From a6df3df0ddf1b121f78ea895da9b557c41ec3804 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 22 一月 2026 14:11:18 +0800
Subject: [PATCH] 输送线组托功能优化
---
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 55 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 33 insertions(+), 22 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 c3db773..ff97fe4 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -605,9 +605,6 @@
if (Objects.isNull(container)) {
throw new CoolException("鏁版嵁閿欒锛氬鍣ㄧ爜涓嶅瓨鍦紒锛�");
}
- // if (param.getBarcode().length() != 8) {
- // throw new CoolException("鏉$爜闀垮害涓嶆槸8浣�===>>" + param.getBarcode());
- // }
if (Objects.isNull(param.getType())) {
param.setType("0");
@@ -689,7 +686,10 @@
OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
.eq("order_id", order.getId())
.eq("matnr", elem.getMatnr()));
-
+ if (Objects.isNull(elem.getBoxType1())) {
+ throw new CoolException("鏍煎眰缂栫爜涓嶈兘涓虹┖锛侊紒");
+ }
+ detls.setBoxType1(elem.getBoxType1());
if (Objects.isNull(detls)) {
throw new CoolException("鏁版嵁閿欒锛氬崟鎹槑缁嗕笉瀛樺湪锛侊紒");
}
@@ -699,14 +699,14 @@
}
OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), elem.getMatnr(), elem.getBatch(),
elem.getBrand(), elem.getStandby1(), elem.getStandby2(), elem.getStandby3(),
- elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
- DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(),
+ "1", elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme());
+ DetlDto detlDto = new DetlDto(order.getOrderNo(), elem.getMatnr(), elem.getBatch(), elem.getBrand(), elem.getStandby1(),
elem.getStandby2(), elem.getStandby3(),
elem.getBoxType1(), elem.getBoxType2(), elem.getBoxType3(), elem.getAnfme(),
elem.getThreeCode());
detlDto.setOrderId(order.getId());
detlDto.setOrderNo(order.getOrderNo());
- if (DetlDto.has(detlDtos, detlDto)) {
+ if (DetlDto.hasOrder(detlDtos, detlDto)) {
DetlDto one = DetlDto.findDto(detlDtos, detlDto);
assert one != null;
one.setAnfme(one.getAnfme() + detlDto.getAnfme());
@@ -762,6 +762,7 @@
waitPakin.setThreeCode(detlDto.getThreeCode());
waitPakin.setSuppCode(detlDto.getStandby1());
waitPakin.setStandby1(detlDto.getStandby1());
+ waitPakin.setBoxType1(detlDto.getBoxType1());
waitPakin.setIoStatus("N"); // 鍏ュ嚭鐘舵��
waitPakin.setAnfme(detlDto.getAnfme()); // 鏁伴噺
waitPakin.setStatus("Y"); // 鐘舵��
@@ -991,7 +992,7 @@
try {
response = new HttpHandler.Builder()
.setUri(MesConstant.URL)
- .setPath(MesConstant.PACK_DOWN_URL)
+ .setPath(MesConstant.IN_DISPATCH_RESULT)
.setJson(JSON.toJSONString(mesCombParam))
.build()
.doPost();
@@ -999,11 +1000,11 @@
if (jsonObject.getInteger("code").equals(200)) {
success = true;
} else if (jsonObject.getInteger("code").equals(500)) {
- log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL,
+ log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
JSON.toJSONString(mesCombParam), response);
throw new CoolException(jsonObject.getString("msg"));
} else {
- log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PACK_DOWN_URL,
+ log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
JSON.toJSONString(mesCombParam), response);
throw new CoolException("涓婃姤mes绯荤粺澶辫触");
}
@@ -1015,7 +1016,7 @@
// 淇濆瓨鎺ュ彛鏃ュ織
apiLogService.save(
"鎵撳寘涓嬬嚎甯墭涓婃姤",
- MesConstant.URL + MesConstant.PACK_DOWN_URL,
+ MesConstant.URL + MesConstant.IN_DISPATCH_RESULT,
null,
"127.0.0.1",
JSON.toJSONString(mesCombParam),
@@ -1066,7 +1067,7 @@
// }
OrderInAndOutUtil.increaseWorkQty(Boolean.TRUE, order.getId(), detlDto.getMatnr(), detlDto.getBatch(),
detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(),
- detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme());
+ "1", detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme());
// 淇濆瓨鍏ュ簱閫氱煡妗�
Mat mat = matService.selectByMatnr(detlDto.getMatnr());
if (Cools.isEmpty(mat)) {
@@ -1179,7 +1180,7 @@
@Override
@Transactional
public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl,
- Double curOutQty, Integer ioType, Long userId, Date now) {
+ Double curOutQty, Integer ioType, Long userId, Date now) {
// 鑾峰彇搴撲綅
LocMast locMast = locMastService.selectById(locDetl.getLocNo());
// 鑾峰彇璺緞
@@ -1810,10 +1811,11 @@
/**
* SO/EO 鍖虹粍鎵�
- * @author Ryan
- * @date 2025/12/18 15:19
+ *
* @param params
* @return com.core.common.R
+ * @author Ryan
+ * @date 2025/12/18 15:19
*/
@Override
@Transactional(rollbackFor = Exception.class)
@@ -1924,6 +1926,10 @@
&& wrkMast.getIoType().equals(TaskIOType.PICK_OUT.type)) {
throw new CoolException("浜虹墿绫诲瀷閿欒");
}
+
+ wrkDetlService.selectList(new EntityWrapper<WrkDetl>()
+ .eq(!Objects.isNull(params.getMatnr()), "matnr", params.getMatnr())
+ .eq("wrk_no", wrkMast.getWrkNo()));
List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
if (Cools.isEmpty(wrkDetls)) {
@@ -2053,7 +2059,6 @@
throw new CoolException("淇濆瓨宸ヤ綔鏄庣粏澶辫触");
}
});
-
// // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> Y
@@ -2195,8 +2200,14 @@
.eq("loc_sts", LocStsType.LOC_STS_TYPE_D.type)
.orderAsc(Arrays.asList("row1", "bay1", "lev1"))
.last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"));
+
+ if (Objects.isNull(locMast)) {
+ throw new CoolException("鏈煡璇㈠埌鍙敤鐨勭┖鏉夸俊鎭紒锛�");
+ }
+
CrnTaskDetlDTO crnTaskDetlDTO = new CrnTaskDetlDTO().setLocNo(locMast.getLocNo()).setLocDetlList(locDetls);
locMasts.add(crnTaskDetlDTO);
+
// 绌烘澘鍑哄簱
generateTask(locMasts, TaskIOType.MERGE_OUT.type, basDevp, userId, station);
}
@@ -2222,7 +2233,7 @@
WrkMast wrkMast1 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("source_loc_no", locMast.getLocNo()));
// 鐢熸垚宸ヤ綔鍙�
int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
- if (Cools.isEmpty(wrkMast1)){
+ if (Cools.isEmpty(wrkMast1)) {
Integer outSta = devp.getDevNo();
// 鑾峰彇璺緞
StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta);
@@ -2254,14 +2265,13 @@
if (!wrkMastService.insert(wrkMast)) {
throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐ワ紝鍑哄簱搴撲綅鍙凤細" + locMast.getLocNo());
}
- }else {
+ } else {
workNo = wrkMast1.getWrkNo();
}
// 鐢熸垚宸ヤ綔妗f槑缁�
for (LocDetl detlDto : crnTaskDetlDTO.getLocDetlList()) {
WrkDetl wrkDetl = new WrkDetl();
BeanUtils.copyProperties(detlDto, wrkDetl);
- wrkDetl.setOrderNo(""); // 鎵嬪姩鍑哄簱涓嶉渶瑕佸甫鍑哄簱瀛樹腑鐨勫崟鎹紪鍙�
wrkDetl.setWrkNo(workNo);
wrkDetl.setIoTime(now);
wrkDetl.setZpallet(null);
@@ -2534,10 +2544,11 @@
/**
* 鍛煎彨AGV绌哄彴杞﹁繑鍥�
- * @author Ryan
- * @date 2025/9/24
+ *
* @param callAgvBackParam
* @return com.core.common.R
+ * @author Ryan
+ * @date 2025/9/24
*/
@Override
@Transactional(rollbackFor = Exception.class)
@@ -2548,7 +2559,7 @@
// 鎸夊綋鍓嶆煡鎵惧簱浣嶉『搴忥紝鏌ュ埌涓�涓悗锛屼笉鍐嶅線涓嬫煡璇�
LocCache locCache = findPriorityLocCache();
-
+
if (Objects.isNull(locCache)) {
return R.error("鏈煡璇㈠埌鍙敤搴撲綅");
}
--
Gitblit v1.9.1