#ifndef PREDEFINE_H
#define PREDEFINE_H

#include <QDebug>

#define APP_THEME               "deaufult"

//#define APP_VERSION               "1.20171013.01"
//#define APP_VERSION               "2.20180822.01"
//#define APP_VERSION               "2.20180824.01"
//#define APP_VERSION               "2.20180905.01"
//#define APP_VERSION               "2.2018913.1"
//#define APP_VERSION               "2.2018919.1"
//#define APP_VERSION               "2.20181023.1"
//#define APP_VERSION               "2.20181210.1"
//#define APP_VERSION               "2.2019110.1"
//#define APP_VERSION               "2.2019110.2"
//#define APP_VERSION               "2.2019.225.1"
//#define APP_VERSION               "2.2019.331.1"
//#define APP_VERSION               "2.2019.410.1"
//#define APP_VERSION               "2.2019.422.1"
//#define APP_VERSION               "2.2019.520.1"
//#define APP_VERSION               "2.2019.528.1"
//#define APP_VERSION               "2.2019.729.1"
//#define APP_VERSION               "2.2019.815.1"
//#define APP_VERSION               "2.2019.916.2"
//#define APP_VERSION               "2.2020.26.1"
//#define APP_VERSION               "2.2020.312.1"
//#define APP_VERSION               "2.2020.5.26"
//#define APP_VERSION               "2.2020.6.29"
//#define APP_VERSION               "2.2020.8.10"
//#define APP_VERSION               "2.2020.9.29"
//#define APP_VERSION               "2.2020.10.27"
//#define APP_VERSION               "2.2020.12.18"
//#define APP_VERSION               "2.2021.1.11"
//#define APP_VERSION               "2.2021.2.22"
//#define APP_VERSION               "2.2021.2.26"
//#define APP_VERSION               "2.2021.4.19"
//#define APP_VERSION               "2.2021.5.11"
//#define APP_VERSION               "2.2021.8.12"
//#define APP_VERSION               "2.2021.9.7"
//#define APP_VERSION               "2.2021.9.24"
//#define APP_VERSION               "2.2021.12.20"
//#define APP_VERSION               "2.2022.1.18"
//#define APP_VERSION               "2.2022.8.1"
//#define APP_VERSION               "2.2022.8.18"
//#define APP_VERSION               "2.2022.10.20"
//#define APP_VERSION               "2.2022.11.30"
//#define APP_VERSION               "2.2023.2.23"
//#define APP_VERSION               "2.2023.4.12"
//#define APP_VERSION               "2.2023.6.29"
//#define APP_VERSION               "2.2023.7.24"
// Qt 5.9.1 & VS2015  [2023-09-13] 开始启用新的大版本;
#define APP_VERSION               "2.2024.1.31"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号

#define SERVER_PASSWORD         "posoperator@freemud.cn"
#define TERMINAL_DEF_IP               "*.*.*.*"

#define CONFIG_NAME             "config.ini"
#define USERCONFIG_NAME         "userConfig.ini"

#define UI_CASHIER              "<font color='#ff0000'>未选择</font>"
#define UI_STOREID              "<font color='#ff0000'>未登录</font>"

#define INI_DB_HOST                "DbInfo/host"
#define INI_DB_USERNAME            "DbInfo/username"
#define INI_DB_PASSWORD            "DbInfo/password"
#define INI_DB_DATABASE            "DbInfo/database"
#define INI_DB_PORT                     "DbInfo/port"
#define INI_LOGINSERVER         "FmServer/loginUrl"
#define INI_ORDERSERVER         "FmServer/orderUrl"
#define INI_STORESERVER         "FmServer/storeUrl"
#define INI_DAEMON_PROCESS_MAP_KEY       "FMKeeper/MultiProcessPortExeMap"
#define INI_DAEMON_PROCESS_MAP_VALUE  "24409@C:\\freemud\\fmPluginNew\\fmTakeout.exe"
#define INI_DAEMON_DEFAULT_EXE_KEY        "FMKeeper/DefaultExe"
#define INI_DAEMON_DEFAULT_EXE_VALUE   "C:\\freemud\\fmPluginNew\\fmTakeout.exe"

