From dcd2e9ad65580de56147956e718059f50f1691d2 Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期五, 30 一月 2026 08:36:12 +0800
Subject: [PATCH] no message
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 102 +++++++++++++++++++++++++--------------------------
1 files changed, 50 insertions(+), 52 deletions(-)
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 d998706..f8d4fbf 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1760,53 +1760,44 @@
*/
@Override
@Transactional(rollbackFor = Exception.class)
- public void combInPub(CompleteParam param, Long userId) {
+ public R combInPub(CompleteParam param, Long userId) {
if (Objects.isNull(param.getBarcode())) {
throw new CoolException("鎵樼洏鐮佷笉鑳戒负绌猴紒锛�");
}
- if (Objects.isNull(param.getStation())) {
+ if (Objects.isNull(param.getSourceStaNo())) {
throw new CoolException("绔欑偣涓嶈兘涓虹┖!!");
}
-// // TODO 淇敼缂撳瓨绔欑偣鐘舵�佸強鏁版嵁
-// Task task = taskService.selectOne(new EntityWrapper<Task>()
-// .eq("wrk_sts", 14L)
-// .eq("barcode", param.getCarBarcode()));
-// if (Objects.isNull(task)) {
-// throw new CoolException("鏁版嵁閿欒,浠诲姟涓嶅瓨鍦�!!");
-// }
-// List<TaskDetl> taskDetls = taskDetlService
-// .selectList(new EntityWrapper<TaskDetl>().eq("wrk_no", task.getWrkNo()));
-// if (Objects.isNull(taskDetls) || taskDetls.isEmpty()) {
-// throw new CoolException("鏁版嵁閿欒,浠诲姟鏄庣粏涓嶅瓨鍦�!!");
-// }
+ if (Objects.isNull(param.getLocType1())) {
+ param.setLocType1((short)1);
+ }
- BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>()
- .eq("dev_no", param.getStation()));
+
+ log.info("WCS浠诲姟鐢熸垚璇锋眰鍙傛暟锛�", JSONObject.toJSONString(param));
+
+
+ BasDevp station = basDevpService.selectOne(new EntityWrapper<BasDevp>()
+ .eq("dev_no", param.getSourceStaNo()));
if (Objects.isNull(station)) {
throw new CoolException("绔欑偣涓嶅瓨鍦�!!");
}
- station.setLocSts(LocStsType.LOC_STS_TYPE_O.type);
- station.setBarcode("");
- if (!basStationService.updateById(station)) {
- throw new CoolException("绔欑偣鐘舵�佷慨鏀瑰け璐�!");
- }
- basStationDetlService.delete(new EntityWrapper<BasStationDetl>().eq("dev_no", station.getDevNo()));
-
-// // 浠诲姟瀹屾垚
-// task.setWrkSts(15L);
-//
-// if (!taskService.updateById(task)) {
-// throw new CoolException("AGV浠诲姟瀹屾垚澶辫触!!");
-// }
-
List<WaitPakin> waitPakins = waitPakinService
- .selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
+ .selectList(new EntityWrapper<WaitPakin>()
+ .eq("io_status" , "N")
+ .eq("zpallet", param.getBarcode()));
if (Objects.isNull(waitPakins) || waitPakins.isEmpty()) {
throw new CoolException("鏁版嵁閿欒,缁勬嫋妗e凡涓嶅瓨鍦�!!");
}
- generateCrnInTask(waitPakins, station, param.getLocType1(), userId);
+ WrkMast wrkMast = generateCrnInTask(waitPakins, station, param.getLocType1(), userId);
+
+ Map<String, Object> response = new HashMap<>();
+ response.put("taskNo", wrkMast.getWrkNo());
+ response.put("locNo", wrkMast.getLocNo());
+ response.put("taskPri", wrkMast.getIoPri());
+
+ return R.ok("浠诲姟鐢熸垚鎴愬姛").add(response);
+
}
/**
@@ -1946,18 +1937,18 @@
* @date 2025/12/9 13:54
*/
@Transactional(rollbackFor = Exception.class)
- public void generateCrnInTask(List<WaitPakin> waitPakins, BasStation station, Short locType, Long userId) {
+ public WrkMast generateCrnInTask(List<WaitPakin> waitPakins, BasDevp station, Short locType, Long userId) {
Date now = new Date();
- StationRela rela = stationRelaService.selectOne(new EntityWrapper<StationRela>()
- .eq("agv_sta", station.getDevNo())
- .orderAsc(Arrays.asList("crn_sta"))
- .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
+// StationRela rela = stationRelaService.selectOne(new EntityWrapper<StationRela>()
+// .eq("agv_sta", station.getDevNo())
+// .orderAsc(Arrays.asList("crn_sta"))
+// .last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
+//
+// if (Objects.isNull(rela)) {
+// throw new CoolException("鏈粦瀹氫綔涓氱珯鐐�!!");
+// }
- if (Objects.isNull(rela)) {
- throw new CoolException("鏈粦瀹氫綔涓氱珯鐐�!!");
- }
-
- BasDevp sourceStaNo = basDevpService.checkSiteStatus(Integer.parseInt(rela.getCrnSta()), true);
+ BasDevp sourceStaNo = basDevpService.checkSiteStatus(station.getDevNo(), true);
sourceStaNo.setLocType1(locType);
LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
WaitPakin pakin = waitPakins.stream().findFirst().get();
@@ -1965,6 +1956,7 @@
WrkMast mast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", pakin.getZpallet()));
WrkMast wrkMast = new WrkMast();
+ String locNo;
if (!Objects.isNull(mast)) {
if (mast.getIoType().equals(TaskIOType.MERGE_OUT.type) || mast.getIoType().equals(TaskIOType.PICK_OUT.type) || mast.getIoType().equals(TaskIOType.CHECK_OUT.type)) {
int ioType = mast.getIoType() - 50;
@@ -1978,6 +1970,7 @@
if (!res) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
}
+ locNo = mast.getLocNo();
// 鏇存柊婧愮珯鐐逛俊鎭�
sourceStaNo.setWrkNo(mast.getWrkNo());
sourceStaNo.setModiTime(now);
@@ -1998,8 +1991,10 @@
} else {
throw new CoolException("鎵樼洏宸插瓨鍦ㄤ换鍔℃。锛侊紒");
}
+
} else {
StartupDto dto = commonService.getLocNo(1, sourceStaNo.getDevNo(), findLocNoAttributeVo, locTypeDto);
+
int workNo = dto.getWorkNo();
// 鐢熸垚宸ヤ綔妗�
wrkMast.setWrkNo(workNo);
@@ -2027,6 +2022,7 @@
if (!res) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
}
+ locNo = dto.getLocNo();
// 鏇存柊婧愮珯鐐逛俊鎭�
sourceStaNo.setWrkNo(workNo);
sourceStaNo.setModiTime(now);
@@ -2060,16 +2056,18 @@
});
-// // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
-// Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
-// .eq("zpallet", pakin.getZpallet());
-// WaitPakin setParam = new WaitPakin();
-// setParam.setLocNo(dto.getLocNo());
-// setParam.setIoStatus("Y");
-// setParam.setModiTime(now);
-// if (!waitPakinService.update(setParam, wrapper)) {
-// throw new CoolException("鏇存柊閫氱煡妗eけ璐�");
-// }
+ // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
+ Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>()
+ .eq("zpallet", pakin.getZpallet());
+ WaitPakin setParam = new WaitPakin();
+ setParam.setLocNo(locNo);
+ setParam.setIoStatus("Y");
+ setParam.setModiTime(now);
+ if (!waitPakinService.update(setParam, wrapper)) {
+ throw new CoolException("鏇存柊閫氱煡妗eけ璐�");
+ }
+
+ return wrkMast;
}
/**
--
Gitblit v1.9.1