apzl_leasing/src_tenwa/com/tenwa/flow/fund/flowpayment/CopyFundPaymentToTemp.java

73 lines
2.1 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;
}
}
}
//安鹏贴息不抵扣
//北汽的有的产品可以贴息差额放款
/*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;
}
}