|
@@ -519,7 +519,7 @@ namespace Test
|
|
|
}
|
|
|
if (findflag)
|
|
|
{
|
|
|
- return "名称:" + v_id + "\r\n" + "价格:" + v_res_id + "\r\n";
|
|
|
+ return "name:" + v_id + "," + "price:" + v_res_id + "\r\n";
|
|
|
}
|
|
|
else return "";
|
|
|
|
|
@@ -546,21 +546,38 @@ namespace Test
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
+ bool start_cnt = false;
|
|
|
+ string list_str="";
|
|
|
public void str_check(string str)
|
|
|
{
|
|
|
string finddata = "";
|
|
|
|
|
|
if (str.Contains("esp_send:") == true)//下位机的数据流
|
|
|
{
|
|
|
- if (str.Contains("find:") == true)//查询数据库
|
|
|
+ if (str.Contains("start_cnt:") == true)//开始记账
|
|
|
+ {
|
|
|
+ start_cnt = true;
|
|
|
+ }
|
|
|
+ if (str.Contains("stop_cnt:") == true)//开始记账
|
|
|
+ {
|
|
|
+ start_cnt = false;
|
|
|
+ }
|
|
|
+ else if (str.Contains("find:") == true)//查询数据库
|
|
|
{
|
|
|
string findStr = user_SubstringEx(str,"find:","\r\n");
|
|
|
if (findStr != "")
|
|
|
{
|
|
|
Console.WriteLine(findStr);
|
|
|
finddata = GetProductType("序列号", findStr);//数据库中查询
|
|
|
- SendMsgdata(finddata);
|
|
|
+ if(finddata!="")
|
|
|
+ {
|
|
|
+ SendMsgdata(finddata);
|
|
|
+ }
|
|
|
+ if (start_cnt)
|
|
|
+ {
|
|
|
+ // list_str +=
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|