From 8cac5d40279933c61ce2ab120aef9d6302ae08e2 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期三, 19 十月 2022 16:22:43 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/LocDetlMapper.xml | 21 ++++++++++
src/main/java/com/zy/common/service/CommonService.java | 68 +++++++---------------------------
2 files changed, 35 insertions(+), 54 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 40639a2..db1539e 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -111,21 +111,20 @@
*/
public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) {
StartupDto startupDto = new StartupDto();
- int start;
- int end;
+ int start = 2;
+ int end = 30;
switch (sourceStaNo) {
- case 103:
- whsType = 1;
- start = 1;
- end = 14;
- break;
- case 203:
+ case 107:
whsType = 2;
- start = 8;
- end = 21;
+ end = 17;
+ break;
+ case 118:
+ whsType = 3;
+ start = 18;
break;
default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+ whsType = 1;
+ break;
}
// 鐢熸垚宸ヤ綔鍙�
int workNo = getWorkNo(0);
@@ -187,55 +186,16 @@
}
// 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
-
- int currentRow = 1;
if (null == locMast) {
Shelves shelves = new Shelves(rowCount, crn_qty);
for (int i = 0; i < shelves.group; i ++) {
- if (i > 0) {
- curRow = currentRow;
- }
curRow = shelves.start(curRow);
if (curRow < 0) {
throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
}
- currentRow = curRow;
- int crnNo1 = shelves.get(curRow);
- if (whsType == 1) {
- switch (curRow) {
- case 1:
- curRow = 1;
- break;
- case 2:
- curRow = 7;
- break;
- case 3:
- curRow = 8;
- break;
- case 4:
- curRow = 14;
- break;
- default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
- }
- } else {
- switch (curRow) {
- case 1:
- curRow = 8;
- break;
- case 2:
- curRow = 14;
- break;
- case 3:
- curRow = 15;
- break;
- case 4:
- curRow = 21;
- break;
- default:
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
- }
- crnNo1 = crnNo1 + 1;
+ Integer crnNo1 = shelves.get(curRow) + 1;
+ if (whsType != 1) {
+ crnNo1 = whsType;
}
if (basCrnpService.checkSiteError(crnNo1, true)) {
crnNo = crnNo1;
@@ -265,7 +225,7 @@
}
// 鏇存柊搴撲綅鎺掑彿
- rowLastno.setCurrentRow(currentRow);
+ rowLastno.setCurrentRow(curRow);
rowLastnoService.updateById(rowLastno);
// 寮�濮嬫煡鎵惧簱浣� ==============================>>
diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 60a5ffa..7571504 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -277,5 +277,26 @@
batch LIKE '%[a-z]%'
</select>
+ <select id="selectSameDetl" resultType="java.lang.String">
+ SELECT
+ ld.loc_no
+ FROM asr_loc_detl ld
+ LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no
+ LEFT JOIN (
+ select
+ loc_no,
+ count(1) as count
+ from asr_loc_detl
+ where 1=1
+ group by loc_no
+ ) dual on dual.loc_no = lm.loc_no
+ WHERE 1 = 1
+ AND ld.matnr = #{matnr}
+ AND (lm.row1 >= #{start} AND lm.row1 <= #{end})
+ AND (lm.loc_sts = 'F')
+ AND dual.count = 1
+ ORDER BY lm.modi_time ASC
+ </select>
+
</mapper>
--
Gitblit v1.9.1