#define INI_PRINTERNAME         "Printer/name"
#define INI_OMSBTNPOSTION       "OmsBtn/postion"
#define INI_OMSBTNWIDTHOFFSET       "OmsBtn/widthoffset"
#define INI_OMSBTNHEIGHTOFFSET       "OmsBtn/heightoffset"
#define INI_FLOATPOSTION        "Float/postion"
#define INI_FLOATOPACITY        "Float/opacity"
#define INI_BLINKINTERVAL       "Float/blinkInterval"
#define INI_SOUNDINTERVAL       "Float/soundInterval"
#define INI_REENTRY             "Features/reEntry"
#define INI_TCPPORT             "TcpServer/Port"
#define INI_DBSERVERIP          "DbServer/ip"
#define INI_DBSERVERPORT        "DbServer/port"
#define INI_STOREID             "Software/storeid"
#define INI_POSNO               "Software/posno"
#define INI_SUBSTOREID         "Software/substoreid"
#define INI_SUBSTORESKIPVERIFY         "Software/substoreSkipVerify"
#define INI_HURRYPRINTSUM         "Software/hurryPrintSum"
#define INI_NOHURRYRECORDPOS         "Software/noHurryRecordPos"
#define INI_OPEN_TCP_CHANNEL      "Software/openTcpChannel"
#define INI_POSKEYEXISTVERIFY    "Software/poskeyExistVerify"

#define INI_PASSWORD            "Software/password"
#define INI_AUTOCONFIRM         "Software/autoconfirm"
#define INI_PARTNERID           "Software/partnerid"
#define INI_INTERVAL            "Software/interval"
#define INI_HTTPSERVERPORT      "HttpServer/port"
#define INI_PUSHSERVERPORT      "PushServer/port"

#define JSON_REQTYPE            "reqtype"
#define JSON_CURRENTUSER        "currentUser"
#define JSON_STOREID            "storeId"
#define JSON_APPSTORESTS            "appStoreStatus"
#define JSON_ELESTORESTS            "eleStoreStatus"
#define JSON_MODSTORESTS            "modStoreStatus"
#define JSON_MOPSTORESTS            "mopStoreStatus"
#define JSON_MTMODSTORESTS            "mtModStoreStatus"
#define JSON_CURBSIDE_STORESTS            "curbsideStoreStatus"
#define JSON_NOTICE_TITLE            "noticeTitle"
#define JSON_NOTICE_CONTENT            "noticeContent"
#define JSON_SKIPRECORDPOS         "skipRecord"
#define JSON_PASSWORD           "password"
#define JSON_IPADDRESS          "iPAddress"
#define JSON_IP_ADDRESS          "ipAddress"
#define JSON_MACHINECODE        "machineCode"

#define JSON_PARTNERID          "partnerId"
#define JSON_ORGCODE            "orgCode"
#define JSON_SUBORGCODE    "subOrgCode"
#define JSON_POSNO              "posNo"
#define JSON_POS_IP_ADDR              "posIp"
#define JSON_POS_BACKUP_PC        "backup"
#define JSON_POS_WORKS_NUM              "decouplePosNo"
#define JSON_POS_HOST_NAME              "posHostName"
#define JSON_POS_MAC_ADDRESS              "posMacAddress"
#define JSON_STORENAME          "StoreName"
#define JSON_OPEN_TCP_CHANNEL     "openTcpChannel"
#define JSON_USERID             "userId"
#define JSON_USERNAME           "userName"
#define JSON_BUSINESSDATE       "business_date"
#define JSON_STATUSCODE         "statusCode"
#define JSON_LOGINCODE         "code"
#define JSON_ERRCODE            "code"
#define JSON_STATUS             "status"
#define JSON_ORDERSTATUS        "orderStatus"
#define JSON_LOGIN_WITH_CONTAINS_ORDER_DETAIL  "containsOrderDetail"
#define JSON_REFUNDFMID         "refundFmId"
#define JSON_GLOBALORDERTYPE        "globalOrderType"
#define JSON_GLOBALSERVICETYPE        "globalServiceType"
#define JSON_GLOBALREFUNDMETHOD  "refundMethod"
#define JSON_STATUSDESC         "status_desc"
#define JSON_MSG            "msg"
#define JSON_MESSAGE            "message"
#define JSON_ERRMSG             "message"
#define JSON_RECEIVINGSTATUS    "operationStatus"
#define JSON_TIMESTAMPS         "timestamp"
#define JSON_AUTOCONFIRM        "autoconfirm"
#define JSON_TOKEN              "PosToken"
#define JSON_DATA               "data"
#define JSON_POSVERSION         "pos_version"
#define JSON_PLUGINVERSION      "version"
#define JSON_POS_PLUGIN_VERSION         "posVersion"
#define JSON_PLUGINVERSIONCOMMENTS      "versionComments"
#define JSON_SYNCSTORESTATUS    "syncStoreStatus"
#define JSON_ORDERS             "orders"
#define JSON_COUNT              "count"
#define JSON_PRODUCTS           "products"
#define JSON_COUPONS           "coupons"
#define JSON_EXCHANGECOUPONS           "exchangeCoupons"
#define JSON_PAYMENTS           "PaymentObjs"
#define JSON_POS_EXTEND_LIST "posExtendList"
#define JSON_SUBPRODUCTS        "addExtra"
#define JSON_ITEMSDISCOUNT     "itemsDiscount"
#define JSON_COUPONPRODUCTS     "skus"
#define JSON_ID                 "id"
#define JSON_ORDERID            "orderId"
#define JSON_ORDER_ID            "orderId"
#define JSON_BUSINESSID         "businessId"
#define JSON_REASON             "reason"
#define JSON_REASONCODE         "reason_code"
#define JSON_SYNCTIME           "syncTime"
#define JSON_SHOPCODE           "storeId"
#define JSON_STORE_ID           "storeId"
#define JSON_POSIPADDRESS       "posAddress"
#define JSON_CHANNEL            "channel"
#define JSON_CALL_BACK_URL "callBackUrl"
#define JSON_SKIP_PRINT         "skipPrint"
#define JSON_PUSH_OPTIONS   "options"
#define JSON_PUSH_ORDER_DETAIL   "orderDetail"
#define JSON_PUSH_PLUGIN_OPTIONS   "pluginOptions"
#define JSON_PRINT_OPT   "printOpt"
#define JSON_PRINT_OPT_ALL   "all"
#define JSON_PRINT_OPT_SUM   "summary"
#define JSON_PRINT_OPT_CUP   "cup"
#define JSON_PRINT_OPT_SUB   "subscribe"
#define JSON_PRINT_OPT_STR   "street"

