apzl_leasing/src_tenwa/com/tenwa/flow/fund/flowpayment/CopyFundPaymentToTemp.java
2022-07-22 18:35:19 +08:00

88 lines
2.8 KiB
Java

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;
}
}
}
//分段融
String settleMethod = Sqlca.getString("select SETTLE_METHOD from lc_calc_condition where CONTRACT_ID='"+contractId+"'");
if(settleMethod!=null && settleMethod.equals("segmented_financing")) {
Map<String, List<Map<String, String>>> configs = ProductParamUtil.getProductComponentDecisionTable( productId, "PRD0301","IsBalanceLending");
if(configs!=null && configs.size()>0 ) {
List<Map<String, String>> list = configs.get("segmented_financing");
if( list!=null && list.size()>0 ) {
String IsBalanceLending = list.get(0).get("IsBalanceLending");
if(IsBalanceLending!=null && IsBalanceLending.equals("Y")) {
fundList += ",'feetype27'";
}
}
}
}
//安鹏贴息不抵扣
//北汽的有的产品可以贴息差额放款
/*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;
}
}