diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/RCScoreResult.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/RCScoreResult.jsp index 7379e4ef2..b214074d7 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/RCScoreResult.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/RCScoreResult.jsp @@ -56,7 +56,7 @@ var curUserId = "<%=userId%>"; var result = RunJavaMethodTrans("com.ample.esb.controller.AmpController","ampDo","flowUnid="+flowUnid+",operatorId="+curUserId); alert(result); - + self.location.reload(); } function afs(){ var projectNo = "<%=projectNo%>"; diff --git a/src/com/ample/esb/controller/AmpController.java b/src/com/ample/esb/controller/AmpController.java index 29e57caf2..0c042d2dd 100644 --- a/src/com/ample/esb/controller/AmpController.java +++ b/src/com/ample/esb/controller/AmpController.java @@ -18,6 +18,7 @@ public class AmpController { AmpService as = new AmpServiceImpl(map); Transaction tran = as.transactionDo(); String result = resultAnalysis(tran); + as.resetFraudTakenCode(); return result; } diff --git a/src/com/ample/esb/service/AmpService.java b/src/com/ample/esb/service/AmpService.java index 8b845f67c..88e10f4ed 100644 --- a/src/com/ample/esb/service/AmpService.java +++ b/src/com/ample/esb/service/AmpService.java @@ -4,5 +4,6 @@ import com.ample.esb.bean.amp.ApplicationTitle; public interface AmpService extends EsbServise{ ApplicationTitle getApplicationTitle() throws Exception; + void resetFraudTakenCode(); } diff --git a/src/com/ample/esb/service/impl/AmpServiceImpl.java b/src/com/ample/esb/service/impl/AmpServiceImpl.java index 2b96e60ac..137645168 100644 --- a/src/com/ample/esb/service/impl/AmpServiceImpl.java +++ b/src/com/ample/esb/service/impl/AmpServiceImpl.java @@ -17,8 +17,10 @@ import com.ample.esb.util.DateUtils; import com.ample.esb.util.XstreamUtil; import jbo.app.tenwa.calc.*; import jbo.app.tenwa.customer.*; +import jbo.com.tenwa.entity.comm.flow.CUSTOMER_HISTORY_INFO_TEMP; import jbo.com.tenwa.lease.comm.*; import jbo.oti.RC_ADDRESS_INFO; +import jbo.oti.RC_SCORE_RESULT; import jbo.prd.PRD_SPECIFIC_LIBRARY; import jbo.sys.FLOW_TASK; @@ -32,6 +34,23 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { setFlowUnid(map.get("flowUnid")); setOperatorId(map.get("operatorId")); } + public void resetFraudTakenCode(){ + BizObjectManager bom = null; + BizObject boRsr = null; + try { + bom = JBOFactory.getBizObjectManager(RC_SCORE_RESULT.CLASS_NAME); + boRsr = bom.createQuery("flow_no=:flow_no").setParameter("flow_no",flowUnid).getSingleResult(true); + if(boRsr==null){ + return; + } + boRsr.setAttributeValue("fraud_taken_code",""); + boRsr.setAttributeValue("update_time", DateUtils.dateTimeNowCore()); + bom.saveObject(boRsr); + } catch (JBOException e) { + e.printStackTrace(); + } + } + @Override public MessageEsbHead esbHead() { MessageEsbHead head = new MessageEsbHead(); @@ -273,8 +292,8 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { li.setCalcDealerSubsidyAmt(interestRate.subtract(new BigDecimal(yearRate)).doubleValue()); li.setCalcManufacturerSubsidyAmt(makerInterestTotal); li.setCarCount(boLects.size()); - li.setExposuresNumber(exposures()); - li.setExposureAmount(exposuresAmount()); + li.setExposuresNumber(getExposuresNumber()); + li.setExposureAmount(getExposuresAmount()); li.setCarRealDownPaymentRatio(boLcct.getAttribute("FIRST_PAYMENT_RATIO").toString()); li.setCarRealDownPaymentAmt(boLcct.getAttribute("FIRST_PAYMENT").toString()); li.setFinancingRatio(1.0-boLcct.getAttribute("FIRST_PAYMENT_RATIO").getDouble()); @@ -682,6 +701,7 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { } gis.add(gr); } + gi.setGuars(gis); return gi; } public Guar getGuar(BizObject boLgu) throws Exception { @@ -1120,6 +1140,26 @@ public class AmpServiceImpl extends EsbCommon implements AmpService { return projectSet; } + public int getExposuresNumber() throws JBOException { + BigDecimal count = new BigDecimal("0"); + for(BizObject boChit : getExposures()){ + count = count.add(new BigDecimal(boChit.getAttribute("CLIENTBUYNUMBER").toString())); + } + return count.intValue(); + } + public List getExposures() throws JBOException { + List boChits = JBOFactory.createBizObjectQuery(CUSTOMER_HISTORY_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid ").setParameter("flowunid",flowUnid).getResultList(false); + System.out.println(boChits.size()); + return boChits; + } + public String getExposuresAmount() throws JBOException { + BigDecimal amount = new BigDecimal("0"); + for(BizObject boChit : getExposures()){ + amount = amount.add(new BigDecimal(boChit.getAttribute("EXPOSURE").toString())); + } + return amount.toString(); + } + public String idDateConvert(String date){ if("2100/12/31".equals(date)){ date = "0000-00-00";