资金计划申请逻辑调整

This commit is contained in:
zhangzhiguo 2025-10-31 15:21:57 +08:00
parent 97bab7d834
commit a538eec7fb
2 changed files with 248 additions and 242 deletions

View File

@ -99,55 +99,56 @@ public class FundingplanapplyAccountBalancePlugin extends AbstractBillPlugIn imp
if(period == null){
//this.getView().showErrMessage("请选择期间!");
this.getView().showErrorNotification("请选择期间!");
}
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
}else{
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
for (DynamicObject custom : customs) {
Map<String, String> map1 = new HashMap<>();
DynamicObject basedataObj = custom.getDynamicObject("fbasedataid");
DynamicObject customer = BusinessDataServiceHelper.loadSingle( basedataObj.getPkValue(), "bd_customer");
map1.put("0001", customer.getString("number"));
li.add(map1);
}
accountAssgrp.put("1122", li);
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
groupBy.add("0001");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
BigDecimal totalendlocal = BigDecimal.ZERO;
BigDecimal totayeardebitfor = BigDecimal.ZERO;
BigDecimal totalyearcreditfor = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
totalendlocal = totalendlocal.add(record.getEndlocal());//期初本位币金额
totayeardebitfor = totayeardebitfor.add(record.getYeardebitfor());//yeardebitfor
totalyearcreditfor = totalyearcreditfor.add(record.getYearcreditfor());//yearcreditfor
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
for (DynamicObject custom : customs) {
Map<String, String> map1 = new HashMap<>();
DynamicObject basedataObj = custom.getDynamicObject("fbasedataid");
DynamicObject customer = BusinessDataServiceHelper.loadSingle( basedataObj.getPkValue(), "bd_customer");
map1.put("0001", customer.getString("number"));
li.add(map1);
}
accountAssgrp.put("1122", li);
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
groupBy.add("0001");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
BigDecimal totalendlocal = BigDecimal.ZERO;
BigDecimal totayeardebitfor = BigDecimal.ZERO;
BigDecimal totalyearcreditfor = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
totalendlocal = totalendlocal.add(record.getEndlocal());//期初本位币金额
totayeardebitfor = totayeardebitfor.add(record.getYeardebitfor());//yeardebitfor
totalyearcreditfor = totalyearcreditfor.add(record.getYearcreditfor());//yearcreditfor
}
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_infundproject_entry");
DynamicObject dynamicObject = zcgjFinApprovedAmount.get(rowIndex);
//年初余额 = 期末余额-本年累计借方+本年累计贷方
BigDecimal beginningbalanceofyear =totalendlocal.subtract(totayeardebitfor).add(totalyearcreditfor);
dynamicObject.set("zcgj_iinitialreceivable",beginningbalanceofyear);//年初余额取科目余额表年初数
dynamicObject.set("zcgj_monthbeginreceivable",totalbeginlocal);//月初应收余额
dynamicObject.set("zcgj_ytdoutputvalue",totayeardebitfor);//本年累计结算-借方
dynamicObject.set("zcgj_ytdpaymentreceived",totalyearcreditfor);//本年累计回款-贷方
this.getView().updateView("zcgj_infundproject_entry");
}
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_infundproject_entry");
DynamicObject dynamicObject = zcgjFinApprovedAmount.get(rowIndex);
//年初余额 = 期末余额-本年累计借方+本年累计贷方
BigDecimal beginningbalanceofyear =totalendlocal.subtract(totayeardebitfor).add(totalyearcreditfor);
dynamicObject.set("zcgj_iinitialreceivable",beginningbalanceofyear);//年初余额取科目余额表年初数
dynamicObject.set("zcgj_monthbeginreceivable",totalbeginlocal);//月初应收余额
dynamicObject.set("zcgj_ytdoutputvalue",totayeardebitfor);//本年累计结算-借方
dynamicObject.set("zcgj_ytdpaymentreceived",totalyearcreditfor);//本年累计回款-贷方
this.getView().updateView("zcgj_infundproject_entry");
}
}
@ -178,55 +179,56 @@ public class FundingplanapplyAccountBalancePlugin extends AbstractBillPlugIn imp
if(period == null){
//this.getView().showErrMessage("请选择期间!");
this.getView().showErrorNotification("请选择期间!");
}
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
}else{
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
for (DynamicObject supplier : suppliers) {
Map<String, String> map1 = new HashMap<>();
DynamicObject basedataObj = supplier.getDynamicObject("fbasedataid");
DynamicObject customer = BusinessDataServiceHelper.loadSingle( basedataObj.getPkValue(), "bd_supplier");
map1.put("0005", customer.getString("number"));
li.add(map1);
}
accountAssgrp.put("2202", li);
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
BigDecimal totalendlocal = BigDecimal.ZERO;
BigDecimal totayeardebitfor = BigDecimal.ZERO;
BigDecimal totalyearcreditfor = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
totalendlocal = totalendlocal.add(record.getEndlocal());//期初本位币金额
totayeardebitfor = totayeardebitfor.add(record.getYeardebitfor());//yeardebitfor
totalyearcreditfor = totalyearcreditfor.add(record.getYearcreditfor());//yearcreditfor
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
for (DynamicObject supplier : suppliers) {
Map<String, String> map1 = new HashMap<>();
DynamicObject basedataObj = supplier.getDynamicObject("fbasedataid");
DynamicObject customer = BusinessDataServiceHelper.loadSingle( basedataObj.getPkValue(), "bd_supplier");
map1.put("0005", customer.getString("number"));
li.add(map1);
}
accountAssgrp.put("2202", li);
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
BigDecimal totalendlocal = BigDecimal.ZERO;
BigDecimal totayeardebitfor = BigDecimal.ZERO;
BigDecimal totalyearcreditfor = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
totalendlocal = totalendlocal.add(record.getEndlocal());//期初本位币金额
totayeardebitfor = totayeardebitfor.add(record.getYeardebitfor());//yeardebitfor
totalyearcreditfor = totalyearcreditfor.add(record.getYearcreditfor());//yearcreditfor
}
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_outfundproject_entry");
DynamicObject dynamicObject = zcgjFinApprovedAmount.get(rowIndex);
//年初余额 = 期末余额-本年累计借方+本年累计贷方
BigDecimal beginningbalanceofyear =totalendlocal.subtract(totalyearcreditfor).add(totayeardebitfor);
dynamicObject.set("zcgj_openingpayable",beginningbalanceofyear);//年初余额取科目余额表年初数
dynamicObject.set("zcgj_monthbeginpayable",totalbeginlocal);//月初应付余额
dynamicObject.set("zcgj_ytdtotalpayment",totayeardebitfor);//本年累计付款-借方
dynamicObject.set("zcgj_ytdnetsettlement",totalyearcreditfor);//本年累计结算-贷方
this.getView().updateView("zcgj_outfundproject_entry");
}
DynamicObjectCollection zcgjFinApprovedAmount = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_outfundproject_entry");
DynamicObject dynamicObject = zcgjFinApprovedAmount.get(rowIndex);
//年初余额 = 期末余额-本年累计借方+本年累计贷方
BigDecimal beginningbalanceofyear =totalendlocal.subtract(totalyearcreditfor).add(totayeardebitfor);
dynamicObject.set("zcgj_openingpayable",beginningbalanceofyear);//年初余额取科目余额表年初数
dynamicObject.set("zcgj_monthbeginpayable",totalbeginlocal);//月初应付余额
dynamicObject.set("zcgj_ytdtotalpayment",totayeardebitfor);//本年累计付款-借方
dynamicObject.set("zcgj_ytdnetsettlement",totalyearcreditfor);//本年累计结算-贷方
this.getView().updateView("zcgj_outfundproject_entry");
}
}
}else{
@ -262,46 +264,47 @@ public class FundingplanapplyAccountBalancePlugin extends AbstractBillPlugIn imp
if(period == null){
//this.getView().showErrMessage("请选择期间!");
this.getView().showErrorNotification("请选择期间!");
}
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
accountAssgrp.put("1001", li); //现金
accountAssgrp.put("1002", li); //现金
// accountAssgrp.put("11260101", li); //银行承兑
//accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_cashamt",totalbeginlocal);//现金
this.getView().updateView("zcgj_fundplyentry");
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_cashamt",BigDecimal.ZERO);//现金
this.getView().updateView("zcgj_fundplyentry");
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
accountAssgrp.put("1001", li); //现金
accountAssgrp.put("1002", li); //现金
// accountAssgrp.put("11260101", li); //银行承兑
//accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_cashamt",totalbeginlocal);//现金
this.getView().updateView("zcgj_fundplyentry");
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_cashamt",BigDecimal.ZERO);//现金
this.getView().updateView("zcgj_fundplyentry");
}
}
}
}
@ -321,45 +324,46 @@ public class FundingplanapplyAccountBalancePlugin extends AbstractBillPlugIn imp
if(period == null){
//this.getView().showErrMessage("请选择期间!");
this.getView().showErrorNotification("请选择期间!");
}
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
//accountAssgrp.put("1001", li); //现金
//accountAssgrp.put("1002", li); //现金
accountAssgrp.put("11260101", li); //银行承兑
//accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_bankamt",totalbeginlocal);//银行承兑
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_bankamt",BigDecimal.ZERO);//银行承兑
this.getView().updateView("zcgj_fundplyentry");
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
//accountAssgrp.put("1001", li); //现金
//accountAssgrp.put("1002", li); //现金
accountAssgrp.put("11260101", li); //银行承兑
//accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_bankamt",totalbeginlocal);//银行承兑
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_bankamt",BigDecimal.ZERO);//银行承兑
this.getView().updateView("zcgj_fundplyentry");
}
}
}
@ -380,45 +384,46 @@ public class FundingplanapplyAccountBalancePlugin extends AbstractBillPlugIn imp
if(period == null){
//this.getView().showErrMessage("请选择期间!");
this.getView().showErrorNotification("请选择期间!");
}
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
//accountAssgrp.put("1001", li); //现金
//accountAssgrp.put("1002", li); //现金
//accountAssgrp.put("11260101", li); //银行承兑
accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_supplyamt",totalbeginlocal);//供应链
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_supplyamt",BigDecimal.ZERO);//供应链
this.getView().updateView("zcgj_fundplyentry");
balanceQueryParamApi.setPeriodNumber(period.getString("number")); //
List<String> groupBy = new ArrayList<>();
Map<String, List<Map<String, String>>> accountAssgrp = new HashMap<>();
List<Map<String, String>> li = new ArrayList<>();
//accountAssgrp.put("1001", li); //现金
//accountAssgrp.put("1002", li); //现金
//accountAssgrp.put("11260101", li); //银行承兑
accountAssgrp.put("11260301", li); //供应链
balanceQueryParamApi.setAccountAssgrp(accountAssgrp);
//groupBy.add("0005");
groupBy.add("account");
Gson gson = new Gson();
String json = gson.toJson(balanceQueryParamApi);
Map<String, Object> params = gson.fromJson(json,
new TypeToken<Map<String, Object>>() {
}.getType());
OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/gl/getBalanceApi", params);
if (balanceData.isStatus()) {
String data = (String) balanceData.getData();
Type listType = new TypeToken<List<AccountRecord>>() {
}.getType();
List<AccountRecord> records = gson.fromJson(data, listType);
BigDecimal totalbeginlocal = BigDecimal.ZERO;
for (AccountRecord record : records) {
totalbeginlocal = totalbeginlocal.add(record.getBeginlocal());//期初本位币金额
}
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_supplyamt",totalbeginlocal);//供应链
}else{
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
DynamicObject dynamicObject = fundplyentry.get(0);
dynamicObject.set("zcgj_supplyamt",BigDecimal.ZERO);//供应链
this.getView().updateView("zcgj_fundplyentry");
}
}
}
}

