1.对五级分类配置表新增字段

2.修改自动五级分类定时任务以支持传统五级分类
This commit is contained in:
jianghongdong 2018-09-22 11:05:59 +08:00
parent 5da1be1618
commit 0ffe00fa94
2 changed files with 6 additions and 33 deletions

View File

@ -2651,6 +2651,7 @@
<attribute name="overdue_loan_max" label="贷款逾期天数-最小(含)" type="STRING" length="32"/>
<attribute name="overdue_loan_min" label="贷款逾期天数-最大(含)" type="STRING" length="32"/>
<attribute name="loan_result" label="贷款五级分类结果" type="STRING" length="32"/>
<attribute name="businesstype" label="业务类型" type="STRING" length="64"/>
</attributes>
<manager>
<managerProperties>

View File

@ -91,14 +91,8 @@ public class AutoFiveGradeClassification implements Job {
JBOTransaction tx=null;
try {
tx= JBOFactory.createJBOTransaction();
// int a=0;//正常合同数
// int b=0;//关注合同数
// int c=0;//次级合同数
// int d=0;//可疑合同数
// int e=0;//损失合同数
BizObjectManager lccsManager = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_STATUS.CLASS_NAME);
BizObjectManager lciManager = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME);
// BizObjectManager five_grade = JBOFactory.getBizObjectManager(LB_FIVE_GRADE_SUMMARY.CLASS_NAME);
BizObjectManager five_gr = JBOFactory.getBizObjectManager(LB_FIVE_GRADE.CLASS_NAME);
tx.join(lccsManager);
tx.join(lciManager);
@ -107,16 +101,14 @@ public class AutoFiveGradeClassification implements Job {
if(lccss.size()>0){
for(BizObject lccs:lccss){
String FIVE_GRADE;
BizObject lci = lciManager.createQuery("ID=:id ").setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).getSingleResult(false);
BizObject lci = lciManager.createQuery("ID=:id and businesstype is not null").setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).getSingleResult(false);
String productId = lci.getAttribute("PRODUCT_ID").getString();
String businessType = lci.getAttribute(LB_CONTRACT_INFO.BUSINESSTYPE).getString();
if(productId!=null){
//0.获取逾期天数和期次
String overday = OverdueProjectCache.getOverDays(lccs.getAttribute("CONTRACT_ID").getString(), lccs.getAttribute("PAYMENT_NUMBER").getString());
// Integer overdays=Integer.parseInt(overday.replaceAll("\\.0", ""));
// String outlist = OverdueProjectCache.getOutList(lccs.getAttribute("CONTRACT_ID").getString(), lccs.getAttribute("PAYMENT_NUMBER").getString());
// outlist=outlist.replaceAll("\\.0", "");
//1.获取等级
String fiveGrade = getFiveConfig(overday);//ProductParamUtil.getFiveGradeClassification(productId, overdays);
String fiveGrade = getFiveConfig(overday,businessType);//ProductParamUtil.getFiveGradeClassification(productId, overdays);
//2.更新跑批状态表(最新)
lccsManager.createQuery("update o set FIVE_GRADE='"+fiveGrade+"',FIVE_GRADE_DATE=:fivegradedate where CONTRACT_ID=:id ")
.setParameter("fivegradedate",DateAssistant.getToday()).setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).executeUpdate();
@ -134,28 +126,8 @@ public class AutoFiveGradeClassification implements Job {
fgbo.setAttributeValue("INPUTTIME", DateAssistant.getToday());
five_gr.saveObject(fgbo);
}
//3.对各个等级进行统计
// switch(fiveGrade){
// case "ClassifyResult01":a++;break;
// case "ClassifyResult02":b++;break;
// case "ClassifyResult03":c++;break;
// case "ClassifyResult04":d++;break;
// case "ClassifyResult05":e++;break;
// }
}
}
//入汇总表
// BizObject bo=five_grade.newObject();
// bo.setAttributeValue("EXCUTE_DATE", DateAssistant.getToday());
// bo.setAttributeValue("CONTRACT_TOTAL",a+b+c+d+e);
// bo.setAttributeValue("NORMAL_CONTRACT",a);
// bo.setAttributeValue("ATTENTION_CONTRACT",b);
// bo.setAttributeValue("SECONDARY_CONTRACT",c);
// bo.setAttributeValue("SUSPECT_CONTRACT",d);
// bo.setAttributeValue("LOSS_CONTRACT",e);
// bo.setAttributeValue("DEMO",DateAssistant.getToday()+",自动跑批");
// bo.setAttributeValue("INPUTUSERID","admin");
// five_grade.saveObject(bo);
}
tx.commit();
} catch (Exception e) {
@ -174,8 +146,8 @@ public class AutoFiveGradeClassification implements Job {
public String getFiveConfig(String overDays) throws JBOException{
BizObject gradeConfg = JBOFactory.getBizObjectManager(LM_GRADE_CLASSIFICATION.CLASS_NAME).createQuery(overDays+" BETWEEN overdue_loan_min and overdue_loan_max").getSingleResult(false);
public String getFiveConfig(String overDays,String businessType) throws JBOException{
BizObject gradeConfg = JBOFactory.getBizObjectManager(LM_GRADE_CLASSIFICATION.CLASS_NAME).createQuery(overDays+" BETWEEN overdue_loan_min and overdue_loan_max and businesstype='"+businessType+"'").getSingleResult(false);
if(gradeConfg!=null){
return gradeConfg.getAttribute(LM_GRADE_CLASSIFICATION.loan_result).getString();
}else{