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 | 871 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 821 insertions(+), 50 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 e1cdcef..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;
}
@@ -1561,7 +1565,15 @@
*/
public synchronized void locToCrnStn1(CrnSlave slave, CrnProtocol crnProtocol) {
List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep12(slave.getId());
+ Double pri = 0.0;
for (WrkMast wrkMast : wrkMasts) {
+ if (wrkMast.getIoType() != 110){
+ if (wrkMast.getIoPri()>=pri){
+ pri = wrkMast.getIoPri();
+ } else {
+ continue;
+ }
+ }
if (wrkMast == null) {
continue;
}
@@ -1640,7 +1652,11 @@
log.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo);
} else {
if (waitWrkMast.getWrkSts() == 11) {
- waitWrkMast.setIoPri(15D);
+ if (waitWrkMast.getIoPri() + 100000D < 99999999) {
+ waitWrkMast.setIoPri(waitWrkMast.getIoPri()+100000D);
+ } else {
+ waitWrkMast.setIoPri(99999999D);
+ }
waitWrkMast.setModiTime(new Date());
if (wrkMastMapper.updateById(waitWrkMast) == 0) {
log.error("璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo());
@@ -2344,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锛氾紙锛夊彧鍏佽鎷嗙洏
) {
@@ -2469,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);
}
@@ -2541,7 +2561,7 @@
if (staProtocol == null) {
continue;
}
- if (staProtocol.getWorkNo() != 0 && staProtocol.isLoading()) {
+ if (staProtocol.getWorkNo() != 0 || staProtocol.isLoading()) {
reset = false;
break;
}
@@ -2550,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 {
}
- }
+// }
}
}
}
@@ -3188,6 +3208,7 @@
staProtocolnew.setWorkNo(wrkMast.getWrkNo());
staProtocolnew.setStaNo(144);
devpThread.setPakMk(staProtocolnew.getSiteId(), false);
+ devpThread.setReportSign(staProtocolnew.getSiteId(), true);
boolean result = MessageQueue.offer(SlaveType.Devp, devpThread.getSlave().getId(), new Task(2, staProtocolnew));
if (!result) {
throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触==>椹卞姩鐮佸灈浣嶆墭鐩樺墠杩涘け璐ワ紒");
@@ -3536,14 +3557,44 @@
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;
}
WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(rgvProtocol.getTaskNo1().longValue());
- if (Cools.isEmpty(wrkMastSta) || wrkMastSta.getType()!=1 || wrkMastSta.getWrkSts()!=1){
+ if (Cools.isEmpty(wrkMastSta) || wrkMastSta.getType()!=1){
log.error("鏈煡鍒板皬杞︽墽琛屼换鍔℃垨鑰呮墽琛屼换鍔$姸鎬佷笉绗﹀悎锛�"+wrkMastSta);
+ continue;
+ }
+ if (wrkMastSta.getWrkSts()!=1){
+ 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){
+ boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo());
+ wrkMastSta.setWrkSts(3);
+ wrkMastStaMapper.updateById(wrkMastSta);
+ continue;
+ }
+ continue;
+ }
+ if (wrkMastSta.getWrkType()==5){
+ boolean rgvComplete = rgvComplete(rgvProtocol.getRgvNo(),rgvProtocol.getTaskNo1());
+ wrkMastSta.setWrkSts(3);
+ wrkMastStaMapper.updateById(wrkMastSta);
continue;
}
/* WrkMast wrkMast = wrkMastMapper.selectPakInStep3(wrkMastSta.getWrkNo().intValue());
@@ -3590,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;
@@ -3641,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 {
@@ -3683,22 +3752,33 @@
// 鍙湁褰揜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
+ //鐜板満淇敼锛氬彔鐩樻満锛屼笉婊¢兘绠楁棤鐗╋紝鎬庝箞鍒ゆ柇闇�瑕佽窡鐢垫帶瀵规帴
+ && ((rgvProtocol.getTaskNo1()==0 && rgvProtocol.getLoaded1()==0)
+ || (rgvProtocol.getTaskNo1()>0 && rgvProtocol.getLoaded1()==1))
+ && rgvProtocol.getTaskNo2()==0
) {
switch (sign){
//鎵ц灏忚溅璐х墿鎼繍浠诲姟
case 1:
signWork = rgvRunWrkMastFullSta(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaPutOrTake(rgvSlave);
+ }
break;
//鎵ц灏忚溅绌烘澘鎼繍浠诲姟
case 2://鏀�//鎷嗙洏
signWork = rgvRunWrkMastEmptyStaPut(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaPut(rgvSlave);
+ }
break;
case 3://婊℃斁
signWork = rgvRunWrkMastEmptyStaPutFull(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaTake(rgvSlave);
+ }
break;
case 4://鍙栧彔鐩�
signWork = rgvRunWrkMastEmptyStaTake(rgvSlave);
@@ -3708,6 +3788,7 @@
break;
case 6:////鎻愬崌
// signWork = qwe();
+ signWork = rgvRunWrkMastMove(rgvSlave);
break;
default:
break;
@@ -3716,12 +3797,21 @@
switch (signCount){
case 1://鎵ц灏忚溅璐х墿鎼繍浠诲姟
signWork = rgvRunWrkMastFullSta(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaPutOrTake(rgvSlave);
+ }
break;
case 2://鏀�//鎷嗙洏
signWork = rgvRunWrkMastEmptyStaPut(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaPut(rgvSlave);
+ }
break;
case 3://婊℃斁
signWork = rgvRunWrkMastEmptyStaPutFull(rgvSlave);
+ if (!signWork){
+ signWork = rgvRunWrkMastFullStaTake(rgvSlave);
+ }
break;
case 4://鍙栧彔鐩�
signWork = rgvRunWrkMastEmptyStaTake(rgvSlave);
@@ -3773,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;
@@ -3869,6 +3966,184 @@
return false;
}
/**
+ * 鎵ц灏忚溅鎼繍浠诲姟
+ */
+ public synchronized boolean rgvRunWrkMastFullStaPutOrTake(RgvSlave rgvSlave) {
+ try{
+ 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.getLoaded1()==0
+ && rgvProtocol.getTaskNo1()==0 && rgvProtocol.getTaskNo2()==0
+ ) {
+
+ 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;
+ }
+ 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.getType()!=1 || wrkMastSta.getWrkType()!=3){//1:婊$増 3锛氬彇鏀�
+ continue;
+ }
+ BasDevp basDevp = basDevpService.selectById(wrkMastSta.getStaEnd());
+ if (!basDevp.getAutoing().equals("Y")){
+ continue;
+ }
+ if (basDevp.getDevNo()>117 && basDevp.getDevNo()<124){
+ if (basDevp.getEmptyMk().equals("Y")){
+ continue;
+ }
+ if (basDevp.getLoading().equals("Y") && basDevp.getWrkNo()!=0){
+ Date date = new Date();
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvSlave.getDevpPlcId());
+ StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo());
+ if (staProtocol == null) {
+ log.info(date+"鍙栨斁浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
+ continue;
+ }
+ if (!staProtocol.isAutoing()){
+ continue;
+ }
+ if (staProtocol.isLoading() && staProtocol.getWorkNo() != 0){
+ WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo());
+ if (Cools.isEmpty(wrkMast) || wrkMast.getIoType()!=101 || Cools.isEmpty(wrkMast.getSheetNo()) || wrkMast.getSheetNo().equals("0")){
+ continue;
+ }
+ BasDevp basDevpS = basDevpService.selectById(wrkMastSta.getStaStart());
+ if (!basDevpS.getAutoing().equals("Y") || !basDevpS.getLoading().equals("Y") || basDevpS.getWrkNo()!=wrkMastSta.getWrkNo().intValue()){
+ continue;
+ }
+ StaProtocol staProtocols = devpThread.getStation().get(basDevpS.getDevNo());
+ if (staProtocols == null) {
+ log.info(date+"鍙栨斁浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
+ continue;
+ }
+ if (!staProtocols.isAutoing() || !staProtocols.isLoading() || staProtocols.getWorkNo() != wrkMastSta.getWrkNo().intValue()){
+ continue;
+ }
+
+
+ log.info(date+"鍙栬揣浠诲姟涓嬪彂锛氬皬杞﹀伐浣滄。锛�"+wrkMastSta);
+ log.info(date+"鍙栬揣浠诲姟涓嬪彂锛氱洰鏍囩珯鐘舵�侊細"+basDevp);
+ boolean sign = rgvTakeFull(basRgvMap.getRgvNo(), wrkMastSta);
+ if (sign){
+ boolean signMap = rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), wrkMastSta.getStaEnd());
+ if (signMap){
+ wrkMastSta.setWrkSts(2);
+ try{
+ wrkMastStaMapper.updateById(wrkMastSta);
+ }catch (Exception e){
+ log.error("鏇存柊灏忚溅浠诲姟澶辫触");
+ }
+ return true;
+ }else {
+ log.error("3978琛岋紝璐х墿鎼繍鍗曞彇浠诲姟锛氬伐浣滃彿{}鎵�灞炰换鍔′笅鍙戝悗鍦板浘鍚屾澶辫触",wrkMastSta.getWrkNo());
+ }
+ }else {
+ log.error("宸ヤ綔鍙穥}鎵�灞炰换鍔′笅鍙戝け璐�",wrkMastSta.getWrkNo());
+ }
+ break;
+ }
+ }
+ }
+ }
+ } else 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.getLoaded1()==1
+ && rgvProtocol.getTaskNo1()!=0 && rgvProtocol.getTaskNo2()==0
+ ) {// 鍙湁褰揜GV绌洪棽銆佽嚜鍔�,宸ヤ綅涓�鏈夌墿 鏈夊伐浣滃彿//rgv鍙敤
+
+ 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;
+ }
+ basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //鏇存柊灏忚溅褰撳墠浣嶇疆绔欑偣鍙�
+ WrkMastSta wrkMastSta = wrkMastStaMapper.selectByWrkNo(rgvProtocol.getTaskNo1().longValue());
+ if (Cools.isEmpty(wrkMastSta)){
+ return false;
+ }
+ if (wrkMastSta.getType()!=1 || wrkMastSta.getWrkType()!=3){//1:婊$増 3锛氬彇鏀�
+ return false;
+ }
+ BasDevp basDevp = basDevpService.selectById(wrkMastSta.getStaEnd());
+ if (!basDevp.getAutoing().equals("Y")){
+ return false;
+ }
+ if (!basDevp.getLoading().equals("Y") && basDevp.getWrkNo()==0){
+ Date date = new Date();
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvSlave.getDevpPlcId());
+ StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo());
+ if (staProtocol == null) {
+ log.info(date+"鍙栨斁浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
+ return false;
+ }
+ if (!staProtocol.isAutoing()){
+ return false;
+ }
+ if (!staProtocol.isLoading() && staProtocol.getWorkNo() == 0){
+ log.info(date+"鍙栬揣浠诲姟涓嬪彂锛氬皬杞﹀伐浣滄。锛�"+wrkMastSta);
+ log.info(date+"鍙栬揣浠诲姟涓嬪彂锛氱洰鏍囩珯鐘舵�侊細"+basDevp);
+ boolean sign = rgvPutFull(basRgvMap.getRgvNo(), wrkMastSta);
+ if (sign){
+ boolean signMap = rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), wrkMastSta.getStaEnd());
+ if (signMap){
+ wrkMastSta.setWrkSts(1);
+ try{
+ wrkMastStaMapper.updateById(wrkMastSta);
+ }catch (Exception e){
+ log.error("鏇存柊灏忚溅浠诲姟澶辫触");
+ }
+ return true;
+ }else {
+ log.error("3978琛岋紝璐х墿鎼繍鍗曞彇浠诲姟锛氬伐浣滃彿{}鎵�灞炰换鍔′笅鍙戝悗鍦板浘鍚屾澶辫触",wrkMastSta.getWrkNo());
+ }
+ }else {
+ log.error("宸ヤ綔鍙穥}鎵�灞炰换鍔′笅鍙戝け璐�",wrkMastSta.getWrkNo());
+ }
+ return true;
+ }
+ }
+ }
+// }
+ }catch (Exception e){
+ log.error("3978琛屾墽琛屽皬杞︽惉杩愪换鍔′笅鍙戝け璐�");
+ log.error("3978琛�"+e);
+ }
+ return false;
+ }
+ /**
* 鎵ц灏忚溅鎼繍浠诲姟//鎷嗙洏
*/
public synchronized boolean rgvRunWrkMastEmptyStaPut(RgvSlave rgvSlave) {//鎷嗙洏
@@ -3890,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;
@@ -3975,6 +4259,122 @@
}
return false;
}
+ /**
+ * 鎵ц灏忚溅鎼繍浠诲姟//鎷嗙洏
+ */
+ public synchronized boolean rgvRunWrkMastFullStaPut(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.getLoaded1()==1
+ && rgvProtocol.getTaskNo1()!=0 && 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;
+ }
+ basRgvMap.setNowRoute(rgvProtocol.getRgvPosI()); //鏇存柊灏忚溅褰撳墠浣嶇疆绔欑偣鍙�
+ List<Integer> route = RouteUtils.getRoute(basRgvMap.getStartRoute(), basRgvMap.getEndRoute());//鑾峰彇娲诲姩鑼冨洿
+ List<WrkMastSta> wrkMastStaList = wrkMastStaMapper.selectNoInterfereList(route, route);//鏌ヨ鍙墽琛屼换鍔�
+ for (WrkMastSta wrkMastSta : wrkMastStaList){
+ if (wrkMastSta.getType()!=1 || wrkMastSta.getWrkType()!=6){// 1:婊℃澘 || 宸ヤ綔绫诲瀷 1:鍙栵紙鍙犵洏锛� 2锛氭媶鐩� 5锛氭弧鍙� 6锛氭弧鏀�
+ continue;
+ }
+ boolean sign = false;
+ if ( wrkMastSta.getStaEnd()!=0){//鏀�
+ BasDevp basDevp = basDevpService.selectById(wrkMastSta.getStaEnd());
+ if (!basDevp.getAutoing().equals("Y") || basDevp.getLoading().equals("Y") || basDevp.getWrkNo()!=0){
+ continue;
+ }
+ if (basDevp.getDevNo()>117 && basDevp.getDevNo()<124){
+ if (basDevp.getLoadingSuper().equals("Y")){
+ continue;
+ }
+ }
+ if (basDevp.getDevNo()>=118 && basDevp.getDevNo()<=123){
+ if (!basDevp.getEmptyMk().equals("Y")){
+ continue;
+ }
+ }
+ Date date = new Date();
+
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvSlave.getDevpPlcId());
+ StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo());
+ if (staProtocol == null) {
+ log.info(date+"鎷嗙洏浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
+ continue;
+ }
+ if (!staProtocol.isAutoing() || staProtocol.isLoading() || staProtocol.getWorkNo() != 0){
+ continue;
+ }
+ if (basDevp.getDevNo()>117 && basDevp.getDevNo()<124){
+ if (staProtocol.isLoadingSuper()){
+ continue;
+ }
+ }
+ if (basDevp.getDevNo()>=118 && basDevp.getDevNo()<=123){
+ if (!staProtocol.isEmptyMk()){
+ continue;
+ }
+ }
+
+ log.info(date+"鎷嗙洏浠诲姟涓嬪彂锛氬皬杞﹀伐浣滄。锛�"+wrkMastSta);
+ log.info(date+"鎷嗙洏浠诲姟涓嬪彂锛氱洰鏍囩珯鐘舵�侊細"+basDevp);
+// sign = rgvPutEmpty(rgvProtocol.getRgvNo(),wrkMastSta);//鎷嗙洏
+ sign = rgvPutFull(basRgvMap.getRgvNo(), wrkMastSta);
+
+ }else {
+ continue;
+ }
+ if (sign){
+ boolean signMap = rgvMapUpdate(basRgvMap, basRgvMap.getStartRoute(), wrkMastSta.getStaEnd());
+ if (signMap){
+ wrkMastSta.setWrkSts(2);
+ try{
+ wrkMastStaMapper.updateById(wrkMastSta);
+ }catch (Exception e){
+ log.error("鏇存柊灏忚溅浠诲姟澶辫触");
+ }
+ return true;
+ }else {
+ log.error("3857琛岋紝璐х墿鎼繍浠诲姟锛氬伐浣滃彿{}鎵�灞炰换鍔′笅鍙戝悗鍦板浘鍚屾澶辫触",wrkMastSta.getWrkNo());
+ }
+ }else {
+ log.error("宸ヤ綔鍙穥}鎵�灞炰换鍔′笅鍙戝け璐�",wrkMastSta.getWrkNo());
+ }
+ break;
+ }
+ }
+// }
+ }catch (Exception e){
+ log.error("3933琛屾墽琛屽皬杞︽斁绌烘澘浠诲姟涓嬪彂澶辫触");
+ log.error("3933琛�"+e);
+ }
+ return false;
+ }
/**
* 鎵ц灏忚溅鎼繍浠诲姟
@@ -3998,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;
@@ -4103,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;
@@ -4179,6 +4597,99 @@
return false;
}
+ public synchronized boolean rgvRunWrkMastFullStaTake(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.getLoaded1() == 0
+ && rgvProtocol.getTaskNo1()==0 && 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.getType()!=1 || wrkMastSta.getWrkType()!=5){// 1:婊℃澘 || 宸ヤ綔绫诲瀷 1:鍙栵紙鍙犵洏锛� 2锛氭媶鐩� 5锛氭弧鍙� 6锛氭弧鏀�
+ continue;
+ }
+ boolean sign = false;
+ if ( wrkMastSta.getStaStart()!=0){//鍙�
+ BasDevp basDevp = basDevpService.selectById(wrkMastSta.getStaStart());
+ if (!basDevp.getAutoing().equals("Y") || !basDevp.getLoading().equals("Y")){
+ continue;
+ }
+ Date date = new Date();
+
+ SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, rgvSlave.getDevpPlcId());
+ StaProtocol staProtocol = devpThread.getStation().get(basDevp.getDevNo());
+ if (staProtocol == null) {
+ log.info(date+"鍙犵洏浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
+ continue;
+ }
+ if (!staProtocol.isAutoing() || !staProtocol.isLoading()){
+ continue;
+ }
+
+ log.info(date+"鍙犵洏浠诲姟涓嬪彂锛氬皬杞﹀伐浣滄。锛�"+wrkMastSta);
+ log.info(date+"鍙犵洏浠诲姟涓嬪彂锛氱洰鏍囩珯鐘舵�侊細"+basDevp);
+// sign = rgvTakeEmpty(rgvProtocol.getRgvNo(),wrkMastSta);//鍙犵洏
+ sign = rgvTakeFull(rgvProtocol.getRgvNo(),wrkMastSta);//鍙犵洏
+ }else {
+ continue;
+ }
+ if (sign){
+ boolean signMap = rgvMapUpdate(basRgvMap, wrkMastSta.getStaStart(), basRgvMap.getStartRoute());
+ if (signMap){
+ wrkMastSta.setWrkSts(1);
+ try{
+ wrkMastStaMapper.updateById(wrkMastSta);
+ }catch (Exception e){
+ log.error("鏇存柊灏忚溅浠诲姟澶辫触");
+ }
+ 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 rgvRunWrkMastEmptyStaTakeFull(RgvSlave rgvSlave) {//婊″彇
try{
// for (RgvSlave rgvSlave:slaveProperties.getRgv()) {
@@ -4198,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;
@@ -4234,7 +4754,7 @@
log.info(date+"婊″彇浠诲姟涓嬪彂锛氭湭鏌ヨ鍒扮珯鐐逛俊鎭細"+wrkMastSta);
continue;
}
- if (!staProtocol.isAutoing() || staProtocol.isLoading()){
+ if (!staProtocol.isAutoing() || !staProtocol.isLoading()){
continue;
}
@@ -4256,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());
@@ -4302,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
@@ -4413,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());
}
@@ -4432,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缂栧彿
@@ -4457,7 +5062,6 @@
}
}else {
try{
- BasRgvMap basRgvMap = basRgvMapMapper.selectById(rgvId);
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
rgvCommand.setRgvNo(rgvId); // RGV缂栧彿
@@ -4480,11 +5084,129 @@
}
}
+ /*
+ * 灏忚溅XY绉诲姩 閬胯
+ * */
+ public synchronized boolean rgvAvoidanceXYWrkMast(Integer rgvId,short wrkNo1){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
+ if (rgvId==2){
+ try{
+ // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+ 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(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;
+
+ }
+ }else {
+ try{
+ // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+ 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( 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浠诲姟鍙�
+ log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}锛屼换鍔℃暟鎹�={}", rgvId, JSON.toJSON(rgvCommand));
+ return false;
+ } else {
+ return true;
+ }
+ }catch (Exception e){
+ return false;
+
+ }
+ }
+ }
+
/*
* 灏忚溅鍙栬揣鑷冲伐浣嶄换鍔�
* */
public synchronized boolean rgvTakeFullAll(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4511,6 +5233,9 @@
* 灏忚溅鍙栬揣鑷冲伐浣嶄换鍔�
* */
public synchronized boolean rgvTakeFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4536,6 +5261,9 @@
* 灏忚溅鏀捐揣鑷宠緭閫佺嚎浠诲姟
* */
public synchronized boolean rgvPutFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4561,6 +5289,9 @@
* 灏忚溅鍙栫┖鏉胯嚦宸ヤ綅浠诲姟 鍙犵洏
* */
public synchronized boolean rgvTakeEmpty(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4586,6 +5317,9 @@
* 灏忚溅鏀剧┖鏉胯嚦杈撻�佺嚎浠诲姟 //鎷嗙洏
* */
public synchronized boolean rgvPutEmpty(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4611,6 +5345,9 @@
* 灏忚溅鍙栫┖鏉胯嚦宸ヤ綅浠诲姟 婊″彇
* */
public synchronized boolean rgvTakeEmptyFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4636,6 +5373,9 @@
* 灏忚溅鏀剧┖鏉胯嚦杈撻�佺嚎浠诲姟 //婊℃斁
* */
public synchronized boolean rgvPutEmptyFull(Integer rgvId,WrkMastSta wrkMastSta){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
RgvCommand rgvCommand = new RgvCommand();
@@ -4661,9 +5401,37 @@
* 灏忚溅澶嶄綅
* */
public synchronized boolean rgvComplete(Integer rgvId){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
try{
// 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(3, new RgvCommand()))) {
+ //step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔�
+ log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}",rgvId);
+ return false;
+ } else {
+ log.info("RGV鍛戒护涓嬪彂鎴愬姛锛孯GV鍙�={}",rgvId);
+ return true;
+ }
+ }catch (Exception e){
+ log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}銆傚紓甯革細"+e,rgvId);
+ return false;
+ }
+ }
+
+ /*
+ * 灏忚溅澶嶄綅
+ * */
+ public synchronized boolean rgvComplete(Integer rgvId,Short taskNo1){
+ if (rgvId>20){
+ rgvId = rgvId-20;
+ }
+ try{
+ RgvCommand rgvCommand = new RgvCommand();
+ rgvCommand.setTaskNo1(taskNo1);
+ // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+ if (!MessageQueue.offer(SlaveType.Rgv, rgvId, new Task(8, rgvCommand))) {
//step=2,宸ヤ綅1銆�2鍐欎换鍔★紱 step=4锛屽伐浣�1鍐欎换鍔★紱 step=5锛屽伐浣�2鍐欎换鍔�
log.error("RGV鍛戒护涓嬪彂澶辫触锛孯GV鍙�={}",rgvId);
return false;
@@ -4684,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{
@@ -4692,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