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

98 lines
3.9 KiB
Java

package com.tenwa.flow.fund.cautiondeduction;
import java.util.List;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import jbo.app.tenwa.calc.LC_RENT_INCOME_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.template.check.DefaultBussinessCheck;
/**
* 检查会计处理日是否填写
*
*/
public class AccountingDateCheck extends DefaultBussinessCheck {
@Override
public Object run(Transaction Sqlca) throws Exception {
String flowunid=this.getAttribute("ObjectNo").toString();
String message = "请填写";
List<BizObject> boFs = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME).createQuery("flowunid=:flowunid")
.setParameter("flowunid", flowunid).getResultList(false);
List<BizObject> boRs = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME).createQuery("flowunid=:flowunid")
.setParameter("flowunid", flowunid).getResultList(false);
if(boFs.size() > 0 && boRs.size() > 0){
boolean flag = true;
for(int i=0;i<boRs.size();i++){
String accountingDateR = boRs.get(i).getAttribute("accounting_date").getString();
if("".equals(accountingDateR)){
message += "投放编号为【"+boRs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boRs.get(i).getAttribute("plan_list").getString()+"】的会计处理日!";
flag = false;
}
}
for(int i=0;i<boFs.size();i++){
String accountingDateF = boFs.get(i).getAttribute("accounting_date").getString();
if("".equals(accountingDateF)){
if("settlemethod11".equals(boFs.get(i).getAttribute("settle_method").getString())){
message += "投放编号为【"+boFs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boFs.get(i).getAttribute("plan_list").getString()+"】的【"+CodeCache.getItemName("SettleMethod", boFs.get(i).getAttribute("settle_method11").getString())+"】的会计处理日!";
}else{
message += "投放编号为【"+boFs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boFs.get(i).getAttribute("plan_list").getString()+"】的【"+CodeCache.getItemName("FeeType", boFs.get(i).getAttribute("fee_type").getString())+"】的会计处理日!";
}
flag = false;
}
}
if(flag){
putMsg("信息填写正常!");
setPass(true);
}else{
putMsg(message);
setPass(false);
}
}else if(boFs.size() > 0){
boolean flag = true;
for(int i=0;i<boFs.size();i++){
String accountingDateF = boFs.get(i).getAttribute("accounting_date").getString();
if("".equals(accountingDateF)){
if("settlemethod11".equals(boFs.get(i).getAttribute("settle_method").getString())){
message += "投放编号为【"+boFs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boFs.get(i).getAttribute("plan_list").getString()+"】的【"+CodeCache.getItemName("SettleMethod", boFs.get(i).getAttribute("settle_method").getString())+"】的会计处理日!";
}else{
message += "投放编号为【"+boFs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boFs.get(i).getAttribute("plan_list").getString()+"】的【"+CodeCache.getItemName("FeeType", boFs.get(i).getAttribute("fee_type").getString())+"】的会计处理日!";
}
flag = false;
}
}
if(flag){
putMsg("信息填写正常!");
setPass(true);
}else{
putMsg(message);
setPass(false);
}
}else if(boRs.size() > 0){
boolean flag = true;
for(int i=0;i<boRs.size();i++){
String accountingDateR = boRs.get(i).getAttribute("accounting_date").getString();
if("".equals(accountingDateR)){
message += "投放编号为【"+boRs.get(i).getAttribute("payment_number").getString()+"】编号为【"+boRs.get(i).getAttribute("plan_list").getString()+"】的会计处理日!";
flag = false;
}
}
if(flag){
putMsg("信息填写正常!");
setPass(true);
}else{
putMsg(message);
setPass(false);
}
}else{
putMsg("未生成本次收款!");
setPass(false);
}
return null;
}
}