Merge branch 'develop' of git@git2.tenwa.com.cn:ApzlDev/apzl_leasing.git into develop

This commit is contained in:
zhulianghua 2018-08-14 17:54:34 +08:00
commit a62374b381
4 changed files with 12 additions and 10 deletions

View File

@ -4301,7 +4301,7 @@
</managerProperties>
</manager>
</class>
<class name="LB_FIVE_GRADE" label="" keyAttributes="">
<class name="LB_FIVE_GRADE" label="" keyAttributes="id">
<attributes>
<attribute name="id" label="id" type="STRING" length="100"/>
<attribute name="summary_id" label="summary_id" type="STRING" length="100"/>

View File

@ -422,7 +422,7 @@ public class CollectAuditInfoCache {
BizObjectManager bmi = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME,transaction);
BizObject boi = bmi.createQuery("select v.replace(v.uuid(),'-','') as v.id,O.QUOT_ID as v.QUOT_ID,O.CUST_ID as v.CUST_ID,O.PROJECT_ID as v.PROJECT_ID,O.PROJECT_PLAN_NUMBER as v.PROJECT_PLAN_NUMBER,"
+ "O.CONTRACT_ID as v.CONTRACT_ID,O.CONTRACT_PLAN_NUMBER as v.CONTRACT_PLAN_NUMBER,O.PAYMENT_NUMBER as v.PAYMENT_NUMBER,'' as v.EBANK_NUMBER,O.id as v.PLAN_ID,O.PLAN_LIST as v.PLAN_LIST,"
+ "'0' as v.INTEREST_ADJUST,'settlemethod6' as v.SETTLE_METHOD,'"+hire_list+"' as v.HIRE_LIST,'"+cerrentDate+"' as v.HIRE_DATE,'"+rent+"' as v.RENT,("+rent+"-vl.interest_over) as v.CORPUS,vl.interest_over as v.INTEREST,vl.penalty_over as v.PENALTY,"
+ "'0' as v.INTEREST_ADJUST,'settlemethod6' as v.SETTLE_METHOD,'"+hire_list+"' as v.HIRE_LIST,'"+cerrentDate+"' as v.HIRE_DATE,vl.rent_over v.RENT,vl.corpus_over as v.CORPUS,vl.interest_over as v.INTEREST,("+rent+"-vl.corpus_over) as v.PENALTY,"
+ "'0' as v.CORPUS_ADJUST,'0' as v.PENALTY_ADJUST,'0' as v.ROLL_BACK,O.COIN as v.COIN from O, jbo.app.tenwa.calc.VI_LC_RENT_PLAN vl where O.id = vl.id"
+ " and vl.contract_id =:contract_id and vl.plan_date =:plan_date")
.setParameter("contract_id", bo.getAttribute("contract_id").toString())
@ -797,7 +797,7 @@ public class CollectAuditInfoCache {
BizObjectManager bmi = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME,transaction);
BizObject boi = bmi.createQuery("select v.replace(v.uuid(),'-','') as v.id,O.QUOT_ID as v.QUOT_ID,O.CUST_ID as v.CUST_ID,O.PROJECT_ID as v.PROJECT_ID,O.PROJECT_PLAN_NUMBER as v.PROJECT_PLAN_NUMBER,"
+ "O.CONTRACT_ID as v.CONTRACT_ID,O.CONTRACT_PLAN_NUMBER as v.CONTRACT_PLAN_NUMBER,O.PAYMENT_NUMBER as v.PAYMENT_NUMBER,'' as v.EBANK_NUMBER,O.id as v.PLAN_ID,O.PLAN_LIST as v.PLAN_LIST,"
+ "'0' as v.INTEREST_ADJUST,'settlemethod6' as v.SETTLE_METHOD,'"+hire_list+"' as v.HIRE_LIST,'"+cerrentDate+"' as v.HIRE_DATE,vl.rent_over as v.RENT,vl.corpus_over v.CORPUS,vl.interest_over v.INTEREST,("+rent+"-vl.rent_over) as v.PENALTY,"
+ "'0' as v.INTEREST_ADJUST,'settlemethod6' as v.SETTLE_METHOD,'"+hire_list+"' as v.HIRE_LIST,'"+cerrentDate+"' as v.HIRE_DATE,vl.rent_over as v.RENT,vl.corpus_over as v.CORPUS,vl.interest_over as v.INTEREST,("+rent+"-vl.rent_over) as v.PENALTY,"
+ "'0' as v.CORPUS_ADJUST,'0' as v.PENALTY_ADJUST,'0' as v.ROLL_BACK,O.COIN as v.COIN from O, jbo.app.tenwa.calc.VI_LC_RENT_PLAN vl where O.id = vl.id"
+ " and vl.contract_id =:contract_id and vl.plan_date =:plan_date")
.setParameter("contract_id", bo.getAttribute("contract_id").toString())

