From 7a546480f6ddfaee1366f280981a002a08412c11 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 17 十二月 2025 15:11:07 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/CommonService.java | 31 +++++++++++++++++++++----------
1 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index fbfa65e..8112db3 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -38,8 +38,6 @@
@Autowired
private NavigateUtils navigateUtils;
@Autowired
- private CommonService commonService;
- @Autowired
private RedisUtil redisUtil;
/**
@@ -139,12 +137,12 @@
ioPri = param.getTaskPri().doubleValue();
}
- Integer sourceCrnNo = commonService.findCrnNoByLocNo(sourceLocMast.getLocNo());
+ Integer sourceCrnNo = this.findCrnNoByLocNo(sourceLocMast.getLocNo());
if (sourceCrnNo == null) {
throw new CoolException("鏈壘鍒板搴斿爢鍨涙満");
}
- Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo());
+ Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo());
if (crnNo == null) {
throw new CoolException("鏈壘鍒板搴斿爢鍨涙満");
}
@@ -186,7 +184,7 @@
}
//鍏ュ簱浠诲姟
- public boolean createInTask(CreateInTaskParam param) {
+ public WrkMast createInTask(CreateInTaskParam param) {
Date now = new Date();
LocMast locMast = locMastService.queryByLoc(param.getLocNo());
if (null == locMast) {
@@ -202,7 +200,7 @@
ioPri = param.getTaskPri().doubleValue();
}
- Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo());
+ Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo());
if (crnNo == null) {
throw new CoolException("鏈壘鍒板搴斿爢鍨涙満");
}
@@ -236,7 +234,7 @@
//缂撳瓨璁板綍褰撳墠鍛戒护鍫嗗灈鏈虹紪鍙�
redisUtil.set(RedisKeyType.CURRENT_CIRCLE_TASK_CRN_NO.key, crnNo, 60 * 60 * 24);
- return true;
+ return wrkMast;
}
//鍑哄簱浠诲姟
@@ -256,14 +254,28 @@
ioPri = param.getTaskPri().doubleValue();
}
- Integer crnNo = commonService.findCrnNoByLocNo(locMast.getLocNo());
+ Integer crnNo = this.findCrnNoByLocNo(locMast.getLocNo());
if (crnNo == null) {
throw new CoolException("鏈壘鍒板搴斿爢鍨涙満");
}
- Integer sourceStationId = commonService.findOutStationId(crnNo, param.getStaNo());
+ Integer sourceStationId = this.findOutStationId(crnNo, param.getStaNo());
if (sourceStationId == null) {
throw new CoolException("鏈壘鍒拌緭閫佺洰鏍囩珯鐐瑰彲璧拌璺緞");
+ }
+
+ BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo));
+ if(basCrnp == null) {
+ throw new CoolException("鏈壘鍒板搴斿爢鍨涙満鏁版嵁");
+ }
+ List<WrkMast> outWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
+ .eq("crn_no", crnNo)
+ .eq("io_type", WrkIoType.OUT.id)
+ );
+ // 妫�鏌ユ槸鍚﹁秴杩囨渶澶у嚭搴撲换鍔℃暟
+ if(outWrkMasts.size() >= basCrnp.getMaxOutTask()){
+ News.info("鍫嗗灈鏈�:{} 宸茶揪鏈�澶у嚭搴撲换鍔℃暟锛屽綋鍓嶄换鍔℃暟:{}", basCrnp.getCrnNo(), outWrkMasts.size());
+ throw new CoolException("鍫嗗灈鏈�:" + basCrnp.getCrnNo() + "宸茶揪鏈�澶у嚭搴撲换鍔℃暟锛屽綋鍓嶄换鍔℃暟:" + outWrkMasts.size());
}
// 鑾峰彇宸ヤ綔鍙�
@@ -292,7 +304,6 @@
locMast.setLocSts("R");
locMast.setModiTime(new Date());
locMastService.updateById(locMast);
-
return true;
}
--
Gitblit v1.9.1