| src/main/java/com/zy/asrs/controller/DualCrnController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/domain/param/DualCrnUpdateTaskNoParam.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/asrs/domain/vo/DualCrnStateTableVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/enums/RedisKeyType.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/thread/impl/ZySiemensDualCrnThread.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/java/com/zy/core/utils/DualCrnOperateProcessUtils.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/main/webapp/components/WatchDualCrnCard.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/controller/DualCrnController.java
@@ -5,11 +5,14 @@ import com.core.common.Cools; import com.core.common.R; import com.zy.asrs.domain.param.DualCrnCommandParam; import com.zy.asrs.domain.param.DualCrnUpdateTaskNoParam; import com.zy.asrs.domain.vo.DualCrnStateTableVo; import com.zy.asrs.entity.BasDualCrnp; import com.zy.asrs.service.BasDualCrnpService; import com.zy.common.utils.RedisUtil; import com.zy.core.cache.MessageQueue; import com.zy.core.cache.SlaveConnection; import com.zy.core.enums.RedisKeyType; import com.zy.core.enums.SlaveType; import com.zy.core.model.Task; import com.zy.core.model.command.DualCrnCommand; @@ -31,6 +34,8 @@ @Autowired private BasDualCrnpService basDualCrnpService; @Autowired private RedisUtil redisUtil; @PostMapping("/dualcrn/table/crn/state") @ManagerAuth(memo = "双工位堆垛机信息表") @@ -51,6 +56,8 @@ } vo.setTaskNo(p.getTaskNo()); vo.setTaskNoTwo(p.getTaskNoTwo()); vo.setDeviceTaskNo(p.getDeviceTaskNo()); vo.setDeviceTaskNoTwo(p.getDeviceTaskNoTwo()); vo.setMode(p.getModeType() == null ? "-" : p.getModeType().desc); vo.setStatus(p.getStatusType() == null ? "-" : p.getStatusType().desc); vo.setStatusTwo(p.getStatusTypeTwo() == null ? "-" : p.getStatusTypeTwo().desc); @@ -181,4 +188,35 @@ MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); return R.ok(); } @PostMapping("/dualcrn/command/updateTaskNo") @ManagerAuth(memo = "双工位堆垛机编辑任务号") public R dualCrnUpdateTaskNo(@RequestBody DualCrnUpdateTaskNoParam param) { if (Cools.isEmpty(param) || param.getCrnNo() == null || param.getStation() == null || param.getTaskNo() == null) { return R.error("缺少参数"); } Integer station = param.getStation(); if (station != 1 && station != 2) { return R.error("工位参数错误"); } Integer taskNo = param.getTaskNo(); if (taskNo < 0) { return R.error("任务号不能小于0"); } Integer crnNo = param.getCrnNo(); DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, crnNo); if (crnThread == null) { return R.error("线程不存在"); } DualCrnProtocol protocol = crnThread.getStatus(); if (protocol == null) { return R.error("设备状态不存在"); } if (station == 1) { redisUtil.set(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + crnNo, taskNo, 60 * 60 * 24); } else { redisUtil.set(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + crnNo, taskNo, 60 * 60 * 24); } return R.ok(); } } src/main/java/com/zy/asrs/domain/param/DualCrnUpdateTaskNoParam.java
New file @@ -0,0 +1,10 @@ package com.zy.asrs.domain.param; import lombok.Data; @Data public class DualCrnUpdateTaskNoParam { private Integer crnNo; private Integer station; private Integer taskNo; } src/main/java/com/zy/asrs/domain/vo/DualCrnStateTableVo.java
@@ -15,6 +15,10 @@ private Integer taskNoTwo = 0; private Integer deviceTaskNo = 0; private Integer deviceTaskNoTwo = 0; private String status = "-"; private String statusTwo = "-"; src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -2,13 +2,8 @@ public enum RedisKeyType { SHUTTLE_WORK_FLAG("shuttle_wrk_no_"), SHUTTLE_FLAG("shuttle_"), FORK_LIFT_WORK_FLAG("fork_lift_wrk_no_"), FORK_LIFT_FLAG("fork_lift_"), LIFT_WORK_FLAG("lift_wrk_no_"), LIFT_FLAG("lift_"), DUAL_CRN_STATION1_FLAG("dual_crn_station1_flag_"), DUAL_CRN_STATION2_FLAG("dual_crn_station2_flag_"), DUAL_CRN_COMMAND_("dual_crn_command_"), DUAL_CRN_COMMAND_IDX("dual_crn_command_idx_"), src/main/java/com/zy/core/model/protocol/DualCrnProtocol.java
@@ -1,9 +1,9 @@ package com.zy.core.model.protocol; import com.zy.core.enums.DualCrnForkPosType; import com.zy.core.enums.DualCrnLiftPosType; import com.zy.core.enums.DualCrnModeType; import com.zy.core.enums.DualCrnStatusType; import com.core.common.Cools; import com.core.common.SpringUtils; import com.zy.common.utils.RedisUtil; import com.zy.core.enums.*; import lombok.Data; @@ -29,14 +29,24 @@ public Integer alarm; /** * 工位1任务号 * WCS工位1任务号 */ public Integer taskNo = 0; /** * 工位2任务号 * WCS工位2任务号 */ public Integer taskNoTwo = 0; /** * 设备工位1任务号 */ public Integer deviceTaskNo = 0; /** * 设备工位2任务号 */ public Integer deviceTaskNoTwo = 0; /** * 工位1当前状态 @@ -296,4 +306,32 @@ this.statusTwo = DualCrnStatusType.get(type).id; } public Integer getTaskNo() { RedisUtil redisUtil = null; try { redisUtil = SpringUtils.getBean(RedisUtil.class); }catch (Exception e) {} if (null != redisUtil) { Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + this.crnNo); if (!Cools.isEmpty(o)) { this.taskNo = Integer.parseInt(String.valueOf(o)); } } return this.taskNo == null ? 0 : this.taskNo; } public Integer getTaskNoTwo() { RedisUtil redisUtil = null; try { redisUtil = SpringUtils.getBean(RedisUtil.class); }catch (Exception e) {} if (null != redisUtil) { Object o = redisUtil.get(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + this.crnNo); if (!Cools.isEmpty(o)) { this.taskNoTwo = Integer.parseInt(String.valueOf(o)); } } return this.taskNoTwo == null ? 0 : this.taskNoTwo; } } src/main/java/com/zy/core/network/fake/ZyDualCrnFakeConnect.java
@@ -2,7 +2,7 @@ import com.alibaba.fastjson.JSON; import com.zy.asrs.entity.DeviceConfig; import com.zy.core.enums.CrnStatusType; import com.zy.core.enums.DualCrnStatusType; import com.zy.core.enums.DualCrnTaskModeType; import com.zy.core.model.CommandResponse; import com.zy.core.model.command.DualCrnCommand; @@ -20,6 +20,8 @@ private final ExecutorService executor = Executors .newFixedThreadPool(9999); private int taskExecuteStation = 0; private DualCrnCommand station1LastCommand = null; private DualCrnCommand station2LastCommand = null; public ZyDualCrnFakeConnect(DeviceConfig deviceConfig) { this.deviceConfig = deviceConfig; @@ -71,13 +73,29 @@ this.crnStatus.setTaskNo(0); } this.crnStatus.setTaskReceive(0); this.crnStatus.setStatus(CrnStatusType.IDLE.id); if (station1LastCommand == null) { this.crnStatus.setStatus(DualCrnStatusType.IDLE.id); }else { if (station1LastCommand.getTaskMode().intValue() == DualCrnTaskModeType.PICK.id) { this.crnStatus.setStatus(DualCrnStatusType.FETCH_COMPLETE.id); }else { this.crnStatus.setStatus(DualCrnStatusType.IDLE.id); } } }else { if (crnStatus.getLoadedTwo() == 0) { this.crnStatus.setTaskNoTwo(0); } this.crnStatus.setTaskReceiveTwo(0); this.crnStatus.setStatusTwo(CrnStatusType.IDLE.id); if (station2LastCommand == null) { this.crnStatus.setStatusTwo(DualCrnStatusType.IDLE.id); }else { if (station1LastCommand.getTaskMode().intValue() == DualCrnTaskModeType.PICK.id) { this.crnStatus.setStatusTwo(DualCrnStatusType.FETCH_COMPLETE.id); }else { this.crnStatus.setStatusTwo(DualCrnStatusType.IDLE.id); } } } } @@ -103,16 +121,16 @@ if(command.getStation() == 1) { this.crnStatus.setTaskNo(taskNo); this.crnStatus.setStatus(CrnStatusType.MOVING.id); this.crnStatus.setStatus(DualCrnStatusType.PUT_MOVING.id); this.crnStatus.setTaskReceive(1); moveYZ(this.crnStatus.getBay(), destinationPosY, this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatus(CrnStatusType.WAITING.id); this.crnStatus.setStatus(DualCrnStatusType.WAITING.id); }else { this.crnStatus.setTaskNoTwo(taskNo); this.crnStatus.setStatusTwo(CrnStatusType.MOVING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.PUT_MOVING.id); this.crnStatus.setTaskReceive(1); moveYZ(this.crnStatus.getBay(), destinationPosY, this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatusTwo(CrnStatusType.WAITING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.WAITING.id); } taskExecuteStation = 0; @@ -143,48 +161,52 @@ if(command.getStation() == 1) { this.crnStatus.setTaskNo(taskNo); this.crnStatus.setStatus(CrnStatusType.FETCH_MOVING.id); this.crnStatus.setStatus(DualCrnStatusType.FETCH_MOVING.id); this.crnStatus.setTaskReceive(1); moveYZ(this.crnStatus.getBay(), sourcePosY,this.crnStatus.getLevel(), sourcePosZ,command.getStation()); this.crnStatus.setStatus(CrnStatusType.FETCHING.id); this.crnStatus.setStatus(DualCrnStatusType.FETCHING.id); sleep(2000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoaded(1); this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id); this.crnStatus.setStatus(DualCrnStatusType.PUT_MOVING.id); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatus(CrnStatusType.PUTTING.id); this.crnStatus.setStatus(DualCrnStatusType.PUTTING.id); sleep(2000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoaded(0); this.crnStatus.setStatus(CrnStatusType.WAITING.id); this.crnStatus.setStatus(DualCrnStatusType.WAITING.id); this.station1LastCommand = command; }else { this.crnStatus.setTaskNoTwo(taskNo); this.crnStatus.setStatusTwo(CrnStatusType.FETCH_MOVING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.FETCH_MOVING.id); this.crnStatus.setTaskReceiveTwo(1); moveYZ(this.crnStatus.getBay(), sourcePosY,this.crnStatus.getLevel(), sourcePosZ, command.getStation()); this.crnStatus.setStatusTwo(CrnStatusType.FETCHING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.FETCHING.id); sleep(2000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoadedTwo(1); this.crnStatus.setStatusTwo(CrnStatusType.PUT_MOVING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.PUT_MOVING.id); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatusTwo(CrnStatusType.PUTTING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.PUTTING.id); sleep(2000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoadedTwo(0); this.crnStatus.setStatusTwo(CrnStatusType.WAITING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.WAITING.id); this.station2LastCommand = command; } taskExecuteStation = 0; @@ -212,30 +234,34 @@ if(command.getStation() == 1) { this.crnStatus.setTaskNo(taskNo); this.crnStatus.setStatus(CrnStatusType.FETCH_MOVING.id); this.crnStatus.setStatus(DualCrnStatusType.FETCH_MOVING.id); this.crnStatus.setTaskReceive(1); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatus(CrnStatusType.FETCHING.id); this.crnStatus.setStatus(DualCrnStatusType.FETCHING.id); sleep(3000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoaded(1); this.crnStatus.setStatus(CrnStatusType.WAITING.id); this.crnStatus.setStatus(DualCrnStatusType.WAITING.id); this.station1LastCommand = command; }else { this.crnStatus.setTaskNoTwo(taskNo); this.crnStatus.setStatusTwo(CrnStatusType.FETCH_MOVING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.FETCH_MOVING.id); this.crnStatus.setTaskReceiveTwo(1); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatusTwo(CrnStatusType.FETCHING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.FETCHING.id); sleep(3000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoadedTwo(1); this.crnStatus.setStatusTwo(CrnStatusType.WAITING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.WAITING.id); this.station2LastCommand = command; } taskExecuteStation = 0; @@ -263,30 +289,34 @@ if(command.getStation() == 1) { this.crnStatus.setTaskNo(taskNo); this.crnStatus.setStatus(CrnStatusType.PUT_MOVING.id); this.crnStatus.setStatus(DualCrnStatusType.PUT_MOVING.id); this.crnStatus.setTaskReceive(1); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatus(CrnStatusType.PUTTING.id); this.crnStatus.setStatus(DualCrnStatusType.PUTTING.id); sleep(3000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoaded(0); this.crnStatus.setStatus(CrnStatusType.WAITING.id); this.crnStatus.setStatus(DualCrnStatusType.WAITING.id); this.station1LastCommand = command; }else { this.crnStatus.setTaskNoTwo(taskNo); this.crnStatus.setStatusTwo(CrnStatusType.PUT_MOVING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.PUT_MOVING.id); this.crnStatus.setTaskReceiveTwo(1); moveYZ(this.crnStatus.getBay(), destinationPosY,this.crnStatus.getLevel(), destinationPosZ, command.getStation()); this.crnStatus.setStatusTwo(CrnStatusType.PUTTING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.PUTTING.id); sleep(3000); if (Thread.currentThread().isInterrupted()) { return; } this.crnStatus.setLoadedTwo(0); this.crnStatus.setStatusTwo(CrnStatusType.WAITING.id); this.crnStatus.setStatusTwo(DualCrnStatusType.WAITING.id); this.station2LastCommand = command; } taskExecuteStation = 0; src/main/java/com/zy/core/thread/impl/ZySiemensDualCrnThread.java
@@ -88,9 +88,13 @@ for (SendDualCrnCommandParam sendDualCrnCommandParam : commandList) { DualCrnCommand dualCrnCommand = sendDualCrnCommandParam.getCommands().get(0); redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_IDX.key + dualCrnCommand.getTaskNo(), 0, 60 * 60 * 24); redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + dualCrnCommand.getTaskNo(), JSON.toJSONString(sendDualCrnCommandParam, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); if (sendDualCrnCommandParam.getStation() == 1) { redisUtil.set(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + crnProtocol.getCrnNo(), dualCrnCommand.getTaskNo(), 60 * 60 * 24); }else { redisUtil.set(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + crnProtocol.getCrnNo(), dualCrnCommand.getTaskNo(), 60 * 60 * 24); } } redisUtil.set(RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getCrnNo(), JSON.toJSONString(commandList, SerializerFeature.DisableCircularReferenceDetect), 60 * 60 * 24); } else if (step == 3) { sendCommand((DualCrnCommand) task.getData()); } @@ -120,11 +124,7 @@ continue; } Object commandListObj = redisUtil.get(RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getCrnNo()); if (commandListObj == null) { continue; } List<SendDualCrnCommandParam> commandList = JSON.parseArray(commandListObj.toString(), SendDualCrnCommandParam.class); List<SendDualCrnCommandParam> commandList = getDualCrnCommandList(); for (SendDualCrnCommandParam commandParam : commandList) { processStation(commandParam); } @@ -246,6 +246,7 @@ //工位1 crnProtocol.setTaskNo(0); crnProtocol.setDeviceTaskNo(0); crnProtocol.setStatus(-1); crnProtocol.setBay(0); crnProtocol.setLevel(0); @@ -256,6 +257,7 @@ //工位2 crnProtocol.setTaskNoTwo(0); crnProtocol.setDeviceTaskNoTwo(0); crnProtocol.setStatusTwo(-1); crnProtocol.setBayTwo(0); crnProtocol.setLevelTwo(0); @@ -315,7 +317,7 @@ crnProtocol.setMode(crnStatus.getMode()); //工位1 crnProtocol.setTaskNo(crnStatus.getTaskNo()); crnProtocol.setDeviceTaskNo(crnStatus.getTaskNo()); crnProtocol.setStatus(crnStatus.getStatus()); crnProtocol.setForkPos(crnStatus.getForkPos()); crnProtocol.setLoaded(crnStatus.getLoaded()); @@ -323,7 +325,7 @@ crnProtocol.setTaskSend(crnStatus.getTaskSend()); //工位2 crnProtocol.setTaskNoTwo(crnStatus.getTaskNoTwo()); crnProtocol.setDeviceTaskNoTwo(crnStatus.getTaskNoTwo()); crnProtocol.setStatusTwo(crnStatus.getStatusTwo()); crnProtocol.setForkPosTwo(crnStatus.getForkPosTwo()); crnProtocol.setLoadedTwo(crnStatus.getLoadedTwo()); @@ -539,4 +541,45 @@ } } } public List<SendDualCrnCommandParam> getDualCrnCommandList() { List<SendDualCrnCommandParam> commandList = new ArrayList<>(); SendDualCrnCommandParam command1 = getDualCrnCommandList(1); SendDualCrnCommandParam command2 = getDualCrnCommandList(2); if (command1 != null) { commandList.add(command1); } if (command2 != null) { commandList.add(command2); } return commandList; } public SendDualCrnCommandParam getDualCrnCommandList(int station) { SendDualCrnCommandParam sendDualCrnCommandParam = null; String key = null; if (station == 1 && crnProtocol.getTaskNo() > 0) { key = RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getTaskNo(); } else if (station == 2 && crnProtocol.getTaskNoTwo() > 0) { key = RedisKeyType.DUAL_CRN_COMMAND_.key + crnProtocol.getTaskNoTwo(); } if (key == null) { return null; } Object commandObj = redisUtil.get(key); if (commandObj == null) { return null; } sendDualCrnCommandParam = JSON.parseObject(commandObj.toString(), SendDualCrnCommandParam.class); if (sendDualCrnCommandParam == null) { return null; } return sendDualCrnCommandParam; } } src/main/java/com/zy/core/utils/DualCrnOperateProcessUtils.java
@@ -465,6 +465,10 @@ Integer station = inStationObjModel.getDualCrnExecuteStation(); if (station == 1) { if (dualCrnProtocol.getTaskNo() > 0) { News.taskInfo(wrkMast.getWrkNo(), "工位1系统内部记录有任务"); return null; } List<Integer> basList = basDualCrnp.getDisableStationOneBays$(); if (basList.contains(Utils.getBay(wrkMast.getLocNo()))) { //禁止放货列,申请重新分配 @@ -472,6 +476,10 @@ return null; } }else { if (dualCrnProtocol.getTaskNoTwo() > 0) { News.taskInfo(wrkMast.getWrkNo(), "工位2系统内部记录有任务"); return null; } List<Integer> basList = basDualCrnp.getDisableStationTwoBays$(); if (basList.contains(Utils.getBay(wrkMast.getLocNo()))) { //禁止放货列,申请重新分配 @@ -520,6 +528,18 @@ if (outStationList.isEmpty()) { News.info("双工位堆垛机:{} 出库站点未设置", basDualCrnp.getCrnNo()); return null; } if (station == 1) { if (dualCrnProtocol.getTaskNo() > 0) { News.taskInfo(wrkMast.getWrkNo(), "工位1系统内部记录有任务"); return null; } }else { if (dualCrnProtocol.getTaskNoTwo() > 0) { News.taskInfo(wrkMast.getWrkNo(), "工位2系统内部记录有任务"); return null; } } Integer crnNo = basDualCrnp.getCrnNo(); @@ -688,12 +708,12 @@ continue; } if(dualCrnProtocol.getTaskNo() > 0 && dualCrnProtocol.getTaskSend() == 0 && dualCrnProtocol.getStatus() == DualCrnStatusType.WAITING.id) { if((dualCrnProtocol.getTaskNo() > 0 && dualCrnProtocol.getDeviceTaskNo() > 0) && dualCrnProtocol.getTaskSend() == 0 && dualCrnProtocol.getStatus().equals(DualCrnStatusType.WAITING.id)) { executeFinish(basDualCrnp, dualCrnThread, dualCrnProtocol, dualCrnProtocol.getTaskNo(), 1); continue; } if(dualCrnProtocol.getTaskNoTwo() > 0 && dualCrnProtocol.getTaskSendTwo() == 0 && dualCrnProtocol.getStatusTwo() == DualCrnStatusType.WAITING.id) { if((dualCrnProtocol.getTaskNoTwo() > 0 && dualCrnProtocol.getDeviceTaskNoTwo() > 0) && dualCrnProtocol.getTaskSendTwo() == 0 && dualCrnProtocol.getStatusTwo().equals(DualCrnStatusType.WAITING.id)) { executeFinish(basDualCrnp, dualCrnThread, dualCrnProtocol, dualCrnProtocol.getTaskNoTwo(), 2); continue; } @@ -762,6 +782,12 @@ DualCrnCommand resetCommand = dualCrnThread.getResetCommand(taskNo, dualCrnProtocol.getCrnNo(), station); boolean offer = MessageQueue.offer(SlaveType.DualCrn, dualCrnProtocol.getCrnNo(), new Task(3, resetCommand)); if (offer) { if (station == 1) { redisUtil.set(RedisKeyType.DUAL_CRN_STATION1_FLAG.key + basDualCrnp.getCrnNo(), 0, 60 * 60 * 24); }else { redisUtil.set(RedisKeyType.DUAL_CRN_STATION2_FLAG.key + basDualCrnp.getCrnNo(), 0, 60 * 60 * 24); } wrkMast.setWrkSts(updateWrkSts); wrkMast.setSystemMsg(""); wrkMast.setIoTime(new Date()); src/main/webapp/components/WatchDualCrnCard.js
@@ -47,8 +47,28 @@ <el-descriptions border direction="vertical"> <el-descriptions-item label="模式">{{ item.mode }}</el-descriptions-item> <el-descriptions-item label="异常码">{{ item.warnCode }}</el-descriptions-item> <el-descriptions-item label="工位1任务号">{{ item.taskNo }}</el-descriptions-item> <el-descriptions-item label="工位2任务号">{{ item.taskNoTwo }}</el-descriptions-item> <el-descriptions-item label="工位1任务号"> <span v-if="readOnly">{{ item.taskNo }}</span> <el-button v-else type="text" size="mini" style="padding:0;" @click.stop="editTaskNo(item, 1)" >{{ item.taskNo }}</el-button> </el-descriptions-item> <el-descriptions-item label="工位2任务号"> <span v-if="readOnly">{{ item.taskNoTwo }}</span> <el-button v-else type="text" size="mini" style="padding:0;" @click.stop="editTaskNo(item, 2)" >{{ item.taskNoTwo }}</el-button> </el-descriptions-item> <el-descriptions-item label="设备工位1任务号">{{ item.deviceTaskNo }}</el-descriptions-item> <el-descriptions-item label="设备工位2任务号">{{ item.deviceTaskNoTwo }}</el-descriptions-item> <el-descriptions-item label="工位1状态">{{ item.status }}</el-descriptions-item> <el-descriptions-item label="工位2状态">{{ item.statusTwo }}</el-descriptions-item> <el-descriptions-item label="工位1是否有物">{{ item.loading }}</el-descriptions-item> @@ -163,6 +183,50 @@ openControl() { this.showControl = !this.showControl; }, editTaskNo(item, station) { let that = this; const isStationOne = station === 1; const fieldName = isStationOne ? "taskNo" : "taskNoTwo"; const stationName = isStationOne ? "工位1" : "工位2"; const currentTaskNo = item[fieldName] == null ? "" : String(item[fieldName]); that.$prompt("请输入" + stationName + "任务号", "编辑任务号", { confirmButtonText: "确定", cancelButtonText: "取消", inputValue: currentTaskNo, inputPattern: /^\d+$/, inputErrorMessage: "任务号必须是非负整数", }).then(({ value }) => { const taskNo = Number(value); $.ajax({ url: baseUrl + "/dualcrn/command/updateTaskNo", headers: { token: localStorage.getItem("token"), }, contentType: "application/json", method: "post", data: JSON.stringify({ crnNo: item.crnNo, station: station, taskNo: taskNo, }), success: (res) => { if (res.code == 200) { item[fieldName] = taskNo; that.$message({ message: stationName + "任务号更新成功", type: "success", }); that.getDualCrnStateInfo(); } else { that.$message({ message: res.msg, type: "warning", }); } }, }); }).catch(() => {}); }, getDualCrnStateInfo() { if (this.$root.sendWs) { this.$root.sendWs(JSON.stringify({