diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java index ce04c7aef..b891df5ef 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/AgvWaitUtil.java @@ -12,6 +12,7 @@ import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.task.enums.ActionTypeEnum; +import org.nl.acs.task.enums.AgvActionTypeEnum; import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.common.exception.BadRequestException; import org.nl.config.lucene.service.LuceneExecuteLogService; @@ -129,7 +130,9 @@ public class AgvWaitUtil { } //诺宝agv调lms更新点位 if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) { - applyLmsGetOut(inst); + if (!AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) { + applyLmsGetOut(inst); + } if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver(); if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) { @@ -152,7 +155,7 @@ public class AgvWaitUtil { param.put("actionType", ActionTypeEnum.IN_FINISHING.getCode().toString()); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("诺宝取货完成请求lms:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getCode().toString()) + .content("诺宝取货完成请求lms:" + inst.getTask_code() + "--" + ActionTypeEnum.IN_FINISHING.getStatus()) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -168,7 +171,7 @@ public class AgvWaitUtil { } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(inst.getCarno()) - .content("追加动诺宝作块失败,返回参数:" + jo.getString("body")) + .content("请求lms追加动诺宝作块失败,返回参数:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java index b30688d40..e7ab768c7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/QueryAGVStatus.java @@ -11,14 +11,19 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device_driver.agv.xg_agv_car.XgAgvCarDeviceDriver; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.opc.DeviceAppService; import org.nl.acs.task.domain.Task; +import org.nl.acs.task.enums.AgvActionTypeEnum; import org.nl.acs.task.enums.AgvSystemTypeEnum; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.config.SpringContextHolder; import org.nl.system.service.param.ISysParamService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; @@ -31,6 +36,10 @@ import java.util.stream.Collectors; @Component("queryAGVStatus") public class QueryAGVStatus { + + @Autowired + private DeviceAppService deviceAppService; + public void run() { InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); TaskService taskService = SpringContextHolder.getBean(TaskService.class); @@ -64,6 +73,7 @@ public class QueryAGVStatus { //执行中 String state = json.getString("state"); String carNo = json.getString("vehicle"); + String instructionCode = json.getString("id"); if ("RUNNING".equals(state) || "CREATED".equals(state) || "TOBEDISPATCHED".equals(state) || "WAITING".equals(state)) { instruction.setInstruction_status("1"); instruction.setCarno(carNo); @@ -73,6 +83,15 @@ public class QueryAGVStatus { task.setTask_id(instruction.getTask_id()); instructionService.update(instruction); taskService.update(task); + if (StrUtil.isNotEmpty(instructionCode)){ + Device carCode = deviceAppService.findDeviceByCode(instructionCode); + XgAgvCarDeviceDriver xgAgvCarDeviceDriver; + if (carCode.getDeviceDriver() instanceof XgAgvCarDeviceDriver){ + xgAgvCarDeviceDriver = (XgAgvCarDeviceDriver) carCode.getDeviceDriver(); + xgAgvCarDeviceDriver.setTaskType(AgvActionTypeEnum.getStatus(instruction.getAgv_action_type())); + } + } + } else if ("FINISHED".equals(state)) { instruction.setInstruction_status("2"); try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index c08f6dca4..415bd79ea 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -778,7 +778,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { //如果是放货二次分配,取放货二次分配需要重新追加动作块 if (AgvActionTypeEnum.OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type()) || AgvActionTypeEnum.IN_OUT_STOCK.getCode().equals(instructionDto.getAgv_action_type())) { Integer actionType = ActionTypeEnum.OUT_STOCK.getCode(); - String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); + String newPointCode = applyXGAgvTask(task_code, actionType, instructionDto); // sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), deviceCodeNow, instructionDto); log.info("放货二次分配追加诺宝成功,新点位 - {}", newPointCode); JSONObject map = new JSONObject(); @@ -823,14 +823,14 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { if (address.contains("GET")) { //取货完成 JSONObject jsonObject = agvWaitUtil.waitOutGet(deviceCodeNow, instructionDto); - if (StringUtil.equals("200",jsonObject.getString("status"))){ + if (StringUtil.equals("200", jsonObject.getString("status"))) { log.info("仙工AGV取货完成后离开,设备号 - {}", deviceCodeNow); return jsonObject; } } else if (address.contains("PUT")) { //放货完成 JSONObject jsonObject = agvWaitUtil.waitOutPut(deviceCodeNow, instructionDto); - if (StringUtil.equals("200",jsonObject.getString("status"))){ + if (StringUtil.equals("200", jsonObject.getString("status"))) { log.info("仙工AGV放货完成后离开,设备号 - {}", deviceCodeNow); return jsonObject; } @@ -842,7 +842,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } private String applyCCAgvTask(String task_code, Instruction instructionDto) { - try { JSONObject param = new JSONObject(); param.put("task_code", task_code); LuceneLogDto logDto = LuceneLogDto.builder() @@ -873,12 +872,6 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { luceneExecuteLogService.deviceExecuteLog(logDto2); throw new BadRequestException("叉车二次分配请求lms返回失败"); } - } catch (Exception e) { - e.printStackTrace(); - } - - return null; - } private void sendAddSequencesToCCAgv(String instructionCode, String nextPoint, Instruction instructionDto) { @@ -943,7 +936,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); - agvurl = agvurl + ":" + agvport + "/" + " robotsStatus?vehicles=" + robotCode; + agvurl = agvurl + ":" + agvport + "/" + "robotsStatus?vehicles=" + robotCode; log.info("根据指定机器人查询状态的请求:{}", agvurl); HttpResponse result = HttpRequest.get(agvurl) .timeout(20000)//超时,毫秒 @@ -956,47 +949,44 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { } private String applyXGAgvTask(String task_code, Integer actionType, Instruction instructionDto) { - try { - JSONObject param = new JSONObject(); - param.put("taskCode", task_code); - param.put("actionType", actionType.toString()); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(instructionDto.getCarno()) - .content("二次分配请求lms,参数:" + task_code + "--" + actionType) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - String response = acsToWmsService.secondaryAllocationPoint(param); - JSONObject jo = JSON.parseObject(response); - if (jo.getInteger("status") == 200) { - LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code(instructionDto.getCarno()) - .content("二次分配请求lms,参数,接口返回:" + jo) - .build(); - logDto2.setLog_level(4); - //二次分配更新点位 - updataTask(instructionDto, jo.getString("data")); - luceneExecuteLogService.deviceExecuteLog(logDto2); - if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) { - //请求成功调用诺宝追加动作块 - sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), jo.getString("data"), instructionDto); - } - return jo.getString("data"); - } else { - LuceneLogDto logDto2 = LuceneLogDto.builder() - .device_code(instructionDto.getCarno()) - .content("二次分配请求lms,返回参数:" + jo.getString("body")) - .build(); - logDto2.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto2); - throw new BadRequestException("二次分配请求lms返回失败"); + JSONObject param = new JSONObject(); + param.put("taskCode", task_code); + param.put("actionType", actionType.toString()); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(instructionDto.getCarno()) + .content("二次分配请求lms,参数:" + task_code + "--" + ActionTypeEnum.getStatus(actionType)) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.secondaryAllocationPoint(param); + JSONObject jo = JSON.parseObject(response); + if (jo.getInteger("status") == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(instructionDto.getCarno()) + .content("二次分配请求lms,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + //二次分配更新点位 + updataTask(instructionDto, jo.getString("data")); + luceneExecuteLogService.deviceExecuteLog(logDto2); + if (!ActionTypeEnum.IN_FINISHING.getCode().equals(actionType)) { + //请求成功调用诺宝追加动作块 + sendAddSequencesToNBAgv(instructionDto.getInstruction_code(), jo.getString("data"), instructionDto); } - } catch (Exception e) { - e.printStackTrace(); + return jo.getString("data"); + + } else { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(instructionDto.getCarno()) + .content("二次分配请求lms,返回参数:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + throw new BadRequestException("二次分配请求lms返回失败"); } - return null; + } private void updataTask(Instruction instructionDto, String newPoint) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 5621b9ccf..a0529e88f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -59,7 +59,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { boolean bConnected = true; boolean isReConnect = false; - int i = 1 ; + int i = 1; boolean requireSucessRegion = false; boolean requireSucessTake = false; boolean requireSucessPut = false; @@ -191,7 +191,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { inst.setAgv_jobno(String.valueOf(index)); inst.setSend_status("1"); instructionService.update(inst); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } flag = true; } @@ -219,13 +219,13 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { e.printStackTrace(); } } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); } //请求删除任务 //(需要WCS反馈) else if (phase == 0x30) { // data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0); - data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0, 0, 0); } //任务删除确认 //(需要WCS反馈) @@ -244,21 +244,20 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - try { - standardAutodoorDeviceDriver.writing("to_open", "1"); - standardAutodoorDeviceDriver.writing("to_close", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); - } - if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1) { - log.info("下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - log.info("未下发NDC信号原因: 下发开门信号值为:{},下发关门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); - } + try { + standardAutodoorDeviceDriver.writing("to_open", "1"); + standardAutodoorDeviceDriver.writing("to_close", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); } -// } + if (standardAutodoorDeviceDriver.getOpen() == 1 && standardAutodoorDeviceDriver.getToOpen() == 1) { + log.info("下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getOpen()); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } else { + log.info("未下发NDC信号原因: 下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose()); + } + } } else { log.info(agvaddr + "对应设备号为空!"); } @@ -271,16 +270,20 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - try { - standardAutodoorDeviceDriver.writing("to_close", "1"); - standardAutodoorDeviceDriver.writing("to_open", "0"); - } catch (Exception e) { - log.info("下发电气信号失败:" + e.getMessage()); - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + try { + standardAutodoorDeviceDriver.writing("to_close", "1"); + standardAutodoorDeviceDriver.writing("to_open", "0"); + } catch (Exception e) { + log.info("下发电气信号失败:" + e.getMessage()); + e.printStackTrace(); } -// } + if (standardAutodoorDeviceDriver.getClose() == 1) { + log.info("读取关门信号值为:{}", standardAutodoorDeviceDriver.getClose()); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + } else { + log.info("未下发NDC信号原因: 读取关门信号值为:{}", standardAutodoorDeviceDriver.getClose()); + } + } } else { log.info(device_code + "对应设备号为空!"); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index b0df8826d..8966cb1e9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -893,6 +893,7 @@ public class DeviceServiceImpl extends CommonServiceImpl i celldto.setCreate_time(now); StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class); storageCellMapper.insert(entity); + storageCells.add(celldto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 2957b8233..0a6972572 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -131,12 +131,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // message = "该指令号未找到对应指令:" + ikey; // logServer.deviceExecuteLog(this.device_code, "", "", "该指令号未找到对应指令:" + ikey); // return; - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("当前指令号为:" + inst.getInstruction_code()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); task = taskService.findByTaskCode(inst.getTask_code()); } else { LuceneLogDto logDto = LuceneLogDto.builder() @@ -194,12 +188,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } inst.setCarno(String.valueOf(carno)); instructionService.update(inst); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); } //到达取货点 //(Itype=1/2/3,需要WCS反馈Phase) @@ -257,15 +245,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("任务号为空") .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -276,16 +264,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -293,7 +281,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - try { standardInspectSiteDeviceDriver.writing(1); } catch (Exception e) { @@ -301,19 +288,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -328,18 +313,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "行架不允许取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -353,19 +338,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + "无货不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -380,19 +363,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } 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); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -463,9 +444,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "2"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -475,19 +456,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() - , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -503,7 +482,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (agvaddr < 1) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agv地址参数有误,phase:" + phase) .build(); logDto.setLog_level(2); @@ -529,7 +508,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (ObjectUtil.isEmpty(device_code)) { log.info(agvaddr + "对应设备号为空!"); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("对应设备号为空" + device_code) .build(); logDto.setLog_level(4); @@ -551,37 +530,35 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals("true", this.device.getExtraValue().get("wait").toString()) && StrUtil.equals(task.getTask_type(), "1")) { standardOrdinarySiteDeviceDriver.setOption(0); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } this.setPhase(phase); } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -590,28 +567,26 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String task_code = inst.getTask_code(); - EXECUTOR.submit(() -> { - if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) - && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("task_code", task_code); - LuceneLogDto logDto1 = LuceneLogDto.builder() - .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) - .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) - .build(); - logDto1.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto1); - acsToWmsService.actionFinishRequest2(jsonObject); - } - }); + if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -620,19 +595,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -647,19 +620,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } 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); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货完成反馈,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -674,19 +645,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((standardInspectSiteDeviceDriver.getMove() != 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -700,9 +669,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "3"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -712,19 +681,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } } else { message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() - , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -774,159 +741,151 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { - if (standardOrdinarySiteDeviceDriver.getOption() == 1) { - standardOrdinarySiteDeviceDriver.setAgvphase(0); - String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); - log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); - if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("任务号为空!") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else { - log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); - message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; - logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code()); + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + standardOrdinarySiteDeviceDriver.setAgvphase(phase); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { + if (standardOrdinarySiteDeviceDriver.getOption() == 1) { + standardOrdinarySiteDeviceDriver.setAgvphase(0); + String task_code = standardOrdinarySiteDeviceDriver.getTask_code(); + log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code); + if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) { LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) + .device_code(this.getDeviceCode()) + .content("任务号为空!") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + log.info("等待LMS系统进行确认允许取货,设备号{},指令号{}", device_code, ikey); + message = "等待LMS系统进行确认允许取货,设备号:" + device_code + ",指令号:" + ikey; + logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code()); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) + .device_code(this.getDeviceCode()) + .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { - manipulatorAgvStationDeviceDriver.writing(2); - } catch (Exception e) { - e.printStackTrace(); - } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(2); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() > 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - try { - standardInspectSiteDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { + try { + standardInspectSiteDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); String device_code1 = device.getDevice_code(); @@ -978,16 +937,178 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + + } else if (phase == 0x77) { + if (agvaddr == 0) { + agvaddr = agvaddr_copy; + } + if (agvaddr < 1) { + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agv地址参数有误,phase:" + phase) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + return; + } + if (agvaddr != 0) { + CommonFinalParam commonFinalParam = new CommonFinalParam(); + old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr); + if (StrUtil.contains(old_device_code, commonFinalParam.getBARRE())) { + String[] point = old_device_code.split(commonFinalParam.getBARRE()); + device_code = point[0]; + } else if (StrUtil.contains(old_device_code, commonFinalParam.getPOINT())) { + String[] point = old_device_code.split("\\."); + device_code = point[0]; + emptyNum = point[1]; + } else { + device_code = old_device_code; } } + + device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device_code)) { + log.info(agvaddr + "对应设备号为空!"); + return; + } + if (ObjectUtil.isEmpty(inst)) { + log.info("未找到指令号{}对应的指令", ikey); + return; + } + + String start_device_code = inst.getStart_device_code(); + String next_device_code = inst.getNext_device_code(); + String start_device_code2 = inst.getStart_device_code2(); + String next_device_code2 = inst.getNext_device_code2(); + + if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) { + if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(2); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1") + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } + } +// else { +// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); +// LuceneLogDto logDto = LuceneLogDto.builder() +// .device_code(this.getDeviceCode()) +// .content("agvphase:" + phase + "反馈:" + data) +// .build(); +// logDto.setLog_level(4); +// luceneExecuteLogService.deviceExecuteLog(logDto); +// } + } } + // 取货完毕 //(Itype=1、3,需要WCS反馈) else if (phase == 0x0A) { @@ -1028,137 +1149,155 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) - && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { - standardOrdinarySiteDeviceDriver.setOption(0); - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - standardOrdinarySiteDeviceDriver.setAgvphase(phase); - standardOrdinarySiteDeviceDriver.setIndex(index); - standardOrdinarySiteDeviceDriver.setInst(inst); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(0); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - try { - manipulatorAgvStationDeviceDriver.writing(3); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(3); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - - try { - standardInspectSiteDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { + standardOrdinarySiteDeviceDriver.setOption(0); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + standardOrdinarySiteDeviceDriver.setAgvphase(phase); + standardOrdinarySiteDeviceDriver.setIndex(index); + standardOrdinarySiteDeviceDriver.setInst(inst); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String task_code = inst.getTask_code(); + if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(standardOrdinarySiteDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } + + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(0); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + try { + manipulatorAgvStationDeviceDriver.writing(3); + } catch (Exception e) { + e.printStackTrace(); + } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String task_code = inst.getTask_code(); + if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) + && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("task_code", task_code); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) + .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + acsToWmsService.actionFinishRequest2(jsonObject); + } + } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(3); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); + + try { + standardInspectSiteDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } + } //(Itype=1,上传称重数据) else if (phase == 0x64) { @@ -1186,7 +1325,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic task.setCarno(this.device_code); taskService.update(task); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1237,9 +1376,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1257,9 +1396,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } 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); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1269,7 +1408,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1284,9 +1423,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1295,7 +1434,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1309,9 +1448,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1321,7 +1460,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1331,9 +1470,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(1); if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1343,7 +1482,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() , standardInspectSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1408,9 +1547,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "4"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1423,16 +1562,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1494,9 +1633,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1510,9 +1649,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1525,9 +1664,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1537,7 +1676,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足放货完成反馈,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() , hongXiangStationDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1568,9 +1707,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } 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); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1581,7 +1720,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() , paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); @@ -1591,9 +1730,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(0); if ((standardInspectSiteDeviceDriver.getMove() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1607,9 +1746,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "5"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1622,16 +1761,16 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction() , wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); @@ -1678,8 +1817,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) @@ -1695,95 +1833,95 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + this.setPhase(phase); + + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + + try { + manipulatorAgvStationDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - this.setPhase(phase); - - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - - try { - manipulatorAgvStationDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(1); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(4); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { + } else { + message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(1); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() == 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() + , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(4); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() + , paperTubePickSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class); String device_code1 = device.getDevice_code(); @@ -1841,14 +1979,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } //放货完成 @@ -1891,8 +2028,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic return; } String agv_inst_type = inst.getAgv_inst_type(); - if (StrUtil.equals(agv_inst_type, CommonFinalParam.ONE) || StrUtil.equals(agv_inst_type, "3")) { - if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { // standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); // if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait")) // && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString()) @@ -1908,91 +2044,90 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - this.setPhase(phase); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + this.setPhase(phase); - } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { - manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); - try { - manipulatorAgvStationDeviceDriver.writing(5); - } catch (Exception e) { - e.printStackTrace(); - } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { + manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); + try { + manipulatorAgvStationDeviceDriver.writing(5); + } catch (Exception e) { + e.printStackTrace(); + } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { + paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); + try { + paperTubePickSiteDeviceDriver.writing(5); + } catch (Exception e) { + e.printStackTrace(); + } + if (paperTubePickSiteDeviceDriver.getAction() == 1 + && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) + .device_code(this.getDeviceCode()) .content("agvphase:" + phase + "反馈:" + data) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { - paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); - try { - paperTubePickSiteDeviceDriver.writing(5); - } catch (Exception e) { - e.printStackTrace(); - } - if (paperTubePickSiteDeviceDriver.getAction() == 1 - && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() - , paperTubePickSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { - hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); - try { - hongXiangStationDeviceDriver.writing(0); - } catch (Exception e) { - e.printStackTrace(); - } - if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } else { - message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() - , hongXiangStationDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() + , paperTubePickSiteDeviceDriver.getError(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) + .device_code(this.getDeviceCode()) + .content(message) .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } + } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { + hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); + try { + hongXiangStationDeviceDriver.writing(0); + } catch (Exception e) { + e.printStackTrace(); + } + if (hongXiangStationDeviceDriver.getMove() > 0) { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() + , hongXiangStationDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } + } else { + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.getDeviceCode()) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } //上传AGV电量 @@ -2136,6 +2271,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic TwoNDCSocketConnectionAutoRun.write(data); } } + } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java index 2a275b95a..fd203e5f7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java @@ -180,6 +180,11 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device */ private int unlock = 0; + /** + * agv二次分配类型(1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配) + */ + private String taskType = ""; + String device_code = null; String container; @@ -211,9 +216,9 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device @Override public JSONObject getDeviceStatusName() { Map map = new LinkedHashMap<>(); - try{ + try { getAgvStatus(); - }catch (Exception e){ + } catch (Exception e) { message = "获取机器人状态报错"; } String isError; @@ -241,8 +246,10 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device map.put("low_battery", low_battery ? "低电量": "正常"); map.put("suspended", suspended ? "订单被暂停,需要人工手动恢复": "正常"); map.put("message", message); + map.put("agv_task_type", taskType); map.put("unconfirmed_reloc", unconfirmed_reloc ? "未确认定位" : "正常"); - map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ?"控制权没有被抢占" : "未知"); + map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ? "控制权没有被抢占" : "未知"); + map.put("move_2","有货"); JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java index 8314b69aa..a8d84782f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java @@ -66,18 +66,11 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem logServer.deviceExecuteLog(this.device_code, "", "", "信号open:" + last_open + "->" + open); } if (close != last_close) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号close:" + last_close + "->" + close); if(close ==1 ){ this.writing("to_close","0"); } } - if (toClose != last_toClose) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号toClose:" + last_toClose + "->" + toClose); - } - if (toOpen != last_toOpen) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号toOpen:" + last_toOpen + "->" + toOpen); - } last_open = open; last_close = close; last_toClose = toClose; @@ -86,11 +79,15 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem public void writing(String param, String value) { -// String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() -// + "." + param; -// Map itemMap = new HashMap(); -// itemMap.put(to_param, Integer.parseInt(value)); - + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + Map itemMap = new HashMap(); + itemMap.put(to_param, Integer.parseInt(value)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); try { this.toDoorCommandControl.control(param,value); } catch (Exception e) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index fd0baa6f1..48d455a21 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -404,7 +404,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements luceneExecuteLogService.deviceExecuteLog(logDto); String response = acsToWmsService.applyTwo(param); JSONObject jo = JSON.parseObject(response); - message = "申请空托盘出入库,返回参数:" + jo.getString("body"); + message = "申请空托盘出入库,返回参数:" + jo; if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) @@ -420,6 +420,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements this.writing(list1); this.requireSucess = true; } else { + this.iserror = false; + message = "申请空托盘出入库出错,返回参数:" + jo; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,返回参数:" + response) @@ -775,7 +777,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java index c0eba6b43..0413bc49e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/standard_ordinary_site/StandardOrdinarySiteDeviceDriver.java @@ -236,11 +236,11 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple String move = ""; String option = ""; if (this.getOption() == 0) { - action = LangProcess.msg("universal_actionMessage1"); + option = LangProcess.msg("universal_actionMessage1"); } else if (this.getOption() == 1) { - action = LangProcess.msg("universal_actionMessage2"); + option = LangProcess.msg("universal_actionMessage2"); } else if (this.getOption() == 2) { - action = LangProcess.msg("universal_actionMessage3"); + option = LangProcess.msg("universal_actionMessage3"); } if (this.getMode() == 0) { mode = LangProcess.msg("universal_off-line"); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index 28809ae64..0c5a6911b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -196,7 +196,8 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i if (move != 0 && task > 0) { if (null!=inst) { inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); - } update_instruction_status(); + } + update_instruction_status(); } } catch (Exception var17) { var17.printStackTrace(); @@ -388,7 +389,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i logServer.deviceExecuteLog(this.device_code, "", "", "二楼到一楼输送线申请行架任务,参数:" + param); String response = acsToWmsService.applyTowToOne(param); JSONObject jo = JSON.parseObject(response); - message = "二楼到一楼输送线申请行架任务,返回参数:" + jo.getString("body"); + message = "二楼到一楼输送线申请行架任务,返回参数:" + jo; if (response == null || jo.getInteger("status") == 200) { List list1 = new ArrayList(); Map map = new HashMap(); @@ -404,9 +405,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i luceneExecuteLogService.deviceExecuteLog(logDto2); this.requireSucess = true; } else { + this.iserror = false; + message = "二楼到一楼输送线申请行架任务报错,返回参数:" + jo; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("二楼到一楼输送线申请行架任务,返回参数:" + jo.getString("body")) + .content("二楼到一楼输送线申请行架任务,返回参数:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index c7cbe6c35..0d8616910 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -387,6 +387,9 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.writing(list); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,返回参数:" + jo); requireSucess = true; + }else { + message = "申请AGV任务报错,参数,接口返回:" + jo; + this.iserror = false; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index b6beca382..7398be39b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -358,7 +358,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr String response = acsToWmsService.deviceApplyTwo(param); JSONObject jo = JSON.parseObject(response); message = "申请捆扎,参数,接口返回:" + jo; - if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) { + if ( jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请捆扎,参数,接口返回:" + jo) @@ -369,12 +369,15 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr packagePLCData(jo.getString("data"), mode); requireSucess = true; } else { + this.iserror = false; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请捆扎失败,接口返回:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); + message = "申请捆扎报错,参数,接口返回:" + jo; + } } @@ -402,6 +405,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr param.put("type", AcsToLmsApplyTaskTypeEnum.LABEL.getType()); String response = acsToWmsService.deviceApplyTwo(param); JSONObject jo = JSON.parseObject(response); + message = "申请贴标,参数,接口返回:" + jo; if (jo.getInteger("status") == 200) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) @@ -422,9 +426,11 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr // Map datas = applyLabelingAndBindingResponse.getData(); requireSucess = true; } else { + this.iserror = false; + message = "申请贴标报错,接口返回:" + jo; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请贴标失败,接口返回:" + jo.getString("body")) + .content("申请贴标失败,接口返回:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java index 02eec0ed5..0b4fd52f2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -610,6 +610,8 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements this.writing(list1); this.requireSucess = true; } else { + this.iserror = false; + message = "申请空托盘出入库报错,接口返回:" + jo; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,返回参数:" + response) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index e9c00f1fe..fe1286642 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -444,6 +444,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv map2.put("value", 23); list2.add(map2); this.writing(list2); + requireSucess = true; } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) @@ -451,6 +452,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); + message = "申请高度等级报错,返回参数:" + jo; } } catch (Exception e) { e.printStackTrace(); @@ -511,6 +513,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); + message = "申请退货入库报错,返回参数:" + jo; } } catch (Exception e) { e.printStackTrace(); @@ -614,6 +617,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv this.writing(list1); this.requireSucess = true; } else { + this.iserror = false; + message = "申请空托盘出入库报错,返回参数:" + jo; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("申请空托盘出入库,返回参数:" + response) @@ -675,12 +680,15 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv map.put("value", mode); list1.add(map); this.writing(list1); + requireSucess = true; } else { + this.iserror = false; LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("木箱、子卷入库申请入库任务,返回参数:" + response) .build(); logDto2.setLog_level(4); + message = "木箱、子卷入库申请入库任务报错,返回参数:" + jo; luceneExecuteLogService.deviceExecuteLog(logDto2); } } catch (Exception e) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java index 63259bcdd..37bf7ca51 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/un_box_lable_conveyor/UnBoxLableConveyorDeviceDriver.java @@ -264,7 +264,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); - + requireSucess = true; packagePLCData(jo); String isUncap = jo.getString("isUncap"); if ("1".equals(isUncap)){ @@ -285,6 +285,9 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl finish_instruction(inst); } + }else { + message = "木箱开盖报错,返回参数:" + jo; + this.iserror = false; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/ItemProtocol.java new file mode 100644 index 000000000..e0ad618d8 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/ItemProtocol.java @@ -0,0 +1,113 @@ +package org.nl.acs.device_driver.one_manipulator.rgv; + +import cn.hutool.core.util.StrUtil; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Data +public class +ItemProtocol { + + //心跳 + public static String item_heartbeat = "heartbeat"; + //工作模式 + public static String item_mode = "mode"; + //光电信号 + public static String item_move = "move"; + //动作信号 + public static String item_action = "action"; + //行走列 + public static String item_walk_y = "walk_y"; + //任务号 + public static String item_task = "task"; + //报警 + public static String item_error = "error"; + + + + + private OneRgvDeviceDriver driver; + + public ItemProtocol(OneRgvDeviceDriver driver){ + this.driver=driver; + } + + public int getHeartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getMode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getMove() { + return this.getOpcIntegerValue(item_move); + } + + public int getAction() { + return this.getOpcIntegerValue(item_action); + } + + public int getWalk_y() { + return this.getOpcIntegerValue(item_walk_y); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + + public int getTask() { + return this.getOpcIntegerValue(item_task); + } + + + + + + Boolean isonline; + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + } + + public String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (StrUtil.isBlank(value)) { + + } else { + return value; + } + return "0"; + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); + list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); + list.add(new ItemDto(item_move, "光电信号", "DB1.B2")); + list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); + list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); + list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); + list.add(new ItemDto(item_task, "任务号", "DB1.D6")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList<>(); + return list; + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDefination.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDefination.java new file mode 100644 index 000000000..d6cbe17eb --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDefination.java @@ -0,0 +1,57 @@ +package org.nl.acs.device_driver.one_manipulator.rgv; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device.enums.DeviceType; + +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.springframework.stereotype.Service; + +import java.util.LinkedList; +import java.util.List; + +@Service +public class OneRgvDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "one_rgv"; + } + + @Override + public String getDriverName() { + return "一楼rgv"; + } + + @Override + public String getDriverDescription() { + return "一楼rgv"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new OneRgvDeviceDriver()).setDevice(device).setDriverDefination(this); + } + + @Override + public Class getDeviceDriverType() { + return OneRgvDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.rgv); + return types; + } + + @Override + public List getReadableItemDtos() { + return ItemProtocol.getReadableItemDtos(); + } + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDeviceDriver.java new file mode 100644 index 000000000..d1d4ca998 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/rgv/OneRgvDeviceDriver.java @@ -0,0 +1,372 @@ +package org.nl.acs.device_driver.one_manipulator.rgv; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device.service.DeviceExtraService; +import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.FeedLmsRealFailed; +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.ext.wms.data.ApplyManipulatorActionRequest; +import org.nl.acs.ext.wms.data.ApplyManipulatorActionResponse; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.history.ErrorUtil; +import org.nl.acs.history.service.DeviceErrorLogService; +import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; +import org.nl.acs.instruction.domain.Instruction; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.route.service.impl.RouteLineServiceImpl; +import org.nl.acs.task.service.TaskService; +import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * RGV + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class OneRgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { + + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + @Autowired + DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + @Autowired + RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class); + @Autowired + DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); + @Autowired + DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + + //工作模式 + int mode = 0; + int last_mode = 0; + //光电信号 + int move = 0; + int last_move = 0; + //动作信号 + int action = 0; + int last_action = 0; + //行走列 + int walk_y = 0; + int last_walk_y = 0; + //报警信号 + int error = 0; + int last_error = 0; + //任务号 + int task = 0; + int last_task = 0; + //气涨轴条码 + String barcode; + String last_barcode; + + + int heartbeat = 0; + int last_heartbeat = 0; + + + + String to_sub_volume_no; + String last_to_sub_volume_no; + + Boolean isonline = true; + int hasGoods = 0; + String message = null; + Boolean iserror = false; + private Date instruction_update_time = new Date(); + private int instruction_update_time_out = 1000; + Integer heartbeat_tag; + private Date instruction_require_time = new Date(); + + private int instruction_require_time_out = 3000; + //行架机械手申请任务成功标识 + boolean requireSucess = false; + + private int instruction_finished_time_out; + + int branchProtocol = 0; + private String error_type = "hxhj_error_type"; + + //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 + int flag; + + String device_code; + + String left = "1"; + String right = "2"; + + //当前指令 + Instruction inst = null; + + //0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成 + int now_steps_type = 0; + String notCreateTaskMessage = ""; + String notCreateInstMessage = ""; + String feedMessage = ""; + + + List getDeviceCodeList = null; + + List putDeviceCodeList = null; + + + @Override + public Device getDevice() { + return this.device; + } + + @Override + public void execute() { + String message = null; + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + move = this.itemProtocol.getMove(); + action = this.itemProtocol.getAction(); + walk_y = this.itemProtocol.getWalk_y(); + error = this.itemProtocol.getError(); + task = this.itemProtocol.getTask(); + heartbeat = this.itemProtocol.getHeartbeat(); + + + if (mode != last_mode) { + requireSucess = false; + } + + + } catch (Exception var17) { + var17.printStackTrace(); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); + + } + + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + + + } + last_mode = mode; + last_move = move; + last_action = action; + last_walk_y = walk_y; + last_error = error; + last_task = task; + last_heartbeat = heartbeat; + last_barcode = barcode; + + } + + /** + * // * 申请任务 + * // * + * // * @param + * // + */ + public synchronized void applyTask() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; + String direction = (String) this.getDevice().getExtraValue().get("direction"); + applyManipulatorActionRequest.setDevice_code(device_code); + applyManipulatorActionRequest.setDirection(direction);//rgv申请位置 + applyManipulatorActionRequest.setQzz_no(String.valueOf(barcode));//气涨轴编码 + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + Map map = new LinkedHashMap<>(); + if (applyManipulatorActionResponse.getstatus() == 200) { + Map data = applyManipulatorActionResponse.getData(); + String point_code2 = data.get("point_code2");//目标站点 + Device deviceByCode = deviceAppService.findDeviceByCode(point_code2); + String address = deviceByCode.getExtraValue().get("address").toString(); + String material_code = data.get("material_code");//子卷号 + String to_is_labeling = data.get("to_is_labeling");//是否贴标 + map.put("to_target", address); + map.put("to_sub_volume_no", material_code); + map.put("to_command", "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 = "universal_message12"; + requireSucess = true; + } else { + map.put("to_command", 99); + this.writing(map); + requireSucess = true; + message = "universal_message13"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse); + } + } + + public void writing(Map map) { + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + Map itemMap = new LinkedHashMap<>(); + map.forEach((key, value) -> { + if (ObjectUtil.isNotEmpty(value)) { + itemMap.put(getToParam() + key, value); + } + }); + if (ObjectUtil.isNotEmpty(itemMap)) { + this.control(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); + } + } + + public String getToParam() { + return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "."; + } + + @Override + public JSONObject getDeviceStatusName() { + Map map = new LinkedHashMap<>(); + + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + + if (this.getMove() == 0) { + move = LangProcess.msg("universal_no"); + map.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = LangProcess.msg("universal_yes"); + map.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = LangProcess.msg("universal_two_yes"); + map.put("hasGoods", true); + } + + String requireSucess = LangProcess.msg("universal_actionMessage4"); + if (this.requireSucess) { + requireSucess = LangProcess.msg("universal_actionMessage5"); + } + map.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = LangProcess.msg("universal_delivery"); + } else if (this.getAction() == 2) { + action = LangProcess.msg("universal_completed"); + } else if (this.getAction() == 3) { + action = LangProcess.msg("universal_releasing"); + } else if (this.getAction() == 4) { + action = LangProcess.msg("universal_releasing_completed"); + } + + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + /*jo.put("action", action);*/ + /*jo.put("task", task);*/ + /*jo.put("walk_y", this.walk_y);*/ + map.put("isOnline", this.getIsonline()); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", LangProcess.msg(message)); + /*jo.put("notCreateTaskMessage", notCreateTaskMessage); + jo.put("notCreateInstMessage",notCreateInstMessage);*/ + map.put("feedMessage", LangProcess.msg(feedMessage)); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + String requestSucess = data.getString("requireSucess"); + if (StrUtil.equals(requestSucess, "0")) { + this.requireSucess = false; + } else if (StrUtil.equals(requestSucess, "1")) { + this.requireSucess = true; + } + } + + @Override + public JSONObject feedLmsRealFailedInfo() { + JSONObject jo = new JSONObject(); + jo.put("device_code", this.getDevice().getDevice_code()); + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("fault_code", String.valueOf(error)); + jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError()))); + jo.put("fault_type", error_type); + return jo; + } + + + public Instruction checkInst() { + if (ObjectUtil.isNotEmpty(this.inst)) { + if (this.task > 0) { + if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) { + return this.inst; + } else { + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + return inst; + } + } + } else { + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + return inst; + } + return null; + } + +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java new file mode 100644 index 000000000..b257434dc --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/ItemProtocol.java @@ -0,0 +1,113 @@ +package org.nl.acs.device_driver.one_manipulator.standard_manipulator; + +import cn.hutool.core.util.StrUtil; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Data +public class +ItemProtocol { + + //心跳 + public static String item_heartbeat = "heartbeat"; + //工作模式 + public static String item_mode = "mode"; + //光电信号 + public static String item_move = "move"; + //动作信号 + public static String item_action = "action"; + //行走列 + public static String item_walk_y = "walk_y"; + //任务号 + public static String item_task = "task"; + //报警 + public static String item_error = "error"; + + + + + private StandardManipulatoDeviceDriver driver; + + public ItemProtocol(StandardManipulatoDeviceDriver driver){ + this.driver=driver; + } + + public int getHeartbeat() { + return this.getOpcIntegerValue(item_heartbeat); + } + + public int getMode() { + return this.getOpcIntegerValue(item_mode); + } + + public int getMove() { + return this.getOpcIntegerValue(item_move); + } + + public int getAction() { + return this.getOpcIntegerValue(item_action); + } + + public int getWalk_y() { + return this.getOpcIntegerValue(item_walk_y); + } + + public int getError() { + return this.getOpcIntegerValue(item_error); + } + + + public int getTask() { + return this.getOpcIntegerValue(item_task); + } + + + + + + Boolean isonline; + + public int getOpcIntegerValue(String protocol) { + Integer value = this.driver.getIntegeregerValue(protocol); + if (value == null) { + // log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!"); + setIsonline(false); + } else { + setIsonline(true); + return value; + } + return 0; + } + + public String getOpcStringValue(String protocol) { + String value = this.driver.getStringValue(protocol); + if (StrUtil.isBlank(value)) { + + } else { + return value; + } + return "0"; + } + + public static List getReadableItemDtos() { + ArrayList list = new ArrayList<>(); + list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0")); + list.add(new ItemDto(item_mode, "工作模式", "DB1.B1")); + list.add(new ItemDto(item_move, "光电信号", "DB1.B2")); + list.add(new ItemDto(item_action, "动作信号", "DB1.B3")); + list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); + list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); + list.add(new ItemDto(item_task, "任务号", "DB1.D6")); + return list; + } + + public static List getWriteableItemDtos() { + ArrayList list = new ArrayList<>(); + return list; + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java new file mode 100644 index 000000000..ca1adc0b7 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatoDeviceDriver.java @@ -0,0 +1,372 @@ +package org.nl.acs.device_driver.one_manipulator.standard_manipulator; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.Data; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device.service.DeviceExtraService; +import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.FeedLmsRealFailed; +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.ext.wms.data.ApplyManipulatorActionRequest; +import org.nl.acs.ext.wms.data.ApplyManipulatorActionResponse; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.history.ErrorUtil; +import org.nl.acs.history.service.DeviceErrorLogService; +import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; +import org.nl.acs.instruction.domain.Instruction; +import org.nl.acs.instruction.service.InstructionService; +import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.monitor.DeviceStageMonitor; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; +import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.route.service.impl.RouteLineServiceImpl; +import org.nl.acs.task.service.TaskService; +import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * RGV + */ +@Slf4j +@Data +@RequiredArgsConstructor +public class StandardManipulatoDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { + + protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + @Autowired + TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); + @Autowired + InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + @Autowired + DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); + @Autowired + RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class); + @Autowired + DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); + @Autowired + DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + @Autowired + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class); + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + + //工作模式 + int mode = 0; + int last_mode = 0; + //光电信号 + int move = 0; + int last_move = 0; + //动作信号 + int action = 0; + int last_action = 0; + //行走列 + int walk_y = 0; + int last_walk_y = 0; + //报警信号 + int error = 0; + int last_error = 0; + //任务号 + int task = 0; + int last_task = 0; + //气涨轴条码 + String barcode; + String last_barcode; + + + int heartbeat = 0; + int last_heartbeat = 0; + + + + String to_sub_volume_no; + String last_to_sub_volume_no; + + Boolean isonline = true; + int hasGoods = 0; + String message = null; + Boolean iserror = false; + private Date instruction_update_time = new Date(); + private int instruction_update_time_out = 1000; + Integer heartbeat_tag; + private Date instruction_require_time = new Date(); + + private int instruction_require_time_out = 3000; + //行架机械手申请任务成功标识 + boolean requireSucess = false; + + private int instruction_finished_time_out; + + int branchProtocol = 0; + private String error_type = "hxhj_error_type"; + + //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 + int flag; + + String device_code; + + String left = "1"; + String right = "2"; + + //当前指令 + Instruction inst = null; + + //0 无任务执行 1更新指令状态 2下发电气信号 3允许取货 允许放货 5放货完成 + int now_steps_type = 0; + String notCreateTaskMessage = ""; + String notCreateInstMessage = ""; + String feedMessage = ""; + + + List getDeviceCodeList = null; + + List putDeviceCodeList = null; + + + @Override + public Device getDevice() { + return this.device; + } + + @Override + public void execute() { + String message = null; + try { + device_code = this.getDeviceCode(); + mode = this.itemProtocol.getMode(); + move = this.itemProtocol.getMove(); + action = this.itemProtocol.getAction(); + walk_y = this.itemProtocol.getWalk_y(); + error = this.itemProtocol.getError(); + task = this.itemProtocol.getTask(); + heartbeat = this.itemProtocol.getHeartbeat(); + + + if (mode != last_mode) { + requireSucess = false; + } + + + } catch (Exception var17) { + var17.printStackTrace(); + logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)); + + } + + if (mode == 0) { + this.setIsonline(false); + message = "universal_off-line"; + //有报警 + } else if (error != 0) { + this.setIserror(true); + message = "universal_message3"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + Instruction instruction = null; + List toInstructions; + + + + } + last_mode = mode; + last_move = move; + last_action = action; + last_walk_y = walk_y; + last_error = error; + last_task = task; + last_heartbeat = heartbeat; + last_barcode = barcode; + + } + + /** + * // * 申请任务 + * // * + * // * @param + * // + */ + public synchronized void applyTask() { + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + ApplyManipulatorActionResponse applyManipulatorActionResponse; + String direction = (String) this.getDevice().getExtraValue().get("direction"); + applyManipulatorActionRequest.setDevice_code(device_code); + applyManipulatorActionRequest.setDirection(direction);//rgv申请位置 + applyManipulatorActionRequest.setQzz_no(String.valueOf(barcode));//气涨轴编码 + applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); + Map map = new LinkedHashMap<>(); + if (applyManipulatorActionResponse.getstatus() == 200) { + Map data = applyManipulatorActionResponse.getData(); + String point_code2 = data.get("point_code2");//目标站点 + Device deviceByCode = deviceAppService.findDeviceByCode(point_code2); + String address = deviceByCode.getExtraValue().get("address").toString(); + String material_code = data.get("material_code");//子卷号 + String to_is_labeling = data.get("to_is_labeling");//是否贴标 + map.put("to_target", address); + map.put("to_sub_volume_no", material_code); + map.put("to_command", "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 = "universal_message12"; + requireSucess = true; + } else { + map.put("to_command", 99); + this.writing(map); + requireSucess = true; + message = "universal_message13"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse); + } + } + + public void writing(Map map) { + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + Map itemMap = new LinkedHashMap<>(); + map.forEach((key, value) -> { + if (ObjectUtil.isNotEmpty(value)) { + itemMap.put(getToParam() + key, value); + } + }); + if (ObjectUtil.isNotEmpty(itemMap)) { + this.control(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); + } + } + + public String getToParam() { + return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "."; + } + + @Override + public JSONObject getDeviceStatusName() { + Map map = new LinkedHashMap<>(); + + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + + if (this.getMove() == 0) { + move = LangProcess.msg("universal_no"); + map.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = LangProcess.msg("universal_yes"); + map.put("hasGoods", true); + } else if (this.getMove() == 2) { + move = LangProcess.msg("universal_two_yes"); + map.put("hasGoods", true); + } + + String requireSucess = LangProcess.msg("universal_actionMessage4"); + if (this.requireSucess) { + requireSucess = LangProcess.msg("universal_actionMessage5"); + } + map.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = LangProcess.msg("universal_delivery"); + } else if (this.getAction() == 2) { + action = LangProcess.msg("universal_completed"); + } else if (this.getAction() == 3) { + action = LangProcess.msg("universal_releasing"); + } else if (this.getAction() == 4) { + action = LangProcess.msg("universal_releasing_completed"); + } + + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("move", move); + /*jo.put("action", action);*/ + /*jo.put("task", task);*/ + /*jo.put("walk_y", this.walk_y);*/ + map.put("isOnline", this.getIsonline()); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("isError", this.getIserror()); + map.put("message", LangProcess.msg(message)); + /*jo.put("notCreateTaskMessage", notCreateTaskMessage); + jo.put("notCreateInstMessage",notCreateInstMessage);*/ + map.put("feedMessage", LangProcess.msg(feedMessage)); + map.put("driver_type", "siemens_conveyor"); + map.put("is_click", true); + JSONObject jo = new JSONObject(map); + return jo; + } + + @Override + public void setDeviceStatus(JSONObject data) { + String requestSucess = data.getString("requireSucess"); + if (StrUtil.equals(requestSucess, "0")) { + this.requireSucess = false; + } else if (StrUtil.equals(requestSucess, "1")) { + this.requireSucess = true; + } + } + + @Override + public JSONObject feedLmsRealFailedInfo() { + JSONObject jo = new JSONObject(); + jo.put("device_code", this.getDevice().getDevice_code()); + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("fault_code", String.valueOf(error)); + jo.put("fault_info", ErrorUtil.getDictDetail(error_type, String.valueOf(this.getError()))); + jo.put("fault_type", error_type); + return jo; + } + + + public Instruction checkInst() { + if (ObjectUtil.isNotEmpty(this.inst)) { + if (this.task > 0) { + if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) { + return this.inst; + } else { + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + return inst; + } + } + } else { + inst = instructionService.findByCodeFromCache(String.valueOf(task)); + return inst; + } + return null; + } + +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatorDefination.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatorDefination.java new file mode 100644 index 000000000..9e286a02c --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/standard_manipulator/StandardManipulatorDefination.java @@ -0,0 +1,56 @@ +package org.nl.acs.device_driver.one_manipulator.standard_manipulator; + +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; +import org.nl.acs.device.domain.Device; +import org.nl.acs.device.enums.DeviceType; +import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination; +import org.springframework.stereotype.Service; + +import java.util.LinkedList; +import java.util.List; + +@Service +public class StandardManipulatorDefination implements OpcDeviceDriverDefination { + @Override + public String getDriverCode() { + return "standard_manipulator"; + } + + @Override + public String getDriverName() { + return "标准版机械手"; + } + + @Override + public String getDriverDescription() { + return "标准版机械手"; + } + + @Override + public DeviceDriver getDriverInstance(Device device) { + return (new StandardManipulatoDeviceDriver()).setDevice(device).setDriverDefination(this); + } + + @Override + public Class getDeviceDriverType() { + return StandardManipulatoDeviceDriver.class; + } + + @Override + public List getFitDeviceTypes() { + List types = new LinkedList(); + types.add(DeviceType.robot); + return types; + } + + @Override + public List getReadableItemDtos() { + return ItemProtocol.getReadableItemDtos(); + } + + @Override + public List getWriteableItemDtos() { + return ItemProtocol.getWriteableItemDtos(); + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index c67a73278..4ac8ed7ad 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -17,12 +17,12 @@ import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver; -import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver; -import org.nl.acs.device_driver.one_manipulator.trapped_manipulator.InteractionJsonDTO; import org.nl.acs.enums.VolumeTwoTypeEnum; +import org.nl.acs.ext.wms.service.AcsToWmsService; +import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; @@ -34,6 +34,7 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; +import org.nl.acs.task.enums.ActionTypeEnum; import org.nl.acs.task.enums.TaskStatusEnum; import org.nl.acs.task.enums.TaskTypeEnum; import org.nl.acs.task.service.TaskService; @@ -49,7 +50,7 @@ import java.util.*; import java.util.stream.Collectors; /** - * 捆扎智能行架 + * 子卷下线行架 */ @Slf4j @Data @@ -58,6 +59,8 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi protected ItemProtocol itemProtocol = new ItemProtocol(this); + AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);; + DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); @@ -192,6 +195,17 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi } updateInstructionStatus(); } + //四个点行架任务,满轴放货完成后调lms生成rgv任务 + if (action == 6 && task > 0 ){ + Integer actionType = ActionTypeEnum.RELEASE_FINISHING.getCode(); + creatAGV(actionType,action); + } + + //空载具取货完成 + if (action == 7 && task > 0 ){ + Integer actionType = ActionTypeEnum.IN_FINISHING.getCode(); + creatAGV(actionType, action); + } } catch (Exception var17) { var17.printStackTrace(); @@ -264,6 +278,45 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi last_to_type = to_type; } + private void creatAGV(Integer actionType, int toCommand) { + Instruction instruction = checkInst(); + JSONObject param = new JSONObject(); + param.put("taskCode", instruction.getTask_code()); + param.put("actionType",actionType ); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("行架取放货完成请求lms,参数:" + task + "--" +ActionTypeEnum.RELEASE_FINISHING.getStatus()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + String response = acsToWmsService.secondaryAllocationPoint(param); + JSONObject jo = JSON.parseObject(response); + if (jo.getInteger("status") == 200) { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("行架取放货完成请求lms,参数,接口返回:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + Map map1 = new HashMap<>(); + List list = new ArrayList(); + map1.put("code", "to_command"); + map1.put("value", toCommand); + list.add(map1); + this.writing(list); + + } else { + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("行架取放货完成请求lms,返回参数:" + jo) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + throw new BadRequestException("行架取放货完成请求lms返回失败"); + } + + } + private void updateInstructionStatus() { Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java index b360affef..17e576700 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/paper_tube_pick_site/PaperTubePickSiteDeviceDriver.java @@ -231,6 +231,13 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("device_code",this.getDevice_code()); jo.put("row_num",this.getPaper_location()); jo.put("material_code",this.getPaper_code()); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈管芯抓取位,请求参数:" + jo) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈管芯抓取位,参数:" + jo); HttpResponse httpResponse = acsToWmsService.feedbackDies(jo); JSONObject jsonObject = null; if(ObjectUtil.isNotEmpty(httpResponse)){ @@ -242,22 +249,28 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple map.put("to_command", 6); try { this.writing(map); - } catch (Exception e) { - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) - .content("下发信号报错" + map) + .content("反馈管芯抓取位,返回参数" + jsonObject) .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + } catch (Exception e) { + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈管芯抓取位" + map) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); } return true; }else{ - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) .content("反馈LMS管芯失败" + httpResponse.body()) .build(); - logDto.setLog_level(3); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); return false; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java index 8f29094fc..228fd1aba 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java @@ -128,7 +128,7 @@ ItemProtocol { list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); - list.add(new ItemDto(item_barcode, "任务号", "DB1.B7")); + list.add(new ItemDto(item_barcode, "气胀轴编号", "DB1.B7")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index 299e594be..7a56ad856 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java @@ -258,10 +258,28 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDirection(direction);//rgv申请位置 applyManipulatorActionRequest.setQzz_no(String.valueOf(barcode));//气涨轴编码 + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_FOUR); + param.put("barcode", String.valueOf(barcode)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,请求参数" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV工位上有货申请行架任务,请求参数:" + param); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); if (applyManipulatorActionResponse.getstatus() == 200) { Map data = applyManipulatorActionResponse.getData(); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,返回参数" + data) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "RGV工位上有货申请行架任务,返回参数:" + data); String point_code2 = data.get("point_code2");//目标站点 Device deviceByCode = deviceAppService.findDeviceByCode(point_code2); String address = deviceByCode.getExtraValue().get("address").toString(); @@ -276,7 +294,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr map.put("to_is_labeling","0"); } this.writing(map); - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + data); message = "universal_message12"; requireSucess = true; } else { @@ -284,7 +302,13 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr this.writing(map); requireSucess = true; message = "universal_message13"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("RGV工位上有货申请行架任务,返回参数" + applyManipulatorActionResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务反馈失败,返回参数:" + applyManipulatorActionResponse.getData()); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index 29830a0b3..a06536da4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -294,6 +294,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme Boolean iserror = false; + String inst_message; + @Override public Device getDevice() { @@ -334,6 +336,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme // 更新指令状态 if (mode == 3 && task > 0 && command == 1 && error == 0) { + if (null!=inst) { + inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code(); + } Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); @@ -1240,6 +1245,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); jo.put("notCreateInstMessage", notCreateInstMessage); + jo.put("inst_message", this.inst_message); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java index f7590d4e4..3234ae286 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/hongxiang_device/HongXiangConveyorDeviceDriver.java @@ -252,7 +252,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -280,7 +280,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } @@ -301,7 +301,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发电气信号:" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { @@ -352,7 +352,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java index 74fd1b629..9363ec78d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java @@ -144,6 +144,7 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java index 92567876c..989812f8c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/manipulator_agv_station/ToCommandControl.java @@ -6,6 +6,10 @@ import com.alibaba.fastjson.JSONObject; import org.nl.acs.device_driver.driver.ItemValue; import org.nl.acs.device_driver.stacker.standard_stacker.ItemProtocol; import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver; +import org.nl.config.SpringContextHolder; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; +import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap; import java.util.Map; @@ -18,6 +22,9 @@ public class ToCommandControl { this.driver = driver; } + @Autowired + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); + public void control(int command) throws Exception { // ItemValue[] itemValues = new ItemValue[]{new ItemValue(this.driver.getItem(ItemProtocol.item_to_command), command)}; Map itemMap = new HashMap(); @@ -26,6 +33,12 @@ public class ToCommandControl { Object obj = command; itemMap.put(to_param, obj); this.driver.checkcontrol(itemMap); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(this.driver.getDevice().getDevice_code()) + .content("下发多个电气信号" + itemMap) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 1e5da9b03..c7bca193b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -1236,7 +1236,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("下发电气信号:" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 7f1b91ad9..cf10cf5f3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -304,19 +304,24 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); + logServer.deviceExecuteLog(this.device_code,"","","申请套管"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE); //气涨轴尺寸 applyPlugPullSiteRequest.setSize(String.valueOf(size)); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_ONE); + param.put("size", String.valueOf(size)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管任务,请求参数::" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() @@ -359,7 +364,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_qty1", number); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套管成功,返回参数:" + applyPlugPullSitResponse.getData()); message = "申请套管成功"; } if (StrUtil.equals("2", is_bushing)){ @@ -368,7 +373,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "不套管,送空气轴"; - logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("不套管,送空气轴,下发电气信号to_command:97") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", message); } if (StrUtil.equals("0", is_bushing)){ Map map = new LinkedHashMap<>(); @@ -376,7 +387,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "缺少纸管,人工确认"; - logServer.deviceExecuteLog(this.device_code, "", "", "不申请套管反馈,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("缺少纸管,人工确认,下发电气信号to_command:98") + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", message); } } else { message = applyPlugPullSitResponse.getMessage(); @@ -385,6 +402,12 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "申请套管失败"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管反馈失败,返回参数:"+applyPlugPullSitResponse) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse); } } @@ -399,13 +422,6 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(2); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); @@ -415,16 +431,30 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl applyPlugPullSiteRequest.setWeight2(String.valueOf(weight2)); applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_TWO); + param.put("weight1", String.valueOf(weight1)); + param.put("material1", String.valueOf(material1)); + param.put("weight1", String.valueOf(weight1)); + param.put("material1", String.valueOf(material1)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请套管完成任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "套管完成任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请套管成功:" + applyPlugPullSitResponse.getData()) + .content("套管完成成功,返回参数:" + applyPlugPullSitResponse.getData()) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); this.writeSignal(mode); - logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse.getData()); message = "套管完成成功"; } else { message = applyPlugPullSitResponse.getMessage(); @@ -432,8 +462,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_command", 99); this.writing(map); requireSucess = true; - message = "申请套管失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse); + message = "套管完成失败"; + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData()); } } @@ -448,25 +484,36 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(2); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); + logServer.deviceExecuteLog(this.device_code,"","","拔轴完成"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_THREE); + param.put("barcode", String.valueOf(barcode)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴完成任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成任务,返回参数:" + applyPlugPullSitResponse.getData()); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴完成,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); message = "拔轴完成成功"; } else { message = applyPlugPullSitResponse.getMessage(); @@ -475,7 +522,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "拔轴完成失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("拔轴完成反馈失败,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "拔轴完成反馈失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -489,18 +542,23 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(2); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); + logServer.deviceExecuteLog(this.device_code,"","","申请拔轴"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_FOUR); + param.put("barcode", String.valueOf(barcode)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map data = applyPlugPullSitResponse.getData(); @@ -535,8 +593,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl map.put("to_command", mode); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse.getData()); message = "申请拔轴成功"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴任务,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); } else { message = applyPlugPullSitResponse.getMessage(); Map map = new LinkedHashMap<>(); @@ -544,7 +608,13 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl this.writing(map); requireSucess = true; message = "申请拔轴失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请拔轴反馈失败,返回参数:"+applyPlugPullSitResponse.getData()) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -558,31 +628,48 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(device_code + "当前mode值为:" + mode) - .build(); - logDto.setLog_level(2); - luceneExecuteLogService.deviceExecuteLog(logDto); - logServer.deviceExecuteLog(this.device_code, "", "", "当前mode值为:" + mode); + logServer.deviceExecuteLog(this.device_code,"","","缓存线已满,生成行架任务"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setSize(String.valueOf(size)); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("type", CommonFinalParam.TYPE_FIVE); + param.put("size", String.valueOf(size)); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,请求参数:" + param); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest); if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) { Map map = new LinkedHashMap<>(); map.put("to_command", mode); this.writing(map); - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyPlugPullSitResponse.getData()); message = "生成行架任务成功"; + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); requireSucess = true; } else { message = applyPlugPullSitResponse.getMessage(); requireSucess = true; message = "申请行架任务失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); + LuceneLogDto logDto1 = LuceneLogDto.builder() + .device_code(device_code) + .content("申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getData()) + .build(); + logDto1.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto1); + logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getData()); } } } @@ -623,7 +710,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); this.control(itemMap); } @@ -643,7 +730,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl .device_code(device_code) .content("下发多个电气信号" + itemMap) .build(); - logDto.setLog_level(3); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java index 20be7c2f3..efb3377df 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/PullHeadManipulatorDeviceDriver.java @@ -729,7 +729,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp map.put("feedMessage", feedMessage); map.put("driver_type", "siemens_conveyor"); map.put("is_click", true); - map.put("message", message); + map.put("message", LangProcess.msg(message)); map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); map.put("error", ErrorUtil.getDictDetail("bqhj_error_type", String.valueOf(this.getError()))); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java index b431a83b5..f43d0b5fc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_tail_manipulator/PullTailManipulatorDeviceDriver.java @@ -215,25 +215,43 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp //反馈重量 if (mode == 3 && action == 5 && move == 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) { + logServer.deviceExecuteLog(this.device_code,"","","反馈重量"); ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest(); - ApplyfeedbackSubVolumeWeightResponse applyPlugPullSitResponse; + ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse; applyfeedbackSubVolumeWeightRequest.setSub_volume(sub_volume_no); - applyfeedbackSubVolumeWeightRequest.setWeight1(String.valueOf(weight)); - applyPlugPullSitResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest); - if(applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN){ + applyfeedbackSubVolumeWeightRequest.setWeight1(weight); + JSONObject param = new JSONObject(); + param.put("device_code", device_code); + param.put("sub_volume", sub_volume_no); + param.put("weight1", weight); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈LMS子卷重量,请求参数:" + param) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + logServer.deviceExecuteLog(this.device_code, "", "", "反馈重量,参数:" + param); + applyfeedbackSubVolumeWeightResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest); + if(applyfeedbackSubVolumeWeightResponse.getCode() == CommonFinalParam.STATUS_OPEN){ Map map = new LinkedHashMap<>(); //todo:反馈重量 map.put("to_command", "5"); this.writing(map); + LuceneLogDto logDto2 = LuceneLogDto.builder() + .device_code(device_code) + .content("反馈LMS子卷重量,返回参数:" + applyfeedbackSubVolumeWeightResponse.getData()) + .build(); + logDto2.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto2); this.requireSucess = true; }else{ - LuceneLogDto logDto = LuceneLogDto.builder() + LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) - .content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage()) + .content("反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getData()) .build(); - logDto.setLog_level(4); - message = "反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage(); - luceneExecuteLogService.deviceExecuteLog(logDto); + logDto1.setLog_level(4); + message = "反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getMessage(); + luceneExecuteLogService.deviceExecuteLog(logDto1); } } else if(mode == 3){ feedMessage = "行架机械手:"; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/ItemProtocol.java index 118518e1c..0fa3a318f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/ItemProtocol.java @@ -117,7 +117,7 @@ public class ItemProtocol { } Boolean isonline; - Boolean isError; + Boolean isError = false; public int getOpcIntegerValue(String protocol) { Integer value = this.driver.getIntegeregerValue(protocol); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index d98b4aa21..dd1af3069 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -190,16 +190,16 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl // } else if (mode == 0) { this.setIsonline(false); - message = "universal_off-line"; + message = LangProcess.msg("universal_off-line"); //有报警 } else if (error != 0) { this.setIserror(true); - message = "universal_message3"; + message = LangProcess.msg("universal_message3"); //无报警 } else { this.setIsonline(true); this.setIserror(false); - message = "universal_operation"; + message = LangProcess.msg("universal_operation"); switch (mode) { case 1: log.debug("设备运转模式:等待工作"); @@ -769,7 +769,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl @Override public JSONObject getDeviceStatusName() { - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + String move_1 = ""; String move_2 = ""; String action = ""; @@ -840,25 +841,26 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl iserror = false; } } - jo.put("requireSucess", requireSucess); - jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("move_1", move_1); - jo.put("move_2", move_2); - jo.put("action", action); - jo.put("walk_y", walk_y); - jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); - jo.put("task", this.getTask()); - jo.put("isOnline", this.getIsonline()); - jo.put("isError", this.getIserror()); - jo.put("is_disable1", this.getIs_disable()); - jo.put("is_disable", is_disable); - jo.put("message", message); - jo.put("is_click", true); - jo.put("driver_type", "slit_two_manipulator"); - jo.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); - jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); - jo.put("feedMessage", LangProcess.msg(feedMessage)); + map.put("device_name", this.getDevice().getDevice_name()); + map.put("mode", mode); + map.put("action", action); + map.put("walk_y", walk_y); + map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); + map.put("task", this.getTask()); + map.put("isOnline", this.getIsonline()); + map.put("isError", this.getIserror()); + map.put("is_disable1", this.getIs_disable()); + map.put("is_disable", is_disable); + map.put("is_click", true); + map.put("driver_type", "slit_two_manipulator"); + map.put("requireSucess", requireSucess); + map.put("move_1", move_1); + map.put("move_2", move_2); + map.put("message", message); + map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage)); + map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage)); + map.put("feedMessage", LangProcess.msg(feedMessage)); + JSONObject jo = new JSONObject(map); return jo; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyfeedbackSubVolumeWeightRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyfeedbackSubVolumeWeightRequest.java index 5d7568911..b95e2faf7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyfeedbackSubVolumeWeightRequest.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyfeedbackSubVolumeWeightRequest.java @@ -13,6 +13,6 @@ public class ApplyfeedbackSubVolumeWeightRequest { /** * 子卷重量 */ - private String weight1; + private double weight1; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index faea6ca16..5c7d46db2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -151,7 +151,7 @@ public interface AcsToWmsService { HttpResponse applyBlankButtonTask(JSONObject param); /** - * 向lms申请反馈 + * RGV工位上有货申请行架任务 * @param param * @return */ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index f8c9d67d1..01c526ee6 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -35,6 +35,7 @@ import org.nl.system.service.param.ISysParamService; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.Map; @@ -184,7 +185,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "error"; } log.info("applyTaskToWms-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTwo", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "二期入库申请任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); @@ -347,6 +348,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .header("Authorization", token).body(String.valueOf(data)) .execute(); // //System.out.println(result2); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedTaskStatus", String.valueOf(result2.getStatus()), + String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { String msg = e.getMessage(); //网络不通 @@ -364,6 +368,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "info"; JSONObject jo = JSONObject.parseObject(result2.body()); log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedTaskStatus", String.valueOf(result2.getStatus()), + String.valueOf(data), String.valueOf(result2.body()), "ACS向WMS反馈任务状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); return result2; } else { type = "error"; @@ -402,7 +409,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, ApplyGreenFoilButtonResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"ApplyGreenFoilButtonRequest", String.valueOf(applyGreenFoilButtonResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyGreenFoilButtonTask", String.valueOf(applyGreenFoilButtonResponse.getCode()), JSON.toJSONString(param), String.valueOf(applyGreenFoilButtonResponse.getMessage()), "ACS向LMS申请生箔按钮任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); } @@ -426,13 +433,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } catch (Exception e) { String message = e.getMessage(); log.info("applyBlankButtonTask----反馈表处按钮请求失败{}", message); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyButtonTask", String.valueOf(result.getStatus()), JSON.toJSONString(result), String.valueOf(result.body()), "反馈下发表处任务报错"); luceneLogService.interfaceExecuteLog(luceneLogDto); } log.info("applyBlankButtonTask - 反馈表处按钮{}", result.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyBlankButtonTask", String.valueOf(result.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyButtonTask", String.valueOf(result.getStatus()), JSON.toJSONString(result.body()), String.valueOf(result.body()), "反馈下发表处任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); @@ -445,7 +452,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param) { - log.info("向LMS申请反馈,请求参数{}",param); + log.info("向lms申请套管工位请求,请求参数{}",param); String result = ""; try { MDC.put(log_file_type, log_type); @@ -455,25 +462,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyPlugPullSiteRequest"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("ApplyPlugPullSiteRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("A向lms申请套管工位请求----请求参数:{}", JSONObject.toJSONString(param)); try { // result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyPlugPullSitResponse----返回参数{}", result); + log.info("向lms申请套管工位请求----返回参数{}", ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" : + "4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务")); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请" + ("1".equals(param.getType()) ? "套轴" : "2".equals(param.getType()) ? "套轴完成" : "3".equals(param.getType()) ? "拔轴完成" : "4".equals(param.getType()) ? "拔轴" : "缓存线已满,生成行架任务")); luceneLogService.interfaceExecuteLog(luceneLogDto); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyPlugPullSitResponse----返回参数{}", result); + log.info("向lms申请套管工位请求----返回参数{}", result); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); JSONObject map = new JSONObject(); @@ -491,7 +499,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) { - log.info("向LMS申请反馈,请求参数{}", param); + log.info("向LMS反馈子卷重量,请求参数{}", param); String result = ""; ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { @@ -499,18 +507,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("向LMS反馈子卷重量----请求参数:{}", JSONObject.toJSONString(param)); try { // result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + log.info("向LMS反馈子卷重量----返回参数{}", result); applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result); + log.info("向LMS反馈子卷重量----返回参数{}", result); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); @@ -525,7 +533,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) { - log.info("向LMS申请反馈,请求参数{}", param); + log.info("RGV工位上有货申请行架任务,请求参数{}", param); String result = ""; ApplyManipulatorActionResponse applyManipulatorActionResponse = new ApplyManipulatorActionResponse(); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { @@ -533,28 +541,28 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { AddressDto addressDto = addressService.findByCode("applyManipulatorAction"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - log.info("ApplyManipulatorActionRequest----请求参数:{}", JSONObject.toJSONString(param)); + log.info("RGV工位上有货申请行架任务----请求参数:{}", JSONObject.toJSONString(param)); try { result = HttpRequest.post(url) .body(JSON.toJSONString(param)) .execute().body(); JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyManipulatorActionResponse----返回参数{}", result); + log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); } catch (Exception e) { JSONObject jsonObject = JSONObject.parseObject(result); - log.info("ApplyManipulatorActionResponse----返回参数{}", result); + log.info("RGV工位上有货申请行架任务----返回参数{}", result); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量失败"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), + JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务失败"); luceneLogService.interfaceExecuteLog(luceneLogDto); JSONObject map = new JSONObject(); map.put("status", 400); map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4, "ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()), - JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量成功"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), + JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务"); luceneLogService.interfaceExecuteLog(luceneLogDto); } return applyManipulatorActionResponse; @@ -586,7 +594,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { map.put("message", e.getMessage()); return JSONObject.toJavaObject(map, GetWasteFoilWeightResponse.class); } - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"GetWasteFoilWeightRequest", String.valueOf(getWasteFoilWeightResponse.getCode()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"feedbackWeight", String.valueOf(getWasteFoilWeightResponse.getCode()), JSON.toJSONString(param), String.valueOf(getWasteFoilWeightResponse), "ACS向LMS申请反馈"); luceneLogService.interfaceExecuteLog(luceneLogDto); } @@ -783,6 +791,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { .body(param.toString()) .execute(); log.info("sendDeviceStatus - 返回参数 {}", response.body()); + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"sendDeviceStatus", String.valueOf(response.getStatus()), + String.valueOf(param), + String.valueOf(response.body()), "向LMS发送设备状态"); + luceneLogService.interfaceExecuteLog(luceneLogDto); } } catch (Throwable ignored) { @@ -821,7 +833,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { type = "error"; } log.info("applyUpdatePointCode-----输出参数{}", result2.body()); - LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyUpdatePointCode", String.valueOf(result2.getStatus()), + LuceneLogDto luceneLogDto = new LuceneLogDto(4,"deviceApplyExceptional", String.valueOf(result2.getStatus()), JSON.toJSONString(param), String.valueOf(result2.body()), "申请更新点位"); luceneLogService.interfaceExecuteLog(luceneLogDto); return result2.body(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index a87729ce2..70746a245 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -626,46 +626,40 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public Map getTubeMes(String jsonObject) throws Exception { log.info("getTubeMes--------------:输入参数" + jsonObject); - String date = new Date().toString(); - LuceneLogDto luceneLogDto = new LuceneLogDto(4, jsonObject, date + "获取管芯信息"); + LuceneLogDto luceneLogDto = new LuceneLogDto(4, "getTubeMes", "", + String.valueOf(jsonObject), + "", "下发管芯信息"); luceneLogService.interfaceExecuteLog(luceneLogDto); JSONArray datas = JSONArray.parseArray(jsonObject); - JSONObject jo = new JSONObject(); + Map map = new HashMap(); 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) { + if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { 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(); + if (ObjectUtil.isEmpty(to_material)){ + map.put("to_material", "0"); + map.put("to_spec", "0"); + map.put("to_qty", "0"); + }else { + map.put("to_material", to_material); + map.put("to_spec", to_spec); + map.put("to_qty", to_qty); } + paperTubePickSiteDeviceDriver.writing(map); } } JSONObject resultJson = new JSONObject(); resultJson.put("status", HttpStatus.OK.value()); resultJson.put("message", "操作成功"); - resultJson.put("data", jo); - log.info("putWeightAction--------------:输出参数" + resultJson.toString()); return resultJson; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/ActionTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/ActionTypeEnum.java index ba2f202f0..6278738d3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/ActionTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/ActionTypeEnum.java @@ -15,15 +15,20 @@ public enum ActionTypeEnum { /** * 防货二次分配 */ - OUT_STOCK(2, "防货二次分配"), + OUT_STOCK(2, "放货二次分配"), /** * 取货完成 */ - IN_FINISHING(3, "取货完成"); + IN_FINISHING(3, "取货完成"), + + /** + * 行架四个点任务放满轴完成 + */ + RELEASE_FINISHING(4, "满轴放货完成"); + Integer code; String status; - public static String getStatus(Integer code) { for (ActionTypeEnum value : values()) { if (value.code.equals(code)) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java index e90538944..0c4dedca2 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/enums/AgvActionTypeEnum.java @@ -25,6 +25,8 @@ public enum AgvActionTypeEnum { */ IN_OUT_STOCK(4, "取放货二次分配"); + + Integer code; String status; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 8fc6f238e..ae8024ecc 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -66,6 +66,7 @@ import org.nl.common.utils.CodeUtil; import org.nl.config.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -74,6 +75,7 @@ import org.springframework.data.domain.Pageable; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.CopyOnWriteArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -803,7 +805,15 @@ public class TaskServiceImpl extends CommonServiceImpl impleme //向缓存添加任务信息 this.addTaskToCache(dto); //反馈上位系统任务状态 - this.feedWmsTaskStatus(entity); + + CompletableFuture.runAsync(() -> { + // 异步更新指令状态 + try { + this.feedWmsTaskStatus(entity); + } catch (Exception e) { + e.printStackTrace(); + } + }); } @Override @@ -926,7 +936,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme for (int m = 0; m < pathlist.size(); m++) { if (pathlist.get(m).equals(start_device_code)) { //起点为货架跳过堆垛机 - if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { index = m + 2; }else { index = m + 1; @@ -972,34 +982,7 @@ public class TaskServiceImpl extends CommonServiceImpl impleme instdto.setAgv_system_type(agv_system_type); instdto.setStart_height(start_height); instdto.setNext_height(next_height); - - //判断agv系统 - //1、1楼叉车系统 - //2、2楼1区域AGV系统 - //3、2楼2区域AGV系统 -已废弃 - if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) { - // task_type - //1、生箔; Itype=1:取空,取满,放空,放满; - //2、分切 Itype=3取满、取空、放满、放空; - //3、普通任务 Itype=2:取货、放货; - //4、叉车任务 - //5、输送任务 - //6、行架 - //7、立库 - if (StrUtil.equals(task_type, CommonFinalParam.ONE)) { - instdto.setAgv_inst_type(CommonFinalParam.ONE); - } else if (StrUtil.equals(task_type, "3")) { - instdto.setAgv_inst_type("2"); - } else if (StrUtil.equals(task_type, "2")) { - instdto.setAgv_inst_type("3"); - } else if (StrUtil.equals(task_type, "8")) { - instdto.setAgv_inst_type("2"); - } else { - log.info("未找到对应的AGV指令类型,任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type()); - } - } else { - instdto.setAgv_inst_type("4"); - } + instdto.setAgv_action_type(acsTask.getAgv_action_type()); instructionservice.create2(instdto); acsTask.setTask_status(CommonFinalParam.ONE); this.update(acsTask); @@ -1656,7 +1639,17 @@ public class TaskServiceImpl extends CommonServiceImpl impleme JSONArray ja = new JSONArray(); ja.add(feed_jo); //TODO 有需要根据上位系统反馈的信息再做进一步处理 - acstowmsService.feedTaskStatus(ja); + + CompletableFuture.runAsync(() -> { + // 异步更新指令状态 + try { + acstowmsService.feedTaskStatus(ja); + } catch (Exception e) { + e.printStackTrace(); + } + }); + + } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java index 4dc43c273..50352d364 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/service/impl/LuceneServiceImpl.java @@ -2,6 +2,7 @@ package org.nl.config.lucene.service.impl; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -162,31 +163,14 @@ public class LuceneServiceImpl implements LuceneService { } TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true); booleanQueryBuilder.add(termRangeQuery, BooleanClause.Occur.MUST); - if (whereJson.get("device_code") != null){ - Query termQuery = new TermQuery(new Term("device_code", (String) whereJson.get("device_code"))); - booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); - } if (whereJson.get("method") != null){ Query termQuery = new TermQuery(new Term("method", (String) whereJson.get("method"))); booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); + } else { + // 使用 TermRangeQuery 来检查字段是否存在和不为空 + Query rangeQuery = TermRangeQuery.newStringRange("method", null, null, false, false); + booleanQueryBuilder.add(rangeQuery, BooleanClause.Occur.MUST); } - if (whereJson.get("status_code") != null){ - Query termQuery = new TermQuery(new Term("status_code", (String) whereJson.get("status_code"))); - booleanQueryBuilder.add(termQuery,BooleanClause.Occur.MUST); - } - if (whereJson.get("requestparam") != null){ - WildcardQuery query = new WildcardQuery(new Term("requestparam", "*"+(String) whereJson.get("requestparam")+"*")); - booleanQueryBuilder.add(query,BooleanClause.Occur.MUST); - } - if (whereJson.get("responseparam") != null){ - WildcardQuery query = new WildcardQuery(new Term("responseparam", "*"+(String) whereJson.get("responseparam")+"*")); - booleanQueryBuilder.add(query,BooleanClause.Occur.MUST); - } - if (whereJson.get("blurry") != null) { - WildcardQuery query = new WildcardQuery(new Term("fieldContent", "*"+(String) whereJson.get("blurry")+"*")); - booleanQueryBuilder.add(query, BooleanClause.Occur.MUST); - } - TopFieldCollector collector = TopFieldCollector.create(new Sort(new SortField("logTime", SortField.Type.LONG,true)), 20000, 0); searcher.search(booleanQueryBuilder.build(), collector); TopDocs topDocs = collector.topDocs(pageNum*pageSize, pageSize); @@ -197,14 +181,12 @@ public class LuceneServiceImpl implements LuceneService { for (ScoreDoc scoreDoc : scoreDocs) { Document doc = open.document(scoreDoc.doc); JSONObject object = new JSONObject(); - object.put("content",doc.get("fieldContent")); - object.put("device_code",doc.get("device_code")); - object.put("logTime",doc.get("logTime")); - object.put("method",doc.get("method")); - object.put("status_code",doc.get("status_code")); - object.put("requestparam",doc.get("requestparam")); - object.put("responseparam",doc.get("responseparam")); - if(doc.get("fieldContent") != null) { + object.put("content", doc.get("fieldContent")); + object.put("logTime", doc.get("logTime") ); + object.put("method", doc.get("method")); + object.put("requestparam", doc.get("requestparam")); + object.put("responseparam", doc.get("responseparam")); + if (ObjectUtil.isNotEmpty(doc.get("fieldContent"))) { list.add(object); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCleanLucenceLog.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCleanLucenceLog.java index 79bbe93d7..329254267 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCleanLucenceLog.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCleanLucenceLog.java @@ -51,6 +51,7 @@ public class AutoCleanLucenceLog { String endDate = DateUtil.format(calendar.getTime(), "yyyy-MM-dd HH:mm:ss.SSS"); TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true); writer.deleteDocuments(termRangeQuery); + writer.commit(); writer.close(); } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java index 5aee86e81..e0c7121a9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/system/service/quartz/task/AutoCreateInst.java @@ -57,6 +57,9 @@ public class AutoCreateInst { if (StrUtil.equals(acsTask.getTask_type(), TaskTypeEnum.AGV_Task.getIndex()) && !StrUtil.startWith(acsTask.getTask_code(), "-")) { continue; } + if (StrUtil.equals(acsTask.getTask_type(), TaskTypeEnum.Truss_Task.getIndex()) && !StrUtil.startWith(acsTask.getTask_code(), "-")) { + continue; + } String taskid = acsTask.getTask_id(); String taskcode = acsTask.getTask_code(); String task_type = acsTask.getTask_type(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml index 4aaae10db..b92ec5a2a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -7,6 +7,7 @@ spring: check-template-location: false profiles: active: dev +# active: prod jackson: time-zone: GMT+8 data: @@ -51,8 +52,8 @@ spring: monitorInterval: 8 tomcatTp: # tomcat webserver 线程池配置 threadPoolAliasName: tomcat 线程池 # 线程池别名,可选 - corePoolSize: 100 - maximumPoolSize: 200 + corePoolSize: 10 + maximumPoolSize: 50 keepAliveTime: 60 runTimeout: 10000 queueTimeout: 100 diff --git a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml index a070661e3..2d43eddc5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml +++ b/acs2/nladmin-system/nlsso-server/src/main/resources/logback-spring.xml @@ -113,7 +113,6 @@ https://juejin.cn/post/6844903775631572999 - diff --git a/acs2/nladmin-ui/src/i18n/langs/history/en.js b/acs2/nladmin-ui/src/i18n/langs/history/en.js index d57bafa2f..2f08fbfef 100644 --- a/acs2/nladmin-ui/src/i18n/langs/history/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/history/en.js @@ -11,6 +11,7 @@ export default { 'Endpoint_two': 'Endpoint Two', 'Material': 'Material', 'Quantity': 'Quantity', + 'agv_action_type': 'The type of AGV secondary distribution', 'Numbering': 'Numbering', 'Value': 'Value', 'Input_task_instruction_number': 'Enter Task Number Or Instruction Number', diff --git a/acs2/nladmin-ui/src/i18n/langs/history/in.js b/acs2/nladmin-ui/src/i18n/langs/history/in.js index b0a5ab1d6..a9b7792c9 100644 --- a/acs2/nladmin-ui/src/i18n/langs/history/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/history/in.js @@ -10,7 +10,8 @@ export default { 'Transit_point': 'Titik transit', 'Endpoint_two': 'Titik Akhir Dua', 'Material': 'Bahan', - 'Quantity': 'Jumlah', + 'Quantity': 'Jenis distribusi sekunder AGV', + 'agv_action_type': 'agv二次分配类型', 'Numbering': 'Nomor', 'Value': 'Nilai', 'Input_task_instruction_number': 'Masukkan Nomor Tugas Atau Nomor Instruksi', diff --git a/acs2/nladmin-ui/src/i18n/langs/history/zh.js b/acs2/nladmin-ui/src/i18n/langs/history/zh.js index e332c0678..77555fd2a 100644 --- a/acs2/nladmin-ui/src/i18n/langs/history/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/history/zh.js @@ -11,6 +11,7 @@ export default { 'Endpoint_two': '终点2', 'Material': '物料', 'Quantity': '数量', + 'agv_action_type': 'agv二次分配类型', 'Numbering': '编号', 'Value': '值', 'Input_task_instruction_number': '输入任务号或指令号', diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/en.js b/acs2/nladmin-ui/src/i18n/langs/monitor/en.js index 2b20df1bd..8715378b6 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/en.js @@ -139,7 +139,8 @@ export default { 'Core_error_identifier': 'Core error identifier', 'Current_command_information': 'Current command information', 'The_signal_is_successfully_marked': 'The signal is successfully marked', - 'Complement_information': 'Complement information' + 'Complement_information': 'Complement information', + 'agv_task_type': 'task type' } } } diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/in.js b/acs2/nladmin-ui/src/i18n/langs/monitor/in.js index 557e4f6f7..a7ca9a493 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/in.js @@ -139,7 +139,8 @@ export default { 'Core_error_identifier': 'Pengenal kesalahan inti', 'Current_command_information': 'Informasi perintah saat ini', 'The_signal_is_successfully_marked': 'Sinyal berhasil ditandai', - 'Complement_information': 'Informasi pelengkap' + 'Complement_information': 'Informasi pelengkap', + 'agv_task_type': 'Jenis tugas' } } } diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js b/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js index 092e435c3..7cf9458b6 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js @@ -139,7 +139,8 @@ export default { 'Core_error_identifier': 'Core出错标识位', 'Current_command_information': '当前指令信息', 'The_signal_is_successfully_marked': '信号成功标记', - 'Complement_information': '补码信息' + 'Complement_information': '补码信息', + 'agv_task_type': '任务类型' } } } diff --git a/acs2/nladmin-ui/src/i18n/langs/task/en.js b/acs2/nladmin-ui/src/i18n/langs/task/en.js index bc571ce9f..12a4304b9 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/en.js @@ -22,6 +22,7 @@ export default { 'Task': 'Task', 'start_or_end': 'Origin Or Destination', 'time': 'Time', + 'empty_shaft_position': 'Empty shaft position', 'extension_field': 'Extension Field' }, 'select': { diff --git a/acs2/nladmin-ui/src/i18n/langs/task/in.js b/acs2/nladmin-ui/src/i18n/langs/task/in.js index b1c10a540..3563c5868 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/in.js @@ -22,6 +22,7 @@ export default { 'Task': 'Tugas', 'start_or_end': 'Asal Atau Tujuan', 'time': 'Waktu', + 'empty_shaft_position': 'Posisi poros kosong', 'extension_field': 'Bidang Perluasan' }, 'select': { diff --git a/acs2/nladmin-ui/src/i18n/langs/task/zh.js b/acs2/nladmin-ui/src/i18n/langs/task/zh.js index 063726046..6c734df0a 100644 --- a/acs2/nladmin-ui/src/i18n/langs/task/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/task/zh.js @@ -22,6 +22,7 @@ export default { 'Task': '任务', 'start_or_end': '起点或终点', 'time': '时间段', + 'empty_shaft_position': '空轴位', 'extension_field': '扩展字段' }, 'select': { diff --git a/acs2/nladmin-ui/src/views/acs/device/config.vue b/acs2/nladmin-ui/src/views/acs/device/config.vue index 52d5f3b8e..9e7d96372 100644 --- a/acs2/nladmin-ui/src/views/acs/device/config.vue +++ b/acs2/nladmin-ui/src/views/acs/device/config.vue @@ -104,7 +104,6 @@ import led_screen from './driver/led_screen' import standard_station from '@/views/acs/device/driver/standard_station' import double_belt_conveyor from '@/views/acs/device/driver/double_belt_conveyor.vue' import with_station_device from '@/views/acs/device/driver/with_station_device.vue' -import standard_manipulator from '@/views/acs/device/driver/standard_manipulator.vue' import box_manipulator from '@/views/acs/device/driver/box_manipulator.vue' import conveyor_with_scanner_weight from '@/views/acs/device/driver/conveyor_with_scanner_weight.vue' import box_manipulator_site from '@/views/acs/device/driver/box_manipulator_site.vue' @@ -134,6 +133,8 @@ import scanner_weight_conveyor from '@/views/acs/device/driver/one_conveyor/scan import un_box_lable_conveyor from '@/views/acs/device/driver/one_conveyor/un_box_lable_conveyor.vue' import xg_agv_car from '@/views/acs/device/driver/agv/xg_agv_car.vue' import oven_inspect_site from '@/views/acs/device/driver/oven_inspect_site.vue' +import one_rgv from '@/views/acs/device/driver/one_manipulator/one_rgv.vue' +import standard_manipulator from '@/views/acs/device/driver/one_manipulator/standard_manipulator.vue' export default { name: 'DeviceConfig', components: { @@ -194,7 +195,8 @@ export default { manipulator_agv_station, volume_two_manipulator, manipulator_cache, - paper_tube_pick_size + paper_tube_pick_size, + one_rgv }, dicts: ['device_type'], mixins: [crud], diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/standard_manipulator.vue b/acs2/nladmin-ui/src/views/acs/device/driver/one_manipulator/one_rgv.vue similarity index 56% rename from acs2/nladmin-ui/src/views/acs/device/driver/standard_manipulator.vue rename to acs2/nladmin-ui/src/views/acs/device/driver/one_manipulator/one_rgv.vue index 73ad43775..c753d1bf5 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/standard_manipulator.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/one_manipulator/one_rgv.vue @@ -1,5 +1,5 @@ + + + + - - - + + + @@ -301,6 +301,8 @@ + + @@ -330,7 +332,6 @@ const defaultForm = { start_point_code: null, start_device_code: null, next_point_code: null, - start_point_code: null, remark: null, material: null, route_plan_code: 'normal', diff --git a/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue b/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue index dd9a20f3f..d61fd7870 100644 --- a/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue +++ b/acs2/nladmin-ui/src/views/acs/history/taskTreeRecord/index.vue @@ -123,7 +123,7 @@ - + @@ -142,11 +142,22 @@ + + + + + + diff --git a/acs2/nladmin-ui/src/views/acs/task/index.vue b/acs2/nladmin-ui/src/views/acs/task/index.vue index 28fe6037d..d164db0ea 100644 --- a/acs2/nladmin-ui/src/views/acs/task/index.vue +++ b/acs2/nladmin-ui/src/views/acs/task/index.vue @@ -429,8 +429,21 @@ - - + + + +
@@ -505,7 +518,7 @@ - + @@ -533,6 +546,11 @@ + + + @@ -610,7 +628,7 @@ import i18n from '@/i18n' export default { name: 'Task', components: { pagination, crudOperation, rrOperation }, - dicts: ['task_status', 'task_type', 'agv_system_type', 'storage_task_type', 'kezhuan'], + dicts: ['task_status', 'task_type', 'agv_system_type', 'storage_task_type', 'kezhuan', 'empty_shaft_position'], mixins: [presenter(), header(), crud()], cruds() { return CRUD({ title: i18n.t('task.txt_box.Task'), url: 'api/task', idField: 'task_id', sort: 'task_id,desc', @@ -672,6 +690,7 @@ export default { formDia: false, isDisabled: false, deviceList: [], + empty_shaft_position: [], materialList: [], statusList: [], routeList: [], @@ -771,6 +790,10 @@ export default { }) }, methods: { + getAgvSystemLabel(value) { + const item = this.dict.label.agv_system_type[value] + return item + }, addNewRow() { this.extension.push({ name: '', diff --git a/acs2/nladmin-ui/src/views/monitor/logQuery/index.vue b/acs2/nladmin-ui/src/views/monitor/logQuery/index.vue index 31e0157d4..7188811f0 100644 --- a/acs2/nladmin-ui/src/views/monitor/logQuery/index.vue +++ b/acs2/nladmin-ui/src/views/monitor/logQuery/index.vue @@ -16,8 +16,20 @@ - - + + + + + + @@ -54,7 +66,7 @@ export default { page: 0 }, query: { - createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))], + createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))] } }) }, @@ -66,13 +78,27 @@ export default { edit: ['admin', 'param:edit'], del: ['admin', 'param:del'] }, - rules: {} } }, created() { }, methods: { + truncateOrFullText(text) { + if (text.length > 1000) { + return text.slice(0, 1000) + '...' + } + return text + }, + handleClick(content) { + if (content.length > 1000) { + this.$alert(content, '完整内容', { + confirmButtonText: '关闭', + dangerouslyUseHTMLString: true, + customClass: 'full-content-alert' + }) + } + }, // 钩子:在获取表格数据之前执行,false 则代表不获取数据 [CRUD.HOOK.beforeRefresh]() { return true @@ -103,6 +129,18 @@ export default { diff --git a/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue b/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue index 2c7970719..269e34814 100644 --- a/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue +++ b/acs2/nladmin-ui/src/views/monitor/logQuery/search.vue @@ -8,14 +8,18 @@ - + style="width: 200px" + @change="crud.toQuery" + > + + { this.methods = data.content }) - }, + } } diff --git a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue index c9c20977d..30fad03c3 100644 --- a/acs2/nladmin-ui/src/views/monitor/lucene/index.vue +++ b/acs2/nladmin-ui/src/views/monitor/lucene/index.vue @@ -14,7 +14,7 @@ > - + @@ -53,7 +53,7 @@ export default { page: 0 }, query: { - createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))], + createTime: [new Date(new Date().setTime(new Date().getTime() - 3600 * 1000)), new Date(new Date().setTime(new Date().getTime() + 3600 * 1000))] } }) }, diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index 57f44517e..8e199e288 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -9,7 +9,7 @@ /> -
+
- + - + @@ -62,7 +62,7 @@ - + @@ -72,7 +72,7 @@ - +