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;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
InstructionService instructionService;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -22,7 +22,7 @@ public class XianGongAgvController {
|
||||
@Autowired
|
||||
private XianGongAgvService xianGongAgentService;
|
||||
|
||||
@PostMapping("/waitPointRequest")
|
||||
@PostMapping("/api/agv/xg/waitPointRequest")
|
||||
@Log("仙工AGV请求取放货")
|
||||
public ResponseEntity<JSONObject> xgAGVWaitPointRequest(@RequestBody JSONObject requestParam) {
|
||||
return new ResponseEntity<>(xianGongAgentService.xgAGVWaitPointRequest(requestParam), HttpStatus.OK);
|
||||
|
||||
@@ -307,11 +307,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() > 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||
}
|
||||
@@ -478,11 +478,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||
}
|
||||
@@ -617,11 +617,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||
}
|
||||
@@ -792,10 +792,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 0) {
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), ikey);
|
||||
}
|
||||
@@ -909,11 +910,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 0 && paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||
}
|
||||
@@ -1107,11 +1108,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 1 && paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
paperTubePickSiteDeviceDriver.setFlag(3);
|
||||
} 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()
|
||||
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
|
||||
}
|
||||
@@ -1237,7 +1239,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() == 0) {
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} else {
|
||||
message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
||||
@@ -1369,7 +1372,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (paperTubePickSiteDeviceDriver.getMove() > 0) {
|
||||
if (paperTubePickSiteDeviceDriver.getAction() == 1
|
||||
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
} else {
|
||||
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("mode", mode);
|
||||
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) {
|
||||
move = LangProcess.msg("universal_no");
|
||||
jo.put("hasGoods", false);
|
||||
|
||||
@@ -381,7 +381,6 @@ public class BoxPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDriv
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
return jo;
|
||||
}
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
map.put("hand_barcode", hand_barcode);
|
||||
map.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
|
||||
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("driver_type", "siemens_conveyor");
|
||||
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("last_inst_message", this.last_inst_message);
|
||||
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("message", LangProcess.msg(message));
|
||||
jo.put("hand_barcode", hand_barcode);
|
||||
|
||||
@@ -354,7 +354,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
this.require_apply_strangulation_time = date;
|
||||
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (ObjectUtil.isEmpty(inst) && StrUtil.isEmpty(inst.getVehicle_code())) {
|
||||
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11");
|
||||
message = "one_message11";
|
||||
return;
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
@@ -404,7 +404,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
//
|
||||
Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (StrUtil.isEmpty(inst.getVehicle_code())) {
|
||||
message = LangProcess.msg("one_message8") + ": " + task + LangProcess.msg("one_message11");
|
||||
message = "one_message11";
|
||||
return;
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
@@ -698,7 +698,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
|
||||
jo.put("inst_message", this.inst_message);
|
||||
jo.put("last_inst_message", this.last_inst_message);
|
||||
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("message", LangProcess.msg(message));
|
||||
jo.put("hand_barcode", hand_barcode);
|
||||
|
||||
@@ -674,7 +674,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
jo.put("action", action);
|
||||
jo.put("task", task);
|
||||
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("message", LangProcess.msg(message));
|
||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||
|
||||
@@ -787,12 +787,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
map3.put("code", "to_container_type");
|
||||
map3.put("value", containerType);
|
||||
list.add(map3);
|
||||
|
||||
this.writing(list);
|
||||
List list2 = new ArrayList();
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code", "to_command");
|
||||
map4.put("value", "1");
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
list2.add(map4);
|
||||
this.writing(list2);
|
||||
led_message = getLedMessage(instdto);
|
||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||
String device = null;
|
||||
@@ -973,7 +975,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
jo.put("action", action);
|
||||
jo.put("task", task);
|
||||
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("message", LangProcess.msg(message));
|
||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||
|
||||
@@ -410,7 +410,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
jo.put("inst_message", this.inst_message);
|
||||
jo.put("last_inst_message", this.last_inst_message);
|
||||
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("message", LangProcess.msg(message));
|
||||
jo.put("hand_barcode", hand_barcode);
|
||||
|
||||
@@ -427,7 +427,6 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||
|
||||
@@ -382,7 +382,6 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||
|
||||
@@ -400,7 +400,6 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(device_code+"创建指令时出现异常:" + e.getMessage())
|
||||
|
||||
@@ -190,7 +190,6 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
|
||||
|
||||
} catch (Exception var17) {
|
||||
var17.printStackTrace();
|
||||
feedMessage = var17.getMessage();
|
||||
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 {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = e.getMessage();
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content(device_code + "创建指令时出现异常:" + e.getMessage())
|
||||
|
||||
@@ -271,7 +271,11 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
map.put("to_target", address);
|
||||
map.put("to_sub_volume_no", material_code);
|
||||
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);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "申请行架任务成功";
|
||||
|
||||
@@ -432,7 +432,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
break;
|
||||
case 4:
|
||||
message = "one_message1";
|
||||
if (updateCommand("4")) break;
|
||||
Instruction instruction1 = checkInst();
|
||||
String next_device_code1 = instruction1.getNext_device_code();
|
||||
Device nextDevice1 = deviceAppService.findDeviceByCode(next_device_code1);
|
||||
@@ -456,7 +455,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
break;
|
||||
case 5:
|
||||
message = "universal_releasing_completed";
|
||||
if (updateCommand("11")) break;
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List list5 = new ArrayList();
|
||||
map.put("code", "to_command");
|
||||
|
||||
@@ -569,7 +569,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
notCreateInstMessage = "";
|
||||
notCreateTaskMessage = "";
|
||||
} else {
|
||||
notCreateInstMessage = "universal_notCreateInstMessage";
|
||||
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -690,7 +690,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
|
||||
jo.put("notCreateInstMessage",notCreateInstMessage);
|
||||
jo.put("feedMessage", LangProcess.msg(feedMessage));
|
||||
jo.put("driver_type", "siemens_conveyor");
|
||||
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.StrUtil;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -35,10 +36,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
/**
|
||||
* @author : TuQiang
|
||||
* @date : 2024/3/14
|
||||
@@ -102,7 +100,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
Boolean iserror = false;
|
||||
|
||||
|
||||
String deviceCode;
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
|
||||
@@ -118,7 +116,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
deviceCode = this.getDeviceCode();
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
move = this.itemProtocol.getItem_move();
|
||||
@@ -156,22 +154,31 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
case 3:
|
||||
log.debug("运行中");
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
// 表处下满料请求
|
||||
if (!requireSucess) {
|
||||
applyTakeFullVolume();
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
//表处上空轴请求
|
||||
if (!requireSucess) {
|
||||
applyTakeEmptyShaft();
|
||||
boolean b = applyTake();
|
||||
if (b) {
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
//表处上空轴请求
|
||||
if (!requireSucess) {
|
||||
boolean b = applyTake();
|
||||
if (b) {
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
// 取消任务
|
||||
if (!requireSucess) {
|
||||
cancelTask();
|
||||
boolean b = applyTake();
|
||||
if (b) {
|
||||
requireSucess = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -184,110 +191,70 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
lastMove = move;
|
||||
lastAction = action;
|
||||
lastError = error;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 表处下满料请求
|
||||
*/
|
||||
public synchronized void applyTakeFullVolume() {
|
||||
|
||||
private boolean applyTake() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instructionRequireTime.getTime()
|
||||
< (long) this.instructionRequireTimeOut) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instructionRequireTimeOut);
|
||||
return;
|
||||
return false;
|
||||
} else {
|
||||
this.instructionRequireTime = date;
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) {
|
||||
message = "two_message5";
|
||||
BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest();
|
||||
blankingButtonRequest.setDevice_code(deviceCode);
|
||||
blankingButtonRequest.setType(CommonFinalParam.TYPE_ONE);
|
||||
BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest);
|
||||
if (ObjectUtil.isEmpty(response)) {
|
||||
message = "two_message6";
|
||||
} else {
|
||||
if (response.getCode()== CommonFinalParam.STATUS_OPEN) {
|
||||
this.writing("to_command","9");
|
||||
message = "two_message7";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = "two_message8" + response.getMessage();
|
||||
this.writing("to_command","99");
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_code", this.getDevice_code());
|
||||
if (this.mode==9) {
|
||||
jo.put("type",CommonFinalParam.TYPE_ONE);
|
||||
}
|
||||
if (this.mode==10) {
|
||||
jo.put("type",CommonFinalParam.TYPE_TWO);
|
||||
}
|
||||
if (this.mode==11) {
|
||||
jo.put("type",CommonFinalParam.TYPE_THREE);
|
||||
}
|
||||
HttpResponse httpResponse = acsToWmsService.applyBlankButtonTask(jo);
|
||||
JSONObject jsonObject = null;
|
||||
if(ObjectUtil.isNotEmpty(httpResponse)){
|
||||
String body = httpResponse.body();
|
||||
jsonObject = JSONObject.parseObject(body);
|
||||
}
|
||||
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) {
|
||||
|
||||
@@ -298,9 +265,9 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
logDto.setLog_level(3);
|
||||
@@ -369,4 +336,28 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
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;
|
||||
|
||||
|
||||
String deviceCode;
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
deviceCode = this.getDeviceCode();
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
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)) {
|
||||
message = "two_message17";
|
||||
ApplyGreenFoilButtonRequest applyGreenFoilButtonRequest = new ApplyGreenFoilButtonRequest();
|
||||
applyGreenFoilButtonRequest.setDevice_code(deviceCode);
|
||||
applyGreenFoilButtonRequest.setDevice_code(device_code);
|
||||
applyGreenFoilButtonRequest.setType(String.valueOf(mode));
|
||||
ApplyGreenFoilButtonResponse response = acsToWmsService.applyGreenFoilButtonTask(applyGreenFoilButtonRequest);
|
||||
if (ObjectUtil.isEmpty(response)) {
|
||||
@@ -224,7 +224,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = "two_message20" + response.getMessage();
|
||||
message = "two_message20";
|
||||
this.writing("to_command", "99");
|
||||
}
|
||||
}
|
||||
@@ -242,9 +242,9 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem
|
||||
|
||||
itemMap.put(to_param, Integer.parseInt(value));
|
||||
this.control(itemMap);
|
||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
@@ -86,7 +86,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
Boolean iserror = false;
|
||||
|
||||
|
||||
String deviceCode;
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
deviceCode = this.getDeviceCode();
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
move = this.itemProtocol.getItem_move();
|
||||
@@ -139,9 +139,9 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号设备号:" + deviceCode + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
@@ -163,7 +163,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
this.checkcontrol(itemMap);
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.deviceCode)
|
||||
.device_code(this.device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
logDto.setLog_level(3);
|
||||
@@ -223,7 +223,6 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("driver_type", "siemens_conveyor");
|
||||
jo.put("is_click", true);
|
||||
return jo;
|
||||
|
||||
@@ -1117,7 +1117,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
action = LangProcess.msg("universal_releasing_completed");
|
||||
}
|
||||
if (error == 0 && iserror) {
|
||||
this.setMessage(LangProcess.msg("universal_message11"));
|
||||
this.setMessage("universal_message11");
|
||||
}
|
||||
String requireActionSucess = "指令" + LangProcess.msg("universal_actionMessage4");
|
||||
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.ExecutableDeviceDriver;
|
||||
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.history.ErrorUtil;
|
||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||
@@ -379,6 +380,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
}
|
||||
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 taskCode = task.getTask_code();
|
||||
String vehicleCode = task.getVehicle_code();
|
||||
@@ -387,7 +396,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
String startDeviceCode = task.getStart_device_code();
|
||||
String routePlanCode = task.getRoute_plan_code();
|
||||
String nextPointCode = task.getNext_point_code();
|
||||
String nextDeviceCode = task.getNext_device_code();
|
||||
|
||||
|
||||
Instruction instdto = new Instruction();
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
|
||||
@@ -177,7 +177,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
|
||||
|
||||
} catch (Exception var17) {
|
||||
feedMessage = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
// return;
|
||||
}
|
||||
@@ -322,12 +321,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
} else {
|
||||
this.instruction_head_time = date;
|
||||
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;
|
||||
if (device.getDeviceDriver()instanceof SlitTwoManipulatorDeviceDriver) {
|
||||
if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) {
|
||||
slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
|
||||
//如果禁用
|
||||
if (slitTwoManipulatorDeviceDriver.getIs_disable()==1){
|
||||
if (slitTwoManipulatorDeviceDriver.getIs_disable() == 1) {
|
||||
//就去走关联设备异常取放货工位的任务 任务生成成功返回true 就不会走下面正常生成任务的逻辑
|
||||
try {
|
||||
flag = instruction_require2();
|
||||
@@ -339,6 +340,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
}
|
||||
}
|
||||
}
|
||||
//没有生成异常取放货工位的任务 就生成正常关联取放货工位的任务
|
||||
//抓取工位
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
getDeviceCodeList = this.getExtraDeviceCodes("get_device_code");
|
||||
@@ -397,6 +399,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
} else {
|
||||
this.instruction_head_time = date;
|
||||
//抓取工位
|
||||
|
||||
if (ObjectUtil.isEmpty(getDeviceCodeList)) {
|
||||
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++) {
|
||||
task = taskDtoList.get(j);
|
||||
|
||||
// 9 行架任务
|
||||
// 6 行架任务
|
||||
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
|
||||
task = null;
|
||||
continue;
|
||||
@@ -584,7 +587,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
notCreateInstMessage = 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) {
|
||||
if (ObjectUtil.isEmpty(device.getExtraValue().get("address"))) {
|
||||
logServer.deviceExecuteLog(device_code, "", "task:" + task, "设备:" + device.getDevice_code() + "未设置电气调度号!");
|
||||
notCreateInstMessage = device.getDevice_code() + "universal_notCreateInstMessage1";;
|
||||
notCreateInstMessage = "universal_notCreateInstMessage1";;
|
||||
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
|
||||
public List<String> getExtraDeviceCodes(String 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("error", this.getError());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("driver_type", "siemens_conveyor");
|
||||
jo.put("is_click", true);
|
||||
return jo;
|
||||
|
||||
@@ -110,4 +110,12 @@ public class WmsToAcsController {
|
||||
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
|
||||
* @return
|
||||
*/
|
||||
BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param);
|
||||
HttpResponse applyBlankButtonTask(JSONObject param);
|
||||
|
||||
/**
|
||||
* 向lms申请反馈
|
||||
|
||||
@@ -117,4 +117,5 @@ public interface WmsToAcsService {
|
||||
*/
|
||||
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
|
||||
public ApplyGreenFoilButtonResponse applyGreenFoilButtonTask(ApplyGreenFoilButtonRequest param) {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyGreenFoilButtonResponse applyGreenFoilButtonResponse = new ApplyGreenFoilButtonResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -409,43 +407,39 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyGreenFoilButtonResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlankingButtonResponse applyBlankButtonTask(BlankingButtonRequest param) {
|
||||
public HttpResponse applyBlankButtonTask(JSONObject param) {
|
||||
HttpResponse result = null;
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
BlankingButtonResponse blankingButtonResponse = new BlankingButtonResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyButtonTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("BlankingButtonRequest----请求参数{}", param);
|
||||
try {
|
||||
// String result = "";
|
||||
String result = HttpRequest.post(url)
|
||||
.body(JSON.toJSONString(param))
|
||||
.execute().body();
|
||||
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);
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyButtonTask");
|
||||
String methods_url = addressDto.getMethods_url();
|
||||
String url = wmsUrl + methods_url;
|
||||
log.info("applyBlankButtonTask----反馈表处按钮请求路径{}", param);
|
||||
try {
|
||||
result = HttpRequest.post(url)
|
||||
.header("Authorization", token)
|
||||
.body(String.valueOf(param))
|
||||
.execute();
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.info("feedbackDie-----输出参数{}", msg);
|
||||
//网络不通
|
||||
}
|
||||
return blankingButtonResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
log.info("applyBlankButtonTask - 反馈表处按钮{}", result.body());
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()),
|
||||
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) {
|
||||
log.info("向LMS申请反馈,请求参数{}",param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse = new ApplyPlugPullSitResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -491,8 +484,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Override
|
||||
public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}",param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -519,16 +510,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyfeedbackSubVolumeWeightResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}", param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
@@ -555,17 +541,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
return applyManipulatorActionResponse;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}", param);
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse = new GetWasteFoilWeightResponse();
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
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.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
||||
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.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||
@@ -489,8 +490,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
@Override
|
||||
public PutActionResponse putAction(String jsonObject) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putAction--------------:输入参数" + jsonObject);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
PutActionResponse response = new PutActionResponse();
|
||||
@@ -547,78 +546,113 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
}
|
||||
response.setStatus(200);
|
||||
response.setMessage("success");
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"putAction", String.valueOf(response.getCode()),
|
||||
jsonObject, String.valueOf(response), "LMS下发动作");
|
||||
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
||||
log.info("putAction--------------:输出参数:" + response);
|
||||
return response;
|
||||
} finally {
|
||||
MDC.remove(log_file_type);
|
||||
}
|
||||
response.setMessage("success");
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "putAction", String.valueOf(response.getCode()),
|
||||
jsonObject, String.valueOf(response), "LMS下发动作");
|
||||
luceneExecuteLogService.interfaceExecuteLog(luceneLogDto);
|
||||
log.info("putAction--------------:输出参数:" + response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> putWeightAction(String jsonObject) throws Exception {
|
||||
try {
|
||||
MDC.put(log_file_type, log_type);
|
||||
log.info("putWeightAction--------------:输入参数" + 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 type = data.getString("type");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
||||
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
||||
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
||||
try {
|
||||
//称重完成
|
||||
if (StrUtil.equals("1", type)) {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
while (true) {
|
||||
if (wasteFoilWeighingStationDriver.getMode()==6){
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
}
|
||||
log.info("putWeightAction--------------:输入参数" + 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 type = data.getString("type");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
||||
if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
||||
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
||||
try {
|
||||
//称重完成
|
||||
if (StrUtil.equals("1", type)) {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
while (true) {
|
||||
if (wasteFoilWeighingStationDriver.getMode() == 6) {
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
}
|
||||
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();
|
||||
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();
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
@@ -51,6 +51,7 @@ import org.nl.acs.route.service.dto.RouteLineDto;
|
||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||
import org.nl.acs.task.TaskInstructionLock;
|
||||
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.service.TaskService;
|
||||
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))) {
|
||||
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系统
|
||||
if (!StrUtil.equals(task.getAgv_system_type(), "0")
|
||||
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
|
||||
@@ -500,7 +501,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
}
|
||||
}
|
||||
//判断是否是仙工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());
|
||||
if (StrUtil.equals(task.getRequest_again_success(), "1")) {
|
||||
//追加订单
|
||||
@@ -511,7 +512,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
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);
|
||||
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
|
||||
dto.setSend_status("2");
|
||||
|
||||
@@ -24,7 +24,8 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService
|
||||
|
||||
|
||||
@Override
|
||||
public JSONArray getData(JSONArray jsonArray) throws Exception {
|
||||
public JSONArray
|
||||
getData(JSONArray jsonArray) throws Exception {
|
||||
JSONArray arr = new JSONArray();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject obj = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user