From 9f2f1f535d4abfc9cdf68eef651cb73ef2e04bcb Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期二, 29 七月 2025 11:06:14 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 89 +++++++++++++++++++++++++++++++++++--------- 1 files changed, 71 insertions(+), 18 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 5918f7c..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; @@ -740,13 +744,13 @@ } // 璁㈠崟鏄庣粏鏁伴噺鏍¢獙 - OrderDetl orderDetl = OrderInAndOutUtil.selectItem(Boolean.TRUE, order.getId(), waitPakin.getMatnr(), waitPakin.getBatch(), waitPakin.getBrand(), waitPakin.getStandby1(), waitPakin.getStandby2(), waitPakin.getStandby3(), + OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(order.getId(), waitPakin.getMatnr(), waitPakin.getBatch(), waitPakin.getBrand(), waitPakin.getStandby1(), waitPakin.getStandby2(), waitPakin.getStandby3(), waitPakin.getBoxType1(), waitPakin.getBoxType2(), waitPakin.getBoxType3()); - if (orderDetl == null) { + if (orderDetlPakin == null) { continue; } - Double workQty = orderDetl.getWorkQty(); + Double workQty = orderDetlPakin.getWorkQty(); BigDecimal workQtyDecimal = new BigDecimal(workQty); workQtyDecimal = workQtyDecimal.subtract(BigDecimal.valueOf(waitPakin.getAnfme())); @@ -754,8 +758,8 @@ if (newWorkQty <= 0) { newWorkQty = 0D; } - orderDetl.setWorkQty(newWorkQty); - orderDetlService.updateById(orderDetl); + orderDetlPakin.setWorkQty(newWorkQty); + orderDetlPakinService.updateById(orderDetlPakin); } } @@ -837,10 +841,6 @@ List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); List<WrkDetl> list = JSON.parseArray(JSON.toJSONString(param.getWrkDetls()), WrkDetl.class); - LocDetlAdjustParam adjustParam = new LocDetlAdjustParam(); - List<LocDetlAdjustParam.LocDetlAdjust> locDetlAdjusts = new ArrayList<>(); - - adjustParam.setLocNo(wrkMast.getSourceLocNo()); // 淇敼鏁伴噺 Iterator<WrkDetl> iterator = wrkDetls.iterator(); while (iterator.hasNext()) { @@ -892,11 +892,6 @@ throw new CoolException("娣诲姞" + wrkMast.getWrkNo() + "鐩樼偣浠诲姟锛�" + wrkDetl.getMatnr() + "鍟嗗搧锛�" + wrkDetl.getBatch() + "鎵瑰彿浠诲姟鏄庣粏澶辫触"); } } - List<WrkDetl> wrkDetls1 = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); - for (WrkDetl wrkDetl : wrkDetls1) { - LocDetlAdjustParam.LocDetlAdjust locDetlAdjust = new LocDetlAdjustParam.LocDetlAdjust(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme()); - locDetlAdjusts.add(locDetlAdjust); - } List<WrkDetl> paramWrkDetls = JSON.parseArray(JSON.toJSONString(param.getWrkDetls()), WrkDetl.class); for (WrkDetl wrkDetl : paramWrkDetls) { @@ -921,9 +916,6 @@ if (!wrkMastService.updateById(wrkMast)) { throw new CoolException("淇敼鐩樼偣浠诲姟涓绘。澶辫触"); } - adjustParam.setList(locDetlAdjusts); - workService.adjustLocDetl2(adjustParam, userId); - } @Override @@ -1276,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