This commit is contained in:
psh
2024-06-03 14:04:08 +08:00
parent 85d2082d89
commit d266c99fb4

View File

@@ -187,7 +187,7 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
this.writing("x6", 0); this.writing("x6", 0);
this.writing("x8", 0); this.writing("x8", 0);
} else if (x1 != last_x1 && x1 == 1 &&!in ) { } else if (x1 != last_x1 && x1 == 1 &&!in ) {
in = true; in = false;
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String device_code = this.devicecode + "DJW01"; String device_code = this.devicecode + "DJW01";
jsonObject.put("device_code", device_code); jsonObject.put("device_code", device_code);
@@ -198,7 +198,7 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
JSONObject res_jo = JSONObject.parseObject(result); JSONObject res_jo = JSONObject.parseObject(result);
if (res_jo.getString("status").equals("200")){ if (res_jo.getString("status").equals("200")){
this.writing("x6", 1); this.writing("x6", 1);
in=false; in=true;
} }
} }
@@ -207,18 +207,19 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
this.writing("x5", 0); this.writing("x5", 0);
this.writing("x7", 0); this.writing("x7", 0);
} else if (x2 != last_x2 && x2 == 1 && !out) { } else if (x2 != last_x2 && x2 == 1 && !out) {
out = true; out = false;
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
String device_code = this.devicecode + "DJW02"; String device_code = this.devicecode + "DJW02";
jsonObject.put("device_code", device_code); jsonObject.put("device_code", device_code);
jsonObject.put("requestDate", new Date()); jsonObject.put("requestDate", new Date());
jsonObject.put("vehicle_type",2);
jsonObject.put("requestNo", IdUtil.simpleUUID()); jsonObject.put("requestNo", IdUtil.simpleUUID());
jsonObject.put("request_method_code", "TBXQKTask"); jsonObject.put("request_method_code", "TBXQKTask");
String result=acsToWmsService.applyTaskToWms(jsonObject); String result=acsToWmsService.applyTaskToWms(jsonObject);
JSONObject res_jo = JSONObject.parseObject(result); JSONObject res_jo = JSONObject.parseObject(result);
if (res_jo.getString("status").equals("200")){ if (res_jo.getString("status").equals("200")){
this.writing("x5", 1); this.writing("x5", 1);
out=false; out = true;
} }
} }