View File

@ -210,6 +210,12 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
this.getView().updateView("zcgj_infundlastentry");
}
BigDecimal cashamtAll = BigDecimal.ZERO;
BigDecimal bankamtAll = BigDecimal.ZERO;
BigDecimal businessamtAll = BigDecimal.ZERO;
BigDecimal supplyamtAll = BigDecimal.ZERO;
BigDecimal otheramtAll = BigDecimal.ZERO;
BigDecimal totalamtAll = BigDecimal.ZERO;
Object periodObj = this.getModel().getValue("zcgj_period");
if(periodObj!=null || periodParam !=null){
DynamicObject period = null;
@ -228,15 +234,9 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
",zcgj_fundplyentry.zcgj_totalamt " +
",createtime",
searchFilterListzj.toArray(new QFilter[]{}), "createtime desc");
if(loadzj!=null && loadzj.length>0){
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
BigDecimal cashamtAll = BigDecimal.ZERO;
BigDecimal bankamtAll = BigDecimal.ZERO;
BigDecimal businessamtAll = BigDecimal.ZERO;
BigDecimal supplyamtAll = BigDecimal.ZERO;
BigDecimal otheramtAll = BigDecimal.ZERO;
BigDecimal totalamtAll = BigDecimal.ZERO;
DynamicObjectCollection fundplyentry = this.getModel().getDataEntity(true).getDynamicObjectCollection("zcgj_fundplyentry");
if(loadzj != null){
for (DynamicObject dynamicObject : loadzj) {
DynamicObjectCollection zcgjFundplyentry = dynamicObject.getDynamicObjectCollection("zcgj_fundplyentry");
for (DynamicObject dy : zcgjFundplyentry) {
@ -257,34 +257,35 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin
totalamtAll = totalamtAll.add(zcgjTotalamt);
}
}
}
DynamicObject fundplyentry3 = fundplyentry.get(3);
fundplyentry3.set("zcgj_cashamt", cashamtAll);
fundplyentry3.set("zcgj_bankamt", bankamtAll);
fundplyentry3.set("zcgj_businessamt", businessamtAll);
fundplyentry3.set("zcgj_supplyamt", supplyamtAll);
fundplyentry3.set("zcgj_otheramt", otheramtAll);
fundplyentry3.set("zcgj_totalamt", totalamtAll);
this.getModel().setValue("zcgj_cashamtbak", cashamtAll);
this.getModel().setValue("zcgj_bankamtbak", bankamtAll);
this.getModel().setValue("zcgj_businessamtbak", businessamtAll);
this.getModel().setValue("zcgj_supplyamtbak", supplyamtAll);
this.getModel().setValue("zcgj_otheramtbak", otheramtAll);
this.getModel().setValue("zcgj_totalamtbak", totalamtAll);
this.getView().updateView("zcgj_fundplyentry");
this.getView().updateView("zcgj_cashamtbak");
this.getView().updateView("zcgj_bankamtbak");
this.getView().updateView("zcgj_businessamtbak");
this.getView().updateView("zcgj_supplyamtbak");
this.getView().updateView("zcgj_otheramtbak");
this.getView().updateView("zcgj_totalamtbak");
}
}
DynamicObject fundplyentry3 = fundplyentry.get(3);
fundplyentry3.set("zcgj_cashamt", cashamtAll);
fundplyentry3.set("zcgj_bankamt", bankamtAll);
fundplyentry3.set("zcgj_businessamt", businessamtAll);
fundplyentry3.set("zcgj_supplyamt", supplyamtAll);
fundplyentry3.set("zcgj_otheramt", otheramtAll);
fundplyentry3.set("zcgj_totalamt", totalamtAll);
}
this.getModel().setValue("zcgj_cashamtbak", cashamtAll);
this.getModel().setValue("zcgj_bankamtbak", bankamtAll);
this.getModel().setValue("zcgj_businessamtbak", businessamtAll);
this.getModel().setValue("zcgj_supplyamtbak", supplyamtAll);
this.getModel().setValue("zcgj_otheramtbak", otheramtAll);
this.getModel().setValue("zcgj_totalamtbak", totalamtAll);
this.getView().updateView("zcgj_fundplyentry");
this.getView().updateView("zcgj_cashamtbak");
this.getView().updateView("zcgj_bankamtbak");
this.getView().updateView("zcgj_businessamtbak");
this.getView().updateView("zcgj_supplyamtbak");
this.getView().updateView("zcgj_otheramtbak");
this.getView().updateView("zcgj_totalamtbak");
this.getView().setEnable(false, 3, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
this.getView().setEnable(false, 7, "zcgj_cashamt","zcgj_bankamt","zcgj_businessamt","zcgj_supplyamt","zcgj_otheramt","zcgj_totalamt");
}