From af404730114bc129ad7a5d9a0642445f0c21f7e1 Mon Sep 17 00:00:00 2001 From: "zhanglei@ap-leasing.com.cn" Date: Wed, 20 Sep 2023 11:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=8E=E6=8E=A7=E4=B8=AD=E5=8F=B0-=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=8F=91=E8=B5=B7=E8=AF=84=E5=88=86=E5=90=8E=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BA=BA=E5=B7=A5=E5=88=A4=E5=AE=9A=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessApplication/RCScoreResult.jsp | 2 +- .../ample/esb/controller/AmpController.java | 1 + src/com/ample/esb/service/AmpService.java | 1 + .../esb/service/impl/AmpServiceImpl.java | 44 ++++++++++++++++++- 4 files changed, 45 insertions(+), 3 deletions(-) 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";