Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -32,6 +32,7 @@ public class AgvWaitUtil {
|
|||||||
AcsToWmsService acsToWmsService;
|
AcsToWmsService acsToWmsService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
InstructionService instructionService;
|
InstructionService instructionService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class XianGongAgvController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XianGongAgvService xianGongAgentService;
|
private XianGongAgvService xianGongAgentService;
|
||||||
|
|
||||||
@PostMapping("/waitPointRequest")
|
@PostMapping("/api/agv/xg/waitPointRequest")
|
||||||
@Log("仙工AGV请求取放货")
|
@Log("仙工AGV请求取放货")
|
||||||
public ResponseEntity<JSONObject> xgAGVWaitPointRequest(@RequestBody JSONObject requestParam) {
|
public ResponseEntity<JSONObject> xgAGVWaitPointRequest(@RequestBody JSONObject requestParam) {
|
||||||
return new ResponseEntity<>(xianGongAgentService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK);
|
return new ResponseEntity<>(xianGongAgentService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK);
|
||||||
|
|||||||
@@ -307,11 +307,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() > 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||||
}
|
}
|
||||||
@@ -478,11 +478,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||||
}
|
}
|
||||||
@@ -617,11 +617,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||||
}
|
}
|
||||||
@@ -792,10 +792,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 0) {
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), ikey);
|
||||||
}
|
}
|
||||||
@@ -909,11 +910,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||||
}
|
}
|
||||||
@@ -1107,11 +1108,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
|
paperTubePickSiteDeviceDriver.setFlag(3);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction()
|
||||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||||
}
|
}
|
||||||
@@ -1237,7 +1239,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() == 0) {
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
@@ -1369,7 +1372,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (paperTubePickSiteDeviceDriver.getMove() > 0) {
|
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||||
|
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||||
|
|||||||
@@ -814,7 +814,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
jo.put("device_name", this.getDevice().getDevice_name());
|
jo.put("device_name", this.getDevice().getDevice_name());
|
||||||
jo.put("mode", mode);
|
jo.put("mode", mode);
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
if (this.getMove() == 0) {
|
if (this.getMove() == 0) {
|
||||||
move = LangProcess.msg("universal_no");
|
move = LangProcess.msg("universal_no");
|
||||||
jo.put("hasGoods", false);
|
jo.put("hasGoods", false);
|
||||||
|
|||||||
@@ -381,7 +381,6 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", this.getError());
|
jo.put("error", this.getError());
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
map.put("hand_barcode", hand_barcode);
|
map.put("hand_barcode", hand_barcode);
|
||||||
map.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
|
map.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
|
||||||
map.put("is_click", true);
|
map.put("is_click", true);
|
||||||
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
map.put("requireSucess", requireSucess);
|
map.put("requireSucess", requireSucess);
|
||||||
map.put("driver_type", "siemens_conveyor");
|
map.put("driver_type", "siemens_conveyor");
|
||||||
map.put("message", LangProcess.msg(message));
|
map.put("message", LangProcess.msg(message));
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
jo.put("inst_message", this.inst_message);
|
jo.put("inst_message", this.inst_message);
|
||||||
jo.put("last_inst_message", this.last_inst_message);
|
jo.put("last_inst_message", this.last_inst_message);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("hand_barcode", hand_barcode);
|
jo.put("hand_barcode", hand_barcode);
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
this.require_apply_strangulation_time = date;
|
this.require_apply_strangulation_time = date;
|
||||||
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) {
|
if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) {
|
||||||
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11");
|
message = "one_message11";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
@@ -404,7 +404,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
//
|
//
|
||||||
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (StrUtil.isEmpty(inst.getVehicle_code())) {
|
if (StrUtil.isEmpty(inst.getVehicle_code())) {
|
||||||
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11");
|
message = "one_message11";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
@@ -698,7 +698,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
|||||||
jo.put("inst_message", this.inst_message);
|
jo.put("inst_message", this.inst_message);
|
||||||
jo.put("last_inst_message", this.last_inst_message);
|
jo.put("last_inst_message", this.last_inst_message);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("hand_barcode", hand_barcode);
|
jo.put("hand_barcode", hand_barcode);
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||||
|
|||||||
@@ -787,12 +787,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
map3.put("code", "to_container_type");
|
map3.put("code", "to_container_type");
|
||||||
map3.put("value", containerType);
|
map3.put("value", containerType);
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
|
|
||||||
|
this.writing(list);
|
||||||
|
List list2 = new ArrayList();
|
||||||
Map map4 = new HashMap();
|
Map map4 = new HashMap();
|
||||||
map4.put("code", "to_command");
|
map4.put("code", "to_command");
|
||||||
map4.put("value", "1");
|
map4.put("value", "1");
|
||||||
list.add(map4);
|
list2.add(map4);
|
||||||
|
this.writing(list2);
|
||||||
this.writing(list);
|
|
||||||
led_message = getLedMessage(instdto);
|
led_message = getLedMessage(instdto);
|
||||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||||
String device = null;
|
String device = null;
|
||||||
@@ -973,7 +975,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
jo.put("action", action);
|
jo.put("action", action);
|
||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
jo.put("inst_message", this.inst_message);
|
jo.put("inst_message", this.inst_message);
|
||||||
jo.put("last_inst_message", this.last_inst_message);
|
jo.put("last_inst_message", this.last_inst_message);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("hand_barcode", hand_barcode);
|
jo.put("hand_barcode", hand_barcode);
|
||||||
|
|||||||
@@ -427,7 +427,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
notCreateInstMessage = e.getMessage();
|
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||||
|
|||||||
@@ -382,7 +382,6 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
notCreateInstMessage = e.getMessage();
|
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||||
|
|||||||
@@ -400,7 +400,6 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
notCreateInstMessage = e.getMessage();
|
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
|||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
var17.printStackTrace();
|
var17.printStackTrace();
|
||||||
feedMessage = var17.getMessage();
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -430,7 +429,6 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
notCreateInstMessage = e.getMessage();
|
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code + "创建指令时出现异常:" + e.getMessage())
|
.content(device_code + "创建指令时出现异常:" + e.getMessage())
|
||||||
|
|||||||
@@ -271,7 +271,11 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
|||||||
map.put("to_target", address);
|
map.put("to_target", address);
|
||||||
map.put("to_sub_volume_no", material_code);
|
map.put("to_sub_volume_no", material_code);
|
||||||
map.put("to_command", "1");
|
map.put("to_command", "1");
|
||||||
map.put("to_is_labeling",StrUtil.isNotEmpty(to_is_labeling)?"0":"1");
|
if (StrUtil.equals("1",to_is_labeling)){
|
||||||
|
map.put("to_is_labeling","1");
|
||||||
|
}else {
|
||||||
|
map.put("to_is_labeling","0");
|
||||||
|
}
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
||||||
message = "申请行架任务成功";
|
message = "申请行架任务成功";
|
||||||
|
|||||||
@@ -432,7 +432,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
message = "one_message1";
|
message = "one_message1";
|
||||||
if (updateCommand("4")) break;
|
|
||||||
Instruction instruction1 = checkInst();
|
Instruction instruction1 = checkInst();
|
||||||
String next_device_code1 = instruction1.getNext_device_code();
|
String next_device_code1 = instruction1.getNext_device_code();
|
||||||
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
|
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
|
||||||
@@ -456,7 +455,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
message = "universal_releasing_completed";
|
message = "universal_releasing_completed";
|
||||||
if (updateCommand("11")) break;
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
List list5 = new ArrayList();
|
List list5 = new ArrayList();
|
||||||
map.put("code", "to_command");
|
map.put("code", "to_command");
|
||||||
|
|||||||
@@ -569,7 +569,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
|||||||
notCreateInstMessage = "";
|
notCreateInstMessage = "";
|
||||||
notCreateTaskMessage = "";
|
notCreateTaskMessage = "";
|
||||||
} else {
|
} else {
|
||||||
notCreateInstMessage = "universal_notCreateInstMessage";
|
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -690,7 +690,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
|||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
jo.put("message", LangProcess.msg(message));
|
||||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||||
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
|
jo.put("notCreateInstMessage",notCreateInstMessage);
|
||||||
jo.put("feedMessage", LangProcess.msg(feedMessage));
|
jo.put("feedMessage", LangProcess.msg(feedMessage));
|
||||||
jo.put("driver_type", "siemens_conveyor");
|
jo.put("driver_type", "siemens_conveyor");
|
||||||
jo.put("is_click", true);
|
jo.put("is_click", true);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.acs.device_driver.two_conveyor.blanking_button;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -35,10 +36,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
|
|||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
/**
|
/**
|
||||||
* @author : TuQiang
|
* @author : TuQiang
|
||||||
* @date : 2024/3/14
|
* @date : 2024/3/14
|
||||||
@@ -102,7 +100,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
|
|
||||||
|
|
||||||
String deviceCode;
|
String device_code;
|
||||||
|
|
||||||
String message = null;
|
String message = null;
|
||||||
|
|
||||||
@@ -118,7 +116,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
|
||||||
deviceCode = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||||
mode = this.itemProtocol.getItem_mode();
|
mode = this.itemProtocol.getItem_mode();
|
||||||
move = this.itemProtocol.getItem_move();
|
move = this.itemProtocol.getItem_move();
|
||||||
@@ -156,22 +154,31 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
case 3:
|
case 3:
|
||||||
log.debug("运行中");
|
log.debug("运行中");
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 10:
|
||||||
// 表处下满料请求
|
// 表处下满料请求
|
||||||
if (!requireSucess) {
|
if (!requireSucess) {
|
||||||
applyTakeFullVolume();
|
boolean b = applyTake();
|
||||||
}
|
if (b) {
|
||||||
break;
|
requireSucess = true;
|
||||||
case 10:
|
}
|
||||||
//表处上空轴请求
|
|
||||||
if (!requireSucess) {
|
|
||||||
applyTakeEmptyShaft();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
|
//表处上空轴请求
|
||||||
|
if (!requireSucess) {
|
||||||
|
boolean b = applyTake();
|
||||||
|
if (b) {
|
||||||
|
requireSucess = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
// 取消任务
|
// 取消任务
|
||||||
if (!requireSucess) {
|
if (!requireSucess) {
|
||||||
cancelTask();
|
boolean b = applyTake();
|
||||||
|
if (b) {
|
||||||
|
requireSucess = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -184,110 +191,70 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
lastMove = move;
|
lastMove = move;
|
||||||
lastAction = action;
|
lastAction = action;
|
||||||
lastError = error;
|
lastError = error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 表处下满料请求
|
private boolean applyTake() {
|
||||||
*/
|
|
||||||
public synchronized void applyTakeFullVolume() {
|
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.instructionRequireTime.getTime()
|
if (date.getTime() - this.instructionRequireTime.getTime()
|
||||||
< (long) this.instructionRequireTimeOut) {
|
< (long) this.instructionRequireTimeOut) {
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut);
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut);
|
||||||
return;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.instructionRequireTime = date;
|
JSONObject jo = new JSONObject();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
jo.put("device_code", this.getDevice_code());
|
||||||
message = "two_message5";
|
if (this.mode==9) {
|
||||||
BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest();
|
jo.put("type",CommonFinalParam.TYPE_ONE);
|
||||||
blankingButtonRequest.setDevice_code(deviceCode);
|
}
|
||||||
blankingButtonRequest.setType(CommonFinalParam.TYPE_ONE);
|
if (this.mode==10) {
|
||||||
BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest);
|
jo.put("type",CommonFinalParam.TYPE_TWO);
|
||||||
if (ObjectUtil.isEmpty(response)) {
|
}
|
||||||
message = "two_message6";
|
if (this.mode==11) {
|
||||||
} else {
|
jo.put("type",CommonFinalParam.TYPE_THREE);
|
||||||
if (response.getCode()== CommonFinalParam.STATUS_OPEN) {
|
}
|
||||||
this.writing("to_command","9");
|
HttpResponse httpResponse = acsToWmsService.applyBlankButtonTask(jo);
|
||||||
message = "two_message7";
|
JSONObject jsonObject = null;
|
||||||
requireSucess = true;
|
if(ObjectUtil.isNotEmpty(httpResponse)){
|
||||||
} else {
|
String body = httpResponse.body();
|
||||||
requireSucess = false;
|
jsonObject = JSONObject.parseObject(body);
|
||||||
message = "two_message8" + response.getMessage();
|
}
|
||||||
this.writing("to_command","99");
|
if(ObjectUtil.isNotNull(jsonObject) && jsonObject.getInteger("status") == 200){
|
||||||
}
|
Map map = new HashMap();
|
||||||
|
//反馈取消任务
|
||||||
|
if (this.mode==9) {
|
||||||
|
map.put("to_command", 9);
|
||||||
}
|
}
|
||||||
|
//反馈表处下满料请求
|
||||||
|
if (this.mode==10) {
|
||||||
|
map.put("to_command", 10);
|
||||||
|
}
|
||||||
|
//反馈表处上空轴请求
|
||||||
|
if (this.mode==11) {
|
||||||
|
map.put("to_command", 11);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
this.writing(map);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("下发信号报错" + map)
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(3);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("反馈LMS表处按钮任务失败" + httpResponse.body())
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(3);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 取消任务
|
|
||||||
*/
|
|
||||||
public synchronized void cancelTask() {
|
|
||||||
Date date = new Date();
|
|
||||||
if (date.getTime() - this.instructionRequireTime.getTime()
|
|
||||||
< (long) this.instructionRequireTimeOut) {
|
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
this.instructionRequireTime = date;
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
|
||||||
message = "two_message9";
|
|
||||||
BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest();
|
|
||||||
blankingButtonRequest.setDevice_code(deviceCode);
|
|
||||||
blankingButtonRequest.setType(CommonFinalParam.TYPE_SIX);
|
|
||||||
BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest);
|
|
||||||
if (ObjectUtil.isEmpty(response)) {
|
|
||||||
message = "two_message10";
|
|
||||||
} else {
|
|
||||||
if (response.getCode()== CommonFinalParam.STATUS_OPEN) {
|
|
||||||
this.writing("to_command","10");
|
|
||||||
message = "two_message11";
|
|
||||||
requireSucess = true;
|
|
||||||
} else {
|
|
||||||
requireSucess = false;
|
|
||||||
message = "two_message12" + response.getMessage();
|
|
||||||
this.writing("to_command","99");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表处上空轴请求
|
|
||||||
*/
|
|
||||||
public synchronized void applyTakeEmptyShaft() {
|
|
||||||
Date date = new Date();
|
|
||||||
if (date.getTime() - this.instructionRequireTime.getTime()
|
|
||||||
< (long) this.instructionRequireTimeOut) {
|
|
||||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
this.instructionRequireTime = date;
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
|
||||||
message = "two_message13";
|
|
||||||
BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest();
|
|
||||||
blankingButtonRequest.setDevice_code(deviceCode);
|
|
||||||
blankingButtonRequest.setType(CommonFinalParam.TYPE_TWO);
|
|
||||||
BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest);
|
|
||||||
if (ObjectUtil.isEmpty(response)) {
|
|
||||||
message = "two_message14";
|
|
||||||
} else {
|
|
||||||
if (response.getCode()== CommonFinalParam.STATUS_OPEN) {
|
|
||||||
this.writing("to_command","10");
|
|
||||||
message = "two_message15";
|
|
||||||
requireSucess = true;
|
|
||||||
} else {
|
|
||||||
requireSucess = false;
|
|
||||||
message = "two_message16" + response.getMessage();
|
|
||||||
this.writing("to_command","99");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writing(String param, String value) {
|
public void writing(String param, String value) {
|
||||||
|
|
||||||
@@ -298,9 +265,9 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
|
|
||||||
itemMap.put(to_param, Integer.parseInt(value));
|
itemMap.put(to_param, Integer.parseInt(value));
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(3);
|
logDto.setLog_level(3);
|
||||||
@@ -369,4 +336,28 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
|||||||
public void setDeviceStatus(JSONObject data) {
|
public void setDeviceStatus(JSONObject data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getToParam() {
|
||||||
|
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void writing(Map<String, Object> map) throws Exception {
|
||||||
|
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||||
|
Map<String, Object> itemMap = new LinkedHashMap<>();
|
||||||
|
map.forEach((key, value) -> {
|
||||||
|
if (ObjectUtil.isNotEmpty(value)) {
|
||||||
|
itemMap.put(getToParam() + key, value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (ObjectUtil.isNotEmpty(itemMap)) {
|
||||||
|
this.checkcontrol(itemMap);
|
||||||
|
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||||
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("下发多个电气信号" + itemMap)
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(3);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
|||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
|
|
||||||
|
|
||||||
String deviceCode;
|
String device_code;
|
||||||
|
|
||||||
String message = null;
|
String message = null;
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
|
||||||
deviceCode = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||||
mode = this.itemProtocol.getItem_mode();
|
mode = this.itemProtocol.getItem_mode();
|
||||||
move = this.itemProtocol.getItem_move();
|
move = this.itemProtocol.getItem_move();
|
||||||
@@ -206,7 +206,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
|||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
||||||
message = "two_message17";
|
message = "two_message17";
|
||||||
ApplyGreenFoilButtonRequest applyGreenFoilButtonRequest = new ApplyGreenFoilButtonRequest();
|
ApplyGreenFoilButtonRequest applyGreenFoilButtonRequest = new ApplyGreenFoilButtonRequest();
|
||||||
applyGreenFoilButtonRequest.setDevice_code(deviceCode);
|
applyGreenFoilButtonRequest.setDevice_code(device_code);
|
||||||
applyGreenFoilButtonRequest.setType(String.valueOf(mode));
|
applyGreenFoilButtonRequest.setType(String.valueOf(mode));
|
||||||
ApplyGreenFoilButtonResponse response = acsToWmsService.applyGreenFoilButtonTask(applyGreenFoilButtonRequest);
|
ApplyGreenFoilButtonResponse response = acsToWmsService.applyGreenFoilButtonTask(applyGreenFoilButtonRequest);
|
||||||
if (ObjectUtil.isEmpty(response)) {
|
if (ObjectUtil.isEmpty(response)) {
|
||||||
@@ -224,7 +224,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
|||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
message = "two_message20" + response.getMessage();
|
message = "two_message20";
|
||||||
this.writing("to_command", "99");
|
this.writing("to_command", "99");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,9 +242,9 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
|||||||
|
|
||||||
itemMap.put(to_param, Integer.parseInt(value));
|
itemMap.put(to_param, Integer.parseInt(value));
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
Boolean iserror = false;
|
Boolean iserror = false;
|
||||||
|
|
||||||
|
|
||||||
String deviceCode;
|
String device_code;
|
||||||
|
|
||||||
String message = null;
|
String message = null;
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
|
|
||||||
deviceCode = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||||
mode = this.itemProtocol.getItem_mode();
|
mode = this.itemProtocol.getItem_mode();
|
||||||
move = this.itemProtocol.getItem_move();
|
move = this.itemProtocol.getItem_move();
|
||||||
@@ -139,9 +139,9 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -163,7 +163,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
this.checkcontrol(itemMap);
|
this.checkcontrol(itemMap);
|
||||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.deviceCode)
|
.device_code(this.device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(3);
|
logDto.setLog_level(3);
|
||||||
@@ -223,7 +223,6 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
|
||||||
jo.put("driver_type", "siemens_conveyor");
|
jo.put("driver_type", "siemens_conveyor");
|
||||||
jo.put("is_click", true);
|
jo.put("is_click", true);
|
||||||
return jo;
|
return jo;
|
||||||
|
|||||||
@@ -1117,7 +1117,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
action = LangProcess.msg("universal_releasing_completed");
|
action = LangProcess.msg("universal_releasing_completed");
|
||||||
}
|
}
|
||||||
if (error == 0 && iserror) {
|
if (error == 0 && iserror) {
|
||||||
this.setMessage(LangProcess.msg("universal_message11"));
|
this.setMessage("universal_message11");
|
||||||
}
|
}
|
||||||
String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4");
|
String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4");
|
||||||
if(this.requireActionSucess){
|
if(this.requireActionSucess){
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.InteractionJsonDTO;
|
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.InteractionJsonDTO;
|
||||||
|
import org.nl.acs.device_driver.two_conveyor.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.ItemProtocol;
|
import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.ItemProtocol;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
import org.nl.acs.history.ErrorUtil;
|
||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
@@ -379,6 +380,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
|
String nextDeviceCode = task.getNext_device_code();
|
||||||
|
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
|
||||||
|
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
|
||||||
|
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||||
|
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
String taskId = task.getTask_id();
|
String taskId = task.getTask_id();
|
||||||
String taskCode = task.getTask_code();
|
String taskCode = task.getTask_code();
|
||||||
String vehicleCode = task.getVehicle_code();
|
String vehicleCode = task.getVehicle_code();
|
||||||
@@ -387,7 +396,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String startDeviceCode = task.getStart_device_code();
|
String startDeviceCode = task.getStart_device_code();
|
||||||
String routePlanCode = task.getRoute_plan_code();
|
String routePlanCode = task.getRoute_plan_code();
|
||||||
String nextPointCode = task.getNext_point_code();
|
String nextPointCode = task.getNext_point_code();
|
||||||
String nextDeviceCode = task.getNext_device_code();
|
|
||||||
|
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
feedMessage = var17.getMessage();
|
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
|
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
@@ -322,12 +321,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
} else {
|
} else {
|
||||||
this.instruction_head_time = date;
|
this.instruction_head_time = date;
|
||||||
String link_device_code = String.valueOf(this.getDevice().getExtraValue().get("link_device_code"));
|
String link_device_code = String.valueOf(this.getDevice().getExtraValue().get("link_device_code"));
|
||||||
Device device = deviceAppservice.findDeviceByCode(link_device_code);
|
List<String> extraDeviceCodes = getExtraDeviceCodes1(link_device_code);
|
||||||
|
String linkCode = extraDeviceCodes.get(0);
|
||||||
|
Device device = deviceAppservice.findDeviceByCode(linkCode);
|
||||||
SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver;
|
SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver;
|
||||||
if (device.getDeviceDriver()instanceof SlitTwoManipulatorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) {
|
||||||
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
|
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
|
||||||
//如果禁用
|
//如果禁用
|
||||||
if (slitTwoManipulatorDeviceDriver.getIs_disable()==1){
|
if (slitTwoManipulatorDeviceDriver.getIs_disable() == 1) {
|
||||||
//就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑
|
//就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑
|
||||||
try {
|
try {
|
||||||
flag = instruction_require2();
|
flag = instruction_require2();
|
||||||
@@ -339,6 +340,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//没有生成异常取放货工位的任务 就生成正常关联取放货工位的任务
|
||||||
//抓取工位
|
//抓取工位
|
||||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||||
@@ -397,6 +399,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
} else {
|
} else {
|
||||||
this.instruction_head_time = date;
|
this.instruction_head_time = date;
|
||||||
//抓取工位
|
//抓取工位
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||||
getDeviceCodeList = this.getExtraDeviceCodes("error_get_device_code");
|
getDeviceCodeList = this.getExtraDeviceCodes("error_get_device_code");
|
||||||
}
|
}
|
||||||
@@ -427,7 +430,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
for (int j = 0; j < taskDtoList.size(); j++) {
|
for (int j = 0; j < taskDtoList.size(); j++) {
|
||||||
task = taskDtoList.get(j);
|
task = taskDtoList.get(j);
|
||||||
|
|
||||||
// 9 行架任务
|
// 6 行架任务
|
||||||
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
|
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
|
||||||
task = null;
|
task = null;
|
||||||
continue;
|
continue;
|
||||||
@@ -584,7 +587,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
notCreateInstMessage = e.getMessage();
|
|
||||||
logServer.deviceExecuteLog(device_code, "", instdto.getInstruction_code(), "指令创建失败,原因->" + e.getMessage());
|
logServer.deviceExecuteLog(device_code, "", instdto.getInstruction_code(), "指令创建失败,原因->" + e.getMessage());
|
||||||
}
|
}
|
||||||
//创建指令后修改任务状态
|
//创建指令后修改任务状态
|
||||||
@@ -608,7 +610,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
public void isSetAddress(Device device) {
|
public void isSetAddress(Device device) {
|
||||||
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
|
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
|
||||||
logServer.deviceExecuteLog(device_code, "", "task:" + task, "设备:" + device.getDevice_code() + "未设置电气调度号!");
|
logServer.deviceExecuteLog(device_code, "", "task:" + task, "设备:" + device.getDevice_code() + "未设置电气调度号!");
|
||||||
notCreateInstMessage = device.getDevice_code() + "universal_notCreateInstMessage1";;
|
notCreateInstMessage = "universal_notCreateInstMessage1";;
|
||||||
throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!");
|
throw new BadRequestException("设备:" + device.getDevice_code() + "未设置电气调度号!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -719,6 +721,26 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
|
|
||||||
//将扩展表中的字符串数组数据转换成集合
|
//将扩展表中的字符串数组数据转换成集合
|
||||||
|
public List<String> getExtraDeviceCodes1(String extraValue) {
|
||||||
|
if (StrUtil.isEmpty(extraValue)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
String devicesString = extraValue.substring(1, extraValue.length() - 1);
|
||||||
|
List<String> devicesList = new ArrayList<>();
|
||||||
|
String[] devices = devicesString.split(",");
|
||||||
|
for (int i = 0; i < devices.length; i++) {
|
||||||
|
String s = devices[i].replace("\"", "").replace("\"", "");
|
||||||
|
devicesList.add(s);
|
||||||
|
}
|
||||||
|
return devicesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将扩展表中的字符串数据转换成集合
|
||||||
|
*
|
||||||
|
* @param extraName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getExtraDeviceCodes(String extraName) {
|
public List<String> getExtraDeviceCodes(String extraName) {
|
||||||
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ public class SubvolumeWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
|||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", this.getError());
|
jo.put("error", this.getError());
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", LangProcess.msg(message));
|
|
||||||
jo.put("driver_type", "siemens_conveyor");
|
jo.put("driver_type", "siemens_conveyor");
|
||||||
jo.put("is_click", true);
|
jo.put("is_click", true);
|
||||||
return jo;
|
return jo;
|
||||||
|
|||||||
@@ -110,4 +110,12 @@ public class WmsToAcsController {
|
|||||||
return new ResponseEntity<>(wmstoacsService.putWeightAction(whereJson), HttpStatus.OK);
|
return new ResponseEntity<>(wmstoacsService.putWeightAction(whereJson), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getTubeMsg")
|
||||||
|
@Log("wms下发废箔重量")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> getTubeMes(@RequestBody String whereJson) throws Exception {
|
||||||
|
return new ResponseEntity<>(wmstoacsService.getTubeMes(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ public interface AcsToWmsService {
|
|||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param);
|
HttpResponse applyBlankButtonTask(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向lms申请反馈
|
* 向lms申请反馈
|
||||||
|
|||||||
@@ -117,4 +117,5 @@ public interface WmsToAcsService {
|
|||||||
*/
|
*/
|
||||||
Map<String, Object> putWeightAction(String jsonObject) throws Exception;
|
Map<String, Object> putWeightAction(String jsonObject) throws Exception;
|
||||||
|
|
||||||
|
Map<String, Object> getTubeMes(String whereJson) throws Exception;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,8 +381,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplyGreenFoilButtonResponse applyGreenFoilButtonTask(ApplyGreenFoilButtonRequest param) {
|
public ApplyGreenFoilButtonResponse applyGreenFoilButtonTask(ApplyGreenFoilButtonRequest param) {
|
||||||
try {
|
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
ApplyGreenFoilButtonResponse applyGreenFoilButtonResponse = new ApplyGreenFoilButtonResponse();
|
ApplyGreenFoilButtonResponse applyGreenFoilButtonResponse = new ApplyGreenFoilButtonResponse();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
@@ -409,43 +407,39 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
}
|
}
|
||||||
return applyGreenFoilButtonResponse;
|
return applyGreenFoilButtonResponse;
|
||||||
} finally {
|
|
||||||
MDC.remove(log_file_type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param) {
|
public HttpResponse applyBlankButtonTask(JSONObject param) {
|
||||||
|
HttpResponse result = null;
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
BlankingButtonResponse blankingButtonResponse = new BlankingButtonResponse();
|
AddressDto addressDto = addressService.findByCode("applyButtonTask");
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
String methods_url = addressDto.getMethods_url();
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String url = wmsUrl + methods_url;
|
||||||
AddressDto addressDto = addressService.findByCode("applyButtonTask");
|
log.info("applyBlankButtonTask----反馈表处按钮请求路径{}", param);
|
||||||
String methods_url = addressDto.getMethods_url();
|
try {
|
||||||
String url = wmsUrl + methods_url;
|
result = HttpRequest.post(url)
|
||||||
log.info("BlankingButtonRequest----请求参数{}", param);
|
.header("Authorization", token)
|
||||||
try {
|
.body(String.valueOf(param))
|
||||||
// String result = "";
|
.execute();
|
||||||
String result = HttpRequest.post(url)
|
} catch (Exception e) {
|
||||||
.body(JSON.toJSONString(param))
|
String msg = e.getMessage();
|
||||||
.execute().body();
|
log.info("feedbackDie-----输出参数{}", msg);
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
//网络不通
|
||||||
log.info("BlankingButtonResponse----返回参数{}", result);
|
|
||||||
blankingButtonResponse = JSONObject.toJavaObject(jsonObject, BlankingButtonResponse.class);
|
|
||||||
} catch (Exception e) {
|
|
||||||
JSONObject map = new JSONObject();
|
|
||||||
map.put("status", 400);
|
|
||||||
map.put("message", e.getMessage());
|
|
||||||
return JSONObject.toJavaObject(map, BlankingButtonResponse.class);
|
|
||||||
}
|
|
||||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"BlankingButtonRequest", String.valueOf(blankingButtonResponse.getCode()),
|
|
||||||
JSON.toJSONString(param), String.valueOf(blankingButtonResponse.getMessage()), "ACS向LMS申请表处下料位按钮任务");
|
|
||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
|
||||||
}
|
}
|
||||||
return blankingButtonResponse;
|
log.info("applyBlankButtonTask - 反馈表处按钮{}", result.body());
|
||||||
} finally {
|
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()),
|
||||||
MDC.remove(log_file_type);
|
JSON.toJSONString(result.body()),
|
||||||
|
String.valueOf(result.body()), "反馈下发表处任务");
|
||||||
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()),
|
||||||
|
JSON.toJSONString(result),
|
||||||
|
String.valueOf(result.body()), "反馈下发表处任务报错");
|
||||||
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +447,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) {
|
public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) {
|
||||||
log.info("向LMS申请反馈,请求参数{}",param);
|
log.info("向LMS申请反馈,请求参数{}",param);
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse();
|
ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
@@ -491,8 +484,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
@Override
|
@Override
|
||||||
public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) {
|
public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) {
|
||||||
log.info("向LMS申请反馈,请求参数{}",param);
|
log.info("向LMS申请反馈,请求参数{}",param);
|
||||||
try {
|
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse();
|
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
@@ -519,16 +510,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
}
|
}
|
||||||
return applyfeedbackSubVolumeWeightResponse;
|
return applyfeedbackSubVolumeWeightResponse;
|
||||||
} finally {
|
|
||||||
MDC.remove(log_file_type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
||||||
log.info("向LMS申请反馈,请求参数{}", param);
|
log.info("向LMS申请反馈,请求参数{}", param);
|
||||||
try {
|
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse();
|
ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
@@ -555,17 +541,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
}
|
}
|
||||||
return applyManipulatorActionResponse;
|
return applyManipulatorActionResponse;
|
||||||
} finally {
|
|
||||||
MDC.remove(log_file_type);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param) {
|
public GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param) {
|
||||||
log.info("向LMS申请反馈,请求参数{}", param);
|
log.info("向LMS申请反馈,请求参数{}", param);
|
||||||
try {
|
try {
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse = new GetWasteFoilWeightResponse();
|
GetWasteFoilWeightResponse getWasteFoilWeightResponse = new GetWasteFoilWeightResponse();
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDr
|
|||||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
|
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.paper_tube_pick_site.PaperTubePickSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
||||||
import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||||
@@ -489,8 +490,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PutActionResponse putAction(String jsonObject) throws Exception {
|
public PutActionResponse putAction(String jsonObject) throws Exception {
|
||||||
try {
|
|
||||||
MDC.put(log_file_type, log_type);
|
|
||||||
log.info("putAction--------------:输入参数" + jsonObject);
|
log.info("putAction--------------:输入参数" + jsonObject);
|
||||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||||
PutActionResponse response = new PutActionResponse();
|
PutActionResponse response = new PutActionResponse();
|
||||||
@@ -547,78 +546,113 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
response.setMessage("success");
|
response.setMessage("success");
|
||||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"putAction", String.valueOf(response.getCode()),
|
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "putAction", String.valueOf(response.getCode()),
|
||||||
jsonObject, String.valueOf(response), "LMS下发动作");
|
jsonObject, String.valueOf(response), "LMS下发动作");
|
||||||
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
log.info("putAction--------------:输出参数:" + response);
|
log.info("putAction--------------:输出参数:" + response);
|
||||||
return response;
|
return response;
|
||||||
} finally {
|
|
||||||
MDC.remove(log_file_type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> putWeightAction(String jsonObject) throws Exception {
|
public Map<String, Object> putWeightAction(String jsonObject) throws Exception {
|
||||||
try {
|
log.info("putWeightAction--------------:输入参数" + jsonObject);
|
||||||
MDC.put(log_file_type, log_type);
|
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||||
log.info("putWeightAction--------------:输入参数" + jsonObject);
|
JSONObject jo = new JSONObject();
|
||||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
for (int i = 0; i < datas.size(); i++) {
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject data = (JSONObject) datas.get(i);
|
||||||
for (int i = 0; i < datas.size(); i++) {
|
String device_code = data.getString("device_code");
|
||||||
JSONObject data = (JSONObject) datas.get(i);
|
String type = data.getString("type");
|
||||||
String device_code = data.getString("device_code");
|
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||||
String type = data.getString("type");
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
throw new Exception("未找到对应设备:" + device_code);
|
||||||
if (ObjectUtil.isEmpty(device)) {
|
}
|
||||||
throw new Exception("未找到对应设备:" + device_code);
|
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
||||||
}
|
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
||||||
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
||||||
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
try {
|
||||||
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
//称重完成
|
||||||
try {
|
if (StrUtil.equals("1", type)) {
|
||||||
//称重完成
|
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||||
if (StrUtil.equals("1", type)) {
|
Thread.sleep(1000); //休眠1秒
|
||||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
while (true) {
|
||||||
Thread.sleep(1000); //休眠1秒
|
if (wasteFoilWeighingStationDriver.getMode() == 6) {
|
||||||
while (true) {
|
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||||
if (wasteFoilWeighingStationDriver.getMode()==6){
|
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
break;
|
||||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
|
||||||
}
|
}
|
||||||
//称重确认信号
|
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||||
else if (StrUtil.equals("2", type)) {
|
|
||||||
wasteFoilWeighingStationDriver.writing("to_command", "7");
|
|
||||||
Thread.sleep(1000); //休眠1秒
|
|
||||||
while (true) {
|
|
||||||
if (wasteFoilWeighingStationDriver.getMode()==7){
|
|
||||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
|
||||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
|
||||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
|
||||||
}
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
//称重确认信号
|
||||||
|
else if (StrUtil.equals("2", type)) {
|
||||||
|
wasteFoilWeighingStationDriver.writing("to_command", "7");
|
||||||
|
Thread.sleep(1000); //休眠1秒
|
||||||
|
while (true) {
|
||||||
|
if (wasteFoilWeighingStationDriver.getMode() == 7) {
|
||||||
|
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||||
|
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||||
|
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
resultJson.put("status", HttpStatus.OK.value());
|
|
||||||
resultJson.put("message", "操作成功");
|
|
||||||
resultJson.put("data", jo);
|
|
||||||
log.info("putWeightAction--------------:输出参数" + resultJson.toString());
|
|
||||||
return resultJson;
|
|
||||||
} finally {
|
|
||||||
MDC.remove(log_file_type);
|
|
||||||
}
|
}
|
||||||
|
JSONObject resultJson = new JSONObject();
|
||||||
|
resultJson.put("status", HttpStatus.OK.value());
|
||||||
|
resultJson.put("message", "操作成功");
|
||||||
|
resultJson.put("data", jo);
|
||||||
|
log.info("putWeightAction--------------:输出参数" + resultJson.toString());
|
||||||
|
return resultJson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
|
||||||
|
log.info("getTubeMes--------------:输入参数" + jsonObject);
|
||||||
|
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
for (int i = 0; i < datas.size(); i++) {
|
||||||
|
JSONObject data = (JSONObject) datas.get(i);
|
||||||
|
String device_code = data.getString("device_code");
|
||||||
|
String to_material = data.getString("to_material");
|
||||||
|
String to_spec = data.getString("to_spec");
|
||||||
|
String to_qty = data.getString("to_qty");
|
||||||
|
|
||||||
|
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||||
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
|
throw new Exception("未找到对应设备:" + device_code);
|
||||||
|
}
|
||||||
|
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
|
||||||
|
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
||||||
|
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
try {
|
||||||
|
//反馈管芯信息
|
||||||
|
Thread.sleep(1000); //休眠1秒
|
||||||
|
while (true) {
|
||||||
|
if (paperTubePickSiteDeviceDriver.getMode() == 2 && paperTubePickSiteDeviceDriver.getFlag() == 3) {
|
||||||
|
jo.put("to_material", to_material);//当前重量
|
||||||
|
jo.put("to_spec", to_spec);//上一次重量
|
||||||
|
jo.put("to_qty", to_qty);//重量差
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONObject resultJson = new JSONObject();
|
||||||
|
resultJson.put("status", HttpStatus.OK.value());
|
||||||
|
resultJson.put("message", "操作成功");
|
||||||
|
resultJson.put("data", jo);
|
||||||
|
log.info("putWeightAction--------------:输出参数" + resultJson.toString());
|
||||||
|
return resultJson;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import org.nl.acs.route.service.dto.RouteLineDto;
|
|||||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||||
import org.nl.acs.task.TaskInstructionLock;
|
import org.nl.acs.task.TaskInstructionLock;
|
||||||
import org.nl.acs.task.domain.Task;
|
import org.nl.acs.task.domain.Task;
|
||||||
|
import org.nl.acs.task.enums.AgvSystemTypeEnum;
|
||||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
@@ -470,7 +471,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (ObjectUtil.isEmpty(route) && (!start_device_code.equals(next_device_code))) {
|
if (ObjectUtil.isEmpty(route) && (!start_device_code.equals(next_device_code))) {
|
||||||
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
|
throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
|
||||||
}
|
}
|
||||||
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(AgvSystemTypeEnum.Two_NDC_System_Type.getIndex())) {
|
||||||
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
|
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
|
||||||
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
||||||
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
|
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
|
||||||
@@ -500,7 +501,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//判断是否是仙工AGV
|
//判断是否是仙工AGV
|
||||||
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(CommonFinalParam.ONE)) {
|
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
|
||||||
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
|
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
|
||||||
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
|
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
|
||||||
//追加订单
|
//追加订单
|
||||||
@@ -511,7 +512,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
dto.setSend_status("1");
|
dto.setSend_status("1");
|
||||||
}
|
}
|
||||||
//仙工叉车
|
//仙工叉车
|
||||||
} else if (deviceByCode.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
} else if (deviceByCode.getDeviceDriver() instanceof BeltConveyorDeviceDriver&& dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
|
||||||
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto);
|
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto);
|
||||||
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
|
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
|
||||||
dto.setSend_status("2");
|
dto.setSend_status("2");
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONArray getData(JSONArray jsonArray) throws Exception {
|
public JSONArray
|
||||||
|
getData(JSONArray jsonArray) throws Exception {
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
for (int i = 0; i < jsonArray.size(); i++) {
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ export default {
|
|||||||
dialogFormVisible10: false,
|
dialogFormVisible10: false,
|
||||||
Stages: [],
|
Stages: [],
|
||||||
stage_code: 'stage_code',
|
stage_code: 'stage_code',
|
||||||
|
stage_name: '二楼监控',
|
||||||
form: {
|
form: {
|
||||||
device_code: '',
|
device_code: '',
|
||||||
hasGoodStatus: null,
|
hasGoodStatus: null,
|
||||||
@@ -505,7 +506,7 @@ export default {
|
|||||||
this.arr = [] // 清空
|
this.arr = [] // 清空
|
||||||
if (item.device_code && item.data) {
|
if (item.device_code && item.data) {
|
||||||
console.log('item', item)
|
console.log('item', item)
|
||||||
/* let tempDeviceName = ''
|
let tempDeviceName = ''
|
||||||
if (this.language === 'zh') {
|
if (this.language === 'zh') {
|
||||||
tempDeviceName = item.data.zh_device_name
|
tempDeviceName = item.data.zh_device_name
|
||||||
}
|
}
|
||||||
@@ -514,7 +515,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (this.language === 'in') {
|
if (this.language === 'in') {
|
||||||
tempDeviceName = item.data.in_device_name
|
tempDeviceName = item.data.in_device_name
|
||||||
} */
|
}
|
||||||
this.arr = [
|
this.arr = [
|
||||||
{ name: i18n.t('monitor.click.equipment_number'), value: item.device_code },
|
{ name: i18n.t('monitor.click.equipment_number'), value: item.device_code },
|
||||||
{ name: i18n.t('monitor.click.device_name'), value: item.device_name }
|
{ name: i18n.t('monitor.click.device_name'), value: item.device_name }
|
||||||
|
|||||||
Reference in New Issue
Block a user