Browse Source

1、更新Readme.txt
2、更新用例代码;

scbc.sat2 5 years ago
parent
commit
1bf9258637
2 changed files with 9 additions and 4 deletions
  1. 1 1
      scbc.tools/test/ReadMe.txt
  2. 8 3
      scbc.tools/test/test.cpp

+ 1 - 1
scbc.tools/test/ReadMe.txt

@@ -112,7 +112,7 @@ Windows:xp sp3
 
 
 8、extern SCBCTOOLS_API int BatchReportKeyCopyResults();
-描述:批量上报抄写结果。从数据库查询出1000条未上报的sn进行上报;
+描述:批量上报抄写结果。从数据库查询出200条未上报的sn进行上报;
 参数:无;
 返回:
 	0=表示在数据库中查询不到未上报的sn抄写信息,或者所有sn未抄写成功;

+ 8 - 3
scbc.tools/test/test.cpp

@@ -37,7 +37,8 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
 			return -1;
 		}
 
-		int i = 10000;
+		// 测试1千次;
+		int i = 1000;
 		while(i--){
 			printf("\n\n******************No.%ld******************\n", i);
 			// 1、查询订单是否已下载成功;
@@ -83,6 +84,7 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
 				printf("UpdateKeyCopyStatus:%d\n", nRet);
 			}
 
+			//Sleep(6000);
 			// 5、单个sn抄写结果上报;
 			nRet = ReportKeyCopyResults(sn.c_str());
 			printf("ReportKeyCopyResults:%d, %s\n", nRet, nRet == 1 ? "上报成功" : "上报失败");
@@ -93,17 +95,20 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
 			}
 
 			// 6、1000个sn抄写结果上报;
-			nRet = BatchReportKeyCopyResults();
-			printf("BatchReportKeyCopyResults:%d, %s\n", nRet, nRet == 1 ? "上报成功" : "上报失败");
+			while((nRet = BatchReportKeyCopyResults()) == 1)
+				printf("BatchReportKeyCopyResults:%d, %s\n", nRet, nRet == 1 ? "上报成功" : "上报失败");
 
 			// 7、查询应下载sn数量、实际下载sn数据、抄写成功sn数量、上报成功sn数量;
 			BidInfo binfo;
 			nRet = QueryBidInfo(bid.c_str(), binfo);
 			printf("QueryBidInfo:%d\n", nRet, nRet == 1 ? "查询成功": "查询失败");
 
+			printf("15秒后,开始删除订单信息\n");
+			Sleep(15000);
 			// 8、删除批次相关表数据(全部表数量)
 			nRet = RemoveBidData(bid.c_str());
 			printf("RemoveBidData:%d\n", nRet);
+			printf("删除订单信息成功\n");
 		}
 	}