#define JSON_BUSINESSSTATUS     "business_status"
#define JSON_CODE               "code"
#define JSON_PAGENUMBER         "pageNo"
#define JSON_PAGESIZE           "pageSize"
#define JSON_DELIVERS           "deliverymans"
#define JSON_DELIVERYID         "deliveryman_id"
#define JSON_DELIVERYNAME       "deliveryman_name"
#define JSON_DELIVERYPHONE      "deliveryman_phone"
#define JSON_ORDER              "order"
#define JSON_SHOPSTATUS         "channels"
#define JSON_SHOPSTATUSDESC     "status_desc"
#define JSON_TOTALNUM           "total_number"
#define JSON_TOTALFEE           "total_fee"
#define JSON_REFUNDTOTALNUM     "refund_number"
#define JSON_REFUNDTOTALFEE     "refund_total_fee"
#define JSON_BILLFEE            "bill_fee"
#define JSON_BILLSTATUS         "bill_status"
#define JSON_BILLTYPE           "bill_type"
#define JSON_SUCCESSNUM         "success_number"
#define JSON_FAILEDNUM          "fail_number"
#define JSON_SUCCESSSUM         "success_total_fee"
#define JSON_FAILEDSUM          "fail_total_fee"
#define JSON_DAILYSUMMARYS      "daily_summarys"

// 消息中心, 保留通告消息 额外天数(在当天基础上 + 1);
#define RETAIN_NOTICE_EXTRA_DAYS   1
#define MINI_STORE_STATUS_FORM_LEFT_OFFSET   100

// PosAgent :  Tcp Socket  Begin;
#define INI_POSAGENTSVR_PORT      "PosAgentSvr/port"
#define INI_POSAGENTSVR_DOMAIN_NAME      "PosAgentSvr/domainName"
#define JSON_TCP_STA_RST     "ok"
#define JSON_TCP_STA_CODE   "code"
#define JSON_TCP_DEVICE_ID   "deviceId"
#define JSON_TCP_DEVICE_HOST_NAME   "deviceHostName"
#define JSON_TCP_DEVICE_WORKS_NUM   "deviceWorkStationNum"
#define JSON_TCP_DEVICE_IP   "deviceIp"
#define JSON_TCP_DEVICE_PORT   "devicePort"
#define JSON_TCP_DEVICE_TYPE   "deviceType"
#define JSON_TCP_DEVICE_VER   "deviceVersion"

