From 8257d89c461f6553d66fad1e5e3df3d172a00924 Mon Sep 17 00:00:00 2001
From: 1 <1>
Date: 星期六, 29 十一月 2025 18:10:18 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java | 84 +++++++++++++++++++++++++++++++++--------
1 files changed, 67 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
index 7674759..d402788 100644
--- a/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -14,13 +14,16 @@
import com.zy.asrs.entity.result.StockVo;
import com.zy.asrs.mapper.TagMapper;
import com.zy.asrs.service.*;
+import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.MatUtils;
import com.zy.asrs.utils.OrderInAndOutUtil;
import com.zy.asrs.utils.Utils;
+import com.zy.common.constant.ArmConstant;
import com.zy.common.model.DetlDto;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.common.utils.NodeUtils;
+import com.zy.erp.kingdee.utils.PostMesDataUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -663,7 +666,8 @@
.eq("status", 1)
);
if (Cools.isEmpty(basArm)){
- throw new CoolException("鏈烘鑷傞厤缃紓甯革紝鏌ヨ涓嶅埌鏈烘鑷傛暟鎹紒锛侊紒"+ JSON.toJSONString(param));
+ return;
+// throw new CoolException("鏈烘鑷傞厤缃紓甯革紝鏌ヨ涓嶅埌鏈烘鑷傛暟鎹紒锛侊紒"+ JSON.toJSONString(param));
}
try{
@@ -702,7 +706,8 @@
.eq("status", 1)
);
if (Cools.isEmpty(basArmMast)){
- throw new CoolException("鏈煡璇㈠埌鐩稿叧鏈烘鑷傛媶鐮佸灈浠诲姟锛侊紒锛�"+ JSON.toJSONString(param));
+ return;
+// throw new CoolException("鏈煡璇㈠埌鐩稿叧鏈烘鑷傛媶鐮佸灈浠诲姟锛侊紒锛�"+ JSON.toJSONString(param));
}
if (Integer.parseInt(param.getPick_num()) !=1){
basArmMast.setStatus(9);
@@ -733,7 +738,8 @@
if (Cools.isEmpty(basArmMast)){
throw new CoolException("鏈煡璇㈠埌鐩稿叧鏈烘鑷傛媶鐮佸灈浠诲姟锛侊紒锛�"+ JSON.toJSONString(param));
}
- basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),2,3);
+ basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(),1,3);
+ basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(),2,3);
}
@Override
@@ -754,7 +760,7 @@
.eq("status", 5)
);
if (!Cools.isEmpty(basArmMast)){
- basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(), 5,6);
+ basArmMastService.updateArmMastStatus(param.getArm_no(),basArmMast.getSortingLine(),basArmMast.getStaNo(), 5,6);
}
}
@@ -792,7 +798,6 @@
if (param == null) {
throw new CoolException("鍙傛暟涓嶈兘涓虹┖");
}
- Integer devpId = 1;
// 鍒涘缓瀵硅薄锛堟瀯閫犲嚱鏁颁腑宸茬敓鎴� timestamp锛�
BasAgvMast basAgvMast = new BasAgvMast();
// 鐢熸垚 WMS 浠诲姟鍙凤紙濡傛棤澶栭儴浼犲叆锛屽彲浠ヤ娇鐢ㄩ洩鑺盜D 鎴栬嚜澧烇級
@@ -808,7 +813,7 @@
basAgvMast.setAppeTime(new Date()); // 娣诲姞鏃堕棿
basAgvMast.setModiTime(new Date()); // 淇敼鏃堕棿
basAgvMast.setIoType(param.getIoType());// 浠诲姟绫诲瀷
- basAgvMast.setDevpId(devpId);
+ basAgvMast.setFloorNo(param.getFloorNo()); //妤煎眰
// 鎻掑叆鏁版嵁搴�
basAgvMastService.insert(basAgvMast);
@@ -867,23 +872,18 @@
agvBindCtnrAndBinParam.setReqCode(String.valueOf(System.currentTimeMillis()));
agvBindCtnrAndBinParam.setCtnrCode(param.getBarcode());
agvBindCtnrAndBinParam.setCtnrTyp("1");
- agvBindCtnrAndBinParam.setPositionCode(
- basAgvLocNoSou != null && basAgvLocNoSou.getAgvLocNo() != null
- ? basAgvLocNoSou.getAgvLocNo()
- : ""
- );
- agvBindCtnrAndBinParam.setStgBinCode(
- basAgvLocNoEnd != null && basAgvLocNoEnd.getAgvLocNo() != null
- ? basAgvLocNoEnd.getAgvLocNo()
- : ""
- );
+ if(basAgvLocNoEnd != null && basAgvLocNoEnd.getAgvLocNo() != null){
+ agvBindCtnrAndBinParam.setStgBinCode(basAgvLocNoEnd.getAgvLocNo());
+ }
+ if(basAgvLocNoSou != null && basAgvLocNoSou.getAgvLocNo() != null){
+ agvBindCtnrAndBinParam.setStgBinCode(basAgvLocNoSou.getAgvLocNo());
+ }
agvBindCtnrAndBinParam.setIndBind(param.getIndBind());
try {
String URL = "http://10.10.10.200:8181/rcms/services/rest/hikRpcService"; // AGV鎺ュ彛鍦板潃
String mesPath = "bindCtnrAndBin"; // 鎺ュ彛璺緞
String response = "";
boolean success = false;
-
try {
log.info("AGV缁戝畾瀹瑰櫒鎺ュ彛璇锋眰鍙傛暟: {}", JSON.toJSONString(agvBindCtnrAndBinParam));
@@ -914,5 +914,55 @@
}
+ @Override
+ @Transactional
+ public boolean agvApplicationPassedTheGrating(ArmAgvGratingParam arm) {
+ ReturnT<String> result = new PostMesDataUtils().postMesDataArmGrating("鍏夋爡璇锋眰涓嬪彂锛�", ArmConstant.getArmUrl(arm.getArmNo()), ArmConstant.ARM_ADAPTOR_GRATING_AGVENTER, arm);
+ if (result.getCode()==200){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ @Transactional
+ public boolean agvApplicationPassedTheGrating(AgvGoTheArnParam param) {
+ String URL = "http://10.10.10.200:8181/rcms/services/rest/hikRpcService"; // AGV鎺ュ彛鍦板潃
+ String AGVPath = "continueTask"; // 鎺ュ彛璺緞
+ AgvGoParam agvGoParam = new AgvGoParam();
+ agvGoParam.setCode("0");
+ agvGoParam.setMessage("缁х画鎵ц");
+ agvGoParam.setReqCode(param.getReqCode());
+ ReturnT<String> result = new PostMesDataUtils().postMesDataArmGrating("鍏夋爡涓嬪彂鍚庣户缁换鍔★細", URL, AGVPath, param);
+ if (result.getCode()==200){
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ @Transactional
+ public boolean agvBindAndBin(String taskNo) {
+ String URL = "http://10.10.10.200:8181/"; // AGV鎺ュ彛鍦板潃
+ String AGVPath = "rcms/services/rest/hikRpcService/bindCtnrAndBin"; // 鎺ュ彛璺緞
+ BasAgvMast basAgvMast = basAgvMastService.selectOne(new EntityWrapper<BasAgvMast>().eq("task_no",taskNo));
+ BasAgvLocNoService basAgvLocNoService = SpringUtils.getBean(BasAgvLocNoService.class);
+ BasAgvLocNo basAgvLocNoEnd = basAgvLocNoService.selectOne(
+ new EntityWrapper<BasAgvLocNo>().eq("sta_no", basAgvMast.getStaNo())
+ );
+ AgvBindCtnrAndBinParam agvBindCtnrAndBinParam = new AgvBindCtnrAndBinParam();
+ agvBindCtnrAndBinParam.setReqCode(basAgvMast.getTaskNo() + "-" + basAgvMast.getTimestamp());
+ agvBindCtnrAndBinParam.setCtnrCode(basAgvMast.getTimestamp().toString());
+ agvBindCtnrAndBinParam.setCtnrTyp("1");
+ agvBindCtnrAndBinParam.setStgBinCode(basAgvLocNoEnd.getAgvLocNo());
+ agvBindCtnrAndBinParam.setIndBind("0");
+ ReturnT<String> resultBind = new PostMesDataUtils().postMesDataArmGrating("AGV瀹瑰櫒缁戝畾瑙g粦", URL,AGVPath, agvBindCtnrAndBinParam);
+ if (resultBind.getCode()!=200){
+ return true;
+ }
+ return false;
+ }
+
+
}
--
Gitblit v1.9.1