fix:跟单任务控制台提交校验问题
This commit is contained in:
parent
be1d7fc1c0
commit
c83ac79ad3
@ -1,9 +1,7 @@
|
|||||||
package com.yem.wm.im.placeexamine.op;
|
package com.yem.wm.im.placeexamine.op;
|
||||||
|
|
||||||
import com.yem.wm.im.placeexamine.vaildator.AlaceexamineSubmitOpSubmitvalidatox;
|
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
|
||||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||||
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
@ -31,10 +29,4 @@ public class AlaceexamineSubmitOp extends AbstractOperationServicePlugIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
|
||||||
super.onAddValidators(e);
|
|
||||||
e.addValidator(new AlaceexamineSubmitOpSubmitvalidatox());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
package com.yem.wm.im.placeexamine.vaildator;
|
|
||||||
|
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
||||||
import kd.bos.entity.ExtendedDataEntity;
|
|
||||||
import kd.bos.entity.validate.AbstractValidator;
|
|
||||||
|
|
||||||
public class AlaceexamineSubmitOpSubmitvalidatox extends AbstractValidator {
|
|
||||||
@Override
|
|
||||||
public void validate() {
|
|
||||||
ExtendedDataEntity[] dataEntities = this.getDataEntities();
|
|
||||||
for (ExtendedDataEntity dataEntitie : dataEntities) {
|
|
||||||
DynamicObject dataEntity = dataEntitie.getDataEntity();
|
|
||||||
DynamicObjectCollection yem_es_materialinfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
|
||||||
for (int i = 0; i < yem_es_materialinfo.size(); i++) {
|
|
||||||
DynamicObject materialinfo = yem_es_materialinfo.get(i);
|
|
||||||
int yem_nqty = materialinfo.getInt("yem_nqty");
|
|
||||||
//商品信息第**行[**物料编码] 末备料数量[*]大于0,请执行备料!
|
|
||||||
if (yem_nqty > 0) {
|
|
||||||
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
|
||||||
if (yem_materiel != null) {
|
|
||||||
int seq = i + 1;
|
|
||||||
String materiel = yem_materiel.getString("number");
|
|
||||||
this.addErrorMessage(dataEntitie, String.format("商品信息第" + seq + "行[" + materiel + "] 末备料数量[" + yem_nqty + "]大于0,请执行备料!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (yem_nqty < 0) {
|
|
||||||
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
|
||||||
if (yem_materiel != null) {
|
|
||||||
int seq = i + 1;
|
|
||||||
String materiel = yem_materiel.getString("number");
|
|
||||||
this.addErrorMessage(dataEntitie, String.format("商品信息第" + seq + "行[" + materiel + "] 末备料数量[" + yem_nqty + "]小于0,提交失败!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -22,13 +22,6 @@ public class TracktaskconsoleSubmitvalidator extends AbstractValidator {
|
|||||||
for (ExtendedDataEntity dataEntitie : dataEntities) {
|
for (ExtendedDataEntity dataEntitie : dataEntities) {
|
||||||
DynamicObject dataEntity = dataEntitie.getDataEntity();
|
DynamicObject dataEntity = dataEntitie.getDataEntity();
|
||||||
yemIsvmi(dataEntity, dataEntitie);
|
yemIsvmi(dataEntity, dataEntitie);
|
||||||
DynamicObject yemBilltype = dataEntity.getDynamicObject("yem_billtype");
|
|
||||||
String typeNumber = "";
|
|
||||||
if(yemBilltype != null){
|
|
||||||
typeNumber = yemBilltype.getString("number");
|
|
||||||
}
|
|
||||||
//排除下单审批中的备料处理
|
|
||||||
if(!"yem_placeexamine_".equals(typeNumber)){
|
|
||||||
DynamicObjectCollection yem_es_materialinfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection yem_es_materialinfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
for (int i = 0; i < yem_es_materialinfo.size(); i++) {
|
for (int i = 0; i < yem_es_materialinfo.size(); i++) {
|
||||||
DynamicObject materialinfo = yem_es_materialinfo.get(i);
|
DynamicObject materialinfo = yem_es_materialinfo.get(i);
|
||||||
@ -51,7 +44,6 @@ public class TracktaskconsoleSubmitvalidator extends AbstractValidator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
Map<Long, Integer> cancelQty = new LinkedHashMap<>();
|
Map<Long, Integer> cancelQty = new LinkedHashMap<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user