From 361baf186c76ba0ce1ad809eeef7ff23ed971312 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期三, 10 八月 2022 07:55:45 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 77 ++++++++++++++++++--------------------
1 files changed, 37 insertions(+), 40 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 a0587a3..5056bba 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -130,7 +130,7 @@
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing() && staProtocol.isLoading()
&& staProtocol.isInEnable()
- && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999)
+ && !staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() > 9990)
&& staProtocol.isPakMk()){// && !Cools.isEmpty(barcode)) {
// if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) {
@@ -323,20 +323,20 @@
for (DevpSlave devp : slaveProperties.getDevp()) {
// 閬嶅巻鎷f枡鍏ュ簱鍙�
for (DevpSlave.Sta pickSta : devp.getPickSta()) {
- // 鑾峰彇鏉$爜鎵弿浠俊鎭�
- BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
- if (barcodeThread == null) {
- continue;
- }
- String barcode = barcodeThread.getBarcode();
- if(!Cools.isEmpty(barcode)) {
- log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
- if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
- continue;
- }
- } else {
- continue;
- }
+// // 鑾峰彇鏉$爜鎵弿浠俊鎭�
+// BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, pickSta.getBarcode());
+// if (barcodeThread == null) {
+// continue;
+// }
+// String barcode = barcodeThread.getBarcode();
+// if(!Cools.isEmpty(barcode)) {
+// log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
+// if("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
+// continue;
+// }
+// } else {
+// continue;
+// }
// 鑾峰彇鎷f枡鍏ュ簱绔欎俊鎭�
SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
@@ -351,21 +351,8 @@
// if (devpThread.ioMode != IoModeType.PAKIN_MODE) { continue; }
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() && staProtocol.isPakMk()){
-
-// if(Cools.isEmpty(barcode) || "NG".endsWith(barcode) || "NoRead".equals(barcode)) {
-// log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", pickSta.getBarcode(), barcode);
-// //鏉$爜涓虹┖鎴栬�呬笉绗﹀悎锛岄��搴撳埌172绔欑偣
-// staProtocol.setWorkNo((short)9999);
-// staProtocol.setStaNo((short)172);
-// devpThread.setPakMk(staProtocol.getSiteId(), false);
-// boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
-// if (!result) {
-// throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
-// }
-// continue;
-// }
-
- WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
+// WrkMast wrkMast = wrkMastMapper.selectPickStep(barcode);
+ WrkMast wrkMast = wrkMastMapper.selectPakInStep3(staProtocol.getWorkNo().intValue());
if (wrkMast == null) {
// 鏃犳嫞鏂欐暟鎹�
continue;
@@ -561,7 +548,7 @@
}
// 搴撲綅绉昏浆
this.locToLoc(crn, crnProtocol);
- this.crnRebackHp(crnProtocol, crnThread);
+// this.crnRebackHp(crnProtocol, crnThread);
}
}
@@ -673,7 +660,7 @@
// 宸茬粡瀛樺湪鍚婅溅鎵ц浠诲姟鏃讹紝鍒欒繃婊�
if (wrkMastMapper.selectWorking(slave.getId()) != null) {
- return;
+ continue;
}
// 鍙屾繁搴撲綅涓旀祬搴撲綅鏈夎揣锛屽垯闇�鍏堝娴呭簱浣嶈繘琛屽簱浣嶇Щ杞�
@@ -1257,7 +1244,7 @@
// 绔欑偣鏉′欢鍒ゆ柇
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
- && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9990 || staProtocol.getWorkNo() == 9997) && staProtocol.isPakMk()) {
+ && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() > 9990 && staProtocol.getWorkNo() <= 9999) && staProtocol.isPakMk()) {
try {
LocTypeDto locTypeDto = new LocTypeDto(staProtocol);
@@ -1377,13 +1364,21 @@
}
// 鑾峰彇宸ヤ綔妗f暟鎹�
WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo());
- if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; }
+// if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; }
+ if (null == wrkMast) { continue; }
wrkMasts.add(wrkMast);
// 缁勮鍛戒护
LedCommand ledCommand = new LedCommand();
ledCommand.setWorkNo(wrkMast.getWrkNo());
+ ledCommand.setIoType(wrkMast.getIoType());
// 鍑哄簱妯″紡
switch (wrkMast.getIoType()) {
+ case 1:
+ ledCommand.setTitle("鍏ㄦ澘鍏ュ簱");
+ break;
+ case 10:
+ ledCommand.setTitle("绌烘澘鍏ュ簱");
+ break;
case 101:
ledCommand.setTitle("鍏ㄦ澘鍑哄簱");
break;
@@ -1405,10 +1400,12 @@
break;
}
ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
+ ledCommand.setLocNo(wrkMast.getLocNo());
ledCommand.setStaNo(wrkMast.getStaNo());
- if (wrkMast.getIoType() != 110) {
+// ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
+ if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10 ) {
List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
- wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatNo(), wrkDetl.getMatName(), wrkDetl.getQty())));
+ wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
}
commands.add(ledCommand);
}
@@ -1493,13 +1490,13 @@
if (staProtocol == null) {
continue;
}
- if (staProtocol.getWorkNo() != 0) {
+ if (staProtocol.getWorkNo() != 0 && staProtocol.isLoading()) {
reset = false;
break;
}
}
// 鑾峰彇led绾跨▼
- LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getDevpPlcId());
+ LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
// led鏄剧ず榛樿鍐呭
if (reset && !ledThread.isLedMk()) {
ledThread.setLedMk(true);
@@ -1553,7 +1550,7 @@
WrkDetl wrkDetl = new WrkDetl();
wrkDetl.setWrkNo(workNo);
wrkDetl.setIoTime(now);
- wrkDetl.setQty(locDetl.getQty());
+ wrkDetl.setAnfme(locDetl.getAnfme());
VersionUtils.setWrkDetl(wrkDetl, locDetl); // 鐗堟湰鎺у埗
wrkDetl.setAppeTime(now);
wrkDetl.setModiTime(now);
@@ -1670,7 +1667,7 @@
WrkDetl wrkDetl = new WrkDetl();
wrkDetl.setWrkNo(workNo);
wrkDetl.setIoTime(new Date());
- wrkDetl.setQty(locDetl.getQty());
+ wrkDetl.setAnfme(locDetl.getAnfme());
VersionUtils.setWrkDetl(wrkDetl, locDetl); // 鐗堟湰鎺у埗
wrkDetl.setAppeTime(new Date());
wrkDetl.setModiTime(new Date());
--
Gitblit v1.9.1