From 9220d57a83cc527cac2a33625fe518b5a03f0def Mon Sep 17 00:00:00 2001 From: zhang <zc857179121@qq.com> Date: 星期五, 23 五月 2025 10:40:48 +0800 Subject: [PATCH] 接口编写 --- src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java | 65 +++++++++++++++++++++++++------- 1 files changed, 50 insertions(+), 15 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 7160b6a..1e4cd13 100644 --- a/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java +++ b/src/main/java/com/zy/nc/task/handler/PlanOrderHandler.java @@ -99,16 +99,16 @@ * * @return */ - public ReturnT<String> start2(List<NccScZkmxbWms> wmsFlag) { + public ReturnT<String> start2In(List<NccScZkmxbWms> wmsFlag) { try { OpenOrderPakinParam param = new OpenOrderPakinParam(); - param.setOrderType("杞簱"); + param.setOrderType("杞簱-鍏ュ簱"); DetlDto detlDto; List<DetlDto> orderDetails = new ArrayList<>(); long i = 1; for (NccScZkmxbWms nccScZkmxbWms : wmsFlag) { log.info("NccScZkmxbWms鏁版嵁:{}", JSONObject.toJSON(nccScZkmxbWms)); - if ( nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getDr() == 0) { + if (nccScZkmxbWms.getBdr() == 0 && nccScZkmxbWms.getDr() == 0) { detlDto = new DetlDto(); detlDto.setMatnr(nccScZkmxbWms.getWlbm()); detlDto.setAnfme(nccScZkmxbWms.getYingzzsl().doubleValue()); @@ -132,6 +132,43 @@ return SUCCESS; } + /** + * 杞簱锛屽寘鍚嚭搴� + * + * @return + */ + public ReturnT<String> start2Out(List<NccScZkmxbWms> wmsFlag) { + try { + OpenOrderPakoutParam param = new OpenOrderPakoutParam(); + param.setOrderType("杞簱-鍑哄簱"); + DetlDto detlDto; + List<DetlDto> orderDetails = new ArrayList<>(); + 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++; + } + nccScZkmxbWms.setWmsFlag(1); + param.setOrderNo(nccScZkmxbWms.getVbillcode()); + } + param.setOrderDetails(orderDetails); + openService.pakoutOrderCreate(param); + nccScZkmxbWmsService.updateBatchById(wmsFlag); + } catch (Exception e) { + e.printStackTrace(); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return FAIL.setMsg(e.getMessage()); + } + return SUCCESS; + } /** * 閲囪喘鍒拌揣 @@ -151,6 +188,7 @@ 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); @@ -189,7 +227,7 @@ } 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() + "鐩樼偣鍗曠殑鏄庣粏閲嶅浜�"); + //throw new CoolException(nccScZkmxbWms.getWlbm() + "鐩樼偣鍗曠殑鏄庣粏閲嶅浜�"); } checkOrderDetl = new InventoryCheckOrderDetl(); checkOrderDetl.setMatnr(nccScZkmxbWms.getWlbm()); @@ -214,7 +252,6 @@ } - /** * 璋冩嫧鍗� * @@ -229,16 +266,14 @@ long i = 1; for (NccSaleDbddWms nccCgCgdhdWms : wmsFlag) { log.info("nccCgCgdhdWms鏁版嵁:{}", JSONObject.toJSON(nccCgCgdhdWms)); - if (nccCgCgdhdWms.getDr() == 0 ) { - detlDto = new DetlDto(); - detlDto.setMatnr(nccCgCgdhdWms.getWlbm()); - detlDto.setAnfme(nccCgCgdhdWms.getZsl().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.getZsl().doubleValue()); + detlDto.setBatch(nccCgCgdhdWms.getVbatchcode()); + detlDto.setLineNumber(i); + detlDto.setRemark(JSONObject.toJSONString(nccCgCgdhdWms)); + orderDetails.add(detlDto); + i++; nccCgCgdhdWms.setWmsFlag(1); param.setOrderNo(nccCgCgdhdWms.getVbillcode()); } -- Gitblit v1.9.1