#define JSON_TCP_SIGN   "sign"
#define JSON_TCP_INFO   "info"
// 长连接Post请求超时 设置为 30s
#define SOCKET_POST_TIMEOUT 30000
// 长连接Get请求超时 设置为 10s
#define SOCKET_GET_TIMEOUT 10000
// 长连接 向 POS Agent Server 发送心跳时间间隔(单位: 秒);
#define SOCKET_HEARTBEAT_INTERVAL  70
// 建立连接超时时间(单位: 毫秒);
#define SOCKET_CONNECT_TIMEOUT_INTERVAL  20*1000
// 写报文超时时间(单位: 毫秒);
#define SOCKET_WRITE_TIMEOUT_INTERVAL  15*1000

// 启动检查超时时间(单位: 毫秒);
#define SOCKET_START_CHECK_TIMEOUT_INTERVAL  5*1000
// 启动超时时间(单位: 毫秒);
#define SOCKET_START_TIMEOUT_INTERVAL  1*10*1000
// 短超时时间(单位: 毫秒);
#define SOCKET_SHORT_TIMEOUT_INTERVAL  2*30*1000
// 长超时时间(单位: 毫秒);
#define SOCKET_LONG_TIMEOUT_INTERVAL   5*30*1000
// 超长超时时间(单位: 毫秒);
#define SOCKET_SUPER_LONG_TIMEOUT_INTERVAL   10*30*1000

// ssl证书相关宏;
#define DES3_KEY_SIZE					24
#define MAX_RSA_KEY_LEN			2048
#define MAX_AES_KEY_LEN				2048
#define MAX_BUF_LEN					25600
#define MAX_SIGN_LEN				256
// AES密钥(长度: 24个字符) -> 密文的对称加解密时使用: 存储证书文件 & 读取证书文件 时 需要使用到;
#define AES_SECRET_KEY                 "92Q31RL+vH2O62PaCMSwHg=="
// AES密钥偏移量iv (长度: 16个字符)  -> 密文的对称加解密时使用:  存储证书文件 & 读取证书文件 时 需要使用到;
#define AES_SECRET_KEY_IVP                 "lFmQJMG91As8+FPz"

#define GET_V1_STG_CERTIFICATE_URL   "https://posagent.stg.starbucks.net/v1/devices/keys?"
#define GET_V1_PRO_CERTIFICATE_URL   "https://posagent.starbucks.net/v1/devices/keys?"
#define GET_V1_UAT_CERTIFICATE_URL   "https://posagent.uat.starbucks.net/v1/devices/keys?"
#define GET_V1_GRAY_CERTIFICATE_URL   "https://posagent.gray.starbucks.net/v1/devices/keys?"
#define GET_V1_DEV_CERTIFICATE_URL   "https://posagent.dev.starbucks.net/v1/devices/keys?"

#define CONF_VALUE_URL                   "all/url"
#define CONF_VALUE_URL_CRET              "all/creturl"
#define CRET_FILE_NAME				"simphonyclient.p12"
#define JSON_KEY_MAC				"mac"
#define JSON_KEY_SIGN				"sign"
#define JSON_KEY_STATUS		        "statusCode"
#define JSON_KEY_PRIVATE_KEY		"privateKey"
#define JSON_KEY_PUBLIC_KEY		"publicKey"

#define JSON_KEY_SERPBLICKEY		"serverPublicKey"
#define JSON_KEY_CLIENTPRIKEY		"clientPrivateKey"
// Ssl End;

#define MAXPUTTIMES             4

// 订单的操作码
#define OPERATION_GETDELIVERS   "getDelivers"
#define OPERATION_CONFRIM       "confirm"
#define OPERATION_REFUSE        "refuse"
#define OPERATION_SENDOUT       "sendOut"
#define OPERATION_COMPLETE      "complete"
#define OPERATION_REFUND        "refund"
#define OPERATION_REFUSEREFUND  "refuseRefund"
#define OPERATION_REFUNDORDER   "refundOrder"
// 订单操作名
#define OPERATIONNAME_GETDELIVERS   "接单"
#define OPERATIONNAME_REFUSE        "拒单"
#define OPERATIONNAME_SENDOUT       "送出"
#define OPERATIONNAME_COMPLETE      "完成"
#define OPERATIONNAME_REFUSEREFUND  "拒绝"
#define OPERATIONNAME_REFUNDORDER   "退单"

#define TICKET_SUMMARY   "汇总小票"
#define TICKET_CUP   "杯贴小票"
#define TICKET_RESERVE   "预约小票"
#define TICKET_CURBSIDE   "街送小票"
#define TICKET_ALL   "全部小票"

// 定义性别:
#define FM_MALE  "男"
#define FM_FEMALE   "女"

