Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zhangzhiguo 2024-12-20 17:14:01 +08:00
commit 108b3ebbfd
5 changed files with 82 additions and 56 deletions

View File

@ -390,12 +390,12 @@ null && visaBillArr.length != 0) {
DynamicObject[] materialOutBillArr = this.getMaterialOutBillArr(materialOutBillFilter); DynamicObject[] materialOutBillArr = this.getMaterialOutBillArr(materialOutBillFilter);
String entityId = this.getView().getParentView().getEntityId(); String entityId = this.getView().getParentView().getEntityId();
// if (!StringUtils.equals(entityId, "ec_out_contract_settle") || !(Boolean)parentModel.getValue("iseqsettle")) { // if (!StringUtils.equals(entityId, "ec_out_contract_settle") || !(Boolean)parentModel.getValue("iseqsettle")) {
// DynamicObject[] measureBillArr = this.getMeasureBillArr(measureBillFilter); DynamicObject[] measureBillArr = this.getMeasureBillArr(measureBillFilter);
// if (payDirection.equals(PayDirectionEnum.IN.getValue())) { if (payDirection.equals(PayDirectionEnum.IN.getValue())) {
// this.setMeasureBillDataToEntry(entryCollection, measureBillArr); this.setMeasureBillDataToEntry(entryCollection, measureBillArr);
// } else { } else {
// this.setMeasureBillDataToEntryOut(entryCollection, measureBillArr); this.setMeasureBillDataToEntryOut(entryCollection, measureBillArr);
// } }
// } // }
this.setClaimArrDataToEntry(entryCollection, claimArr); this.setClaimArrDataToEntry(entryCollection, claimArr);

View File

@ -60,17 +60,17 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin {
// contractType = "ck"; // contractType = "ck";
// this.getPageCache().remove("firstOpen"); // this.getPageCache().remove("firstOpen");
if (contractType != null) { if (contractType != null) {
if (contractType.toString().equals("wzcg01")) {//物资采购 // if (contractType.toString().equals("wzcg01")) {//物资采购
this.getView().setVisible(true, new String[]{"flexpanelmaterial"}); // this.getView().setVisible(true, new String[]{"flexpanelmaterial"});
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelturnover","flexpanelother"}); // this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelturnover","flexpanelother"});
} else if (contractType.toString().equals("sbcg")) {//设备采购 // } else if (contractType.toString().equals("sbcg")) {//设备采购
this.getView().setVisible(true, new String[]{"flexpanelequipment"}); // this.getView().setVisible(true, new String[]{"flexpanelequipment"});
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelmaterial", "flexpanelturnover","flexpanelother"}); // this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelmaterial", "flexpanelturnover","flexpanelother"});
}else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")|| contractType.toString().equals("ck")|| // }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")|| contractType.toString().equals("ck")||
contractType.toString().equals("zyfbcc")|| contractType.toString().equals("jjbc")) {//产出物 // contractType.toString().equals("zyfbcc")|| contractType.toString().equals("jjbc")) {//产出物
this.getView().setVisible(true, new String[]{"flexpanelturnover"}); // this.getView().setVisible(true, new String[]{"flexpanelturnover"});
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelmaterial","flexpanelother"}); // this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelmaterial","flexpanelother"});
} // }
} }
} }
} }

View File

