1.修改付款申请明细页面融资额度和申请额度不正确问题。

This commit is contained in:
zhangbb 2018-08-28 13:47:08 +08:00
parent 5fe3015364
commit f740e8fc25

View File

@ -135,6 +135,7 @@ public class FundPaymentCar {
public String setDeductMoney(JBOTransaction tx) throws Exception{
try{
BigDecimal deductMoney = new BigDecimal(0);
BizObject boLFPAMT = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "contract_id = '" + contractId + "' and fee_type = 'feetype10'").getSingleResult(false);
// BizObject boCA = JBOFactory.createBizObjectQuery(CUSTOMER_ACCOUNT.CLASS_NAME, "contract_id=:contract_id").setParameter("contract_id", contractId).getSingleResult(false);
BizObject boLCI = JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME, "ID=:ID").setParameter("ID", contractId).getSingleResult(false);
@ -145,89 +146,89 @@ public class FundPaymentCar {
BigDecimal outOverMoney = new BigDecimal(boLFPAMT.getAttribute("PLAN_MONEY").getString());
tx.join(bomLFIT);
if(fundList==null||"".equals(fundList)){
fundList="0";
}
List<BizObject> boLFPs = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME,
"contract_id = '" + contractId + "' and fee_type in (" + fundList + ") ").getResultList(false);
BigDecimal deductMoney = new BigDecimal(0);
for(int i = 0;i < boLFPs.size(); i ++){
if(outOverMoney.compareTo(new BigDecimal(0)) == 0){
continue;
}else{
List<BizObject> boLFPs = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME,
"contract_id = '" + contractId + "' and fee_type in (" + fundList + ") ").getResultList(false);
for(int i = 0;i < boLFPs.size(); i ++){
if(outOverMoney.compareTo(new BigDecimal(0)) == 0){
continue;
}
String planID = boLFPs.get(i).getAttribute("ID").getString();
String inOvermoney = boLFPs.get(i).getAttribute("PLAN_MONEY").getString();
if(outOverMoney.compareTo(new BigDecimal(inOvermoney)) < 0){
inOvermoney = outOverMoney.toString();
}
deductMoney = deductMoney.add(new BigDecimal(inOvermoney));
outOverMoney = outOverMoney.subtract(new BigDecimal(inOvermoney));
BizObject boLFP = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "id=:PlanID").setParameter("PlanID", planID).getSingleResult(false);
BizObject boLFITOut = bomLFIT.newObject();//µÖ¿Û³µÁ¾¿î
boLFITOut.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
boLFITOut.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
boLFITOut.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
boLFITOut.setAttributeValue("RELATIVE_ID", incomeID);
boLFITOut.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
boLFITOut.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
boLFITOut.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
boLFITOut.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
boLFITOut.setAttributeValue("PLAN_ID", planID);
boLFITOut.setAttributeValue("PLAN_LIST", boLFPAMT.getAttribute("PLAN_LIST").getInt());
boLFITOut.setAttributeValue("PAY_TYPE", "pay_type_out");
boLFITOut.setAttributeValue("FEE_TYPE", "feetype10");
boLFITOut.setAttributeValue("SETTLE_METHOD", "settlemethod11");
List<BizObject> boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0' and PAY_STATUS<>'apply_return'").setParameter("PLAN_ID", planID)
.getResultList(false);
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and pay_type='pay_type_out' and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", planID)
.getResultList(false);
boLFITOut.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
boLFITOut.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
boLFITOut.setAttributeValue("FACT_MONEY", inOvermoney);
boLFITOut.setAttributeValue("FEE_ADJUST", 0);
/*boLFITOut.setAttributeValue("FACT_OBJECT", boCA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_BANK", boCA.getAttribute("BANK_NAME").getString());
boLFITOut.setAttributeValue("CLIENT_ACCOUNT", boCA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_ACCNUMBER", boCA.getAttribute("ACC_NUMBER").getString());*/
boLFITOut.setAttributeValue("FACT_OBJECT", boDA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_BANK", boDA.getAttribute("OPEN_BANK").getString());
boLFITOut.setAttributeValue("CLIENT_ACCOUNT", boDA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_ACCNUMBER", boDA.getAttribute("ACC_NUMBER").getString());
boLFITOut.setAttributeValue("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
boLFITOut.setAttributeValue("APPLY_PERSON", userId);
boLFITOut.setAttributeValue("APPLY_DEPT", orgId);
boLFITOut.setAttributeValue("MEMO", "µÖ¿ÛÈÚ×Ê¿î");
boLFITOut.setAttributeValue("FUND_FEETYPE", boLFP.getAttribute("FEE_TYPE").getString());
boLFITOut.setAttributeValue("ROLL_BACK", 0);
boLFITOut.setAttributeValue("FLOWUNID", flowunid);
boLFITOut.setAttributeValue("IS_FLOWING", 0);
bomLFIT.saveObject(boLFITOut);
BizObject boLFITIn = bomLFIT.newObject();//²îî»ØÁý¿î
boLFITIn.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
boLFITIn.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
boLFITIn.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
boLFITIn.setAttributeValue("RELATIVE_ID", incomeID);
boLFITIn.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
boLFITIn.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
boLFITIn.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
boLFITIn.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
boLFITIn.setAttributeValue("PLAN_ID", planID);
boLFITIn.setAttributeValue("PLAN_LIST", boLFP.getAttribute("PLAN_LIST").getInt());
boLFITIn.setAttributeValue("PAY_TYPE", boLFP.getAttribute("PAY_TYPE").getString());
boLFITIn.setAttributeValue("FEE_TYPE", boLFP.getAttribute("FEE_TYPE").getString());
boLFITIn.setAttributeValue("SETTLE_METHOD", "settlemethod11");
boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0' and PAY_STATUS<>'apply_return'").setParameter("PLAN_ID", planID)
.getResultList(false);
boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and pay_type='pay_type_in' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", planID)
.getResultList(false);
boLFITIn.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
boLFITIn.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
boLFITIn.setAttributeValue("FACT_MONEY", inOvermoney);
boLFITIn.setAttributeValue("FEE_ADJUST", 0);
boLFITIn.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
boLFITIn.setAttributeValue("ROLL_BACK", 0);
boLFITIn.setAttributeValue("FLOWUNID", flowunid);
boLFITIn.setAttributeValue("IS_FLOWING", 0);
bomLFIT.saveObject(boLFITIn);
}
String planID = boLFPs.get(i).getAttribute("ID").getString();
String inOvermoney = boLFPs.get(i).getAttribute("PLAN_MONEY").getString();
if(outOverMoney.compareTo(new BigDecimal(inOvermoney)) < 0){
inOvermoney = outOverMoney.toString();
}
deductMoney = deductMoney.add(new BigDecimal(inOvermoney));
outOverMoney = outOverMoney.subtract(new BigDecimal(inOvermoney));
BizObject boLFP = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "id=:PlanID").setParameter("PlanID", planID).getSingleResult(false);
BizObject boLFITOut = bomLFIT.newObject();//µÖ¿Û³µÁ¾¿î
boLFITOut.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
boLFITOut.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
boLFITOut.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
boLFITOut.setAttributeValue("RELATIVE_ID", incomeID);
boLFITOut.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
boLFITOut.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
boLFITOut.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
boLFITOut.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
boLFITOut.setAttributeValue("PLAN_ID", planID);
boLFITOut.setAttributeValue("PLAN_LIST", boLFPAMT.getAttribute("PLAN_LIST").getInt());
boLFITOut.setAttributeValue("PAY_TYPE", "pay_type_out");
boLFITOut.setAttributeValue("FEE_TYPE", "feetype10");
boLFITOut.setAttributeValue("SETTLE_METHOD", "settlemethod11");
List<BizObject> boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0' and PAY_STATUS<>'apply_return'").setParameter("PLAN_ID", planID)
.getResultList(false);
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and pay_type='pay_type_out' and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", planID)
.getResultList(false);
boLFITOut.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
boLFITOut.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
boLFITOut.setAttributeValue("FACT_MONEY", inOvermoney);
boLFITOut.setAttributeValue("FEE_ADJUST", 0);
/*boLFITOut.setAttributeValue("FACT_OBJECT", boCA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_BANK", boCA.getAttribute("BANK_NAME").getString());
boLFITOut.setAttributeValue("CLIENT_ACCOUNT", boCA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_ACCNUMBER", boCA.getAttribute("ACC_NUMBER").getString());*/
boLFITOut.setAttributeValue("FACT_OBJECT", boDA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_BANK", boDA.getAttribute("OPEN_BANK").getString());
boLFITOut.setAttributeValue("CLIENT_ACCOUNT", boDA.getAttribute("ACCOUNT").getString());
boLFITOut.setAttributeValue("CLIENT_ACCNUMBER", boDA.getAttribute("ACC_NUMBER").getString());
boLFITOut.setAttributeValue("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
boLFITOut.setAttributeValue("APPLY_PERSON", userId);
boLFITOut.setAttributeValue("APPLY_DEPT", orgId);
boLFITOut.setAttributeValue("MEMO", "µÖ¿ÛÈÚ×Ê¿î");
boLFITOut.setAttributeValue("FUND_FEETYPE", boLFP.getAttribute("FEE_TYPE").getString());
boLFITOut.setAttributeValue("ROLL_BACK", 0);
boLFITOut.setAttributeValue("FLOWUNID", flowunid);
boLFITOut.setAttributeValue("IS_FLOWING", 0);
bomLFIT.saveObject(boLFITOut);
BizObject boLFITIn = bomLFIT.newObject();//²îî»ØÁý¿î
boLFITIn.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
boLFITIn.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
boLFITIn.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
boLFITIn.setAttributeValue("RELATIVE_ID", incomeID);
boLFITIn.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
boLFITIn.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
boLFITIn.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
boLFITIn.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
boLFITIn.setAttributeValue("PLAN_ID", planID);
boLFITIn.setAttributeValue("PLAN_LIST", boLFP.getAttribute("PLAN_LIST").getInt());
boLFITIn.setAttributeValue("PAY_TYPE", boLFP.getAttribute("PAY_TYPE").getString());
boLFITIn.setAttributeValue("FEE_TYPE", boLFP.getAttribute("FEE_TYPE").getString());
boLFITIn.setAttributeValue("SETTLE_METHOD", "settlemethod11");
boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0' and PAY_STATUS<>'apply_return'").setParameter("PLAN_ID", planID)
.getResultList(false);
boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and pay_type='pay_type_in' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", planID)
.getResultList(false);
boLFITIn.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
boLFITIn.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
boLFITIn.setAttributeValue("FACT_MONEY", inOvermoney);
boLFITIn.setAttributeValue("FEE_ADJUST", 0);
boLFITIn.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
boLFITIn.setAttributeValue("ROLL_BACK", 0);
boLFITIn.setAttributeValue("FLOWUNID", flowunid);
boLFITIn.setAttributeValue("IS_FLOWING", 0);
bomLFIT.saveObject(boLFITIn);
}
BizObject boEquipAmt = bomLFIT.newObject();//ʵ¼Ê·Å¿î
boEquipAmt.setAttributeValue("ID", incomeID);
@ -261,6 +262,7 @@ public class FundPaymentCar {
.getResultList(false);
boEquipAmt.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
boEquipAmt.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
String a = boLFPAMT.getAttribute("PLAN_MONEY").getString();
boEquipAmt.setAttributeValue("FACT_MONEY", new BigDecimal(boLFPAMT.getAttribute("PLAN_MONEY").getString()).subtract(deductMoney));
boEquipAmt.setAttributeValue("FEE_ADJUST", 0);
boEquipAmt.setAttributeValue("ROLL_BACK", 0);