View File

@ -111,9 +111,9 @@ public class OverdueProjectCache {
try {
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
String sql="SELECT COUNT(*) outlist FROM lc_rent_plan inner join(SELECT IFNULL(lrp.rent,0)-IFNULL(lri.money,0) rent_overage,lrp.ID FROM lc_rent_plan lrp LEFT JOIN(SELECT SUM(IFNULL(rent,0))+SUM(IFNULL(interest_adjust,0)) money,plan_id FROM lc_rent_income WHERE roll_back ='0' GROUP BY plan_id) AS lri ON lri.plan_id=lrp.ID) l on l.id=lc_rent_plan.id WHERE lc_rent_plan.plan_date<CURDATE() and l.rent_overage>0 and contract_id=:contract_id and payment_number=:payment_number GROUP BY contract_id,payment_number";
// if("ORACLE".equals(InitDBType.DBTYPE)){
if("ORACLE".equals(InitDBType.DBTYPE)){
sql="SELECT COUNT(*) outlist FROM lc_rent_plan inner join(SELECT nvl(lrp.rent,0)-nvl(lri.money,0) rent_overage,lrp.ID FROM lc_rent_plan lrp LEFT JOIN(SELECT SUM(nvl(rent,0))+SUM(nvl(interest_adjust,0)) money,plan_id FROM lc_rent_income WHERE roll_back ='0' GROUP BY plan_id) lri ON lri.plan_id=lrp.ID) l on l.id=lc_rent_plan.id WHERE str_to_date(lc_rent_plan.plan_date,'%y/%m/%d')<left(now(),10) and l.rent_overage>0 and contract_id=:contract_id and payment_number=:payment_number GROUP BY contract_id,payment_number";
// }
}
SqlObject asql = new SqlObject(sql);
asql.setParameter("contract_id", id);
asql.setParameter("payment_number", payment_number);

View File

@ -109,12 +109,13 @@ public class AutoFiveGradeClassification implements Job {
//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", "");
// 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);
//2.更新跑批状态表(最新)
lccsManager.createQuery("update o set FIVE_GRADE='"+fiveGrade+"',FIVE_GRADE_DATE=:fivegradedate,overduedays='"+overday+"',overdue='"+outlist+"' where CONTRACT_ID=:id ").setParameter("fivegradedate",DateAssistant.getToday()).setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).executeUpdate();
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();
FIVE_GRADE=fiveGrade;
BizObject singleResult = five_gr.createQuery("select * from o where FIVE_GRADE_DATE=:fivegradedate and CONTRACT_ID=:id ").setParameter("fivegradedate",DateAssistant.getToday()).setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).getSingleResult(false);
//3.入分类等级明细表(累计)
@ -170,11 +171,12 @@ public class AutoFiveGradeClassification implements Job {
public String getFiveConfig(String overDays) throws JBOException{
BizObject gradeConfg = JBOFactory.getBizObjectManager(LM_GRADE_CLASSIFICATION.CLASS_NAME).createQuery("select * from O where "+overDays+" BETWEEN overdue_loan_min and overdue_loan_max").getSingleResult(false);
BizObject gradeConfg = JBOFactory.getBizObjectManager(LM_GRADE_CLASSIFICATION.CLASS_NAME).createQuery(overDays+" BETWEEN overdue_loan_min and overdue_loan_max").getSingleResult(false);
if(gradeConfg!=null){
return gradeConfg.getAttribute(LM_GRADE_CLASSIFICATION.loan_result).getString();
}else{
return "getGrade01";
}
throw new JBOException("Îå¼¶·ÖÀàδÅäÖá­¡­");
}