收入合同结算单增加反审核校验逻辑
This commit is contained in:
parent
9f96ccdfc8
commit
66a15b3152
|
@ -0,0 +1,58 @@
|
|||
package zcgj.zcdev.zcdev.pr.plugin.operate;
|
||||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.ExtendedDataEntity;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
|
||||
/**
|
||||
* 收入合同结算冲销单反审核校验是否生成收入合同冲销单
|
||||
*/
|
||||
public class InContractSettleUnauditCheckOp extends AbstractOperationServicePlugIn {
|
||||
|
||||
@Override
|
||||
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||
super.onPreparePropertys(e);
|
||||
e.getFieldKeys().add("billno");
|
||||
//e.getFieldKeys().add("contract.zcgj_pricetype");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||
super.onAddValidators(e);
|
||||
//当前所在的组织是属于矿山下的
|
||||
e.getValidators().add(new ValidatorExt());
|
||||
}
|
||||
|
||||
class ValidatorExt extends AbstractValidator {
|
||||
@Override
|
||||
public void validate() {
|
||||
ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
|
||||
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
|
||||
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
|
||||
String billId = dataEntity.getString("id");
|
||||
String billno = dataEntity.getString("billno");
|
||||
//冲销单据
|
||||
/*boolean isReversabillid = dataEntity.getBoolean("zcgj_is_reversabillid");
|
||||
if (isReversabillid) {
|
||||
DynamicObject[] load = BusinessDataServiceHelper.load("ec_in_contract_settle", "id,zcgj_reversabillid", new QFilter[]{new QFilter("zcgj_ec_outsettleid", QCP.equals, billId)});
|
||||
if (load != null && load.length > 0) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "收入合同结算冲销单【"+billno+"】存在收入合同结算冲销单,请删除收入合同结算冲销单后再进行反审核操作。");
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
DynamicObject[] load = BusinessDataServiceHelper.load("zcgj_ec_in_finaceconfirm", "id,zcgj_ec_in_contractid", new QFilter[]{new QFilter("zcgj_ec_in_contractid", QCP.equals, billId)});
|
||||
if (load != null && load.length > 0) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "收入合同结算单【"+billno+"】存在收入合同确认单,请删除收入合同确认单后再进行反审核操作。");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue