From 215b98eb8cc24bee55737bb0b07c6428e1bac18a Mon Sep 17 00:00:00 2001
From: dubin <dubin>
Date: 星期三, 20 八月 2025 13:47:08 +0800
Subject: [PATCH] 联调
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 145 +++++++++++++++++++++++++++--------------------
1 files changed, 83 insertions(+), 62 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 e064d65..af35f34 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -150,19 +150,23 @@
errMsg = "鍙宠秴闄�";
back = true;
}
- if (!back && staProtocol.isWeightErr()) {
- errMsg = "瓒呴噸";
+ if (!back && staProtocol.getWeight() > 1000) {
+ errMsg = "瓒呴噸鎴栨湭璇诲彇";
back = true;
}
if (!back && staProtocol.isBarcodeErr()) {
errMsg = "鎵爜澶辫触";
back = true;
}
+// if(staProtocol.getWeight() <= 0 ){
+// continue;
+// }
// if (!back && staProtocol.getWeight() == 0.0) {
// errMsg = "閲嶉噺鑾峰彇澶辫触";
// back = true;
// }
+// News.info("{}閲嶉噺", staProtocol.getWeight());
// 閫�鍥�
if (back) {
@@ -190,7 +194,8 @@
&& staProtocol.isLoading()
&& staProtocol.isInEnable()
&& !staProtocol.isEmptyMk()
- && staProtocol.isPakMk()) {
+ && staProtocol.isPakMk()
+ && staProtocol.getWorkNo()==9999) {
if (Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode) || "00000000".equals(barcode)) {
News.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
@@ -307,7 +312,8 @@
staProtocol.setStaNo(inSta.getBackSta().shortValue());
devpThread.setPakMk(staProtocol.getSiteId(), false);
MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
-//
+ log.error("杈撻�佺嚎涓嬪彂2锛�" + staProtocol.getWorkNo() + "," + staProtocol.getStaNo());
+
// if (ledThread != null) {
String errorMsg = jsonObject.getString("msg");
if (!Cools.isEmpty(errorMsg)) {
@@ -938,7 +944,7 @@
}
// 搴撲綅绉昏浆
//mark - 3 - ....
-// this.locToLoc(crn, crnProtocol, mark);
+ this.locToLoc(crn, crnProtocol, mark);
// this.crnRebackHp(crnProtocol, crnThread);
}
@@ -1165,7 +1171,7 @@
// WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo());
List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo());
for (WrkMast wrkMast : wrkMasts) {
- if (wrkMast == null) {
+ if (wrkMast == null) {
continue;
}
// 宸ヤ綔妗g姸鎬佸垽鏂�
@@ -1185,9 +1191,26 @@
if (staProtocol == null) {
News.infoNoLog("" + mark + " - 2" + " - 3" + " - 鍫嗗灈鏈哄嚭搴撶珯淇℃伅(staProtocol!=null缁х画鎵ц,鍚﹀垯寰幆缁堟)锛歴taProtocol=" + staProtocol);
break;
-// continue;
} else {
staProtocol = staProtocol.clone();
+ }
+ StaProtocol staProtocol1 = devpThread.getStation().get(crnStn.getStaNo() - 1);
+ if (staProtocol1 == null) {
+ News.infoNoLog("" + mark + " - 2" + " - 3" + " - 鍫嗗灈鏈哄嚭搴撶珯淇℃伅(staProtocol!=null缁х画鎵ц,鍚﹀垯寰幆缁堟)锛歴taProtocol=" + staProtocol);
+ break;
+ } else {
+ staProtocol1 = staProtocol1.clone();
+ }
+ StaProtocol staProtocol2 = devpThread.getStation().get(crnStn.getStaNo() - 2);
+ if (staProtocol2 == null) {
+ News.infoNoLog("" + mark + " - 2" + " - 3" + " - 鍫嗗灈鏈哄嚭搴撶珯淇℃伅(staProtocol!=null缁х画鎵ц,鍚﹀垯寰幆缁堟)锛歴taProtocol=" + staProtocol);
+ break;
+ } else {
+ staProtocol2 = staProtocol2.clone();
+ }
+ //鍑哄叆鍙h緭閫佺嚎鍙厑璁稿瓨鍦ㄤ竴涓墭鐩�
+ if(staProtocol.isLoading() || staProtocol1.isLoading() || staProtocol2.isLoading() ) {
+ break;
}
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
@@ -1215,54 +1238,54 @@
break;
}
-// // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞�
-// 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());
+ // 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞�
+ 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) {
+ News.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo);
+ } else {
+ if (waitWrkMast.getWrkSts() == 11) {
+ waitWrkMast.setIoPri(15D);
+ waitWrkMast.setModiTime(new Date());
+ if (wrkMastMapper.updateById(waitWrkMast) == 0) {
+ News.error("" + mark + " - 2" + " - 8" + " - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo());
+ }
+ continue;
+ } else {
+
+ }
+ }
+ } else if (shallowLoc.getLocSts().equals("F") || shallowLoc.getLocSts().equals("D")) {
+ News.warnNoLog("" + mark + " - 2" + " - 9" + " - // F銆丏 搴撲綅鐘舵��={}", shallowLoc.getLocSts());
// WrkMast waitWrkMast = wrkMastMapper.selectByLocNo(shallowLocNo);
-// if (null == waitWrkMast) {
-// News.error("{}搴撲綅寮傚父锛屾湭妫�绱㈠埌鐩稿簲宸ヤ綔妗o紒", shallowLocNo);
-// } else {
-// if (waitWrkMast.getWrkSts() == 11) {
-// waitWrkMast.setIoPri(15D);
-// waitWrkMast.setModiTime(new Date());
-// if (wrkMastMapper.updateById(waitWrkMast) == 0) {
-// News.error("" + mark + " - 2" + " - 8" + " - 璋冩暣宸ヤ綔妗d紭鍏堢骇澶辫触锛佸伐浣滃彿={}", waitWrkMast.getWrkNo());
-// }
-// continue;
-// } else {
-//
-// }
-// }
-// } 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);
-// // 姝ゆ爣璁伴伩鍏嶅娆℃墽琛岀Щ搴撲换鍔�
-//// if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())
-//// || Cools.isEmpty(waitWrkMast)) {
-// if (Cools.isEmpty(waitWrkMast)) {
-// wrkMast.setUpdMk("Y");
-// wrkMastMapper.updateById(wrkMast);
-// // 鐢熸垚宸ヤ綔妗�,灏嗘祬搴撲綅绉昏浆鍒版柊鐨勫簱浣嶄腑
-// moveLocForDeepLoc(slave, shallowLoc, mark);
-// }
-// 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;
-// }
-// }
-// }
+ //2022-08-16 modify,涓嶆牴鎹畊pdmk鏍囪绉诲簱浠诲姟(瀹规槗琚彇娑堝鑷村牭濉�)锛屾煡璇㈠伐浣滄。鏄惁瀛樺湪浠诲姟
+ WrkMast waitWrkMast = wrkMastMapper.selectByLocNo1(shallowLocNo);
+ // 姝ゆ爣璁伴伩鍏嶅娆℃墽琛岀Щ搴撲换鍔�
+// if (Cools.isEmpty(wrkMast.getUpdMk()) || "N".equals(wrkMast.getUpdMk())
+// || Cools.isEmpty(waitWrkMast)) {
+ if (Cools.isEmpty(waitWrkMast)) {
+ wrkMast.setUpdMk("Y");
+ wrkMastMapper.updateById(wrkMast);
+ // 鐢熸垚宸ヤ綔妗�,灏嗘祬搴撲綅绉昏浆鍒版柊鐨勫簱浣嶄腑
+ moveLocForDeepLoc(slave, shallowLoc, mark);
+ }
+ 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;
+ }
+ }
+ }
// 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊�
if (wrkMastMapper.selectWorking(slave.getId()) != null) {
@@ -1862,14 +1885,14 @@
} else {
total = locDetl.getAnfme();
}
- if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 1) {
- ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(), total));
+ if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 1 || wrkMast.getIoType() == 53 || wrkMast.getIoType() == 57) {
+ ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getOrderNo(),wrkDetl.getOutOrderNo(),wrkDetl.getUnit(),wrkDetl.getWeight(),wrkDetl.getSupp(),wrkDetl.getLength() ,wrkDetl.getTemp1(), wrkDetl.getProType(),wrkDetl.getAnfme(),wrkDetl.getTemp2(), total));
}
- if (wrkMast.getIoType() == 103 && (null == wrkDetl.getInspect() || 0 == wrkDetl.getInspect())) {
- ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(), total));
+ if (wrkMast.getIoType() == 103 ) {
+ ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getOrderNo(),wrkDetl.getOutOrderNo(),wrkDetl.getUnit(),wrkDetl.getWeight(),wrkDetl.getSupp(),wrkDetl.getLength() ,wrkDetl.getTemp1(), wrkDetl.getProType(),wrkDetl.getAnfme(),wrkDetl.getTemp2(), total));
}
if (wrkMast.getIoType() == 107) {
- ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getManu(), wrkDetl.getMemo(), wrkDetl.getAnfme(), total));
+ ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getBatch(), wrkDetl.getSpecs(), wrkDetl.getOrderNo(),wrkDetl.getOutOrderNo(),wrkDetl.getUnit(),wrkDetl.getWeight(),wrkDetl.getSupp(),wrkDetl.getLength() ,wrkDetl.getTemp1(), wrkDetl.getProType(),wrkDetl.getAnfme(),wrkDetl.getTemp2(), total));
}
});
}
@@ -2383,10 +2406,8 @@
SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, 1);
List<Integer> list = new ArrayList<>();
list.add(101);
- list.add(112);
Map<Integer, Integer> map = new HashMap<>();
map.put(101, 102);
- map.put(112, 111);
for (Integer site : list) {
WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("sta_no", map.get(site)));
if (!Cools.isEmpty(wrkMast)) {
@@ -2410,7 +2431,7 @@
}
Short loctype1 = 1;
if (site == 101) {
- loctype1 = 2;
+ loctype1 = 1;
}
LocTypeDto locTypeDto = new LocTypeDto(loctype1, (short) 1, (short) 1);
locTypeDto.setSiteId(site);
--
Gitblit v1.9.1