Revert "feat:跟单任务控制台,填写取消数量后,不能有整机生产信息"

This reverts commit 23142ed75e.
This commit is contained in:
zzs 2025-02-14 14:11:24 +08:00
parent 70fbbdfc57
commit 09d0f6f468

View File

@ -5,11 +5,6 @@ import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.validate.AbstractValidator;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* @author zhouc
* @date 2023/10/11 19:12
@ -42,32 +37,6 @@ public class TracktaskconsoleSavevalidator extends AbstractValidator {
}
}
}
StringBuilder sb = new StringBuilder();
DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
Map<Long, Integer> cancelQty = new LinkedHashMap<>();
for (DynamicObject d : c) {
long id = d.getLong("id");
BigDecimal cancel_num = d.getBigDecimal("yem_cancel_num");
if (cancel_num.compareTo(BigDecimal.ZERO) > 0) {
cancelQty.put(id, c.indexOf(d));
}
}
DynamicObjectCollection backC = dataEntity.getDynamicObjectCollection("yem_es_salesorder_r");
for (DynamicObject d : backC) {
long entrtyid = d.getLong("yem_entrtyid");
if (cancelQty.containsKey(entrtyid)) {
Integer idx = cancelQty.get(entrtyid);
DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_es_salesorder_z");
if (!subC.isEmpty()) {
sb.append(String.format("商品明细第 %s 行已维护取消数量,不允许维护整机生产信息!", idx + 1)).append("\r\n");
}
}
}
if (sb.length() > 0) {
this.addErrorMessage(dataEntitie, sb.toString());
}
}
}
}