From c64b495fa07b7d381df66590894109fb672c20f0 Mon Sep 17 00:00:00 2001 From: 1 <1@123> Date: 星期四, 08 五月 2025 14:57:50 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 63 +++++++++++++++++++++---------- 1 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java index 69a505a..aaa1e03 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -12,10 +12,7 @@ import com.zy.asrs.entity.*; import com.zy.asrs.mapper.*; import com.zy.asrs.service.*; -import com.zy.asrs.utils.CommandUtils; -import com.zy.asrs.utils.RouteUtils; -import com.zy.asrs.utils.TrackRangeUtils; -import com.zy.asrs.utils.Utils; +import com.zy.asrs.utils.*; import com.zy.common.model.MatDto; import com.zy.common.service.CommonService; import com.zy.common.utils.CollectionUtils; @@ -194,7 +191,7 @@ String barcode = barcodeThread.getBarcode(); if (!Cools.isEmpty(barcode) && !barcode.equals("99999999")) { // 璇锋眰wms鎺ュ彛锛岃幏鍙栧伐浣滃彿鍜岀洰鏍囧簱浣� - ToWmsDTO toWmsDTO = new ToWmsDTO(barcode, staProtocol.getSiteId(), 0); + ToWmsDTO toWmsDTO = new ToWmsDTO(staProtocol.getSiteId(),staProtocol.getGrossWt(),barcode, 0); TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("barcode", barcode)); if (!Cools.isEmpty(taskWrk1)) { log.info("鎵樼洏鐮侊細" + barcode + "浠诲姟妗e瓨鍦�"); @@ -465,7 +462,8 @@ // 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢 if (staProtocol.isAutoing() && staProtocol.isLoading() - && staProtocol.isInEnable() && (workNo == 0 || (workNo>9000 && workNo<10000)) +// && staProtocol.isInEnable() + && (workNo == 0 || (workNo>9000 && workNo<10000)) && staProtocol.isPakMkWalk() ) { if (inSta.isBarcodeSign()){ @@ -510,6 +508,7 @@ } else { staProtocol.setWorkNo(taskWrk1.getWrkNo()); staProtocol.setStaNo(staDesc.getCrnStn()); + devpThread.setPakMkWalk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); } } @@ -517,7 +516,7 @@ } } } else { - TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>()); + TaskWrk taskWrk1 = taskWrkService.selectOne(new EntityWrapper<TaskWrk>().eq("IO_TYPE",1).eq("WRK_STS",1).eq("START_POINT",staProtocol.getSiteId().toString())); if (!Cools.isEmpty(taskWrk1)) { if (taskWrk1.getIoType() == 1 && taskWrk1.getStartPoint().equals(staProtocol.getSiteId().toString())) { @@ -528,8 +527,21 @@ return; } else { staProtocol.setWorkNo(taskWrk1.getWrkNo()); - staProtocol.setStaNo(staDesc.getCrnStn()); + staProtocol.setStaNo(BarcodeUtils.getStaNo(staProtocol.getSiteId())); + devpThread.setPakMkWalk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); + + Date now = new Date(); +// taskWrk1.setStatus(TaskStatusType.DISTRIBUTE.id);//娲惧彂鐘舵�� +// taskWrk.setAssignTime(now);//娲惧彂鏃堕棿 + taskWrk1.setExecuteTime(now); + taskWrk1.setWrkSts(2);//宸ヤ綔鐘舵�� 3.鍚婅溅鍏ュ簱 + taskWrk1.setCrnNo(staDesc.getCrnNo());//鍫嗗灈鏈哄彿 + taskWrk1.setModiTime(now); + taskWrk1.setModiUser(9988L); + taskWrkService.updateById(taskWrk1); + + } } return; @@ -593,7 +605,7 @@ log.info("涓嬪彂杈撻�佺嚎浠诲姟锛歵askWrk:" + JSON.toJSONString(taskWrk)); // R r = siteController.siteDetlUpdate(Integer.valueOf(taskWrk.getTargetPoint()), taskWrk.getWrkNo().shortValue(), (short) 0, "Y", false, false); staProtocol.setWorkNo(taskWrk.getWrkNo()); - staProtocol.setStaNo(staDesc.getCrnStn()); + staProtocol.setStaNo(BarcodeUtils.getStaNo(staProtocol.getSiteId())); boolean offer = false; try { offer = MessageQueue.offer(SlaveType.Devp, 1, new Task(2, staProtocol)); @@ -605,7 +617,7 @@ if (offer) { log.info("涓嬪彂杈撻�佺嚎浠诲姟鎴愬姛锛歵askWrk:" + JSON.toJSONString(taskWrk)); Date now = new Date(); - taskWrk.setStatus(5); + taskWrk.setStatus(9); taskWrk.setWrkSts(14); taskWrk.setModiTime(now); taskWrk.setCompleteTime(now); @@ -797,7 +809,7 @@ HashMap<String, Object> headParam = new HashMap<>(); headParam.put("taskNo", taskWrk.getTaskNo()); headParam.put("status", taskWrk.getStatus()); - headParam.put("ioType", taskWrk.getIoType()); + headParam.put("ioType", taskWrk.getIoTypeWms()); headParam.put("barcode", taskWrk.getBarcode()); String response; response = new HttpHandler.Builder() @@ -917,7 +929,7 @@ HashMap<String, Object> headParam = new HashMap<>(); headParam.put("taskNo", taskWrk.getTaskNo()); headParam.put("status", taskWrk.getStatus()); - headParam.put("ioType", taskWrk.getIoType()); + headParam.put("ioType", taskWrk.getIoTypeWms()); headParam.put("barcode", taskWrk.getBarcode()); String response; response = new HttpHandler.Builder() @@ -1021,7 +1033,7 @@ HashMap<String, Object> headParam = new HashMap<>(); headParam.put("taskNo", taskWrk.getTaskNo()); headParam.put("status", taskWrk.getStatus()); - headParam.put("ioType", taskWrk.getIoType()); + headParam.put("ioType", taskWrk.getIoTypeWms()); headParam.put("barcode", taskWrk.getBarcode()); String response; response = new HttpHandler.Builder() @@ -1135,7 +1147,7 @@ HashMap<String, Object> headParam = new HashMap<>(); headParam.put("taskNo", taskWrk.getTaskNo()); headParam.put("status", taskWrk.getStatus()); - headParam.put("ioType", taskWrk.getIoType()); + headParam.put("ioType", taskWrk.getIoTypeWms()); headParam.put("barcode", taskWrk.getBarcode()); String response; log.error("wcs瀹岀粨浠诲姟涓婃姤wms==銆�", headParam); @@ -1343,7 +1355,7 @@ if (rgvProtocol == null || rgvTaskProtocol == null) { return false; } - if (!rgvProtocol.getModeType().equals(RgvModeType.AUTO) || rgvProtocol.getRgvPos().equals(0L) || rgvTaskProtocol.getAvoid() == -1 || rgvProtocol.getRgvPosDestination() == 0L + if (!rgvProtocol.getModeType().equals(RgvModeType.AUTO) || rgvProtocol.getRgvPos().equals(0L) || rgvTaskProtocol.getAvoid() == -1 || (!rgvProtocol.getStatusType().equals(RgvStatusType.IDLE) && !rgvProtocol.getStatusType().equals(RgvStatusType.ROAM))) { return false; } @@ -1371,8 +1383,9 @@ // 鍒ゆ柇鏄惁婊¤冻鍙栬揣鏉′欢 if (staProtocol.isAutoing() // && staProtocol.isLoading() + && staProtocol.isStaOk() && staProtocol.getWorkNo() != 0) { - TaskWrk taskWrk = taskWrkService.selectByTaskNo(staProtocol.getWorkNo().toString()); + TaskWrk taskWrk = taskWrkService.selectByWrkNo(staProtocol.getWorkNo()); if (taskWrk != null) { return taskWrk; } @@ -1594,7 +1607,8 @@ if (taskWrk == null) { return false; } - Integer targetPointConvert = taskWrk.getTargetPointConvert(); +// Integer targetPointConvert = taskWrk.getTargetPointConvert(); + Integer targetPointConvert = BarcodeUtils.getOutStaNo(taskWrk.getOriginTargetPoint()); if (targetPointConvert == null) { return false; } @@ -1607,7 +1621,7 @@ BasDevpPosition basDevpPositionEnd = basDevpPositionService.selectOne(new EntityWrapper<BasDevpPosition>().eq("DEV_NO", targetPointConvert)); //鎵ц issuedTake.setTaskNo(Long.valueOf(taskWrk.getTaskNo())); - issuedTake.setTaskStatus(1); + issuedTake.setTaskStatus(2); issuedTake.setTaskNoDirection(issuedTake.gettaskNoDirection$(issuedTake.getTaskNo(), issuedTake.getTaskStatus())); issuedTake.setTargetPosition(basDevpPositionSou.getPlcPosition()); issuedTake.setIsRunning(1); @@ -1615,7 +1629,7 @@ issuedPut.setTaskNo(Long.valueOf(taskWrk.getTaskNo())); - issuedPut.setTaskStatus(2); + issuedPut.setTaskStatus(3); issuedPut.setTaskNoDirection(issuedPut.gettaskNoDirection$(issuedPut.getTaskNo(), issuedPut.getTaskStatus())); issuedPut.setTargetPosition(basDevpPositionEnd.getPlcPosition()); issuedPut.setIsRunning(1); @@ -1665,8 +1679,17 @@ } // 鑾峰彇宸ヤ綔妗f暟鎹� LedCommand ledCommand = new LedCommand(); - //璇锋眰wms +// +// ledCommand.setWorkNo(wrkMast.getWrkNo()); +// ledCommand.setIoType(wrkMast.getIoType()); +// ledCommand.setTitle("绌烘澘鍑哄簱"); +// ledCommand.setEmptyMk(true); +// ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); +// ledCommand.setLocNo(wrkMast.getLocNo()); +// ledCommand.setStaNo(wrkMast.getStaNo()); + MatDto matDto = new MatDto(); + ledCommand.getMatDtos().add(matDto); commands.add(ledCommand); } Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet()); -- Gitblit v1.9.1