From faa2c4244701949010da56802977c167e1d16141 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 19 七月 2023 16:45:19 +0800
Subject: [PATCH] #工具类Bug修复
---
src/main/java/com/zy/common/service/CommonService.java | 56 ++++++++++++++++++++++++++------------------------------
1 files changed, 26 insertions(+), 30 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index cb56388..c8ff3bc 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -97,20 +97,7 @@
*/
@Transactional
public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, int times) {
-
- if (sourceStaNo < 200){
- whsType = 1;
- } else if (sourceStaNo > 199 && sourceStaNo < 300){
- whsType = 2;
- } else if (sourceStaNo > 299){
- whsType = 3;
- }
- // 鐩爣鍫嗗灈鏈哄彿
- int crnNo = whsType;
- if (!basCrnpService.checkSiteError(crnNo, true)){
- throw new CoolException("娌℃湁鍙敤鐨勫爢鍨涙満");
- }
-
+ whsType = 1;
StartupDto startupDto = new StartupDto();
RowLastno rowLastno = rowLastnoService.selectById(whsType);
@@ -175,21 +162,6 @@
curRow = getCurRow(curRow);
}
- // 鑾峰彇鐩爣绔�
- Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
- .eq("type_no", staDescId)
- .eq("stn_no", sourceStaNo)
- .eq("crn_no", crnNo);
- StaDesc staDesc = staDescService.selectOne(wrapper);
- if (Cools.isEmpty(staDesc)) {
- log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo);
- throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
- }
- BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
- if (!staNo.getAutoing().equals("Y")) {
- throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
- }
-
// 鏇存柊搴撲綅鎺掑彿
rowLastno.setCurrentRow(curRow);
rowLastnoService.updateById(rowLastno);
@@ -229,9 +201,33 @@
}
}
}
+ Integer crnNo = 0;
+ BasDevp staNo =null;
+ boolean sign=false;
+ if (!Cools.isEmpty(locMast)){
+ try{
+ crnNo = locMast.getCrnNo();
+ // 鑾峰彇鐩爣绔�
+ Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+ .eq("type_no", staDescId)
+ .eq("stn_no", sourceStaNo)
+ .eq("crn_no", crnNo);
+ StaDesc staDesc = staDescService.selectOne(wrapper);
+ if (Cools.isEmpty(staDesc)) {
+ log.error("type_no={},stn_no={},crn_no={}", staDescId, sourceStaNo, crnNo);
+ throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
+ }
+ staNo = basDevpService.selectById(staDesc.getCrnStn());
+ if (!staNo.getAutoing().equals("Y")) {
+ throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
+ }
+ }catch (Exception e){
+ sign=true;
+ }
+ }
// 2.搴撲綅褰撳墠鎵�灞炲昂瀵告棤绌哄簱浣嶆椂锛岃皟鏁村昂瀵稿弬鏁帮紝鍚戜笂鍏煎妫�绱㈠簱浣�
- if (Cools.isEmpty(locMast)) {
+ if (Cools.isEmpty(locMast) || sign) {
// 褰撳墠宸烽亾鏃犵┖搴撲綅鏃讹紝閫掑綊璋冩暣鑷充笅涓�宸烽亾锛屾绱㈠叏閮ㄥ贩閬撴棤鏋滃悗锛岃烦鍑洪�掑綊
if (times < rowCount) {
times = times + 1;
--
Gitblit v1.9.1