From e72f4946b1696a570022d6ae715fa07656ab89f7 Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 27 九月 2023 13:07:43 +0800
Subject: [PATCH] Merge branch 'tzskasrs' of http://47.97.1.152:5880/r/zy-asrs into tzskasrs
---
src/main/java/com/zy/common/model/TaskDto.java | 49 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/src/main/java/com/zy/common/model/TaskDto.java b/src/main/java/com/zy/common/model/TaskDto.java
index afcf9d0..02baec6 100644
--- a/src/main/java/com/zy/common/model/TaskDto.java
+++ b/src/main/java/com/zy/common/model/TaskDto.java
@@ -8,10 +8,7 @@
import com.zy.asrs.service.LocDetlService;
import lombok.Data;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* Created by vincent on 2022/3/28
@@ -22,6 +19,8 @@
private String locNo;
private Integer staNo;
+
+ private String agvStaNo;
private List<LocDto> locDtos;
@@ -37,6 +36,12 @@
public TaskDto(String locNo, Integer staNo, LocDto locDto) {
this.locNo = locNo;
this.staNo = staNo;
+ this.locDtos.add(locDto);
+ }
+
+ public TaskDto(String locNo, String agvStaNo, LocDto locDto) {
+ this.locNo = locNo;
+ this.agvStaNo = agvStaNo;
this.locDtos.add(locDto);
}
@@ -71,31 +76,51 @@
}
public boolean isAll(){
- // 姹囨�讳笉鑰冭檻鎵瑰彿
+ // 姹囨�讳笉鑰冭檻搴忓垪鐮�
List<DetlDto> detlDtos = new ArrayList<>();
for (LocDto locDto : this.getLocDtos()) {
- DetlDto dto = new DetlDto(locDto.getMatnr(), null, locDto.getAnfme());
+ DetlDto dto = new DetlDto(locDto.getMatnr(), locDto.getBatch(), locDto.getAnfme(), locDto.getCsocode(), locDto.getIsoseq());
+ dto.setContainerCode(locDto.getContainerCode());
if (DetlDto.has(detlDtos, dto)) {
- DetlDto detlDto = DetlDto.find(detlDtos, locDto.getMatnr(), null);
+ DetlDto detlDto = DetlDto.find(detlDtos, locDto.getMatnr(), dto.getBatch(),dto.getCsocode(),dto.getIsoseq(),dto.getContainerCode());
assert detlDto != null;
detlDto.setAnfme(detlDto.getAnfme() + locDto.getAnfme());
} else {
- detlDtos.add(new DetlDto(locDto.getMatnr(), null, locDto.getAnfme()));
+ detlDtos.add(new DetlDto(locDto.getMatnr(), locDto.getBatch(), locDto.getAnfme()));
}
}
// 鏌ヨ褰撳墠搴撲綅鍙锋墍鏈夌殑搴撳瓨鏄庣粏
LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class);
- // todo
List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", this.locNo));
if (locDetls == null || locDetls.isEmpty()){
- throw new CoolException("璁$畻婊℃澘澶辫触锛屽簱浣嶅彿=" + this.locNo);
+ throw new CoolException("妫�绱㈠簱瀛樻槑缁嗗け璐ワ紝搴撲綅鍙�=" + this.locNo);
}
int sameNumber = 0;
for (LocDetl locDetl : locDetls) {
- for (DetlDto detlDto : detlDtos) {
- if (detlDto.getLocDetl().getMatnr().equals(locDetl.getMatnr()) && dto.getCount().equals(locDetl.getAnfme())) {
+ Iterator<DetlDto> iterator = detlDtos.iterator();
+ while (iterator.hasNext()) {
+ DetlDto dto = iterator.next();
+ if (!dto.getMatnr().equals(locDetl.getMatnr())) {
+ continue;
+ }
+ if (Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) {
+ continue;
+ }
+ if (!Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(locDetl.getBatch())) {
+ continue;
+ }
+ if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(locDetl.getBatch())) {
+ if (!dto.getBatch().equals(locDetl.getBatch())) {
+ continue;
+ }
+ }
+ if (dto.getAnfme() > locDetl.getAnfme()) {
+ throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇�");
+ }
+ if (dto.getAnfme().equals(locDetl.getAnfme())) {
sameNumber++;
+ iterator.remove();
break;
}
}
--
Gitblit v1.9.1