From e6d092d364c5f11f864b34a7dfe81977e65fb232 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 13 六月 2024 09:02:07 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/OrderController.java | 79 +++++++++++++++++++++++++++++++++++++++
src/main/java/com/zy/asrs/service/AgvLocDetlService.java | 2 +
src/main/java/com/zy/asrs/mapper/AgvLocDetlMapper.java | 3 +
src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java | 5 ++
src/main/java/com/zy/asrs/controller/OrderDetlController.java | 4 +-
5 files changed, 90 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index fefdf51..438228d 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -271,7 +271,14 @@
throw new CoolException("淇濆瓨璁㈠崟涓绘。澶辫触");
}
List<DetlDto> list = new ArrayList<>();
+ Boolean flag = false;
for (OrderDetl orderDetl : param.getOrderDetlList()) {
+ if (Cools.isEmpty(orderDetl.getProcessSts())) {
+ orderDetl.setProcessSts(3);
+ }
+ if (orderDetl.getProcessSts() == 1) {
+ flag = true;
+ }
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());
@@ -360,9 +367,79 @@
}
}
}
+
}
+ // 宸ュ簭涓�1锛氬緟鍔犲伐 鐢熸垚鍔犲伐鍗�
+ if (flag) {
+ if (param.getDocType().intValue() == 32) {
+ order = new Order(
+ String.valueOf(snowflakeIdWorker.nextId()), // 缂栧彿[闈炵┖]
+ "JG" + param.getOrderNo(), // 璁㈠崟缂栧彿
+ DateUtils.convert(now), // 鍗曟嵁鏃ユ湡
+ 35L, // 鍗曟嵁绫诲瀷
+ null, // 椤圭洰缂栧彿
+ null, //
+ null, // 璋冩嫧椤圭洰缂栧彿
+ null, // 鍒濆绁ㄦ嵁鍙�
+ null, // 绁ㄦ嵁鍙�
+ null, // 瀹㈡埛缂栧彿
+ null, // 瀹㈡埛
+ null, // 鑱旂郴鏂瑰紡
+ null, // 鎿嶄綔浜哄憳
+ null, // 鍚堣閲戦
+ null, // 浼樻儬鐜�
+ null, // 浼樻儬閲戦
+ null, // 閿�鍞垨閲囪喘璐圭敤鍚堣
+ null, // 瀹炰粯閲戦
+ null, // 浠樻绫诲瀷
+ null, // 涓氬姟鍛�
+ null, // 缁撶畻澶╂暟
+ null, // 閭垂鏀粯绫诲瀷
+ null, // 閭垂
+ null, // 浠樻鏃堕棿
+ null, // 鍙戣揣鏃堕棿
+ null, // 鐗╂祦鍚嶇О
+ null, // 鐗╂祦鍗曞彿
+ 1L, // 璁㈠崟鐘舵��
+ 1, // 鐘舵��
+ getUserId(), // 娣诲姞浜哄憳
+ now, // 娣诲姞鏃堕棿
+ getUserId(), // 淇敼浜哄憳
+ now, // 淇敼鏃堕棿
+ null // 澶囨敞
+ );
+ if (!orderService.insert(order)) {
+ throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟澶辫触");
+ }
+ List<DetlDto> dbList = new ArrayList<>();
+ for (OrderDetl orderDetl : param.getOrderDetlList()) {
+ 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());
+ item.setAnfme(item.getAnfme() + orderDetl.getAnfme());
+ if (!orderDetlService.updateById(item)) {
+ throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟鏄庣粏妗eけ璐�");
+ }
+ } else {
+ dbList.add(dto);
+ orderDetl.setOrderId(order.getId());
+ orderDetl.setOrderNo(order.getOrderNo());
+ orderDetl.setSource(35);
+ orderDetl.setCreateBy(getUserId());
+ orderDetl.setCreateTime(now);
+ orderDetl.setUpdateBy(getUserId());
+ orderDetl.setUpdateTime(now);
+ orderDetl.setStatus(1);
+ orderDetl.setQty(0.0D);
+ if (!orderDetlService.insert(orderDetl)) {
+ throw new CoolException("鐢熸垚鍗婃垚鍝佽皟鎷ㄥ崟鏄庣粏妗eけ璐�");
+ }
+ }
+ }
-
+ }
+ }
return R.ok("璁㈠崟娣诲姞鎴愬姛");
}
diff --git a/src/main/java/com/zy/asrs/controller/OrderDetlController.java b/src/main/java/com/zy/asrs/controller/OrderDetlController.java
index 2a3f91e..805f902 100644
--- a/src/main/java/com/zy/asrs/controller/OrderDetlController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderDetlController.java
@@ -152,11 +152,11 @@
docIds.add(pakin.getDocId());
}
}
-
+ wrapper.eq("process_sts",1);
wrapper.in("source",docIds);
Page<OrderDetl> page = orderDetlService.selectPage(new Page<>(curr, limit), wrapper);
for (OrderDetl record : page.getRecords()) {
- Double sumAnfme = agvLocDetlService.getSumAnfme(record.getMatnr(), record.getThreeCode());
+ Double sumAnfme = agvLocDetlService.getSumAnfmeProcess(record.getMatnr(), record.getThreeCode());
record.setStock(sumAnfme == null ? 0 : sumAnfme);
}
diff --git a/src/main/java/com/zy/asrs/mapper/AgvLocDetlMapper.java b/src/main/java/com/zy/asrs/mapper/AgvLocDetlMapper.java
index ec0e68b..cd14b80 100644
--- a/src/main/java/com/zy/asrs/mapper/AgvLocDetlMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/AgvLocDetlMapper.java
@@ -25,6 +25,9 @@
@Select("select sum(a.anfme) as sum from agv_loc_detl a left join agv_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr} AND a.three_code = #{threeCode}")
Double selectSumAnfmeByMatnr(@Param("matnr") String matnr,@Param("threeCode") String threeCode);
+ @Select("select sum(a.anfme) as sum from agv_loc_detl a left join agv_loc_mast b on a.loc_no = b.loc_no where b.loc_sts = 'F' and a.matnr = #{matnr} AND a.three_code = #{threeCode} AND a.process_sts = 1")
+ Double selectSumAnfmeByMatnrProcess(@Param("matnr") String matnr,@Param("threeCode") String threeCode);
+
@Select("select sum(a.anfme) as sum from agv_loc_detl a left join agv_loc_mast b on a.loc_no = b.loc_no where (b.loc_sts = 'F' or b.loc_sts = 'R') and b.floor = #{floor} and a.matnr = #{matnr} AND a.three_code = #{threeCode}")
Double selectSumAnfmeByMatnr2(@Param("matnr") String matnr,@Param("threeCode") String threeCode,@Param("floor") Integer floor);
diff --git a/src/main/java/com/zy/asrs/service/AgvLocDetlService.java b/src/main/java/com/zy/asrs/service/AgvLocDetlService.java
index c6b771d..ad725e0 100644
--- a/src/main/java/com/zy/asrs/service/AgvLocDetlService.java
+++ b/src/main/java/com/zy/asrs/service/AgvLocDetlService.java
@@ -22,6 +22,8 @@
Double getSumAnfme(String matnr, String threeCode);
+ Double getSumAnfmeProcess(String matnr, String threeCode);
+
Double getSumAnfmeDb(String matnr, String threeCode, Integer floor);
Integer sum();
diff --git a/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
index f835a93..9453e7a 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvLocDetlServiceImpl.java
@@ -124,6 +124,11 @@
}
@Override
+ public Double getSumAnfmeProcess(String matnr, String threeCode) {
+ return this.baseMapper.selectSumAnfmeByMatnrProcess(matnr, threeCode);
+ }
+
+ @Override
public Double getSumAnfmeDb(String matnr, String threeCode,Integer floor) {
return this.baseMapper.selectSumAnfmeByMatnr2(matnr, threeCode, floor);
}
--
Gitblit v1.9.1