From 0db4302044b776fef2e1267a8fa5807740c97178 Mon Sep 17 00:00:00 2001 From: ap007 Date: Tue, 6 Sep 2022 10:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=8F=E9=94=80=E5=95=86=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BD=B1=E5=83=8F=E8=B5=84=E6=96=99=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FundPaymentInvoice/LbInvoiceTemp.jsp | 2 +- .../DistributorApproval/LDistributorInfo.jsp | 49 +++++++++++++++- .../DistributorChange/LDistributorInfo.jsp | 49 +++++++++++++++- .../Comm/LBContract/LBContractPrintList.jsp | 2 +- .../Flow/Comm/LBProject/LBProjectInfo.jsp | 58 +++++++++---------- .../BusinessProjectTempInfo.jsp | 3 +- .../ample/icms/service/ImageInfoService.java | 4 +- .../ample/icms/service/ImageOcrService.java | 10 +++- src/com/ample/icms/util/GetInfoUtil.java | 28 ++++++++- .../IcmsDocListCheckOfDistributor.java | 43 ++++++++++++++ 10 files changed, 203 insertions(+), 45 deletions(-) create mode 100644 src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckOfDistributor.java diff --git a/WebContent/Tenwa/Core/InvoiceManager/FundPaymentInvoice/LbInvoiceTemp.jsp b/WebContent/Tenwa/Core/InvoiceManager/FundPaymentInvoice/LbInvoiceTemp.jsp index 17c07b2f4..d5f5249eb 100644 --- a/WebContent/Tenwa/Core/InvoiceManager/FundPaymentInvoice/LbInvoiceTemp.jsp +++ b/WebContent/Tenwa/Core/InvoiceManager/FundPaymentInvoice/LbInvoiceTemp.jsp @@ -52,7 +52,7 @@ %><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> <%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/Tenwa/Lease/DistributorManage/DistributorChange/LDistributorInfo.jsp b/WebContent/Tenwa/Lease/DistributorManage/DistributorChange/LDistributorInfo.jsp index 4cc48399d..085fe3f72 100644 --- a/WebContent/Tenwa/Lease/DistributorManage/DistributorChange/LDistributorInfo.jsp +++ b/WebContent/Tenwa/Lease/DistributorManage/DistributorChange/LDistributorInfo.jsp @@ -8,7 +8,8 @@ String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号 String RightType=CurPage.getParameter("RightType"); if(sFlowUnid == null) sFlowUnid=""; - + String sPhaseNo=CurPage.getParameter("PhaseNo");//阶段号 + String FlowNo = CurPage.getParameter("FlowNo");//流程编号 ASObjectModel temp = new ASObjectModel("LDistributorChangeInfoHis"); //获取法人原始信息 ASObjectWindow wtemp = new ASObjectWindow(CurPage, temp,request); ASResultSet rs = Sqlca.getResultSet(new SqlObject(wtemp.getDataObject().getJboSql().replaceAll("v\\.", "").replaceAll("jbo\\.[\\w+\\.]+\\.","").replaceAll(" O ", " "+temp.getJboClass().replaceAll("jbo\\.[\\w+\\.]+\\.","")+" O ")).setParameter("FlowUnid", sFlowUnid)); @@ -49,7 +50,8 @@ dwTemp.replaceColumn("beforechange", "", CurPage.getObjectWindowOutput()); String sButtons[][] = { - {"true","All","Button","保存","保存所有修改","save()","","","",""} + {"true","All","Button","保存","保存所有修改","save()","","","",""}, + {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""} /* {String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""} */ }; sButtonPosition = "north"; @@ -211,6 +213,47 @@ function saveproj_name(){ setItemRequired(0,'LIMIT_END_DATE',true); } } - +function openFileList(){ + let appInfo = getAppInfo(); + let index = appInfo.indexOf("@"); + if(index==-1){ + alert(appInfo); + return; + } + let appCode = appInfo.substr(0,index); + let appName = appInfo.substr(index+1,appInfo.length); + if(appCode=='0000'){ + alert(appName); + return; + } + openAppointFileList(appCode,appName); +} +function openAppointFileList(appCode,appName){ + let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl",""); + let code = getCode(); + let params = getRequestParam(appCode,appName,code); + if(params!=null){ + AsControl.postICMS(url,params); + } +} +function getAppInfo(){ + let appInfo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getAppInfoByFlowNoRJM", "flowNo=<%=FlowNo%>"); + return appInfo; +} +function getCode(){ + let code = 'ECM0002'; + if( + "<%=FlowNo%>"=="DistributorApprovalFlow"&&("<%=sPhaseNo%>"=="0010")|| + "<%=FlowNo%>"=="DistributorChangeFlow"&&("<%=sPhaseNo%>"=="0010") + ){ + code = 'ECM0001'; + } + return code; +} +function getRequestParam(appCode,appName,code){ + let busiNo = getItemValue(0,0,'DISTRIBUTOR_NO'); + let param = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestParam","appCode="+appCode+",appName="+appName+",code="+code+",busiNo="+busiNo); + return param; +} <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBContract/LBContractPrintList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBContract/LBContractPrintList.jsp index 637f664de..007e377f8 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBContract/LBContractPrintList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBContract/LBContractPrintList.jsp @@ -58,7 +58,7 @@ //因为要传到付款阶段的合同套系,所以这里的flowNo固定为FundPaymentCarFlow var sParams="ProjectId=<%=projectId%>,flowUnid=<%=flowunid%>,projectNo=<%=ProjectNo%>,flowNo=FundPaymentCarFlow"; var sReturn = RunJavaMethodTrans("com.ample.icms.service.ImageUploadService","upload",sParams); - // alert(sReturn); + alert(sReturn); } //测试电子签约 function sign(){ diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp index 4f62c3616..2b5239cf3 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBProject/LBProjectInfo.jsp @@ -107,7 +107,8 @@ String sButtons[][] =null; sButtons= new String[][]{ {ShowButton,"All","Button","保存","保存所有修改","saveRecord()","","","",""}, - {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""} + {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""}, + {"true","","Button","尽职信审报告","尽职信审报告","openAppointFileList('APZLCTYWXSCL','传统业务信审资料')","","","","btn_icon_saveNew",""} }; %> <%/*~END~*/%> @@ -213,14 +214,7 @@ init(); } function openFileList(){ - let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl",""); - let params = getRequestParam(); - if(params!=null){ - post(url,params); - } - } - function getRequestParam(){ - let appInfo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getAppInfoByFlowUnidRJM", "flowUnid=<%=sFlowUnid%>"); + let appInfo = getAppInfo(); let index = appInfo.indexOf("@"); if(index==-1){ alert(appInfo); @@ -228,10 +222,35 @@ init(); } let appCode = appInfo.substr(0,index); let appName = appInfo.substr(index+1,appInfo.length); + if(appCode=='0000'){ + alert(appName); + return; + } + openAppointFileList(appCode,appName); + } + function openAppointFileList(appCode,appName){ + let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl",""); + let code = getCode(); + let params = getRequestParam(appCode,appName,code); + if(params!=null){ + AsControl.postICMS(url,params); + } + } + function getAppInfo(){ + let appInfo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getAppInfoByFlowUnidRJM", "flowUnid=<%=sFlowUnid%>"); + return appInfo; + } + function getCode(){ let code = 'ECM0002'; - if("<%=sPhaseNo%>"=="0010"){ + if( + "<%=FlowNo%>"=="ProjectApprovalFlow"&&("<%=sPhaseNo%>"=="0010"||"<%=sPhaseNo%>"=="0040"||"<%=sPhaseNo%>"=="0050")|| + "<%=FlowNo%>"=="ProjectCreditFlow"&&("<%=sPhaseNo%>"=="0010"||"<%=sPhaseNo%>"=="0040") + ){ code = 'ECM0001'; } + return code; + } + function getRequestParam(appCode,appName,code){ let busiNo = '<%=projectNo%>'; if(busiNo==null||busiNo==""||busiNo=="null"){ busiNo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getProjectNoByFlowUnidRJM", "flowUnid=<%=sFlowUnid%>"); @@ -239,26 +258,7 @@ init(); let param = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestParam","appCode="+appCode+",appName="+appName+",code="+code+",busiNo="+busiNo); return param; } - /** - * 考虑防止一些浏览器的弹窗被阻止,不用ajax,而是用form表单提交的方式 - * @param URL - * @param PARAMS - */ - function post(URL, param) { - let temp_form = document.createElement("form"); - temp_form.action = URL; - temp_form.target = "_blank"; - temp_form.method = "post"; - temp_form.style.display = "none"; - let opt = document.createElement("textarea"); - opt.name = 'data'; - opt.value = param; - temp_form.appendChild(opt); - - document.body.appendChild(temp_form); - temp_form.submit(); - } diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessProjectTempInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessProjectTempInfo.jsp index 27dcf44e3..00d7d143b 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessProjectTempInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/BusinessProjectTempInfo.jsp @@ -61,8 +61,7 @@ dwTemp.replaceColumn("customer_info", "", CurPage.getObjectWindowOutput()); String sButtons[][] = { {"ReadOnly".equals(rightType)?"false":"true","","Button","保存","保存","save()","","","","btn_icon_saveNew",""}, - {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""}, - {"true","","Button","产品信息","产品信息","product()","","","","btn_icon_saveNew",""} + {"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""} }; %><%@ include file="/Frame/resources/include/ui/include_info.jspf"%> diff --git a/src/com/ample/icms/service/ImageInfoService.java b/src/com/ample/icms/service/ImageInfoService.java index d7d8c1d5a..cd6bef407 100644 --- a/src/com/ample/icms/service/ImageInfoService.java +++ b/src/com/ample/icms/service/ImageInfoService.java @@ -16,10 +16,10 @@ public class ImageInfoService { private String projectNo; private String flowNo; - public String getFileUrl(JBOTransaction tx) throws Exception { + public String getFileUrl(String folderNo ,JBOTransaction tx) throws Exception { String result = this.getResponseResult(tx); //APZLJJ000400 APZLJJ000060 - String FileUrl = this.getFileUrlByResultAnalysis(result,"APZLJJ000060"); + String FileUrl = this.getFileUrlByResultAnalysis(result,folderNo); return FileUrl; } public String getResponseResult(JBOTransaction tx) throws SQLException, JBOException { diff --git a/src/com/ample/icms/service/ImageOcrService.java b/src/com/ample/icms/service/ImageOcrService.java index 814866327..60122b998 100644 --- a/src/com/ample/icms/service/ImageOcrService.java +++ b/src/com/ample/icms/service/ImageOcrService.java @@ -8,14 +8,18 @@ public class ImageOcrService { private String contractId; private String projectNo; private String flowNo; - public String invoiceOrcDo(JBOTransaction tx) throws Exception { + public String invoiceOrcOfInvoice(JBOTransaction tx) throws Exception { + + return this.invoiceOrc("APZLJJ000060",ImageOcr.ocrType.vehicle_invoice_ocr,tx); + } + public String invoiceOrc(String floder,ImageOcr.ocrType ocrType,JBOTransaction tx) throws Exception { ImageInfoService iis = new ImageInfoService(); iis.setContractId(contractId); iis.setFlowNo(flowNo); - String fileUrl = iis.getFileUrl(tx); + String fileUrl = iis.getFileUrl(floder,tx); ImageOcr io = new ImageOcr(); - String result = io.doPost(fileUrl, ImageOcr.ocrType.vehicle_invoice_ocr); + String result = io.doPost(fileUrl, ocrType); return result; } diff --git a/src/com/ample/icms/util/GetInfoUtil.java b/src/com/ample/icms/util/GetInfoUtil.java index f0d4b1aa2..c0957ef68 100644 --- a/src/com/ample/icms/util/GetInfoUtil.java +++ b/src/com/ample/icms/util/GetInfoUtil.java @@ -70,7 +70,7 @@ public class GetInfoUtil { String appInfo = getAppInfoByProjectNo(projectNo,flowNo,Sqlca); return appInfo; } - public String getAppInfoByProjectNo(String projectNo, String flowNo, Transaction Sqlca) throws SQLException, JBOException { + public String getAppInfoByProjectNo(String projectNo, String flowNo, Transaction Sqlca) throws SQLException { String sql = "select app_code,app_name from icms_rela where flow_no='" + flowNo + "' and project_no='" + projectNo + "'"; SqlObject sql_icms = new SqlObject(sql); ASResultSet rs = Sqlca.getASResultSet(sql_icms); @@ -310,7 +310,31 @@ public class GetInfoUtil { String productId = Sqlca.getString(new SqlObject(sql)); return productId; } - + public String getAppInfoByFlowNoRJM() throws SQLException { + Transaction Sqlca = Transaction.createTransaction("als"); + return getAppInfoByFlowNo(flowNo,Sqlca); + } + public String getAppInfoByFlowNo(String flowNo, Transaction Sqlca) throws SQLException { + String sql = "select app_code,app_name from icms_prd_rela where flowno='" + flowNo + "'"; + SqlObject sql_icms = new SqlObject(sql); + ASResultSet rs = Sqlca.getASResultSet(sql_icms); + String appCode = null; + String appName = null; + while (rs.next()) { + appCode = rs.getString("app_code"); + appName = rs.getString("app_name"); + } + if (appCode == null) { + return "0000@未找到初始化的影像信息配置,请联系管理员"; + } + String appInfo = appCode + "@" + appName; + return appInfo; + } + public String getDistributorIdByFlowUnid(String flowUnid, Transaction Sqlca) throws SQLException { + String sql = "select distributor_no from distributor_info_temp where flowunid='" + flowUnid + "'"; + String distributorNo = Sqlca.getString(new SqlObject(sql)); + return distributorNo; + } public String getFlowUnid() { return flowUnid; } diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckOfDistributor.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckOfDistributor.java new file mode 100644 index 000000000..2eadcb8d5 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/IcmsDocListCheckOfDistributor.java @@ -0,0 +1,43 @@ +package com.tenwa.lease.flow.project.commcheck; + +import com.amarsoft.app.alarm.AlarmBiz; +import com.amarsoft.awe.util.Transaction; +import com.ample.icms.check.ImageCheck; +import com.ample.icms.util.GetInfoUtil; + +/** + * 资料清单检查 + * @author 20170524 + * + */ +public class IcmsDocListCheckOfDistributor extends AlarmBiz { + @Override + public Object run(Transaction Sqlca) throws Exception { + String flowUnid = this.getAttribute("ObjectNo").toString(); + GetInfoUtil gif = new GetInfoUtil(); + String busiNo = gif.getDistributorIdByFlowUnid(flowUnid,Sqlca); + String flowNo = gif.getFlowNoByFlowUnid(flowUnid,Sqlca); + String app = gif.getAppInfoByFlowNo(flowNo,Sqlca); + String [] appInfo = app.split("@"); + String appCode = appInfo[0]; + String appName = appInfo[1]; + if("0000".equals(appCode)){ + setPass(false); + putMsg(appName); + return null; + } + ImageCheck ic= new ImageCheck(); + ic.setAppCode(appCode); + ic.setAppName(appName); + ic.setBusiNo(busiNo); + String result =ic.resultAnalysis(ic.getResult()); + String[] resultInfo = result.split("@"); + if("true".equals(resultInfo[0])){ + setPass(true); + }else{ + setPass(false); + } + putMsg(resultInfo[1]); + return null; + } +}