增加付款申请汽车

This commit is contained in:
zhaoxin 2018-07-23 18:22:21 +08:00
parent be2f5c7915
commit f6dd2dc4b8
5 changed files with 606 additions and 2 deletions

View File

@ -0,0 +1,22 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2018-07-11
Content: ʾÀýÏêÇéÒ³Ãæ
History Log:
*/
String ishistory = CurPage.getParameter("IsHistory");
String flowunid = CurPage.getParameter("FlowUnid");
ASObjectModel doTemp = new ASObjectModel("LCFundPaymentTempInfo");
/* if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");
} */
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//Ö»¶Áģʽ
dwTemp.genHTMLObjectWindow(flowunid);
String sButtons[][] = {
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -46,8 +46,7 @@ public class CopyFundIncomeTempToFormal extends BaseBussiness{
otherProperty.clear();
otherProperty.put("FLOWUNID", "");
otherProperty.put("RELATIVE_ID", incomeID);
//otherProperty.put("PAY_STATUS", "apply_pass");
otherProperty.put("PAY_STATUS", null);//众联项目只有付款申请,不需要实际付款流程
otherProperty.put("PAY_STATUS", "apply_pass");
DataOperatorUtil.copySingleJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondition,LC_FUND_INCOME.CLASS_NAME, null, otherProperty,Sqlca.getTransaction());
}
}

View File

@ -0,0 +1,70 @@
package com.tenwa.flow.fund.flowpayment;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.amarsoft.app.util.ProductParamUtil;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.amarsoft.dict.als.cache.CodeCache;
import com.amarsoft.dict.als.object.Item;
import com.tenwa.flow.baseBussion.BaseBussiness;
/**
* 拷贝差额放款到临时表
* @author zhulh
*
*/
public class CopyFundPaymentToTemp extends BaseBussiness{
public Object run(Transaction Sqlca) throws Exception{
this.initBussinessParam(Sqlca.getTransaction());
String contractId = (String)this.getAttribute("ContractId");
String flowunid = (String)this.getAttribute("ObjectNo");
String userId = (String)this.getAttribute("CurUserID");
String productId = (String)this.getAttribute("ProductId");
//获取坐扣项
Map<String, Map<String, String>> params = ProductParamUtil.getProductComponentType(productId, "PRD0315");
List<String> deductFeeType = new ArrayList<String>();
for(Entry<String, Map<String, String>> feeTypes : params.entrySet()) {
if(!feeTypes.getValue().containsKey("isBalance")) {
continue;
}
String isBalance = feeTypes.getValue().get("isBalance");
if("yes".equals(isBalance)) {
deductFeeType.add(feeTypes.getKey());
}
}
Item[] items = CodeCache.getItems("FeeType");
String fundList = "";
for(Item item : items) {
for(String feetype : deductFeeType) {
if(feetype.equals(item.getRelativeCode())) {
if(fundList.length() != 0) {
fundList += ",";
}
fundList += "'" + item.getItemNo() + "'";
break;
}
}
}
if(fundList.length() > 0) {
fundList += ",";
}
fundList += "'feetype27'";
ASUser user = ASUser.getUser(userId, Sqlca);
FundPaymentCar fp = new FundPaymentCar();
fp.setFlowunid(flowunid);
fp.setContractId(contractId);
fp.setUserId(user.getUserID());
fp.setOrgId(user.getOrgID());
fp.setFundList(fundList);
fp.setDeductMoney(Sqlca.getTransaction());
String sMessage="true";
return sMessage;
}
}

View File

@ -0,0 +1,426 @@
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.com.tenwa.lease.comm.LC_PAY_CONDTION;
import jbo.com.tenwa.lease.comm.LC_PAY_CONDTION_TEMP;
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{
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);
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);
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;
}
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("APPLYPAY_DATE", boLFP.getAttribute("PLAN_DATE").getString());
boLFITOut.setAttributeValue("APPLY_PERSON", userId);
boLFITOut.setAttributeValue("APPLY_DEPT", orgId);
boLFITOut.setAttributeValue("MEMO", "抵扣融资款");
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);
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("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());
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("");
String[] fmoneys = factmoneys.split("");
String[] fadjusts = feeadjusts.split("");
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";
}
}

View File

@ -0,0 +1,87 @@
package com.tenwa.handler;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import com.amarsoft.app.util.ProductParamUtil;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
import com.amarsoft.dict.als.cache.CodeCache;
import com.amarsoft.dict.als.object.Item;
public class LCFundPaymentTempInfoHandler extends CommonHandler {
@Override
protected void initDisplayForEdit(BizObject bo) throws Exception {
String productId = this.asPage.getParameter("ProductId");
//»ñÈ¡×ø¿ÛÏî
Map<String, Map<String, String>> params = ProductParamUtil.getProductComponentType(productId, "PRD0315");
List<String> deductFeeType = new ArrayList<String>();
for(Entry<String, Map<String, String>> feeTypes : params.entrySet()) {
if(!feeTypes.getValue().containsKey("isBalance")) {
continue;
}
String isBalance = feeTypes.getValue().get("isBalance");
if("yes".equals(isBalance)) {
deductFeeType.add(feeTypes.getKey());
}
}
Item[] items = CodeCache.getItems("FeeType");
String fundList = "";
for(Item item : items) {
for(String feetype : deductFeeType) {
if(feetype.equals(item.getRelativeCode())) {
if(fundList.length() != 0) {
fundList += ",";
}
fundList += "'" + item.getItemNo() + "'";
break;
}
}
}
if(fundList.length() > 0) {
fundList += ",";
}
fundList += "'feetype27'";
String flowunid = this.asPage.getParameter("ObjectNo");
@SuppressWarnings("unchecked")
List<BizObject> boLFITs = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME,
"flowunid = '" + flowunid + "' and fee_type in (" + fundList + ") ").getResultList(false);
BigDecimal cleanLeaseMoney = new BigDecimal("0");
cleanLeaseMoney = cleanLeaseMoney.add(new BigDecimal(bo.getAttribute("FACT_MONEY").getString()));
for(BizObject boLFIT : boLFITs) {
BigDecimal factMoney = new BigDecimal(boLFIT.getAttribute("FACT_MONEY").getString());
String feeType = boLFIT.getAttribute("FEE_TYPE").getString();
if(factMoney.compareTo(BigDecimal.ZERO) > 0) {
switch(feeType) {
case "feetype1":
cleanLeaseMoney = cleanLeaseMoney.add(factMoney);
bo.setAttributeValue("HANDLING_CHARGE_MONEY", factMoney);
this.asDataObject.setVisible("HANDLING_CHARGE_MONEY", true);
break;
case "feetype2":
cleanLeaseMoney = cleanLeaseMoney.add(factMoney);
bo.setAttributeValue("CAUTION_MONEY", factMoney);
this.asDataObject.setVisible("CAUTION_MONEY", true);
break;
case "feetype27":
cleanLeaseMoney = cleanLeaseMoney.add(factMoney);
bo.setAttributeValue("DEALER_DISCOUNT", factMoney);
this.asDataObject.setVisible("DEALER_DISCOUNT", true);
break;
}
}
}
bo.setAttributeValue("CLEAN_LEASE_MONEY", cleanLeaseMoney);
}
}