物料对称修改
This commit is contained in:
parent
d785e49f84
commit
1ddb754e5d
|
@ -31,6 +31,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/***
|
||||
|
@ -583,9 +584,7 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
**/
|
||||
private JsonResultEntity checkData(List<ZjMaterielSynchronizationEventEntity> list, boolean flag,List<InventoryEntity> inventoryEntities) {
|
||||
StringBuffer str = new StringBuffer();
|
||||
|
||||
Integer num = 0;
|
||||
Integer num1 = 0;
|
||||
Map<String, Integer> elementCountMap = new HashMap<>();
|
||||
/*
|
||||
1、必填校验:发起
|
||||
物料中类、货品编码(修改必填)
|
||||
|
@ -606,13 +605,14 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
str.append("序号为"+entity.getField0004()+"明细行的物料中类为空。");
|
||||
//return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的物料中类为空");
|
||||
}else {
|
||||
elementCountMap.put(entity.getField0043code(), elementCountMap.getOrDefault(entity.getField0043code(), 0) + 1);
|
||||
//判断存货分类里面如果有6或7,有一个必须有另一个
|
||||
if(entity.getField0043code().startsWith("6")){
|
||||
num++;
|
||||
}
|
||||
if(entity.getField0043code().startsWith("7")){
|
||||
num1++;
|
||||
}
|
||||
//if(entity.getField0043code().startsWith("6")){
|
||||
// num++;
|
||||
//}
|
||||
//if(entity.getField0043code().startsWith("7")){
|
||||
// num1++;
|
||||
//}
|
||||
}
|
||||
//if(entity.getField0018code() == null || "".equals(entity.getField0018code())){
|
||||
// return BaseResult.getFailureMessageEntity("序号为"+entity.getField0004()+"明细行的申请原因为空");
|
||||
|
@ -696,18 +696,33 @@ public class ZjMaterielSynchronizationEventServiceImpl extends BaseService<ZjMat
|
|||
|
||||
}
|
||||
}
|
||||
Map<String,String> stringMap = new HashMap<>();
|
||||
//判断存货分类里面如果有6或7,有一个必须有另一个
|
||||
if(num > 0){
|
||||
if(num1 == 0){
|
||||
str.append("存货分类存在6,不存在7"+"。");
|
||||
if(elementCountMap != null && elementCountMap.size() > 0){
|
||||
for (Map.Entry<String, Integer> entry : elementCountMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Integer value = entry.getValue();
|
||||
if(key.startsWith("6")){
|
||||
Integer o = elementCountMap.getOrDefault("7"+key.substring(1),0);
|
||||
if(value != o){
|
||||
stringMap.put(key+"和"+"7"+key.substring(1),"1");
|
||||
}
|
||||
}
|
||||
if(key.startsWith("7")){
|
||||
Integer o = elementCountMap.getOrDefault("6"+key.substring(1),0);
|
||||
if(value != o){
|
||||
stringMap.put("6"+key.substring(1)+"和"+key,"1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(stringMap != null && stringMap.size() > 0){
|
||||
String result = stringMap.keySet().stream()
|
||||
.collect(Collectors.joining(","));
|
||||
str.append(result+"不是成对出现。");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(num1 > 0){
|
||||
if(num == 0){
|
||||
str.append("存货分类存在7,不存在6"+"。");
|
||||
}
|
||||
}
|
||||
//查询u8物料
|
||||
ZjMaterielSynchronizationEventDto querywl = new ZjMaterielSynchronizationEventDto();
|
||||
querywl.setDataSourceCode(zju8);
|
||||
|
|
Loading…
Reference in New Issue