From fb5b2e35fd234d8f8068c690df1bcbf956e05880 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <xltys1995>
Date: 星期二, 03 十一月 2020 09:35:28 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 92 ++++++++++++++++++++++-----------------------
1 files changed, 45 insertions(+), 47 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 9ffa669..1091368 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -7,7 +7,6 @@
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
-import com.zy.common.model.Shelves;
import com.zy.common.model.StartupDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -89,19 +88,12 @@
* @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
*/
public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos) {
- if (sourceStaNo == 3) {
- whsType = 1;
- } else if (sourceStaNo == 7) {
- whsType = 2;
- } else {
- throw new CoolException("鏃犳晥鍏ュ簱绔�");
- }
StartupDto startupDto = new StartupDto();
RowLastno rowLastno = rowLastnoService.selectById(whsType);
if (Cools.isEmpty(rowLastno)) {
throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�");
}
- if (rowLastno.getWhsType() == 1){
+ if (whsType == 1 || whsType == 2){
int curRow = rowLastno.getCurrentRow();
int sRow = rowLastno.getsRow();
int eRow = rowLastno.geteRow();
@@ -113,48 +105,54 @@
LocMast locMast = null;
// 鍚屼竴澶╁悓瑙勬牸璐х墿闈犺繎鎽嗘硶瑙勫垯
- if (!Cools.isEmpty(matNos)) {
- List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0));
- for (String locNo : locNos) {
- // 鑾峰彇鎺�
- int row = Integer.parseInt(locNo.substring(0, 2));
- // 鍒ゆ柇鏄惁涓烘繁搴撲綅
- double remainder = Arith.remainder(row, rowCount / crn_qty);
- int targetRow;
- if (remainder == 1) {
- // 寰楀埌褰撳墠搴撲綅鐨勫鍥村簱浣�
- targetRow = row + 1;
- } else if (remainder == 0) {
- // 寰楀埌褰撳墠搴撲綅鐨勫唴鍥村簱浣�
- targetRow = row - 1;
- } else {
- continue;
- }
- String targetLocNo = zerofill(String.valueOf(targetRow), 2)+locNo.substring(2);
- // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
- LocMast targetLocMast = locMastService.selectById(targetLocNo);
- if (targetLocMast != null && targetLocMast.getLocSts().equals("O")) {
- locMast = targetLocMast;
- crnNo = locMast.getCrnNo();
- break;
- }
- }
- }
+// if (!Cools.isEmpty(matNos)) {
+// List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0));
+// for (String locNo : locNos) {
+// // 鑾峰彇鎺�
+// int row = Integer.parseInt(locNo.substring(0, 2));
+// // 鍒ゆ柇鏄惁涓烘繁搴撲綅
+// double remainder = Arith.remainder(row, rowCount / crn_qty);
+// int targetRow;
+// if (remainder == 1) {
+// // 寰楀埌褰撳墠搴撲綅鐨勫鍥村簱浣�
+// targetRow = row + 1;
+// } else if (remainder == 0) {
+// // 寰楀埌褰撳墠搴撲綅鐨勫唴鍥村簱浣�
+// targetRow = row - 1;
+// } else {
+// continue;
+// }
+// String targetLocNo = zerofill(String.valueOf(targetRow), 2)+locNo.substring(2);
+// // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
+// LocMast targetLocMast = locMastService.selectById(targetLocNo);
+// if (targetLocMast != null && targetLocMast.getLocSts().equals("O")) {
+// locMast = targetLocMast;
+// crnNo = locMast.getCrnNo();
+// break;
+// }
+// }
+// }
// 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
if (null == locMast) {
- // 鑾峰彇鐩爣绔欐墍鍦ㄨ揣鏋舵帓鍙�
- Shelves shelves = new Shelves(rowCount, crn_qty);
- curRow = shelves.start(curRow);
- if (curRow < 0) {
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+ // 鑾峰彇鐩爣绔欐墍鍦ㄨ揣鏋舵帓鍙� todo:luxiaotao
+ if (curRow == sRow) {
+ curRow = eRow;
+ } else {
+ curRow = sRow;
}
- for (List<Integer> node : shelves.nodes){
- if (node.contains(curRow)) {
- crnNo = shelves.nodes.indexOf(node) + 1;
- break;
- }
- }
+ crnNo = whsType;
+// Shelves shelves = new Shelves(rowCount, crn_qty);
+// curRow = shelves.start(curRow);
+// if (curRow < 0) {
+// throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+// }
+// for (List<Integer> node : shelves.nodes){
+// if (node.contains(curRow)) {
+// crnNo = shelves.nodes.indexOf(node) + 1;
+// break;
+// }
+// }
}
basCrnpService.checkSiteStatus(crnNo);
--
Gitblit v1.9.1