Commit 8c95cb60 by 李定达

1.增加如下类型冲正并测试(91,93,96,98, 101, 103)

parent cef151d2
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
*.pdb *.pdb
*.obj *.obj
Debug/log/ Debug/log/
*.zip
*.sdf *.sdf
*.opensdf *.opensdf
*.user *.user
......
No preview for this file type
...@@ -329,7 +329,7 @@ int ProcessPosReqData(const char *indata, string &in, int *needrbk, int *reqType ...@@ -329,7 +329,7 @@ int ProcessPosReqData(const char *indata, string &in, int *needrbk, int *reqType
type = (int)json_integer_value(reqtype); type = (int)json_integer_value(reqtype);
*reqType_i = type; *reqType_i = type;
if(type == 72 || type == 62 || type == 71) if(type == 72 || type == 62 || type == 71 || type == 90 || type == 92 || type == 95 || type == 97 || type == 100 || type == 102)
*needrbk = 1; *needrbk = 1;
if(type == 71 || type == 3) if(type == 71 || type == 3)
...@@ -509,18 +509,73 @@ int SaveRollBackFile(const string text) ...@@ -509,18 +509,73 @@ int SaveRollBackFile(const string text)
int type = json_integer_value(reqType); int type = json_integer_value(reqType);
if(type == 62) switch (type)
{ {
json_integer_set(reqType, (json_int_t)83); case 62 :
}else if(type == 71 || type == 72) json_integer_set(reqType, (json_int_t)83);
{ break;
json_integer_set(reqType, (json_int_t)3); case 71 :
}else json_integer_set(reqType, (json_int_t)3);
{ break;
json_decref(root); case 72 :
return 1; json_integer_set(reqType, (json_int_t)3);
break;
case 90 :
json_integer_set(reqType, (json_int_t)91);
break;
case 92 :
json_integer_set(reqType, (json_int_t)93 );
break;
case 95 :
json_integer_set(reqType, (json_int_t)96);
break;
case 97 :
json_integer_set(reqType, (json_int_t)98);
break;
case 100 :
json_integer_set(reqType, (json_int_t)101);
break;
case 102 :
json_integer_set(reqType, (json_int_t)103);
break;
default:
json_decref(root);
return 1;
} }
//if(type == 62)
//{
// json_integer_set(reqType, (json_int_t)83);
//}else if (type == 90)
//{
// json_integer_set(reqType, (json_int_t)91);
//}else if (type == 92)
//{
// json_integer_set(reqType, (json_int_t)93);
//}else if (type == 95)
//{
// json_integer_set(reqType, (json_int_t)96);
//}else if (type == 97)
//{
// json_integer_set(reqType, (json_int_t)98);
//}
//else if (type == 100)
//{
// json_integer_set(reqType, (json_int_t)101);
//}
//else if (type == 102)
//{
// json_integer_set(reqType, (json_int_t)101);
//}
//else if(type == 71 || type == 72)
//{
// json_integer_set(reqType, (json_int_t)3);
//}else
//{
// json_decref(root);
// return 1;
//}
char* json = json_dumps(root, JSON_COMPACT | JSON_SORT_KEYS); char* json = json_dumps(root, JSON_COMPACT | JSON_SORT_KEYS);
strcpy_s(inmsg, MAX_BUF_LEN, json); strcpy_s(inmsg, MAX_BUF_LEN, json);
...@@ -1091,8 +1146,8 @@ void testinitclient() ...@@ -1091,8 +1146,8 @@ void testinitclient()
//char a[] = "{\"ver\":1,\"partnerId\":1234,\"reqType\": 62,\"coupon\": \"122222222222\",\"stationId\": \"1\",\"storeId\": \"999999\",\"operator_id\": \"00000002\" }"; //char a[] = "{\"ver\":1,\"partnerId\":1234,\"reqType\": 62,\"coupon\": \"122222222222\",\"stationId\": \"1\",\"storeId\": \"999999\",\"operator_id\": \"00000002\" }";
//char a[] = "{\r\n \"pay_transId\":\"2017052600001162504297\",\r\n \"total_amount\":1,\r\n \"mcoupon_amount\":0,\r\n \"alipay_amount\":1,\r\n \"pay_ebcode\":\"10010\",\r\n \"ver\":1,\r\n \"fmId\":\"SXA1377O27012186844\",\r\n \"pay_date\":\"2017-05-26 17:01:16.004\",\r\n \"statusCode\":100\r\n}"; //char a[] = "{\r\n \"pay_transId\":\"2017052600001162504297\",\r\n \"total_amount\":1,\r\n \"mcoupon_amount\":0,\r\n \"alipay_amount\":1,\r\n \"pay_ebcode\":\"10010\",\r\n \"ver\":1,\r\n \"fmId\":\"SXA1377O27012186844\",\r\n \"pay_date\":\"2017-05-26 17:01:16.004\",\r\n \"statusCode\":100\r\n}";
//char a[] = "{\"businessDate\":\"20170526\",\"code\":\"7310180009462033\",\"operatorId\":\"90001\",\"partnerId\":1443,\"products\":[{\"consume_num\":1,\"discount\":0,\"name\":\"Coffee\",\"number\":0,\"payment\":null,\"pid\":\"3488\",\"price\":3100,\"priceAct\":0,\"salesType\":\"Normal\",\"scope\":null}],\"promotionTag\":null,\"reqType\":71,\"stationId\":\"3\",\"storeId\":\"1713\",\"transAmount\":3100,\"transId\":\"6460\",\"undiscountAmount\":0,\"ver\":1}"; //char a[] = "{\"businessDate\":\"20170526\",\"code\":\"7310180009462033\",\"operatorId\":\"90001\",\"partnerId\":1443,\"products\":[{\"consume_num\":1,\"discount\":0,\"name\":\"Coffee\",\"number\":0,\"payment\":null,\"pid\":\"3488\",\"price\":3100,\"priceAct\":0,\"salesType\":\"Normal\",\"scope\":null}],\"promotionTag\":null,\"reqType\":71,\"stationId\":\"3\",\"storeId\":\"1713\",\"transAmount\":3100,\"transId\":\"6460\",\"undiscountAmount\":0,\"ver\":1}";
char a[] = "{\r\n \"ver\": 1,\r\n \"reqType\": 0,\r\n \"partnerId\": 1443,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"12344\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"adadadada\"\r\n}"; //char a[] = "{\r\n \"ver\": 1,\r\n \"reqType\": 71,\r\n \"partnerId\": 1443,\r\n \"stationId\": \"1\",\r\n \"storeId\": \"12344\",\r\n \"operatorId\": \"9\",\r\n \"code\": \"adadadada\"\r\n}";
//char a[] = "{\r\n \"businessDate\": \"20170601\",\r\n \"code\": \"7310188850000277\",\r\n \"operatorId\": \"90001\",\r\n \"partnerId\": 1443,\r\n \"partnerOrderId\": \"1443171223323\",\r\n \"products\": [\r\n {\r\n \"consume_num\": 1,\r\n \"discount\": 0,\r\n \"name\": \"Coffee\",\r\n \"number\": 0,\r\n \"payment\": null,\r\n \"pid\": \"3488\",\r\n \"price\": 3100,\r\n \"priceAct\": 0,\r\n \"salesType\": \"Normal\",\r\n \"scope\": null\r\n }\r\n ],\r\n \"promotionTag\": null,\r\n \"reqType\": 72,\r\n \"stationId\": \"9\",\r\n \"storeId\": \"12344\",\r\n \"transAmount\": 29,\r\n \"transId\": 1,\r\n \"undiscountAmount\": 0,\r\n \"ver\": 1\r\n}"; char a[] = "{\r\n \"businessDate\": \"20170601\",\r\n \"code\": \"7310188850000277\",\r\n \"operatorId\": \"90001\",\r\n \"partnerId\": 1443,\r\n \"partnerOrderId\": \"1443171223323\",\r\n \"products\": [\r\n {\r\n \"consume_num\": 1,\r\n \"discount\": 0,\r\n \"name\": \"Coffee\",\r\n \"number\": 0,\r\n \"payment\": null,\r\n \"pid\": \"3488\",\r\n \"price\": 3100,\r\n \"priceAct\": 0,\r\n \"salesType\": \"Normal\",\r\n \"scope\": null\r\n }\r\n ],\r\n \"promotionTag\": null,\r\n \"reqType\": 102,\r\n \"stationId\": \"9\",\r\n \"storeId\": \"12344\",\r\n \"transAmount\": 29,\r\n \"transId\": \"1\",\r\n \"undiscountAmount\": 0,\r\n \"ver\": 1\r\n}";
void testCheckRollbackData() void testCheckRollbackData()
{ {
InitClient(); InitClient();
...@@ -1119,11 +1174,11 @@ int main() ...@@ -1119,11 +1174,11 @@ int main()
char b[MAX_BUF_LEN]; char b[MAX_BUF_LEN];
char c[MAX_BUF_LEN] = { 0 }; //char c[MAX_BUF_LEN] = { 0 };
strcpy(c, TEST_CG); //strcpy(c, TEST_CG);
LOG() << c; //LOG() << c;
//TestRETDES(); //TestRETDES();
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment