From 9d8d5147ca480bd734b71106962cdf3816e59a16 Mon Sep 17 00:00:00 2001
From: tzsk <Administrator@qq.com>
Date: 星期三, 07 二月 2024 18:29:35 +0800
Subject: [PATCH] Changes
---
src/main/java/com/zy/common/web/WcsController.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
index 4d4f5f2..45f3aff 100644
--- a/src/main/java/com/zy/common/web/WcsController.java
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -9,6 +9,7 @@
import com.zy.asrs.mapper.WrkMastMapper;
import com.zy.asrs.service.*;
import com.zy.common.CodeRes;
+import com.zy.common.model.AgvBasDevpDto;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
import com.zy.common.service.CommonService;
@@ -65,6 +66,10 @@
private WrkMastMapper wrkMastMapper;
@Autowired
private WrkMastLogService wrkMastLogService;
+ @Autowired
+ private AgvWrkDetlService agvWrkDetlService;
+ @Autowired
+ private AgvLocDetlService agvLocDetlService;
// @Autowired
// private ErpService erpService;
@@ -642,10 +647,10 @@
String currentContainerCode = currentContainerMap.get(devNo);
//鍒ゆ柇瀹瑰櫒鏄惁鍙戠敓鍙樺寲
- if(!Cools.eq(containerCode,currentContainerCode)){
+ if(!Cools.isEmpty(currentContainerCode) && !Cools.eq(containerCode,currentContainerCode)){
//鏌ヨ鏃у鍣ㄧ殑宸ヤ綔妗�
AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(currentContainerCode);
- if(agvWrkMast.getIoType() == 101){
+ if(!Cools.isEmpty(agvWrkMast) && agvWrkMast.getIoType() == 101){
//鍙戦�佸鍣ㄧ珛鍦鸿姹傦紝瀹屾垚宸ヤ綔妗�
List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
agvWrkMastList.add(agvWrkMast);
@@ -677,19 +682,56 @@
String devNo = param.getDevNo();
String containerCode = currentContainerMap.get(devNo);
+ AgvBasDevpDto agvBasDevpDto = new AgvBasDevpDto();
+
//鏌ユ壘璇ュ鍣ㄧ殑宸ヤ綔妗�
AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(containerCode);
if(!Cools.isEmpty(agvWrkMast)){
- return R.ok(agvWrkMast);
+ List<AgvWrkDetl> agvWrkDetlList = agvWrkDetlService.selectList(new EntityWrapper<AgvWrkDetl>().eq("wrk_no", agvWrkMast.getWrkNo()));
+
+ for (AgvWrkDetl agvWrkDetl : AgvWrkDetlList){
+ agvWrkDetl.setVolume(agvWrkDetl.getAnfme());
+ if(agvWrkMast.getIoType() == 103){
+ //瀵绘壘鏄惁鏈夌浉鍚岀墿鏂欑殑宸ヤ綔妗f槑缁嗭紝骞惰繑鍥炴暟閲忎箣鍜�
+ double anfme = getAllAnfmeInAgvWrkDetlList(agvWrkDetlList,agvWrkDetl);
+ AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getSourceLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime());
+ //鐢ㄤ簬缁撲綑鏁伴噺鏄剧ず
+ agvWrkDetl.setVolume(agvLocDetl.getAnfme() - anfme);
+ }
+ if(agvWrkMast.getIoType() == 53){
+ AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime());
+ if(Cools.isEmpty(agvLocDetl)){
+ agvWrkDetl.setVolume(0.0);
+ }else {
+ agvWrkDetl.setVolume(agvLocDetl.getAnfme());
+ }
+ }
+ };
+
+
+ return R.ok(agvWrkDetlList).add(agvWrkMast);
}
//鏌ユ壘璇ュ鍣ㄧ殑鍏ュ簱閫氱煡妗�
- AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectByContainerCode(containerCode);
- if(!Cools.isEmpty(agvWaitPakin)){
- return R.ok(agvWaitPakin);
+ List<AgvWaitPakin> agvWaitPakinList = agvWaitPakinService.selectList(new EntityWrapper<AgvWaitPakin>().eq("supp_code", containerCode));
+ if(!Cools.isEmpty(agvWaitPakinList)){
+ return R.ok(agvWaitPakinList);
}
return R.error("娌℃湁璇ュ鍣ㄧ殑鍑哄簱銆佹嫞鏂欍�佸叆搴撲俊鎭瓑");
}
+ private double getAllAnfmeInAgvWrkDetlList(List<AgvWrkDetl> agvWrkDetlList, AgvWrkDetl wd0) {
+ double allAnfme = 0;
+ for (AgvWrkDetl wd1 : agvWrkDetlList){
+ if(Cools.eq(wd0.getMatnr(),wd1.getMatnr())
+ && Cools.eq(wd0.getBatch(),wd1.getBatch())
+ && Cools.eq(wd0.getThreeCode(),wd1.getThreeCode())
+ && Cools.eq(wd0.getDeadTime(),wd1.getDeadTime())){
+ allAnfme += wd1.getAnfme();
+ }
+ }
+ return allAnfme;
+ }
+
}
--
Gitblit v1.9.1