#ifndef PREDEFINE_H
#define PREDEFINE_H

#include <QDebug>

#define APP_THEME               "deaufult"

//#define APP_VERSION               "4.2019.1225.1"
//#define APP_VERSION               "4.2020.318.1"
//#define APP_VERSION               "4.2020.423.1"
//#define APP_VERSION               "4.2020.520.1"
//#define APP_VERSION               "4.2020.526.1"
//#define APP_VERSION               "4.2020.6.29"
//#define APP_VERSION               "4.2020.6.30"
//#define APP_VERSION               "4.2020.8.10"
//#define APP_VERSION               "4.2021.1.8"
//#define APP_VERSION               "4.2021.5.10"
//#define APP_VERSION               "4.2021.12.10"
//#define APP_VERSION               "4.2022.3.3"
//#define APP_VERSION               "4.2022.4.11"
//#define APP_VERSION               "4.2022.4.28"
//#define APP_VERSION               "4.2022.8.1"
//#define APP_VERSION               "4.2023.2.23"
#define APP_VERSION               "4.2023.4.12"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号

#define SERVER_PASSWORD         "posoperator@freemud.cn"

#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_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_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_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_PMSMACHINENO        "pmsMachineNo"

#define JSON_PARTNERID          "partnerId"
#define JSON_ORGCODE            "orgCode"
#define JSON_POSNO              "posNo"
#define JSON_POS_IP_ADDR              "posIp"
#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_ORDERCOUNT        "orderCount"
#define JSON_REFUNDFMID         "refundFmId"
#define JSON_GLOBALORDERTYPE        "globalOrderType"
#define JSON_GLOBALSERVICETYPE        "globalServiceType"
#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_PCS_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_PAYMENTS           "PaymentObjs"
#define JSON_SUBPRODUCTS        "addExtra"
#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_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_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"


// 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  80

// 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 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 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       10000
// 默认心跳间隔的时间
#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