//接口地址
#define INI_INTERFACE_ILOGIN                  "login"
#define INI_INTERFACE_GETSTORESTATE           "getStoreState"
#define INI_INTERFACE_UPDATESTATE             "updateState"
#define INI_INTERFACE_PULLORDER               "pullOrder"
#define INI_INTERFACE_PULLORDERLIST           "pullOrderList"
#define INI_INTERFACE_HEART                   "heart"
#define INI_INTERFACE_REPORTOMSRECORDORDER    "reportOmsRecordOrder"
#define INI_INTERFACE_CONFIRM                 "confirm"
#define INI_INTERFACE_CANCLE                  "cancle"
//#define INI_INTERFACE_REFUND                "refund"  //注释不使用此接口


// 属性名称
#define PROPERTY_ID             "id"            // 人员编号
#define PROPERTY_NAME           "name"          // 人员姓名
#define PROPERTY_PHONE          "phone"         // 人员电话
#define PROPERTY_SHIFTID        "shiftId"       // 班次编号
#define PROPERTY_SHIFTNAME      "shiftName"     // 班次名称

#define MASTER_POS_UNIQUE_ID  "111111111111111"   // 初始主POS 唯一ID;
#define BACKUP_POS_UNIQUE_ID  "222222222222222"   // 备机POS (OnePOS) 唯一ID;
#define DEFAULT_CASHIER_ID  "90001"
#define DEFAULT_CASHIER_NAME  "MICROS"
#define DEFAULT_CASHIER_ID_EMPTY  " "
#define DEFAULT_CASHIER_NAME_EMPTY  " "
#define DEFAULT_WORKSTATION_NUM  "199"


// 悬浮框: 提醒订单的类型
#define REMIND_NEW_ORDER        2   // 新订单: 目前不存在case
#define REMIND_CONFIRMED_ORDER  3   // 已确认的订单(制作中): 最多的case
#define REMIND_SENDOUT_ORDER    4   // 已配送订单:  不应该提示
#define REMIND_FINISHED_ORDER   5   // 已完成订单:  不应该提示
#define REMIND_REFUNDED_ORDER   6   // 已退款订单:  最多且重要的case；
#define REMIND_REQREFUND_ORDER  7   // 请求退单的订单: 目前如果有请求退单；POS会自动发起退单请求，完成退单动作；
#define REMIND_AGRREFUND_ORDER  30
#define REMIND_COMPLAINT_ORDER  12   // 客诉单：最多且重要的case；
#define REMIND_SIM_ORDERLIST_NOEMPTY  50   // Simphony有效队列中存在有订单待录入:就需要闪烁提醒；

// 服务器返回正确值
#define JSON_STATUSCODE_OK      100
// 默认拉取订单的间隔时间
#define VALUE_PULLSYNCTIME      20000
// 默认网络超时时间
#define VALUE_NETTIMEOUT        40000
// 默认尝试加锁网络超时时间
#define VALUE_TRYLOCKNETTIMEOUT  5000
// 尝试加锁程序内部超时时间[500ms]
#define VALUE_TRYLOCKMEMTIMEOUT  500
// 默认重新尝试登录的时间
#define VALUE_RELOGINTIME       20000
// 默认心跳间隔的时间
#define VALUE_SENDHEARTTIME       20000
// 新订单提示音音频时长
#define VALUE_NEWORDERTIME      6000        //TODO
// 需退款提示音音频时长
#define VALUE_REFUNDORDERTIME   10000        //TODO
// 拒绝退款理由
#define VALUE_REFUSEREFUND_REASON  "拒绝退款"
//订单门店营业状态 0:未知；1:开店；2:关店
#define UNKNOWNSTORE 0
#define OPENSTORE    1
#define CLOSESTORE   2

// o2ofulfillment 履约服务 CallBackUrl 地址;
#define GET_O2OFULFILLMENT_STG_CBL   "https://o2ofulfillment.stg.starbucks.net/fulfillment/pos"
#define GET_O2OFULFILLMENT_PRO_CBL   "https://o2ofulfillment.starbucks.net/fulfillment/pos"
#define GET_O2OFULFILLMENT_UAT_CBL   "https://o2ofulfillment.uat.starbucks.net/fulfillment/pos"
#define GET_O2OFULFILLMENT_DEV_CBL   "https://o2ofulfillment.dev.starbucks.net/fulfillment/pos"
#define GET_O2OFULFILLMENT_GRAY_CBL   "https://o2ofulfillment.gray.starbucks.net/fulfillment/pos"


#endif // PREDEFINE_H
