477 lines
26 KiB
Java
477 lines
26 KiB
Java
package com.tenwa.flow.fund.flowpayment;
|
||
|
||
import java.math.BigDecimal;
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
import jbo.app.tenwa.calc.LC_FUND_INCOME;
|
||
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
|
||
import jbo.app.tenwa.calc.LC_FUND_PLAN;
|
||
import jbo.app.tenwa.calc.VI_LC_FUND_PLAN;
|
||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
|
||
import jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT;
|
||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION;
|
||
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION_TEMP;
|
||
import jbo.prd.LB_PRODUCTTOCOMPANY_INFO;
|
||
|
||
import com.amarsoft.are.jbo.BizObject;
|
||
import com.amarsoft.are.jbo.BizObjectManager;
|
||
import com.amarsoft.are.jbo.JBOFactory;
|
||
import com.amarsoft.are.jbo.JBOTransaction;
|
||
import com.amarsoft.are.util.StringFunction;
|
||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||
import com.tenwa.reckon.util.UUIDUtil;
|
||
|
||
public class FundPaymentCar {
|
||
private String fundList;
|
||
private String flowunid;
|
||
private String equipOverMoney;
|
||
private String equipAMTID;
|
||
private String userId;
|
||
private String orgId;
|
||
private String planids;
|
||
private String overmoneys;
|
||
private String factmoneys;
|
||
private String feeadjusts;
|
||
private String returnID;
|
||
private String contractId;
|
||
|
||
public String getReturnID() {
|
||
return returnID;
|
||
}
|
||
|
||
public void setReturnID(String returnID) {
|
||
this.returnID = returnID;
|
||
}
|
||
|
||
public String getFactmoneys() {
|
||
return factmoneys;
|
||
}
|
||
|
||
public void setFactmoneys(String factmoneys) {
|
||
this.factmoneys = factmoneys;
|
||
}
|
||
|
||
public String getFeeadjusts() {
|
||
return feeadjusts;
|
||
}
|
||
|
||
public void setFeeadjusts(String feeadjusts) {
|
||
this.feeadjusts = feeadjusts;
|
||
}
|
||
|
||
public String getPlanids() {
|
||
return planids;
|
||
}
|
||
|
||
public void setPlanids(String planids) {
|
||
this.planids = planids;
|
||
}
|
||
|
||
public String getOvermoneys() {
|
||
return overmoneys;
|
||
}
|
||
|
||
public void setOvermoneys(String overmoneys) {
|
||
this.overmoneys = overmoneys;
|
||
}
|
||
|
||
public String getUserId() {
|
||
return userId;
|
||
}
|
||
|
||
public void setUserId(String userId) {
|
||
this.userId = userId;
|
||
}
|
||
|
||
public String getOrgId() {
|
||
return orgId;
|
||
}
|
||
|
||
public void setOrgId(String orgId) {
|
||
this.orgId = orgId;
|
||
}
|
||
|
||
public String getEquipAMTID() {
|
||
return equipAMTID;
|
||
}
|
||
|
||
public void setEquipAMTID(String equipAMTID) {
|
||
this.equipAMTID = equipAMTID;
|
||
}
|
||
|
||
public String getEquipOverMoney() {
|
||
return equipOverMoney;
|
||
}
|
||
|
||
public void setEquipOverMoney(String equipOverMoney) {
|
||
this.equipOverMoney = equipOverMoney;
|
||
}
|
||
|
||
public String getFlowunid() {
|
||
return flowunid;
|
||
}
|
||
|
||
public void setFlowunid(String flowunid) {
|
||
this.flowunid = flowunid;
|
||
}
|
||
|
||
public String getFundList() {
|
||
return fundList;
|
||
}
|
||
|
||
public void setFundList(String fundList) {
|
||
this.fundList = fundList;
|
||
}
|
||
|
||
public String getContractId() {
|
||
return contractId;
|
||
}
|
||
|
||
public void setContractId(String contractId) {
|
||
this.contractId = contractId;
|
||
}
|
||
|
||
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);
|
||
String distributorId = boLCI.getAttribute("distributor_id").getString();
|
||
String productId = boLCI.getAttribute("product_id").getString();
|
||
BizObject boLPI = JBOFactory.createBizObjectQuery(LB_PRODUCTTOCOMPANY_INFO.CLASS_NAME, "product_id=:product_id").setParameter("product_id", productId).getSingleResult(false);
|
||
BizObject boDA = JBOFactory.createBizObjectQuery(DISTRIBUTOR_ACCOUNT.CLASS_NAME, "distributor_id=:distributor_id and IS_MAIN='Y'").setParameter("distributor_id", distributorId).getSingleResult(false);
|
||
String factObject = boDA.getAttribute("ACCOUNT").getString();
|
||
String clientAccount = boDA.getAttribute("ACCOUNT").getString();
|
||
String clientAccNumber = boDA.getAttribute("ACC_NUMBER").getString();
|
||
String clientBank = boDA.getAttribute("OPEN_BANK").getString();
|
||
String clientProvince = boDA.getAttribute("provinceInfo").getString();
|
||
String clientCity = boDA.getAttribute("district").getString();
|
||
String isCompany = "N";
|
||
if(boLPI!=null&&boLPI.getAttribute("product_id")!=null){
|
||
factObject = boLPI.getAttribute("company_name").toString();
|
||
clientAccount = boLPI.getAttribute("account").toString();
|
||
clientAccNumber = boLPI.getAttribute("acc_number").toString();
|
||
clientBank = boLPI.getAttribute("bank_name").toString();
|
||
clientProvince = boLPI.getAttribute("province").toString();
|
||
clientCity = boLPI.getAttribute("city").toString();
|
||
isCompany = "Y";
|
||
}
|
||
BizObjectManager bomLFIT = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
|
||
String incomeID = UUIDUtil.getUUID();
|
||
BigDecimal outOverMoney = new BigDecimal(boLFPAMT.getAttribute("PLAN_MONEY").getString());
|
||
tx.join(bomLFIT);
|
||
if(fundList==null||"".equals(fundList)){
|
||
|
||
}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();
|
||
}
|
||
/*if( "feetype27".equals(boLFPs.get(i).getAttribute("fee_type").toString())){
|
||
deductMoney = deductMoney.subtract(new BigDecimal(inOvermoney));
|
||
}else{
|
||
deductMoney = deductMoney.add(new BigDecimal(inOvermoney));
|
||
}*/
|
||
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();//<2F>ֿ۳<D6BF><DBB3><EFBFBD><EFBFBD><EFBFBD>
|
||
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", factObject);
|
||
boLFITOut.setAttributeValue("CLIENT_BANK", clientBank);
|
||
boLFITOut.setAttributeValue("CLIENT_ACCOUNT", clientAccount);
|
||
boLFITOut.setAttributeValue("CLIENT_ACCNUMBER", clientAccNumber);
|
||
boLFITOut.setAttributeValue("CLIENT_PROVINCE", clientProvince);
|
||
boLFITOut.setAttributeValue("CLIENT_CITY", clientCity);
|
||
boLFITOut.setAttributeValue("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
|
||
boLFITOut.setAttributeValue("APPLY_PERSON", userId);
|
||
boLFITOut.setAttributeValue("APPLY_DEPT", orgId);
|
||
boLFITOut.setAttributeValue("MEMO", "<EFBFBD>ֿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿ<EFBFBD>");
|
||
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();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
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();//ʵ<>ʷſ<CAB7>
|
||
boEquipAmt.setAttributeValue("ID", incomeID);
|
||
boEquipAmt.setAttributeValue("QUOT_ID", boLFPAMT.getAttribute("QUOT_ID").getString());
|
||
boEquipAmt.setAttributeValue("CUST_ID", boLFPAMT.getAttribute("CUST_ID").getString());
|
||
boEquipAmt.setAttributeValue("PROJECT_ID", boLFPAMT.getAttribute("PROJECT_ID").getString());
|
||
boEquipAmt.setAttributeValue("PROJECT_PLAN_NUMBER", boLFPAMT.getAttribute("PROJECT_PLAN_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("CONTRACT_ID", boLFPAMT.getAttribute("CONTRACT_ID").getString());
|
||
boEquipAmt.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFPAMT.getAttribute("CONTRACT_PLAN_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("PAYMENT_NUMBER", boLFPAMT.getAttribute("PAYMENT_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("PLAN_ID", boLFPAMT.getAttribute("ID").getString());
|
||
boEquipAmt.setAttributeValue("PLAN_LIST", boLFPAMT.getAttribute("PLAN_LIST").getInt());
|
||
/*boEquipAmt.setAttributeValue("FACT_OBJECT", boCA.getAttribute("ACCOUNT").getString());
|
||
boEquipAmt.setAttributeValue("CLIENT_BANK", boCA.getAttribute("BANK_NAME").getString());
|
||
boEquipAmt.setAttributeValue("CLIENT_ACCOUNT", boCA.getAttribute("ACCOUNT").getString());
|
||
boEquipAmt.setAttributeValue("CLIENT_ACCNUMBER", boCA.getAttribute("ACC_NUMBER").getString());*/
|
||
boEquipAmt.setAttributeValue("FACT_OBJECT",factObject);
|
||
boEquipAmt.setAttributeValue("CLIENT_BANK",clientBank);
|
||
boEquipAmt.setAttributeValue("CLIENT_ACCOUNT", clientAccount);
|
||
boEquipAmt.setAttributeValue("CLIENT_ACCNUMBER", clientAccNumber);
|
||
boEquipAmt.setAttributeValue("CLIENT_PROVINCE", clientProvince);
|
||
boEquipAmt.setAttributeValue("CLIENT_CITY", clientCity);
|
||
boEquipAmt.setAttributeValue("isCompany", isCompany);
|
||
boEquipAmt.setAttributeValue("APPLYPAY_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
|
||
boEquipAmt.setAttributeValue("APPLY_PERSON", userId);
|
||
boEquipAmt.setAttributeValue("APPLY_DEPT", orgId);
|
||
boEquipAmt.setAttributeValue("PAY_TYPE", boLFPAMT.getAttribute("PAY_TYPE").getString());
|
||
boEquipAmt.setAttributeValue("FEE_TYPE", boLFPAMT.getAttribute("FEE_TYPE").getString());
|
||
boEquipAmt.setAttributeValue("SETTLE_METHOD", "settlemethod6");
|
||
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", boLFPAMT.getAttribute("ID").getString())
|
||
.getResultList(false);
|
||
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", boLFPAMT.getAttribute("ID").getString())
|
||
.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);
|
||
boEquipAmt.setAttributeValue("FLOWUNID", flowunid);
|
||
boEquipAmt.setAttributeValue("IS_FLOWING", 0);
|
||
bomLFIT.saveObject(boEquipAmt);
|
||
}catch(Exception e){
|
||
e.printStackTrace();
|
||
return "ERROR";
|
||
}
|
||
return "SUCCESS";
|
||
}
|
||
|
||
|
||
public String setEquipAMTPayment(JBOTransaction tx) throws Exception{
|
||
try{
|
||
BizObject boLFPAMT = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "id=:id").setParameter("id", equipAMTID).getSingleResult(false);
|
||
BizObjectManager bomLFIT = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
|
||
tx.join(bomLFIT);
|
||
BizObject boEquipAmt = bomLFIT.newObject();
|
||
boEquipAmt.setAttributeValue("QUOT_ID", boLFPAMT.getAttribute("QUOT_ID").getString());
|
||
boEquipAmt.setAttributeValue("CUST_ID", boLFPAMT.getAttribute("CUST_ID").getString());
|
||
boEquipAmt.setAttributeValue("PROJECT_ID", boLFPAMT.getAttribute("PROJECT_ID").getString());
|
||
boEquipAmt.setAttributeValue("PROJECT_PLAN_NUMBER", boLFPAMT.getAttribute("PROJECT_PLAN_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("CONTRACT_ID", boLFPAMT.getAttribute("CONTRACT_ID").getString());
|
||
boEquipAmt.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFPAMT.getAttribute("CONTRACT_PLAN_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("PAYMENT_NUMBER", boLFPAMT.getAttribute("PAYMENT_NUMBER").getString());
|
||
boEquipAmt.setAttributeValue("PLAN_ID", equipAMTID);
|
||
boEquipAmt.setAttributeValue("PLAN_LIST", boLFPAMT.getAttribute("PLAN_LIST").getString());
|
||
//boEquipAmt.setAttributeValue("FACT_OBJECT", boLFPAMT.getAttribute("PAY_OBJ").getString());
|
||
boEquipAmt.setAttributeValue("APPLYPAY_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
|
||
boEquipAmt.setAttributeValue("APPLY_PERSON", userId);
|
||
boEquipAmt.setAttributeValue("APPLY_DEPT", orgId);
|
||
boEquipAmt.setAttributeValue("PAY_TYPE", boLFPAMT.getAttribute("PAY_TYPE").getString());
|
||
boEquipAmt.setAttributeValue("FEE_TYPE", boLFPAMT.getAttribute("FEE_TYPE").getString());
|
||
boEquipAmt.setAttributeValue("SETTLE_METHOD", "settlemethod6");
|
||
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", equipAMTID)
|
||
.getResultList(false);
|
||
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", equipAMTID)
|
||
.getResultList(false);
|
||
boEquipAmt.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
|
||
boEquipAmt.setAttributeValue("FACT_DATE", boLFPAMT.getAttribute("PLAN_DATE").getString());
|
||
boEquipAmt.setAttributeValue("FACT_MONEY", new BigDecimal(equipOverMoney));
|
||
boEquipAmt.setAttributeValue("FEE_ADJUST", 0);
|
||
//boEquipAmt.setAttributeValue("FACT_OBJECT", boLFPAMT.getAttribute("PAY_OBJ").getString());
|
||
boEquipAmt.setAttributeValue("ROLL_BACK", 0);
|
||
boEquipAmt.setAttributeValue("FLOWUNID", flowunid);
|
||
boEquipAmt.setAttributeValue("IS_FLOWING", 0);
|
||
bomLFIT.saveObject(boEquipAmt);
|
||
Map<String,String> fromCondtion = new HashMap<>();
|
||
fromCondtion.put("PAYMENT_NUMBER", boLFPAMT.getAttribute("PAYMENT_NUMBER").getString());
|
||
fromCondtion.put("FEE_TYPE", boLFPAMT.getAttribute("FEE_TYPE").getString());
|
||
fromCondtion.put("PLAN_LIST", boLFPAMT.getAttribute("PLAN_LIST").getString());
|
||
Map<String,String> otherProperty = new HashMap<>();
|
||
otherProperty.put("FLOWUNID", flowunid);
|
||
DataOperatorUtil.copyJBOSet(LC_PAY_CONDTION.CLASS_NAME, fromCondtion,LC_PAY_CONDTION_TEMP.CLASS_NAME, null, otherProperty,null, tx);
|
||
}catch(Exception e){
|
||
e.printStackTrace();
|
||
return "ERROR";
|
||
}
|
||
return "SUCCESS";
|
||
}
|
||
|
||
public String setFundPayment(JBOTransaction tx) throws Exception{
|
||
try{
|
||
String[] ids = planids.split("@");
|
||
String[] moneys = overmoneys.split("@");
|
||
for(int i=0;i<ids.length;i++){
|
||
BizObject boLFP = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "id=:id").setParameter("id", ids[i]).getSingleResult(false);
|
||
BizObjectManager bomLFIT = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
|
||
tx.join(bomLFIT);
|
||
BizObject boLFI = bomLFIT.newObject();
|
||
boLFI.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
|
||
boLFI.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
|
||
boLFI.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
|
||
boLFI.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
|
||
boLFI.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
|
||
boLFI.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
|
||
boLFI.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
|
||
boLFI.setAttributeValue("PLAN_ID", ids[i]);
|
||
boLFI.setAttributeValue("PLAN_LIST", boLFP.getAttribute("PLAN_LIST").getString());
|
||
//boLFI.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
|
||
boLFI.setAttributeValue("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
|
||
boLFI.setAttributeValue("APPLY_PERSON", userId);
|
||
boLFI.setAttributeValue("APPLY_DEPT", orgId);
|
||
boLFI.setAttributeValue("PAY_TYPE", boLFP.getAttribute("PAY_TYPE").getString());
|
||
boLFI.setAttributeValue("FEE_TYPE", boLFP.getAttribute("FEE_TYPE").getString());
|
||
boLFI.setAttributeValue("SETTLE_METHOD", "settlemethod6");
|
||
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", ids[i])
|
||
.getResultList(false);
|
||
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", ids[i])
|
||
.getResultList(false);
|
||
boLFI.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
|
||
boLFI.setAttributeValue("FACT_DATE", boLFP.getAttribute("PLAN_DATE").getString());
|
||
boLFI.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i]));
|
||
boLFI.setAttributeValue("FEE_ADJUST", 0);
|
||
//boLFI.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
|
||
boLFI.setAttributeValue("ROLL_BACK", 0);
|
||
boLFI.setAttributeValue("FLOWUNID", flowunid);
|
||
boLFI.setAttributeValue("IS_FLOWING", 0);
|
||
bomLFIT.saveObject(boLFI);
|
||
Map<String,String> fromCondtion = new HashMap<>();
|
||
fromCondtion.put("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
|
||
fromCondtion.put("FEE_TYPE", boLFP.getAttribute("FEE_TYPE").getString());
|
||
fromCondtion.put("PLAN_LIST", boLFP.getAttribute("PLAN_LIST").getString());
|
||
Map<String,String> otherProperty = new HashMap<>();
|
||
otherProperty.put("FLOWUNID", flowunid);
|
||
DataOperatorUtil.copyJBOSet(LC_PAY_CONDTION.CLASS_NAME, fromCondtion,LC_PAY_CONDTION_TEMP.CLASS_NAME, null, otherProperty,null, tx);
|
||
}
|
||
}catch(Exception e){
|
||
e.printStackTrace();
|
||
return "ERROR";
|
||
}
|
||
return "SUCCESS";
|
||
}
|
||
|
||
public String updateRelativeData(JBOTransaction tx){
|
||
try{
|
||
String[] ids = planids.split("<EFBFBD><EFBFBD>");
|
||
String[] fmoneys = factmoneys.split("<EFBFBD><EFBFBD>");
|
||
String[] fadjusts = feeadjusts.split("<EFBFBD><EFBFBD>");
|
||
BizObjectManager bomLFIT = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
|
||
tx.join(bomLFIT);
|
||
for(int i=0;i<ids.length;i++){
|
||
bomLFIT.createQuery("update O set fact_money=:FactMoney,fee_adjust=:FeeAdjust where Plan_id=:PlanID and Flowunid=:FlowUnid and pay_type='pay_type_in'")
|
||
.setParameter("FactMoney", fmoneys[i]).setParameter("FeeAdjust", fadjusts[i]).setParameter("PlanID", ids[i]).setParameter("FlowUnid", flowunid).executeUpdate();
|
||
}
|
||
}catch(Exception e){
|
||
e.printStackTrace();
|
||
return "ERROR";
|
||
}
|
||
return "SUCCESS";
|
||
}
|
||
|
||
public String setCautionReturn(JBOTransaction tx) throws Exception{
|
||
try{
|
||
String[] returnIDs = returnID.split("@");
|
||
for(int i=0;i<returnIDs.length;i++){
|
||
BizObject bo = JBOFactory.createBizObjectQuery(VI_LC_FUND_PLAN.CLASS_NAME, "id=:id").setParameter("id", returnIDs[i]).getSingleResult(false);
|
||
if(bo != null){
|
||
BizObject boLFP = JBOFactory.createBizObjectQuery(LC_FUND_PLAN.CLASS_NAME, "id=:id").setParameter("id", returnIDs[i]).getSingleResult(false);
|
||
BizObjectManager bomLFIT = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
|
||
tx.join(bomLFIT);
|
||
BizObject boLFIT = bomLFIT.newObject();
|
||
boLFIT.setAttributeValue("QUOT_ID", boLFP.getAttribute("QUOT_ID").getString());
|
||
boLFIT.setAttributeValue("CUST_ID", boLFP.getAttribute("CUST_ID").getString());
|
||
boLFIT.setAttributeValue("PROJECT_ID", boLFP.getAttribute("PROJECT_ID").getString());
|
||
boLFIT.setAttributeValue("PROJECT_PLAN_NUMBER", boLFP.getAttribute("PROJECT_PLAN_NUMBER").getString());
|
||
boLFIT.setAttributeValue("CONTRACT_ID", boLFP.getAttribute("CONTRACT_ID").getString());
|
||
boLFIT.setAttributeValue("CONTRACT_PLAN_NUMBER", boLFP.getAttribute("CONTRACT_PLAN_NUMBER").getString());
|
||
boLFIT.setAttributeValue("PAYMENT_NUMBER", boLFP.getAttribute("PAYMENT_NUMBER").getString());
|
||
boLFIT.setAttributeValue("PLAN_ID", returnIDs[i]);
|
||
boLFIT.setAttributeValue("PLAN_LIST", boLFP.getAttribute("PLAN_LIST").getString());
|
||
//boLFIT.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
|
||
boLFIT.setAttributeValue("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
|
||
boLFIT.setAttributeValue("APPLY_PERSON", userId);
|
||
boLFIT.setAttributeValue("APPLY_DEPT", orgId);
|
||
boLFIT.setAttributeValue("PAY_TYPE", boLFP.getAttribute("PAY_TYPE").getString());
|
||
boLFIT.setAttributeValue("FEE_TYPE", boLFP.getAttribute("FEE_TYPE").getString());
|
||
boLFIT.setAttributeValue("SETTLE_METHOD", "settlemethod8");
|
||
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", equipAMTID)
|
||
.getResultList(false);
|
||
List<BizObject> boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = '0' and ROLL_BACK='0' and PAY_STATUS is null").setParameter("PLAN_ID", equipAMTID)
|
||
.getResultList(false);
|
||
boLFIT.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1);
|
||
boLFIT.setAttributeValue("FACT_DATE", StringFunction.getToday());
|
||
boLFIT.setAttributeValue("ACCOUNTING_DATE", StringFunction.getToday());
|
||
boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(bo.getAttribute("OVERMONEY").getString()));
|
||
boLFIT.setAttributeValue("FEE_ADJUST", 0);
|
||
//boLFIT.setAttributeValue("FACT_OBJECT", boLFP.getAttribute("PAY_OBJ").getString());
|
||
boLFIT.setAttributeValue("ROLL_BACK", 0);
|
||
boLFIT.setAttributeValue("FLOWUNID", flowunid);
|
||
boLFIT.setAttributeValue("IS_FLOWING", 0);
|
||
bomLFIT.saveObject(boLFIT);
|
||
}
|
||
}
|
||
}catch(Exception e){
|
||
e.printStackTrace();
|
||
return "ERROR";
|
||
}
|
||
return "SUCCESS";
|
||
}
|
||
}
|