付款申请单操作插件优化
This commit is contained in:
parent
59ee6ccb42
commit
2ae8e62996
|
@ -9,6 +9,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||||
import kd.bos.dataentity.resource.ResManager;
|
import kd.bos.dataentity.resource.ResManager;
|
||||||
|
@ -41,11 +42,21 @@ class PaymentApplyInvoiceValidator extends AbstractValidator {
|
||||||
for (int var4 = 0; var4 < var3; ++var4) {
|
for (int var4 = 0; var4 < var3; ++var4) {
|
||||||
ExtendedDataEntity dataEntity = var2[var4];
|
ExtendedDataEntity dataEntity = var2[var4];
|
||||||
DynamicObject bill = dataEntity.getDataEntity();
|
DynamicObject bill = dataEntity.getDataEntity();
|
||||||
|
int a = 0;
|
||||||
|
String sourcetype = bill.getString("sourcetype");//付款类型
|
||||||
|
if (StringUtils.equals(sourcetype, "01")) {
|
||||||
|
//非合同付款
|
||||||
|
a++;
|
||||||
|
}
|
||||||
DynamicObjectCollection entries = bill.getDynamicObjectCollection("entryentity");
|
DynamicObjectCollection entries = bill.getDynamicObjectCollection("entryentity");
|
||||||
|
|
||||||
for (int i = 0; i < entries.size(); ++i) {
|
for (int i = 0; i < entries.size(); ++i) {
|
||||||
DynamicObject entry = (DynamicObject)entries.get(i);
|
DynamicObject entry = entries.get(i);
|
||||||
DynamicObject contract = entry.getDynamicObject("contract");
|
DynamicObject contract = null;
|
||||||
|
if (a == 0) {
|
||||||
|
//合同付款
|
||||||
|
contract = entry.getDynamicObject("contract");
|
||||||
|
}
|
||||||
DynamicObjectCollection subEntries = entry.getDynamicObjectCollection("subentryentity");
|
DynamicObjectCollection subEntries = entry.getDynamicObjectCollection("subentryentity");
|
||||||
if (contract!=null && contract.getBoolean("ismultirate") && (subEntries == null || subEntries.isEmpty())) {
|
if (contract!=null && contract.getBoolean("ismultirate") && (subEntries == null || subEntries.isEmpty())) {
|
||||||
this.addWarningMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】未添加发票,税额可能存在偏差,请确认。", "PaymentApplyInvoiceValidateOp_0", "ec-ecpf-opplugin", new Object[0]), contract.getString("name")));
|
this.addWarningMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】未添加发票,税额可能存在偏差,请确认。", "PaymentApplyInvoiceValidateOp_0", "ec-ecpf-opplugin", new Object[0]), contract.getString("name")));
|
||||||
|
|
|
@ -1,223 +0,0 @@
|
||||||
//
|
|
||||||
// Source code recreated from a .class file by IntelliJ IDEA
|
|
||||||
// (powered by FernFlower decompiler)
|
|
||||||
//
|
|
||||||
|
|
||||||
package zcgj.zcdev.zcdev.pr.plugin.form;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
||||||
import kd.bos.dataentity.metadata.dynamicobject.DynamicObjectType;
|
|
||||||
import kd.bos.dataentity.resource.ResManager;
|
|
||||||
import kd.bos.dataentity.utils.StringUtils;
|
|
||||||
import kd.bos.entity.EntityMetadataCache;
|
|
||||||
import kd.bos.entity.ExtendedDataEntity;
|
|
||||||
import kd.bos.entity.MainEntityType;
|
|
||||||
import kd.bos.entity.ValueMapItem;
|
|
||||||
import kd.bos.entity.property.ComboProp;
|
|
||||||
import kd.bos.entity.validate.AbstractValidator;
|
|
||||||
import kd.bos.orm.query.QFilter;
|
|
||||||
import kd.bos.servicehelper.QueryServiceHelper;
|
|
||||||
import kd.ec.basedata.common.enums.BillStatusEnum;
|
|
||||||
import kd.ec.basedata.common.enums.ContractStatusEnum;
|
|
||||||
import kd.ec.basedata.common.enums.PlanAmtTypeEnum;
|
|
||||||
|
|
||||||
public class PaymentTypeValidatorExt extends AbstractValidator {
|
|
||||||
public PaymentTypeValidatorExt() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void validate() {
|
|
||||||
String operateKey = this.getOperateKey();
|
|
||||||
if (StringUtils.equals("submit", operateKey)) {
|
|
||||||
this.validatePayType();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void validatePayType() {
|
|
||||||
Set<Long> balanceContractIds = new HashSet(16);
|
|
||||||
Set<Long> bondContractIds = new HashSet(16);
|
|
||||||
Set<Long> otherSubmitContractIds = new HashSet(16);
|
|
||||||
Set<Long> submitBalanceContractIds = new HashSet(16);
|
|
||||||
Set<Long> contractIds = new HashSet(16);
|
|
||||||
Set<Long> paymentIds = new HashSet(16);
|
|
||||||
ExtendedDataEntity[] dataEntities = this.getDataEntities();
|
|
||||||
ExtendedDataEntity[] var8 = dataEntities;
|
|
||||||
int var9 = dataEntities.length;
|
|
||||||
|
|
||||||
for(int var10 = 0; var10 < var9; ++var10) {
|
|
||||||
ExtendedDataEntity dataEntity = var8[var10];
|
|
||||||
DynamicObject bill = dataEntity.getDataEntity();
|
|
||||||
paymentIds.add(bill.getLong("id"));
|
|
||||||
DynamicObjectCollection entries = bill.getDynamicObjectCollection("entryentity");
|
|
||||||
Iterator var14 = entries.iterator();
|
|
||||||
|
|
||||||
while(var14.hasNext()) {
|
|
||||||
DynamicObject entry = (DynamicObject)var14.next();
|
|
||||||
String payType = entry.getString("paymenttype");
|
|
||||||
long contractId = entry.getDynamicObject("contract").getLong("id");
|
|
||||||
contractIds.add(contractId);
|
|
||||||
if (StringUtils.equals(PlanAmtTypeEnum.BALANCE.getValue(), payType)) {
|
|
||||||
balanceContractIds.add(contractId);
|
|
||||||
submitBalanceContractIds.add(contractId);
|
|
||||||
} else if (StringUtils.equals(PlanAmtTypeEnum.BOND.getValue(), payType)) {
|
|
||||||
bondContractIds.add(contractId);
|
|
||||||
} else {
|
|
||||||
otherSubmitContractIds.add(contractId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QFilter filter = new QFilter("entryentity.contract", "in", contractIds);
|
|
||||||
filter.and("id", "not in", paymentIds);
|
|
||||||
filter.and("billstatus", "in", new String[]{BillStatusEnum.SUBMIT.getValue(), BillStatusEnum.AUDIT.getValue()});
|
|
||||||
DynamicObjectCollection payments = QueryServiceHelper.query("ec_paymentapply", "billstatus,entryentity.contract,entryentity.paymenttype", new QFilter[]{filter});
|
|
||||||
Iterator var24 = payments.iterator();
|
|
||||||
|
|
||||||
while(var24.hasNext()) {
|
|
||||||
DynamicObject payment = (DynamicObject)var24.next();
|
|
||||||
String payType = payment.getString("entryentity.paymenttype");
|
|
||||||
long contractId = payment.getLong("entryentity.contract");
|
|
||||||
if (StringUtils.equals(PlanAmtTypeEnum.BALANCE.getValue(), payType)) {
|
|
||||||
balanceContractIds.add(contractId);
|
|
||||||
if (StringUtils.equals(BillStatusEnum.SUBMIT.getValue(), payment.getString("billstatus"))) {
|
|
||||||
submitBalanceContractIds.add(contractId);
|
|
||||||
}
|
|
||||||
} else if (StringUtils.equals(PlanAmtTypeEnum.BOND.getValue(), payType)) {
|
|
||||||
bondContractIds.add(contractId);
|
|
||||||
} else if (StringUtils.equals(BillStatusEnum.SUBMIT.getValue(), payment.getString("billstatus"))) {
|
|
||||||
otherSubmitContractIds.add(contractId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<Long, Set<String>> contractPayPlanTypes = this.getContractPayPlanTypes(contractIds);
|
|
||||||
Map<String, String> payTypeCombo = this.getPayTypeCombo();
|
|
||||||
ExtendedDataEntity[] var29 = dataEntities;
|
|
||||||
int var31 = dataEntities.length;
|
|
||||||
|
|
||||||
for(int var32 = 0; var32 < var31; ++var32) {
|
|
||||||
ExtendedDataEntity dataEntity = var29[var32];
|
|
||||||
DynamicObject bill = dataEntity.getDataEntity();
|
|
||||||
DynamicObjectCollection entries = bill.getDynamicObjectCollection("entryentity");
|
|
||||||
Iterator var18 = entries.iterator();
|
|
||||||
|
|
||||||
while(var18.hasNext()) {
|
|
||||||
DynamicObject entry = (DynamicObject)var18.next();
|
|
||||||
DynamicObject contract = entry.getDynamicObject("contract");
|
|
||||||
String payType = entry.getString("paymenttype");
|
|
||||||
this.contractPayPlanValidate(dataEntity, contract, payType, contractPayPlanTypes, payTypeCombo);
|
|
||||||
this.prePayTypeValidate(dataEntity, contract, payType);
|
|
||||||
this.payStageValidate(balanceContractIds, bondContractIds, payTypeCombo, dataEntity, contract, payType);
|
|
||||||
this.payMethodValidate(dataEntity, contract, payType);
|
|
||||||
this.balanceTypeValidate(otherSubmitContractIds, dataEntity, contract, payType);
|
|
||||||
this.bondTypeValidate(submitBalanceContractIds, otherSubmitContractIds, dataEntity, contract, payType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void contractPayPlanValidate(ExtendedDataEntity dataEntity, DynamicObject contract, String payType, Map<Long, Set<String>> contractPayPlanTypes, Map<String, String> payTypeCombo) {
|
|
||||||
Set<String> types = (Set)contractPayPlanTypes.get(contract.getLong("id"));
|
|
||||||
if (types != null && !types.contains(payType) && !StringUtils.equals(PlanAmtTypeEnum.BALANCE.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%1$s】付款条件中不包含付款类型【%2$s】,不允许付款。", "PaymentTypeValidator_8", "ec-contract-opplugin", new Object[0]), contract.getString("name"), payTypeCombo.getOrDefault(payType, "")));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Map<Long, Set<String>> getContractPayPlanTypes(Set<Long> contractIds) {
|
|
||||||
Map<Long, Set<String>> payPlanTypeMap = new HashMap(contractIds.size());
|
|
||||||
QFilter contractFilter = new QFilter("id", "in", contractIds);
|
|
||||||
DynamicObjectCollection contracts = QueryServiceHelper.query("ec_out_contract", "id,outcontpayplanentry.paytype", new QFilter[]{contractFilter});
|
|
||||||
|
|
||||||
Iterator var5;
|
|
||||||
long contractId;
|
|
||||||
Set payPlanTypes;
|
|
||||||
for(var5 = contracts.iterator(); var5.hasNext(); payPlanTypeMap.put(contractId, payPlanTypes)) {
|
|
||||||
DynamicObject contract = (DynamicObject)var5.next();
|
|
||||||
contractId = contract.getLong("id");
|
|
||||||
payPlanTypes = (Set)payPlanTypeMap.getOrDefault(contractId, new HashSet(4));
|
|
||||||
String type = contract.getString("outcontpayplanentry.paytype");
|
|
||||||
if (StringUtils.isNotEmpty(type)) {
|
|
||||||
payPlanTypes.add(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var5 = payPlanTypeMap.values().iterator();
|
|
||||||
|
|
||||||
while(var5.hasNext()) {
|
|
||||||
Set<String> planTypes = (Set)var5.next();
|
|
||||||
if (planTypes.isEmpty()) {
|
|
||||||
planTypes.add(PlanAmtTypeEnum.PREPAYMENT.getValue());
|
|
||||||
planTypes.add(PlanAmtTypeEnum.SETTLEPAYMENT.getValue());
|
|
||||||
planTypes.add(PlanAmtTypeEnum.BALANCE.getValue());
|
|
||||||
planTypes.add(PlanAmtTypeEnum.BOND.getValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return payPlanTypeMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void bondTypeValidate(Set<Long> submitBalanceContractIds, Set<Long> otherSubmitContractIds, ExtendedDataEntity dataEntity, DynamicObject contract, String payType) {
|
|
||||||
long contractId = contract.getLong("id");
|
|
||||||
if (StringUtils.equals(payType, PlanAmtTypeEnum.BOND.getValue()) && (otherSubmitContractIds.contains(contractId) || submitBalanceContractIds.contains(contractId))) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】存在其他在途付款申请,无法进行质保金支付。", "PaymentTypeValidator_1", "ec-contract-opplugin", new Object[0]), contract.getString("name")));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void balanceTypeValidate(Set<Long> otherSubmitContractIds, ExtendedDataEntity dataEntity, DynamicObject contract, String payType) {
|
|
||||||
if (StringUtils.equals(payType, PlanAmtTypeEnum.BALANCE.getValue()) && otherSubmitContractIds.contains(contract.getLong("id"))) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】存在其他在途付款申请,无法进行尾款支付。", "PaymentTypeValidator_2", "ec-contract-opplugin", new Object[0]), contract.getString("name")));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void payMethodValidate(ExtendedDataEntity dataEntity, DynamicObject contract, String payType) {
|
|
||||||
if (contract.getBoolean("ispaybytasknode") && StringUtils.equals(PlanAmtTypeEnum.SETTLEPAYMENT.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】为按节点支付,无法进行结算款支付。", "PaymentTypeValidator_3", "ec-contract-opplugin", new Object[0]), contract.getString("name")));
|
|
||||||
} else if (!contract.getBoolean("ispaybytasknode") && StringUtils.equals(PlanAmtTypeEnum.PROGRESSPAYMENT.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】为按月支付,无法进行进度款支付。", "PaymentTypeValidator_4", "ec-contract-opplugin", new Object[0]), contract.getString("name")));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void payStageValidate(Set<Long> balanceContractIds, Set<Long> bondContractIds, Map<String, String> payTypeCombo, ExtendedDataEntity dataEntity, DynamicObject contract, String payType) {
|
|
||||||
if (bondContractIds.contains(contract.getLong("id")) && !StringUtils.equals(PlanAmtTypeEnum.BOND.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%1$s】已进入质保金支付阶段,无法进行%2$s支付。", "PaymentTypeValidator_9", "ec-contract-opplugin", new Object[0]), contract.getString("name"), payTypeCombo.get(payType)));
|
|
||||||
} else if (balanceContractIds.contains(contract.getLong("id")) && !StringUtils.equals(PlanAmtTypeEnum.BALANCE.getValue(), payType) && !StringUtils.equals(PlanAmtTypeEnum.BOND.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%1$s】已进入尾款支付阶段,无法进行%2$s支付。", "PaymentTypeValidator_10", "ec-contract-opplugin", new Object[0]), contract.getString("name"), payTypeCombo.get(payType)));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void prePayTypeValidate(ExtendedDataEntity dataEntity, DynamicObject contract, String payType) {
|
|
||||||
String contStatus = contract.getString("contstatus");
|
|
||||||
if (StringUtils.equals(contStatus, ContractStatusEnum.OVERSETTLE.getValue()) && StringUtils.equals(PlanAmtTypeEnum.PREPAYMENT.getValue(), payType)) {
|
|
||||||
this.addErrorMessage(dataEntity, String.format(ResManager.loadKDString("合同【%s】已决算,无法进行预付款支付。", "PaymentTypeValidator_7", "ec-contract-opplugin", new Object[0]), contract.getString("name")));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected Map<String, String> getPayTypeCombo() {
|
|
||||||
MainEntityType paymentType = EntityMetadataCache.getDataEntityType("ec_paymentapply");
|
|
||||||
DynamicObject paymentBill = new DynamicObject(paymentType);
|
|
||||||
DynamicObjectType entryType = paymentBill.getDynamicObjectCollection("entryentity").getDynamicObjectType();
|
|
||||||
ComboProp payTypeCombo = (ComboProp)entryType.getProperty("paymenttype");
|
|
||||||
List<ValueMapItem> comboItems = payTypeCombo.getComboItems();
|
|
||||||
Map<String, String> payTypeComboMap = new HashMap(comboItems.size());
|
|
||||||
Iterator var7 = comboItems.iterator();
|
|
||||||
|
|
||||||
while(var7.hasNext()) {
|
|
||||||
ValueMapItem comboItem = (ValueMapItem)var7.next();
|
|
||||||
payTypeComboMap.put(comboItem.getValue(), comboItem.getName().getLocaleValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
return payTypeComboMap;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,7 +14,6 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
import kd.ec.contract.opplugin.fund.PaymentApplyFundOp;
|
import kd.ec.contract.opplugin.fund.PaymentApplyFundOp;
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentMaxAmountValidator;
|
import kd.ec.contract.opplugin.fund.validator.PaymentMaxAmountValidator;
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentTypeValidator;
|
import kd.ec.contract.opplugin.fund.validator.PaymentTypeValidator;
|
||||||
import kd.ec.contract.opplugin.validator.ContractMeasureValidator;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
|
@ -24,13 +24,9 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import kd.bos.servicehelper.operation.DeleteServiceHelper;
|
import kd.bos.servicehelper.operation.DeleteServiceHelper;
|
||||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
import kd.ec.basedata.common.enums.PlanAmtTypeEnum;
|
import kd.ec.basedata.common.enums.PlanAmtTypeEnum;
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentDeductionValidator;
|
import kd.ec.contract.opplugin.fund.validator.*;
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentMaxAmountValidator;
|
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentPlanValidator;
|
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentProgressValidator;
|
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentReferenceValidator;
|
|
||||||
import kd.ec.contract.opplugin.fund.validator.PaymentTypeValidator;
|
|
||||||
|
|
||||||
|
//付款申请单二开系统插件:提交,审核,反审核操作注册的系统插件(暂废
|
||||||
public class PaymentApplyFundOpExt extends AbstractOperationServicePlugIn {
|
public class PaymentApplyFundOpExt extends AbstractOperationServicePlugIn {
|
||||||
public PaymentApplyFundOpExt() {
|
public PaymentApplyFundOpExt() {
|
||||||
}
|
}
|
||||||
|
@ -174,6 +170,11 @@ public class PaymentApplyFundOpExt extends AbstractOperationServicePlugIn {
|
||||||
for(int var5 = 0; var5 < var4; ++var5) {
|
for(int var5 = 0; var5 < var4; ++var5) {
|
||||||
DynamicObject paymentApply = var3[var5];
|
DynamicObject paymentApply = var3[var5];
|
||||||
DynamicObjectCollection entryCol = paymentApply.getDynamicObjectCollection("entryentity");
|
DynamicObjectCollection entryCol = paymentApply.getDynamicObjectCollection("entryentity");
|
||||||
|
String sourcetype = paymentApply.getString("sourcetype");//付款类型
|
||||||
|
if (StringUtils.equals(sourcetype, "01")) {
|
||||||
|
//非合同付款
|
||||||
|
break;
|
||||||
|
}
|
||||||
Iterator var8 = entryCol.iterator();
|
Iterator var8 = entryCol.iterator();
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
|
@ -22,6 +22,7 @@ import kd.bos.orm.query.QFilter;
|
||||||
import kd.bos.servicehelper.QueryServiceHelper;
|
import kd.bos.servicehelper.QueryServiceHelper;
|
||||||
import kd.ec.basedata.common.enums.ContractStatusEnum;
|
import kd.ec.basedata.common.enums.ContractStatusEnum;
|
||||||
|
|
||||||
|
//付款申请单提交操作插件
|
||||||
public class PaymentContSubmitOpExt extends AbstractOperationServicePlugIn {
|
public class PaymentContSubmitOpExt extends AbstractOperationServicePlugIn {
|
||||||
public PaymentContSubmitOpExt() {
|
public PaymentContSubmitOpExt() {
|
||||||
}
|
}
|
||||||
|
@ -43,11 +44,21 @@ public class PaymentContSubmitOpExt extends AbstractOperationServicePlugIn {
|
||||||
for(int var5 = 0; var5 < var4; ++var5) {
|
for(int var5 = 0; var5 < var4; ++var5) {
|
||||||
ExtendedDataEntity dataEntity = var3[var5];
|
ExtendedDataEntity dataEntity = var3[var5];
|
||||||
long newFormId = (Long)dataEntity.getDataEntity().getPkValue();
|
long newFormId = (Long)dataEntity.getDataEntity().getPkValue();
|
||||||
|
int a = 0;
|
||||||
|
String sourcetype = dataEntity.getDataEntity().getString("sourcetype");//付款类型
|
||||||
|
if (StringUtils.equals(sourcetype, "01")) {
|
||||||
|
//非合同付款
|
||||||
|
a++;
|
||||||
|
}
|
||||||
DynamicObjectCollection entryEntity = dataEntity.getDataEntity().getDynamicObjectCollection("entryentity");
|
DynamicObjectCollection entryEntity = dataEntity.getDataEntity().getDynamicObjectCollection("entryentity");
|
||||||
|
|
||||||
for(int i = 0; i < entryEntity.size(); ++i) {
|
for(int i = 0; i < entryEntity.size(); ++i) {
|
||||||
DynamicObject row = (DynamicObject)entryEntity.get(i);
|
DynamicObject row = (DynamicObject)entryEntity.get(i);
|
||||||
DynamicObject contract = row.getDynamicObject("contract");
|
DynamicObject contract = null;
|
||||||
|
if (a == 0) {
|
||||||
|
//合同付款
|
||||||
|
contract = row.getDynamicObject("contract");
|
||||||
|
}
|
||||||
if (contract != null) {
|
if (contract != null) {
|
||||||
String contStatus = contract.getString("contstatus");
|
String contStatus = contract.getString("contstatus");
|
||||||
String contName = contract.getString("name");
|
String contName = contract.getString("name");
|
||||||
|
|
Loading…
Reference in New Issue