From f740e8fc253dfb27b0326a70c28ed4aa57c318e0 Mon Sep 17 00:00:00 2001 From: zhangbb Date: Tue, 28 Aug 2018 13:47:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BB=98=E6=AC=BE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=98=8E=E7=BB=86=E9=A1=B5=E9=9D=A2=E8=9E=8D=E8=B5=84?= =?UTF-8?q?=E9=A2=9D=E5=BA=A6=E5=92=8C=E7=94=B3=E8=AF=B7=E9=A2=9D=E5=BA=A6?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/fund/flowpayment/FundPaymentCar.java | 166 +++++++++--------- 1 file changed, 84 insertions(+), 82 deletions(-) diff --git a/src_tenwa/com/tenwa/flow/fund/flowpayment/FundPaymentCar.java b/src_tenwa/com/tenwa/flow/fund/flowpayment/FundPaymentCar.java index 52d7f15aa..e96df4dc0 100644 --- a/src_tenwa/com/tenwa/flow/fund/flowpayment/FundPaymentCar.java +++ b/src_tenwa/com/tenwa/flow/fund/flowpayment/FundPaymentCar.java @@ -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 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 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 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 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 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 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);