From 69c997d31073a2a8370dd764138f7ef208804a49 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 29 七月 2025 09:56:19 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java | 14 +++++++
src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java | 11 +++++
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 67 +++++++++++++++++++++++++++++++++
src/main/java/com/zy/asrs/controller/MobileController.java | 14 +++++++
src/main/java/com/zy/asrs/service/MobileService.java | 4 ++
5 files changed, 109 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index e5bd07f..562bcec 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -698,4 +698,18 @@
return R.ok("涓婃姤ERP鎴愬姛");
}
+ @RequestMapping("/pallet/toOutSta")
+ @ManagerAuth(memo = "鎵樼洏鍘诲嚭搴撳彛")
+ public R toOutSta(@RequestBody PalletToOutStaParam param) {
+ mobileService.toOutSta(param, getUserId());
+ return R.ok();
+ }
+
+ @RequestMapping("/pallet/toAllOut")
+ @ManagerAuth(memo = "鎷f枡杞叏鏉�")
+ public R toAllOut(@RequestBody PalletToAllOutParam param) {
+ mobileService.toAllOut(param, getUserId());
+ return R.ok();
+ }
+
}
diff --git a/src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java b/src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java
new file mode 100644
index 0000000..6e818bd
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java
@@ -0,0 +1,14 @@
+package com.zy.asrs.entity.param;
+
+import lombok.Data;
+
+@Data
+public class PalletToAllOutParam {
+
+ // 鎵樼洏鏉$爜
+ private String barcode;
+
+ // 鎵樼洏鏉$爜
+ private String newBarcode;
+
+}
diff --git a/src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java b/src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java
new file mode 100644
index 0000000..11d15e9
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java
@@ -0,0 +1,11 @@
+package com.zy.asrs.entity.param;
+
+import lombok.Data;
+
+@Data
+public class PalletToOutStaParam {
+
+ // 鎵樼洏鏉$爜
+ private String barcode;
+
+}
diff --git a/src/main/java/com/zy/asrs/service/MobileService.java b/src/main/java/com/zy/asrs/service/MobileService.java
index 06756eb..8d083ae 100644
--- a/src/main/java/com/zy/asrs/service/MobileService.java
+++ b/src/main/java/com/zy/asrs/service/MobileService.java
@@ -74,4 +74,8 @@
Double curOutQty, Integer ioType, Long userId, Date now);
void checkOutSubmit(Integer orderId, Long userId);
+
+ void toOutSta(PalletToOutStaParam param, Long userId);
+
+ void toAllOut(PalletToAllOutParam param, Long userId);
}
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index f4b0696..e1564e6 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -19,10 +19,11 @@
import com.zy.common.model.DetlDto;
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
-import com.zy.common.utils.Synchro;
+import com.zy.common.utils.HttpHandler;
import com.zy.nc.service.NccJcQilibcBarcodeflowWmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -38,6 +39,9 @@
@Slf4j
@Service
public class MobileServiceImpl implements MobileService {
+
+ @Value("${wcs.url}")
+ private String wcsUrl;
@Autowired
private MatService matService;
@@ -1264,4 +1268,65 @@
throw new CoolException("鐩樼偣鏈畬鎴愭棤娉曚笂鎶�");
}
}
+
+ @Override
+ public void toOutSta(PalletToOutStaParam param, Long userId) {
+ WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
+ if (wrkMast == null) {
+ throw new CoolException("宸ヤ綔妗d笉瀛樺湪");
+ }
+
+ if (wrkMast.getIoType() != 103) {
+ throw new CoolException("宸ヤ綔妗g被鍨嬩笉鏄嫞鏂欏嚭搴�");
+ }
+
+ if (wrkMast.getWrkSts() != 14) {
+ throw new CoolException("宸ヤ綔鐘舵�佹湭澶勪簬宸插嚭搴�");
+ }
+
+ String response = "";
+ try {
+ HashMap<String, Object> map = new HashMap<>();
+ map.put("wrkNo", wrkMast.getWrkNo());
+ map.put("sourceStaNo", wrkMast.getStaNo());
+ map.put("staNo", 1075);
+
+ response = new HttpHandler.Builder()
+ .setUri(wcsUrl)
+ .setPath("/open/toOutSta")
+ .setJson(JSON.toJSONString(map))
+ .build()
+ .doPost();
+ log.info("toOutSta:{}", response);
+ } catch (Exception e) {
+ log.error("fail", e);
+ }
+ }
+
+ @Override
+ public void toAllOut(PalletToAllOutParam param, Long userId) {
+ WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
+ if (wrkMast == null) {
+ throw new CoolException("宸ヤ綔妗d笉瀛樺湪");
+ }
+
+ if (wrkMast.getIoType() != 103) {
+ throw new CoolException("宸ヤ綔妗g被鍨嬩笉鏄嫞鏂欏嚭搴�");
+ }
+
+ if (wrkMast.getWrkSts() != 14) {
+ throw new CoolException("宸ヤ綔鐘舵�佹湭澶勪簬宸插嚭搴�");
+ }
+
+ wrkMast.setBarcode(param.getNewBarcode());
+ wrkMast.setModiTime(new Date());
+ wrkMast.setModiUser(userId);
+ wrkMastService.updateById(wrkMast);
+
+ WrkDetl wrkDetl = new WrkDetl();
+ wrkDetl.setZpallet(param.getNewBarcode());
+ wrkDetl.setModiTime(new Date());
+ wrkDetl.setModiUser(userId);
+ wrkDetlService.update(wrkDetl, new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
+ }
}
--
Gitblit v1.9.1