合同成本核算优化添加成本项等字段赋值逻辑
This commit is contained in:
parent
549aa0dda2
commit
b412b5f31c
|
|
@ -56,6 +56,7 @@ import kd.bos.form.field.events.BeforeF7SelectListener;
|
|||
import kd.bos.form.operate.FormOperate;
|
||||
import kd.bos.list.ListFilterParameter;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.QueryServiceHelper;
|
||||
|
|
@ -81,6 +82,9 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* 合同成本核算系统二开插件
|
||||
**/
|
||||
public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin implements BeforeF7SelectListener, HyperLinkClickListener {
|
||||
private static final String UNITPROJECT = "unitproject";
|
||||
private static final String DIRECTION = "direction";
|
||||
|
|
@ -147,6 +151,14 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
this.getModel().setValue("isaddrow", true, rowIndex);
|
||||
Object settleNumber = this.getModel().getValue("settlenumber", parentRowIndex);
|
||||
this.getModel().setValue("subsettlenumber", settleNumber, rowIndex);
|
||||
//二开添加↓
|
||||
Object settleperiod = this.getModel().getValue("settleperiod", parentRowIndex);//计量单期间
|
||||
this.getModel().setValue("zcgj_costperiod", settleperiod, rowIndex);//成本期间
|
||||
Object zcgj_costtype = this.getModel().getValue("zcgj_costtype", parentRowIndex);//成本项
|
||||
this.getModel().setValue("costtype", zcgj_costtype, rowIndex);//成本项
|
||||
Object zcgj_sectype = this.getModel().getValue("zcgj_sectype", parentRowIndex);//二级分类
|
||||
this.getModel().setValue("zcgj_sectype1", zcgj_sectype, rowIndex);//二级分类
|
||||
//二开添加↑
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -654,6 +666,20 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
DynamicObject entry = new DynamicObject(entryDT);
|
||||
entry.set("contract", settleBill.get("contract"));
|
||||
entry.set("contractnumber", settleBill.get("contract.number"));
|
||||
//二开添加↓
|
||||
DynamicObject contract = settleBill.getDynamicObject("contract");//合同名称
|
||||
if (contract != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
entry.set("zcgj_costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
entry.set("zcgj_sectype", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
entry.set("settlenumber", settleBill.get("billno"));
|
||||
entry.set("settleid", settleBill.getPkValue());
|
||||
entry.set("settleperiod", settleBill.get("period"));
|
||||
|
|
@ -700,6 +726,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
String direction = item.getString("direction");
|
||||
if (!DirectionEnum.NON.getValue().equals(direction)) {
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", settleBill.get("period"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = settleBill.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleBill.getString("billno"));
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
BigDecimal amount = itemEntry.getBigDecimal("amount").multiply(exchangeRate);
|
||||
|
|
@ -768,6 +809,20 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
detailEntry = new DynamicObject(entryDT);
|
||||
detailEntry.set("contract", measureBill.get("contract"));
|
||||
detailEntry.set("contractnumber", measureBill.get("contract.number"));
|
||||
//二开添加↓
|
||||
DynamicObject contract = measureBill.getDynamicObject("contract");//合同名称
|
||||
if (contract != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
detailEntry.set("zcgj_costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
detailEntry.set("zcgj_sectype", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
detailEntry.set("settlenumber", measureBill.get("billno"));
|
||||
detailEntry.set("settleid", measureBill.getPkValue());
|
||||
detailEntry.set("settleperiod", measureBill.get("period"));
|
||||
|
|
@ -810,6 +865,20 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
BigDecimal exchangeRate = this.getBillExchangeRate(finalSettle);
|
||||
entry.set("contract", finalSettle.get("contract"));
|
||||
entry.set("contractnumber", finalSettle.get("contract.number"));
|
||||
//二开添加↓
|
||||
DynamicObject contract = finalSettle.getDynamicObject("contract");//合同名称
|
||||
if (contract != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
entry.set("zcgj_costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
entry.set("zcgj_sectype", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
entry.set("settlenumber", finalSettle.get("billno"));
|
||||
entry.set("settleid", finalSettle.getPkValue());
|
||||
Date date = finalSettle.getDate("bizdate");
|
||||
|
|
@ -1007,6 +1076,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
if (entry.getLong("id") == entryId) {
|
||||
int precision = this.getAmountPrecision();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
if (entry.get("cbs") != null) {
|
||||
|
|
@ -1065,6 +1149,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
if (entry.getLong("id") == entryId) {
|
||||
int precision = this.getAmountPrecision();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
if (entry.get("cbs") != null) {
|
||||
|
|
@ -1121,6 +1220,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
while (var20.hasNext()) {
|
||||
DynamicObject entry = (DynamicObject) var20.next();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
if (entry.get("cbs") != null) {
|
||||
|
|
@ -1152,6 +1266,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
}
|
||||
} else {
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
BigDecimal thisAmt = BigDecimal.ZERO;
|
||||
|
|
@ -1205,6 +1334,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
while (var20.hasNext()) {
|
||||
DynamicObject entry = (DynamicObject) var20.next();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", bill.getString("billno"));
|
||||
DynamicObject dy = entry.getDynamicObject("listing");
|
||||
if (dy != null) {
|
||||
|
|
@ -1316,6 +1460,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
while (var20.hasNext()) {
|
||||
DynamicObject entry = (DynamicObject) var20.next();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
if (entry.get("cbs") != null) {
|
||||
|
|
@ -1347,6 +1506,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
}
|
||||
} else {
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", newEntry.get("settleperiod"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = newEntry.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", settleNumber);
|
||||
subEntry.set("listingname", item.getString("name"));
|
||||
BigDecimal thisAmt = BigDecimal.ZERO;
|
||||
|
|
@ -1401,6 +1575,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
while (var33.hasNext()) {
|
||||
DynamicObject entry = (DynamicObject) var33.next();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", measureBill.get("period"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = measureBill.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", measureBill.getString("billno"));
|
||||
subEntry.set("listingname", entry.getString("listingname"));
|
||||
DynamicObject resourceitem = entry.getDynamicObject("resourceitem");
|
||||
|
|
@ -1470,6 +1659,21 @@ public class ContractCostSplitBillPluginExt extends AbstractEccoBillPlugin imple
|
|||
while (var15.hasNext()) {
|
||||
DynamicObject entry = (DynamicObject) var15.next();
|
||||
DynamicObject subEntry = new DynamicObject(subEntryDT);
|
||||
subEntry.set("zcgj_costperiod", measureBill.get("period"));//成本期间-二开添加
|
||||
//二开添加↓
|
||||
DynamicObject contract1 = measureBill.getDynamicObject("contract");//合同名称
|
||||
if (contract1 != null) {
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contract1.get("number"))};
|
||||
DynamicObject ec_all_contract_f7 = BusinessDataServiceHelper.loadSingle("ec_all_contract_f7", "contracttype", qFilters);//收入支出合同f7
|
||||
if (ec_all_contract_f7 != null) {
|
||||
DynamicObject contractType = ec_all_contract_f7.getDynamicObject("contracttype");//合同类型
|
||||
if (contractType != null) {
|
||||
subEntry.set("costtype", contractType.get("zcgj_costtype"));//成本项
|
||||
subEntry.set("zcgj_sectype1", contractType.get("zcgj_sectype"));//二级分类
|
||||
}
|
||||
}
|
||||
}
|
||||
//二开添加↑
|
||||
subEntry.set("subsettlenumber", measureBill.getString("billno"));
|
||||
subEntry.set("listingname", ResManager.loadKDString("计量款", "ContractCostSplitBillPlugin_10", "ec-ecco-formplugin", new Object[0]));
|
||||
if (entry.get("cbs") != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue