From 08d48e15eb1a33bef4125b99abc802d1aa7e1c54 Mon Sep 17 00:00:00 2001
From: lsh <1>
Date: 星期日, 28 一月 2024 13:22:00 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java | 10 +-
src/main/java/com/zy/asrs/task/WrkMastStaInItScheduler.java | 136 ++++++++++++++++++++++++++++++++++++++++----
src/main/resources/license.lic | 0
src/main/resources/application.yml | 2
4 files changed, 128 insertions(+), 20 deletions(-)
diff --git a/src/main/java/com/zy/asrs/task/WrkMastStaInItScheduler.java b/src/main/java/com/zy/asrs/task/WrkMastStaInItScheduler.java
index 0da05d6..d6c7630 100644
--- a/src/main/java/com/zy/asrs/task/WrkMastStaInItScheduler.java
+++ b/src/main/java/com/zy/asrs/task/WrkMastStaInItScheduler.java
@@ -9,8 +9,11 @@
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.RgvOneSignService;
import com.zy.asrs.service.WrkMastService;
+import com.zy.asrs.service.WrkMastStaService;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.task.handler.WrkMastStaInItHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -25,6 +28,8 @@
@Component
public class WrkMastStaInItScheduler {
+ private static final Logger log = LoggerFactory.getLogger(WorkMastScheduler.class);
+
@Autowired
private WrkMastStaInItHandler wrkMastStaInItHandler;
@Autowired
@@ -33,10 +38,20 @@
private WrkMastService wrkMastService;
@Autowired
private RgvOneSignService rgvOneSignService;
+ @Autowired
+ private WrkMastStaService wrkMastStaService;
public static final List<Integer> STA_WORK_CU = new ArrayList<Integer>() {{
add(101);add(102);add(104);add(105);add(107);add(108);add(110);add(111);add(113);add(114);add(116);add(117);
+ }};
+
+ public static final List<Integer> STA_WORK_CU_CAR = new ArrayList<Integer>() {{
+ add(118);add(119);add(120);add(121);
+ }};
+
+ public static final List<Integer> STA_WORK_CU_CAR_TWO = new ArrayList<Integer>() {{
+ add(120);add(121);
}};
public static final List<Integer> STA_WORK_RU = new ArrayList<Integer>() {{
@@ -61,12 +76,9 @@
if (wrkMast.getWrkSts()!=14 && wrkMast.getWrkSts()!=15){
continue;
}
-// if (wrkMast.getStaNo()==118 || wrkMast.getStaNo()==119){
-// RgvOneSign rgvOneSign = rgvOneSignService.selectOne(new EntityWrapper<RgvOneSign>().eq("rgv_one_type","oneSign"));
-// if (rgvOneSign.getRgvOneSign()==1){
-// continue;
-// }
-// }
+ if (wrkMast.getStaNo()==118 || wrkMast.getStaNo()==119 || wrkMast.getStaNo()==120 || wrkMast.getStaNo()==121){
+ continue;
+ }
boolean wrkTypeSign = fullKM(wrkMast);
if (!Cools.isEmpty(wrkMast)){
if (wrkTypeSign) {
@@ -92,6 +104,10 @@
BasDevp basDevp = basDevpService.selectById(staNo);
if (basDevp.getWrkNo()!=0 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y")){
WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo()));
+ if (Cools.isEmpty(wrkMast)){
+ continue;
+ }
+
if (wrkMast.getWrkSts()!=2 || wrkMast.getIoType()==10){
continue;
}
@@ -105,19 +121,111 @@
} else {
System.out.println(staNo+"澶辫触锛�");
}
-// }else {
-// ReturnT<String> result = wrkMastStaInItHandler.start(wrkMast,basDevp,23);
-// if (result.getCode()==200) {
-// continue;
-// } else {
-// System.out.println(staNo+"澶辫触锛�");
-// }
-// }
}
}
}
}
+ @Scheduled(cron = "0/3 * * * * ? ")
+ private void execute2(){
+ try{
+ for(Integer staNo : STA_WORK_CU){
+ BasDevp basDevp = basDevpService.selectById(staNo);
+ if (basDevp.getWrkNo()!=0 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y")){
+ WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo()));
+ if(Cools.isEmpty(wrkMast)){
+ continue;
+ }
+ if (wrkMast.getIoType()!=101 && wrkMast.getIoType()!=104){
+ continue;
+ }
+ if (wrkMast.getWrkSts()!=14 && wrkMast.getWrkSts()!=15){
+ continue;
+ }
+ if (wrkMast.getStaNo()<118 || wrkMast.getStaNo()>121){
+ continue;
+ }
+ int count = wrkMastStaService.selectCount(new EntityWrapper<WrkMastSta>().eq("sta_start", wrkMast.getStaNo()).or().eq("sta_end", wrkMast.getStaNo()));
+ if (count!=0){
+ continue;
+ }
+ BasDevp basDevpEnd = basDevpService.selectById(wrkMast.getStaNo());
+ if (!basDevpEnd.getLoading().equals("Y") || basDevpEnd.getWrkNo()!=0 || basDevpEnd.getLoading().equals("Y") || basDevpEnd.getReportSign()!=0){
+ continue;
+ }
+ if (wrkMast.getStaNo()==118 || wrkMast.getStaNo()==119){
+ RgvOneSign rgvOneSign = rgvOneSignService.selectOne(new EntityWrapper<RgvOneSign>().eq("rgv_one_type","oneSign"));
+ if (rgvOneSign.getRgvOneSign()==1){
+ continue;
+ }
+ }
+//
+ boolean wrkTypeSign = fullKM(wrkMast);
+ if (!Cools.isEmpty(wrkMast)){
+ if (wrkTypeSign) {
+ ReturnT<String> result = wrkMastStaInItHandler.start(wrkMast,basDevp,13);//3锛氬彇鏀�
+ if (result.getCode()==200){
+ continue;
+ }else {
+ System.out.println(staNo+"澶辫触锛�");
+ }
+ }
+ }
+ }
+ }
+
+ for(Integer staNo : STA_WORK_CU){
+ BasDevp basDevp = basDevpService.selectById(staNo);
+ if (basDevp.getWrkNo()!=0 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y")){
+ List<Integer> STA_WORK_CU_CAR_NOW = STA_WORK_CU_CAR;
+ WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo()));
+ if(Cools.isEmpty(wrkMast)){
+ continue;
+ }
+ if (wrkMast.getIoType()!=101 && wrkMast.getIoType()!=104){
+ continue;
+ }
+ if (wrkMast.getWrkSts()!=14 && wrkMast.getWrkSts()!=15){
+ continue;
+ }
+ Integer wrkMastStaNo = wrkMast.getStaNo();
+ if (wrkMastStaNo<118 || wrkMastStaNo>121){
+ continue;
+ }
+ int count = wrkMastStaService.selectCount(new EntityWrapper<WrkMastSta>().eq("sta_start", wrkMastStaNo).or().eq("sta_end", wrkMastStaNo));
+ if (count!=0){
+ continue;
+ }
+ RgvOneSign rgvOneSign = rgvOneSignService.selectOne(new EntityWrapper<RgvOneSign>().eq("rgv_one_type","oneSign"));
+ if (rgvOneSign.getRgvOneSign()==1){
+ STA_WORK_CU_CAR_NOW = STA_WORK_CU_CAR_TWO;
+ }
+
+ BasDevp basDevpEnd = basDevpService.selectById(wrkMastStaNo);
+ if (!basDevpEnd.getLoading().equals("Y") || basDevpEnd.getWrkNo()!=0 || basDevpEnd.getLoading().equals("Y") || basDevpEnd.getReportSign()!=0) {
+ for (Integer staNoOther : STA_WORK_CU_CAR_NOW) {
+ if (staNoOther.equals(wrkMastStaNo)) continue;
+ int countOther = wrkMastStaService.selectCount(new EntityWrapper<WrkMastSta>().eq("sta_start", staNoOther).or().eq("sta_end", staNoOther));
+ if (countOther!=0){
+ continue;
+ }
+ BasDevp basDevpOther = basDevpService.selectById(staNoOther);
+ if (!basDevpOther.getLoading().equals("Y") || basDevpOther.getWrkNo()!=0 || basDevpOther.getLoading().equals("Y") || basDevpOther.getReportSign()!=0) {
+ continue;
+ }
+ wrkMast.setStaNo(staNoOther);
+ wrkMastService.updateById(wrkMast);
+ log.info("宸ヤ綔鍙�"+wrkMast.getWrkNo()+"淇敼鐩爣绔欎负:"+staNoOther+";鍘熺洰鏍囩珯涓�:"+wrkMastStaNo);
+ return;
+ }
+ }
+ }
+ }
+ }catch (Exception e){
+ log.error("鐩爣涓烘媶鍨涗綅缃殑浠诲姟鐢熸垚灏忚溅宸ヤ綔妗f澶辫触锛侊紒"+e);
+ }
+ }
+
public boolean fullKM(WrkMast wrkMast){
if (wrkMast.getIoType()!=10 && wrkMast.getIoType()!=110){
return true;
diff --git a/src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java b/src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java
index 869a32b..3febe69 100644
--- a/src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java
+++ b/src/main/java/com/zy/asrs/utils/OutboundAllocationUtil.java
@@ -213,11 +213,11 @@
if (locDetlList.size()==0){
continue;
}
-// if (sign>lists.size()/2) {
-// //120銆�121
-// staA=120;
-// staB=121;
-// }
+ if (sign>lists.size()/2) {
+ //120銆�121
+ staA=120;
+ staB=121;
+ }
List<StockOutParam.LocDetl> locDetlsA = new ArrayList<>();
List<StockOutParam.LocDetl> locDetlsB = new ArrayList<>();
List<String> locNos = new ArrayList<>();
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index a74f319..5652141 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -10,7 +10,7 @@
enabled: false
datasource:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
- url: jdbc:sqlserver://192.168.18.3:49977;databasename=srjtasrs
+ url: jdbc:sqlserver://192.168.18.4:49977;databasename=srjtasrs
username: sa
password: sa@123
mvc:
diff --git a/src/main/resources/license.lic b/src/main/resources/license.lic
index fc20130..623e35b 100644
--- a/src/main/resources/license.lic
+++ b/src/main/resources/license.lic
Binary files differ
--
Gitblit v1.9.1