#ifndef GLOBAL
#define GLOBAL

#define EXE_ROLLBACK                    "rollback.dll"

#define MAX_BUF_LEN                     25600
#define MAX_CHILED_LEN                  256
#define MAX_PRINT_LEN                   12800

#define PRINT_FILE_PATH                 "C:/Freemud/fmClient/Prints/"
#define PRINT_ENDDAY_FILE_NAME          "EndDayPrint.txt"
#define PRINT_SHIFT_FILE_NAME           "ShiftPrint.txt"
#define PRINT_AGAIN_FILE_NAME           "AgainPrint.txt"
#define PRINT_FILE_NAME                 "print.txt"

#define ENCODE_FIRST                    "encode/first"
#define ENCODE_END                      "encode/end"

#define JSON_KEY_VER                    "ver"
#define JSON_KEY_DLLVER               "dllVersion"
#define JSON_KEY_SERVER_URL          "serverUrl"
#define JSON_KEY_REQTYPE                "reqType"
#define JSON_KEY_PARTNERID              "partnerId"
#define JSON_KEY_STOREID                "storeId"
#define JSON_KEY_STATIONID              "stationId"
#define JSON_KEY_OPERATORID             "operatorId"
#define JSON_KEY_TRANSID                "transId"
#define JSON_KEY_REFUNDID               "refundId"
#define JSON_KEY_BUSINESSDATE           "businessDate"
#define JSON_KEY_CODE                   "code"
#define JSON_KEY_FMID                   "fmId"
#define JSON_KEY_TRANSAMOUNT            "transAmount"
#define JSON_KEY_REFUNDAMOUT            "refundAmount"
#define JSON_KEY_ENDTIME                "endTime"
#define JSON_KEY_TRANSTIME              "transTime"
#define JSON_KEY_STATE                  "state"
#define JSON_KEY_STATEMSG               "stateMsg"
#define JSON_KEY_METHCODE               "paymentMethodCode"

//response
#define JSON_KEY_MESSAGE                "message"
#define JSON_KEY_STATUSCODE             "statusCode"
#define JSON_KEY_PAYACCOUNT             "payAccount"
#define JSON_KEY_PAYTRANSID             "payTransId"
#define JSON_KEY_TYPE                   "type"
#define JSON_KEY_CODE                   "code"
#define JSON_KEY_FMID                   "fmId"
#define JSON_KEY_EXT                    "ext"
#define JSON_KEYT_STATE                 "state"
#define JSON_KEY_PRINT                  "print"
#define JSON_KEY_PRINTACTION            "printAction"
#define JSON_KEY_PRINTPATH              "path"
#define JSON_KET_CLIENTREF              "cAlientrefundamount"

#define JSON_KEY_PAYMENTMETHOD          "paymentMethod"
#define JSON_KEY_PAYMENTMETHODCODE      "paymentMethodCode"
#define JSON_KEY_TRANSAMOUNT            "transAmount"
#define JSON_KEY_MERDISCOUNT            "merchantDiscount"
#define JSON_KEY_PLTDISCOUNT            "platformDiscount"
#define JSON_KEY_UNAMOUNT               "undiscountAmount"
#define JSON_KEY_PARTORDERID            "partnerOrderId"

//array products
#define JSON_KEY_PRODUCTS               "products"
#define JSON_KEY_PRODUCTS_CONSUMENUM    "consumeNum"
#define JSON_KEY_PRODUCTS_PID           "pid"
#define JSON_KEY_PRODUCTS_NAME          "name"
#define JSON_KEY_PRODUCTS_SALESTYPE     "salesType"
#define JSON_KEY_PRODUCTS_PRICE         "price"
#define JSON_KEY_TOTALNUM               "totalNum"
#define JSON_KEY_TOTALAMOUNT            "totalAmount"
#define JSON_KEY_QUERYINFO              "queryInfo"
#define JSON_KEY_PAGENUM                "pageNum"
#define JSON_KEY_PAGESIZE               "pageSize"
#define JSON_KEY_BEGINTIME              "beginTime"
#define JSON_KEY_ENDTIME                "endTime"
#define JSON_KEY_POSTYPE               "posType"
#define JSON_KEY_AUTHCODE               "authCode"
#define JSON_KEY_SALENO                 "saleNo"

#define DEFAULT_JSON_VER_VALUE          3
#define DEFAULT_JSON_PRODUCTS_NORMAL    "NORMAL"
#define DEFAULT_JSON_PRODUCTS_FREE      "FREE"

#define JSON_REQTYPE_PAY                72
#define JSON_REQTYPE_REFUND             62
#define JSON_REQTYPE_ENDDAY             82
#define JSON_REQTYPE_PRINTER            85
#define JSON_REQTYPE_FIND               2

typedef enum
{
    SIGN,        // 签到 - 0
    MANAGE,   // 管理 - 1
    PAY,         // 支付 - 2
    REFUND,     // 退货 - 3
    FINDS,       // 交易查询 - 4
    ENDDAY,    // 日结单打印 - 5
    SHIFT,         // 打印交接班 - 6  [已淘汰,不使用]
    AGAIN_PRINT,  // 重新打印 - 7
    EC_SIGN = 350,     // 签到 - 350  =  350-350 = 0 对应上面 "签到"
    EC_FINDS = 354,   // 查询  - 354  =  354-350 = 4 对应上面 "交易查询"

} ReqType;


#endif // GLOBAL
