From ef10b5d3f2c4367e44de6245c5f4cf11228bc295 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 26 五月 2023 16:32:08 +0800
Subject: [PATCH] 解决拉取地图缓慢问题
---
src/main/java/com/zy/common/service/CommonService.java | 444 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 302 insertions(+), 142 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index f2100fc..1ac22c2 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -9,14 +9,13 @@
import com.zy.asrs.utils.Utils;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.model.LocTypeDto;
-import com.zy.common.model.Shelves;
import com.zy.common.model.StartupDto;
import com.zy.common.properties.SlaveProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -26,6 +25,15 @@
@Slf4j
@Service
public class CommonService {
+
+ public static final List<Integer> FIRST_GROUP_ROW_LIST = new ArrayList<Integer>() {{
+ add(2);add(3);add(4);add(5);add(6);add(7);add(8);add(9);add(10);
+ add(11);add(12);add(13);add(14);add(15);add(16);add(17);
+ }};
+ public static final List<Integer> SECOND_GROUP_ROW_LIST = new ArrayList<Integer>() {{
+ add(18);add(19);add(20);
+ add(21);add(22);add(23);add(24);add(25);add(26);add(27);add(28);add(29);add(30);
+ }};
@Autowired
private WrkMastService wrkMastService;
@@ -45,10 +53,14 @@
private LocDetlService locDetlService;
@Autowired
private SlaveProperties slaveProperties;
+ @Autowired
+ private MatService matService;
+ @Autowired
+ private LocRuleService locRuleService;
/**
* 鐢熸垚宸ヤ綔鍙�
- * @param wrkMk 0:鍏ュ簱 1 - 3000 ; 1:鎷f枡/骞舵澘/鐩樼偣 3001 - 6000 ; 2: 鍑哄簱 6001 -9000 ; 3:鍏朵粬 9001 -9999
+ * @param wrkMk 0:鍏ュ嚭搴� ; 1:鍏朵粬
* @return workNo(宸ヤ綔鍙�)
*/
public int getWorkNo(Integer wrkMk) {
@@ -56,11 +68,14 @@
if (Cools.isEmpty(wrkLastno)) {
throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�");
}
-
- int workNo = wrkLastno.getWrkNo();
+ int workNo = 0;
+ // 鍏ュ嚭搴撶被鍨�
+ workNo = wrkLastno.getWrkNo();
int sNo = wrkLastno.getSNo();
int eNo = wrkLastno.getENo();
+
workNo = workNo>=eNo ? sNo : workNo+1;
+
while (true) {
WrkMast wrkMast = wrkMastService.selectById(workNo);
if (null != wrkMast) {
@@ -69,12 +84,10 @@
break;
}
}
- // 淇敼搴忓彿璁板綍
if (workNo > 0){
wrkLastno.setWrkNo(workNo);
wrkLastnoService.updateById(wrkLastno);
}
- // 妫�楠�
if (workNo == 0) {
throw new CoolException("鐢熸垚宸ヤ綔鍙峰け璐ワ紝璇疯仈绯荤鐞嗗憳");
} else {
@@ -87,190 +100,313 @@
/**
* 妫�绱㈠簱浣嶅彿
- * @param whsType 绫诲瀷 1:鍙屾繁寮忚揣鏋�
- * @param staDescId 璺緞宸ヤ綔绫诲瀷
+ * @param whsType 绫诲瀷 1:鍙屾繁寮忚揣鏋�
+ * @param staDescId 璺緞ID
* @param sourceStaNo 婧愮珯
- * @param matNos 鍟嗗搧缂栧彿闆嗗悎
+ * @param matNos 鐗╂枡鍙烽泦鍚�
* @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
*/
- @Transactional
- public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, int times) {
- StartupDto startupDto = new StartupDto();
- // 鐢熸垚宸ヤ綔鍙�
- int workNo = getWorkNo(0);
-
+ public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto) {
+ int start;
+ int end;
+ Integer matType = null;//鐗╂枡绫诲瀷
+ //鏍规嵁鍏ュ簱绔欙紝鍐冲畾鎼滅储鎸囧畾鍫嗗灈鏈�
+ ArrayList<Integer> crnNos = new ArrayList<>();
+ //鏍规嵁鍏ュ簱绔欙紝鎵惧埌搴撲綅缁勬渶鍐呬晶鎺�
+ ArrayList<Integer> rows = new ArrayList<>();
switch (sourceStaNo) {
- case 202:
- whsType = 2;
- break;
- case 205:
+ case 103://103鍏ュ簱绔�
whsType = 1;
+ start = 1;
+ end = 14;
+
+ //103绔欏垎閰�1锛�2鍫嗗灈鏈�
+ crnNos.add(1);
+ crnNos.add(2);
+
+ //鍒嗛厤1锛�7锛�8锛�14鎺�
+ rows.add(1);
+ rows.add(7);
+ rows.add(8);
+ rows.add(14);
break;
- case 126:
- whsType = 3;
+ case 203://203鍏ュ簱绔�
+ whsType = 2;
+ start = 8;
+ end = 21;
+
+ //203绔欏垎閰�2锛�3鍫嗗灈鏈�
+ crnNos.add(2);
+ crnNos.add(3);
+
+ //鍒嗛厤8锛�14锛�15锛�21鎺�
+ rows.add(8);
+ rows.add(14);
+ rows.add(15);
+ rows.add(21);
break;
default:
- throw new CoolException("搴撲綅鎺掑彿鍒嗛厤閿欒, 婧愮珯鍙凤細" + sourceStaNo);
+ throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
}
- startupDto.setWorkNo(workNo);
RowLastno rowLastno = rowLastnoService.selectById(whsType);
if (Cools.isEmpty(rowLastno)) {
throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�");
}
-
- // ===============>>>> 寮�濮嬫墽琛�
- int curRow = rowLastno.getCurrentRow();
- int sRow = rowLastno.getsRow();
- int eRow = rowLastno.geteRow();
- int crn_qty = rowLastno.getCrnQty();
- int rowCount = eRow - sRow + 1;
- // 鐩爣鍫嗗灈鏈哄彿
- int crnNo = 0;
// 鐩爣搴撲綅
LocMast locMast = null;
- // 闈犺繎鎽嗘斁瑙勫垯 --- 鍚屽ぉ鍚岃鏍肩墿鏂�
if (!Cools.isEmpty(matNos)) {
- List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0), sRow, eRow);
- for (String locNo : locNos) {
- if (Utils.isShallowLoc(slaveProperties, locNo)) {
- continue;
+ for (String matNo : matNos) {
+ Mat mat = matService.selectByMatnr(matNo);
+ if (matType == null) {
+ matType = mat.getMatType();
}
- String shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo);
- // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
- LocMast shallowLoc = locMastService.selectById(shallowLocNo);
- if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
- if (VersionUtils.locMoveCheckLocType(shallowLoc, locTypeDto)) {
- locMast = shallowLoc;
- crnNo = locMast.getCrnNo();
- break;
- }
+ if (matType != mat.getMatType()) {
+ throw new CoolException("娣锋斁鐗╂枡绫诲瀷涓嶄竴鑷�");
}
+ }
+
+ if (matNos.size() > 1 && matType == 1) {
+ //鐗╂枡涓哄崟鍝佺被鍨嬶紝涓旂墿鏂欑绫昏秴杩�1(瀹為檯涓洪珮棰戞贩鏀�)锛屽垯绂佹鍏ュ簱
+ throw new CoolException("鐗╂枡绫诲瀷鍜屽疄闄呯绫讳笉涓�鑷�");
}
}
// 闈犺繎鎽嗘斁瑙勫垯 --- 绌烘墭
+ locMast = getLocNoStep1(staDescId, locTypeDto, start, end);
+ if (locMast != null) {
+ //鎵惧埌搴撲綅锛岃繑鍥瀌to
+ return getLocNoFinalStep(staDescId, sourceStaNo, locMast);//杩斿洖dto
+ }
+
+ if (matType != null) {
+ if (matType == 1) {//鍗曞搧绫诲瀷鍏ュ簱
+ locMast = getLocNoStep2(locTypeDto, matNos, rows);
+ if (locMast != null) {
+ //鎵惧埌搴撲綅锛岃繑鍥瀌to
+ return getLocNoFinalStep(staDescId, sourceStaNo, locMast);//杩斿洖dto
+ }
+ } else if (matType == 2) {//楂橀绫诲瀷鍏ユ渶澶栦晶搴撲綅
+ locMast = getLocNoStep3(locTypeDto, crnNos);
+ if (locMast == null) {
+ //楂橀娌℃湁鎵惧埌搴撲綅锛屾壘浣庨娣锋斁鍖哄煙搴撲綅
+ locMast = getLocNoStep4(locTypeDto);
+ }
+ if (locMast != null) {
+ //鎵惧埌搴撲綅锛岃繑鍥瀌to
+ return getLocNoFinalStep(staDescId, sourceStaNo, locMast);//杩斿洖dto
+ }
+ } else if (matType == 3) {//浣庨娣锋斁绫诲瀷
+ locMast = getLocNoStep4(locTypeDto);
+ if (locMast != null) {
+ //鎵惧埌搴撲綅锛岃繑鍥瀌to
+ return getLocNoFinalStep(staDescId, sourceStaNo, locMast);//杩斿洖dto
+ }
+ }
+ }
+
+ throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+ }
+
+ // 闈犺繎鎽嗘斁瑙勫垯 --- 绌烘墭
+ private LocMast getLocNoStep1(Integer staDescId, LocTypeDto locTypeDto,int start,int end) {
+ LocMast locMast = null;
if (staDescId == 10) {
- List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").gt("row1", sRow).lt("row1", eRow));
+ List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+ .eq("loc_sts", "D").ge("row1", start).le("row1", end));
if (locMasts.size() > 0) {
for (LocMast loc : locMasts) {
- if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
+ List<String> groupLoc = Utils.getGroupLoc(loc.getLocNo());
+ LocMast locMast0 = locMastService.findOutMost(groupLoc);
+ if (null != locMast0) {
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (locMastService.checkEmptyCount(locMast0, 10)) {
+ locMast = locMast0;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return locMast;
+ }
+
+ //鍗曞搧绫诲瀷鍏ュ簱
+ private LocMast getLocNoStep2(LocTypeDto locTypeDto, List<String> matNos, List<Integer> rows) {
+ LocMast locMast = null;
+
+ //鍏堟壘宸ヤ綔妗�
+ List<WrkMast> wrkMasts = wrkMastService.selectSameWrkMast(matNos.get(0));
+ for (WrkMast wrkMast : wrkMasts) {
+ List<String> groupLoc = Utils.getGroupLoc(wrkMast.getLocNo());
+ List<LocMast> locMasts = locMastService.findEmptyLocMastByLocNos(locTypeDto.getLocType1(), groupLoc);
+ for (LocMast locMast0 : locMasts) {
+ //妫�娴嬪綋鍓嶅簱浣嶅唴渚у叾浠栧簱浣嶆槸鍚︿负D銆丗銆乆銆丼
+ if (Utils.checkInsideLocIsDFXS(locMast0.getLocNo())) {
+ //鍐呬晶鍏朵粬搴撲綅涓嶆槸D銆丗銆乆銆丼銆備笉鑳介�夊彇璇ュ簱浣�
+ continue;
+ }
+
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (true || basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (locMastService.checkEmptyCount(locMast0, 10)) {
+ locMast = locMast0;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ //鎵惧唴渚х┖搴撲綅(闈炴渶澶栦晶搴撲綅)
+ if (locMast == null) {
+ List<String> locNos = locDetlService.getSameDetl(matNos.get(0));
+ for (String locNo : locNos) {
+ List<String> groupLoc = Utils.getGroupLoc(locNo);
+ List<LocMast> locMasts = locMastService.findEmptyLocMastByLocNos(locTypeDto.getLocType1(), groupLoc);
+ for (LocMast locMast0 : locMasts) {
+ //妫�娴嬪綋鍓嶅簱浣嶅唴渚у叾浠栧簱浣嶆槸鍚︿负D銆丗銆乆
+ if (Utils.checkInsideLocIsDFX(locMast0.getLocNo())) {
+ //鍐呬晶鍏朵粬搴撲綅涓嶆槸D銆丗銆乆銆備笉鑳介�夊彇璇ュ簱浣�
continue;
}
- String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo());
- // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
- LocMast shallowLoc = locMastService.selectById(shallowLocNo);
- if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
- locMast = shallowLoc;
- crnNo = locMast.getCrnNo();
- break;
+
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (true || basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (locMastService.checkEmptyCount(locMast0, 10)) {
+ locMast = locMast0;
+ break;
+ }
+ }
}
}
}
}
- // 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
- if (null == locMast) {
- // 1-4鎺�
- if (whsType == 1) {
- // 鑾峰彇鐩爣绔欐墍鍦ㄨ揣鏋舵帓鍙�
- 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;
- }
- }
- // 5-8鎺�
- } else if (whsType == 2) {
- // 鑾峰彇鐩爣绔欐墍鍦ㄨ揣鏋舵帓鍙�
- Shelves shelves = new Shelves(rowCount, crn_qty);
- curRow = shelves.start(curRow - 4);
- if (curRow < 0) {
- throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
- }
- for (List<Integer> node : shelves.nodes){
- if (node.contains(curRow)) {
- crnNo = shelves.nodes.indexOf(node) + 1;
- break;
- }
- }
- // 鍋忕Щ閲忚ˉ鍋�
- curRow = curRow + 4;
- crnNo = crnNo + 1;
- // 126绌烘澘鍏� 1-8鎺�
- } else {
- // 鑾峰彇鐩爣绔欐墍鍦ㄨ揣鏋舵帓鍙�
- 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;
+ //鏈壘鍒板贩閬擄紝鎵句竴鏉℃柊鐨勭┖宸烽亾
+ if (locMast == null) {
+ locMast = locMastService.findInEmptyLocMast(locTypeDto.getLocType1(), rows);//鎵句竴鏉℃柊鐨勭┖宸烽亾
+ }
+
+ return locMast;
+ }
+
+ //楂橀绫诲瀷鍏ユ渶澶栦晶搴撲綅
+ private LocMast getLocNoStep3(LocTypeDto locTypeDto, List<Integer> crnNos) {
+ LocMast locMast = null;
+ //鎵炬渶澶栦晶绌哄簱浣�
+ List<LocMast> locMasts = locMastService.findOutMast(locTypeDto.getLocType1(), crnNos);
+ for (LocMast locMast0 : locMasts) {
+ //妫�娴嬪綋鍓嶅簱浣嶅唴渚у叾浠栧簱浣嶆槸鍚︿负D銆丗銆乆
+ if (Utils.checkInsideLocIsDFX(locMast0.getLocNo())) {
+ //鍐呬晶鍏朵粬搴撲綅涓嶆槸D銆丗銆乆銆備笉鑳介�夊彇璇ュ簱浣�
+ continue;
+ }
+
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (true||basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (locMastService.checkEmptyCount(locMast0, 10)) {
+ locMast = locMast0;
}
}
}
}
- basCrnpService.checkSiteStatus(crnNo);
+ return locMast;
+ }
+
+ //浣庨绫诲瀷锛岀洿鎺ユ壘娣锋斁鍖哄煙
+ private LocMast getLocNoStep4(LocTypeDto locTypeDto) {
+ LocMast locMast = null;
+ List<LocMast> locMasts = locMastService.findEmptyLowFrequencyLocMast(locTypeDto.getLocType1());
+ for (LocMast locMast0 : locMasts) {
+ //妫�娴嬪綋鍓嶅簱浣嶅唴渚у叾浠栧簱浣嶆槸鍚︿负D銆丗銆乆
+ if (Utils.checkInsideLocIsDFX(locMast0.getLocNo())) {
+ //鍐呬晶鍏朵粬搴撲綅涓嶆槸D銆丗銆乆銆備笉鑳介�夊彇璇ュ簱浣�
+ continue;
+ }
+
+ //妫�娴嬪綋鍓嶅簱浣嶅渚у簱浣嶆槸鍚︿负O(绌哄簱浣�)
+ boolean flag = false;
+ List<String> outerLoc = Utils.getGroupOuterLoc(locMast0.getLocNo());
+ if (outerLoc.size() > 0) {
+ List<LocMast> outerLocMast = locMastService.selectByLocNos(outerLoc);
+ for (LocMast mast : outerLocMast) {
+ if (!mast.getLocSts().equals("O")) {
+ //涓嶆槸绌哄簱浣嶏紝鎵句笅涓�涓�
+ flag = true;
+ break;
+ }
+ }
+ }
+ if (flag) {
+ continue;
+ }
+
+ // 娴呭簱浣嶇鍚堝昂瀵告娴�
+ if (VersionUtils.locMoveCheckLocType(locMast0, locTypeDto)) {
+ // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+ if (true||basCrnpService.checkSiteError(locMast0.getCrnNo(), true)) {
+ // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+ if (locMastService.checkEmptyCount(locMast0, 10)) {
+ locMast = locMast0;
+ }
+ }
+ }
+ }
+
+ return locMast;
+ }
+
+ //杩斿洖dto
+ private StartupDto getLocNoFinalStep(Integer staDescId, Integer sourceStaNo, LocMast locMast) {
// 鑾峰彇鐩爣绔�
Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
.eq("type_no", staDescId)
.eq("stn_no", sourceStaNo)
- .eq("crn_no", crnNo);
+ .eq("crn_no", locMast.getCrnNo());
StaDesc staDesc = staDescService.selectOne(wrapper);
if (Cools.isEmpty(staDesc)) {
+ log.error("鍏ュ簱璺緞涓嶅瓨鍦�, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, locMast.getCrnNo());
throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
}
- BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
- int inQty = staNo.getInQty()==null?0:staNo.getInQty();
- if (staNo.getAutoing().equals("Y") && inQty<2) {
- // 鏇存柊搴撲綅鎺掑彿
- rowLastno.setCurrentRow(curRow);
- rowLastnoService.updateById(rowLastno);
- // 鏌ユ壘搴撲綅
- if (locMast == null) {
- if (Utils.isShallowLoc(slaveProperties, curRow)) {
- Integer deepRow = Utils.getDeepRow(slaveProperties, curRow);
- locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1());
- }
- if (Cools.isEmpty(locMast)) {
- locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1());
- }
- }
- if (Cools.isEmpty(locMast)) {
- // 杞昏揣鐗╂壘杞诲簱浣嶄负绌烘椂锛屽彲浠ュ幓鎵鹃噸搴撲綅浠�
- if (locTypeDto.getLocType1() == 1) {
- locTypeDto.setLocType1((short) 2);
- return getLocNo(null, staDescId, sourceStaNo, matNos, locTypeDto, times);
- }
- if (times >= rowCount) {
- log.error("娌℃湁绌哄簱浣�");
- throw new CoolException("娌℃湁绌哄簱浣�");
- }
- times = times + 1;
- return getLocNo(1, staDescId, sourceStaNo, matNos, locTypeDto, times);
- }
- String locNo = locMast.getLocNo();
- // 杩斿洖dto
- startupDto.setCrnNo(crnNo);
- startupDto.setSourceStaNo(sourceStaNo);
- startupDto.setStaNo(staNo.getDevNo());
- startupDto.setLocNo(locNo);
- } else {
- throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
+ // 妫�娴嬬洰鏍囩珯
+ BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
+ if (!staNo.getAutoing().equals("Y")) {
+ throw new CoolException("鐩爣绔�" + staDesc.getCrnStn() + "涓嶅彲鐢�");
}
+
+ String locNo = locMast.getLocNo();
+
+ // 鐢熸垚宸ヤ綔鍙�
+ int workNo = getWorkNo(0);
+
+ // 杩斿洖dto
+ StartupDto startupDto = new StartupDto();
+ startupDto.setWorkNo(workNo);
+ startupDto.setCrnNo(locMast.getCrnNo());
+ startupDto.setSourceStaNo(sourceStaNo);
+ startupDto.setStaNo(staNo.getDevNo());
+ startupDto.setLocNo(locNo);
return startupDto;
}
-
public static String zerofill(String msg, Integer count) {
if (msg.length() == count) {
@@ -286,4 +422,28 @@
}
}
-}
\ No newline at end of file
+ public int getCurRow(int curRow){
+ switch (curRow){
+ case 1:
+ case 2:
+ case 8:
+ case 9:
+ case 10:
+ case 15:
+ case 16:
+ case 17:
+ return curRow+1;
+ case 5:
+ case 6:
+ case 7:
+ case 13:
+ case 14:
+ case 20:
+ case 21:
+ return curRow-1;
+ default:
+ return 0;
+ }
+ }
+
+}
--
Gitblit v1.9.1