收入合同结算优化期间切换导致的bug修复及其他

This commit is contained in:
xuhaihui 2026-01-21 17:24:30 +08:00
parent 7cd5e7f9ff
commit 6dc491c5cf
3 changed files with 58 additions and 6 deletions

View File

@ -10,6 +10,10 @@ import kd.bos.servicehelper.QueryServiceHelper;
import java.util.EventObject; import java.util.EventObject;
/**
* 出差申请单移动端表单插件
* 说明机票审批相关逻辑
*/
public class TripReqBillFlightMobPlugin extends AbstractBillPlugIn { public class TripReqBillFlightMobPlugin extends AbstractBillPlugIn {
@Override @Override
public void afterCopyData(EventObject e) { public void afterCopyData(EventObject e) {

View File

@ -41,11 +41,11 @@ public class ContractSettleBillPlugin extends ContractSettleCommonEditPlugin{
if (zcgjEnddate!=null){ if (zcgjEnddate!=null){
Date nowdate = new Date(); Date nowdate = new Date();
int timeDays = PluginUtils.getTimeDays(zcgjEnddate, nowdate); int timeDays = PluginUtils.getTimeDays(zcgjEnddate, nowdate);
int endDays = Integer.parseInt(System.getProperty("contract.enddays")); // int endDays = Integer.parseInt(System.getProperty("contract.enddays"));
// int endDays = 100; //// int endDays = 100;
if (timeDays-endDays<=0){ // if (timeDays-endDays<=0){
this.getView().showTipNotification("当前选择合同距离到期不足"+endDays+"天!"); // this.getView().showTipNotification("当前选择合同距离到期不足"+endDays+"天!");
} // }
} }
} }
DynamicObject contract = (DynamicObject)changeData.getNewValue(); DynamicObject contract = (DynamicObject)changeData.getNewValue();
@ -102,6 +102,50 @@ public class ContractSettleBillPlugin extends ContractSettleCommonEditPlugin{
} }
} }
}*/ }*/
protected void periodChanged(ChangeData changeData) {
DynamicObject period = (DynamicObject) changeData.getNewValue();
this.getModel().setValue("begindate", period == null ? null : period.getDate("begindate"));
this.getModel().setValue("enddate", period == null ? null : period.getDate("enddate"));
this.reloadMeasureDetails();
this.reloadMaterialOutDetails();
//二开添加
DynamicObjectCollection itemEntryCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("itementry");//支付项分录
// 存储第一行和第二行的 pkValue
Object firstPkValue = null;
Object secondPkValue = null;
// 用于记录是否已经处理了第一行和第二行
boolean hasFirst = false;
boolean hasSecond = false;
for (DynamicObject itemEntry : itemEntryCollection) {
Object seq = itemEntry.get("seq");
if (seq.equals(1) || seq.equals(2)) {
DynamicObject payitem = itemEntry.getDynamicObject("payitem");
if (payitem != null) {
Object pkValue = payitem.getPkValue();
// 根据 seq 值存储对应的 pkValue
if (seq.equals(1) && !hasFirst) {
firstPkValue = pkValue;
hasFirst = true;
} else if (seq.equals(2) && !hasSecond) {
secondPkValue = pkValue;
hasSecond = true;
}
}
}
}
if (hasFirst && hasSecond) {
if (firstPkValue != null && firstPkValue.equals(secondPkValue)) {
DynamicObject itemEntry = this.getModel().getEntryRowEntity("itementry", 0);
if (itemEntry != null) {
BigDecimal ofTaxAmount = itemEntry.getBigDecimal("oftaxamount");//含税金额
if (ofTaxAmount.compareTo(BigDecimal.ZERO) == 0) {
this.getModel().deleteEntryRow("itementry", 0);
}
}
}
}
//二开添加
}
private void taxamtChanged(ChangeData changeData) { private void taxamtChanged(ChangeData changeData) {
int rowIndex = changeData.getRowIndex(); int rowIndex = changeData.getRowIndex();

View File

@ -75,7 +75,11 @@ public class OutContractSettleUnauditCheckOp extends AbstractOperationServicePlu
bindInvoice("1", dynamicObject.getLong("id")); bindInvoice("1", dynamicObject.getLong("id"));
QFilter idFilter = new QFilter("id", "=", dynamicObject.getLong("id")); QFilter idFilter = new QFilter("id", "=", dynamicObject.getLong("id"));
QFilter statusFilter = new QFilter("billstatus", "=", "A"); QFilter statusFilter = new QFilter("billstatus", "=", "A");
DeleteServiceHelper.delete("zcgj_ec_out_finaceconfirm", new QFilter[]{idFilter.and(statusFilter)}); try {
DeleteServiceHelper.delete("zcgj_ec_out_finaceconfirm", new QFilter[]{idFilter.and(statusFilter)});
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
} }