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,提交失败!"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -21,34 +21,26 @@ public class TracktaskconsoleSubmitvalidator extends AbstractValidator {
|
|||||||
ExtendedDataEntity[] dataEntities = this.getDataEntities();
|
ExtendedDataEntity[] dataEntities = this.getDataEntities();
|
||||||
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);
|
||||||
int yem_nqty = materialinfo.getInt("yem_nqty");
|
int yem_nqty = materialinfo.getInt("yem_nqty");
|
||||||
//商品信息第**行[**物料编码] 末备料数量[*]大于0,请执行备料!
|
//商品信息第**行[**物料编码] 末备料数量[*]大于0,请执行备料!
|
||||||
if(yem_nqty>0){
|
if (yem_nqty > 0) {
|
||||||
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
||||||
if(yem_materiel!=null){
|
if (yem_materiel != null) {
|
||||||
int seq = i+1;
|
int seq = i + 1;
|
||||||
String materiel = yem_materiel.getString("number");
|
String materiel = yem_materiel.getString("number");
|
||||||
this.addErrorMessage(dataEntitie,String.format("商品信息第"+seq+"行["+materiel+"] 末备料数量["+yem_nqty+"]大于0,请执行备料!"));
|
this.addErrorMessage(dataEntitie, String.format("商品信息第" + seq + "行[" + materiel + "] 末备料数量[" + yem_nqty + "]大于0,请执行备料!"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(yem_nqty<0){
|
if (yem_nqty < 0) {
|
||||||
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
DynamicObject yem_materiel = materialinfo.getDynamicObject("yem_materiel");
|
||||||
if(yem_materiel!=null){
|
if (yem_materiel != null) {
|
||||||
int seq = i+1;
|
int seq = i + 1;
|
||||||
String materiel = yem_materiel.getString("number");
|
String materiel = yem_materiel.getString("number");
|
||||||
this.addErrorMessage(dataEntitie,String.format("商品信息第"+seq+"行["+materiel+"] 末备料数量["+yem_nqty+"]小于0,提交失败!"));
|
this.addErrorMessage(dataEntitie, String.format("商品信息第" + seq + "行[" + materiel + "] 末备料数量[" + yem_nqty + "]小于0,提交失败!"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,14 +76,14 @@ public class TracktaskconsoleSubmitvalidator extends AbstractValidator {
|
|||||||
|
|
||||||
private void yemIsvmi(DynamicObject dataEntity, ExtendedDataEntity dataEntities) {
|
private void yemIsvmi(DynamicObject dataEntity, ExtendedDataEntity dataEntities) {
|
||||||
DynamicObjectCollection yemEsSalesorderR = dataEntity.getDynamicObjectCollection("yem_es_salesorder_r");
|
DynamicObjectCollection yemEsSalesorderR = dataEntity.getDynamicObjectCollection("yem_es_salesorder_r");
|
||||||
if (yemEsSalesorderR!=null){
|
if (yemEsSalesorderR != null) {
|
||||||
for (DynamicObject dynamicObject : yemEsSalesorderR) {
|
for (DynamicObject dynamicObject : yemEsSalesorderR) {
|
||||||
String yemStockway = dynamicObject.getString("yem_stockway");
|
String yemStockway = dynamicObject.getString("yem_stockway");
|
||||||
if ("E".equals(yemStockway)){
|
if ("E".equals(yemStockway)) {
|
||||||
String yemIsvmi = dynamicObject.getString("yem_isvmi");
|
String yemIsvmi = dynamicObject.getString("yem_isvmi");
|
||||||
int seq = dynamicObject.getInt("seq");
|
int seq = dynamicObject.getInt("seq");
|
||||||
if ("".equals(yemIsvmi)){
|
if ("".equals(yemIsvmi)) {
|
||||||
this.addErrorMessage(dataEntities,"备料(生产、采购)信息 第"+seq+"行 仓库类型未填写,请填写后提交!!!");
|
this.addErrorMessage(dataEntities, "备料(生产、采购)信息 第" + seq + "行 仓库类型未填写,请填写后提交!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user