From f934f933155b4c65a17d18176f4a2fbf95e68535 Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期三, 28 五月 2025 08:33:01 +0800 Subject: [PATCH] 13 --- src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java | 144 ++++++++++++++++++++++++++++------------------- 1 files changed, 86 insertions(+), 58 deletions(-) diff --git a/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java b/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java index e70d467..5dd1c51 100644 --- a/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java +++ b/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java @@ -1,7 +1,6 @@ package com.zy.nc.task.handler; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.core.common.Cools; import com.core.exception.CoolException; import com.zy.asrs.entity.InventoryCheckOrder; @@ -24,6 +23,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.util.ArrayList; +import java.util.Date; import java.util.List; @Service @@ -65,26 +65,61 @@ public ReturnT<String> start1(List<NccSaleXsfhmxWms> wmsFlag) { try { OpenOrderPakoutParam param = new OpenOrderPakoutParam(); - param.setOrderType("閿�鍞彂璐�"); DetlDto detlDto; List<DetlDto> orderDetails = new ArrayList<>(); long i = 1; for (NccSaleXsfhmxWms nccSaleXsfhmxWms : wmsFlag) { - if (nccSaleXsfhmxWms.getFstatusflag() == 2 && nccSaleXsfhmxWms.getBdr() == 0 && nccSaleXsfhmxWms.getHdr() == 0) { - detlDto = new DetlDto(); - detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm()); - detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum().doubleValue()); - detlDto.setLineNumber(i); - detlDto.setRemark(JSONObject.toJSONString(nccSaleXsfhmxWms)); - orderDetails.add(detlDto); - log.info("NccSaleXsfhmxWms鏁版嵁:{}", JSONObject.toJSON(nccSaleXsfhmxWms)); - i++; - } + param.setOrderType("閿�鍞彂璐�"); + detlDto = new DetlDto(); + detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm()); + detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum().doubleValue()); + detlDto.setStandby1(nccSaleXsfhmxWms.getFhckbm()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccSaleXsfhmxWms)); + orderDetails.add(detlDto); + log.info("NccSaleXsfhmxWms鏁版嵁:{}", JSONObject.toJSON(nccSaleXsfhmxWms)); + i++; nccSaleXsfhmxWms.setWmsFlag(1); param.setOrderNo(nccSaleXsfhmxWms.getVbillcode()); } param.setOrderDetails(orderDetails); openService.pakoutOrderCreate(param); + nccSaleXsfhmxWmsService.updateBatchById(wmsFlag); + } catch (Exception e) { + e.printStackTrace(); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return FAIL.setMsg(e.getMessage()); + } + return SUCCESS; + } + + /** + * 鍙戣揣 + * + * @return + */ + public ReturnT<String> start1In(List<NccSaleXsfhmxWms> wmsFlag) { + try { + OpenOrderPakinParam param = new OpenOrderPakinParam(); + DetlDto detlDto; + List<DetlDto> orderDetails = new ArrayList<>(); + long i = 1; + for (NccSaleXsfhmxWms nccSaleXsfhmxWms : wmsFlag) { + param.setOrderType("閿�鍞��璐�"); + detlDto = new DetlDto(); + detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm()); + detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum().doubleValue()); + detlDto.setStandby1(nccSaleXsfhmxWms.getFhckbm()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccSaleXsfhmxWms)); + orderDetails.add(detlDto); + log.info("NccSaleXsfhmxWms鏁版嵁:{}", JSONObject.toJSON(nccSaleXsfhmxWms)); + i++; + nccSaleXsfhmxWms.setWmsFlag(1); + param.setOrderNo(nccSaleXsfhmxWms.getVbillcode()); + } + param.setOrderDetails(orderDetails); + openService.pakinOrderCreate(param); nccSaleXsfhmxWmsService.updateBatchById(wmsFlag); } catch (Exception e) { e.printStackTrace(); @@ -108,16 +143,15 @@ long i = 1; for (NccScZkmxbWms nccScZkmxbWms : wmsFlag) { log.info("NccScZkmxbWms鏁版嵁:{}", JSONObject.toJSON(nccScZkmxbWms)); - if (nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getDr() == 0) { - detlDto = new DetlDto(); - detlDto.setMatnr(nccScZkmxbWms.getWlbm()); - detlDto.setAnfme(nccScZkmxbWms.getYingzzsl().doubleValue()); - detlDto.setBatch(nccScZkmxbWms.getVbatchcode()); - detlDto.setLineNumber(i); - detlDto.setRemark(JSONObject.toJSONString(nccScZkmxbWms)); - orderDetails.add(detlDto); - i++; - } + detlDto = new DetlDto(); + detlDto.setMatnr(nccScZkmxbWms.getWlbm()); + detlDto.setAnfme(nccScZkmxbWms.getYingzzsl().doubleValue()); + detlDto.setBatch(nccScZkmxbWms.getVbatchcode()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccScZkmxbWms)); + detlDto.setStandby1(nccScZkmxbWms.getRkckbm()); + orderDetails.add(detlDto); + i++; nccScZkmxbWms.setWmsFlag(1); param.setOrderNo(nccScZkmxbWms.getVbillcode()); } @@ -146,16 +180,14 @@ long i = 1; for (NccScZkmxbWms nccScZkmxbWms : wmsFlag) { log.info("NccScZkmxbWms鏁版嵁:{}", JSONObject.toJSON(nccScZkmxbWms)); - if (nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getDr() == 0) { - detlDto = new DetlDto(); - detlDto.setMatnr(nccScZkmxbWms.getWlbm()); - detlDto.setAnfme(nccScZkmxbWms.getYingzzsl().doubleValue()); - detlDto.setBatch(nccScZkmxbWms.getVbatchcode()); - detlDto.setLineNumber(i); - detlDto.setRemark(JSONObject.toJSONString(nccScZkmxbWms)); - orderDetails.add(detlDto); - i++; - } + detlDto = new DetlDto(); + detlDto.setMatnr(nccScZkmxbWms.getWlbm()); + detlDto.setAnfme(nccScZkmxbWms.getYingzzsl().doubleValue()); + detlDto.setBatch(nccScZkmxbWms.getVbatchcode()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccScZkmxbWms)); + orderDetails.add(detlDto); + i++; nccScZkmxbWms.setWmsFlag(1); param.setOrderNo(nccScZkmxbWms.getVbillcode()); } @@ -184,16 +216,15 @@ long i = 1; for (NccCgCgdhdWms nccCgCgdhdWms : wmsFlag) { log.info("nccCgCgdhdWms鏁版嵁:{}", JSONObject.toJSON(nccCgCgdhdWms)); - if (nccCgCgdhdWms.getBdr() == 0 && nccCgCgdhdWms.getHdr() == 0) { - detlDto = new DetlDto(); - detlDto.setMatnr(nccCgCgdhdWms.getWlbm()); - detlDto.setAnfme(nccCgCgdhdWms.getYdzsl().doubleValue()); - detlDto.setBatch(nccCgCgdhdWms.getVbatchcode()); - detlDto.setLineNumber(i); - detlDto.setRemark(JSONObject.toJSONString(nccCgCgdhdWms)); - orderDetails.add(detlDto); - i++; - } + detlDto = new DetlDto(); + detlDto.setMatnr(nccCgCgdhdWms.getWlbm()); + detlDto.setAnfme(nccCgCgdhdWms.getYdzsl().doubleValue()); + detlDto.setBatch(nccCgCgdhdWms.getVbatchcode()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccCgCgdhdWms)); + detlDto.setStandby1(nccCgCgdhdWms.getCkbm()); + orderDetails.add(detlDto); + i++; nccCgCgdhdWms.setWmsFlag(1); param.setOrderNo(nccCgCgdhdWms.getVbillcode()); } @@ -220,26 +251,23 @@ InventoryCheckOrderDetl checkOrderDetl = null; for (NccCkPddWms nccScZkmxbWms : wmsFlag) { log.info("NccCkPddWms鏁版嵁:{}", JSONObject.toJSON(nccScZkmxbWms)); - if (nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getHdr() == 0) { - Mat mat = matService.selectByMatnr(nccScZkmxbWms.getWlbm()); - if (Cools.isEmpty(mat)) { - throw new CoolException(nccScZkmxbWms.getWlbm() + "缂栧彿鍟嗗搧妫�绱㈠け璐ワ紝璇峰厛娣诲姞鍟嗗搧"); - } - List<InventoryCheckOrderDetl> checkOrderDetls = inventoryCheckOrderDetlService.selectList(new EntityWrapper<InventoryCheckOrderDetl>().eq("order_no", nccScZkmxbWms.getVbillcode()).eq("matnr", mat.getMatnr()).eq("batch", nccScZkmxbWms.getVbatchcode())); - if (checkOrderDetls != null && !checkOrderDetls.isEmpty()) { - throw new CoolException(nccScZkmxbWms.getWlbm() + "鐩樼偣鍗曠殑鏄庣粏閲嶅浜�"); - } - checkOrderDetl = new InventoryCheckOrderDetl(); - checkOrderDetl.setMatnr(nccScZkmxbWms.getWlbm()); - checkOrderDetl.setMaktx(mat.getMaktx()); - checkOrderDetl.setOrderNo(nccScZkmxbWms.getVbillcode()); - checkOrderDetl.setAnfme(nccScZkmxbWms.getZmzsl().doubleValue()); - checkOrderDetl.setBatch(nccScZkmxbWms.getVbatchcode()); - inventoryCheckOrderDetlService.insert(checkOrderDetl); + Mat mat = matService.selectByMatnr(nccScZkmxbWms.getWlbm()); + if (Cools.isEmpty(mat)) { + throw new CoolException(nccScZkmxbWms.getWlbm() + "缂栧彿鍟嗗搧妫�绱㈠け璐ワ紝璇峰厛娣诲姞鍟嗗搧"); } + checkOrderDetl = new InventoryCheckOrderDetl(); + checkOrderDetl.setMatnr(nccScZkmxbWms.getWlbm()); + checkOrderDetl.setMaktx(mat.getMaktx()); + checkOrderDetl.setOrderNo(nccScZkmxbWms.getVbillcode()); + checkOrderDetl.setAnfme(nccScZkmxbWms.getZmzsl().doubleValue()); + checkOrderDetl.setBatch(nccScZkmxbWms.getVbatchcode()); + inventoryCheckOrderDetlService.insert(checkOrderDetl); nccScZkmxbWms.setWmsFlag(1); param.setOrderNo(nccScZkmxbWms.getVbillcode()); + param.setCreateBy(nccScZkmxbWms.getPdrmc()); + } + param.setCreateTime(new Date()); param.setStatus("1"); inventoryCheckOrderService.insert(param); nccCkPddWmsService.updateBatchById(wmsFlag); -- Gitblit v1.9.1