diff --git a/WebContent/Tenwa/Core/FlowManager/BaseFunction/BaseFlowFunction.jspf b/WebContent/Tenwa/Core/FlowManager/BaseFunction/BaseFlowFunction.jspf index 2ed4e5897..171fb5674 100644 --- a/WebContent/Tenwa/Core/FlowManager/BaseFunction/BaseFlowFunction.jspf +++ b/WebContent/Tenwa/Core/FlowManager/BaseFunction/BaseFlowFunction.jspf @@ -81,13 +81,6 @@ FlowFunction.doSubmit=function(sObjectType,sObjectNo,sTaskNo,sFlowName,sFlowNo,s } return; }} - //判断经销商留言是否填写 - if (sPhaseNo != "0010" && sPhaseNo != "0020") { - var isopenmassge = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction", "getjxsmessage", "TaskNo=" + sTaskNo); - if (isopenmassge == "Y") { - return this.getDealerMessage(sObjectNo, sPhaseNo, sTaskNo); - } - } autoRiskScan(sFlowName,"TaskNo="+sTaskNo+"&ObjectType="+sObjectType+"&ObjectNo="+sObjectNo+"&FlowNo="+sFlowNo+"&PhaseNo="+sPhaseNo+"&isAutoCommit=false",sPhaseNo,function(riskMessage){ if(riskMessage != true){ @@ -150,7 +143,7 @@ FlowFunction.backStep=function(sObjectType,sObjectNo,sFlowNo,sPhaseNo,sTaskNo,sF }} //判断经销商留言是否填写 - if (sPhaseNo != "0010" && sPhaseNo != "0020") { + if (sPhaseNo = "0030") { var isopenmassge = AsControl.RunJavaMethodTrans("com.amarsoft.app.flow.FlowAction", "getjxsmessage", "TaskNo=" + sTaskNo); if (isopenmassge == "Y") { return this.getDealerMessage(sObjectNo, sPhaseNo, sTaskNo); diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp index 1fb88e2ac..bdce6ea14 100644 --- a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistoryInformation.jsp @@ -48,9 +48,11 @@ <%@ include file="/Resources/CodeParts/Tab01.jsp"%> <%@ include file="/IncludeEnd.jsp"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp index 7c33e6205..94f9c8a48 100644 --- a/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp +++ b/WebContent/Tenwa/Customer/Lessee/Comm/CustomerHistory/CustomerHistory_Info_temp.jsp @@ -11,10 +11,18 @@ String sTempletNo = "CustomerHistoryInfoTemp";//--模板号-- String flowunId=CurPage.getParameter("flowunid");//流程编号 String certId=CurPage.getParameter("certId");//客户证件号 + String type =CurPage.getParameter("type");//客户类型 ASObjectModel doTemp = new ASObjectModel(sTempletNo); ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request); dwTemp.Style = "2";//freeform //dwTemp.genHTMLObjectWindow("1"); + //只有客户显示总敞口 + if(type.equals("client")){ + doTemp.setVisible("EXPOSURE",true); + }else { + doTemp.setVisible("EXPOSURE",false); + } + dwTemp.genHTMLObjectWindow(flowunId+","+certId); String compClientID = request.getParameter("CompClientID"); 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/config/baic.properties b/config/baic.properties index 5f20012c1..61c778c81 100644 --- a/config/baic.properties +++ b/config/baic.properties @@ -4,7 +4,7 @@ userid=TYJWBY7F AFS012_serviceid=N9LZG7J8OXSD90B4 AMP005_serviceid=24LITXVE9LKXANTD -log_path=D:/tmp/esb/log/ +log_path=/data/esb/log/ ## 反欺诈 afs_url=http://test-antifraud.baicfc.com/Instinct.UI.WebClient_5.3.1_2023/api/redirect? diff --git a/src/com/ample/esb/common/EsbCommon.java b/src/com/ample/esb/common/EsbCommon.java index 1947592aa..b6f90f57c 100644 --- a/src/com/ample/esb/common/EsbCommon.java +++ b/src/com/ample/esb/common/EsbCommon.java @@ -25,7 +25,6 @@ import org.apache.http.util.EntityUtils; import org.bouncycastle.crypto.digests.SM3Digest; import java.io.IOException; -import java.nio.charset.StandardCharsets; public class EsbCommon implements EsbServise { public Transaction createEsbTransaction() { @@ -96,8 +95,8 @@ public class EsbCommon implements EsbServise { HttpResponse response = client.execute(httppost); if(response.getStatusLine().getStatusCode() == HttpStatus.SC_OK){ result = EntityUtils.toString(response.getEntity()); - byte[] xmlByte = result.getBytes(StandardCharsets.ISO_8859_1); - result = new String(xmlByte,"utf-8"); + // byte[] xmlByte = result.getBytes(StandardCharsets.ISO_8859_1); + // result = new String(xmlByte,"utf-8"); System.out.println("ESB响应报文:\n"+result); } } catch (IOException e) { @@ -120,13 +119,13 @@ public class EsbCommon implements EsbServise { } @Override public Transaction transactionDo(){ - String logPath = BaicPropertiesUtil.get("log_path"); //.创建实体类 Transaction tranRequest = createEsbTransaction(); + String logPath = BaicPropertiesUtil.get("log_path")+tranRequest.getMessageEsbHead().getTranCode()+"_"+tranRequest.getMessageEsbHead().getGlobalSeqNo(); //.转换为xml请求报文 String xmlRrquest = XstreamUtil.xmlConvert(tranRequest); //.将xml请求报文存为文件 - FileUtil.writeFile(logPath+tranRequest.getMessageEsbHead().getGlobalSeqNo()+"_request.txt", xmlRrquest); + FileUtil.writeFile(logPath + "_request.txt", xmlRrquest); //.保存请求信息 saveEsbLog(tranRequest); //.获得url @@ -134,7 +133,7 @@ public class EsbCommon implements EsbServise { //.得到响应报文 String xmlResopnse= this.httpSend(url,xmlRrquest); //.将xml响应报文存为文件 - FileUtil.writeFile(logPath+tranRequest.getMessageEsbHead().getGlobalSeqNo()+"_response.txt", xmlResopnse); + FileUtil.writeFile(logPath+"_response.txt", xmlResopnse); //.转换为实体类 Transaction tranResponse = (Transaction)XstreamUtil.objectConvert(xmlResopnse); //.更新响应信息 diff --git a/src/com/ample/esb/controller/AfsResultServlet.java b/src/com/ample/esb/controller/AfsResultServlet.java index a5c38ec78..9bc0b7382 100644 --- a/src/com/ample/esb/controller/AfsResultServlet.java +++ b/src/com/ample/esb/controller/AfsResultServlet.java @@ -10,7 +10,9 @@ import com.ample.esb.util.BaicPropertiesUtil; import com.ample.esb.util.DateUtils; import com.ample.esb.util.XstreamUtil; import com.ample.sms.FileUtil; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; import jbo.oti.RC_SCORE_RESULT; +import org.apache.commons.collections.CollectionUtils; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -20,6 +22,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; +import java.util.List; public class AfsResultServlet extends HttpServlet { private static final long serialVersionUID = 1L; @@ -55,8 +58,10 @@ public class AfsResultServlet extends HttpServlet { Transaction tran = (Transaction)XstreamUtil.objectConvert(requestXml); String logPath = BaicPropertiesUtil.get("log_path"); String globalSeqNo = tran.getMessageEsbHead().getGlobalSeqNo(); + String tranCode = tran.getMessageEsbHead().getTranCode(); String projectNo = tran.getMessageBody().getAfsResultRequest().getApplyNo(); - FileUtil.writeFile(logPath + projectNo +"_"+ globalSeqNo +"_request.txt", requestXml); + String filePath = logPath + tranCode + "_" + projectNo +"_"+ globalSeqNo; + FileUtil.writeFile( filePath + "_request.txt", requestXml); String fraudAlert = tran.getMessageBody().getAfsResultRequest().getFraudAlert(); String actionTaken = tran.getMessageBody().getAfsResultRequest().getActionTaken(); @@ -80,7 +85,8 @@ public class AfsResultServlet extends HttpServlet { BizObject boRsr = null; try { bom = JBOFactory.getBizObjectManager(RC_SCORE_RESULT.CLASS_NAME); - boRsr = bom.createQuery("project_no=:projectNo").setParameter("projectNo",projectNo).getSingleResult(true); + String flowUnid = queryProjectTemp(projectNo); + boRsr = bom.createQuery("flow_no=:flow_no").setParameter("flow_no",flowUnid).getSingleResult(true); boRsr.setAttributeValue("fraud_alert_code",fraudAlert); boRsr.setAttributeValue("fraud_taken_code",actionTaken); boRsr.setAttributeValue("update_time", DateUtils.dateTimeNowCore()); @@ -99,11 +105,31 @@ public class AfsResultServlet extends HttpServlet { appHead.setTargetTranTime(DateUtils.TimeNowAccurate()); String responseXml = XstreamUtil.xmlConvert(tran); - FileUtil.writeFile(logPath + projectNo +"_"+ globalSeqNo + RetCommStatus +"_response.txt", responseXml); + FileUtil.writeFile(filePath + "_response.txt", responseXml); return responseXml; } + private String queryProjectTemp(String projectNo) throws JBOException { + String flowNo = null; + BizObjectManager lbProjectInfo = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME);// 项目信息 + List lbProjectInfoBizObjectList = lbProjectInfo.createQuery("PROJECT_NO=:PROJECT_NO").setParameter("PROJECT_NO", projectNo).getResultList(false); + if(CollectionUtils.isNotEmpty(lbProjectInfoBizObjectList)){ + for(BizObject lbProject : lbProjectInfoBizObjectList){ + if(null == flowNo){ + flowNo = lbProject.getAttribute("FLOWUNID").toString(); + ARE.getLog().info("WriteScoreResultThread#saveUpdateScoreResult:flowNoTempLong=" + flowNo.substring(3)); + }else { + String flowNoTemp = lbProject.getAttribute("FLOWUNID").toString(); + ARE.getLog().info("WriteScoreResultThread#saveUpdateScoreResult:flowNoTemp=" + flowNo); + if(Long.parseLong(flowNo.substring(3)) < Long.parseLong(flowNoTemp.substring(3))){ + flowNo = flowNoTemp; + } + } + } + } + return flowNo; + } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doPost(request, response); 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..7804fe69a 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,24 @@ 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 { + BizObject boChit = JBOFactory.createBizObjectQuery(CUSTOMER_HISTORY_INFO_TEMP.CLASS_NAME,"FLOWUNID=:flowunid and customertype='主承租人' ").setParameter("flowunid",flowUnid).getSingleResult(false); + String amount = boChit.getAttribute("EXPOSURE").toString(); + return amount; + } + public String idDateConvert(String date){ if("2100/12/31".equals(date)){ date = "0000-00-00"; diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java index c01f05b43..3f112f2d2 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/InsertCustomerHistoryInfo.java @@ -29,7 +29,7 @@ public class InsertCustomerHistoryInfo { } //获取客户历史信息 - public void InsertCustomerHistoryInfoTemp(JBOTransaction tx) throws Exception{ + public String InsertCustomerHistoryInfoTemp(JBOTransaction tx) throws Exception{ try { tx= JBOFactory.createJBOTransaction(); Conn conn = new Conn(tx); @@ -319,7 +319,7 @@ public class InsertCustomerHistoryInfo { }catch (Exception e){ e.printStackTrace(); } - + return "SUCCEEDED"; } @@ -336,16 +336,22 @@ public class InsertCustomerHistoryInfo { "select '' as customerid,cf.name as customername,cf.CERTTYPE,cf.certid,'共同承租人' as customertype,'' as customer_num,cf.FLOWUNID,cf.PROJECT_ID from customer_family_temp cf where cf.FLOWUNID = '" + flowunid + "'\n"; List> customerinfo = conn.executeQuery(sql); - String certid = ""; - List> cfinfo = new ArrayList<>(); + String certids = ""; + + for (int i = 0; i < customerinfo.size(); i++) { + if(customerinfo.size()==i+1){ + certids = certids+"'"+customerinfo.get(i).get("certid")+"'"; + }else { + certids = certids+"'"+customerinfo.get(i).get("certid")+"'"+","; + } + } //避免项目的历史客户信息重复录入 - for (int i = customerinfo.size()-1; i >= 0; i--) { - String cfsql = "select id from customer_history_info_temp where certid <> '"+customerinfo.get(i).get("certid")+"' and flowunid = '"+customerinfo.get(i).get("flowunid")+"'"; - cfinfo = conn.executeQuery(cfsql); + String cfsql = "select id from customer_history_info_temp where certid not in ("+certids+") and flowunid = '"+flowunid+"'"; + List> cfinfo = conn.executeQuery(cfsql); + - } if(cfinfo.size()>0){ for (int i = 0; i < cfinfo.size(); i++) {