2018-06-03 22:26:41 +08:00

67 lines
2.7 KiB
Java

package com.tenwa.flow.fund.flowpayment;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.dict.als.cache.CodeCache;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.template.check.DefaultBussinessCheck;
/**
* 检查付款申请支付对象和对方银行
*
*/
public class FactObjectCheck extends DefaultBussinessCheck {
@Override
public Object run(Transaction Sqlca) throws Exception {
String flowunid=this.getAttribute("ObjectNo").toString();
List<BizObject> bos = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME).createQuery("flowunid=:flowunid and settle_method<>'settlemethod11'")
.setParameter("flowunid", flowunid).getResultList(false);
if(bos.size() > 0){
String message = "请填写";
boolean flag = true;
for(BizObject bo:bos){
String factObject = bo.getAttribute("fact_object").getString();
String clientBank = bo.getAttribute("client_bank").getString();
if("settlemethod11".equals(bo.getAttribute("settle_method").getString())){
if("".equals(factObject) && "".equals(clientBank)){
message += "投放编号为【"+bo.getAttribute("payment_number").getString()+"】编号为【"+bo.getAttribute("plan_list").getInt()+"】的【"+CodeCache.getItemName("SettleMethod", bo.getAttribute("settle_method").getString())+"】的支付对象和对方银行信息!";
flag = false;
}else if("".equals(clientBank)){
message += "投放编号为【"+bo.getAttribute("payment_number").getString()+"】编号为【"+bo.getAttribute("plan_list").getInt()+"】的【"+CodeCache.getItemName("SettleMethod", bo.getAttribute("settle_method").getString())+"】的对方银行信息!";
flag = false;
}
}else{
if("".equals(factObject) && "".equals(clientBank)){
message += "投放编号为【"+bo.getAttribute("payment_number").getString()+"】编号为【"+bo.getAttribute("plan_list").getInt()+"】的【"+CodeCache.getItemName("FeeType", bo.getAttribute("fee_type").getString())+"】的支付对象和对方银行信息!";
flag = false;
}else if("".equals(clientBank)){
message += "投放编号为【"+bo.getAttribute("payment_number").getString()+"】编号为【"+bo.getAttribute("plan_list").getInt()+"】的【"+CodeCache.getItemName("FeeType", bo.getAttribute("fee_type").getString())+"】的对方银行信息!";
flag = false;
}
}
}
if(flag){
putMsg("信息填写正常!");
setPass(true);
}else{
putMsg(message);
setPass(false);
}
}else{
putMsg("未生成本次付款!");
setPass(false);
}
return null;
}
}