@ -26,7 +26,7 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
int var7 = dataEntities.length; int var7 = dataEntities.length;
DynamicObject changeListing; DynamicObject changeListing;
for(int var8 = 0; var8 < var7; ++var8) { for (int var8 = 0; var8 < var7; ++var8) {
ExtendedDataEntity dataEntity = var6[var8]; ExtendedDataEntity dataEntity = var6[var8];
changeListing = dataEntity.getDataEntity(); changeListing = dataEntity.getDataEntity();
if (!excludeIds.contains(changeListing.getLong("id"))) { if (!excludeIds.contains(changeListing.getLong("id"))) {
@ -34,13 +34,13 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
DynamicObjectCollection modelEntries = changeListing.getDynamicObjectCollection("listmodelentry"); DynamicObjectCollection modelEntries = changeListing.getDynamicObjectCollection("listmodelentry");
Iterator var12 = modelEntries.iterator(); Iterator var12 = modelEntries.iterator();
while(var12.hasNext()) { while (var12.hasNext()) {
DynamicObject modelEntry = (DynamicObject)var12.next(); DynamicObject modelEntry = (DynamicObject) var12.next();
DynamicObjectCollection listingEntries = modelEntry.getDynamicObjectCollection("listentry"); DynamicObjectCollection listingEntries = modelEntry.getDynamicObjectCollection("listentry");
Iterator var15 = listingEntries.iterator(); Iterator var15 = listingEntries.iterator();
while(var15.hasNext()) { while (var15.hasNext()) {
DynamicObject listingEntry = (DynamicObject)var15.next(); DynamicObject listingEntry = (DynamicObject) var15.next();
DynamicObject listing = listingEntry.getDynamicObject("listing"); DynamicObject listing = listingEntry.getDynamicObject("listing");
if (listing != null && !listingIds.add(listing.getLong("id"))) { if (listing != null && !listingIds.add(listing.getLong("id"))) {
repeatListingIds.add(listing.getLong("id")); repeatListingIds.add(listing.getLong("id"));
@ -57,8 +57,8 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
Set<Long> changedListingIds = new HashSet(16); Set<Long> changedListingIds = new HashSet(16);
Iterator var30 = changeListings.iterator(); Iterator var30 = changeListings.iterator();
while(var30.hasNext()) { while (var30.hasNext()) {
changeListing = (DynamicObject)var30.next(); changeListing = (DynamicObject) var30.next();
changedListingIds.add(changeListing.getLong("kapianentry.entryentity.listid")); changedListingIds.add(changeListing.getLong("kapianentry.entryentity.listid"));
} }
@ -69,7 +69,7 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
int var36 = listings.length; int var36 = listings.length;
DynamicObject measureListing; DynamicObject measureListing;
for(int var38 = 0; var38 < var36; ++var38) { for (int var38 = 0; var38 < var36; ++var38) {
measureListing = var34[var38]; measureListing = var34[var38];
listingQtyBalance.put(measureListing.getLong("id"), measureListing.getBigDecimal("totalqty")); listingQtyBalance.put(measureListing.getLong("id"), measureListing.getBigDecimal("totalqty"));
} }
@ -80,11 +80,11 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
DynamicObjectCollection measureListings = QueryServiceHelper.query("ec_incontractmeasure", "listmodelentry.listentry.listing,listmodelentry.listentry.thisqty", new QFilter[]{filter}); DynamicObjectCollection measureListings = QueryServiceHelper.query("ec_incontractmeasure", "listmodelentry.listentry.listing,listmodelentry.listentry.thisqty", new QFilter[]{filter});
Iterator var39 = measureListings.iterator(); Iterator var39 = measureListings.iterator();
while(var39.hasNext()) { while (var39.hasNext()) {
measureListing = (DynamicObject)var39.next(); measureListing = (DynamicObject) var39.next();
long listingId = measureListing.getLong("listmodelentry.listentry.listing"); long listingId = measureListing.getLong("listmodelentry.listentry.listing");
if (listingId != 0L) { if (listingId != 0L) {
BigDecimal qtyBalance = (BigDecimal)listingQtyBalance.getOrDefault(listingId, BigDecimal.ZERO); BigDecimal qtyBalance = (BigDecimal) listingQtyBalance.getOrDefault(listingId, BigDecimal.ZERO);
listingQtyBalance.put(listingId, qtyBalance.subtract(measureListing.getBigDecimal("listmodelentry.listentry.thisqty"))); listingQtyBalance.put(listingId, qtyBalance.subtract(measureListing.getBigDecimal("listmodelentry.listentry.thisqty")));
} }
} }
@ -92,20 +92,35 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
ExtendedDataEntity[] var41 = dataEntities; ExtendedDataEntity[] var41 = dataEntities;
int var42 = dataEntities.length; int var42 = dataEntities.length;
for(int var44 = 0; var44 < var42; ++var44) { for (int var44 = 0; var44 < var42; ++var44) {
ExtendedDataEntity dataEntity = var41[var44]; ExtendedDataEntity dataEntity = var41[var44];
DynamicObject bill = dataEntity.getDataEntity(); DynamicObject bill = dataEntity.getDataEntity();
if (!excludeIds.contains(bill.getLong("id"))) { if (!excludeIds.contains(bill.getLong("id"))) {
DynamicObjectCollection modelEntries = bill.getDynamicObjectCollection("listmodelentry"); DynamicObjectCollection modelEntries = bill.getDynamicObjectCollection("listmodelentry");
Iterator var20 = modelEntries.iterator(); Iterator var20 = modelEntries.iterator();
int isTwo = 0;
while(var20.hasNext()) { if (modelEntries.size() > 1) {
DynamicObject modelEntry = (DynamicObject)var20.next(); DynamicObject object = modelEntries.get(0);
DynamicObjectCollection listingEntries = object.getDynamicObjectCollection("listentry");
if (!listingEntries.isEmpty()) {
isTwo++;
}
DynamicObject object1 = modelEntries.get(1);
DynamicObjectCollection listingEntries1 = object1.getDynamicObjectCollection("listentry");
if (!listingEntries1.isEmpty()) {
isTwo++;
}
if (isTwo > 1) {
this.addErrorMessage(dataEntity, "多清单时计量只可计量其中!请清空其中一个分录。");
}
}
while (var20.hasNext()) {
DynamicObject modelEntry = (DynamicObject) var20.next();
DynamicObjectCollection listingEntries = modelEntry.getDynamicObjectCollection("listentry"); DynamicObjectCollection listingEntries = modelEntry.getDynamicObjectCollection("listentry");
Iterator var23 = listingEntries.iterator(); Iterator var23 = listingEntries.iterator();
while(var23.hasNext()) { while (var23.hasNext()) {
DynamicObject listingEntry = (DynamicObject)var23.next(); DynamicObject listingEntry = (DynamicObject) var23.next();
DynamicObject listing = listingEntry.getDynamicObject("listing"); DynamicObject listing = listingEntry.getDynamicObject("listing");
if (listing != null) { if (listing != null) {
if (repeatListingIds.contains(listing.getLong("id"))) { if (repeatListingIds.contains(listing.getLong("id"))) {
@ -120,8 +135,11 @@ public class ContractMeasurementValidator extends ContractMeasureValidator {
} }
} }
} }
} }
} }
} }
} }

View File

@ -31,6 +31,10 @@ public class InContractSettlementValidator extends InContractSettleValidator {
if (itementry.size() == 0) { if (itementry.size() == 0) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
} }
BigDecimal oftaxamount = itementry.get(0).getBigDecimal("oftaxamount");
if (oftaxamount.compareTo(new BigDecimal(0)) > 0) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项分录中的金额不能为空!", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
}
DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract"); DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_in_contract");
BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount"); BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount");
BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount"); BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount");

View File

@ -18,32 +18,36 @@ public class OutContractSettlementValidator extends OutContractSettleValidator {
BigDecimal settleOfTaxAmount = dataEntity.getDataEntity().getBigDecimal("settleoftaxamount"); BigDecimal settleOfTaxAmount = dataEntity.getDataEntity().getBigDecimal("settleoftaxamount");
DynamicObject contractTemp = dataEntity.getDataEntity().getDynamicObject("contract"); DynamicObject contractTemp = dataEntity.getDataEntity().getDynamicObject("contract");
DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry"); DynamicObjectCollection itementry = dataEntity.getDataEntity().getDynamicObjectCollection("itementry");
if(itementry.isEmpty()) { if (itementry.isEmpty()) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项不能为空", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
}
BigDecimal oftaxamount = itementry.get(0).getBigDecimal("oftaxamount");
if (oftaxamount.compareTo(new BigDecimal(0)) > 0) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("支付合同项分录中的金额不能为空!", "InContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
}
if (contractTemp == null) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("合同不可为空。", "OutContractSettleValidator_5", "ec-contract-opplugin", new Object[0]));
return false;
} else {
DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_out_contract");
BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount");
BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount");
DynamicObject contractType = contract.getDynamicObject("contracttype");
DynamicObject contractAttr = contractType == null ? null : contractType.getDynamicObject("contattr");
boolean validateAmount = true;
if (contractAttr != null) {
contractAttr = BusinessDataServiceHelper.loadSingle(contractAttr.getPkValue(), "ec_contattr");
validateAmount = !StringUtils.equals("09", contractAttr.getString("basictype"));
} }
if (contractTemp == null) {
this.addErrorMessage(dataEntity, ResManager.loadKDString("合同不可为空。", "OutContractSettleValidator_5", "ec-contract-opplugin", new Object[0]));
return false;
} else {
DynamicObject contract = BusinessDataServiceHelper.loadSingle(dataEntity.getDataEntity().getDynamicObject("contract").getPkValue(), "ec_out_contract");
BigDecimal totalSettleOfTaxAmount = contract.getBigDecimal("totalsettleoftaxamount");
BigDecimal totalOfTaxAmount = contract.getBigDecimal("totaloftaxamount");
DynamicObject contractType = contract.getDynamicObject("contracttype");
DynamicObject contractAttr = contractType == null ? null : contractType.getDynamicObject("contattr");
boolean validateAmount = true;
if (contractAttr != null) {
contractAttr = BusinessDataServiceHelper.loadSingle(contractAttr.getPkValue(), "ec_contattr");
validateAmount = !StringUtils.equals("09", contractAttr.getString("basictype"));
}
if (validateAmount && settleOfTaxAmount.compareTo(totalOfTaxAmount.subtract(totalSettleOfTaxAmount)) > 0) { if (validateAmount && settleOfTaxAmount.compareTo(totalOfTaxAmount.subtract(totalSettleOfTaxAmount)) > 0) {
// this.addErrorMessage(dataEntity, ResManager.loadKDString("本期结算价税合计不能大于合同剩余金额价税合计", "OutContractSettleValidator_0", "ec-contract-opplugin", new Object[0])); // this.addErrorMessage(dataEntity, ResManager.loadKDString("本期结算价税合计不能大于合同剩余金额价税合计", "OutContractSettleValidator_0", "ec-contract-opplugin", new Object[0]));
return true; return true;
} else { } else {
return true; return true;
}
} }
}
} }
} }
} }