From 7c1af4c63e66754f0868c1a501f4895f9cbc9213 Mon Sep 17 00:00:00 2001 From: zhangchao <zc857179121@qq.com> Date: 星期五, 15 十一月 2024 09:29:12 +0800 Subject: [PATCH] 双单位 --- src/main/java/com/zy/asrs/controller/OrderController.java | 222 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 117 insertions(+), 105 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java index 06465ac..df58107 100644 --- a/src/main/java/com/zy/asrs/controller/OrderController.java +++ b/src/main/java/com/zy/asrs/controller/OrderController.java @@ -337,7 +337,7 @@ List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1)); List<Long> docIds = new ArrayList<>(); for (DocType pakin : pakins) { - if (pakin.getDocId() == 36) { + if (pakin.getDocId() == 17) { docIds.add(pakin.getDocId()); } } @@ -419,33 +419,36 @@ } DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); if (DetlDto.has(list, dto)) { - OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode(),orderDetl.getDeadTime()); + OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode().trim(),orderDetl.getDeadTime()); Double anfme = item.getAnfme(); item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); if (!orderDetlService.updateById(item)) { throw new CoolException("淇濆瓨璁㈠崟鏄庣粏妗eけ璐�"); } // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 - FlowLog flowLog = new FlowLog(); - flowLog.setFid(String.valueOf(flowId)); - flowLog.setOpType(2L); - flowLog.setOrderNo(param.getOrderNo()); - flowLog.setThreeCode(orderDetl.getThreeCode()); - flowLog.setMatnr(orderDetl.getMatnr()); - flowLog.setMaktx(orderDetl.getMaktx()); - flowLog.setOrderPrevious(anfme); - flowLog.setOrderCurrent(anfme + orderDetl.getAnfme()); - flowLog.setOrderChanged(orderDetl.getAnfme()); - flowLog.setQtyPrevious(orderDetl.getQty()); - flowLog.setQtyCurrent(orderDetl.getQty()); - flowLog.setQtyChanged(0.0D); - flowLog.setUserId(getUserId()); - flowLog.setAppeTime(now); - if (!flowLogService.insert(flowLog)) { - throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); - } +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setOpType(2L); +// flowLog.setOrderNo(param.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode().trim()); +// flowLog.setMatnr(orderDetl.getMatnr()); +// flowLog.setMaktx(orderDetl.getMaktx()); +// flowLog.setOrderPrevious(anfme); +// flowLog.setOrderCurrent(anfme + orderDetl.getAnfme()); +// flowLog.setOrderChanged(orderDetl.getAnfme()); +// flowLog.setQtyPrevious(orderDetl.getQty()); +// flowLog.setQtyCurrent(orderDetl.getQty()); +// flowLog.setQtyChanged(0.0D); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } } else { list.add(dto); + if (!Cools.isEmpty(orderDetl.getThreeCode())){ + orderDetl.setThreeCode(orderDetl.getThreeCode().trim()); + } orderDetl.setOrderId(order.getId()); orderDetl.setOrderNo(order.getOrderNo()); orderDetl.setSource(param.getDocType().intValue()); @@ -458,25 +461,25 @@ if (!orderDetlService.insert(orderDetl)) { throw new CoolException("淇濆瓨璁㈠崟鏄庣粏妗eけ璐�"); } - // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 - FlowLog flowLog = new FlowLog(); - flowLog.setFid(String.valueOf(flowId)); - flowLog.setOpType(1L); - flowLog.setOrderNo(param.getOrderNo()); - flowLog.setThreeCode(orderDetl.getThreeCode()); - flowLog.setMatnr(orderDetl.getMatnr()); - flowLog.setMaktx(orderDetl.getMaktx()); - flowLog.setOrderPrevious(0.0D); - flowLog.setOrderCurrent(orderDetl.getAnfme()); - flowLog.setOrderChanged(orderDetl.getAnfme()); - flowLog.setQtyPrevious(0.0D); - flowLog.setQtyCurrent(0.0D); - flowLog.setQtyChanged(0.0D); - flowLog.setUserId(getUserId()); - flowLog.setAppeTime(now); - if (!flowLogService.insert(flowLog)) { - throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); - } +// // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setOpType(1L); +// flowLog.setOrderNo(param.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode().trim()); +// flowLog.setMatnr(orderDetl.getMatnr()); +// flowLog.setMaktx(orderDetl.getMaktx()); +// flowLog.setOrderPrevious(0.0D); +// flowLog.setOrderCurrent(orderDetl.getAnfme()); +// flowLog.setOrderChanged(orderDetl.getAnfme()); +// flowLog.setQtyPrevious(0.0D); +// flowLog.setQtyCurrent(0.0D); +// flowLog.setQtyChanged(0.0D); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } } } if (param.getDocType().intValue() == 32) { @@ -523,13 +526,16 @@ for (OrderDetl orderDetl : param.getOrderDetlList()) { DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); if (DetlDto.has(dbList, dto)) { - OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode(),orderDetl.getDeadTime()); + OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode().trim(),orderDetl.getDeadTime()); item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); if (!orderDetlService.updateById(item)) { throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟鏄庣粏妗eけ璐�"); } } else { dbList.add(dto); + if (!Cools.isEmpty(orderDetl.getThreeCode())){ + orderDetl.setThreeCode(orderDetl.getThreeCode().trim()); + } orderDetl.setOrderId(order.getId()); orderDetl.setOrderNo(order.getOrderNo()); orderDetl.setSource(33); @@ -593,13 +599,16 @@ if (orderDetl.getProcessSts() != 1) continue; DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getBatch()); if (DetlDto.has(dbList, dto)) { - OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode(),orderDetl.getDeadTime()); + OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode().trim(),orderDetl.getDeadTime()); item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); if (!orderDetlService.updateById(item)) { throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟鏄庣粏妗eけ璐�"); } } else { dbList.add(dto); + if (!Cools.isEmpty(orderDetl.getThreeCode())){ + orderDetl.setThreeCode(orderDetl.getThreeCode().trim()); + } orderDetl.setOrderId(order.getId()); orderDetl.setOrderNo(order.getOrderNo()); orderDetl.setSource(35); @@ -612,25 +621,25 @@ if (!orderDetlService.insert(orderDetl)) { throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟鏄庣粏妗eけ璐�"); } - // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 - FlowLog flowLog = new FlowLog(); - flowLog.setFid(String.valueOf(flowId)); - flowLog.setOpType(1L); - flowLog.setOrderNo(param.getOrderNo()); - flowLog.setThreeCode(orderDetl.getThreeCode()); - flowLog.setMatnr(orderDetl.getMatnr()); - flowLog.setMaktx(orderDetl.getMaktx()); - flowLog.setOrderPrevious(0.0D); - flowLog.setOrderCurrent(orderDetl.getAnfme()); - flowLog.setOrderChanged(orderDetl.getAnfme()); - flowLog.setQtyPrevious(0.0D); - flowLog.setQtyCurrent(0.0D); - flowLog.setQtyChanged(0.0D); - flowLog.setUserId(getUserId()); - flowLog.setAppeTime(now); - if (!flowLogService.insert(flowLog)) { - throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); - } +// // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setOpType(1L); +// flowLog.setOrderNo(param.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode().trim()); +// flowLog.setMatnr(orderDetl.getMatnr()); +// flowLog.setMaktx(orderDetl.getMaktx()); +// flowLog.setOrderPrevious(0.0D); +// flowLog.setOrderCurrent(orderDetl.getAnfme()); +// flowLog.setOrderChanged(orderDetl.getAnfme()); +// flowLog.setQtyPrevious(0.0D); +// flowLog.setQtyCurrent(0.0D); +// flowLog.setQtyChanged(0.0D); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } } @@ -674,31 +683,31 @@ for (OrderDetl orderDetl : param.getOrderDetlList()) { DetlDto dto = new DetlDto(orderDetl.getMatnr(), orderDetl.getAnfme(), orderDetl.getProcessSts()); if (DetlDto.has(list, dto)) { - OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode(),orderDetl.getDeadTime()); + OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(),orderDetl.getThreeCode().trim(),orderDetl.getDeadTime()); Double anfme = item.getAnfme(); item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); if (!orderDetlService.updateById(item)) { throw new CoolException("淇濆瓨璁㈠崟鏄庣粏妗eけ璐�"); } - // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 - FlowLog flowLog = new FlowLog(); - flowLog.setFid(String.valueOf(flowId)); - flowLog.setOpType(2L); - flowLog.setOrderNo(param.getOrderNo()); - flowLog.setThreeCode(orderDetl.getThreeCode()); - flowLog.setMatnr(orderDetl.getMatnr()); - flowLog.setMaktx(orderDetl.getMaktx()); - flowLog.setOrderPrevious(anfme); - flowLog.setOrderCurrent(anfme + orderDetl.getAnfme()); - flowLog.setOrderChanged(orderDetl.getAnfme()); - flowLog.setQtyPrevious(orderDetl.getQty()); - flowLog.setQtyCurrent(orderDetl.getQty()); - flowLog.setQtyChanged(0.0D); - flowLog.setUserId(getUserId()); - flowLog.setAppeTime(now); - if (!flowLogService.insert(flowLog)) { - throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); - } +// // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setOpType(2L); +// flowLog.setOrderNo(param.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode().trim()); +// flowLog.setMatnr(orderDetl.getMatnr()); +// flowLog.setMaktx(orderDetl.getMaktx()); +// flowLog.setOrderPrevious(anfme); +// flowLog.setOrderCurrent(anfme + orderDetl.getAnfme()); +// flowLog.setOrderChanged(orderDetl.getAnfme()); +// flowLog.setQtyPrevious(orderDetl.getQty()); +// flowLog.setQtyCurrent(orderDetl.getQty()); +// flowLog.setQtyChanged(0.0D); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } } else { if (docType == 35 && orderDetl.getProcessSts() == 1) { List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>() @@ -711,6 +720,9 @@ } } list.add(dto); + if (!Cools.isEmpty(orderDetl.getThreeCode())){ + orderDetl.setThreeCode(orderDetl.getThreeCode().trim()); + } orderDetl.setOrderId(order.getId()); orderDetl.setOrderNo(order.getOrderNo()); orderDetl.setSource(docType); @@ -724,24 +736,24 @@ throw new CoolException("淇濆瓨璁㈠崟鏄庣粏妗eけ璐�"); } // 娴佹按 -- 鏂板璁㈠崟鏄庣粏 - FlowLog flowLog = new FlowLog(); - flowLog.setFid(String.valueOf(flowId)); - flowLog.setOpType(2L); - flowLog.setOrderNo(param.getOrderNo()); - flowLog.setThreeCode(orderDetl.getThreeCode()); - flowLog.setMatnr(orderDetl.getMatnr()); - flowLog.setMaktx(orderDetl.getMaktx()); - flowLog.setOrderPrevious(0.0D); - flowLog.setOrderCurrent(orderDetl.getAnfme()); - flowLog.setOrderChanged(orderDetl.getAnfme()); - flowLog.setQtyPrevious(orderDetl.getQty()); - flowLog.setQtyCurrent(orderDetl.getQty()); - flowLog.setQtyChanged(0.0D); - flowLog.setUserId(getUserId()); - flowLog.setAppeTime(now); - if (!flowLogService.insert(flowLog)) { - throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); - } +// FlowLog flowLog = new FlowLog(); +// flowLog.setFid(String.valueOf(flowId)); +// flowLog.setOpType(2L); +// flowLog.setOrderNo(param.getOrderNo()); +// flowLog.setThreeCode(orderDetl.getThreeCode().trim()); +// flowLog.setMatnr(orderDetl.getMatnr()); +// flowLog.setMaktx(orderDetl.getMaktx()); +// flowLog.setOrderPrevious(0.0D); +// flowLog.setOrderCurrent(orderDetl.getAnfme()); +// flowLog.setOrderChanged(orderDetl.getAnfme()); +// flowLog.setQtyPrevious(orderDetl.getQty()); +// flowLog.setQtyCurrent(orderDetl.getQty()); +// flowLog.setQtyChanged(0.0D); +// flowLog.setUserId(getUserId()); +// flowLog.setAppeTime(now); +// if (!flowLogService.insert(flowLog)) { +// throw new CoolException("鍚屾鍗婃垚鍝佽皟鎷ㄥ崟娴佹按璁板綍澶辫触"); +// } } } return R.ok("璁㈠崟淇敼鎴愬姛"); @@ -956,15 +968,15 @@ Integer proSts = 0; Row row = sheet.getRow(i); //鍗曟嵁绫诲瀷 - String docName = dataFormatter.formatCellValue(row.getCell(0)); + String docName = dataFormatter.formatCellValue(row.getCell(0)).trim(); //鍗曟嵁缂栧彿 - String uuid = dataFormatter.formatCellValue(row.getCell(1)); + String uuid = dataFormatter.formatCellValue(row.getCell(1)).trim(); //鐗╂枡鍙� - String matnr = dataFormatter.formatCellValue(row.getCell(2)); + String matnr = dataFormatter.formatCellValue(row.getCell(2)).trim(); //閿�鍞崟鍙� - String csocode = dataFormatter.formatCellValue(row.getCell(3)); + String csocode = dataFormatter.formatCellValue(row.getCell(3)).trim(); //鑷敱椤� - String isocode = dataFormatter.formatCellValue(row.getCell(4)); + String isocode = dataFormatter.formatCellValue(row.getCell(4)).trim(); // 鏁伴噺 if(Cools.isEmpty(dataFormatter.formatCellValue(row.getCell(5)))){ continue; @@ -1133,7 +1145,7 @@ throw new CoolException("鐢熸垚鍗曟嵁涓绘。澶辫触锛岃閲嶆柊瀵煎叆锛�"); } }else { - order2.setSettle(order.getSettle() == 1L ? 1L : 2L ); + order2.setSettle(order2.getSettle() == 1L ? 1L : 2L ); orderService.updateById(order2); } @@ -1211,7 +1223,7 @@ throw new CoolException("鐢熸垚鍗曟嵁涓绘。澶辫触锛岃閲嶆柊瀵煎叆锛�"); } }else { - order3.setSettle(order.getSettle() == 1L ? 1L : 2L ); + order3.setSettle(order3.getSettle() == 1L ? 1L : 2L ); orderService.updateById(order3); } -- Gitblit v1.9.1