From 63a52ec239c245954def02450f91925b4003f924 Mon Sep 17 00:00:00 2001
From: DELL <56479841@qq.com>
Date: 星期二, 25 六月 2024 16:25:25 +0800
Subject: [PATCH] 只能有一个在设备上走的工作档
---
src/main/java/com/zy/common/web/WcsController.java | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index d3c84c0..21ff117 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -11,6 +11,7 @@
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
import com.zy.common.web.param.SearchLocParam;
+import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -74,10 +75,21 @@
return R.error("楂樹綆妫�娴嬩俊鍙蜂笉鑳戒负绌�");
}
+
// 婧愮珯鐐圭姸鎬佹娴�
BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true);
+ if (Cools.isEmpty(sourceStaNo)){
+ return R.error("鍏ュ簱绔欑偣涓嶅瓨鍦�");
+ }
+ sourceStaNo.setLocType1(param.getLocType1());
LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
locTypeDto.setLocType1(param.getLocType1());
+
+ // 闄愬埗鍙兘鏈変竴涓湪璁惧涓婅蛋鐘舵��
+ int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("wrk_sts", 2).eq("source_sta_no", param.getSourceStaNo()));
+ if (count > 0) {
+ return R.error("宸叉湁鍦ㄨ澶囦笂璧板伐浣滄。");
+ }
StartupDto dto = null;
switch (param.getIoType()) {
@@ -103,7 +115,12 @@
BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
// 妫�绱㈠簱浣�
List<String> matNos = pltBarcodes.stream().map(PltBarcode::getMatNo).distinct().collect(Collectors.toList());
- StartupDto dto = commonService.getLocNo(1, 1, devpNo, false, matNos, locTypeDto,0);
+ StartupDto dto;
+ if (devpNo == 304) {
+ dto = commonService.getLocNoBy304(barcode);
+ } else {
+ dto = commonService.getLocNo(1, 1, devpNo, false, matNos, locTypeDto,0);
+ }
int workNo = dto.getWorkNo();
// 鐢熸垚宸ヤ綔妗�
@@ -134,7 +151,7 @@
// 鐢熸垚宸ヤ綔妗f槑缁�
List<MatCodeCountDto> matDtos = new ArrayList<>();
pltBarcodes.forEach(elem -> {
- matDtos.add(new MatCodeCountDto(elem.getBillNo(), elem.getSeqNo(), elem.getMatNo(), elem.getQty()));
+ matDtos.add(new MatCodeCountDto(elem.getBillNo(), elem.getSeqNo(), elem.getMatNo(), elem.getSupplier(), elem.getQty(),elem.getSource(),elem.getVendor(),elem.getMemo()));
//鏇存柊缁勬墭鏁版嵁鐘舵�佷负鍏ュ簱涓�
Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq("barcode", elem.getBarcode())
@@ -165,12 +182,18 @@
return dto;
}
+ @Synchronized
@Transactional
public StartupDto emptyPlateIn(Integer devpNo, LocTypeDto locTypeDto) {
// 婧愮珯鐐圭姸鎬佹娴�
BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
// 妫�绱㈠簱浣�
- StartupDto dto = commonService.getLocNo(1, 10, devpNo, true, null, locTypeDto,0);
+ StartupDto dto;
+ if (devpNo >= 300) {
+ dto = commonService.emptyIngetLocNo(devpNo);
+ } else {
+ dto = commonService.getLocNo(1, 10, devpNo, true, null, locTypeDto, 0);
+ }
int workNo = dto.getWorkNo();
// 鐢熸垚宸ヤ綔妗�
WrkMast wrkMast = new WrkMast();
--
Gitblit v1.9.1