#ifndef PREDEFINE_H
#define PREDEFINE_H

#include <QDebug>

#define APP_THEME               "deaufult"

#define APP_VERSION             "1.20171013.01"
#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_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_PASSWORD           "password"
#define JSON_IPADDRESS          "iPAddress"
#define JSON_MACHINECODE        "machineCode"
#define JSON_PARTNERID          "partnerId"
#define JSON_ORGCODE            "orgCode"
#define JSON_POSNO              "posNo"
#define JSON_STORENAME          "StoreName"
#define JSON_USERID             "userId"
#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_STATUSDESC         "status_desc"
#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_ORDERS             "orders"
#define JSON_COUNT              "count"
#define JSON_PRODUCTS           "products"
#define JSON_SUBPRODUCTS        "addExtra"
#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_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"


#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_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 JSON_STATUSCODE_OK      100
// 默认拉取订单的间隔时间
#define VALUE_PULLSYNCTIME      20000
// 默认网络超时时间
#define VALUE_NETTIMEOUT        20000
// 默认重新尝试登录的时间
#define VALUE_RELOGINTIME       20000
// 默认心跳间隔的时间
#define VALUE_SENDHEARTTIME       20000
// 新订单提示音音频时长
#define VALUE_NEWORDERTIME      6000        //TODO
// 需退款提示音音频时长
#define VALUE_REFUNDORDERTIME   5000        //TODO
// 拒绝退款理由
#define VALUE_REFUSEREFUND_REASON  "拒绝退款"

#endif // PREDEFINE_H
