fix:
1.跟单任务控制台,填写取消数量后,不能有整机生产信息
This commit is contained in:
parent
c9caeb4469
commit
039f8aee92
@ -1,15 +1,10 @@
|
||||
package com.yem.wm.im.tracktaskconsole.op;
|
||||
|
||||
import com.yem.wm.im.priceLibrary.validator.PriceLibraryAuditValidator;
|
||||
import com.yem.wm.im.tracktaskconsole.validator.TracktaskconsoleSubmitvalidator;
|
||||
import com.yem.wm.im.yearlybudget.validator.YearlyBudgetValidator;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhouc
|
||||
* @date 2023/8/12 19:26
|
||||
|
@ -5,6 +5,10 @@ import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.ExtendedDataEntity;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhouc
|
||||
* @date 2023/8/12 19:29
|
||||
@ -48,6 +52,31 @@ public class TracktaskconsoleSubmitvalidator 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());
|
||||
}
|
||||
|
||||
// DynamicObject billType = dataEntity.getDynamicObject("yem_billtype");//单据类型
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user