diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/AutoFiveGradeClassification.java b/src_tenwa/com/tenwa/lease/app/quartzmession/AutoFiveGradeClassification.java index 6b90d9a27..47e79fd13 100644 --- a/src_tenwa/com/tenwa/lease/app/quartzmession/AutoFiveGradeClassification.java +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/AutoFiveGradeClassification.java @@ -1,6 +1,7 @@ package com.tenwa.lease.app.quartzmession; import java.util.List; +import java.util.Map; import jbo.app.tenwa.calc.LC_CALC_CONDITION_STATUS; import jbo.app.tenwa.customer.DISTRIBUTOR_INFO; @@ -23,6 +24,7 @@ import com.amarsoft.are.util.StringFunction; import com.amarsoft.awe.util.Transaction; import com.base.util.QuartzUtil; import com.tenwa.comm.util.date.DateAssistant; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; import com.tenwa.flow.comm.handler.flowmanage.OverdueProjectCache; import com.tenwa.lease.flow.project.commbusiness.CreateFiveGradeDataAction; @@ -101,27 +103,28 @@ public class AutoFiveGradeClassification implements Job { tx.join(lccsManager); tx.join(lciManager); tx.join(five_gr); - List lccss = lccsManager.createQuery("select CONTRACT_ID,PAYMENT_NUMBER from O where O.is_auto = 'Y' and PLAN_STATUS = '31'").getResultList(false); - if(lccss.size()>0){ - for(BizObject lccs:lccss){ +// List lccss = lccsManager.createQuery("select CONTRACT_ID,PAYMENT_NUMBER from O where O.is_auto = 'Y' and PLAN_STATUS = '31'").getResultList(false); + List> lccss = DataOperatorUtil.getDataBySql("select CONTRACT_ID,PAYMENT_NUMBER from LC_CALC_CONDITION_STATUS where is_auto = 'Y' and PLAN_STATUS = '31'"); + if(lccss!=null && lccss.size()>0){ + for(int i = 0 ; i < lccss.size() ; i++ ){ String FIVE_GRADE; - BizObject lci = lciManager.createQuery("ID=:id and businesstype is not null").setParameter("id",lccs.getAttribute("CONTRACT_ID").getString()).getSingleResult(false); + BizObject lci = lciManager.createQuery("ID=:id and businesstype is not null").setParameter("id", lccss.get(i).get("CONTRACT_ID") ).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()); + String overday = OverdueProjectCache.getOverDays( lccss.get(i).get("CONTRACT_ID") , lccss.get(i).get("PAYMENT_NUMBER") ); //1.获取等级 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(); + .setParameter("fivegradedate",DateAssistant.getToday()).setParameter("id", lccss.get(i).get("CONTRACT_ID") ).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); + BizObject singleResult = five_gr.createQuery("select * from o where FIVE_GRADE_DATE=:fivegradedate and CONTRACT_ID=:id ").setParameter("fivegradedate",DateAssistant.getToday()).setParameter("id" , lccss.get(i).get("CONTRACT_ID") ).getSingleResult(false); //3.入分类等级明细表(累计) if(null==singleResult){ BizObject fgbo=five_gr.newObject(); - fgbo.setAttributeValue("CONTRACT_ID", lccs.getAttribute("CONTRACT_ID").getString()); + fgbo.setAttributeValue("CONTRACT_ID", lccss.get(i).get("CONTRACT_ID") ); fgbo.setAttributeValue("FIVE_GRADE",FIVE_GRADE); fgbo.setAttributeValue("FIVE_GRADE_DATE", DateAssistant.getToday()); fgbo.setAttributeValue("FIVE_GRADE_DEMO", DateAssistant.getToday()+"||日自动跑批");