From 4cec3f902ac1fac2d599a37dc401594e4e932cf8 Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期五, 18 七月 2025 18:25:14 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 473 +++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 351 insertions(+), 122 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index eda3cf8..39702ae 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -93,9 +93,9 @@
@Autowired
private WrkMastStaMapper wrkMastStaMapper;
@Autowired
- private BasRgvMapMapper basRgvMapMapper;
- @Autowired
private RgvOneSignMapper rgvOneSignMapper;
+ @Autowired
+ private BasRgvMapService basRgvMapService;
@Value("${wms.url}")
private String wmsUrl;
@@ -1310,7 +1310,11 @@
log.error("鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo());
continue;
}
- if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable()
+// if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable()
+// && staDetl.getCanining() != null && staDetl.getCanining().equals("Y") && staDetl.getWrkNo().equals(wrkMast.getWrkNo())) {
+// flag = true;
+// }
+ if (staProtocol.isAutoing() && staProtocol.getWorkNo() > 0
&& staDetl.getCanining() != null && staDetl.getCanining().equals("Y") && staDetl.getWrkNo().equals(wrkMast.getWrkNo())) {
flag = true;
}
@@ -2356,7 +2360,10 @@
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
- && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
// && (rgvProtocol.getLoaded2()==2 || rgvProtocol.getLoaded2()==3 ) ////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
&& rgvProtocol.getLoaded2()==3 ////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
) {
@@ -2481,11 +2488,12 @@
if (Cools.isEmpty(wrkDetls)){
continue;
}
- Integer count1 = wrkDetlService.count1();
- Integer count11 = wrkDetlService.count11();
+// Integer count1 = wrkDetlService.count1();
+ Integer count111 = wrkDetlService.count111();
+// Integer count11 = wrkDetlService.count11();
Integer count2 = wrkDetlService.count2(wrkDetls.get(0).getOrderNo());
Integer count3 = wrkDetlService.count3();
- wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl,count1+count11,count2,count3)));
+ wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl,count111,count2,count3)));
}
commands.add(ledCommand);
}
@@ -2553,7 +2561,7 @@
if (staProtocol == null) {
continue;
}
- if (staProtocol.getWorkNo() != 0 && staProtocol.isLoading()) {
+ if (staProtocol.getWorkNo() != 0 || staProtocol.isLoading()) {
reset = false;
break;
}
@@ -2562,21 +2570,21 @@
LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
// led鏄剧ず榛樿鍐呭
if (reset && !ledThread.isLedMk()) {
- if (led.getId() == 7) {
- ledThread.setLedMk(true);
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
- log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
- } else {
-
- }
- } else {
+// if (led.getId() == 7) {
+// ledThread.setLedMk(true);
+// if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(4, new ArrayList<>()))) {
+// log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
+// } else {
+//
+// }
+// } else {
ledThread.setLedMk(true);
if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(2, new ArrayList<>()))) {
log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
} else {
}
- }
+// }
}
}
}
@@ -3549,7 +3557,13 @@
if (!rgvComplete){
log.error("灏忚溅澶嶄綅澶辫触锛屽皬杞﹀彿{}锛�",rgvProtocol.getRgvNo());
}
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
basRgvMap.setNowRoute(rgvProtocol.getRgvPosI());
rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute());
break;
@@ -3560,13 +3574,13 @@
continue;
}
if (wrkMastSta.getWrkSts()!=1){
- if (wrkMastSta.getWrkType()==1 && wrkMastSta.getWrkSts()==2 && rgvProtocol.getLoaded1()==1){
- boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo(),rgvProtocol.getTaskNo1());
- if (!rgvComplete){
- log.error("灏忚溅澶嶄綅澶辫触锛屽皬杞﹀彿{}锛�",rgvProtocol.getRgvNo());
- break;
- }
- rgvAvoidanceXYWrkMast(rgvProtocol.getRgvNo());
+ if (wrkMastSta.getWrkType()==3 && wrkMastSta.getWrkSts()==2 && rgvProtocol.getLoaded1()==1){
+// boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo(),rgvProtocol.getTaskNo1());
+// if (!rgvComplete){
+// log.error("灏忚溅澶嶄綅澶辫触锛屽皬杞﹀彿{}锛�",rgvProtocol.getRgvNo());
+// break;
+// }
+ rgvAvoidanceXYWrkMast(rgvProtocol.getRgvNo(),wrkMastSta.getWrkNo().shortValue());
continue;
}
if (wrkMastSta.getWrkType()==6){
@@ -3627,16 +3641,28 @@
}
wrkMastSta.setWrkSts(3);
wrkMastStaMapper.updateById(wrkMastSta);
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
basRgvMap.setNowRoute(rgvProtocol.getRgvPosI());
rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute());
}else if (rgvProtocol.getTaskNo2()!=0 && (rgvProtocol.getStatusType2()==RgvStatusType.WAITING || rgvProtocol.getStatusType2()==RgvStatusType.FETCHWAITING)){
if (rgvProtocol.getTaskNo2()==(short)32222){
- boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo());
+ boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo(),rgvProtocol.getTaskNo1());
if (!rgvComplete){
log.error("灏忚溅澶嶄綅澶辫触锛屽皬杞﹀彿{}锛�",rgvProtocol.getRgvNo());
}
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
basRgvMap.setNowRoute(rgvProtocol.getRgvPosI());
rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute());
break;
@@ -3678,14 +3704,20 @@
//
// }
}*/
- boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo());
+ boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo(),rgvProtocol.getTaskNo1());
if (!rgvComplete){
log.error("灏忚溅澶嶄綅澶辫触锛屽皬杞﹀彿{}锛�",rgvProtocol.getRgvNo());
break;
}
wrkMastSta.setWrkSts(3);
wrkMastStaMapper.updateById(wrkMastSta);
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
basRgvMap.setNowRoute(rgvProtocol.getRgvPosI());
rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute());
}else {
@@ -3720,10 +3752,11 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏃犵墿//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && (rgvProtocol.getLoaded1()==0 || (rgvProtocol.getLoaded1()==1 && rgvProtocol.getTaskNo1()!=0) )
- && (rgvProtocol.getTaskNo1()==0 || (rgvProtocol.getLoaded1()==1 && rgvProtocol.getTaskNo1()!=0) )
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
&& rgvProtocol.getTaskNo2()==0
) {
switch (sign){
@@ -3755,6 +3788,7 @@
break;
case 6:////鎻愬崌
// signWork = qwe();
+ signWork = rgvRunWrkMastMove(rgvSlave);
break;
default:
break;
@@ -3829,12 +3863,19 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏃犵墿//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getLoaded1()==0
&& rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(basRgv.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(basRgv.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -3943,12 +3984,19 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏃犵墿//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getLoaded1()==0
&& rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(basRgv.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(basRgv.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4024,12 +4072,19 @@
}
} else if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getLoaded1()==1
&& rgvProtocol.getTaskNo1()!=0 && rgvProtocol.getTaskNo2()==0
) {// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏈夌墿 鏈夊伐浣滃彿//rgv鍙敤
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(basRgv.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(basRgv.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4110,10 +4165,19 @@
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
&& (rgvProtocol.getLoaded2()==3 || rgvProtocol.getLoaded2()==1 || rgvProtocol.getLoaded2()==4)////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗� 锛堝彧鑳芥媶鍙狅級 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗�() 锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(basRgv.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4215,12 +4279,19 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅浜屾湁鐗�//rgv鍙敤//鎷嗙洏
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getLoaded1()==1
&& rgvProtocol.getTaskNo1()!=0 && rgvProtocol.getTaskNo2()==0
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4327,10 +4398,19 @@
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
&& (rgvProtocol.getLoaded2()==2 || rgvProtocol.getLoaded2()==3 ) ////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4432,10 +4512,19 @@
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
&& (rgvProtocol.getLoaded2()==0 || rgvProtocol.getLoaded2()==1 ) //鐜板満淇敼锛氬彔鐩樻満锛�////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗╋紙鍙兘鎷嗗彔锛� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4525,12 +4614,19 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅浜屾棤鐗�//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
- && rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
&& rgvProtocol.getModeType() == RgvModeType.AUTO
&& rgvProtocol.getLoaded1() == 0
&& rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4613,10 +4709,19 @@
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
&& rgvProtocol.getLoaded2()==0 //鐜板満淇敼锛氬彔鐩樻満锛�////0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗╋紙鍙兘鎷嗗彔锛� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvProtocol.getRgvNo());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
if (basRgvMap == null) {
log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
return false;
@@ -4649,7 +4754,7 @@
log.info(date+"婊″彇浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
continue;
}
- if (!staProtocol.isAutoing() || staProtocol.isLoading()){
+ if (!staProtocol.isAutoing() || !staProtocol.isLoading()){
continue;
}
@@ -4671,6 +4776,81 @@
return true;
}else {
log.error("3879琛岋紝璐х墿鎼繍浠诲姟锛氬伐浣滃彿{}鎵�灞炰换鍔′笅鍙戝悗鍦板浘鍚屾澶辫触",wrkMastSta.getWrkNo());
+ }
+ }else {
+ log.error("宸ヤ綔鍙穥}鎵�灞炰换鍔′笅鍙戝け璐�",wrkMastSta.getWrkNo());
+ }
+ break;
+ }
+ }
+// }
+ }catch (Exception e){
+ log.error("3989琛屾墽琛屽皬杞﹀彇绌烘澘浠诲姟涓嬪彂澶辫触");
+ log.error("3989琛�"+e);
+ }
+ return false;
+ }
+ public synchronized boolean rgvRunWrkMastMove(RgvSlave rgvSlave) {//婊″彇
+ try{
+// for (RgvSlave rgvSlave:slaveProperties.getRgv()) {
+ RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvSlave.getId());
+ RgvProtocol rgvProtocol = rgvThread.getRgvProtocol();
+ if (rgvProtocol == null) {
+ return false;
+ }
+ BasRgv basRgv = basRgvService.selectById(rgvSlave.getId());
+ if (basRgv == null) {
+ log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱杩涜缁存姢锛�", rgvSlave.getId());
+ return false;
+ }
+
+ // 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅浜屾棤鐗�//rgv鍙敤
+ if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
+ && rgvProtocol.getStatusType1() == RgvStatusType.IDLE
+ && (rgvProtocol.getStatusType2() == RgvStatusType.IDLE
+ || (rgvProtocol.getStatusType2() == RgvStatusType.SOS100 && rgvProtocol.getTaskNo2()==0))
+ && rgvProtocol.getModeType() == RgvModeType.AUTO
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
+ ) {
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvProtocol.getRgvNo(),rgvSignTwoType);
+ if (basRgvMap == null) {
+ log.error("{}鍙稲GV灏氭湭鍦ㄦ暟鎹簱鍦板浘涓繘琛岀淮鎶わ紒", rgvProtocol.getRgvNo());
+ return false;
+ }
+ List<Integer> route = RouteUtils.getRoute(basRgvMap.getStartRoute(), basRgvMap.getEndRoute());
+ basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //鏇存柊灏忚溅褰撳墠浣嶇疆绔欑偣鍙�
+ List<WrkMastSta> wrkMastStaList = wrkMastStaMapper.selectNoInterfereList(route, route);
+ for (WrkMastSta wrkMastSta : wrkMastStaList){
+ if (wrkMastSta.getWrkType()!=4){// 2:绌烘澘 || 宸ヤ綔绫诲瀷 1:鍙栵紙鍙犵洏锛� 2锛氭媶鐩� 5锛氭弧鍙� 6锛氭弧鏀� 4 绉诲姩
+ continue;
+ }
+ boolean sign = false;
+ if ( wrkMastSta.getStaEnd()!=0){//鏀�
+ sign = rgvAvoidanceXY(rgvProtocol.getRgvNo(),wrkMastSta);//鎷嗙洏
+ }else {
+ continue;
+ }
+ if (sign){
+ boolean signMap = rgvMapUpdate(basRgvMap, basRgvMap.getStartRoute(), wrkMastSta.getStaEnd());
+ if (signMap){
+ wrkMastSta.setWrkSts(3);
+ try{
+ wrkMastStaMapper.updateById(wrkMastSta);
+ }catch (Exception e){
+ log.error("鏇存柊灏忚溅浠诲姟澶辫触");
+ }
+ return true;
+ }else {
+ log.error("3857琛岋紝璐х墿鎼繍浠诲姟锛氬伐浣滃彿{}鎵�灞炰换鍔′笅鍙戝悗鍦板浘鍚屾澶辫触",wrkMastSta.getWrkNo());
}
}else {
log.error("宸ヤ綔鍙穥}鎵�灞炰换鍔′笅鍙戝け璐�",wrkMastSta.getWrkNo());
@@ -4717,8 +4897,9 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏃犵墿//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getLoaded1()==0 //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
- && rgvProtocol.getTaskNo1()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
&& rgvProtocol.getTaskNo2()==0
&& rgvProtocol.getStatusType1() == RgvStatusType.IDLE
&& rgvProtocol.getStatusType2() == RgvStatusType.IDLE
@@ -4828,11 +5009,18 @@
// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏃犵墿//rgv鍙敤
if (rgvProtocol.getStatusType() == RgvStatusType.IDLE
&& rgvProtocol.getModeType() == RgvModeType.AUTO
- && rgvProtocol.getLoaded1()==0 //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
- && rgvProtocol.getTaskNo1()==0
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
&& rgvProtocol.getTaskNo2()==0
) {
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvSlave.getId());
+
+ RgvOneSign rgvSignTwo = rgvOneSignMapper.selectOneSign("rgvTwo");
+ int rgvSignTwoType = 0;
+ if (!Cools.isEmpty(rgvSignTwo)){
+ rgvSignTwoType = rgvSignTwo.getRgvOneSign();
+ }
+ BasRgvMap basRgvMap = basRgvMapService.selectByIdSignTwo(rgvSlave.getId(),rgvSignTwoType);
basRgvMap.setNowRoute(rgvProtocol.getRgvPosI());
rgvMapUpdate(basRgvMap,basRgvMap.getStartRoute(),basRgvMap.getStartRoute());
}
@@ -4847,9 +5035,11 @@
* 灏忚溅XY绉诲姩 閬胯
* */
public synchronized boolean rgvAvoidanceXY(Integer rgvId){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
if (rgvId==1){
try{
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvId);
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
@@ -4872,7 +5062,6 @@
}
}else {
try{
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvId);
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
@@ -4898,19 +5087,26 @@
/*
* 灏忚溅XY绉诲姩 閬胯
* */
- public synchronized boolean rgvAvoidanceXYWrkMast(Integer rgvId){
+ public synchronized boolean rgvAvoidanceXYWrkMast(Integer rgvId,short wrkNo1){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
if (rgvId==2){
try{
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvId);
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
+ rgvCommand.setTaskNo1(wrkNo1); // 宸ヤ綔鍙�
+ rgvCommand.setAckFinish1((short) 1); // 浠诲姟瀹屾垚纭浣�
+ rgvCommand.setTaskMode1(RgvTaskModeType.NONE); // 浠诲姟妯″紡
+ rgvCommand.setSourceStaNo1((short)0); // 婧愮珯
+ rgvCommand.setDestinationStaNo1((short)0); // 鐩爣绔�
rgvCommand.setAckFinish2((short) 0); // 宸ヤ綅2浠诲姟瀹屾垚纭浣�
rgvCommand.setTaskNo2((short)32222); // 宸ヤ綅2宸ヤ綔鍙�
rgvCommand.setTaskMode2(RgvTaskModeType.X_MOVE); // 宸ヤ綅2浠诲姟妯″紡: 鍥炲師鐐�
rgvCommand.setSourceStaNo2((short)121);
rgvCommand.setCommand((short) 2); //宸ヤ綅2浠诲姟纭
- if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(5, rgvCommand))) {
+ if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(10, rgvCommand))) {
//step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔� step=9锛屽洖鍘熺偣 9999浠诲姟鍙�
log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
return false;
@@ -4923,14 +5119,71 @@
}
}else {
try{
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvId);
+ // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+ RgvCommand rgvCommand = new RgvCommand();
+ rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
+ rgvCommand.setTaskNo1(wrkNo1); // 宸ヤ綔鍙�
+ rgvCommand.setAckFinish1((short) 1); // 浠诲姟瀹屾垚纭浣�
+ rgvCommand.setTaskMode1(RgvTaskModeType.NONE); // 浠诲姟妯″紡
+ rgvCommand.setSourceStaNo1((short)0); // 婧愮珯
+ rgvCommand.setDestinationStaNo1((short)0); // 鐩爣绔�
+ rgvCommand.setAckFinish2((short) 0); // 宸ヤ綅2浠诲姟瀹屾垚纭浣�
+ rgvCommand.setTaskNo2((short)32222); // 宸ヤ綅2宸ヤ綔鍙�
+ rgvCommand.setTaskMode2(RgvTaskModeType.X_MOVE); // 宸ヤ綅2浠诲姟妯″紡: 鍥炲師鐐�
+ rgvCommand.setSourceStaNo2((short)118);
+ rgvCommand.setCommand((short) 2); //宸ヤ綅2浠诲姟纭
+ if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(10, rgvCommand))) {
+ //step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔� step=9锛屽洖鍘熺偣 9999浠诲姟鍙�
+ log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
+ return false;
+ } else {
+ return true;
+ }
+ }catch (Exception e){
+ return false;
+
+ }
+ }
+ }
+
+ /*
+ * 灏忚溅XY绉诲姩 閬胯
+ * */
+ public synchronized boolean rgvAvoidanceXY(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
+ if (rgvId==1){
+ try{
+ // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+ RgvCommand rgvCommand = new RgvCommand();
+ rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
+ rgvCommand.setAckFinish1((short) 0); // 宸ヤ綅1浠诲姟瀹屾垚纭浣�
+ rgvCommand.setTaskNo1((short)32222); // 宸ヤ綅1宸ヤ綔鍙�
+ rgvCommand.setTaskMode1(RgvTaskModeType.X_MOVE); // 宸ヤ綅1浠诲姟妯″紡: 鍥炲師鐐�
+ //basRgvMap.getLockStartRoute().shortValue()
+ rgvCommand.setSourceStaNo1( wrkMastSta.getStaEnd().shortValue());
+ rgvCommand.setCommand((short) 1); //宸ヤ綅1浠诲姟纭
+ if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) {
+ //step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔� step=9锛屽洖鍘熺偣 9999浠诲姟鍙�
+ log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
+ return false;
+ } else {
+ return true;
+ }
+ }catch (Exception e){
+ return false;
+
+ }
+ }else {
+ try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
rgvCommand.setAckFinish2((short) 0); // 宸ヤ綅2浠诲姟瀹屾垚纭浣�
rgvCommand.setTaskNo2((short)32222); // 宸ヤ綅2宸ヤ綔鍙�
rgvCommand.setTaskMode2(RgvTaskModeType.X_MOVE); // 宸ヤ綅2浠诲姟妯″紡: 鍥炲師鐐�
- rgvCommand.setSourceStaNo2((short)118);
+ rgvCommand.setSourceStaNo2( wrkMastSta.getStaEnd().shortValue());
rgvCommand.setCommand((short) 2); //宸ヤ綅2浠诲姟纭
if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(5, rgvCommand))) {
//step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔� step=9锛屽洖鍘熺偣 9999浠诲姟鍙�
@@ -4951,6 +5204,9 @@
* 灏忚溅鍙栬揣鑷冲伐浣嶄换鍔�
* */
public synchronized boolean rgvTakeFullAll(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4973,64 +5229,13 @@
}
}
-
- /*
- * 灏忚溅鍙栬揣鑷冲伐浣嶄换鍔�
- * */
- public synchronized boolean rgvTakeFullPut(Integer rgvId,WrkMastSta wrkMastSta){
- try{
- // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
- RgvCommand rgvCommand = new RgvCommand();
- rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
- rgvCommand.setAckFinish1((short) 0); // 宸ヤ綅1浠诲姟瀹屾垚纭浣�
- rgvCommand.setTaskNo1(wrkMastSta.getWrkNo().shortValue()); // 宸ヤ綅1宸ヤ綔鍙�
- rgvCommand.setTaskMode1(RgvTaskModeType.FETCH); // 宸ヤ綅1浠诲姟妯″紡: 鍗曞彇
- rgvCommand.setSourceStaNo1(wrkMastSta.getStaStart().shortValue()); //宸ヤ綅1璧风偣
- rgvCommand.setDestinationStaNo1(wrkMastSta.getStaEnd().shortValue()); //宸ヤ綅1鐩爣绔欑偣
- rgvCommand.setCommand((short) 1); //宸ヤ綅1浠诲姟纭
- if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) {
- //step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔�
- log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
- return false;
- } else {
- return true;
- }
- }catch (Exception e){
- return false;
- }
- }
-
-
- /*
- * 灏忚溅鏀捐揣鑷冲伐浣嶄换鍔�
- * */
- public synchronized boolean rgvTakeFullTake(Integer rgvId,WrkMastSta wrkMastSta){
- try{
- // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
- RgvCommand rgvCommand = new RgvCommand();
- rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
- rgvCommand.setAckFinish1((short) 0); // 宸ヤ綅1浠诲姟瀹屾垚纭浣�
- rgvCommand.setTaskNo1(wrkMastSta.getWrkNo().shortValue()); // 宸ヤ綅1宸ヤ綔鍙�
- rgvCommand.setTaskMode1(RgvTaskModeType.PUT); // 宸ヤ綅1浠诲姟妯″紡: 鍗曟斁
- rgvCommand.setSourceStaNo1(wrkMastSta.getStaStart().shortValue()); //宸ヤ綅1璧风偣
- rgvCommand.setDestinationStaNo1(wrkMastSta.getStaEnd().shortValue()); //宸ヤ綅1鐩爣绔欑偣
- rgvCommand.setCommand((short) 1); //宸ヤ綅1浠诲姟纭
- if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(4, rgvCommand))) {
- //step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔�
- log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
- return false;
- } else {
- return true;
- }
- }catch (Exception e){
- return false;
- }
- }
-
/*
* 灏忚溅鍙栬揣鑷冲伐浣嶄换鍔�
* */
public synchronized boolean rgvTakeFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5056,6 +5261,9 @@
* 灏忚溅鏀捐揣鑷宠緭閫佺嚎浠诲姟
* */
public synchronized boolean rgvPutFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5081,6 +5289,9 @@
* 灏忚溅鍙栫┖鏉胯嚦宸ヤ綅浠诲姟 鍙犵洏
* */
public synchronized boolean rgvTakeEmpty(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5106,6 +5317,9 @@
* 灏忚溅鏀剧┖鏉胯嚦杈撻�佺嚎浠诲姟 //鎷嗙洏
* */
public synchronized boolean rgvPutEmpty(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5131,6 +5345,9 @@
* 灏忚溅鍙栫┖鏉胯嚦宸ヤ綅浠诲姟 婊″彇
* */
public synchronized boolean rgvTakeEmptyFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5156,6 +5373,9 @@
* 灏忚溅鏀剧┖鏉胯嚦杈撻�佺嚎浠诲姟 //婊℃斁
* */
public synchronized boolean rgvPutEmptyFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -5181,6 +5401,9 @@
* 灏忚溅澶嶄綅
* */
public synchronized boolean rgvComplete(Integer rgvId){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(3, new RgvCommand()))) {
@@ -5201,6 +5424,9 @@
* 灏忚溅澶嶄綅
* */
public synchronized boolean rgvComplete(Integer rgvId,Short taskNo1){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setTaskNo1(taskNo1);
@@ -5226,7 +5452,9 @@
if (rgvOpen){
return true;
}
-
+ if (basRgvMapCurrent.getRgvNo()>2){
+ return true;
+ }
// List<Integer> integers = RouteUtils.RouteMapCurrentFar(basRgvMapCurrent.getNowRoute(),staStart,staEnd, basRgvMapCurrent.getLockStartRoute());
//鏇存柊褰撳墠灏忚溅閿�
try{
@@ -5234,16 +5462,17 @@
// Integer farCurrentStaNo = RouteUtils.RouteIndexFarMas(staEnd, staStart, staEnd, basRgvMapCurrent.getLockStartRoute());//鑾峰彇鏈�杩滅珯鐐�
Integer fallMerge = RouteUtils.RouteIndexFarMas(basRgvMapCurrent.getRgvNo(), farCurrentStaNo); //鑾峰彇鍚堝苟骞叉秹椤�
basRgvMapCurrent.setLockEndRoute(fallMerge);
- basRgvMapMapper.updateById(basRgvMapCurrent);
+
+ basRgvMapService.updateById(basRgvMapCurrent);
//鏇存柊鍙︿竴鍙板皬杞﹀湴鍥�
Integer rgvNoOther = basRgvMapCurrent.getRgvNoOther();
- BasRgvMap basRgvMapOther = basRgvMapMapper.selectById(rgvNoOther);
+ BasRgvMap basRgvMapOther = basRgvMapService.selectById(rgvNoOther);
List<Integer> integers = RouteUtils.RouteMapCurrentFar(fallMerge, basRgvMapCurrent.getLockStartRoute());
Integer lockEndRoute = RouteUtils.RouteMapOtherFarStnNo(integers, basRgvMapCurrent.getLockStartRoute());//鍙︿竴鍙板皬杞﹀彲娲诲姩鏈�杩滀綅缃�
Integer lockEndRouteL = RouteUtils.RouteIndexFarMasL(rgvNoOther, lockEndRoute);//鍙︿竴鍙板皬杞﹀彲娲诲姩鏈�杩滀綅缃�
basRgvMapOther.setEndRoute(lockEndRouteL);
- basRgvMapMapper.updateById(basRgvMapOther);
+ basRgvMapService.updateById(basRgvMapOther);
return true;
}catch (Exception e){
log.error("灏忚溅鍦板浘鏇存柊鍑洪敊锛�");
--
Gitblit v1.9.1