src/main/java/com/zy/asrs/controller/BasMapController.java
@@ -221,6 +221,7 @@ StationObjModel barcodeStationModel = new StationObjModel(); barcodeStationModel.setDeviceNo(deviceNo); barcodeStationModel.setStationId(value.getInteger("stationId")); barcodeStationModel.setBarcodeIdx(value.getInteger("barcodeIdx")); if (value.getInteger("backStation") != null) { StationObjModel backStation = new StationObjModel(); src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -119,7 +119,9 @@ vo.setEnableIn(stationProtocol.isEnableIn());// å¯å¨å ¥åº vo.setPalletHeight(stationProtocol.getPalletHeight()); // æçé«åº¦ vo.setError(stationProtocol.getError()); // é误ç vo.setErrorMsg(stationProtocol.getErrorMsg()); // æ¥è¦ä¿¡æ¯ vo.setBarcode(stationProtocol.getBarcode()); // æ¡ç vo.setWeight(stationProtocol.getWeight());//éé String stationStatus = StationStatusType.process(stationProtocol).toString().toLowerCase().replaceAll("_", "-"); if (stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.getTaskNo() > 0 && !stationProtocol.isRunBlock()) { String taskClass = getStationTaskClass(stationProtocol.getTaskNo(), inTaskRange, outTaskRange); src/main/java/com/zy/asrs/domain/vo/StationLatestDataVo.java
@@ -44,9 +44,15 @@ //æ¥è¦ private Integer error; //æ¥è¦ä¿¡æ¯ private String errorMsg; //æ¡ç private String barcode; private String stationStatus; //éé private Double weight; } src/main/java/com/zy/asrs/utils/Utils.java
@@ -193,10 +193,20 @@ .eq("in_enable", "Y") .eq("status", 1); if (hasConfig) { wrapper.in("crn_no", allowedCrnNos); } if (currentCircleTaskCrnNo != null) { currentCircleTaskCrnNo = currentCircleTaskCrnNo + 1; BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", currentCircleTaskCrnNo)); List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no", currentCircleTaskCrnNo)); BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() .eq("crn_no", currentCircleTaskCrnNo) .eq("in_enable", "Y") .eq("status", 1) ); List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>() .eq("crn_no", currentCircleTaskCrnNo) ); if (currentCrnTask.size() <= 1) { if (basCrnp != null) { List<List<Integer>> rowList = basCrnp.getControlRows$(); @@ -230,9 +240,6 @@ List<BasCrnp> enabledCrnps = new ArrayList<>(); for (BasCrnp basCrnp : baseList) { if (hasConfig && !allowedCrnNos.contains(basCrnp.getCrnNo())) { continue; } CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); if (crnThread == null) { continue; @@ -311,6 +318,10 @@ .eq("in_enable", "Y") .eq("status", 1); if (hasConfig) { wrapper.in("crn_no", allowedCrnNos); } HashMap<Integer, Integer> map = new HashMap<>(); List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(wrapper); @@ -333,10 +344,6 @@ List<BasDualCrnp> enabledCrnps = new ArrayList<>(); for (BasDualCrnp basDualCrnp : baseList) { if (hasConfig && !allowedCrnNos.contains(basDualCrnp.getCrnNo())) { continue; } DualCrnThread dualCrnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, basDualCrnp.getCrnNo()); if (dualCrnThread == null) { continue; src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -40,6 +40,7 @@ CHECK_STATION_RUN_BLOCK_LIMIT_("check_station_run_block_limit_"), CHECK_SHALLOW_LOC_STATUS_LIMIT("check_shallow_loc_status_limit_"), GENERATE_ENABLE_IN_STATION_DATA_LIMIT("generate_enable_in_station_data_limit_"), GENERATE_STATION_BACK_LIMIT("generate_station_back_limit_"), DUAL_CRN_PICK_WAIT_NEXT_TASK("dual_crn_pick_wait_next_task_"), DUAL_CRN_OUT_TASK_STATION_INFO("dual_crn_out_task_station_info_"), src/main/java/com/zy/core/enums/WrkIoType.java
@@ -8,6 +8,8 @@ OUT(101, "åºåº"), LOC_MOVE(201, "ç§»åºä»»å¡"), FAKE_TASK_NO(9999, "仿çéæºå·¥ä½å·"), ENABLE_IN(9998, "å¯å¨å ¥åº"), STATION_BACK(9997, "ç«ç¹åé"), ; WrkIoType(int id, String desc) { src/main/java/com/zy/core/model/StationObjModel.java
@@ -17,6 +17,8 @@ private Integer stationLev; private Integer barcodeIdx; private StationObjModel barcodeStation; private StationObjModel backStation; src/main/java/com/zy/core/model/protocol/StationProtocol.java
@@ -49,6 +49,9 @@ //æ¥è¦ private Integer error; //æ¥è¦ä¿¡æ¯ private String errorMsg; //æ¡ç private String barcode; src/main/java/com/zy/core/network/entity/ZyStationStatusEntity.java
@@ -41,6 +41,9 @@ //æ¥è¦ private Integer error; //æ¥è¦ä¿¡æ¯ private String errorMsg; //æ¡ç private String barcode; src/main/java/com/zy/core/network/real/ZyStationRealConnect.java
@@ -22,6 +22,7 @@ import com.zy.core.network.api.ZyStationConnectApi; import com.zy.core.network.entity.ZyStationStatusEntity; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.text.MessageFormat; @@ -87,6 +88,9 @@ } statusList = JSONObject.parseArray(basDevp.getStationList(), ZyStationStatusEntity.class); if (statusList != null) { statusList.sort(Comparator.comparing(ZyStationStatusEntity::getStationId)); } barcodeStatusList = JSONObject.parseArray(basDevp.getBarcodeStationList(), ZyStationStatusEntity.class); } src/main/java/com/zy/core/network/real/ZyStationV3RealConnect.java
@@ -17,6 +17,7 @@ import com.zy.core.cache.OutputQueue; import com.zy.core.enums.StationCommandType; import com.zy.core.model.CommandResponse; import com.zy.core.model.StationObjModel; import com.zy.core.model.command.StationCommand; import com.zy.core.network.api.ZyStationConnectApi; import com.zy.core.network.entity.ZyStationStatusEntity; @@ -35,7 +36,7 @@ public class ZyStationV3RealConnect implements ZyStationConnectApi { private List<ZyStationStatusEntity> statusList; private List<ZyStationStatusEntity> barcodeStatusList; private List<StationObjModel> barcodeOriginList; private SiemensS7Net siemensNet; private DeviceConfig deviceConfig; private RedisUtil redisUtil; @@ -94,10 +95,7 @@ if (statusList != null) { statusList.sort(Comparator.comparing(ZyStationStatusEntity::getStationId)); } barcodeStatusList = JSONObject.parseArray(basDevp.getBarcodeStationList(), ZyStationStatusEntity.class); if (barcodeStatusList != null) { barcodeStatusList.sort(Comparator.comparing(ZyStationStatusEntity::getStationId)); } barcodeOriginList = basDevp.getBarcodeStationList$(); } if (siemensNet == null) { @@ -122,21 +120,94 @@ boolean[] status2 = siemensNet.getByteTransform().TransBool(result.Content, i * 8 + 7, 1); statusEntity.setRunBlock(status2[1]);//éæ°è§å路线 statusEntity.setEnableIn(status2[3]);//å¯å¨å ¥åº Integer palletHeight = null; if (status[7]) { palletHeight = 1;//ä½ } if (status2[0]) { palletHeight = 2;//ä¸ } if (status[6]) { palletHeight = 3;//é« } statusEntity.setPalletHeight(palletHeight);//é«ä½ä¿¡å· statusEntity.setError(0);//é»è®¤æ æ¥è¦ } } // æ¡ç æ«æå¨ OperateResultExOne<byte[]> result2 = siemensNet.Read("DB101.0", (short) (statusList.size() * 10)); OperateResultExOne<byte[]> result2 = siemensNet.Read("DB101.0", (short) (barcodeOriginList.size() * 16)); if (result2.IsSuccess) { for (int i = 0; i < barcodeStatusList.size(); i++) { ZyStationStatusEntity barcodeEntity = barcodeStatusList.get(i); ZyStationStatusEntity statusEntity = findStatusEntity(barcodeEntity.getStationId()); if (statusEntity == null) { for (int i = 0; i < barcodeOriginList.size(); i++) { ZyStationStatusEntity barcodeEntity = findStatusEntityByBarcodeIdx(i + 1); if (barcodeEntity == null) { continue; } String barcode = siemensNet.getByteTransform().TransString(result2.Content, i * 10 + 2, 8, "UTF-8"); String barcode = siemensNet.getByteTransform().TransString(result2.Content, i * 16 + 2, 14, "UTF-8"); barcode = barcode.trim(); barcodeEntity.setBarcode(barcode); } } // ç§°é OperateResultExOne<byte[]> result3 = siemensNet.Read("DB102.0", (short) (barcodeOriginList.size() * 4)); if (result3.IsSuccess) { for (int i = 0; i < barcodeOriginList.size(); i++) { ZyStationStatusEntity barcodeEntity = findStatusEntityByBarcodeIdx(i + 1); if (barcodeEntity == null) { continue; } double weight = (double) siemensNet.getByteTransform().TransSingle(result3.Content, i * 4); barcodeEntity.setWeight(weight); } } // æ¥è¦ä¿¡æ¯ OperateResultExOne<byte[]> result4 = siemensNet.Read("DB103.0", (short) (barcodeOriginList.size() * 2)); if (result4.IsSuccess) { for (int i = 0; i < barcodeOriginList.size(); i++) { ZyStationStatusEntity barcodeEntity = findStatusEntityByBarcodeIdx(i + 1); if (barcodeEntity == null) { continue; } StringBuilder sb = new StringBuilder(); boolean[] status1 = siemensNet.getByteTransform().TransBool(result4.Content, i * 2, 1); boolean[] status2 = siemensNet.getByteTransform().TransBool(result4.Content, i * 2 + 1, 1); if(status1[0]){ sb.append("å·¦è¶ å®½æ¥è¦;"); } if(status1[1]) { sb.append("å³è¶ 宽æ¥è¦;"); } if(status1[2]) { sb.append("åè¶ é¿æ¥è¦;"); } if(status1[3]) { sb.append("åè¶ é¿æ¥è¦;"); } if(status1[4]) { sb.append("è¶ é«æ¥è¦;"); } if(status1[5]) { sb.append("æè´§æ¥è¦ï¼ç©ºæå ¥åºæ¶æ£æµæç䏿æ è´§ç©;"); } if(status1[6]) { sb.append("ééå¼å¸¸æ¥è¦;"); } if(status1[7]) { sb.append("æ«ç å¼å¸¸;"); } if(sb.length() > 0) { barcodeEntity.setError(1); }else { barcodeEntity.setError(0); } barcodeEntity.setErrorMsg(sb.toString()); } } @@ -199,6 +270,46 @@ log.error("åå ¥è¾é线å½ä»¤å¤±è´¥ãç«ç¹ç¼å·={}ï¼ç«ç¹æ°æ®={}", command.getTaskNo(), JSON.toJSON(command)); commandResponse.setResult(false); } } else if (command.getCommandType().equals(StationCommandType.WRITE_INFO)) { int enableCommandIdx = -1; while (true) { enableCommandIdx = getEnableCommandIdx(command.getTaskNo()); if(enableCommandIdx == -1) { try { Thread.sleep(300); }catch (Exception e) {} }else { break; } tryCount++; if (tryCount > maxTryCount) { commandResponse.setMessage("å½ä»¤ä¸åè¶ æ¶ï¼æ æ³æ¾å°å¯ç¨ä¸ååºå"); return commandResponse; } } short[] data = new short[21]; data[0] = command.getTargetStaNo().shortValue(); data[1] = command.getTargetStaNo().shortValue(); OperateResult writeTask = siemensNet.Write("DB23." + (enableCommandIdx * taskAddressLength), command.getTaskNo()); try { Thread.sleep(50); }catch (Exception e) {} OperateResult writeData = siemensNet.Write("DB23." + (enableCommandIdx * taskAddressLength + 4), data); try { Thread.sleep(200); }catch (Exception e) {} OperateResult writeConfirm = siemensNet.Write("DB23." + (enableCommandIdx * taskAddressLength + 46), (short) 1); if(writeTask.IsSuccess && writeData.IsSuccess && writeConfirm.IsSuccess) { log.error("åå ¥è¾é线å½ä»¤æåãä»»å¡å·={}ï¼ç«ç¹æ°æ®={}", command.getTaskNo(), JSON.toJSON(command)); commandResponse.setResult(true); }else { log.error("åå ¥è¾é线å½ä»¤å¤±è´¥ãç«ç¹ç¼å·={}ï¼ç«ç¹æ°æ®={}", command.getTaskNo(), JSON.toJSON(command)); commandResponse.setResult(false); } } return commandResponse; } @@ -231,10 +342,18 @@ return new byte[0]; } private ZyStationStatusEntity findStatusEntity(Integer stationId) { for (ZyStationStatusEntity statusEntity : statusList) { if (statusEntity.getStationId().equals(stationId)) { return statusEntity; private ZyStationStatusEntity findStatusEntityByBarcodeIdx(Integer barcodeIdx) { Integer stationId = null; for (StationObjModel stationObjModel : barcodeOriginList) { if (stationObjModel.getBarcodeIdx().equals(barcodeIdx)) { stationId = stationObjModel.getStationId(); break; } } for (ZyStationStatusEntity zyStationStatusEntity : statusList) { if(zyStationStatusEntity.getStationId().equals(stationId)) { return zyStationStatusEntity; } } return null; @@ -243,9 +362,9 @@ private int getEnableCommandIdx(int taskNo) { int useIdx = -1; for (int i = 0; i < taskAddressLimit; i++) { OperateResultExOne<byte[]> resultTask = siemensNet.Read("DB23." + (i * taskAddressLength + 0), (short) 2); OperateResultExOne<byte[]> resultTask = siemensNet.Read("DB23." + (i * taskAddressLength + 0), (short) 4); OperateResultExOne<byte[]> resultStatus = siemensNet.Read("DB23." + (i * taskAddressLength + 46), (short) 2); if(resultTask.IsSuccess && resultStatus.IsSuccess) { if(!resultTask.IsSuccess || !resultStatus.IsSuccess) { continue; } src/main/java/com/zy/core/plugin/NormalProcess.java
@@ -56,10 +56,10 @@ @Override public void run() { //请æ±çæå ¥åºä»»å¡ generateStoreWrkFile(); //æ£æµå ¥åºç«æ¯å¦æä»»å¡çæï¼å¹¶å¯å¨å ¥åº checkInStationHasTask(); //请æ±çæå ¥åºä»»å¡ generateStoreWrkFile(); //æ§è¡å åæºä»»å¡ crnOperateUtils.crnIoExecute(); @@ -71,6 +71,9 @@ stationOperateProcessUtils.stationOutExecute(); //æ£æµè¾éç«ç¹åºåºä»»å¡æ§è¡å®æ stationOperateProcessUtils.stationOutExecuteFinish(); //æ£æµè¾éç«ç¹æ¯å¦è¿è¡å µå¡ stationOperateProcessUtils.checkStationRunBlock(); } /** @@ -102,8 +105,23 @@ //满足èªå¨ãæç©ãæå·¥ä½å·ï¼çæå ¥åºæ°æ® if (stationProtocol.isAutoing() && stationProtocol.isLoading() && stationProtocol.isInEnable() && stationProtocol.getTaskNo() > 0 ) { if (stationProtocol.getError() > 0) { Object backLock = redisUtil.get(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationId); if (backLock != null) { continue; } //æ¥è¦åé StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.STATION_BACK.id), stationId, entity.getBackStation().getStationId(), 0); MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); redisUtil.set(RedisKeyType.GENERATE_STATION_BACK_LIMIT.key + stationId, "lock", 15); News.info("{}ç«ç¹æ¥è¦åéæåï¼æ°æ®å :{}", stationId, JSON.toJSONString(command)); continue; } if (Cools.isEmpty(stationProtocol.getBarcode())) { continue; } @@ -135,13 +153,6 @@ taskParam.setTaskPri(dto.getTaskPri()); taskParam.setBarcode(stationProtocol.getBarcode()); WrkMast wrkMast = commonService.createInTask(taskParam); StationCommand command = stationThread.getCommand(StationCommandType.WRITE_INFO, wrkMast.getWrkNo(), stationId, stationId, 0); if(command == null){ News.taskInfo(wrkMast.getWrkNo(), "è·åè¾é线å½ä»¤å¤±è´¥"); continue; } MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); } } } @@ -182,9 +193,10 @@ && stationProtocol.getTaskNo() == 0 && stationProtocol.isEnableIn() ) { StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.FAKE_TASK_NO.id), stationId, entity.getBarcodeStation().getStationId(), 0); StationCommand command = stationThread.getCommand(StationCommandType.MOVE, commonService.getWorkNo(WrkIoType.ENABLE_IN.id), stationId, entity.getBarcodeStation().getStationId(), 0); MessageQueue.offer(SlaveType.Devp, basDevp.getDevpNo(), new Task(2, command)); redisUtil.set(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 10); redisUtil.set(RedisKeyType.GENERATE_ENABLE_IN_STATION_DATA_LIMIT.key + stationId, "lock", 15); News.info("{}ç«ç¹å¯å¨å ¥åºæåï¼æ°æ®å :{}", stationId, JSON.toJSONString(command)); } } } src/main/java/com/zy/core/thread/impl/ZyStationThread.java
@@ -136,8 +136,11 @@ stationProtocol.setFullPlt(statusEntity.isFullPlt()); stationProtocol.setPalletHeight(statusEntity.getPalletHeight()); stationProtocol.setError(statusEntity.getError()); stationProtocol.setErrorMsg(statusEntity.getErrorMsg()); stationProtocol.setBarcode(statusEntity.getBarcode()); stationProtocol.setRunBlock(statusEntity.isRunBlock()); stationProtocol.setEnableIn(statusEntity.isEnableIn()); stationProtocol.setWeight(statusEntity.getWeight()); } } } src/main/java/com/zy/core/thread/impl/ZyStationV3Thread.java
@@ -140,9 +140,11 @@ stationProtocol.setFullPlt(statusEntity.isFullPlt()); stationProtocol.setPalletHeight(statusEntity.getPalletHeight()); stationProtocol.setError(statusEntity.getError()); stationProtocol.setErrorMsg(statusEntity.getErrorMsg()); stationProtocol.setBarcode(statusEntity.getBarcode()); stationProtocol.setRunBlock(statusEntity.isRunBlock()); stationProtocol.setEnableIn(statusEntity.isEnableIn()); stationProtocol.setWeight(statusEntity.getWeight()); } } } @@ -294,7 +296,7 @@ List<Integer> segmentEndIndices = new ArrayList<>(); int idx = 0; while (idx < total) { int end = Math.min(idx + 20, total) - 1; int end = Math.min(idx + 3, total) - 1; segmentTargets.add(path.get(end)); segmentEndIndices.add(end); idx = end + 1; @@ -314,22 +316,29 @@ segCmd.setNavigatePath(new ArrayList<>(path.subList(0, currentEndIdx + 1))); sendCommand(segCmd); boolean finished = false; while (!finished) { long runTime = System.currentTimeMillis(); while (true) { try { Integer currentStationId = findCurrentStationByTask(original.getTaskNo()); if (currentStationId == null) { StationProtocol currentStation = findCurrentStationByTask(original.getTaskNo()); if (currentStation == null) { if(System.currentTimeMillis() - runTime > 1000 * 60){ break; } Thread.sleep(500); continue; } int currentIndex = path.indexOf(currentStationId); runTime = System.currentTimeMillis(); if (currentStation.isRunBlock()) { break; } int currentIndex = path.indexOf(currentStation.getStationId()); if (currentIndex < 0) { Thread.sleep(500); continue; } int remaining = total - currentIndex - 1; if (remaining <= 0) { finished = true; break; } int currentSegEndIndex = path.indexOf(segmentTargets.get(segCursor)); @@ -361,7 +370,7 @@ } } private Integer findCurrentStationByTask(Integer taskNo) { private StationProtocol findCurrentStationByTask(Integer taskNo) { try { com.zy.asrs.service.DeviceConfigService deviceConfigService = SpringUtils.getBean(com.zy.asrs.service.DeviceConfigService.class); if (deviceConfigService == null) { @@ -380,7 +389,7 @@ } for (StationProtocol sp : m.values()) { if (sp.getTaskNo() != null && sp.getTaskNo().equals(taskNo) && sp.isLoading()) { return sp.getStationId(); return sp; } } } src/main/java/com/zy/core/utils/StationOperateProcessUtils.java
@@ -90,11 +90,6 @@ continue; } if (!wrkMast.getWrkNo().equals(stationProtocol.getTaskNo())) { News.taskInfo(stationProtocol.getStationId(), "è¾éç«ç¹å·¥ä½å·:{}䏿¡ç æç´¢å°çä»»å¡å·¥ä½å·:{}ä¸ä¸è´", stationProtocol.getTaskNo(), wrkMast.getWrkNo()); continue; } String locNo = wrkMast.getLocNo(); FindCrnNoResult findCrnNoResult = commonService.findCrnNoByLocNo(locNo); if (findCrnNoResult == null) { src/main/resources/docs/µØÍ¼²Ù×÷˵Ã÷Êé.pdfBinary files differ
src/main/resources/sql/20251219153026.nb3Binary files differ
src/main/resources/sql/20260109084743.nb3Binary files differ
src/main/webapp/components/DevpCard.js
@@ -43,10 +43,12 @@ <el-descriptions-item label="å¯å¨å ¥åº">{{ item.enableIn ? 'Y' : 'N' }}</el-descriptions-item> <el-descriptions-item label="æçé«åº¦">{{ item.palletHeight }}</el-descriptions-item> <el-descriptions-item label="æ¡ç ">{{ item.barcode }}</el-descriptions-item> <el-descriptions-item label="éé">{{ item.weight }}</el-descriptions-item> <el-descriptions-item label="æ é代ç ">{{ item.error }}</el-descriptions-item> <el-descriptions-item label="æ éä¿¡æ¯">{{ item.errorMsg }}</el-descriptions-item> <el-descriptions-item label="æ©å±æ°æ®">{{ item.extend }}</el-descriptions-item> </el-descriptions> </el-collapse-item> </el-collapse-item> </el-collapse> </div> <div style="display:flex; justify-content:flex-end; margin-top:8px;"> src/main/webapp/components/MapCanvas.js
@@ -539,7 +539,7 @@ } if (status === "site-auto") { this.updateColor(sta, 0x78ff81); } else if (status === "site-auto-run" || status === "site-auto-run-id") { } else if (status === "site-auto-run" || status === "site-auto-id" || status === "site-auto-run-id") { this.updateColor(sta, 0xfa51f6); } else if (status === "site-unauto") { this.updateColor(sta, 0xb8b8b8);