WIP:寄单放单提交校验
This commit is contained in:
parent
cd747987eb
commit
7a3638ca84
@ -1,5 +1,6 @@
|
|||||||
package com.yem.wm.es.exportpresent.validator;
|
package com.yem.wm.es.exportpresent.validator;
|
||||||
|
|
||||||
|
import com.yem.wm.es.shippingdetails.util.PaymentControlUtil;
|
||||||
import com.yem.wm.utils.DynamicObjectUtil;
|
import com.yem.wm.utils.DynamicObjectUtil;
|
||||||
import com.yem.wm.utils.YEM;
|
import com.yem.wm.utils.YEM;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
@ -11,9 +12,9 @@ import kd.bos.orm.query.QFilter;
|
|||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import static com.yem.wm.fm.gathering.dynamic.GatheringClaimFormPlugin.getPercentagePeriod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ljw
|
* @author ljw
|
||||||
@ -29,7 +30,39 @@ public class ExportPresentSubmitsValidator extends AbstractValidator {
|
|||||||
DynamicObject dataEntity = data.getDataEntity();
|
DynamicObject dataEntity = data.getDataEntity();
|
||||||
// 款项类型
|
// 款项类型
|
||||||
String paymenttype = dataEntity.getString("yem_paymenttype");
|
String paymenttype = dataEntity.getString("yem_paymenttype");
|
||||||
if ("A".equals(paymenttype)) {
|
// 是否见提单
|
||||||
|
String isladingbill = dataEntity.getString("yem_isladingbill");
|
||||||
|
|
||||||
|
Set<String> salesorder = new HashSet<>();
|
||||||
|
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_es_exportpre_erf");
|
||||||
|
for (DynamicObject d : collection) {
|
||||||
|
DynamicObject saleorder = d.getDynamicObject("yem_saleorder");
|
||||||
|
if (YEM.isNotEmpty(saleorder)) {
|
||||||
|
salesorder.add(saleorder.getString("billno"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String selectfields = DynamicObjectUtil.getSelectfields("yem_es_salesorder");
|
||||||
|
selectfields = DynamicObjectUtil.getEntrySelectfields(selectfields, "yem_es_salesorder", "yem_es_salescontrac_s");
|
||||||
|
Map<Object, DynamicObject> map = BusinessDataServiceHelper.loadFromCache("yem_es_salesorder", selectfields,new QFilter[]{new QFilter("billno", "in", salesorder)});
|
||||||
|
// 100%L/C,100%OA、100%DP、100%DA
|
||||||
|
boolean isRequireValidator = false;
|
||||||
|
for (Map.Entry<Object, DynamicObject> salesoerderEntry : map.entrySet()) {
|
||||||
|
DynamicObject order = salesoerderEntry.getValue();
|
||||||
|
DynamicObjectCollection salescontrac = order.getDynamicObjectCollection("yem_es_salescontrac_s");
|
||||||
|
for (DynamicObject d : salescontrac) {
|
||||||
|
DynamicObject rapstyle = d.getDynamicObject("yem_rapstyle_c");
|
||||||
|
BigDecimal raprate = d.getBigDecimal("yem_raprate");
|
||||||
|
if (YEM.isNotEmpty(rapstyle)) {
|
||||||
|
String number = rapstyle.getString("number");
|
||||||
|
if ("D/A JSFS08 L/C OA D/A".contains(number) && raprate.compareTo(new BigDecimal("100")) == 0) {
|
||||||
|
isRequireValidator = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("A".equals(paymenttype) && ("A".equals(isladingbill) || isRequireValidator)) {
|
||||||
arrearsVerification(dataEntity, data);
|
arrearsVerification(dataEntity, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user