From 0de58f0aa2624a1c3745886b6ab9a9caaa4db3b4 Mon Sep 17 00:00:00 2001 From: tqs <546479841@QQ.COM> Date: 星期六, 04 二月 2023 21:17:13 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 335 +++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 227 insertions(+), 108 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 a462746..47c6be7 100644 --- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java @@ -21,6 +21,7 @@ import com.zy.common.service.CommonService; import com.zy.common.utils.CollectionUtils; import com.zy.common.utils.HttpHandler; +import com.zy.common.utils.News; import com.zy.core.CrnThread; import com.zy.core.DevpThread; import com.zy.core.cache.MessageQueue; @@ -94,7 +95,7 @@ * 缁勬墭 * 鍏ュ簱绔欙紝鏍规嵁鏉$爜鎵弿鐢熸垚鍏ュ簱宸ヤ綔妗o紝宸ヤ綔鐘舵�� 2 */ - public synchronized void generateStoreWrkFile() { + public synchronized void generateStoreWrkFile(Integer mark) { // 鏍规嵁杈撻�佺嚎plc閬嶅巻 for (DevpSlave devp : slaveProperties.getDevp()) { // 閬嶅巻鍏ュ簱鍙� @@ -123,25 +124,27 @@ // } // 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢 - if (staProtocol.isAutoing() && staProtocol.isLoading() - && staProtocol.isInEnable() + if (!staProtocol.isLoading()){ + continue; + } + if (staProtocol.isAutoing() && staProtocol.isInEnable() && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990) - && staProtocol.isPakMk()) {// && !Cools.isEmpty(barcode)) { - - try { - Thread.sleep(300); - }catch (Exception e){} + && staProtocol.isPakMk() && staProtocol.getStamp()>=2) {// && !Cools.isEmpty(barcode)) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�"); +// try { +// Thread.sleep(300); +// }catch (Exception e){} String barcode = barcodeThread.getBarcode(); if(!Cools.isEmpty(barcode)) { - log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode); + News.info(""+mark+" - 1"+" - {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode); if("NG".endsWith(barcode) || "NoRead".equals(barcode) || "empty".equals(barcode)) { staProtocol.setWorkNo((short) 9999); staProtocol.setStaNo(inSta.getBackSta().shortValue()); devpThread.setPakMk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); - log.info("鎵爜澶辫触1 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); + News.info(""+mark+" - 2"+" - 鎵爜澶辫触1 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); // led 寮傚父鏄剧ず if (ledThread != null) { String errorMsg = "鎵爜澶辫触锛岃閲嶈瘯"; @@ -155,7 +158,7 @@ devpThread.setPakMk(staProtocol.getSiteId(), false); MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); - log.info("鎵爜澶辫触2 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); + News.info(""+mark+" - 3"+" - 鎵爜澶辫触2 ===>> {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{},绔欑偣:{}", inSta.getBarcode(), barcode, inSta.getStaNo()); // led 寮傚父鏄剧ず if (ledThread != null) { String errorMsg = "鎵爜澶辫触锛岃閲嶈瘯"; @@ -174,7 +177,7 @@ } } if (wrkMast != null) { - log.error("宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo()); + News.error(""+mark+" - 4"+" - 宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo()); staProtocol.setWorkNo((short)9999); staProtocol.setStaNo(inSta.getBackSta().shortValue()); devpThread.setPakMk(staProtocol.getSiteId(), false); @@ -234,7 +237,7 @@ // ledThread.errorReset(); } } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); + News.error(""+mark+" - 5"+" - 璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); staProtocol.setWorkNo((short)9999); staProtocol.setStaNo(inSta.getBackSta().shortValue()); devpThread.setPakMk(staProtocol.getSiteId(), false); @@ -255,10 +258,15 @@ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } + }else { + News.errorNoLog(""+mark+" - 6"+" - 绔欑偣淇℃伅涓嶇鍚堝叆搴撴潯浠讹紒锛侊紒"+" 鑷姩淇″彿锛�"+staProtocol.isAutoing()+"銆佸彲鍏ヤ俊鍙凤細" + staProtocol.isInEnable() + +"銆佺┖鏉夸俊鍙凤細"+ staProtocol.isEmptyMk()+"銆佸伐浣滃彿锛�" + staProtocol.getWorkNo() + +"銆侀攣瀹氭爣璁�"+ staProtocol.isPakMk()+"銆佸叆搴撳嵃璁帮細" + staProtocol.getStamp()); } } } + News.infoNoLog(""+mark+" - 0"+" - 缁勬墭 ===銆嬫墽琛屽畬鎴�"); } @@ -266,7 +274,7 @@ * wms鍏ュ簱 * 鍏ュ簱绔欙紝鏍规嵁鏉$爜鎵弿鐢熸垚鍏ュ簱宸ヤ綔妗o紝宸ヤ綔鐘舵�� 1 ==>> 2 */ - public synchronized void generateStoreWrkFile0() { + public synchronized void generateStoreWrkFile0(Integer mark) { // 鏍规嵁杈撻�佺嚎plc閬嶅巻 for (DevpSlave devp : slaveProperties.getDevp()) { // 閬嶅巻鍏ュ簱鍙� @@ -286,9 +294,13 @@ } // 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢 - if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() + if (!staProtocol.isLoading()){ + continue; + } + if (staProtocol.isAutoing() && staProtocol.isInEnable() && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999) && staProtocol.isPakMk()) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�"); // 鍒ゆ柇閲嶅宸ヤ綔妗� WrkMast wrkMast = wrkMastMapper.selectPakInStep11(inSta.getStaNo()); if (wrkMast == null) { @@ -307,24 +319,27 @@ wrkMast.setWrkSts(2L); // 宸ヤ綔鐘舵�侊細2.璁惧涓婅蛋 wrkMast.setModiTime(new Date()); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("鏇存柊宸ヤ綔妗eけ璐ワ紒锛侊紒 [宸ヤ綔鍙凤細{}]", wrkMast.getWrkNo()); + News.error(""+mark+" - 1"+" - 鏇存柊宸ヤ綔妗eけ璐ワ紒锛侊紒 [宸ヤ綔鍙凤細{}]", wrkMast.getWrkNo()); } } else { - log.error("鍙戝竷鍛戒护鑷宠緭閫佺嚎闃熷垪澶辫触锛侊紒锛� [plc缂栧彿锛歿}]", devp.getId()); + News.error(""+mark+" - 2"+" - 鍙戝竷鍛戒护鑷宠緭閫佺嚎闃熷垪澶辫触锛侊紒锛� [plc缂栧彿锛歿}]", devp.getId()); } + }else { + News.errorNoLog(""+mark+" - 6"+" - 绔欑偣淇℃伅涓嶇鍚堝叆搴撴潯浠讹紒锛侊紒"+" 鑷姩淇″彿锛�"+staProtocol.isLoading()+"銆佸彲鍏ヤ俊鍙凤細" + staProtocol.isInEnable() + +"銆佺┖鏉夸俊鍙凤細"+ staProtocol.isEmptyMk()+"銆佸伐浣滃彿锛�" + staProtocol.getWorkNo() + +"銆侀攣瀹氭爣璁�"+ staProtocol.isPakMk()+"銆佸叆搴撳嵃璁帮細" + staProtocol.getStamp()); } - - } } + News.infoNoLog(""+mark+" - 0"+" - wms鍏ュ簱 ===銆嬫墽琛屽畬鎴�"); } /** * 鎷f枡銆佸苟鏉裤�佺洏鐐瑰啀鍏ュ簱 */ - public synchronized void stnToCrnStnPick() { + public synchronized void stnToCrnStnPick(Integer mark) { for (DevpSlave devp : slaveProperties.getDevp()) { // 閬嶅巻鎷f枡鍏ュ簱鍙� for (DevpSlave.Sta pickSta : devp.getPickSta()) { @@ -335,7 +350,7 @@ } String barcode = barcodeThread.getBarcode(); if(!Cools.isEmpty(barcode)) { - log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); + News.info(""+mark+" - 1"+" - {}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode); if("NG".endsWith(barcode) || "NoRead".equals(barcode)) { continue; } @@ -356,6 +371,7 @@ // if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; } if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�"); WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode); // WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue()); if (wrkMast == null) { @@ -383,7 +399,7 @@ .eq("crn_no", wrkMast.getCrnNo()); // 鍫嗗灈鏈哄彿 StaDesc staDesc = staDescService.selectOne(wrapper); if (Cools.isEmpty(staDesc)) { - log.error("鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); + News.error(""+mark+" - 2"+" - 鍏ュ簱璺緞涓嶅瓨鍦紒type_no={},stn_no={},crn_no={}", wrkMast.getIoType(), pickSta.getStaNo(), wrkMast.getCrnNo()); continue; } @@ -433,20 +449,25 @@ devpThread.setPakMk(staProtocol.getSiteId(), false); boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { - log.error("鍙戝竷鍛戒护鑷宠緭閫佺嚎闃熷垪澶辫触锛侊紒锛� [plc缂栧彿锛歿}]", devp.getId()); + News.error(""+mark+" - 3"+" - 鍙戝竷鍛戒护鑷宠緭閫佺嚎闃熷垪澶辫触锛侊紒锛� [plc缂栧彿锛歿}]", devp.getId()); } + }else { + News.errorNoLog(""+mark+" - 6"+" - 绔欑偣淇℃伅涓嶇鍚堝叆搴撴潯浠讹紒锛侊紒"+" 鑷姩淇″彿锛�"+staProtocol.isLoading()+"銆佸彲鍏ヤ俊鍙凤細" + staProtocol.isInEnable() + +"銆佺┖鏉夸俊鍙凤細"+ staProtocol.isEmptyMk()); } } } + News.infoNoLog(""+mark+" - 0"+" - 鎷f枡銆佸苟鏉裤�佺洏鐐瑰啀鍏ュ簱 ===銆嬫墽琛屽畬鎴�"); } /** * 鍫嗗灈鏈虹珯鍑哄簱鍒板嚭搴撶珯 */ - public synchronized void crnStnToOutStn() { + public synchronized void crnStnToOutStn(Integer mark) { + for (CrnSlave crnSlave : slaveProperties.getCrn()) { // 閬嶅巻鍫嗗灈鏈哄嚭搴撶珯 for (CrnSlave.CrnStn crnStn : crnSlave.getCrnOutStn()) { @@ -479,6 +500,7 @@ if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue()) && crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.forkPosType == CrnForkPosType.HOME) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�"); // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- @@ -496,20 +518,28 @@ // 澶嶄綅鍫嗗灈鏈� crnThread.setResetFlag(true); } else { - log.error("鏇存柊宸ヤ綔妗g殑宸ヤ綔鐘舵�佷负14澶辫触锛侊紒锛� [宸ヤ綔鍙�:{}]", wrkMast.getWrkNo()); + News.error(""+mark+" - 1"+" - 鏇存柊宸ヤ綔妗g殑宸ヤ綔鐘舵�佷负14澶辫触锛侊紒锛� [宸ヤ綔鍙�:{}]", wrkMast.getWrkNo()); } + }else { + News.errorNoLog(""+mark+" - 6"+" - 鍫嗗灈鏈轰俊鎭笉绗﹀悎鍏ュ簱鏉′欢锛侊紒锛�" + +" 鍫嗗灈鏈虹姸鎬侊細"+crnProtocol.modeType+"==鑷姩AUTO锛�" + CrnModeType.AUTO + +"銆佸爢鍨涙満浠诲姟鍙凤細"+crnProtocol.getTaskNo()+"==宸ヤ綔妗d换鍔″彿锛�" + wrkMast.getWrkNo().shortValue() + +"銆佺姸鎬佹灇涓撅細"+crnProtocol.statusType+"==WAITING锛�90 //浠诲姟瀹屾垚绛夊緟WCS纭)锛�" + CrnStatusType.WAITING + +"銆佽揣鍙変綅缃細"+crnProtocol.forkPosType+"==HOME锛�0 // 璐у弶鍘熶綅锛�" + CrnForkPosType.HOME); } } } } + News.infoNoLog(""+mark+" - 0"+" - 鍫嗗灈鏈虹珯鍑哄簱鍒板嚭搴撶珯 ===銆嬫墽琛屽畬鎴�"); } /** * 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂 */ - public synchronized void crnIoExecute() { + public synchronized void crnIoExecute(Integer mark) { + for (CrnSlave crn : slaveProperties.getCrn()) { // 鑾峰彇鍫嗗灈鏈轰俊鎭� CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); @@ -519,7 +549,7 @@ } BasCrnp basCrnp = basCrnpService.selectById(crn.getId()); if (basCrnp == null) { - log.error("{}鍙峰爢鍨涙満灏氭湭鍦ㄦ暟鎹簱杩涜缁存姢锛�", crn.getId()); + News.error(""+mark+" - 1"+" - {}鍙峰爢鍨涙満灏氭湭鍦ㄦ暟鎹簱杩涜缁存姢锛�", crn.getId()); continue; } @@ -531,32 +561,37 @@ // 鍙湁褰撳爢鍨涙満绌洪棽 骞朵笖 鏃犱换鍔℃椂鎵嶇户缁墽琛� if (crnProtocol.getStatusType() == CrnStatusType.IDLE && crnProtocol.getTaskNo() == 0 && crnProtocol.getModeType() == CrnModeType.AUTO && crnProtocol.getLoaded() == 0 && crnProtocol.getForkPos() == 0) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛屽爢鍨涙満鍏ュ嚭搴撲綔涓氫笅鍙�"); // 濡傛灉鏈�杩戜竴娆℃槸鍏ュ簱妯″紡 if (crnProtocol.getLastIo().equals("I")) { if (basCrnp.getInEnable().equals("Y")) { - this.crnStnToLoc(crn, crnProtocol); // 鍏ュ簱 + //mark - 1 - .... + this.crnStnToLoc(crn, crnProtocol,mark); // 鍏ュ簱 crnProtocol.setLastIo("O"); } else if (basCrnp.getOutEnable().equals("Y")) { - this.locToCrnStn(crn, crnProtocol); // 鍑哄簱 + //mark - 2 - .... + this.locToCrnStn(crn, crnProtocol,mark); // 鍑哄簱 crnProtocol.setLastIo("I"); } } // 濡傛灉鏈�杩戜竴娆℃槸鍑哄簱妯″紡 else if (crnProtocol.getLastIo().equals("O")) { if (basCrnp.getOutEnable().equals("Y")) { - this.locToCrnStn(crn, crnProtocol); // 鍑哄簱 + this.locToCrnStn(crn, crnProtocol,mark); // 鍑哄簱 crnProtocol.setLastIo("I"); } else if (basCrnp.getInEnable().equals("Y")) { - this.crnStnToLoc(crn, crnProtocol); // 鍏ュ簱 + this.crnStnToLoc(crn, crnProtocol,mark); // 鍏ュ簱 crnProtocol.setLastIo("O"); } } } // 搴撲綅绉昏浆 - this.locToLoc(crn, crnProtocol); + //mark - 3 - .... + this.locToLoc(crn, crnProtocol,mark); // this.crnRebackHp(crnProtocol, crnThread); } + News.infoNoLog(""+mark+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂鎵ц瀹屾垚"); } /** @@ -594,7 +629,7 @@ if (wrkMastMapper.selectDevWorking(crnProtocol.getCrnNo()) == null) { return; } - log.info("鍫嗗灈鏈哄彫鍥炲師鐐�==>>" + crnProtocol.getCrnNo() + "鍙峰爢鍨涙満鏈夊叆搴撲换鍔�,鍙洖鍘熺偣"); + News.info("鍫嗗灈鏈哄彫鍥炲師鐐�==>>" + crnProtocol.getCrnNo() + "鍙峰爢鍨涙満鏈夊叆搴撲换鍔�,鍙洖鍘熺偣"); // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- CrnCommand crnCommand = new CrnCommand(); crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 鍫嗗灈鏈虹紪鍙� @@ -608,7 +643,7 @@ crnCommand.setDestinationPosY((short) 0); // 鐩爣搴撲綅鍒� crnCommand.setDestinationPosZ((short) 0); // 鐩爣搴撲綅灞� if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, crnCommand))) { - log.error("鍫嗗灈鏈哄洖鍘熺偣鍛戒护涓嬪彂澶辫触锛屽爢鍨涙満鍙�={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); + News.error("鍫嗗灈鏈哄洖鍘熺偣鍛戒护涓嬪彂澶辫触锛屽爢鍨涙満鍙�={}锛屼换鍔℃暟鎹�={}", crnProtocol.getCrnNo(), JSON.toJSON(crnCommand)); } crnThread.setBackHpFlag(true); } @@ -618,13 +653,15 @@ /** * 鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鍒板簱浣� */ - public synchronized void crnStnToLoc(CrnSlave slave, CrnProtocol crnProtocol) { + public synchronized void crnStnToLoc(CrnSlave slave, CrnProtocol crnProtocol,Integer mark) { + News.warnNoLog(""+mark+" - 1"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氭墽琛屽叆搴�"); for (CrnSlave.CrnStn crnStn : slave.getCrnInStn()) { boolean flag = false; // 鑾峰彇鍫嗗灈鏈哄叆搴撶珯淇℃伅 DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId()); StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()); if (staProtocol == null) { + News.infoNoLog(""+mark+" - 1"+" - 1"+" - 鍫嗗灈鏈哄叆搴撶珯淇℃伅(staProtocol!=null缁х画鎵ц)锛歴taProtocol="+staProtocol); continue; } else { staProtocol = staProtocol.clone(); @@ -632,7 +669,7 @@ // 鏌ヨ绔欑偣璇︾粏淇℃伅 BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); if (staDetl == null) { - log.error("鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo()); + News.error(""+mark+" - 1"+" - 2"+" - 鍏ュ簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo()); continue; } if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.getWorkNo() > 0 && staProtocol.isInEnable() @@ -640,27 +677,33 @@ flag = true; } if (!flag) { + News.errorNoLog(""+mark+" - 1"+" - 3"+" - 鍫嗗灈鏈哄叆搴撶珯淇℃伅(浠ヤ笅闇�瑕佸叏true):" + +"鑷姩淇″彿"+staProtocol.isAutoing()+"鏈夌墿淇″彿"+staProtocol.isLoading() + +"宸ヤ綔鍙�>0"+staProtocol.getWorkNo()+"鍙叆淇″彿"+staProtocol.isInEnable() + +"鑳藉叆淇″彿锛坵ms璁剧疆锛�.equals(\"Y\")"+staDetl.getCanining()); continue; } // 鑾峰彇宸ヤ綔鐘舵�佷负2锛堣澶囦笂璧帮級鐨勫叆搴撳伐浣滄。 WrkMast wrkMast = wrkMastMapper.selectPakInStep2(slave.getId(), staProtocol.getWorkNo().intValue(), crnStn.getStaNo()); if (null == wrkMast) { + News.infoNoLog(""+mark+" - 1"+" - 4"+" - 鏌ヨ鏃犲緟鍏ュ簱鏁版嵁--wrk_sts=2, 宸ヤ綔鍙�={}", staProtocol.getWorkNo()); // log.error("鏌ヨ鏃犲緟鍏ュ簱鏁版嵁--wrk_sts=2, 宸ヤ綔鍙�={}", staProtocol.getWorkNo()); continue; } // 鑾峰彇搴撲綅淇℃伅 LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); if (locMast == null) { - log.error("鏌ヨ搴撳瓨鏃犳暟鎹�--搴撲綅鍙穥}", wrkMast.getLocNo()); + News.error(""+mark+" - 1"+" - 5"+" - 鏌ヨ搴撳瓨鏃犳暟鎹�--搴撲綅鍙穥}", wrkMast.getLocNo()); continue; } if (!locMast.getLocSts().equals("S") && !locMast.getLocSts().equals("Q")) { - log.error("鍏ュ簱鎿嶄綔搴撲綅鐘舵�佷笉绗﹀悎--鐘舵��, 搴撲綅鍙�={}锛屽簱浣嶇姸鎬�={}", wrkMast.getLocNo(), locMast.getLocSts()); + News.error(""+mark+" - 1"+" - 6"+" - 鍏ュ簱鎿嶄綔搴撲綅鐘舵�佷笉绗﹀悎--鐘舵��, 搴撲綅鍙�={}锛屽簱浣嶇姸鎬�={}", wrkMast.getLocNo(), locMast.getLocSts()); continue; } // 鍫嗗灈鏈烘帶鍒惰繃婊� if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { +// News.infoNoLog(""+mark+" - 1"+" - 7"+" - 鍫嗗灈鏈烘帶鍒惰繃婊�:鍫嗗灈鏈烘槸鍚︾┖闂�={}锛屼换鍔″彿={}", crnProtocol.getStatusType(),crnProtocol.getTaskNo()); continue; } @@ -671,41 +714,49 @@ // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� if (Utils.isDeepLoc(slaveProperties, wrkMast.getLocNo())) { + News.warnNoLog(""+mark+" - 1"+" - 8"+" - 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� : 寮�濮嬫墽琛� 浠诲姟鍙�={}",wrkMast.getWrkNo()); String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getLocNo()); LocMast shallowLoc = locMastService.selectById(shallowLocNo); // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒 if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { + News.warnNoLog(""+mark+" - 1"+" - 9"+" - // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒搴撲綅鐘舵��={}",shallowLoc.getLocSts()); WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); if (null == waitWrkMast) { - log.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo); + News.error(""+mark+" - 1"+" - 10"+" - {}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo); } else { waitWrkMast.setIoPri(15D); waitWrkMast.setModiTime(new Date()); if (wrkMastMapper.updateById(waitWrkMast) == 0) { - log.error("璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo()); + News.error(""+mark+" - 1"+" - 11"+" - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo()); } continue; } } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { + News.warnNoLog(""+mark+" - 1"+" - 12"+" - // F銆丏 搴撲綅鐘舵��={}",shallowLoc.getLocSts()); // 姝ゆ爣璁伴伩鍏嶅娆℃墽琛岀Щ搴撲换鍔� if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())) { wrkMast.setUpdMk("Y"); wrkMast.setIoPri(14D); wrkMastMapper.updateById(wrkMast); // 鐢熸垚宸ヤ綔妗�,灏嗘祬搴撲綅绉昏浆鍒版柊鐨勫簱浣嶄腑 - moveLocForDeepLoc(slave, shallowLoc); + moveLocForDeepLoc(slave, shallowLoc,mark); // 鐢熸垚宸ヤ綔妗c�佹敼鍙樻祬搴撲綅鐨勬簮搴�/鐩爣搴� 搴撲綅鐘舵�併�佷笅鍙戝爢鍨涙満鍛戒护锛堢珛椹墽琛�) // moveLocForDeepLocPakin(slave, shallowLoc, wrkMast); } continue; } else if (shallowLoc.getLocSts().equals("Q")) { + News.warnNoLog(""+mark+" - 1"+" - 13"+" - // Q 搴撲綅鐘舵��={}",shallowLoc.getLocSts()); WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { + News.infoNoLog(""+mark+" - 1"+" - 14"+" - // F銆丏 宸ヤ綔鐘舵��(鍒ゆ柇鏉′欢涓�==4)={}",waitWrkMast.getWrkSts()); continue; } } } + News.warnNoLog(""+mark+" - 1"+" - 15"+" - 鍛戒护涓嬪彂 : 宸ヤ綔鍙�={},婧愭帓={},婧愬垪={},婧愬眰={},鐩爣鎺�={},鐩爣鍒�={},鐩爣灞�={}",wrkMast.getWrkNo().shortValue() + ,crnStn.getRow().shortValue(),crnStn.getBay().shortValue(),crnStn.getLev().shortValue() + ,locMast.getRow1().shortValue(),locMast.getBay1().shortValue(),locMast.getLev1().shortValue()); // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- CrnCommand crnCommand = new CrnCommand(); @@ -720,7 +771,7 @@ crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 鐩爣搴撲綅鍒� crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 鐩爣搴撲綅灞� if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { - log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); + News.error(""+mark+" - 1"+" - 16"+" - 鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); } else { // long startTime = System.currentTimeMillis(); @@ -741,17 +792,19 @@ wrkMast.setCrnStrTime(now); wrkMast.setModiTime(now); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); + News.error(""+mark+" - 1"+" - 17"+" - 淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } } } + News.infoNoLog(""+mark+" - 1"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂 锛� 鍏ュ簱鎵ц瀹屾瘯"); } /** * 鍑哄簱 ===>> 搴撲綅鍒板爢鍨涙満绔� * 2022-06-09 TQS淇敼锛屾煡璇㈠伐浣滄。LIST锛岄亶鍘嗕笅鍙戯紝闃叉绗竴涓换鍔″牭濉炲嚭搴� */ - public synchronized void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol) { + public synchronized void locToCrnStn(CrnSlave slave, CrnProtocol crnProtocol,Integer mark) { + News.warnNoLog(""+mark+" - 2"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氭墽琛屽嚭搴�"); for (CrnSlave.CrnStn crnStn : slave.getCrnOutStn()) { // 鑾峰彇宸ヤ綔鐘舵�佷负11锛堢敓鎴愬嚭搴揑D锛夌殑鍑哄簱宸ヤ綔妗� // WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo()); @@ -762,19 +815,20 @@ } // 宸ヤ綔妗g姸鎬佸垽鏂� if (wrkMast.getIoType() < 100 || wrkMast.getSourceStaNo() == null) { - log.error("鏌ヨ宸ヤ綔妗f暟鎹笉绗﹀悎鏉′欢--鍏ュ嚭绫诲瀷/绔欑偣, 宸ヤ綔鍙�={}锛屾簮搴撲綅={}锛屽叆鍑虹被鍨�={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType()); + News.error(""+mark+" - 2"+" - 1"+" - 鏌ヨ宸ヤ綔妗f暟鎹笉绗﹀悎鏉′欢--鍏ュ嚭绫诲瀷/绔欑偣, 宸ヤ綔鍙�={}锛屾簮搴撲綅={}锛屽叆鍑虹被鍨�={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo(), wrkMast.getIoType()); continue; } // 鑾峰彇婧愬簱浣嶄俊鎭� LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); if (!sourceSta.getLocSts().equals("R") && !sourceSta.getLocSts().equals("P")) { - log.error("鍑哄簱鎿嶄綔搴撲綅鐘舵�佷笉绗﹀悎--鐘舵��, 搴撲綅鍙�={}锛屽簱浣嶇姸鎬�={}", wrkMast.getLocNo(), sourceSta.getLocSts()); + News.error(""+mark+" - 2"+" - 2"+" - 鍑哄簱鎿嶄綔搴撲綅鐘舵�佷笉绗﹀悎--鐘舵��, 搴撲綅鍙�={}锛屽簱浣嶇姸鎬�={}", wrkMast.getLocNo(), sourceSta.getLocSts()); continue; } // 鑾峰彇鍫嗗灈鏈哄嚭搴撶珯淇℃伅 SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId()); StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo()); if (staProtocol == null) { + News.infoNoLog(""+mark+" - 2"+" - 3"+" - 鍫嗗灈鏈哄嚭搴撶珯淇℃伅(staProtocol!=null缁х画鎵ц,鍚﹀垯寰幆缁堟)锛歴taProtocol="+staProtocol); break; // continue; } else { @@ -783,14 +837,15 @@ // // 鍏ュ嚭搴撴ā寮忓垽鏂� // if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; } - if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { - continue; - } +// if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) { +// News.infoNoLog(""+mark+" - 2"+" - 4"+" - 鍏ュ嚭搴撴ā寮忥紙姝ゅ鍑哄簱鏂规硶锛屽嚭搴撴ā寮忕户缁�=="+devpThread.ioModeOf2F); +// continue; +// } // 鏌ヨ绔欑偣璇︾粏淇℃伅 BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo()); if (staDetl == null) { - log.error("鍑哄簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo()); + News.error(""+mark+" - 2"+" - 5"+" - 鍑哄簱 ===>> 鍫嗗灈鏈虹珯鐐瑰湪鏁版嵁搴撲笉瀛樺湪, 绔欑偣缂栧彿={}", crnStn.getStaNo()); break; // continue; } @@ -807,19 +862,21 @@ // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� if (Utils.isDeepLoc(slaveProperties, wrkMast.getSourceLocNo())) { + News.warnNoLog(""+mark+" - 2"+" - 6"+" - 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞� : 寮�濮嬫墽琛� 浠诲姟鍙�={}",wrkMast.getWrkNo()); String shallowLocNo = Utils.getShallowLoc(slaveProperties, wrkMast.getSourceLocNo()); LocMast shallowLoc = locMastService.selectById(shallowLocNo); // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒 if (shallowLoc.getLocSts().equals("P") || shallowLoc.getLocSts().equals("R")) { + News.warnNoLog(""+mark+" - 2"+" - 7"+" - // O.绌哄簱浣嶃�丵.鎷f枡/鐩樼偣/骞舵澘鍐嶅叆搴撱�丼.鍏ュ簱棰勭害銆乆.绂佺敤 鐩存帴鎼紒搴撲綅鐘舵��={}",shallowLoc.getLocSts()); WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); if (null == waitWrkMast) { - log.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo); + News.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo); } else { if (waitWrkMast.getWrkSts() == 11) { waitWrkMast.setIoPri(15D); waitWrkMast.setModiTime(new Date()); if (wrkMastMapper.updateById(waitWrkMast) == 0) { - log.error("璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo()); + News.error(""+mark+" - 2"+" - 8"+" - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo()); } continue; } else { @@ -827,6 +884,7 @@ } } } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) { + News.warnNoLog(""+mark+" - 2"+" - 9"+" - // F銆丏 搴撲綅鐘舵��={}",shallowLoc.getLocSts()); // WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo); //2022-08-16 modify,涓嶆牴鎹畊pdmk鏍囪绉诲簱浠诲姟(瀹规槗琚彇娑堝鑷村牭濉�)锛屾煡璇㈠伐浣滄。鏄惁瀛樺湪浠诲姟 WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); @@ -837,13 +895,15 @@ wrkMast.setUpdMk("Y"); wrkMastMapper.updateById(wrkMast); // 鐢熸垚宸ヤ綔妗�,灏嗘祬搴撲綅绉昏浆鍒版柊鐨勫簱浣嶄腑 - moveLocForDeepLoc(slave, shallowLoc); + moveLocForDeepLoc(slave, shallowLoc,mark); } - log.error("{}浠诲姟鍑哄簱澶辫触锛屾祬搴撲綅鍫靛锛佹祬搴撲綅鍙�:{}", wrkMast.getWrkNo(), shallowLocNo); + News.error("{}浠诲姟鍑哄簱澶辫触锛屾祬搴撲綅鍫靛锛佹祬搴撲綅鍙�:{}", wrkMast.getWrkNo(), shallowLocNo); continue; } else if (shallowLoc.getLocSts().equals("Q") || shallowLoc.getLocSts().equals("S")) { + News.warnNoLog(""+mark+" - 2"+" - 10"+" - // Q銆丼 搴撲綅鐘舵��={}",shallowLoc.getLocSts()); WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo); if (null != waitWrkMast && waitWrkMast.getWrkSts() == 4) { + News.infoNoLog(""+mark+" - 2"+" - 11"+" - // F銆丏 宸ヤ綔鐘舵��(鍒ゆ柇鏉′欢涓�==4)={}",waitWrkMast.getWrkSts()); continue; } } @@ -854,6 +914,10 @@ break; // return; } + + News.warnNoLog(""+mark+" - 2"+" - 12"+" - 鍛戒护涓嬪彂 : 宸ヤ綔鍙�={},婧愭帓={},婧愬垪={},婧愬眰={},鐩爣鎺�={},鐩爣鍒�={},鐩爣灞�={}",wrkMast.getWrkNo().shortValue() + ,sourceSta.getRow1().shortValue(),sourceSta.getBay1().shortValue(),sourceSta.getLev1().shortValue() + ,crnStn.getRow().shortValue(),crnStn.getBay().shortValue(),crnStn.getLev().shortValue()); // 1.鍫嗗灈鏈哄紑濮嬬Щ鍔� CrnCommand crnCommand = new CrnCommand(); @@ -868,7 +932,7 @@ crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 鐩爣搴撲綅鍒� crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 鐩爣搴撲綅灞� if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { - log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); + News.error(""+mark+" - 2"+" - 13"+" - 鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); } else { // 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� Date now = new Date(); @@ -876,13 +940,14 @@ wrkMast.setCrnStrTime(now); wrkMast.setModiTime(now); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); + News.error(""+mark+" - 2"+" - 14"+" - 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } break; } } } } + News.infoNoLog(""+mark+" - 2"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂 锛� 鍑哄簱鎵ц瀹屾瘯"); } // /** @@ -1005,16 +1070,17 @@ /** * 搴撲綅绉昏浆 */ - public synchronized void locToLoc(CrnSlave slave, CrnProtocol crnProtocol) { + public synchronized void locToLoc(CrnSlave slave, CrnProtocol crnProtocol,Integer mark) { // 鑾峰彇宸ヤ綔妗d俊鎭� WrkMast wrkMast = wrkMastMapper.selectLocMove(slave.getId()); if (null == wrkMast) { return; } + News.warnNoLog(""+mark+" - 3"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氭墽琛屽簱浣嶇Щ杞�"); // 鑾峰彇婧愬簱浣嶄俊鎭� LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); if (null == sourceSta) { - log.error("宸ヤ綔妗e簱浣嶇Щ杞け璐ワ紝鍘熷洜锛氭绱㈡簮搴撲綅澶辫触锛佸伐浣滃彿={}锛屾簮搴撲綅={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); + News.error(""+mark+" - 3"+" - 1"+" - 宸ヤ綔妗e簱浣嶇Щ杞け璐ワ紝鍘熷洜锛氭绱㈡簮搴撲綅澶辫触锛佸伐浣滃彿={}锛屾簮搴撲綅={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); return; } // 婧愬簱浣� 搴撲綅鐘舵�佸垽鏂� @@ -1024,7 +1090,7 @@ // 鑾峰彇鐩爣搴撲綅淇℃伅 LocMast sta = locMastService.selectById(wrkMast.getLocNo()); if (null == sta) { - log.error("宸ヤ綔妗e簱浣嶇Щ杞け璐ワ紝鍘熷洜锛氭绱㈢洰鏍囧簱浣嶅け璐ワ紒宸ヤ綔鍙�={}锛屾簮搴撲綅={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); + News.error(""+mark+" - 3"+" - 2"+" - 宸ヤ綔妗e簱浣嶇Щ杞け璐ワ紝鍘熷洜锛氭绱㈢洰鏍囧簱浣嶅け璐ワ紒宸ヤ綔鍙�={}锛屾簮搴撲綅={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); return; } // 鑾峰彇鍫嗗灈鏈轰俊鎭� 骞� 鍒ゆ柇鏄惁鍙叆鍑� @@ -1043,6 +1109,10 @@ return; } + News.warnNoLog(""+mark+" - 3"+" - 3"+" - 鍛戒护涓嬪彂 : 宸ヤ綔鍙�={},婧愭帓={},婧愬垪={},婧愬眰={},鐩爣鎺�={},鐩爣鍒�={},鐩爣灞�={}",wrkMast.getWrkNo().shortValue() + ,sourceSta.getRow1().shortValue(),sourceSta.getBay1().shortValue(),sourceSta.getLev1().shortValue() + ,sta.getRow1().shortValue(),sta.getBay1().shortValue(),sta.getLev1().shortValue()); + // 鍛戒护涓嬪彂鍖� -------------------------------------------------------------------------- CrnCommand crnCommand = new CrnCommand(); crnCommand.setCrnNo(slave.getId()); // 鍫嗗灈鏈虹紪鍙� @@ -1056,7 +1126,7 @@ crnCommand.setDestinationPosY(sta.getBay1().shortValue()); // 鐩爣搴撲綅鍒� crnCommand.setDestinationPosZ(sta.getLev1().shortValue()); // 鐩爣搴撲綅灞� if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { - log.error("鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); + News.error(""+mark+" - 3"+" - 4"+" - 鍫嗗灈鏈哄懡浠や笅鍙戝け璐ワ紝鍫嗗灈鏈哄彿={}锛屼换鍔℃暟鎹�={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); } else { // 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� Date now = new Date(); @@ -1064,16 +1134,18 @@ wrkMast.setCrnStrTime(now); wrkMast.setModiTime(now); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("銆愬簱浣嶇Щ杞�� 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); + News.error(""+mark+" - 3"+" - 5"+" - 銆愬簱浣嶇Щ杞�� 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } } + News.infoNoLog(""+mark+" - 3"+" - 0"+" - 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂锛氬簱浣嶇Щ杞畬鎴�"); } /** * 鎵ц瀵瑰伐浣滄。鐨勫畬鎴愭搷浣� */ - public synchronized void storeFinished() { + public synchronized void storeFinished(Integer mark) { + for (CrnSlave crn : slaveProperties.getCrn()) { // 鑾峰彇鍫嗗灈鏈轰俊鎭� CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); @@ -1083,6 +1155,7 @@ } // 鐘舵�侊細绛夊緟纭 骞朵笖 浠诲姟瀹屾垚浣� = 1 if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛屽宸ヤ綔妗g殑瀹屾垚鎿嶄綔"); if (crnProtocol.getTaskNo() == 9999) { // 鍫嗗灈鏈哄浣� crnThread.setResetFlag(true); @@ -1090,7 +1163,7 @@ // 鑾峰彇鍏ュ簱寰呯‘璁ゅ伐浣滄。 WrkMast wrkMast = wrkMastMapper.selectPakInStep3(crnProtocol.getTaskNo().intValue()); if (wrkMast == null) { - log.error("鍫嗗灈鏈哄浜庣瓑寰呯‘璁や笖浠诲姟瀹屾垚鐘舵�侊紝浣嗘湭鎵惧埌宸ヤ綔妗c�傚爢鍨涙満鍙�={}锛屽伐浣滃彿={}", crn.getId(), crnProtocol.getTaskNo()); + News.error(""+mark+" - 1"+" - 鍫嗗灈鏈哄浜庣瓑寰呯‘璁や笖浠诲姟瀹屾垚鐘舵�侊紝浣嗘湭鎵惧埌宸ヤ綔妗c�傚爢鍨涙満鍙�={}锛屽伐浣滃彿={}", crn.getId(), crnProtocol.getTaskNo()); continue; } // 鍏ュ簱 + 搴撲綅杞Щ ==> 4.鍏ュ簱瀹屾垚 @@ -1105,18 +1178,20 @@ // 淇敼鎴愬姛鍚庡浣嶅爢鍨涙満 if (wrkMastMapper.updateById(wrkMast) > 0) { // 鍫嗗灈鏈哄浣� + News.warnNoLog(""+mark+" - 2"+" - 淇敼鎴愬姛鍚庡浣嶅爢鍨涙満 : 鍫嗗灈鏈哄彿={}",crnThread.getCrnProtocol().getCrnNo()); crnThread.setResetFlag(true); } } } } + News.infoNoLog(""+mark+" - 0"+" - 瀵瑰伐浣滄。鐨勫畬鎴愭搷浣滄墽琛屽畬鎴�"); } /** * 鍫嗗灈鏈哄紓甯镐俊鎭褰� */ - public synchronized void recCrnErr() { + public synchronized void recCrnErr(Integer mark) { Date now = new Date(); for (CrnSlave crn : slaveProperties.getCrn()) { // 鑾峰彇鍫嗗灈鏈轰俊鎭� @@ -1129,9 +1204,11 @@ // if (crnProtocol.getModeType() != CrnModeType.STOP) { // 鏈変换鍔� if (crnProtocol.getTaskNo() != 0) { + BasErrLog latest = basErrLogService.findLatestByTaskNo(crn.getId(), crnProtocol.getTaskNo().intValue()); // 鏈夊紓甯� if (latest == null) { + News.warnNoLog(""+mark+" - 1"+" - 寮�濮嬫墽琛岋細鍫嗗灈鏈哄紓甯镐俊鎭褰� 锛� 鏈変换鍔★紝鏈夊紓甯�"); if (crnProtocol.getAlarm() != null && crnProtocol.getAlarm() > 0) { WrkMast wrkMast = wrkMastMapper.selectById(crnProtocol.getTaskNo()); if (wrkMast == null) { @@ -1163,7 +1240,7 @@ "浠诲姟涓紓甯�" // 澶囨敞 ); if (!basErrLogService.insert(basErrLog)) { - log.error("鍫嗗灈鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", crn.getId(), errName); + News.error(""+mark+" - 2"+" - 鍫嗗灈鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", crn.getId(), errName); } } } else { @@ -1173,7 +1250,7 @@ latest.setUpdateTime(now); latest.setStatus(2); if (!basErrLogService.updateById(latest)) { - log.error("鍫嗗灈鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", crn.getId(), latest.getId()); + News.error(""+mark+" - 3"+" - 鍫嗗灈鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", crn.getId(), latest.getId()); } } } @@ -1182,6 +1259,7 @@ BasErrLog latest = basErrLogService.findLatest(crn.getId()); // 鏈夊紓甯� if (crnProtocol.getAlarm() != null && crnProtocol.getAlarm() > 0) { + News.warnNoLog(""+mark+" - 4"+" - 寮�濮嬫墽琛岋細鍫嗗灈鏈哄紓甯镐俊鎭褰� 锛� 鏃犱换鍔★紝鏈夊紓甯�"); // 璁板綍鏂板紓甯� if (latest == null || (latest.getErrCode() != crnProtocol.getAlarm().intValue())) { BasCrnError crnError = basCrnErrorMapper.selectById(crnProtocol.getAlarm()); @@ -1210,7 +1288,7 @@ "鏃犱换鍔″紓甯�" // 澶囨敞 ); if (!basErrLogService.insert(basErrLog)) { - log.error("鍫嗗灈鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", crn.getId(), errName); + News.error(""+mark+" - 5"+" - 鍫嗗灈鏈簆lc寮傚父璁板綍澶辫触 ===>> [id:{}] [error:{}]", crn.getId(), errName); } } // 鏃犲紓甯� @@ -1221,7 +1299,7 @@ latest.setUpdateTime(now); latest.setStatus(2); if (!basErrLogService.updateById(latest)) { - log.error("鍫嗗灈鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", crn.getId(), latest.getId()); + News.error(""+mark+" - 6"+" - 鍫嗗灈鏈簆lc寮傚父璁板綍淇澶辫触 ===>> [id:{}] [errLogId:{}]", crn.getId(), latest.getId()); } } } @@ -1229,6 +1307,7 @@ } } + News.infoNoLog(""+mark+" - 0"+" - 鍫嗗灈鏈哄紓甯镐俊鎭褰曟墽琛屽畬鎴�"); } @@ -1237,7 +1316,8 @@ /** * 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐� */ - public synchronized void storeEmptyPlt() { + public synchronized void storeEmptyPlt(Integer mark) { + for (DevpSlave devp : slaveProperties.getDevp()) { // 閬嶅巻绌烘澘鍏ュ簱鍙� for (DevpSlave.Sta emptyInSta : devp.getEmptyInSta()) { @@ -1255,13 +1335,17 @@ ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, emptyInSta.getLed()); } + if (!staProtocol.isLoading()){ + continue; + } + // 绔欑偣鏉′欢鍒ゆ柇 if (staProtocol.isAutoing() - && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) { + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛岋細绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐�"); try { LocTypeDto locTypeDto = new LocTypeDto(staProtocol); @@ -1286,6 +1370,7 @@ devpThread.setPakMk(staProtocol.getSiteId(), false); boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { + News.errorNoLog(""+mark+" - 1"+" - 鏇存柊plc绔欑偣淇℃伅澶辫触"); throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触"); } @@ -1309,6 +1394,7 @@ devpThread.setPakMk(staProtocol.getSiteId(), false); boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); if (!result) { + News.errorNoLog(""+mark+" - 2"+" - 鏇存柊plc绔欑偣淇℃伅澶辫触"); throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触"); } @@ -1318,23 +1404,28 @@ MessageQueue.offer(SlaveType.Led, emptyInSta.getLed(), new Task(5, errorMsg)); } } - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); + News.error(""+mark+" - 3"+" - 璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/pakin/loc/v1", JSON.toJSONString(param), response); } } catch (Exception e) { e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } + } else { + News.errorNoLog(""+mark+" - 4"+" - 绔欑偣淇℃伅涓嶇鍚堝叆搴撴潯浠讹紒锛侊紒"+" 鑷姩淇″彿锛�"+staProtocol.isAutoing()+"銆佸彲鍏ヤ俊鍙凤細" + staProtocol.isInEnable() + +"銆佺┖鏉夸俊鍙凤細"+ staProtocol.isEmptyMk()+"銆佸伐浣滃彿锛�" + staProtocol.getWorkNo() + +"銆侀攣瀹氭爣璁�"+ staProtocol.isPakMk()); } - } } + News.infoNoLog(""+mark+" - 0"+" - 绌烘爤鏉垮垵濮嬪寲鍏ュ簱,鍙夎溅鍏ュ簱绔欐斁璐ф墽琛屽畬鎴�"); } /** * 鍑哄簱 ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣� */ - public synchronized void ledExecute() { + public synchronized void ledExecute(Integer mark) { + for (LedSlave led : slaveProperties.getLed()) { // 鑾峰彇杈撻�佺嚎plc绾跨▼ DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); @@ -1356,6 +1447,7 @@ if (null == wrkMast) { continue; } + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�:鍑哄簱 ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣�"); wrkMasts.add(wrkMast); // 缁勮鍛戒护 LedCommand ledCommand = new LedCommand(); @@ -1386,7 +1478,7 @@ ledCommand.setEmptyMk(true); break; default: - log.error("浠诲姟鍏ュ嚭搴撶被鍨嬮敊璇紒锛侊紒[宸ヤ綔鍙凤細{}] [鍏ュ嚭搴撶被鍨嬶細{}]", wrkMast.getWrkNo(), wrkMast.getIoType()); + News.error(""+mark+" - 1"+" - 浠诲姟鍏ュ嚭搴撶被鍨嬮敊璇紒锛侊紒[宸ヤ綔鍙凤細{}] [鍏ュ嚭搴撶被鍨嬶細{}]", wrkMast.getWrkNo(), wrkMast.getIoType()); break; } ledCommand.setSourceLocNo(wrkMast.getSourceLocNo()); @@ -1406,24 +1498,33 @@ if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) { continue; } +// 鍛戒护涓嬪彂 ------------------------------------------------------------------------------- +// if (!commands.isEmpty()) { +// if (led.getId() < 7) { +// if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) { +// News.error(""+mark+" - 2"+" - {}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); +// continue; +// } else { +// ledThread.setLedMk(false); +// } +// } else { +// if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { +// News.error(""+mark+" - 3"+" - {}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); +// continue; +// } else { +// ledThread.setLedMk(false); +// } +// } +// +// } // 鍛戒护涓嬪彂 ------------------------------------------------------------------------------- if (!commands.isEmpty()) { - if (led.getId() == 7) { - if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) { - log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); - continue; - } else { - ledThread.setLedMk(false); - } - } else { - if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { - log.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); - continue; - } else { - ledThread.setLedMk(false); - } + if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) { + News.error("{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); + continue; + }else { + ledThread.setLedMk(false); } - } try { @@ -1432,6 +1533,7 @@ wrkMast.setOveMk("Y"); wrkMast.setModiTime(new Date()); if (wrkMastMapper.updateById(wrkMast) == 0) { + News.errorNoLog(""+mark+" - 4"+" - 鏇存柊宸ヤ綔妗eけ璐�"); throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�"); } } @@ -1445,13 +1547,17 @@ } } + News.infoNoLog(""+mark+" - 0"+" - 鍑哄簱 ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣ㄦ墽琛屽畬鎴�"); } /** * 鍏朵粬 ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅 */ - public synchronized void ledReset() { + public synchronized void ledReset(Integer mark) { + + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛�:鍏朵粬 ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅"); for (LedSlave led : slaveProperties.getLed()) { + // 鑾峰彇杈撻�佺嚎plc绾跨▼ DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId()); // 鍛戒护闆嗗悎 @@ -1473,12 +1579,13 @@ if (reset && !ledThread.isLedMk()) { 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()); + News.error(""+mark+" - 1"+" - {}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort()); } else { } } } + News.infoNoLog(""+mark+" - 0"+" - 鎵ц瀹屾垚锛氬叾浠� ===>> LED鏄剧ず鍣ㄥ浣嶏紝鏄剧ず榛樿淇℃伅"); } /** @@ -1561,8 +1668,10 @@ * 鍥犲弻娣卞簱浣嶉樆濉烇紝瀵规祬搴撲綅杩涜绉昏浆锛堢珛鍗虫墽琛岀増) * tip锛氬悓姝� */ - private synchronized void moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc) { + private synchronized void moveLocForDeepLoc(CrnSlave crn, LocMast shallowLoc,Integer mark) { + try { + News.warnNoLog(""+mark+"moveLocForDeepLoc"+" - 0"+" - 寮�濮嬫墽琛�:鍥犲弻娣卞簱浣嶉樆濉烇紝瀵规祬搴撲綅杩涜绉昏浆锛堢珛鍗虫墽琛岀増)"); List<Integer> rows = locMastService.queryDistinctRow(crn.getId()); LocMast loc = null; for (Integer row : rows) { @@ -1604,7 +1713,7 @@ } if (null == loc) { - log.error("鍙屾繁搴撲綅 --- 娴呭簱浣嶉樆濉炲紓甯革紒 寰呯Щ杞祬搴撲綅锛�" + shallowLoc.getLocNo()); + News.error(""+mark+"moveLocForDeepLoc"+" - 1"+" - 鍙屾繁搴撲綅 --- 娴呭簱浣嶉樆濉炲紓甯革紒 寰呯Щ杞祬搴撲綅锛�" + shallowLoc.getLocNo()); throw new CoolException("鍙屾繁搴撲綅 --- 娴呭簱浣嶉樆濉炲紓甯革紒 寰呯Щ杞祬搴撲綅锛�" + shallowLoc.getLocNo()); } @@ -1630,6 +1739,7 @@ wrkMast.setModiTime(new Date()); int res = wrkMastMapper.insert(wrkMast); if (res == 0) { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 2"+" - 淇濆瓨宸ヤ綔妗eけ璐�"); throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�"); } // 宸ヤ綔妗f槑缁嗕繚瀛� @@ -1644,6 +1754,7 @@ wrkDetl.setAppeTime(new Date()); wrkDetl.setModiTime(new Date()); if (!wrkDetlService.insert(wrkDetl)) { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 3"+" - 淇濆瓨宸ヤ綔妗f槑缁嗗け璐�"); throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�"); } } @@ -1653,9 +1764,11 @@ shallowLoc.setLocSts("R"); // R.鍑哄簱棰勭害 shallowLoc.setModiTime(new Date()); if (!locMastService.updateById(shallowLoc)) { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 4"+" - 鏇存柊婧愬簱浣嶇姸鎬佸け璐�"); throw new CoolException("鏇存柊婧愬簱浣嶇姸鎬佸け璐�"); } } else { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 5"+" - 婧愬簱浣嶅嚭搴撳け璐�"); throw new CoolException("婧愬簱浣嶅嚭搴撳け璐�"); } // 淇敼鐩爣搴撲綅鐘舵�� @@ -1663,13 +1776,15 @@ loc.setLocSts("S"); // S.鍏ュ簱棰勭害 loc.setModiTime(new Date()); if (!locMastService.updateById(loc)) { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 6"+" - 鏇存柊鐩爣搴撲綅鐘舵�佸け璐�"); throw new CoolException("鏇存柊鐩爣搴撲綅鐘舵�佸け璐�"); } } else { + News.errorNoLog(""+mark+"moveLocForDeepLoc"+" - 7"+" - 绉昏浆澶辫触"); throw new CoolException("绉昏浆澶辫触"); } } catch (Exception e) { - log.error("鍙屾繁搴撲綅闃诲锛屽娴呭簱浣嶈繘琛岀Щ杞け璐�", e); + News.error(""+mark+"moveLocForDeepLoc"+" - 8"+" - 鍙屾繁搴撲綅闃诲锛屽娴呭簱浣嶈繘琛岀Щ杞け璐�", e); e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } @@ -1770,7 +1885,7 @@ } } } catch (Exception e) { - log.error("鍫嗗灈鏈烘紨绀� ===>> 搴撲綅绉昏浆澶辫触", e); + News.error("鍫嗗灈鏈烘紨绀� ===>> 搴撲綅绉昏浆澶辫触", e); e.printStackTrace(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); } @@ -1797,27 +1912,27 @@ } // 鍏ュ簱 if (wrkMast.getWrkSts() == 1 || wrkMast.getWrkSts() == 2) { - log.warn("鍫嗗灈鏈洪潪绌洪棽鎯呭喌涓嬶紝寮�濮嬩慨鏀瑰伐浣滄。鐘舵�併�俒id:{},鏃堕棿锛歿}] >>>>> 鍫嗗灈鏈哄綋鍓嶇姸鎬佷负锛歿}銆備换鍔″彿:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); + News.warn("鍫嗗灈鏈洪潪绌洪棽鎯呭喌涓嬶紝寮�濮嬩慨鏀瑰伐浣滄。鐘舵�併�俒id:{},鏃堕棿锛歿}] >>>>> 鍫嗗灈鏈哄綋鍓嶇姸鎬佷负锛歿}銆備换鍔″彿:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); // 淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� wrkMast.setWrkSts(3L); wrkMast.setCrnStrTime(now); wrkMast.setModiTime(now); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); + News.error("淇敼宸ヤ綔妗g姸鎬� 2.璁惧涓婅蛋 => 3.鍚婅溅鍏ュ簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } - log.warn("淇敼宸ヤ綔妗g姸鎬佹垚鍔熴�俒鏃堕棿锛歿}] >>>>> 浠诲姟鍙�:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); + News.warn("淇敼宸ヤ綔妗g姸鎬佹垚鍔熴�俒鏃堕棿锛歿}] >>>>> 浠诲姟鍙�:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); } // 鍑哄簱銆佺Щ搴� if (wrkMast.getWrkSts() == 11) { - log.warn("鍫嗗灈鏈洪潪绌洪棽鎯呭喌涓嬶紝寮�濮嬩慨鏀瑰伐浣滄。鐘舵�併�俒id:{},鏃堕棿锛歿}] >>>>> 鍫嗗灈鏈哄綋鍓嶇姸鎬佷负锛歿}銆備换鍔″彿:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); + News.warn("鍫嗗灈鏈洪潪绌洪棽鎯呭喌涓嬶紝寮�濮嬩慨鏀瑰伐浣滄。鐘舵�併�俒id:{},鏃堕棿锛歿}] >>>>> 鍫嗗灈鏈哄綋鍓嶇姸鎬佷负锛歿}銆備换鍔″彿:{}", crn.getId(), DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), crnProtocol.getStatusType().desc, crnProtocol.getTaskNo()); // 淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� wrkMast.setWrkSts(12L); wrkMast.setCrnStrTime(now); wrkMast.setModiTime(now); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); + News.error("淇敼宸ヤ綔妗g姸鎬� 11.鐢熸垚鍑哄簱ID => 12.鍚婅溅鍑哄簱涓� 澶辫触锛侊紒锛屽伐浣滃彿={}", wrkMast.getWrkNo()); } - log.warn("淇敼宸ヤ綔妗g姸鎬佹垚鍔熴�俒鏃堕棿锛歿}] >>>>> 浠诲姟鍙�:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); + News.warn("淇敼宸ヤ綔妗g姸鎬佹垚鍔熴�俒鏃堕棿锛歿}] >>>>> 浠诲姟鍙�:{}", DateUtils.convert(now, DateUtils.yyyyMMddHHmmsssss_F), wrkMast.getWrkNo()); } @@ -1889,17 +2004,21 @@ } - public synchronized void outOfDevp() { + public synchronized void outOfDevp(Integer mark) { + List<WrkMast> wrkMasts = wrkMastMapper.selectPick(); + if (wrkMasts.size()!=0){ + News.warnNoLog(""+mark+" - 0"+" - 寮�濮嬫墽琛宱utOfDevp"); + } for (WrkMast wrkMast : wrkMasts) { if (basDevpService.selectCount(new EntityWrapper<BasDevp>().eq("wrk_no", wrkMast.getWrkNo())) == 0) { wrkMast.setCtnNo("Y"); if (wrkMastMapper.updateById(wrkMast) == 0) { - log.error("淇敼{}宸ヤ綔妗eけ璐ワ紝ctn_no", wrkMast.getWrkNo()); + News.error(""+mark+" - 1"+" - 淇敼{}宸ヤ綔妗eけ璐ワ紝ctn_no", wrkMast.getWrkNo()); } } - } + News.infoNoLog(""+mark+" - 0"+" - outOfDevp鎵ц瀹屾垚"); } @@ -1931,9 +2050,9 @@ JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { JSONObject data = (JSONObject) jsonObject.get("data"); - log.info((String) data.get("msg")); + News.info((String) data.get("msg")); } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); + News.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyOut/v1","", response); } } catch (Exception e) { e.printStackTrace(); @@ -1969,9 +2088,9 @@ .doPost(); JSONObject jsonObject = JSON.parseObject(response); if (jsonObject.getInteger("code").equals(200)) { - log.info((String) jsonObject.get("msg")); + News.info((String) jsonObject.get("msg")); } else { - log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response); + News.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", wmsUrl + "/rpc/auto/emptyIn/v1", JSON.toJSONString(locTypeDto), response); } } catch (Exception e) { e.printStackTrace(); -- Gitblit v1.9.1