From 42720ae3b51db80ce710a11c21212d2b02d2116d Mon Sep 17 00:00:00 2001 From: zhangjun Date: Thu, 20 Jun 2019 20:10:08 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E5=95=86=E7=A7=9F=E9=87=91=E8=AE=A1=E5=88=92=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Flow/RentCollection/rentcollection/CapgeminiReport.jsp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp index 438223895..5f980e2d1 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp @@ -28,12 +28,14 @@ doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); //导出有权限 template = "cff950db664c4faeb1f4656629176004"; + }else{ + template = "cff950db664c4faeb1f4656629176004"; } String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); if(roleList.contains("800R00000051")){ - doTemp.appendJboWhere(" and lci.distributor_id='"+distributor_no+"'"); + doTemp.appendJboWhere(" and O.distributor_no='"+distributor_no+"'"); template = "cff950db664c4faeb1f4656629176004"; } From 18148808f235c927d1c529d071f1ee3f9c261c68 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Thu, 20 Jun 2019 20:12:59 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=B8=BA=E5=82=AC=E6=94=B6=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9=E5=BA=94=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rentcollection/ClearingDataReport.jsp | 4 +++- .../rentcollection/FundIncomeReport.jsp | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp index 91d13d590..d4a4b54c3 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp @@ -28,12 +28,14 @@ doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); //导出有权限 template = "6d2b46cb97c84867b38e1f39d4e9a092"; + }else{ + template = "6d2b46cb97c84867b38e1f39d4e9a092"; } String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); if(roleList.contains("800R00000051")){ - doTemp.appendJboWhere(" and lci.distributor_id='"+distributor_no+"'"); + doTemp.appendJboWhere(" and O.distributor_no='"+distributor_no+"'"); template = "6d2b46cb97c84867b38e1f39d4e9a092"; } diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp index 4c55bffbf..0e83b5f84 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp @@ -40,7 +40,7 @@ String template = ""; //登录人属于经销商角色 401:经销商roleid - if(roleList.contains("401")){ + if(roleList.contains("401") && !roleList.contains("800R00000051")){ doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); //导出有权限 template = "2cd25a9b1c6248c8abacaeeaf7cda303"; @@ -48,6 +48,15 @@ //导出无权限 template = "a87e9bea25694013b9cc39216cac831e"; } + String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); + String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); + + if(roleList.contains("800R00000051")){ + doTemp.appendJboWhere(" and lci.distributor_id='"+distributor_no+"'"); + template = "2cd25a9b1c6248c8abacaeeaf7cda303"; + }else{ + template = "a87e9bea25694013b9cc39216cac831e"; + } ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); dwTemp.Style="1"; //--设置为Grid风格-- From 9ae82bec909231e21fc6b90566061d8d3f8a6d5f Mon Sep 17 00:00:00 2001 From: zhangjun Date: Thu, 20 Jun 2019 20:25:43 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=A7=9F=E9=87=91=E5=82=AC=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E7=A7=9F=E9=87=91=E5=82=AC=E6=94=B6=E5=87=BD=E5=8A=A0?= =?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=8C=E5=AF=B9=E5=BA=94=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GeneratedReminderLetterList.jsp | 11 +++-- .../rentcollection/rentCollectionList.jsp | 12 +++-- WebContent/WEB-INF/etc/jbo/jbo_customer.xml | 41 ++++++++++++++++-- WebContent/fileTemplate/娓犻亾鍟嗗偓鏀舵姤琛.xlsx | Bin 0 -> 8557 bytes .../fileTemplate/娓犻亾鍟嗙閲戣鍒掓姤琛.xlsx | Bin 0 -> 9429 bytes .../fileTemplate/娓犻亾鍟嗙粨娓呮暟鎹姤琛.xlsx | Bin 0 -> 8348 bytes 6 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 WebContent/fileTemplate/娓犻亾鍟嗗偓鏀舵姤琛.xlsx create mode 100644 WebContent/fileTemplate/娓犻亾鍟嗙閲戣鍒掓姤琛.xlsx create mode 100644 WebContent/fileTemplate/娓犻亾鍟嗙粨娓呮暟鎹姤琛.xlsx diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp index d6dbc0368..2d47282d1 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp @@ -42,7 +42,7 @@ }else if(roleList.contains("800R00000048")){ String userid_kj=""; BizObjectManager userInfoBOM = JBOFactory.getBizObjectManager("jbo.awe.USER_INFO"); - List userListObject = userInfoBOM.createQuery("belongorg=:belongorg").setParameter("belongorg", "8006014").getResultList(false); + List userListObject = userInfoBOM.createQuery("belongorg=:belongorg").setParameter("belongorg", "8006002").getResultList(false); List useridList_kj = new ArrayList(); for(BizObject bo : userListObject){ userid_kj = bo.getAttribute("userid").toString(); @@ -52,10 +52,15 @@ doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); } //登录人属于经销商角色 401:经销商roleid - if(roleList.contains("401")){ + if(roleList.contains("401") && !roleList.contains("800R00000051")){ doTemp.appendJboWhere(" and O.project_manage='"+userid+"'"); } - + String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); + String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); + + if(roleList.contains("800R00000051")){ + doTemp.appendJboWhere(" and O.distributor_id='"+distributor_no+"'"); + } /* String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract"); diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp index ff8281029..bf4d775d4 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp @@ -36,7 +36,7 @@ } String useridStr = StringUtils.join(useridList.toArray(), ","); doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); - }else if(roleList.contains("800R00000045")){ + }/* else if(roleList.contains("800R00000045")){ String userid_kj=""; BizObjectManager userInfoBOM = JBOFactory.getBizObjectManager("jbo.awe.USER_INFO"); List userListObject = userInfoBOM.createQuery("belongorg=:belongorg").setParameter("belongorg", "8006014").getResultList(false); @@ -47,11 +47,17 @@ } String useridStr = StringUtils.join(useridList_kj.toArray(), ","); doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); - } + } */ //登录人属于经销商角色 401:经销商roleid - if(roleList.contains("401")){ + if(roleList.contains("401") && !roleList.contains("800R00000051")){ doTemp.appendJboWhere(" and O.project_manage='"+userid+"'"); } + String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); + String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); + + if(roleList.contains("800R00000051")){ + doTemp.appendJboWhere(" and O.distributor_id='"+distributor_no+"'"); + } diff --git a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml index f0486b3c6..4e35dbda9 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml @@ -3180,7 +3180,7 @@ - + @@ -3210,6 +3210,7 @@ + @@ -3225,7 +3226,7 @@ - + @@ -3234,6 +3235,7 @@ + @@ -3247,5 +3249,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebContent/fileTemplate/娓犻亾鍟嗗偓鏀舵姤琛.xlsx b/WebContent/fileTemplate/娓犻亾鍟嗗偓鏀舵姤琛.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..50cf2c03eb198bf33dfc9d4fb68f89b2bf614fc7 GIT binary patch literal 8557 zcmeHMg0K}tf95|ET0X{0-(JEf5>`HeTed#~5u zU+{f~ky;g3_&{uphc6Pio;BB_gSFh< zh+3le{%P-g`-+Or5*B}d@dW1j7|x`v4U@0Y={lP{Tnx4E0=|b)fg06wO(rvqMwgpZ z#THk_2JR^n^G8b@;R(&?i^IzZkQP32Wgg<{;^?yyz3v1sORJxOpHC~}%a}8@nmTnb?v}>8fqA5E*!9sl zM>q9D4o_0P25@~x0015yU;%3Xpk=K#2hAB2Yf4bop+ISA>;kfLWqT2I3TuhT{vT2kCVy>n@pHmBUO)XdaY>SJw08>?Vz51WczC zenk_Fe5$lRo{rb+YGyTC?$>Kab$(5(t!e$#rqV3iMS$Ad*ut*uR4Stt=iZM^C9_w9 zng{!eYecq(F6TTzuZHJjAj`Xp57=4Sd)yZsL-BqInxXzpk|2@Ssi)8tX@Zi37=Q%h zWyk(IPdpu6z-Eq);2+uRPtL$VQyA3CfA{#Hp{&@&f!U1mJ%YnC!vha%){UKdUwaP& zsjr4gsPtez3an9RW-bZ7@`QX?c3Bo%Loesew znH`jo2g}0aVDInll^&p=zj4KB6iMu5&Bo>5x?-dwipVRZmO5)359hHR=5Xh-bsZ(^ zhhk=+W+U(>RCB*9xTe0I@(q*a=0l_8`~||>U~h`CQzD?e5Slk&Y-f^+<*Hr!0_oeQ zJ4Z>$4nN0u9X zJyXljNdFr$G3^-H&+Exx)yL9h5nRD&jQcw9nK(&n#m?Iz zih33WjT9qA5+SWK)TpJYx1#npm>3XDbT}9h?V6!ReeM)36qQ2hoi_7);8&mVz^pEPv{_#!Pqs>^`yCPuPn`NO+xtA&w+wP{EZlW(^(G3^wAlmKj zkuyZ#Z{DFAYm+{ZORD}X=~;&F?)2;DWOGD#lE}(Nl+n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5lkp|>}iDs%#v^orPtI)kd0P>t&{$Q1VK#>F2h(zgExDczCuM%4{^=i7p@UE z7Oi8cro_5T4P~w&aru>bA30z(%#363h~>v50t=odwdeM%m`?mp+JO+)8*C`w#fHnn4FC{JaNpVL?>HL{FT!pgH> z-UA|TnE73B+yw0&t0BP+z&IQx6j=KgJSV?S{G0MY=Q*K|6GM=Jcw-m6( zJ63CP3t!=;IQ$3wtn93jz(?AxQZC5JKl69jb; zkggW<@2E3&aQGkSAY1mwm8aHWHwDoXsZTKCj`Ypt#Vj@(#C4T1C^YA7k9t#Wm`Mbx z3&-s$^uz)|YkY@1U`qOrSz{NK55;eYO?Ng3gnuK!iB%kzBPy1480G za9*Dw6wq#&^%?|+4Q>v;Mj%`eHw!&og{eYp4e^6F5yyG@s!X!XJY7a#Jbx|7NJe&5 zB0qMba;ud-DulXXl+mI8YVsT@6fIzga=8>ie1>y`=w54LaZl4wP~X-Xo4My>Q=K$Z z9?K?EZeUDn`^JrQAg(tmvT8l74<4!=i1C^iSH7J2bNEZVL21nUI*PYqwFN8*NGcKV z=4ck@l;KoS0`Q5cka!j%a6X2rB#NBua=(~gT}oic%ED)LO*K^=M za`({68K1b7J+U;g2;LLZZLTuYNZCr;7h~!%vWU`~TPUfA;gUwELH*Bgm-x zC!zOe47(i!CcJO8KW_}TR5 zBJM9!0N#II{a+>B&tCqSYX9Z~kOip>|CM-uHvi|D`FC?Xi2C;*^FK~dWqCMAbO8Wl O$j1+o+u_N6{Q5r!eotQj literal 0 HcmV?d00001 From 31cfa4fca68e06f38a824bad644503ff71831785 Mon Sep 17 00:00:00 2001 From: tangfutang Date: Fri, 21 Jun 2019 19:53:16 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=B5=84=E9=87=91=E5=AE=9E=E6=94=B6?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=94=B9=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../query_report/pengyuandata.jsp | 3 + .../rentcollection/FundIncomeReport.jsp | 267 +- .../fileTemplate/璧勯噾瀹炴敹鎶ヨ〃瀵煎嚭3.xlsx | Bin 0 -> 10826 bytes .../action/ContractSignAction.java | 5232 ++++++++--------- .../commcheck/MakingContractCarCheck.java | 2 +- 5 files changed, 2754 insertions(+), 2750 deletions(-) create mode 100644 WebContent/fileTemplate/璧勯噾瀹炴敹鎶ヨ〃瀵煎嚭3.xlsx diff --git a/WebContent/Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/pengyuandata.jsp b/WebContent/Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/pengyuandata.jsp index 32a43eecb..434330f09 100644 --- a/WebContent/Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/pengyuandata.jsp +++ b/WebContent/Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/pengyuandata.jsp @@ -112,6 +112,9 @@ <% } finally { diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp index 0e83b5f84..6bb823e58 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp @@ -1,134 +1,135 @@ -<%@ page contentType="text/html; charset=GBK"%> -<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> -<%@ page import="org.apache.commons.lang.StringUtils" %> -<% - /* - Author: undefined 2018-10-30 - Content: - History Log: - */ - String userid=CurUser.getUserID(); - ASObjectModel doTemp = new ASObjectModel("FundIncomeReport"); - - //加权限 - BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); - List roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).getResultList(false); - List roleList = new ArrayList(); - String roleid = ""; - for(BizObject bo : roleListObject){ - roleid = bo.getAttribute("roleid").toString(); - roleList.add(roleid); - } - //roleid:800R00000044 北财合作方 - //String roleId = "800R00000044"; - - //roleid:800R00000045 rolename: bccuishou - //如果登录人属于bccuishou角色,可以看到北财下的所有的合同 - /* if(roleList.contains("800R00000045")){ - List userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); - String userId = ""; - List useridList = new ArrayList(); - for(BizObject bo : userObjectList){ - userId = bo.getAttribute("userid").toString(); - useridList.add("'"+userId+"'"); - } - String useridStr = StringUtils.join(useridList.toArray(), ","); - doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); - } */ - - //导出模板编号 - String template = ""; - - //登录人属于经销商角色 401:经销商roleid - if(roleList.contains("401") && !roleList.contains("800R00000051")){ - doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); - //导出有权限 - template = "2cd25a9b1c6248c8abacaeeaf7cda303"; - }else{ - //导出无权限 - template = "a87e9bea25694013b9cc39216cac831e"; - } - String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); - String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); - - if(roleList.contains("800R00000051")){ - doTemp.appendJboWhere(" and lci.distributor_id='"+distributor_no+"'"); - template = "2cd25a9b1c6248c8abacaeeaf7cda303"; - }else{ - template = "a87e9bea25694013b9cc39216cac831e"; - } - - ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); - dwTemp.Style="1"; //--设置为Grid风格-- - dwTemp.ReadOnly = "1"; //只读模式 - dwTemp.ShowSummary="1"; //汇总 - dwTemp.setPageSize(10); - dwTemp.genHTMLObjectWindow(""); - - //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 - String sButtons[][] = { - //{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, - //{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, - {"true","","Button","导出excel","导出excel","exportExcel()","","","","btn_icon_up",""}, - //{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""}, - }; -%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> - +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<% + /* + Author: undefined 2018-10-30 + Content: + History Log: + */ + String userid=CurUser.getUserID(); + ASObjectModel doTemp = new ASObjectModel("FundIncomeReport"); + + //加权限 + BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); + List roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).getResultList(false); + List roleList = new ArrayList(); + String roleid = ""; + for(BizObject bo : roleListObject){ + roleid = bo.getAttribute("roleid").toString(); + roleList.add(roleid); + } + //roleid:800R00000044 北财合作方 + //String roleId = "800R00000044"; + + //roleid:800R00000045 rolename: bccuishou + //如果登录人属于bccuishou角色,可以看到北财下的所有的合同 + /* if(roleList.contains("800R00000045")){ + List userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); + String userId = ""; + List useridList = new ArrayList(); + for(BizObject bo : userObjectList){ + userId = bo.getAttribute("userid").toString(); + useridList.add("'"+userId+"'"); + } + String useridStr = StringUtils.join(useridList.toArray(), ","); + doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); + } */ + + //导出模板编号 + String template = ""; + + + String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); + String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); + +// if("DSTB20190516003654".equals(distributor_no)){//测试环境18 + if("DSTB20190510003636".equals(distributor_no)){//正式环境 + doTemp.appendJboWhere(" and lci.distributor_id ='"+distributor_no+"'"); + template = "56c237b623a54732b61196c0b64b8238"; + + }else if(roleList.contains("401")){ + doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); + //导出有权限 + template = "2cd25a9b1c6248c8abacaeeaf7cda303"; + }else{ + //导出无权限 + template = "a87e9bea25694013b9cc39216cac831e"; + } + + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.ShowSummary="1"; //汇总 + dwTemp.setPageSize(10); + dwTemp.genHTMLObjectWindow(""); + + //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 + String sButtons[][] = { + //{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, + //{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, + {"true","","Button","导出excel","导出excel","exportExcel()","","","","btn_icon_up",""}, + //{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + <%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/fileTemplate/璧勯噾瀹炴敹鎶ヨ〃瀵煎嚭3.xlsx b/WebContent/fileTemplate/璧勯噾瀹炴敹鎶ヨ〃瀵煎嚭3.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..c957fe64cfda0d83c44b322c0babccf1b3f5fe91 GIT binary patch literal 10826 zcmeHtRa9NevNrAn5AIHI3-0dj?(P~OxVyU(+}+(>f@^>v!QBE}NY2^W$=Uae`}~i; zADEN1O1i(A^Xpn&B_j?D0tN6o0;M*2Ua$WikS{j|*7`Db);9JuGB0AtFCRes5W9nR zeP#y)0I&uE0D%9yn68ZtwTq=idd!#@Fdef0jn4^ub;W*UP+T%HZ(q1dWpiXQyQK~Z zWYc{1mFh|(ygRURd$>=et`U$UMYFAQj6I7xDN$2Tgef|Np90QPlSL%W)#F<-7vckd^_S)*d&dK)@zdKlK`G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Ngx5lzRWqB`1Qa40niq# At^fc4 literal 0 HcmV?d00001 diff --git a/src/com/tenwa/channelportal/action/ContractSignAction.java b/src/com/tenwa/channelportal/action/ContractSignAction.java index e5a35a59a..cc380e0ba 100644 --- a/src/com/tenwa/channelportal/action/ContractSignAction.java +++ b/src/com/tenwa/channelportal/action/ContractSignAction.java @@ -1,2617 +1,2617 @@ -package com.tenwa.channelportal.action; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.log4j.Logger; - -import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; -import jbo.app.tenwa.customer.CUSTOMER_PERSON; -import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; -import jbo.app.tenwa.doc.LB_DOCATTRIBUTE; -import jbo.app.tenwa.doc.LB_DOCLIBRARY; -import jbo.app.tenwa.doc.LB_DOCRELATIVE; -import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST; -import jbo.app.tenwa.doc.LB_ONEDIMENSIONALCODE; -import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; -import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS; -import jbo.com.tenwa.lease.carbrand.LB_CONTRACT_SIGN_LOG; -import jbo.com.tenwa.lease.comm.LB_CONTRACT_TEMPLATE; -import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; -import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; -import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; -import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE; -import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP; -import jbo.sys.CODE_LIBRARY; - -import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.BizObjectManager; -import com.amarsoft.are.jbo.JBOException; -import com.amarsoft.are.jbo.JBOFactory; -import com.amarsoft.are.jbo.JBOTransaction; -import com.amarsoft.are.util.StringFunction; -import com.amarsoft.awe.Configure; -import com.amarsoft.awe.util.ASResultSet; -import com.amarsoft.awe.util.SqlObject; -import com.amarsoft.awe.util.Transaction; -import com.amarsoft.context.ASUser; -import com.caucho.hessian.client.HessianProxyFactory; -import com.tenwa.app.dao.ContractSignInfo; -import com.tenwa.lease.app.service.HttpRequestAppService; -import com.tenwa.lease.flow.contract.contractapproval.ContractTemplateCache; -import com.tenwa.makeContract.util.MakeOneCodeAndContractModel; -import com.tenwa.channelportal.action.generativecontract.Word2PdfUtil; -import com.tenwa.channelportal.action.generativecontract.WordToPDFUtil; -import com.tenwa.comm.util.date.DateAssistant; -import com.tenwa.comm.util.jboutil.DataOperatorUtil; -import com.tenwa.doc.util.BASE64; -import com.tenwa.officetempalte.util.FileOperatorUtil; -import com.tenwa.quartz.DateUtil; -import com.tenwa.reckon.util.UUIDUtil; - -public class ContractSignAction{ - public String file_id; - public String cust_phone; - public String cust_id; - public String library_id; - public String customerType; - public String CurUserID; - public String ProjectId; - public String contract_id; - public String FlowUnid; - public String InputOrgid; - public String id; - private String attrId; - public String flagType; - public HessianProxyFactory factory = new HessianProxyFactory(); - public HttpRequestAppService requestService; - public String PAYMENT_NUMBER; - public String PLAN_LIST; - public String Ttype; - public String contractNo; - public String leasform; - private static Logger logger=Logger.getLogger(ContractSignAction.class); - @SuppressWarnings("deprecation") - public static String getConfigRequestUrl() throws Exception{ - return Configure.getInstance().getConfigure("RequestHessionUrl"); - } - @SuppressWarnings("deprecation") - public static String getFileSavePath() throws Exception{ - return Configure.getInstance().getConfigure("FileSavePath"); - } - - public String getCurUserID() { - return CurUserID; - } - - public String getContract_id() { - return contract_id; - } - - public void setContract_id(String contract_id) { - this.contract_id = contract_id; - } - - public void setCurUserID(String curUserID) { - CurUserID = curUserID; - } - - public String getCustomerType() { - return customerType; - } - - public void setCustomerType(String customerType) { - this.customerType = customerType; - } - - public String getFile_id() { - return file_id; - } - - public void setFile_id(String file_id) { - this.file_id = file_id; - } - - - public String getCust_id() { - return cust_id; - } - - public void setCust_id(String cust_id) { - this.cust_id = cust_id; - } - - public String getCust_phone() { - return cust_phone; - } - public void setCust_phone(String cust_phone) { - this.cust_phone = cust_phone; - } - - public String getLibrary_id() { - return library_id; - } - public void setLibrary_id(String library_id) { - this.library_id = library_id; - } - - public String getProjectId() { - return ProjectId; - } - - public void setProjectId(String projectId) { - ProjectId = projectId; - } - - public String getFlowUnid() { - return FlowUnid; - } - - public void setFlowUnid(String flowUnid) { - FlowUnid = flowUnid; - } - - public String getInputOrgid() { - return InputOrgid; - } - - public void setInputOrgid(String inputOrgid) { - InputOrgid = inputOrgid; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - //类型 - public String getFlagType() { - return flagType; - } - - public void setFlagType(String flagType) { - this.flagType = flagType; - } - public String getAttrId() { - return attrId; - } - public void setAttrId(String attrId) { - this.attrId = attrId; - } - - - public String getPAYMENT_NUMBER() { - return PAYMENT_NUMBER; - } - public void setPAYMENT_NUMBER(String pAYMENT_NUMBER) { - PAYMENT_NUMBER = pAYMENT_NUMBER; - } - public String getPLAN_LIST() { - return PLAN_LIST; - } - public void setPLAN_LIST(String pLAN_LIST) { - PLAN_LIST = pLAN_LIST; - } - public String getTtype() { - return Ttype; - } - public void setTtype(String ttype) { - Ttype = ttype; - } - public String getContractNo() { - return contractNo; - } - public void setContractNo(String contractNo) { - this.contractNo = contractNo; - } - public String getLeasform() { - return leasform; - } - public void setLeasform(String leasform) { - this.leasform = leasform; - } - /** - * 自然人电子签约 - * - * @author tenwa518 - * @param tx - * @return - * @throws Exception - */ - @SuppressWarnings("unchecked") - public String signIng(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); - BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObjectManager lcslBom = JBOFactory.getBizObjectManager(LB_CONTRACT_SIGN_LOG.CLASS_NAME,tx); - Map> map = new HashMap>(); - ContractSignInfo con = null; - List bo = null; - BizObject ldclBo = null; - try { - //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); - BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); - // 查询lb_doc_contract_list表 - bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) ").setParameter("projectId", ProjectId).getResultList(true); - for (BizObject keys : bo) { - String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); - StringBuffer manyPeople = this.manyPeople(); - if(manyPeople.length()>0){ - info=info+"@applicant,"+manyPeople.deleteCharAt(manyPeople.length() - 1); - } - List list = map.get(info); - if (list == null) { - list = new ArrayList(); - map.put(info, list); - } - con = new ContractSignInfo(); - con.setCustname(keys.getAttribute("DOC_NAME").toString()); - con.setCustphone(keys.getAttribute("TELEPHONE").toString()); - con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(keys.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = keys.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - list.add(con); - } - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - Map resultMap = requestService.createContractSign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - //拷表的方法 - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - pbo.setAttributeValue("DATA_STATE", "8");// 状态改成电子签约,签署中 - pbm.saveObject(pbo); - //记录项目进程日志 - /*Transaction tran = Transaction.createTransaction(tx); - ASUser user = ASUser.getUser(CurUserID, tran); - JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME,tx) - .createQuery("UPDATE O SET BUSINESS_STATUS='8',UPDATEUSERID='"+user.getUserID()+"',UPDATEORGID='"+user.getOrgID()+"',UPDATETIME='"+StringFunction.getTodayNow()+"' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM "+LB_PROJECT_INFO.CLASS_NAME+" LPI WHERE LPI.ID='"+ProjectId+"')").executeUpdate(); - SqlObject so = new SqlObject("INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'8','"+user.getUserID()+"','"+user.getOrgID()+"','"+StringFunction.getTodayNow().replaceAll(":", "△")+"' FROM LB_PROJECT_INFO WHERE ID='"+ProjectId+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); - so.setRunSql(so.getRunSql().replaceAll("△", ":")); - tran.executeSQL(so);*/ - return "success"; - } else { - Boolean flag = false; - String getMessage = resultMap.get("error"); - logger.info("契约锁反馈的异常信息" + getMessage); - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1 && !"error".equals(key)) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - if ("1".equals(sendProcess)) { - flag = true; - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - }else if("2".equals(sendProcess)){ - ldclBo.setAttributeValue("MESSAGE",getMessage ); - } - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "0");//发起电子签约 - otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - // 判断不同的异常反馈给前端 - if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { - getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); - return flag + "@" + getMessage; - } else if (getMessage.indexOf("contractId不能为空") != -1) { - return flag + "@" + getMessage; - } else { - return flag + "@" + "error"; - } - } - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - logger.info("自然人电子签约异常:" + e.getMessage()); - return "flase@error"; - } - } - /** - * 法人客户在生成合同是直接盖章 - * @param tx - * @return - * @throws Exception - */ - - @SuppressWarnings("unchecked") - public String compnySignIng(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); - BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - Map map = new HashMap(); - ContractSignInfo con = null; - List bo = null; - BizObject ldclBo = null; - try { - //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); - BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); - // 查询lb_doc_contract_list表 - bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) ").setParameter("projectId", ProjectId).getResultList(true); - for (BizObject keys : bo) { - String info = keys.getAttribute("id").toString(); - con = new ContractSignInfo(); - con.setCustname(keys.getAttribute("DOC_NAME").toString()); - con.setCustphone(keys.getAttribute("TELEPHONE").toString()); - con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(keys.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = keys.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(info, con); - } - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - Map resultMap = requestService.compnySign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SIGN_TYPE", "COMPLETE");//法人客户当盖完章改为完成状态 - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - //拷表的方法 - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - pbo.setAttributeValue("DATA_STATE", "8");// 状态改成电子签约,签署中 - pbm.saveObject(pbo); - downloadDoc(tx); - return "success"; - } else { - Boolean flag = false; - String getMessage = resultMap.get("error"); - logger.info("契约锁反馈的异常信息" + getMessage); - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1 && !"error".equals(key)) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - if ("1".equals(sendProcess)) { - flag = true; - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - }else if("2".equals(sendProcess)){ - ldclBo.setAttributeValue("MESSAGE",getMessage ); - } - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "0");//发起电子签约 - otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - // 判断不同的异常反馈给前端 - if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { - getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); - return flag + "@" + getMessage; - } else if (getMessage.indexOf("contractId不能为空") != -1) { - return flag + "@" + getMessage; - } else { - return flag + "@" + "error"; - } - } - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - logger.info("法人客户生成合同盖章失败" + e.getMessage()); - return "flase@error"; - } - } - - //获取电子签约人员列表 - public StringBuffer manyPeople() throws JBOException{ - //获取担保人信息 - StringBuffer info = new StringBuffer(); - BizObjectManager cptm = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME); - List cpts = cptm.createQuery("select * from O where flowunid=:flowUnid").setParameter("flowUnid", FlowUnid).getResultList(false); - for(BizObject cpt:cpts){ - String name = cpt.getAttribute("FULLNAME").toString(); - String mobile = cpt.getAttribute("mobile").toString(); - if(name.length()>0 && mobile.length()>0){ - info.append(name+"@"+mobile+"@guarantee,"); - } - } - //获取共同申请人的信息 - BizObjectManager cftm = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME); - BizObject cft = cftm.createQuery("flowunid=:FLowUnid and Partner_='Y'").setParameter("FLowUnid", FlowUnid).getSingleResult(false); - if(cft!=null){ - String name = cft.getAttribute("name").toString(); - String mobile = cft.getAttribute("tel").toString(); - if(name.length()>0 && mobile.length()>0){ - info.append(name+"@"+mobile+"@comm,"); - } - } - - return info; - } - - /** - * 法人租金委托代偿电子签约 - * @author tenwa518 - * @param tx - * @return - * @throws Exception - */ - @SuppressWarnings("unchecked") - public String companySignIng(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - Map> map = new HashMap>(); - ContractSignInfo con = null; - List bo = null; - BizObject ldclBo = null; - try { - BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); - // 查询lb_doc_contract_list表 - bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) and doc_name='租金代偿函'").setParameter("projectId", ProjectId).getResultList(true); - for (BizObject keys : bo) { - String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); - List list = map.get(info); - if (list == null) { - list = new ArrayList(); - map.put(info, list); - } - con = new ContractSignInfo(); - con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); - con.setCustphone(keys.getAttribute("TELEPHONE").toString()); - con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(keys.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = keys.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - list.add(con); - } - - Map fromCondtion=new HashMap(); - MapotherProperty=new HashMap(); - Map resultMap = requestService.createComContractSign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1) { - fromCondtion.clear(); - otherProperty.clear(); - //契约锁合同号 - String contractId=resultMap.get("contract_" + key); - String sendProcess=resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - ldclBo.setAttributeValue("SENDPROCESS",sendProcess); - contBom.saveObject(ldclBo); - - String contractDocId =ldclBo .getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - //拷表的方法 - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion,LB_CONTRACT_SIGN_LOG.CLASS_NAME, - null,otherProperty,tx); - } - } - pbo.setAttributeValue("project_status","8");//状态改成电子签约,签署中 - pbm.saveObject(pbo); - //记录项目进程日志 - Transaction tran = Transaction.createTransaction(tx); - ASUser user = ASUser.getUser(CurUserID, tran); - JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME,tx) - .createQuery("UPDATE O SET BUSINESS_STATUS='8',UPDATEUSERID='"+user.getUserID()+"',UPDATEORGID='"+user.getOrgID()+"',UPDATETIME='"+StringFunction.getTodayNow()+"' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM "+LB_PROJECT_INFO.CLASS_NAME+" LPI WHERE LPI.ID='"+ProjectId+"')").executeUpdate(); - SqlObject so = new SqlObject("INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'8','"+user.getUserID()+"','"+user.getOrgID()+"','"+StringFunction.getTodayNow().replaceAll(":", "△")+"' FROM LB_PROJECT_INFO WHERE ID='"+ProjectId+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); - so.setRunSql(so.getRunSql().replaceAll("△", ":")); - tran.executeSQL(so); - return "success"; - } else { - Boolean falg=false; - String getMessage = resultMap.get("error"); - logger.info("契约锁反馈的异常信息" + getMessage); - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1 && !"error".equals(key)) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - if ("1".equals(sendProcess)) { - falg=true; - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - }else if ("2".equals(sendProcess)) { - ldclBo.setAttributeValue("MESSAGE", getMessage); - } - contBom.saveObject(ldclBo); - - String contractDocId=ldclBo.getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");//发起电子签约 - otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - // 判断不同的异常反馈给前端 - if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { - getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); - return getMessage; - } else if (getMessage.indexOf("contractId不能为空") != -1) { - return getMessage; - } else { - return "error"; - } - } - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - return "error"; - } - - } - - /** - * (扣款卡变更)自然人委托扣款授权书电子签约,还有租金代偿函 - * @author tenwa518 - * @param tx - * @return - * @throws Exception - */ - public String PersonDeductSignIng(JBOTransaction tx) throws Exception{ - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - Map> map = new HashMap>(); - ContractSignInfo con = null; - List bo = null; - BizObject ldclBo = null; - try { - // 查询lb_doc_contract_list表 - bo = contBom.createQuery("flow_unid=:flow_unid and (sendprocess='0' or sendprocess='2' ) and file_flag='yes'").setParameter("flow_unid", FlowUnid).getResultList(true); - - for (BizObject keys : bo) { - String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); - List list = map.get(info); - if (list == null) { - list = new ArrayList(); - map.put(info, list); - } - con = new ContractSignInfo(); - con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); - con.setCustphone(keys.getAttribute("TELEPHONE").toString()); - con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(keys.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = keys.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - list.add(con); - } - - - Map fromCondtion=new HashMap(); - MapotherProperty=new HashMap(); - Map resultMap = null; - if ("01".equals(customerType)) { - resultMap = requestService.createComContractSign(map); - } else { - resultMap = requestService.createEntrustmentSign(map); - } - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - fromCondtion.clear(); - otherProperty.clear(); - //契约锁合同号 - String contractId=resultMap.get("contract_" + key); - String sendProcess=resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - ldclBo.setAttributeValue("SENDPROCESS",sendProcess); - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - //拷表的方法 - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - - return "success"; - - } else { - Boolean flag = false; - String getMessage = resultMap.get("error"); - logger.info("契约锁反馈的异常信息" + getMessage); - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1 && !"error".equals(key)) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - if ("1".equals(sendProcess)) { - flag = true; - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - }else if("2".equals(sendProcess)){ - ldclBo.setAttributeValue("MESSAGE",getMessage ); - } - contBom.saveObject(ldclBo); - - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "0");//发起电子签约 - otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 - otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - // 判断不同的异常反馈给前端 - if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { - getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); - return getMessage; - } else if (getMessage.indexOf("contractId不能为空") != -1) { - return getMessage; - } else { - return "error"; - } - } - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - return "error"; - } - } - - /** - * 提前结清 申请书进行电子签约 - * - * @author - * @param - * @return - * @throws Exception - */ - public String AdjustFordSignIng(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - Map> map = new HashMap>(); - ContractSignInfo con = null; - List bo = null; - BizObject ldclBo = null; - try { - // 查询lb_doc_contract_list表 - bo = contBom.createQuery("flow_unid=:flow_unid and file_flag='yes'").setParameter("flow_unid", FlowUnid).getResultList(true); - for (BizObject keys : bo) { - String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); - List list = map.get(info); - if (list == null) { - list = new ArrayList(); - map.put(info, list); - } - con = new ContractSignInfo(); - con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); - con.setCustphone(keys.getAttribute("TELEPHONE").toString()); - con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(keys.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = keys.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - list.add(con); - } - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - Map resultMap = null; - resultMap = requestService.createAdjustFordContractDSign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); -// ldclBo.setAttributeValue("PROCESS", "4"); - contBom.saveObject(ldclBo); - - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("id", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - // 拷表的方法 - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - return "success"; - } else { - Boolean flag = false; - String getMessage = resultMap.get("error"); - logger.info("契约锁反馈的异常信息" + getMessage); - for (String key : resultMap.keySet()) { - // 存储契约锁返回的合同id和合同文件id - if (key.indexOf("contract_") == -1 && !"error".equals(key)) { - fromCondtion.clear(); - otherProperty.clear(); - // 契约锁合同号 - String contractId = resultMap.get("contract_" + key); - String sendProcess = resultMap.get("contract_" + contractId); - ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); - ldclBo.setAttributeValue("SENDPROCESS", sendProcess); - if ("1".equals(sendProcess)) { - flag = true; - ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); - } else if ("2".equals(sendProcess)) { - ldclBo.setAttributeValue("MESSAGE", getMessage); - } - contBom.saveObject(ldclBo); - String contractDocId = ldclBo.getAttribute("id").toString(); - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 - otherProperty.put("CONTRACTDOCID", contractDocId); - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } - } - // 判断不同的异常反馈给前端 - if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { - getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); - return getMessage; - } else if (getMessage.indexOf("contractId不能为空") != -1) { - return getMessage; - } else { - return "error"; - } - } - } catch (Exception e) { - tx.rollback(); - e.printStackTrace(); - return "error"; - } - - } -/** - * 提前结清查询签约状态 - * @param tx - * @return - * @throws Exception - */ - public String getAdjustFordSignStatus(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); - List ldclBoList = ldclBom.createQuery("flow_unid='" + FlowUnid + "' and file_flag='yes' and " - + "sendprocess='1'").getResultList(true); - String signContractId = ""; - String customerName = ""; - String contractDocId = ""; - StringBuffer result = new StringBuffer(); - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - for (BizObject key : ldclBoList) { - signContractId = key.getAttribute("singcontract_id").toString(); - customerName = key.getAttribute("customername").toString(); - contractDocId = key.getAttribute("id").toString(); - try { - String signType = requestService.getContractSignStatus(signContractId); - String signstatus = clBom.createQuery("itemno='" + signType + "'").getSingleResult(false).getAttribute("itemname").toString(); - key.setAttributeValue("sign_type", signType); - if("COMPLETE".equals(signType)){ - key.setAttributeValue("PROCESS", "5.1"); - } - ldclBom.saveObject(key); - result.append("," + customerName + "电子签约状态:" + signstatus); - //日志记录 - - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "1");// 查询状态 - otherProperty.put("CONTRACTDOCID", contractDocId); - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } catch (Exception e) { - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "1");// 查询状态 - otherProperty.put("CONTRACTDOCID", contractDocId); - otherProperty.put("MESSAGE", e.getMessage()); - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - return "error"+"@"+e.getMessage(); - } - - } - return result.toString().substring(1); - } - - /** - * (扣款卡变更)自然人委托扣款授权书获取电子签约状态 ,法人租金代偿 - * - * @throws Exception - */ - public String contractSignStatusForContract(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); - List ldclBoList = ldclBom.createQuery("flow_unid='" + FlowUnid + "' and file_flag='yes' and " - + "sendprocess='1'").getResultList(true); - String signContractId = ""; - String customerName = ""; - String contractDocId = ""; - StringBuffer result = new StringBuffer(); - Map fromCondtion = new HashMap(); - Map otherProperty = new HashMap(); - for (BizObject key : ldclBoList) { - signContractId = key.getAttribute("singcontract_id").toString(); - customerName = key.getAttribute("customername").toString(); - contractDocId = key.getAttribute("id").toString(); - try { - String signType = requestService.getContractSignStatus(signContractId); - String signstatus = clBom.createQuery("itemno='" + signType + "'").getSingleResult(false).getAttribute("itemname").toString(); - key.setAttributeValue("sign_type", signType); - if("COMPLETE".equals(signType)){ - key.setAttributeValue("PROCESS", "5.1"); - } - ldclBom.saveObject(key); - result.append("," + customerName + "电子签约状态:" + signstatus); - //日志记录 - - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "1");// 查询状态 - otherProperty.put("CONTRACTDOCID", contractDocId); - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - } catch (Exception e) { - fromCondtion.put("ID", contractDocId); - otherProperty.put("SIGNPROCESS", "1");// 查询状态 - otherProperty.put("CONTRACTDOCID", contractDocId); - otherProperty.put("MESSAGE", e.getMessage()); - otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); - DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, - otherProperty, tx); - return "error"+"@"+e.getMessage(); - } - - } - return result.toString().substring(1); - } - - /** - * 获取电子签约状态 - * - * @throws Exception - */ - public String contractSignStatus(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); - BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); - BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObjectManager ldBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); - BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); - String status = ""; - String peopleStatus=""; - String sql = ""; - if ("01".equals(customerType)) { - sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函' and sendprocess='1'"; - } else { - sql = "project_id=:projectId and file_flag='yes' and sendprocess='1'"; - } - @SuppressWarnings("unchecked") - List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); - if (bo != null) { - boolean flag = true; - Map map = new HashMap(); - for (BizObject keys : bo) { - map.put(keys.getAttribute("singcontract_id").toString(), keys.getAttribute("customername").toString()); - } - for (String key : map.keySet()) { - try { - String signStatu = requestService.getContractSignStatus(key); - int index = signStatu.indexOf("$"); - String signStatus = signStatu.substring(0, index); - peopleStatus = signStatu.substring(index+1); - String signStatusName = - clBom.createQuery("itemno='" + signStatus + "'").getSingleResult(false).getAttribute("itemname").toString(); - List ldclList = - contBom.createQuery("project_id=:projectId and file_flag='yes' and singcontract_id='" + key + "'") - .setParameter("projectId", ProjectId).getResultList(true); - for (BizObject keys : ldclList) { - keys.setAttributeValue("SIGN_TYPE", signStatus); - // 客户签署完成,合同制作过程为4 - if ("REQUIRED".equals(signStatus)) { - this.sign(tx); - downloadDoc(tx); - keys.setAttributeValue("PROCESS", "4"); - } - contBom.saveObject(keys); - } - if (!"REQUIRED".equals(signStatus) && !"COMPLETE".equals(signStatus) ) { - flag = false; - } - if ("REQUIRED".equals(signStatus)) { - status += ";
客户" + map.get(key) + "签约状态:已签名"; - } else { - status += ";
客户" + map.get(key) + "签约状态:" + signStatusName; - } - } catch (Exception e) { - e.printStackTrace(); - return "获取签约状态失败!"; - } - } - // 合同签约已完成 - if (flag) { - pbo.setAttributeValue("DATA_STATE", "4");// 状态改成已完成电子签约 - pbm.saveObject(pbo); - // 记录项目进程日志 - /* Transaction tran = Transaction.createTransaction(tx); - ASUser user = ASUser.getUser(CurUserID, tran); - JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME, tx) - .createQuery("UPDATE O SET BUSINESS_STATUS='4',UPDATEUSERID='" + user.getUserID() + "',UPDATEORGID='" - + user.getOrgID() + "',UPDATETIME='" + StringFunction.getTodayNow() - + "' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM " + LB_PROJECT_INFO.CLASS_NAME - + " LPI WHERE LPI.ID='" + ProjectId + "')") - .executeUpdate(); - SqlObject so = new SqlObject( - "INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'4','" - + user.getUserID() + "','" + user.getOrgID() + "','" + StringFunction.getTodayNow().replaceAll(":", "△") - + "' FROM LB_PROJECT_INFO WHERE ID='" + ProjectId + "'"); - so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); - so.setRunSql(so.getRunSql().replaceAll("△", ":")); - tran.executeSQL(so);*/ - for (BizObject keys : bo) { - /* ldBom.createQuery("update O set status='' where id='" + keys.getAttribute("attribute_id").toString() + "'") - .executeUpdate();*/ - } - status = ";
已经完成电子签约"; - } - } - if (status.length() < 1) { - return "获取签约状态失败,没有合同文件"; - } else { - status = status.substring(5); - String[] peopleStat = peopleStatus.split(","); - if(peopleStat.length>1){ - status = status+"
"; - for(int i=0;i map = new HashMap(); - - map.put(ldb.getAttribute("TEMPLATE_ID").toString(),lul.getAttribute("CUSTOMER_NAME").toString()); - - for (String key : map.keySet()) { - try { - String signStatu = requestService.getContractSignStatus(key); - int index = signStatu.indexOf("$"); - String signStatus = signStatu.substring(0, index); - peopleStatus = signStatu.substring(index+1); - String signStatusName = - clBom.createQuery("itemno='" + signStatus + "'").getSingleResult(false).getAttribute("itemname").toString(); - BizObject ldl = ldlMange.createQuery("RELATIVE_ID=:relativeid").setParameter("relativeid", ldb.getAttribute("ID").getString()).getSingleResult(false); - lda = ldaMange.createQuery("LIBRARY_ID=:libraryid").setParameter("libraryid", ldl.getAttribute("ID").getString()).getSingleResult(true); - if (signStatu.indexOf("已签署")>0) { - signStatus = "REQUIRED"; - }else{ - flag = false; - } - if ("REQUIRED".equals(signStatus)) { - status += ";
客户" + map.get(key) + "签约状态:已签名"; - } else { - status += ";
客户" + map.get(key) + "签约状态:" + signStatusName; - } - } catch (Exception e) { - e.printStackTrace(); - return "获取签约状态失败!"; - } - } - // 合同签约已完成 - if (flag) { - lda.setAttributeValue("REMARK", "COMPLETE");// 状态改成已完成电子签约 - BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); - if(ldcl != null){ - ldcl.setAttributeValue("sign_type", "COMPLETE"); - ldclManage.saveObject(ldcl); - } - ldaMange.saveObject(lda); - status = ";
已经完成电子签约"; - changedownloadDoc(tx); - } - } - - if (status.length() < 1) { - return "获取签约状态失败,没有合同文件"; - } else { - status = status.substring(5); - String[] peopleStat = peopleStatus.split(","); - if(peopleStat.length>1){ - status = status+"
"; - for(int i=0;i contractIds = new ArrayList(); - if ("01".equals(customerType)) { - sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函' and sendprocess='1'"; - } else { - sql = "project_id=:projectId and file_flag='yes' and sendprocess='1'"; - } - @SuppressWarnings("unchecked") - List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); - if (bo != null) { - boolean flag = true; - Map map = new HashMap(); - for (BizObject keys : bo) { - map.put(keys.getAttribute("singcontract_id").toString(), keys.getAttribute("customername").toString()); - contractIds.add(keys.getAttribute("singcontract_id").toString()); - } - - Map resultMap = requestService.getContractSignListStatus(contractIds); - } - return ""; - } - - /** - * 盖企业章 - * - * @param tx - * @return - * @throws MalformedURLException - * @throws Exception - */ - public String sign(JBOTransaction tx) throws MalformedURLException, Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - @SuppressWarnings("unchecked") - List bo = contBom.createQuery("project_id=:projectId and file_flag='yes'") - .setParameter("projectId", ProjectId).getResultList(true); - if (bo != null) { - Map> map = new HashMap>(); - for (BizObject keys : bo) { - List list = map.get(keys.getAttribute("singcontract_id").toString()); - if (list == null) { - list = new ArrayList(); - } - list.add(keys.getAttribute("DOCUMENT_ID").toString()+"@"+keys.getAttribute("doc_name").toString()); - map.put(keys.getAttribute("singcontract_id").toString(), list); - } - Map resultMap = requestService.Sign(map); - String statu = resultMap.get("error"); - if (statu == null) { - return "success"; - } - } - - return "error"; - } - - /** - * 根据document_id下载合同 - * - * @param tx - * @return - * @throws Exception - * @throws MalformedURLException - */ - public String downloadDoc(JBOTransaction tx) throws MalformedURLException, Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - String sql = ""; - if ("01".equals(customerType)) { - sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函'"; - } else { - sql = "project_id=:projectId and file_flag='yes'"; - } - try { - - @SuppressWarnings("unchecked") - List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); - if (bo != null) { - Map map = new HashMap(); - for (BizObject keys : bo) { - map.put(keys.getAttribute("DOCUMENT_ID").toString(), keys.getAttribute("FULLPATH").toString()); - } - Map result = requestService.downloadDoc(map); - if (!result.containsKey("error")) { - for (String contractId : map.keySet()) { - try { - if ("success".equals(result.get(contractId))) { - String fileString = result.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - return "success"; - } else { - return "error"; - } - } - } catch (Exception e) { - return "error"; - } - return "success"; - } - - /** - * 扣款卡信息变更根据document_id下载合同 - * - * @param tx - * @return - * @throws Exception - * @throws MalformedURLException - */ - public String changedownloadDoc(JBOTransaction tx) throws MalformedURLException, Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager ldMange = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME, tx); - String sql = "OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid "; - @SuppressWarnings("unchecked") - BizObject ldb = ldMange.createQuery(sql).setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); - BizObjectManager clBom = JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME, tx); - try { - if (ldb != null) { - BizObject ldl = clBom.createQuery("RELATIVE_ID=:relativeid").setParameter("relativeid", ldb.getAttribute("ID").getString()).getSingleResult(false); - BizObjectManager ldaMange = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - BizObject lda = ldaMange.createQuery("LIBRARY_ID=:libraryid").setParameter("libraryid", ldl.getAttribute("ID").getString()).getSingleResult(false); - Map map = new HashMap(); - map.put(ldl.getAttribute("REMARK").toString(), lda.getAttribute("FULLPATH").toString()); - Map result = requestService.downloadDoc(map); - if (!result.containsKey("error")) { - for (String contractId : map.keySet()) { - try { - if ("success".equals(result.get(contractId))) { - String fileString = result.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - return "success"; - } else { - return "error"; - } - } - } catch (Exception e) { - return "error"; - } - return "success"; - } - -//扣款卡变更下载合同 - public String downloadDocContract(JBOTransaction tx) throws MalformedURLException, Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - String sql = ""; - sql = "flow_unid=:flow_unid and file_flag='yes'"; - String attributeId = ""; - try { - @SuppressWarnings("unchecked") - List bo = contBom.createQuery(sql).setParameter("flow_unid", FlowUnid).getResultList(true); - if (bo != null) { - Map map = new HashMap(); - for (BizObject keys : bo) { - map.put(keys.getAttribute("DOCUMENT_ID").toString(), keys.getAttribute("FULLPATH").toString()); - attributeId = keys.getAttribute("ATTRIBUTE_ID").toString(); - } - Map result = requestService.downloadDoc(map); - - if (!result.containsKey("error")) { - for (String contractId : map.keySet()) { - try { - if ("success".equals(result.get(contractId))) { - String fileString = result.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result.get(contractId))) { - return "error@"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - return "success@" + attributeId; - } else { - return "error@"; - } - } else { - System.out.println("没有文件可下载"); - return "error@"; - } - } catch (Exception e) { - e.printStackTrace(); - return "error@"; - } - } - -/** - * 扣款卡变更下载zip合同 - * @param tx - * @return - * @throws Exception - * @throws MalformedURLException - */ -public String downloadZipContract(JBOTransaction tx) throws MalformedURLException, Exception{ - requestService = (HttpRequestAppService) factory.create( - HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - try{ - String path=null; - @SuppressWarnings("unchecked") - String sql=""; - sql="flow_unid=:flow_unid and file_flag='yes'"; - @SuppressWarnings("unchecked") - List bo = contBom.createQuery(sql).setParameter("flow_unid",FlowUnid).getResultList(true); - - if(bo!=null){ - Map map=new HashMap(); - for(BizObject keys:bo){ - path="D://"+keys.getAttribute("singcontract_id").toString()+"DocList.zip"; - map.put(keys.getAttribute("singcontract_id").toString(),path); - } - String result=requestService.download(map); - if(result.equals("success")){ - return "success"; - }else{ - return "error"; - } - } - }catch(Exception e){ - return "error"; - } - return "success"; -} - - -/** - * 根据contract_id下载合同 - * @param tx - * @return - * @throws Exception - * @throws MalformedURLException - */ -public String download(JBOTransaction tx) throws MalformedURLException, Exception{ - requestService = (HttpRequestAppService) factory.create( - HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - try{ - String path=null; - @SuppressWarnings("unchecked") - List bo = contBom.createQuery("project_id=:projectId and file_flag='yes'").setParameter("projectId",ProjectId).getResultList(true); - if(bo!=null){ - Map map=new HashMap(); - for(BizObject keys:bo){ - path="D://"+keys.getAttribute("singcontract_id").toString()+"DocList.zip"; - map.put(keys.getAttribute("singcontract_id").toString(),path); - } - String result=requestService.download(map); - if(result.equals("success")){ - return "success"; - }else{ - return "error"; - } - } - }catch(Exception e){ - return "error"; - } - return "success"; -} - -/** - *jar包方式word转换pdf - *用jar方法 - *word转换pdf - */ -public void wordToPdfJar(JBOTransaction tx){ - try { - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - String sql=""; - if(flagType==null || "word".equals(flagType)){ - sql="project_id='"+ProjectId+"' and file_flag='yes' and process='1'"; - }else if("contract".equals(flagType)){ - sql="contract_id='"+contract_id+"' and file_flag='yes' and process='1'"; - }else if("pdfFalse".equals(flagType)){ - sql="project_id='"+ProjectId+"' and file_flag='yes' and process='3'"; - }else if ("flowunid".equals(flagType)){ - sql = "flow_unid='"+FlowUnid+"' and file_flag='yes' and process='1'"; - } - List bo = contBom.createQuery(sql).getResultList(false); - if(bo!=null){ - for(BizObject key:bo){ - String lastFilePath= key.getAttribute("FULLPATH").toString().replace(".docx", ".pdf"); - try { - WordToPdfThread wtpt = new WordToPdfThread(key.getAttribute("FULLPATH").toString(),lastFilePath,key.getAttribute("ATTRIBUTE_ID").toString()); - wtpt.start(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } catch (JBOException e) { - e.printStackTrace(); - - } -} -/** - * LibreOffice实现word转换pdf - * word转换pdf - * @throws JBOException - */ - @SuppressWarnings({ "unchecked", "static-access" }) - public void wordToPdf(JBOTransaction tx) throws JBOException { - try { - BizObjectManager fbo = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx); - BizObject fbos = fbo.createQuery("FLOW_UNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(false); - //获取用户信息 - BizObjectManager lult = JBOFactory.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME); - BizObjectManager customer = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME); - BizObject lults = lult.createQuery("flowunid=:flowUnid").setParameter("flowUnid", FlowUnid).getSingleResult(false); - BizObject cust = customer.createQuery("flowunid=:flowUnid and customerid=:customerid").setParameter("flowUnid", FlowUnid).setParameter("customerid", lults.getAttribute("customer_id").toString()).getSingleResult(false); - String customername = null; - String telephone = null; - String ids =null; - - if(cust!=null){ - customername = cust.getAttribute("FULLNAME").toString(); - telephone = cust.getAttribute("mobile").toString(); - ids = cust.getAttribute("CUSTOMERID").toString(); - } - - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObjectManager attrBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - WordToPDFUtil wordTopdf = new WordToPDFUtil(); - File file = null; - Boolean result = null; - String sql = ""; - /*if (flagType == null || "word".equals(flagType)) { - sql = "project_id='" + ProjectId + "' and file_flag='yes' and process='1'"; - } else if ("contract".equals(flagType)) { - sql = "contract_id='" + contract_id + "' and file_flag='yes' and process='1'"; - } else if ("pdfFalse".equals(flagType)) { - sql = "project_id='" + ProjectId + "' and file_flag='yes' and process='3'"; - } else if ("flowunid".equals(flagType)){ - sql = "flow_unid='"+FlowUnid+"' and file_flag='yes' and (process='1' or process='3')"; - }*/ - List bo = contBom.createQuery("flow_unid=:flowUnid and file_flag='yes' and process='1'").setParameter("flowUnid", FlowUnid).getResultList(true); - if (bo != null) { - for (BizObject contBo : bo) { - String attrId = contBo.getAttribute("ATTRIBUTE_ID").toString(); - BizObject attrBo = attrBom.createQuery("id='" +attrId+"'").getSingleResult(true); - String path = attrBo.getAttribute("FULLPATH").toString(); - String lastFilePath = path.replace(".docx", ".pdf"); - File filePath = new File(path); - if(!filePath.exists()){ - logger.info("word转换pdf的源文件不存在"); - continue; - } - String lastFilePathpdf = filePath.getParent(); - try { - result = wordTopdf.Word2Pdf(path, lastFilePathpdf); - } catch (Exception e) { - result = false; - e.printStackTrace(); - } - if (result) { - file =new File(lastFilePath); - contBo.setAttributeValue("FULLPATH",lastFilePath); - contBo.setAttributeValue("FILENAME",contBo.getAttribute("FILENAME").toString().replace(".docx",".pdf" )); - contBo.setAttributeValue("FILEPATH",contBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); - contBo.setAttributeValue("CONTENT_TYPE","application/pdf"); - contBo.setAttributeValue("PROCESS","2"); - contBo.setAttributeValue("PROJECT_ID",fbos.getAttribute("proj_id").toString()); - contBo.setAttributeValue("CUSTOMERNAME",customername); - contBo.setAttributeValue("TELEPHONE",telephone); - contBo.setAttributeValue("IDS",ids); - contBom.saveObject(contBo); - attrBo.setAttributeValue("FULLPATH",attrBo.getAttribute("FULLPATH").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FILENAME",attrBo.getAttribute("FILENAME").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FILEPATH",attrBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FileSize",file.length()); - attrBo.setAttributeValue("CONTENT_TYPE","application/pdf"); - attrBom.saveObject(attrBo); - }else{ - contBo.setAttributeValue("PROCESS","3"); - contBom.saveObject(contBo); - } - } - } - } catch (JBOException e) { - e.printStackTrace(); - } - } - - /** - * 租金通知书附件用LibreOffice实现word转换pdf - * word转换pdf - * @throws JBOException - */ - @SuppressWarnings({ "unchecked", "static-access" }) - public String wordToPdfAnnex(JBOTransaction tx) throws JBOException { - - PLAN_LIST=PLAN_LIST.split("\\.")[0]; - BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); - BizObject DOCRELATIVE = null; - if("null".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - }else if("rights".equals(PLAN_LIST)){ - DOCRELATIVE = bom.createQuery("CONTRACT_ID=:CONTRACT_ID and objecttype='rights'").setParameter("CONTRACT_ID",contract_id).getSingleResult(false); - }else if("settle".equals(PLAN_LIST)){ - DOCRELATIVE = bom.createQuery("CONTRACT_ID=:CONTRACT_ID and objecttype='settle'").setParameter("CONTRACT_ID",contract_id).getSingleResult(false); - }else if("TX".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype='AdjustInterst' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - }else if("ChangeCar".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("transfer".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("AdjustmentNotice".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("TriditionCollection".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionCollection' and plan_number=:plan_number").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - }else if("TriditionSuspension".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); - }else if("settletradition".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='settletradition' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); - }else if("LetterApprova".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LetterApprova' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); - }else if("LoanNotice".equals(PLAN_LIST)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LoanNotice' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); - } - else{ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false); - } - - BizObjectManager attrBom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME); - BizObject attrBo=null; - WordToPDFUtil wordTopdf = new WordToPDFUtil(); - File file = null; - Boolean result = null; - String sql = ""; - try { - if (DOCRELATIVE != null) { - - String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); - BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); - String DOCLIBRARYid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); - attrBo = attrBom.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(true); - - String path = attrBo.getAttribute("FULLPATH").toString(); - String lastFilePath = path.replace(".docx", ".pdf"); - File filePath = new File(path); - if(!filePath.exists()){ - logger.info("word转换pdf的源文件不存在"); - } - String lastFilePathpdf = filePath.getParent(); - try { - result = wordTopdf.Word2Pdf(path, lastFilePathpdf); - } catch (Exception e) { - result = false; - e.printStackTrace(); - } - if (result) { - file =new File(lastFilePath); - attrBo.setAttributeValue("FULLPATH",attrBo.getAttribute("FULLPATH").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FILENAME",attrBo.getAttribute("FILENAME").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FILEPATH",attrBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); - attrBo.setAttributeValue("FileSize",file.length()); - attrBo.setAttributeValue("CONTENT_TYPE","application/pdf"); - attrBom.saveObject(attrBo); - }else{ - } - if("ChangeCar".equals(PLAN_LIST)){ - BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); - file =new File(lastFilePath); - ldcl.setAttributeValue("FULLPATH",lastFilePath); - ldcl.setAttributeValue("FILENAME",ldcl.getAttribute("FILENAME").toString().replace(".docx",".pdf" )); - ldcl.setAttributeValue("FILEPATH",ldcl.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); - ldcl.setAttributeValue("CONTENT_TYPE","application/pdf"); - ldcl.setAttributeValue("PROCESS","2"); - ldclManage.saveObject(ldcl); - } - } - - } catch (JBOException e) { - e.printStackTrace(); - } - return attrBo.getAttribute("ID").toString(); - } - /** - * 多线程word转换pdf - * @author tenwa518 - * - */ -class WordToPdfThread extends Thread{ - final String fullPath; - final String lastFilePath; - final String attrId; - public WordToPdfThread(String fullPath,String lastFilePath,String attrId){ - this.fullPath = fullPath; - this.lastFilePath = lastFilePath; - this.attrId = attrId; - - } - @Override - public void run() { - Word2PdfUtil wP = new Word2PdfUtil(); -// WordToPDFUtil w2P = new WordToPDFUtil(); - try { -// w2P.Word2Pdf(fullPath, lastFilePathpdf); - wP.doc2pdf(fullPath,lastFilePath,attrId); - } catch (Exception e) { - e.printStackTrace(); - } - } -} -/** - * 查看word文件是否都转为pdf - * @param tx - * @return - * @throws JBOException - */ -public String getMakeContractProcess(JBOTransaction tx) throws JBOException{ - BizObjectManager ldclBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - int wordIng=0; - int pdfFalse=0; - int pdfTrue=0; - List ldclBo2=ldclBom.createQuery("project_id='"+ProjectId+"' and file_flag='yes' ").getResultList(false); - if(ldclBo2.size()>0){ - for(BizObject key:ldclBo2){ - String process = key.getAttribute("process").toString(); - if("1".equals(process)){ - wordIng++; -// return "error"; - }else if("2".equals(process)){ - pdfTrue++; -// return "wording"; - }else if("3".equals(process)){ - pdfFalse++; -// return "success"; - } - } - }else{ - //制作合同 - return "0"; - } - if(wordIng>0 && pdfFalse>0 && pdfTrue>0){ - //word转换PDF部分失败 - return "1"; - }else if(wordIng==0 && pdfFalse>0 && pdfTrue>0){ - //word转PDF失败 - return "2"; - }else if(wordIng==0 && pdfFalse>0 && pdfTrue>0){ - //word转换PDF部分失败, - return "3"; - }else if(wordIng>0 && pdfFalse==0 && pdfTrue>0){ - //word正在转换pdf - return "4"; - }else if(wordIng>0 && pdfFalse==0 && pdfTrue==0){ - //word没有转换pdf - return "5"; - }else if(wordIng==0 && pdfFalse==0 && pdfTrue>0){ - //word转换PDF成功 - return "6"; - } - return "error"; -} -//(扣款卡变更)根据合同号获取文件状态 -public String getMakeContractProcessContract(JBOTransaction tx) throws JBOException{ - BizObjectManager ldclBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - BizObject ldclBo = null; - ldclBo=ldclBom.createQuery("flow_unid='"+FlowUnid+"'and file_flag='yes' ").getSingleResult(false); - if(ldclBo!=null){ - String process = ldclBo.getAttribute("process").toString(); - String signType = ldclBo.getAttribute("sign_type").toString(); - if("1".equals(process)){ - return "isDoc"; - }else if("2".equals(process)&&"DRAFT".equals(signType)){ - return "isPdf"; - }else if("COMPLETE".equals(signType)){ - return "complete"; - }else if("SIGNING".equals(signType)){ - return "isSigning"; - } - } - //表示不存在这个文件 - return "notExsit"; -} -/** - * 转账授权申请书 - * @param tx - * @return - * @throws InterruptedException - */ -@SuppressWarnings("unchecked") -public String AccountAccreditSign(JBOTransaction tx){ - try{ - this.wordToPdf(tx); - tx.commit(); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - List boList = contBom.createQuery("file_flag='yes' and (process='2' or process='5') and flow_unid='"+FlowUnid+"'").getResultList(true); - if(boList.size()>0){ - try { - String result =this.accountSign(tx,FlowUnid,InputOrgid); - if("success".equals(result)){ - return "success"; - }else{ - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - }else{ - return "error"; - } - } catch (JBOException e) { - e.printStackTrace(); - return "error"; - } -} -public String accountSign(JBOTransaction tx,String flowunid,String orgid) throws Exception{ - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObjectManager attrBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME,tx); - Map map=new HashMap(); - ContractSignInfo con=null; - BizObject ldclBo=null; - try{ - //查询lb_doc_contract_list表 - ldclBo = ldclBom.createQuery("file_flag='yes' and process='2' and flow_unid='" + flowunid + "'").getSingleResult(true); - if (ldclBo != null) { - con = new ContractSignInfo(); - con.setFileid(ldclBo.getAttribute("ATTRIBUTE_ID").toString()); - con.setFilename(ldclBo.getAttribute("FILENAME").toString()); - // 获取生成文件路径 - String makefullPath = ldclBo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(flowunid, con); - Map resultMap = null; - if (orgid.indexOf("8002003001") >= 0) { - // 西城转账授权 - resultMap = requestService.createAccountContractSign(map); - } else { - // 东城转账授权 - resultMap = requestService.createAccountContractDSign(map); - } - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - ldclBo.setAttributeValue("SINGCONTRACT_ID", resultMap.get("contract_" + key)); - } - } - ldclBo.setAttributeValue("PROCESS", "5"); - ldclBom.saveObject(ldclBo); - tx.commit(); - } else { - return "error"; - } - } - //拉取文件 - ldclBo = ldclBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + flowunid + "'").getSingleResult(true); - if (ldclBo != null) { - BizObject attrBo = attrBom.createQuery("id='"+ldclBo.getAttribute("attribute_id")+"'").getSingleResult(true); - Map mapFile = new HashMap(); - String fileName = ldclBo.getAttribute("FILENAME").toString(); - String fullPath =FileOperatorUtil.getuploadFileDir(this.getFileSavePath())+UUIDUtil.getUUID()+"_"+fileName; - String filePath = fullPath.replaceAll(this.getFileSavePath(),""); - mapFile.put(ldclBo.getAttribute("DOCUMENT_ID").toString(),fullPath); - Map result = requestService.downloadDoc(mapFile); - if (!result.containsKey("error")) { - for (String documentId : mapFile.keySet()) { - try { - if ("success".equals(result.get(documentId))) { - String fileString = result.get("file_" + documentId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(mapFile.get(documentId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result.get(documentId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - } - } - ldclBo.setAttributeValue("FILEPATH",filePath); - ldclBo.setAttributeValue("FULLPATH",fullPath); - ldclBo.setAttributeValue("PROCESS", "6"); - ldclBom.saveObject(ldclBo); - attrBo.setAttributeValue("FILEPATH",filePath); - attrBo.setAttributeValue("FULLPATH",fullPath); - attrBo.setAttributeValue("FileSize",new File(fullPath).length()); - attrBom.saveObject(attrBo); - return "success"; - } else { - return "error"; - } - } else { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - -} -public String getFlowUnid(JBOTransaction tx) throws JBOException{ - BizObjectManager fboBom=JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME,tx); - BizObject fboBo=fboBom.createQuery("CHANNELAPPLYID='"+id+"'").getSingleResult(false); - return fboBo.getAttribute("flow_unid").toString(); -} - -/* - * 重新发送短信 - * */ -public String sendMessageAgain(JBOTransaction tx) { - try{ - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - List bo = null; - String file = new String(); - Map contractmap = new HashMap(); - List list = new ArrayList(); - bo = contBom.createQuery("select singcontract_id,filename from O where project_id =:projectId" - +" and file_flag = 'yes' and sendprocess = '1' and sign_type = 'SIGNING'") - .setParameter("projectId", ProjectId).getResultList(true); - for (BizObject temp : bo) { - String singcontractid = temp.getAttribute("singcontract_id").toString(); - String filename = temp.getAttribute("filename").toString(); - contractmap.put(singcontractid, filename); - } - list.addAll(contractmap.keySet()); - Map map = requestService.sendNotice(list); - if(!map.containsKey("error")){ - return "success"; - }else{ - for(String singcontractid:map.keySet()){ - String sendStatus = map.get(singcontractid); - if("2"==sendStatus){ - file += contractmap.get(singcontractid)+";"; - } - } - return file; - } - - } catch (Exception e) { - try { - tx.rollback(); - } catch (JBOException e1) { - e1.printStackTrace(); - } - e.printStackTrace(); - return "error"; - } -} - - /* - * 扣款卡信息变更重新发送短信 - * */ - public String ChangesendMessageAgain(JBOTransaction tx) { - try{ - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - List bo = null; - String file = new String(); - Map contractmap = new HashMap(); - List list = new ArrayList(); - BizObjectManager ldMange = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME, tx); - String status = ""; - String peopleStatus=""; - String sql = "OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid "; - @SuppressWarnings("unchecked") - BizObject ldb = ldMange.createQuery(sql).setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); - if(ldb!=null){ - String singcontractid = ldb.getAttribute("TEMPLATE_ID").toString(); - contractmap.put(singcontractid, "直租个人授权协议书.pdf"); - } - list.addAll(contractmap.keySet()); - Map map = requestService.sendNotice(list); - if(!map.containsKey("error")){ - return "success"; - }else{ - for(String singcontractid:map.keySet()){ - String sendStatus = map.get(singcontractid); - if("2"==sendStatus){ - file += contractmap.get(singcontractid)+";"; - } - } - return file; - } - - } catch (Exception e) { - try { - tx.rollback(); - } catch (JBOException e1) { - e1.printStackTrace(); - } - e.printStackTrace(); - return "error"; - } - } - -public String getProcess(JBOTransaction tx){ - try { - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObject bo = contBom.createQuery("file_flag='yes' and process is not null and flow_unid='"+FlowUnid+"'").getSingleResult(false); - if(bo==null){ - return "success"; - }else{ - return bo.getAttribute("PROCESS").toString(); - } - } catch (JBOException e) { - e.printStackTrace(); - return "error"; - } - -} - -public String claimSign(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); - ContractSignInfo con = null; - BizObject bo = null; - String doc_name = new String(); - String[] attrIdList=attrId.split("@"); - try{ - for(String attribute_id:attrIdList){ - Map map=new HashMap(); - bo = contBom.createQuery("file_flag='yes' and process='2' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); - if(bo != null){ - con = new ContractSignInfo(); - con.setFileid(attribute_id); - con.setFilename(bo.getAttribute("FILENAME").toString()); - String makefullPath = bo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(FlowUnid, con); - Map resultMap = null; - //调代理的接口 - doc_name = bo.getAttribute("doc_name").toString(); - if("租金支付表".equals(doc_name)){ - //租金支付表 - resultMap = requestService.createPaymentofHireSign(map); - } - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - bo.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); - bo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - } - } - bo.setAttributeValue("PROCESS", "5"); - contBom.saveObject(bo); - tx.commit(); - } else { - return "error"; - } - } - bo = contBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); - if (bo != null) { - Map map1 = new HashMap(); - map1.put(bo.getAttribute("DOCUMENT_ID").toString(), bo.getAttribute("FULLPATH").toString()); - Map result1 = requestService.downloadDoc(map1); - if (!result1.containsKey("error")) { - for (String contractId : map1.keySet()) { - try { - if ("success".equals(result1.get(contractId))) { - String fileString = result1.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result1.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - bo.setAttributeValue("PROCESS", "6"); - contBom.saveObject(bo); - } else { - return "error"; - } - } else { - return "error"; - } - } - return "success"; - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } -} - - /** - * 打印租金通知书并发短信给客户 - * @param tx - * @return - * @throws Exception - */ - public String claimSignA(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - String libraryid=""; - PLAN_LIST=PLAN_LIST.split("\\.")[0]; - BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); - BizObject DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false); - if (DOCRELATIVE != null) { - String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); - BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); - libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); - } - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - ContractSignInfo con = null; - BizObject bo = null; -// String contract_id=""; - String info=""; - try{ - //获取承租人的姓名和电话号 - BizObjectManager lulManager = JBOFactory.getBizObjectManager(LB_UNION_LESSEE.CLASS_NAME, tx); - String customerid = lulManager.createQuery("CONTRACT_ID=:contractId").setParameter("contractId", contract_id).getSingleResult(false).getAttribute("CUSTOMER_ID").toString(); - BizObjectManager crManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME, tx); - BizObject cr = crManage.createQuery("CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(false); - if(cr != null){ - info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString()+"@"+flagType; - }else{ - info = "flagType@flagType@"+flagType; - } - //获取需要盖章的文件信息 - Map map=new HashMap(); - bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); - if(bo != null){ - id = bo.getAttribute("id").toString(); - con = new ContractSignInfo(); - con.setFileid(id); - con.setFilename(bo.getAttribute("FILENAME").toString()); - String makefullPath = bo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(info, con); - Map resultMap = null; - //调代理的接口 -// doc_name = bo.getAttribute("doc_name").toString(); -// if("租金支付表".equals(doc_name)){ - //租金支付表 - resultMap = requestService.createPaymentofHireSign(map); -// } - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { -// bo.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); -// bo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); - contract_id = resultMap.get(key); - } - } -// bo.setAttributeValue("PROCESS", "5"); -// contBom.saveObject(bo); -// tx.commit(); - } else { - return "error"; - } - } -// bo = contBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); - if (bo != null) { - Map map1 = new HashMap(); - map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); - Map result1 = requestService.downloadDoc(map1); - if (!result1.containsKey("error")) { - for (String contractId : map1.keySet()) { - try { - if ("success".equals(result1.get(contractId))) { - String fileString = result1.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result1.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } -// bo.setAttributeValue("PROCESS", "6"); -// contBom.saveObject(bo); - } else { - return "error"; - } - } else { - return "error"; - } - - return "success"; - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - } - - /** - * 扣款卡信息变更发电子签约 - * @param tx - * @return - * @throws Exception - */ - public String changeCarSignA(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - String libraryid=""; - BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME,tx); - BizObjectManager bom1=null; - BizObject DOCRELATIVE= null; - BizObject library= null; - DOCRELATIVE=bom.createQuery("OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); - if (DOCRELATIVE != null) { - String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); - bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME,tx); - library=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(true); - libraryid = library.getAttribute("id").toString(); - } - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - ContractSignInfo con = null; - BizObject bo = null; -// String contract_id=""; - String info=""; - try{ - //获取承租人的姓名和电话号 - BizObjectManager lulManager = JBOFactory.getBizObjectManager(LB_UNION_LESSEE.CLASS_NAME, tx); - String customerid = lulManager.createQuery("CONTRACT_ID=:contractId").setParameter("contractId", contract_id).getSingleResult(false).getAttribute("CUSTOMER_ID").toString(); - BizObjectManager crManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME, tx); - BizObject cr = crManage.createQuery("CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(false); - if(cr != null){ - info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString()+"@"+flagType; - }else{ - return "error"; - } - //获取需要盖章的文件信息 - Map map=new HashMap(); - bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); - if(bo != null){ - id = bo.getAttribute("id").toString(); - con = new ContractSignInfo(); - con.setFileid(id); - con.setFilename(bo.getAttribute("FILENAME").toString()); - String makefullPath = bo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(info, con); - Map resultMap = null; - resultMap = requestService.createAccountContractDSign(map); - - if (!resultMap.containsKey("error")) { - BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); - if(ldcl != null){ - ldcl.setAttributeValue("sign_type", "SIGNING"); - ldclManage.saveObject(ldcl); - } - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { -// DOCRELATIVE.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); - DOCRELATIVE.setAttributeValue("TEMPLATE_ID", resultMap.get("contract_" + key)); - library.setAttributeValue("REMARK",resultMap.get(key)); - bo.setAttributeValue("REMARK","SIGNING"); - contract_id = resultMap.get(key); - } - } - bom.saveObject(DOCRELATIVE); - bom1.saveObject(library); - contBom.saveObject(bo); - tx.commit(); - } else { - return "error"; - } - } - return "success"; - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - } - - /** - * 催收函盖公司章 - * @param tx - * @return - * @throws Exception - */ - public String collectionSignA(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - String libraryid=""; - BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); - BizObject DOCRELATIVE = null; - if("settle".equals(flagType)){ - DOCRELATIVE=bom.createQuery("CONTRACT_ID=:contractid and objecttype='settle' ").setParameter("contractid",contract_id).getSingleResult(false); - }else if("LetterApprova".equals(flagType)){ - DOCRELATIVE=bom.createQuery("PROJ_ID=:projectId and objecttype='LetterApprova' ").setParameter("projectId",ProjectId).getSingleResult(false); - }else{ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%打印催款函%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - } - if (DOCRELATIVE != null) { - String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); - BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); - libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); - } - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - ContractSignInfo con = null; - BizObject bo = null; - String info=""; - try{ - info = libraryid + "@" + libraryid+"@"+flagType; - //获取需要盖章的文件信息 - Map map=new HashMap(); - bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); - if(bo != null){ - id = bo.getAttribute("id").toString(); - con = new ContractSignInfo(); - con.setFileid(id); - con.setFilename(bo.getAttribute("FILENAME").toString()); - String makefullPath = bo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(info, con); - Map resultMap = null; - resultMap = requestService.createPaymentofHireSign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - contract_id = resultMap.get(key); - } - } - } else { - return "error"; - } - } - if (bo != null) { - Map map1 = new HashMap(); - map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); - Map result1 = requestService.downloadDoc(map1); - if (!result1.containsKey("error")) { - for (String contractId : map1.keySet()) { - try { - if ("success".equals(result1.get(contractId))) { - String fileString = result1.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result1.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - } else { - return "error"; - } - } else { - return "error"; - } - - return "success"; - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - } - - - - /*** - * 已经生成的合同,作废, - * @param tx - * @return - * @throws JBOException - */ - - public String updateDocContractStatus(JBOTransaction tx) throws JBOException{ -// BizObjectManager attBom=JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME,tx);ProjectId - BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx); - try{ -// BizObject lcl = lclManager.createQuery("file_flag='yes' and attribute_id='"+file_id+"'").getSingleResult(true); - - lclManager.createQuery("update O set file_flag='no',message='1' where attribute_id=:attributeid").setParameter("attributeid",file_id).executeUpdate(); - lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",ProjectId).executeUpdate(); - //attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").executeUpdate(); - tx.commit(); - }catch(Exception e){ - tx.rollback(); - e.printStackTrace(); - System.out.println(e.getMessage()); - return "error"; - } - return "success"; - } - - public String companyUpdateDocContractStatus(JBOTransaction tx) throws Exception{ - BizObjectManager fboManger=JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME,tx); - BizObjectManager lctManger=JBOFactory.getBizObjectManager(LB_CONTRACT_TEMPLATE.CLASS_NAME,tx); - BizObject fbo = fboManger.createQuery("flow_unid=:flowunid").setParameter("flowunid",FlowUnid).getSingleResult(false); - BizObject lct = lctManger.createQuery("Contract_id=:contractid").setParameter("contractid", fbo.getAttribute("CONTRACT_ID").getString()).getSingleResult(false); - String attId = ContractTemplateCache.getContractTemplateID(lct.getAttribute("ID").getString()); - lctManger.deleteObject(lct); - BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); - BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx); - try{ - lclManager.createQuery("update O set file_flag='no',message='1' where attribute_id=:attributeid").setParameter("attributeid",attId).executeUpdate(); - lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",ProjectId).executeUpdate(); - //attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").executeUpdate(); - tx.commit(); - }catch(Exception e){ - tx.rollback(); - e.printStackTrace(); - System.out.println(e.getMessage()); - return "error"; - } - return "success"; - } - - /** - * 传统合同盖章 - * @param tx - * @return - * @throws Exception - - */ - public String TcollectionSignA(JBOTransaction tx) throws Exception { - requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); - String libraryid=""; - BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); - BizObject DOCRELATIVE = null; - if("transfer".equals(flagType)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("AdjustmentNotice".equals(flagType)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("TriditionCollection".equals(flagType)){ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype='TriditionCollection' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - }else if("TriditionSuspension".equals(flagType)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); - }else if("settletradition".equals(flagType)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='settletradition' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); - }else if("LoanNotice".equals(flagType)){ - DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LoanNotice' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); - }else{ - DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%打印催款函%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); - } - if (DOCRELATIVE != null) { - String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); - BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); - libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); - } - BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); - ContractSignInfo con = null; - BizObject bo = null; - String info=""; - try{ - info = libraryid + "@" + libraryid+"@"+flagType; - //获取需要盖章的文件信息 - Map map=new HashMap(); - bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); - if(bo != null){ - id = bo.getAttribute("id").toString(); - con = new ContractSignInfo(); - con.setFileid(id); - con.setFilename(bo.getAttribute("FILENAME").toString()); - String makefullPath = bo.getAttribute("FULLPATH").toString(); - File file = new File(makefullPath); - if (!file.exists()) { - throw new RuntimeException("要读取的文件不存在"); - } - con.setInputfile(BASE64.encodeImgageToBase64(file)); - map.put(info, con); - Map resultMap = null; - resultMap = requestService.createPaymentofHireSign(map); - if (!resultMap.containsKey("error")) { - for (String key : resultMap.keySet()) { - if (key.indexOf("contract_") == -1) { - contract_id = resultMap.get(key); - } - } - } else { - return "error"; - } - } - if (bo != null) { - Map map1 = new HashMap(); - map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); - Map result1 = requestService.downloadDoc(map1); - if (!result1.containsKey("error")) { - for (String contractId : map1.keySet()) { - try { - if ("success".equals(result1.get(contractId))) { - String fileString = result1.get("file_" + contractId); - InputStream fileInput = BASE64.encodeFileToBase64(fileString); - OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO - byte[] buffByte = new byte[1024]; - int size = 0; - while ((size = fileInput.read(buffByte)) != -1) { - fileOut.write(buffByte, 0, size); - } - fileInput.close(); - fileOut.close(); - } else if ("error".equals(result1.get(contractId))) { - return "error"; - } - } catch (Exception e) { - e.printStackTrace(); - - } - } - } else { - return "error"; - } - } else { - return "error"; - } - - return "success"; - } catch (Exception e) { - e.printStackTrace(); - return "error"; - } - } - //生成一维 - public String SystemMakeOneDimensionalCode(JBOTransaction tx){ - Configure CurConfig = Configure.getInstance(); - try { - String diskPath=CurConfig.getConfigure("OneDimensionalCode"); - MakeOneCodeAndContractModel mocacm = new MakeOneCodeAndContractModel(); - BizObjectManager loManage = JBOFactory.getBizObjectManager(LB_ONEDIMENSIONALCODE.CLASS_NAME,tx); - BizObject lom = loManage.createQuery(" PROJECT_ID=:projectid and CONTRACT_NO=:contractNo and CONTRACT_ID=:contractId").setParameter("projectid", ProjectId).setParameter("contractNo", contractNo).setParameter("contractId", contract_id).getSingleResult(false); - if(lom == null){ - //生成一维码 - mocacm.MOneDimensionalCode(contractNo, contract_id, ProjectId, diskPath, tx); - } - String outPdfFile = CurConfig.getConfigure("BQcontract"); - mocacm.pdfAndMark(outPdfFile, "", contract_id,leasform, tx); - }catch (Exception e) { - e.printStackTrace(); - return "error"; - } - return "success"; - } +package com.tenwa.channelportal.action; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP; +import jbo.app.tenwa.customer.CUSTOMER_PERSON; +import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP; +import jbo.app.tenwa.doc.LB_DOCATTRIBUTE; +import jbo.app.tenwa.doc.LB_DOCLIBRARY; +import jbo.app.tenwa.doc.LB_DOCRELATIVE; +import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST; +import jbo.app.tenwa.doc.LB_ONEDIMENSIONALCODE; +import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT; +import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS; +import jbo.com.tenwa.lease.carbrand.LB_CONTRACT_SIGN_LOG; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_TEMPLATE; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP; +import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE; +import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP; +import jbo.sys.CODE_LIBRARY; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.Configure; +import com.amarsoft.awe.util.ASResultSet; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.amarsoft.context.ASUser; +import com.caucho.hessian.client.HessianProxyFactory; +import com.tenwa.app.dao.ContractSignInfo; +import com.tenwa.lease.app.service.HttpRequestAppService; +import com.tenwa.lease.flow.contract.contractapproval.ContractTemplateCache; +import com.tenwa.makeContract.util.MakeOneCodeAndContractModel; +import com.tenwa.channelportal.action.generativecontract.Word2PdfUtil; +import com.tenwa.channelportal.action.generativecontract.WordToPDFUtil; +import com.tenwa.comm.util.date.DateAssistant; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.doc.util.BASE64; +import com.tenwa.officetempalte.util.FileOperatorUtil; +import com.tenwa.quartz.DateUtil; +import com.tenwa.reckon.util.UUIDUtil; + +public class ContractSignAction{ + public String file_id; + public String cust_phone; + public String cust_id; + public String library_id; + public String customerType; + public String CurUserID; + public String ProjectId; + public String contract_id; + public String FlowUnid; + public String InputOrgid; + public String id; + private String attrId; + public String flagType; + public HessianProxyFactory factory = new HessianProxyFactory(); + public HttpRequestAppService requestService; + public String PAYMENT_NUMBER; + public String PLAN_LIST; + public String Ttype; + public String contractNo; + public String leasform; + private static Logger logger=Logger.getLogger(ContractSignAction.class); + @SuppressWarnings("deprecation") + public static String getConfigRequestUrl() throws Exception{ + return Configure.getInstance().getConfigure("RequestHessionUrl"); + } + @SuppressWarnings("deprecation") + public static String getFileSavePath() throws Exception{ + return Configure.getInstance().getConfigure("FileSavePath"); + } + + public String getCurUserID() { + return CurUserID; + } + + public String getContract_id() { + return contract_id; + } + + public void setContract_id(String contract_id) { + this.contract_id = contract_id; + } + + public void setCurUserID(String curUserID) { + CurUserID = curUserID; + } + + public String getCustomerType() { + return customerType; + } + + public void setCustomerType(String customerType) { + this.customerType = customerType; + } + + public String getFile_id() { + return file_id; + } + + public void setFile_id(String file_id) { + this.file_id = file_id; + } + + + public String getCust_id() { + return cust_id; + } + + public void setCust_id(String cust_id) { + this.cust_id = cust_id; + } + + public String getCust_phone() { + return cust_phone; + } + public void setCust_phone(String cust_phone) { + this.cust_phone = cust_phone; + } + + public String getLibrary_id() { + return library_id; + } + public void setLibrary_id(String library_id) { + this.library_id = library_id; + } + + public String getProjectId() { + return ProjectId; + } + + public void setProjectId(String projectId) { + ProjectId = projectId; + } + + public String getFlowUnid() { + return FlowUnid; + } + + public void setFlowUnid(String flowUnid) { + FlowUnid = flowUnid; + } + + public String getInputOrgid() { + return InputOrgid; + } + + public void setInputOrgid(String inputOrgid) { + InputOrgid = inputOrgid; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + //类型 + public String getFlagType() { + return flagType; + } + + public void setFlagType(String flagType) { + this.flagType = flagType; + } + public String getAttrId() { + return attrId; + } + public void setAttrId(String attrId) { + this.attrId = attrId; + } + + + public String getPAYMENT_NUMBER() { + return PAYMENT_NUMBER; + } + public void setPAYMENT_NUMBER(String pAYMENT_NUMBER) { + PAYMENT_NUMBER = pAYMENT_NUMBER; + } + public String getPLAN_LIST() { + return PLAN_LIST; + } + public void setPLAN_LIST(String pLAN_LIST) { + PLAN_LIST = pLAN_LIST; + } + public String getTtype() { + return Ttype; + } + public void setTtype(String ttype) { + Ttype = ttype; + } + public String getContractNo() { + return contractNo; + } + public void setContractNo(String contractNo) { + this.contractNo = contractNo; + } + public String getLeasform() { + return leasform; + } + public void setLeasform(String leasform) { + this.leasform = leasform; + } + /** + * 自然人电子签约 + * + * @author tenwa518 + * @param tx + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public String signIng(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); + BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObjectManager lcslBom = JBOFactory.getBizObjectManager(LB_CONTRACT_SIGN_LOG.CLASS_NAME,tx); + Map> map = new HashMap>(); + ContractSignInfo con = null; + List bo = null; + BizObject ldclBo = null; + try { + //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); + BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); + // 查询lb_doc_contract_list表 + bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) ").setParameter("projectId", ProjectId).getResultList(true); + for (BizObject keys : bo) { + String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); + StringBuffer manyPeople = this.manyPeople(); + if(manyPeople.length()>0){ + info=info+"@applicant,"+manyPeople.deleteCharAt(manyPeople.length() - 1); + } + List list = map.get(info); + if (list == null) { + list = new ArrayList(); + map.put(info, list); + } + con = new ContractSignInfo(); + con.setCustname(keys.getAttribute("DOC_NAME").toString()); + con.setCustphone(keys.getAttribute("TELEPHONE").toString()); + con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(keys.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = keys.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + list.add(con); + } + Map fromCondtion = new HashMap(); + Map otherProperty = new HashMap(); + Map resultMap = requestService.createContractSign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + //拷表的方法 + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + pbo.setAttributeValue("DATA_STATE", "8");// 状态改成电子签约,签署中 + pbm.saveObject(pbo); + //记录项目进程日志 + /*Transaction tran = Transaction.createTransaction(tx); + ASUser user = ASUser.getUser(CurUserID, tran); + JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME,tx) + .createQuery("UPDATE O SET BUSINESS_STATUS='8',UPDATEUSERID='"+user.getUserID()+"',UPDATEORGID='"+user.getOrgID()+"',UPDATETIME='"+StringFunction.getTodayNow()+"' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM "+LB_PROJECT_INFO.CLASS_NAME+" LPI WHERE LPI.ID='"+ProjectId+"')").executeUpdate(); + SqlObject so = new SqlObject("INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'8','"+user.getUserID()+"','"+user.getOrgID()+"','"+StringFunction.getTodayNow().replaceAll(":", "△")+"' FROM LB_PROJECT_INFO WHERE ID='"+ProjectId+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); + so.setRunSql(so.getRunSql().replaceAll("△", ":")); + tran.executeSQL(so);*/ + return "success"; + } else { + Boolean flag = false; + String getMessage = resultMap.get("error"); + logger.info("契约锁反馈的异常信息" + getMessage); + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1 && !"error".equals(key)) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + if ("1".equals(sendProcess)) { + flag = true; + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + }else if("2".equals(sendProcess)){ + ldclBo.setAttributeValue("MESSAGE",getMessage ); + } + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "0");//发起电子签约 + otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + // 判断不同的异常反馈给前端 + if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { + getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); + return flag + "@" + getMessage; + } else if (getMessage.indexOf("contractId不能为空") != -1) { + return flag + "@" + getMessage; + } else { + return flag + "@" + "error"; + } + } + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + logger.info("自然人电子签约异常:" + e.getMessage()); + return "flase@error"; + } + } + /** + * 法人客户在生成合同是直接盖章 + * @param tx + * @return + * @throws Exception + */ + + @SuppressWarnings("unchecked") + public String compnySignIng(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); + BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + Map map = new HashMap(); + ContractSignInfo con = null; + List bo = null; + BizObject ldclBo = null; + try { + //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); + BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); + // 查询lb_doc_contract_list表 + bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) ").setParameter("projectId", ProjectId).getResultList(true); + for (BizObject keys : bo) { + String info = keys.getAttribute("id").toString(); + con = new ContractSignInfo(); + con.setCustname(keys.getAttribute("DOC_NAME").toString()); + con.setCustphone(keys.getAttribute("TELEPHONE").toString()); + con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(keys.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = keys.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(info, con); + } + Map fromCondtion = new HashMap(); + Map otherProperty = new HashMap(); + Map resultMap = requestService.compnySign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SIGN_TYPE", "COMPLETE");//法人客户当盖完章改为完成状态 + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + //拷表的方法 + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + pbo.setAttributeValue("DATA_STATE", "8");// 状态改成电子签约,签署中 + pbm.saveObject(pbo); + downloadDoc(tx); + return "success"; + } else { + Boolean flag = false; + String getMessage = resultMap.get("error"); + logger.info("契约锁反馈的异常信息" + getMessage); + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1 && !"error".equals(key)) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + if ("1".equals(sendProcess)) { + flag = true; + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + }else if("2".equals(sendProcess)){ + ldclBo.setAttributeValue("MESSAGE",getMessage ); + } + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "0");//发起电子签约 + otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + // 判断不同的异常反馈给前端 + if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { + getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); + return flag + "@" + getMessage; + } else if (getMessage.indexOf("contractId不能为空") != -1) { + return flag + "@" + getMessage; + } else { + return flag + "@" + "error"; + } + } + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + logger.info("法人客户生成合同盖章失败" + e.getMessage()); + return "flase@error"; + } + } + + //获取电子签约人员列表 + public StringBuffer manyPeople() throws JBOException{ + //获取担保人信息 + StringBuffer info = new StringBuffer(); + BizObjectManager cptm = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME); + List cpts = cptm.createQuery("select * from O where flowunid=:flowUnid").setParameter("flowUnid", FlowUnid).getResultList(false); + for(BizObject cpt:cpts){ + String name = cpt.getAttribute("FULLNAME").toString(); + String mobile = cpt.getAttribute("mobile").toString(); + if(name.length()>0 && mobile.length()>0){ + info.append(name+"@"+mobile+"@guarantee,"); + } + } + //获取共同申请人的信息 + BizObjectManager cftm = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME); + BizObject cft = cftm.createQuery("flowunid=:FLowUnid and Partner_='Y'").setParameter("FLowUnid", FlowUnid).getSingleResult(false); + if(cft!=null){ + String name = cft.getAttribute("name").toString(); + String mobile = cft.getAttribute("tel").toString(); + if(name.length()>0 && mobile.length()>0){ + info.append(name+"@"+mobile+"@comm,"); + } + } + + return info; + } + + /** + * 法人租金委托代偿电子签约 + * @author tenwa518 + * @param tx + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public String companySignIng(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + Map> map = new HashMap>(); + ContractSignInfo con = null; + List bo = null; + BizObject ldclBo = null; + try { + BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); + // 查询lb_doc_contract_list表 + bo = contBom.createQuery("project_id=:projectId and file_flag='yes' and (sendprocess='0' or sendprocess='2' ) and doc_name='租金代偿函'").setParameter("projectId", ProjectId).getResultList(true); + for (BizObject keys : bo) { + String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); + List list = map.get(info); + if (list == null) { + list = new ArrayList(); + map.put(info, list); + } + con = new ContractSignInfo(); + con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); + con.setCustphone(keys.getAttribute("TELEPHONE").toString()); + con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(keys.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = keys.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + list.add(con); + } + + Map fromCondtion=new HashMap(); + MapotherProperty=new HashMap(); + Map resultMap = requestService.createComContractSign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1) { + fromCondtion.clear(); + otherProperty.clear(); + //契约锁合同号 + String contractId=resultMap.get("contract_" + key); + String sendProcess=resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + ldclBo.setAttributeValue("SENDPROCESS",sendProcess); + contBom.saveObject(ldclBo); + + String contractDocId =ldclBo .getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + //拷表的方法 + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion,LB_CONTRACT_SIGN_LOG.CLASS_NAME, + null,otherProperty,tx); + } + } + pbo.setAttributeValue("project_status","8");//状态改成电子签约,签署中 + pbm.saveObject(pbo); + //记录项目进程日志 + Transaction tran = Transaction.createTransaction(tx); + ASUser user = ASUser.getUser(CurUserID, tran); + JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME,tx) + .createQuery("UPDATE O SET BUSINESS_STATUS='8',UPDATEUSERID='"+user.getUserID()+"',UPDATEORGID='"+user.getOrgID()+"',UPDATETIME='"+StringFunction.getTodayNow()+"' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM "+LB_PROJECT_INFO.CLASS_NAME+" LPI WHERE LPI.ID='"+ProjectId+"')").executeUpdate(); + SqlObject so = new SqlObject("INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'8','"+user.getUserID()+"','"+user.getOrgID()+"','"+StringFunction.getTodayNow().replaceAll(":", "△")+"' FROM LB_PROJECT_INFO WHERE ID='"+ProjectId+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); + so.setRunSql(so.getRunSql().replaceAll("△", ":")); + tran.executeSQL(so); + return "success"; + } else { + Boolean falg=false; + String getMessage = resultMap.get("error"); + logger.info("契约锁反馈的异常信息" + getMessage); + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1 && !"error".equals(key)) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + if ("1".equals(sendProcess)) { + falg=true; + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + }else if ("2".equals(sendProcess)) { + ldclBo.setAttributeValue("MESSAGE", getMessage); + } + contBom.saveObject(ldclBo); + + String contractDocId=ldclBo.getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");//发起电子签约 + otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + // 判断不同的异常反馈给前端 + if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { + getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); + return getMessage; + } else if (getMessage.indexOf("contractId不能为空") != -1) { + return getMessage; + } else { + return "error"; + } + } + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + return "error"; + } + + } + + /** + * (扣款卡变更)自然人委托扣款授权书电子签约,还有租金代偿函 + * @author tenwa518 + * @param tx + * @return + * @throws Exception + */ + public String PersonDeductSignIng(JBOTransaction tx) throws Exception{ + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + Map> map = new HashMap>(); + ContractSignInfo con = null; + List bo = null; + BizObject ldclBo = null; + try { + // 查询lb_doc_contract_list表 + bo = contBom.createQuery("flow_unid=:flow_unid and (sendprocess='0' or sendprocess='2' ) and file_flag='yes'").setParameter("flow_unid", FlowUnid).getResultList(true); + + for (BizObject keys : bo) { + String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); + List list = map.get(info); + if (list == null) { + list = new ArrayList(); + map.put(info, list); + } + con = new ContractSignInfo(); + con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); + con.setCustphone(keys.getAttribute("TELEPHONE").toString()); + con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(keys.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = keys.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + list.add(con); + } + + + Map fromCondtion=new HashMap(); + MapotherProperty=new HashMap(); + Map resultMap = null; + if ("01".equals(customerType)) { + resultMap = requestService.createComContractSign(map); + } else { + resultMap = requestService.createEntrustmentSign(map); + } + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + fromCondtion.clear(); + otherProperty.clear(); + //契约锁合同号 + String contractId=resultMap.get("contract_" + key); + String sendProcess=resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + ldclBo.setAttributeValue("SENDPROCESS",sendProcess); + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + //拷表的方法 + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + + return "success"; + + } else { + Boolean flag = false; + String getMessage = resultMap.get("error"); + logger.info("契约锁反馈的异常信息" + getMessage); + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1 && !"error".equals(key)) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + if ("1".equals(sendProcess)) { + flag = true; + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + }else if("2".equals(sendProcess)){ + ldclBo.setAttributeValue("MESSAGE",getMessage ); + } + contBom.saveObject(ldclBo); + + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "0");//发起电子签约 + otherProperty.put("CONTRACTDOCID",contractDocId);//发起电子签约 + otherProperty.put("INPUTTIME",DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + // 判断不同的异常反馈给前端 + if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { + getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); + return getMessage; + } else if (getMessage.indexOf("contractId不能为空") != -1) { + return getMessage; + } else { + return "error"; + } + } + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + return "error"; + } + } + + /** + * 提前结清 申请书进行电子签约 + * + * @author + * @param + * @return + * @throws Exception + */ + public String AdjustFordSignIng(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + Map> map = new HashMap>(); + ContractSignInfo con = null; + List bo = null; + BizObject ldclBo = null; + try { + // 查询lb_doc_contract_list表 + bo = contBom.createQuery("flow_unid=:flow_unid and file_flag='yes'").setParameter("flow_unid", FlowUnid).getResultList(true); + for (BizObject keys : bo) { + String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString(); + List list = map.get(info); + if (list == null) { + list = new ArrayList(); + map.put(info, list); + } + con = new ContractSignInfo(); + con.setCustname(keys.getAttribute("CUSTOMERNAME").toString()); + con.setCustphone(keys.getAttribute("TELEPHONE").toString()); + con.setFileid(keys.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(keys.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = keys.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + list.add(con); + } + Map fromCondtion = new HashMap(); + Map otherProperty = new HashMap(); + Map resultMap = null; + resultMap = requestService.createAdjustFordContractDSign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); +// ldclBo.setAttributeValue("PROCESS", "4"); + contBom.saveObject(ldclBo); + + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("id", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId);// 发起电子签约 + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + // 拷表的方法 + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + return "success"; + } else { + Boolean flag = false; + String getMessage = resultMap.get("error"); + logger.info("契约锁反馈的异常信息" + getMessage); + for (String key : resultMap.keySet()) { + // 存储契约锁返回的合同id和合同文件id + if (key.indexOf("contract_") == -1 && !"error".equals(key)) { + fromCondtion.clear(); + otherProperty.clear(); + // 契约锁合同号 + String contractId = resultMap.get("contract_" + key); + String sendProcess = resultMap.get("contract_" + contractId); + ldclBo = contBom.createQuery("ATTRIBUTE_ID='" + key + "'").getSingleResult(true); + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", contractId); + ldclBo.setAttributeValue("SENDPROCESS", sendProcess); + if ("1".equals(sendProcess)) { + flag = true; + ldclBo.setAttributeValue("SIGN_TYPE", "SIGNING"); + } else if ("2".equals(sendProcess)) { + ldclBo.setAttributeValue("MESSAGE", getMessage); + } + contBom.saveObject(ldclBo); + String contractDocId = ldclBo.getAttribute("id").toString(); + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "0");// 发起电子签约 + otherProperty.put("CONTRACTDOCID", contractDocId); + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } + } + // 判断不同的异常反馈给前端 + if (getMessage.indexOf("用户认证信息与合同签署方信息不匹配") != -1) { + getMessage = getMessage.substring((getMessage.indexOf("message")) + 10, (getMessage.indexOf("code")) - 3); + return getMessage; + } else if (getMessage.indexOf("contractId不能为空") != -1) { + return getMessage; + } else { + return "error"; + } + } + } catch (Exception e) { + tx.rollback(); + e.printStackTrace(); + return "error"; + } + + } +/** + * 提前结清查询签约状态 + * @param tx + * @return + * @throws Exception + */ + public String getAdjustFordSignStatus(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); + List ldclBoList = ldclBom.createQuery("flow_unid='" + FlowUnid + "' and file_flag='yes' and " + + "sendprocess='1'").getResultList(true); + String signContractId = ""; + String customerName = ""; + String contractDocId = ""; + StringBuffer result = new StringBuffer(); + Map fromCondtion = new HashMap(); + Map otherProperty = new HashMap(); + for (BizObject key : ldclBoList) { + signContractId = key.getAttribute("singcontract_id").toString(); + customerName = key.getAttribute("customername").toString(); + contractDocId = key.getAttribute("id").toString(); + try { + String signType = requestService.getContractSignStatus(signContractId); + String signstatus = clBom.createQuery("itemno='" + signType + "'").getSingleResult(false).getAttribute("itemname").toString(); + key.setAttributeValue("sign_type", signType); + if("COMPLETE".equals(signType)){ + key.setAttributeValue("PROCESS", "5.1"); + } + ldclBom.saveObject(key); + result.append("," + customerName + "电子签约状态:" + signstatus); + //日志记录 + + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "1");// 查询状态 + otherProperty.put("CONTRACTDOCID", contractDocId); + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } catch (Exception e) { + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "1");// 查询状态 + otherProperty.put("CONTRACTDOCID", contractDocId); + otherProperty.put("MESSAGE", e.getMessage()); + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + return "error"+"@"+e.getMessage(); + } + + } + return result.toString().substring(1); + } + + /** + * (扣款卡变更)自然人委托扣款授权书获取电子签约状态 ,法人租金代偿 + * + * @throws Exception + */ + public String contractSignStatusForContract(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); + List ldclBoList = ldclBom.createQuery("flow_unid='" + FlowUnid + "' and file_flag='yes' and " + + "sendprocess='1'").getResultList(true); + String signContractId = ""; + String customerName = ""; + String contractDocId = ""; + StringBuffer result = new StringBuffer(); + Map fromCondtion = new HashMap(); + Map otherProperty = new HashMap(); + for (BizObject key : ldclBoList) { + signContractId = key.getAttribute("singcontract_id").toString(); + customerName = key.getAttribute("customername").toString(); + contractDocId = key.getAttribute("id").toString(); + try { + String signType = requestService.getContractSignStatus(signContractId); + String signstatus = clBom.createQuery("itemno='" + signType + "'").getSingleResult(false).getAttribute("itemname").toString(); + key.setAttributeValue("sign_type", signType); + if("COMPLETE".equals(signType)){ + key.setAttributeValue("PROCESS", "5.1"); + } + ldclBom.saveObject(key); + result.append("," + customerName + "电子签约状态:" + signstatus); + //日志记录 + + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "1");// 查询状态 + otherProperty.put("CONTRACTDOCID", contractDocId); + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + } catch (Exception e) { + fromCondtion.put("ID", contractDocId); + otherProperty.put("SIGNPROCESS", "1");// 查询状态 + otherProperty.put("CONTRACTDOCID", contractDocId); + otherProperty.put("MESSAGE", e.getMessage()); + otherProperty.put("INPUTTIME", DateAssistant.getTodayNow()); + DataOperatorUtil.copySingleJBO(LB_DOC_CONTRACT_LIST.CLASS_NAME, fromCondtion, LB_CONTRACT_SIGN_LOG.CLASS_NAME, null, + otherProperty, tx); + return "error"+"@"+e.getMessage(); + } + + } + return result.toString().substring(1); + } + + /** + * 获取电子签约状态 + * + * @throws Exception + */ + public String contractSignStatus(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + //BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME, tx); + BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, tx); + BizObjectManager clBom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME, tx); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObjectManager ldBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + //BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).getSingleResult(true); + BizObject pbo = pbm.createQuery("FLOWUNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(true); + String status = ""; + String peopleStatus=""; + String sql = ""; + if ("01".equals(customerType)) { + sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函' and sendprocess='1'"; + } else { + sql = "project_id=:projectId and file_flag='yes' and sendprocess='1'"; + } + @SuppressWarnings("unchecked") + List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); + if (bo != null) { + boolean flag = true; + Map map = new HashMap(); + for (BizObject keys : bo) { + map.put(keys.getAttribute("singcontract_id").toString(), keys.getAttribute("customername").toString()); + } + for (String key : map.keySet()) { + try { + String signStatu = requestService.getContractSignStatus(key); + int index = signStatu.indexOf("$"); + String signStatus = signStatu.substring(0, index); + peopleStatus = signStatu.substring(index+1); + String signStatusName = + clBom.createQuery("itemno='" + signStatus + "'").getSingleResult(false).getAttribute("itemname").toString(); + List ldclList = + contBom.createQuery("project_id=:projectId and file_flag='yes' and singcontract_id='" + key + "'") + .setParameter("projectId", ProjectId).getResultList(true); + for (BizObject keys : ldclList) { + keys.setAttributeValue("SIGN_TYPE", signStatus); + // 客户签署完成,合同制作过程为4 + if ("REQUIRED".equals(signStatus)) { + this.sign(tx); + downloadDoc(tx); + keys.setAttributeValue("PROCESS", "4"); + } + contBom.saveObject(keys); + } + if (!"REQUIRED".equals(signStatus) && !"COMPLETE".equals(signStatus) ) { + flag = false; + } + if ("REQUIRED".equals(signStatus)) { + status += ";
客户" + map.get(key) + "签约状态:已签名"; + } else { + status += ";
客户" + map.get(key) + "签约状态:" + signStatusName; + } + } catch (Exception e) { + e.printStackTrace(); + return "获取签约状态失败!"; + } + } + // 合同签约已完成 + if (flag) { + pbo.setAttributeValue("DATA_STATE", "4");// 状态改成已完成电子签约 + pbm.saveObject(pbo); + // 记录项目进程日志 + /* Transaction tran = Transaction.createTransaction(tx); + ASUser user = ASUser.getUser(CurUserID, tran); + JBOFactory.getBizObjectManager(BUSINESS_STATUS.CLASS_NAME, tx) + .createQuery("UPDATE O SET BUSINESS_STATUS='4',UPDATEUSERID='" + user.getUserID() + "',UPDATEORGID='" + + user.getOrgID() + "',UPDATETIME='" + StringFunction.getTodayNow() + + "' WHERE CONTRACT_NUMBER=(SELECT LPI.CONTRACT_NUMBER FROM " + LB_PROJECT_INFO.CLASS_NAME + + " LPI WHERE LPI.ID='" + ProjectId + "')") + .executeUpdate(); + SqlObject so = new SqlObject( + "INSERT INTO BUSINESS_DETAIL(ID,CONTRACT_NUMBER,BUSINESS_STATUS,INPUTUSERID,INPUTORGID,INPUTTIME) SELECT SYS_GUID(),CONTRACT_NUMBER,'4','" + + user.getUserID() + "','" + user.getOrgID() + "','" + StringFunction.getTodayNow().replaceAll(":", "△") + + "' FROM LB_PROJECT_INFO WHERE ID='" + ProjectId + "'"); + so.setDebugSql(so.getDebugSql().replaceAll("△", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("△", ":")); + so.setRunSql(so.getRunSql().replaceAll("△", ":")); + tran.executeSQL(so);*/ + for (BizObject keys : bo) { + /* ldBom.createQuery("update O set status='' where id='" + keys.getAttribute("attribute_id").toString() + "'") + .executeUpdate();*/ + } + status = ";
已经完成电子签约"; + } + } + if (status.length() < 1) { + return "获取签约状态失败,没有合同文件"; + } else { + status = status.substring(5); + String[] peopleStat = peopleStatus.split(","); + if(peopleStat.length>1){ + status = status+"
"; + for(int i=0;i map = new HashMap(); + + map.put(ldb.getAttribute("TEMPLATE_ID").toString(),lul.getAttribute("CUSTOMER_NAME").toString()); + + for (String key : map.keySet()) { + try { + String signStatu = requestService.getContractSignStatus(key); + int index = signStatu.indexOf("$"); + String signStatus = signStatu.substring(0, index); + peopleStatus = signStatu.substring(index+1); + String signStatusName = + clBom.createQuery("itemno='" + signStatus + "'").getSingleResult(false).getAttribute("itemname").toString(); + BizObject ldl = ldlMange.createQuery("RELATIVE_ID=:relativeid").setParameter("relativeid", ldb.getAttribute("ID").getString()).getSingleResult(false); + lda = ldaMange.createQuery("LIBRARY_ID=:libraryid").setParameter("libraryid", ldl.getAttribute("ID").getString()).getSingleResult(true); + if (signStatu.indexOf("已签署")>0) { + signStatus = "REQUIRED"; + }else{ + flag = false; + } + if ("REQUIRED".equals(signStatus)) { + status += ";
客户" + map.get(key) + "签约状态:已签名"; + } else { + status += ";
客户" + map.get(key) + "签约状态:" + signStatusName; + } + } catch (Exception e) { + e.printStackTrace(); + return "获取签约状态失败!"; + } + } + // 合同签约已完成 + if (flag) { + lda.setAttributeValue("REMARK", "COMPLETE");// 状态改成已完成电子签约 + BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); + if(ldcl != null){ + ldcl.setAttributeValue("sign_type", "COMPLETE"); + ldclManage.saveObject(ldcl); + } + ldaMange.saveObject(lda); + status = ";
已经完成电子签约"; + changedownloadDoc(tx); + } + } + + if (status.length() < 1) { + return "获取签约状态失败,没有合同文件"; + } else { + status = status.substring(5); + String[] peopleStat = peopleStatus.split(","); + if(peopleStat.length>1){ + status = status+"
"; + for(int i=0;i contractIds = new ArrayList(); + if ("01".equals(customerType)) { + sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函' and sendprocess='1'"; + } else { + sql = "project_id=:projectId and file_flag='yes' and sendprocess='1'"; + } + @SuppressWarnings("unchecked") + List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); + if (bo != null) { + boolean flag = true; + Map map = new HashMap(); + for (BizObject keys : bo) { + map.put(keys.getAttribute("singcontract_id").toString(), keys.getAttribute("customername").toString()); + contractIds.add(keys.getAttribute("singcontract_id").toString()); + } + + Map resultMap = requestService.getContractSignListStatus(contractIds); + } + return ""; + } + + /** + * 盖企业章 + * + * @param tx + * @return + * @throws MalformedURLException + * @throws Exception + */ + public String sign(JBOTransaction tx) throws MalformedURLException, Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + @SuppressWarnings("unchecked") + List bo = contBom.createQuery("project_id=:projectId and file_flag='yes'") + .setParameter("projectId", ProjectId).getResultList(true); + if (bo != null) { + Map> map = new HashMap>(); + for (BizObject keys : bo) { + List list = map.get(keys.getAttribute("singcontract_id").toString()); + if (list == null) { + list = new ArrayList(); + } + list.add(keys.getAttribute("DOCUMENT_ID").toString()+"@"+keys.getAttribute("doc_name").toString()); + map.put(keys.getAttribute("singcontract_id").toString(), list); + } + Map resultMap = requestService.Sign(map); + String statu = resultMap.get("error"); + if (statu == null) { + return "success"; + } + } + + return "error"; + } + + /** + * 根据document_id下载合同 + * + * @param tx + * @return + * @throws Exception + * @throws MalformedURLException + */ + public String downloadDoc(JBOTransaction tx) throws MalformedURLException, Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + String sql = ""; + if ("01".equals(customerType)) { + sql = "project_id=:projectId and file_flag='yes' and doc_name='租金代偿函'"; + } else { + sql = "project_id=:projectId and file_flag='yes'"; + } + try { + + @SuppressWarnings("unchecked") + List bo = contBom.createQuery(sql).setParameter("projectId", ProjectId).getResultList(true); + if (bo != null) { + Map map = new HashMap(); + for (BizObject keys : bo) { + map.put(keys.getAttribute("DOCUMENT_ID").toString(), keys.getAttribute("FULLPATH").toString()); + } + Map result = requestService.downloadDoc(map); + if (!result.containsKey("error")) { + for (String contractId : map.keySet()) { + try { + if ("success".equals(result.get(contractId))) { + String fileString = result.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + return "success"; + } else { + return "error"; + } + } + } catch (Exception e) { + return "error"; + } + return "success"; + } + + /** + * 扣款卡信息变更根据document_id下载合同 + * + * @param tx + * @return + * @throws Exception + * @throws MalformedURLException + */ + public String changedownloadDoc(JBOTransaction tx) throws MalformedURLException, Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager ldMange = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME, tx); + String sql = "OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid "; + @SuppressWarnings("unchecked") + BizObject ldb = ldMange.createQuery(sql).setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); + BizObjectManager clBom = JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME, tx); + try { + if (ldb != null) { + BizObject ldl = clBom.createQuery("RELATIVE_ID=:relativeid").setParameter("relativeid", ldb.getAttribute("ID").getString()).getSingleResult(false); + BizObjectManager ldaMange = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + BizObject lda = ldaMange.createQuery("LIBRARY_ID=:libraryid").setParameter("libraryid", ldl.getAttribute("ID").getString()).getSingleResult(false); + Map map = new HashMap(); + map.put(ldl.getAttribute("REMARK").toString(), lda.getAttribute("FULLPATH").toString()); + Map result = requestService.downloadDoc(map); + if (!result.containsKey("error")) { + for (String contractId : map.keySet()) { + try { + if ("success".equals(result.get(contractId))) { + String fileString = result.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + return "success"; + } else { + return "error"; + } + } + } catch (Exception e) { + return "error"; + } + return "success"; + } + +//扣款卡变更下载合同 + public String downloadDocContract(JBOTransaction tx) throws MalformedURLException, Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + String sql = ""; + sql = "flow_unid=:flow_unid and file_flag='yes'"; + String attributeId = ""; + try { + @SuppressWarnings("unchecked") + List bo = contBom.createQuery(sql).setParameter("flow_unid", FlowUnid).getResultList(true); + if (bo != null) { + Map map = new HashMap(); + for (BizObject keys : bo) { + map.put(keys.getAttribute("DOCUMENT_ID").toString(), keys.getAttribute("FULLPATH").toString()); + attributeId = keys.getAttribute("ATTRIBUTE_ID").toString(); + } + Map result = requestService.downloadDoc(map); + + if (!result.containsKey("error")) { + for (String contractId : map.keySet()) { + try { + if ("success".equals(result.get(contractId))) { + String fileString = result.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result.get(contractId))) { + return "error@"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + return "success@" + attributeId; + } else { + return "error@"; + } + } else { + System.out.println("没有文件可下载"); + return "error@"; + } + } catch (Exception e) { + e.printStackTrace(); + return "error@"; + } + } + +/** + * 扣款卡变更下载zip合同 + * @param tx + * @return + * @throws Exception + * @throws MalformedURLException + */ +public String downloadZipContract(JBOTransaction tx) throws MalformedURLException, Exception{ + requestService = (HttpRequestAppService) factory.create( + HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + try{ + String path=null; + @SuppressWarnings("unchecked") + String sql=""; + sql="flow_unid=:flow_unid and file_flag='yes'"; + @SuppressWarnings("unchecked") + List bo = contBom.createQuery(sql).setParameter("flow_unid",FlowUnid).getResultList(true); + + if(bo!=null){ + Map map=new HashMap(); + for(BizObject keys:bo){ + path="D://"+keys.getAttribute("singcontract_id").toString()+"DocList.zip"; + map.put(keys.getAttribute("singcontract_id").toString(),path); + } + String result=requestService.download(map); + if(result.equals("success")){ + return "success"; + }else{ + return "error"; + } + } + }catch(Exception e){ + return "error"; + } + return "success"; +} + + +/** + * 根据contract_id下载合同 + * @param tx + * @return + * @throws Exception + * @throws MalformedURLException + */ +public String download(JBOTransaction tx) throws MalformedURLException, Exception{ + requestService = (HttpRequestAppService) factory.create( + HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + try{ + String path=null; + @SuppressWarnings("unchecked") + List bo = contBom.createQuery("project_id=:projectId and file_flag='yes'").setParameter("projectId",ProjectId).getResultList(true); + if(bo!=null){ + Map map=new HashMap(); + for(BizObject keys:bo){ + path="D://"+keys.getAttribute("singcontract_id").toString()+"DocList.zip"; + map.put(keys.getAttribute("singcontract_id").toString(),path); + } + String result=requestService.download(map); + if(result.equals("success")){ + return "success"; + }else{ + return "error"; + } + } + }catch(Exception e){ + return "error"; + } + return "success"; +} + +/** + *jar包方式word转换pdf + *用jar方法 + *word转换pdf + */ +public void wordToPdfJar(JBOTransaction tx){ + try { + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + String sql=""; + if(flagType==null || "word".equals(flagType)){ + sql="project_id='"+ProjectId+"' and file_flag='yes' and process='1'"; + }else if("contract".equals(flagType)){ + sql="contract_id='"+contract_id+"' and file_flag='yes' and process='1'"; + }else if("pdfFalse".equals(flagType)){ + sql="project_id='"+ProjectId+"' and file_flag='yes' and process='3'"; + }else if ("flowunid".equals(flagType)){ + sql = "flow_unid='"+FlowUnid+"' and file_flag='yes' and process='1'"; + } + List bo = contBom.createQuery(sql).getResultList(false); + if(bo!=null){ + for(BizObject key:bo){ + String lastFilePath= key.getAttribute("FULLPATH").toString().replace(".docx", ".pdf"); + try { + WordToPdfThread wtpt = new WordToPdfThread(key.getAttribute("FULLPATH").toString(),lastFilePath,key.getAttribute("ATTRIBUTE_ID").toString()); + wtpt.start(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } catch (JBOException e) { + e.printStackTrace(); + + } +} +/** + * LibreOffice实现word转换pdf + * word转换pdf + * @throws JBOException + */ + @SuppressWarnings({ "unchecked", "static-access" }) + public void wordToPdf(JBOTransaction tx) throws JBOException { + try { + BizObjectManager fbo = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME, tx); + BizObject fbos = fbo.createQuery("FLOW_UNID=:flowunid").setParameter("flowunid", FlowUnid).getSingleResult(false); + //获取用户信息 + BizObjectManager lult = JBOFactory.getBizObjectManager(LB_UNION_LESSEE_TEMP.CLASS_NAME); + BizObjectManager customer = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME); + BizObject lults = lult.createQuery("flowunid=:flowUnid").setParameter("flowUnid", FlowUnid).getSingleResult(false); + BizObject cust = customer.createQuery("flowunid=:flowUnid and customerid=:customerid").setParameter("flowUnid", FlowUnid).setParameter("customerid", lults.getAttribute("customer_id").toString()).getSingleResult(false); + String customername = null; + String telephone = null; + String ids =null; + + if(cust!=null){ + customername = cust.getAttribute("FULLNAME").toString(); + telephone = cust.getAttribute("mobile").toString(); + ids = cust.getAttribute("CUSTOMERID").toString(); + } + + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObjectManager attrBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + WordToPDFUtil wordTopdf = new WordToPDFUtil(); + File file = null; + Boolean result = null; + String sql = ""; + /*if (flagType == null || "word".equals(flagType)) { + sql = "project_id='" + ProjectId + "' and file_flag='yes' and process='1'"; + } else if ("contract".equals(flagType)) { + sql = "contract_id='" + contract_id + "' and file_flag='yes' and process='1'"; + } else if ("pdfFalse".equals(flagType)) { + sql = "project_id='" + ProjectId + "' and file_flag='yes' and process='3'"; + } else if ("flowunid".equals(flagType)){ + sql = "flow_unid='"+FlowUnid+"' and file_flag='yes' and (process='1' or process='3')"; + }*/ + List bo = contBom.createQuery("flow_unid=:flowUnid and file_flag='yes' and process='1'").setParameter("flowUnid", FlowUnid).getResultList(true); + if (bo != null) { + for (BizObject contBo : bo) { + String attrId = contBo.getAttribute("ATTRIBUTE_ID").toString(); + BizObject attrBo = attrBom.createQuery("id='" +attrId+"'").getSingleResult(true); + String path = attrBo.getAttribute("FULLPATH").toString(); + String lastFilePath = path.replace(".docx", ".pdf"); + File filePath = new File(path); + if(!filePath.exists()){ + logger.info("word转换pdf的源文件不存在"); + continue; + } + String lastFilePathpdf = filePath.getParent(); + try { + result = wordTopdf.Word2Pdf(path, lastFilePathpdf); + } catch (Exception e) { + result = false; + e.printStackTrace(); + } + if (result) { + file =new File(lastFilePath); + contBo.setAttributeValue("FULLPATH",lastFilePath); + contBo.setAttributeValue("FILENAME",contBo.getAttribute("FILENAME").toString().replace(".docx",".pdf" )); + contBo.setAttributeValue("FILEPATH",contBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); + contBo.setAttributeValue("CONTENT_TYPE","application/pdf"); + contBo.setAttributeValue("PROCESS","2"); + contBo.setAttributeValue("PROJECT_ID",fbos.getAttribute("proj_id").toString()); + contBo.setAttributeValue("CUSTOMERNAME",customername); + contBo.setAttributeValue("TELEPHONE",telephone); + contBo.setAttributeValue("IDS",ids); + contBom.saveObject(contBo); + attrBo.setAttributeValue("FULLPATH",attrBo.getAttribute("FULLPATH").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FILENAME",attrBo.getAttribute("FILENAME").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FILEPATH",attrBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FileSize",file.length()); + attrBo.setAttributeValue("CONTENT_TYPE","application/pdf"); + attrBom.saveObject(attrBo); + }else{ + contBo.setAttributeValue("PROCESS","3"); + contBom.saveObject(contBo); + } + } + } + } catch (JBOException e) { + e.printStackTrace(); + } + } + + /** + * 租金通知书附件用LibreOffice实现word转换pdf + * word转换pdf + * @throws JBOException + */ + @SuppressWarnings({ "unchecked", "static-access" }) + public String wordToPdfAnnex(JBOTransaction tx) throws JBOException { + + PLAN_LIST=PLAN_LIST.split("\\.")[0]; + BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE = null; + if("null".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and OBJECTTYPE='打印催款函' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + }else if("rights".equals(PLAN_LIST)){ + DOCRELATIVE = bom.createQuery("CONTRACT_ID=:CONTRACT_ID and objecttype='rights'").setParameter("CONTRACT_ID",contract_id).getSingleResult(false); + }else if("settle".equals(PLAN_LIST)){ + DOCRELATIVE = bom.createQuery("CONTRACT_ID=:CONTRACT_ID and objecttype='settle'").setParameter("CONTRACT_ID",contract_id).getSingleResult(false); + }else if("TX".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype='AdjustInterst' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + }else if("ChangeCar".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("transfer".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("AdjustmentNotice".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("TriditionCollection".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionCollection' and plan_number=:plan_number").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + }else if("TriditionSuspension".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); + }else if("settletradition".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='settletradition' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); + }else if("LetterApprova".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LetterApprova' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); + }else if("LoanNotice".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LoanNotice' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); + } + else{ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false); + } + + BizObjectManager attrBom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME); + BizObject attrBo=null; + WordToPDFUtil wordTopdf = new WordToPDFUtil(); + File file = null; + Boolean result = null; + String sql = ""; + try { + if (DOCRELATIVE != null) { + + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); + String DOCLIBRARYid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); + attrBo = attrBom.createQuery("library_id=:library_id").setParameter("library_id", DOCLIBRARYid).getSingleResult(true); + + String path = attrBo.getAttribute("FULLPATH").toString(); + String lastFilePath = path.replace(".docx", ".pdf"); + File filePath = new File(path); + if(!filePath.exists()){ + logger.info("word转换pdf的源文件不存在"); + } + String lastFilePathpdf = filePath.getParent(); + try { + result = wordTopdf.Word2Pdf(path, lastFilePathpdf); + } catch (Exception e) { + result = false; + e.printStackTrace(); + } + if (result) { + file =new File(lastFilePath); + attrBo.setAttributeValue("FULLPATH",attrBo.getAttribute("FULLPATH").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FILENAME",attrBo.getAttribute("FILENAME").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FILEPATH",attrBo.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); + attrBo.setAttributeValue("FileSize",file.length()); + attrBo.setAttributeValue("CONTENT_TYPE","application/pdf"); + attrBom.saveObject(attrBo); + }else{ + } + if("ChangeCar".equals(PLAN_LIST)){ + BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); + file =new File(lastFilePath); + ldcl.setAttributeValue("FULLPATH",lastFilePath); + ldcl.setAttributeValue("FILENAME",ldcl.getAttribute("FILENAME").toString().replace(".docx",".pdf" )); + ldcl.setAttributeValue("FILEPATH",ldcl.getAttribute("FILEPATH").toString().replace(".docx", ".pdf")); + ldcl.setAttributeValue("CONTENT_TYPE","application/pdf"); + ldcl.setAttributeValue("PROCESS","2"); + ldclManage.saveObject(ldcl); + } + } + + } catch (JBOException e) { + e.printStackTrace(); + } + return attrBo.getAttribute("ID").toString(); + } + /** + * 多线程word转换pdf + * @author tenwa518 + * + */ +class WordToPdfThread extends Thread{ + final String fullPath; + final String lastFilePath; + final String attrId; + public WordToPdfThread(String fullPath,String lastFilePath,String attrId){ + this.fullPath = fullPath; + this.lastFilePath = lastFilePath; + this.attrId = attrId; + + } + @Override + public void run() { + Word2PdfUtil wP = new Word2PdfUtil(); +// WordToPDFUtil w2P = new WordToPDFUtil(); + try { +// w2P.Word2Pdf(fullPath, lastFilePathpdf); + wP.doc2pdf(fullPath,lastFilePath,attrId); + } catch (Exception e) { + e.printStackTrace(); + } + } +} +/** + * 查看word文件是否都转为pdf + * @param tx + * @return + * @throws JBOException + */ +public String getMakeContractProcess(JBOTransaction tx) throws JBOException{ + BizObjectManager ldclBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + int wordIng=0; + int pdfFalse=0; + int pdfTrue=0; + List ldclBo2=ldclBom.createQuery("project_id='"+ProjectId+"' and file_flag='yes' ").getResultList(false); + if(ldclBo2.size()>0){ + for(BizObject key:ldclBo2){ + String process = key.getAttribute("process").toString(); + if("1".equals(process)){ + wordIng++; +// return "error"; + }else if("2".equals(process)){ + pdfTrue++; +// return "wording"; + }else if("3".equals(process)){ + pdfFalse++; +// return "success"; + } + } + }else{ + //制作合同 + return "0"; + } + if(wordIng>0 && pdfFalse>0 && pdfTrue>0){ + //word转换PDF部分失败 + return "1"; + }else if(wordIng==0 && pdfFalse>0 && pdfTrue>0){ + //word转PDF失败 + return "2"; + }else if(wordIng==0 && pdfFalse>0 && pdfTrue>0){ + //word转换PDF部分失败, + return "3"; + }else if(wordIng>0 && pdfFalse==0 && pdfTrue>0){ + //word正在转换pdf + return "4"; + }else if(wordIng>0 && pdfFalse==0 && pdfTrue==0){ + //word没有转换pdf + return "5"; + }else if(wordIng==0 && pdfFalse==0 && pdfTrue>0){ + //word转换PDF成功 + return "6"; + } + return "error"; +} +//(扣款卡变更)根据合同号获取文件状态 +public String getMakeContractProcessContract(JBOTransaction tx) throws JBOException{ + BizObjectManager ldclBom=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + BizObject ldclBo = null; + ldclBo=ldclBom.createQuery("flow_unid='"+FlowUnid+"'and file_flag='yes' ").getSingleResult(false); + if(ldclBo!=null){ + String process = ldclBo.getAttribute("process").toString(); + String signType = ldclBo.getAttribute("sign_type").toString(); + if("1".equals(process)){ + return "isDoc"; + }else if("2".equals(process)&&"DRAFT".equals(signType)){ + return "isPdf"; + }else if("COMPLETE".equals(signType)){ + return "complete"; + }else if("SIGNING".equals(signType)){ + return "isSigning"; + } + } + //表示不存在这个文件 + return "notExsit"; +} +/** + * 转账授权申请书 + * @param tx + * @return + * @throws InterruptedException + */ +@SuppressWarnings("unchecked") +public String AccountAccreditSign(JBOTransaction tx){ + try{ + this.wordToPdf(tx); + tx.commit(); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + List boList = contBom.createQuery("file_flag='yes' and (process='2' or process='5') and flow_unid='"+FlowUnid+"'").getResultList(true); + if(boList.size()>0){ + try { + String result =this.accountSign(tx,FlowUnid,InputOrgid); + if("success".equals(result)){ + return "success"; + }else{ + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + }else{ + return "error"; + } + } catch (JBOException e) { + e.printStackTrace(); + return "error"; + } +} +public String accountSign(JBOTransaction tx,String flowunid,String orgid) throws Exception{ + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager ldclBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObjectManager attrBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME,tx); + Map map=new HashMap(); + ContractSignInfo con=null; + BizObject ldclBo=null; + try{ + //查询lb_doc_contract_list表 + ldclBo = ldclBom.createQuery("file_flag='yes' and process='2' and flow_unid='" + flowunid + "'").getSingleResult(true); + if (ldclBo != null) { + con = new ContractSignInfo(); + con.setFileid(ldclBo.getAttribute("ATTRIBUTE_ID").toString()); + con.setFilename(ldclBo.getAttribute("FILENAME").toString()); + // 获取生成文件路径 + String makefullPath = ldclBo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(flowunid, con); + Map resultMap = null; + if (orgid.indexOf("8002003001") >= 0) { + // 西城转账授权 + resultMap = requestService.createAccountContractSign(map); + } else { + // 东城转账授权 + resultMap = requestService.createAccountContractDSign(map); + } + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + ldclBo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + ldclBo.setAttributeValue("SINGCONTRACT_ID", resultMap.get("contract_" + key)); + } + } + ldclBo.setAttributeValue("PROCESS", "5"); + ldclBom.saveObject(ldclBo); + tx.commit(); + } else { + return "error"; + } + } + //拉取文件 + ldclBo = ldclBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + flowunid + "'").getSingleResult(true); + if (ldclBo != null) { + BizObject attrBo = attrBom.createQuery("id='"+ldclBo.getAttribute("attribute_id")+"'").getSingleResult(true); + Map mapFile = new HashMap(); + String fileName = ldclBo.getAttribute("FILENAME").toString(); + String fullPath =FileOperatorUtil.getuploadFileDir(this.getFileSavePath())+UUIDUtil.getUUID()+"_"+fileName; + String filePath = fullPath.replaceAll(this.getFileSavePath(),""); + mapFile.put(ldclBo.getAttribute("DOCUMENT_ID").toString(),fullPath); + Map result = requestService.downloadDoc(mapFile); + if (!result.containsKey("error")) { + for (String documentId : mapFile.keySet()) { + try { + if ("success".equals(result.get(documentId))) { + String fileString = result.get("file_" + documentId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(mapFile.get(documentId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result.get(documentId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + } + } + ldclBo.setAttributeValue("FILEPATH",filePath); + ldclBo.setAttributeValue("FULLPATH",fullPath); + ldclBo.setAttributeValue("PROCESS", "6"); + ldclBom.saveObject(ldclBo); + attrBo.setAttributeValue("FILEPATH",filePath); + attrBo.setAttributeValue("FULLPATH",fullPath); + attrBo.setAttributeValue("FileSize",new File(fullPath).length()); + attrBom.saveObject(attrBo); + return "success"; + } else { + return "error"; + } + } else { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + +} +public String getFlowUnid(JBOTransaction tx) throws JBOException{ + BizObjectManager fboBom=JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME,tx); + BizObject fboBo=fboBom.createQuery("CHANNELAPPLYID='"+id+"'").getSingleResult(false); + return fboBo.getAttribute("flow_unid").toString(); +} + +/* + * 重新发送短信 + * */ +public String sendMessageAgain(JBOTransaction tx) { + try{ + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + List bo = null; + String file = new String(); + Map contractmap = new HashMap(); + List list = new ArrayList(); + bo = contBom.createQuery("select singcontract_id,filename from O where project_id =:projectId" + +" and file_flag = 'yes' and sendprocess = '1' and sign_type = 'SIGNING'") + .setParameter("projectId", ProjectId).getResultList(true); + for (BizObject temp : bo) { + String singcontractid = temp.getAttribute("singcontract_id").toString(); + String filename = temp.getAttribute("filename").toString(); + contractmap.put(singcontractid, filename); + } + list.addAll(contractmap.keySet()); + Map map = requestService.sendNotice(list); + if(!map.containsKey("error")){ + return "success"; + }else{ + for(String singcontractid:map.keySet()){ + String sendStatus = map.get(singcontractid); + if("2"==sendStatus){ + file += contractmap.get(singcontractid)+";"; + } + } + return file; + } + + } catch (Exception e) { + try { + tx.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + return "error"; + } +} + + /* + * 扣款卡信息变更重新发送短信 + * */ + public String ChangesendMessageAgain(JBOTransaction tx) { + try{ + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + List bo = null; + String file = new String(); + Map contractmap = new HashMap(); + List list = new ArrayList(); + BizObjectManager ldMange = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME, tx); + String status = ""; + String peopleStatus=""; + String sql = "OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid "; + @SuppressWarnings("unchecked") + BizObject ldb = ldMange.createQuery(sql).setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); + if(ldb!=null){ + String singcontractid = ldb.getAttribute("TEMPLATE_ID").toString(); + contractmap.put(singcontractid, "直租个人授权协议书.pdf"); + } + list.addAll(contractmap.keySet()); + Map map = requestService.sendNotice(list); + if(!map.containsKey("error")){ + return "success"; + }else{ + for(String singcontractid:map.keySet()){ + String sendStatus = map.get(singcontractid); + if("2"==sendStatus){ + file += contractmap.get(singcontractid)+";"; + } + } + return file; + } + + } catch (Exception e) { + try { + tx.rollback(); + } catch (JBOException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + return "error"; + } + } + +public String getProcess(JBOTransaction tx){ + try { + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObject bo = contBom.createQuery("file_flag='yes' and process is not null and flow_unid='"+FlowUnid+"'").getSingleResult(false); + if(bo==null){ + return "success"; + }else{ + return bo.getAttribute("PROCESS").toString(); + } + } catch (JBOException e) { + e.printStackTrace(); + return "error"; + } + +} + +public String claimSign(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; + String doc_name = new String(); + String[] attrIdList=attrId.split("@"); + try{ + for(String attribute_id:attrIdList){ + Map map=new HashMap(); + bo = contBom.createQuery("file_flag='yes' and process='2' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); + if(bo != null){ + con = new ContractSignInfo(); + con.setFileid(attribute_id); + con.setFilename(bo.getAttribute("FILENAME").toString()); + String makefullPath = bo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(FlowUnid, con); + Map resultMap = null; + //调代理的接口 + doc_name = bo.getAttribute("doc_name").toString(); + if("租金支付表".equals(doc_name)){ + //租金支付表 + resultMap = requestService.createPaymentofHireSign(map); + } + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + bo.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); + bo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + } + } + bo.setAttributeValue("PROCESS", "5"); + contBom.saveObject(bo); + tx.commit(); + } else { + return "error"; + } + } + bo = contBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); + if (bo != null) { + Map map1 = new HashMap(); + map1.put(bo.getAttribute("DOCUMENT_ID").toString(), bo.getAttribute("FULLPATH").toString()); + Map result1 = requestService.downloadDoc(map1); + if (!result1.containsKey("error")) { + for (String contractId : map1.keySet()) { + try { + if ("success".equals(result1.get(contractId))) { + String fileString = result1.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result1.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + bo.setAttributeValue("PROCESS", "6"); + contBom.saveObject(bo); + } else { + return "error"; + } + } else { + return "error"; + } + } + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } +} + + /** + * 打印租金通知书并发短信给客户 + * @param tx + * @return + * @throws Exception + */ + public String claimSignA(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + String libraryid=""; + PLAN_LIST=PLAN_LIST.split("\\.")[0]; + BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false); + if (DOCRELATIVE != null) { + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); + libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); + } + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; +// String contract_id=""; + String info=""; + try{ + //获取承租人的姓名和电话号 + BizObjectManager lulManager = JBOFactory.getBizObjectManager(LB_UNION_LESSEE.CLASS_NAME, tx); + String customerid = lulManager.createQuery("CONTRACT_ID=:contractId").setParameter("contractId", contract_id).getSingleResult(false).getAttribute("CUSTOMER_ID").toString(); + BizObjectManager crManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME, tx); + BizObject cr = crManage.createQuery("CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(false); + if(cr != null){ + info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString()+"@"+flagType; + }else{ + info = "flagType@flagType@"+flagType; + } + //获取需要盖章的文件信息 + Map map=new HashMap(); + bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); + if(bo != null){ + id = bo.getAttribute("id").toString(); + con = new ContractSignInfo(); + con.setFileid(id); + con.setFilename(bo.getAttribute("FILENAME").toString()); + String makefullPath = bo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(info, con); + Map resultMap = null; + //调代理的接口 +// doc_name = bo.getAttribute("doc_name").toString(); +// if("租金支付表".equals(doc_name)){ + //租金支付表 + resultMap = requestService.createPaymentofHireSign(map); +// } + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { +// bo.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); +// bo.setAttributeValue("DOCUMENT_ID", resultMap.get(key)); + contract_id = resultMap.get(key); + } + } +// bo.setAttributeValue("PROCESS", "5"); +// contBom.saveObject(bo); +// tx.commit(); + } else { + return "error"; + } + } +// bo = contBom.createQuery("file_flag='yes' and process='5' and flow_unid='" + FlowUnid + "' and attribute_id= '"+attribute_id+"'").getSingleResult(true); + if (bo != null) { + Map map1 = new HashMap(); + map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); + Map result1 = requestService.downloadDoc(map1); + if (!result1.containsKey("error")) { + for (String contractId : map1.keySet()) { + try { + if ("success".equals(result1.get(contractId))) { + String fileString = result1.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result1.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } +// bo.setAttributeValue("PROCESS", "6"); +// contBom.saveObject(bo); + } else { + return "error"; + } + } else { + return "error"; + } + + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + } + + /** + * 扣款卡信息变更发电子签约 + * @param tx + * @return + * @throws Exception + */ + public String changeCarSignA(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + String libraryid=""; + BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME,tx); + BizObjectManager bom1=null; + BizObject DOCRELATIVE= null; + BizObject library= null; + DOCRELATIVE=bom.createQuery("OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(true); + if (DOCRELATIVE != null) { + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME,tx); + library=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(true); + libraryid = library.getAttribute("id").toString(); + } + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; +// String contract_id=""; + String info=""; + try{ + //获取承租人的姓名和电话号 + BizObjectManager lulManager = JBOFactory.getBizObjectManager(LB_UNION_LESSEE.CLASS_NAME, tx); + String customerid = lulManager.createQuery("CONTRACT_ID=:contractId").setParameter("contractId", contract_id).getSingleResult(false).getAttribute("CUSTOMER_ID").toString(); + BizObjectManager crManage = JBOFactory.getBizObjectManager(CUSTOMER_PERSON.CLASS_NAME, tx); + BizObject cr = crManage.createQuery("CUSTOMERID=:customerid").setParameter("customerid", customerid).getSingleResult(false); + if(cr != null){ + info = cr.getAttribute("FULLNAME").toString() + "@" + cr.getAttribute("mobile").toString()+"@"+flagType; + }else{ + return "error"; + } + //获取需要盖章的文件信息 + Map map=new HashMap(); + bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); + if(bo != null){ + id = bo.getAttribute("id").toString(); + con = new ContractSignInfo(); + con.setFileid(id); + con.setFilename(bo.getAttribute("FILENAME").toString()); + String makefullPath = bo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(info, con); + Map resultMap = null; + resultMap = requestService.createAccountContractDSign(map); + + if (!resultMap.containsKey("error")) { + BizObjectManager ldclManage=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObject ldcl = ldclManage.createQuery(" FLOW_UNID=:flowunid and CONTRACT_ID=:contractid and file_flag='yes' ").setParameter("flowunid", FlowUnid).setParameter("contractid", contract_id).getSingleResult(true); + if(ldcl != null){ + ldcl.setAttributeValue("sign_type", "SIGNING"); + ldclManage.saveObject(ldcl); + } + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { +// DOCRELATIVE.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key)); + DOCRELATIVE.setAttributeValue("TEMPLATE_ID", resultMap.get("contract_" + key)); + library.setAttributeValue("REMARK",resultMap.get(key)); + bo.setAttributeValue("REMARK","SIGNING"); + contract_id = resultMap.get(key); + } + } + bom.saveObject(DOCRELATIVE); + bom1.saveObject(library); + contBom.saveObject(bo); + tx.commit(); + } else { + return "error"; + } + } + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + } + + /** + * 催收函盖公司章 + * @param tx + * @return + * @throws Exception + */ + public String collectionSignA(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + String libraryid=""; + BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE = null; + if("settle".equals(flagType)){ + DOCRELATIVE=bom.createQuery("CONTRACT_ID=:contractid and objecttype='settle' ").setParameter("contractid",contract_id).getSingleResult(false); + }else if("LetterApprova".equals(flagType)){ + DOCRELATIVE=bom.createQuery("PROJ_ID=:projectId and objecttype='LetterApprova' ").setParameter("projectId",ProjectId).getSingleResult(false); + }else{ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%打印催款函%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + } + if (DOCRELATIVE != null) { + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); + libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); + } + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; + String info=""; + try{ + info = libraryid + "@" + libraryid+"@"+flagType; + //获取需要盖章的文件信息 + Map map=new HashMap(); + bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); + if(bo != null){ + id = bo.getAttribute("id").toString(); + con = new ContractSignInfo(); + con.setFileid(id); + con.setFilename(bo.getAttribute("FILENAME").toString()); + String makefullPath = bo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(info, con); + Map resultMap = null; + resultMap = requestService.createPaymentofHireSign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + contract_id = resultMap.get(key); + } + } + } else { + return "error"; + } + } + if (bo != null) { + Map map1 = new HashMap(); + map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); + Map result1 = requestService.downloadDoc(map1); + if (!result1.containsKey("error")) { + for (String contractId : map1.keySet()) { + try { + if ("success".equals(result1.get(contractId))) { + String fileString = result1.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result1.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + } else { + return "error"; + } + } else { + return "error"; + } + + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + } + + + + /*** + * 已经生成的合同,作废, + * @param tx + * @return + * @throws JBOException + */ + + public String updateDocContractStatus(JBOTransaction tx) throws JBOException{ +// BizObjectManager attBom=JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME,tx);ProjectId + BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx); + try{ +// BizObject lcl = lclManager.createQuery("file_flag='yes' and attribute_id='"+file_id+"'").getSingleResult(true); + + lclManager.createQuery("update O set file_flag='no',message='1' where attribute_id=:attributeid").setParameter("attributeid",file_id).executeUpdate(); + lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",ProjectId).executeUpdate(); + //attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").executeUpdate(); + tx.commit(); + }catch(Exception e){ + tx.rollback(); + e.printStackTrace(); + System.out.println(e.getMessage()); + return "error"; + } + return "success"; + } + + public String companyUpdateDocContractStatus(JBOTransaction tx) throws Exception{ + BizObjectManager fboManger=JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME,tx); + BizObjectManager lctManger=JBOFactory.getBizObjectManager(LB_CONTRACT_TEMPLATE.CLASS_NAME,tx); + BizObject fbo = fboManger.createQuery("flow_unid=:flowunid").setParameter("flowunid",FlowUnid).getSingleResult(false); + BizObject lct = lctManger.createQuery("Contract_id=:contractid").setParameter("contractid", fbo.getAttribute("CONTRACT_ID").getString()).getSingleResult(false); + String attId = ContractTemplateCache.getContractTemplateID(lct.getAttribute("ID").getString()); + lctManger.deleteObject(lct); + BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx); + BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx); + try{ + lclManager.createQuery("update O set file_flag='no',message='1' where attribute_id=:attributeid").setParameter("attributeid",attId).executeUpdate(); + lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",ProjectId).executeUpdate(); + //attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").executeUpdate(); + tx.commit(); + }catch(Exception e){ + tx.rollback(); + e.printStackTrace(); + System.out.println(e.getMessage()); + return "error"; + } + return "success"; + } + + /** + * 传统合同盖章 + * @param tx + * @return + * @throws Exception + + */ + public String TcollectionSignA(JBOTransaction tx) throws Exception { + requestService = (HttpRequestAppService) factory.create(HttpRequestAppService.class, this.getConfigRequestUrl()); + String libraryid=""; + BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE = null; + if("transfer".equals(flagType)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='transfer' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("AdjustmentNotice".equals(flagType)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='AdjustmentNotice' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("TriditionCollection".equals(flagType)){ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype='TriditionCollection' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + }else if("TriditionSuspension".equals(flagType)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='TriditionSuspension' and FLOW_UNID=:flowunid ").setParameter("flowunid",FlowUnid).getSingleResult(false); + }else if("settletradition".equals(flagType)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='settletradition' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contract_id).getSingleResult(false); + }else if("LoanNotice".equals(flagType)){ + DOCRELATIVE=bom.createQuery(" OBJECTTYPE='LoanNotice' and PROJ_ID=:projectId ").setParameter("projectId",ProjectId).getSingleResult(false); + }else{ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number and objecttype LIKE '%打印催款函%' ").setParameter("plan_number",PAYMENT_NUMBER).getSingleResult(false); + } + if (DOCRELATIVE != null) { + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + BizObjectManager bom1=JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); + libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); + } + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; + String info=""; + try{ + info = libraryid + "@" + libraryid+"@"+flagType; + //获取需要盖章的文件信息 + Map map=new HashMap(); + bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); + if(bo != null){ + id = bo.getAttribute("id").toString(); + con = new ContractSignInfo(); + con.setFileid(id); + con.setFilename(bo.getAttribute("FILENAME").toString()); + String makefullPath = bo.getAttribute("FULLPATH").toString(); + File file = new File(makefullPath); + if (!file.exists()) { + throw new RuntimeException("要读取的文件不存在"); + } + con.setInputfile(BASE64.encodeImgageToBase64(file)); + map.put(info, con); + Map resultMap = null; + resultMap = requestService.createPaymentofHireSign(map); + if (!resultMap.containsKey("error")) { + for (String key : resultMap.keySet()) { + if (key.indexOf("contract_") == -1) { + contract_id = resultMap.get(key); + } + } + } else { + return "error"; + } + } + if (bo != null) { + Map map1 = new HashMap(); + map1.put(contract_id, bo.getAttribute("FULLPATH").toString()); + Map result1 = requestService.downloadDoc(map1); + if (!result1.containsKey("error")) { + for (String contractId : map1.keySet()) { + try { + if ("success".equals(result1.get(contractId))) { + String fileString = result1.get("file_" + contractId); + InputStream fileInput = BASE64.encodeFileToBase64(fileString); + OutputStream fileOut = new FileOutputStream(map1.get(contractId));// TODO + byte[] buffByte = new byte[1024]; + int size = 0; + while ((size = fileInput.read(buffByte)) != -1) { + fileOut.write(buffByte, 0, size); + } + fileInput.close(); + fileOut.close(); + } else if ("error".equals(result1.get(contractId))) { + return "error"; + } + } catch (Exception e) { + e.printStackTrace(); + + } + } + } else { + return "error"; + } + } else { + return "error"; + } + + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "error"; + } + } + //生成一维 + public String SystemMakeOneDimensionalCode(JBOTransaction tx){ + Configure CurConfig = Configure.getInstance(); + try { + String diskPath=CurConfig.getConfigure("OneDimensionalCode"); + MakeOneCodeAndContractModel mocacm = new MakeOneCodeAndContractModel(); + BizObjectManager loManage = JBOFactory.getBizObjectManager(LB_ONEDIMENSIONALCODE.CLASS_NAME,tx); + BizObject lom = loManage.createQuery(" PROJECT_ID=:projectid and CONTRACT_NO=:contractNo and CONTRACT_ID=:contractId").setParameter("projectid", ProjectId).setParameter("contractNo", contractNo).setParameter("contractId", contract_id).getSingleResult(false); + if(lom == null){ + //生成一维码 + mocacm.MOneDimensionalCode(contractNo, contract_id, ProjectId, diskPath, tx); + } + String outPdfFile = CurConfig.getConfigure("BQcontract"); + mocacm.pdfAndMark(outPdfFile, "", contract_id,leasform, tx); + }catch (Exception e) { + e.printStackTrace(); + return "error"; + } + return "success"; + } } \ No newline at end of file diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/MakingContractCarCheck.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/MakingContractCarCheck.java index f5997e2df..d5c56ba7d 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commcheck/MakingContractCarCheck.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/MakingContractCarCheck.java @@ -42,7 +42,7 @@ public class MakingContractCarCheck extends DefaultBussinessCheck { if(ldcl!=null){ BizObject psl = psltMange.createQuery("productid=:productid").setParameter("productid", lcit.getAttribute("PRODUCT_ID").getString()).getSingleResult(false); if(psl!=null){ - if("03".equals(ci.getAttribute("CUSTOMERTYPE").getString())&&!"BAIC_MOTOR".equals(psl.getAttribute("operationType").toString())&&!"DYCD".equals(psl.getAttribute("operationType").toString())&&!"ZYC".equals(psl.getAttribute("operationType").toString())&&!"KJZL".equals(psl.getAttribute("operationType").toString())){ + if("03".equals(ci.getAttribute("CUSTOMERTYPE").getString())&&!"BAIC_MOTOR".equals(psl.getAttribute("operationType").toString())&&!"DYCD".equals(psl.getAttribute("operationType").toString())&&!"ZYC".equals(psl.getAttribute("operationType").toString())&&!"KJZL".equals(psl.getAttribute("operationType").toString())&&!"KHSQ".equals(psl.getAttribute("operationType").toString())){ if("4".equals(ldcl.getAttribute("PROCESS").getString())){ putMsg("已完成电子签约!"); setPass(true); From d5e48cf45109f1ef8ac787c7628ac80ac0c45721 Mon Sep 17 00:00:00 2001 From: zhangjun Date: Mon, 24 Jun 2019 20:02:58 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=9F=E9=87=91?= =?UTF-8?q?=E6=9D=83=E9=99=90=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=82=AC=E6=94=B6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?jbo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rentcollection/CapgeminiReport.jsp | 3 +- .../rentcollection/ClearingDataReport.jsp | 3 +- .../rentcollection/DealerCollection.jsp | 102 ++++++++++++++++++ WebContent/WEB-INF/etc/jbo/jbo_customer.xml | 42 ++++---- 4 files changed, 127 insertions(+), 23 deletions(-) create mode 100644 WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/DealerCollection.jsp diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp index 5f980e2d1..d09d26ddb 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/CapgeminiReport.jsp @@ -36,7 +36,7 @@ if(roleList.contains("800R00000051")){ doTemp.appendJboWhere(" and O.distributor_no='"+distributor_no+"'"); - template = "cff950db664c4faeb1f4656629176004"; + template = "5addef5e8b56470688949d554cad4b24"; } ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); @@ -71,6 +71,7 @@ //生成文件关联关系 tempParam["OBJECTTYPE"]="经销商租金计划报表"; tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>"; + tempParam["distributor_no"]="<%=distributor_no%>"; //生成模板固定参数 tempParam["CurUserId"]="<%=CurUser.getUserID()%>"; diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp index d4a4b54c3..a81b101cc 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/ClearingDataReport.jsp @@ -36,7 +36,7 @@ if(roleList.contains("800R00000051")){ doTemp.appendJboWhere(" and O.distributor_no='"+distributor_no+"'"); - template = "6d2b46cb97c84867b38e1f39d4e9a092"; + template = "6a3c4a11c86048928d8823f796ee9423"; } ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); @@ -69,6 +69,7 @@ //生成文件关联关系 tempParam["OBJECTTYPE"]="经销商结清数据报表"; tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>"; + tempParam["distributor_no"]="<%=distributor_no%>"; //生成模板固定参数 tempParam["CurUserId"]="<%=CurUser.getUserID()%>"; diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/DealerCollection.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/DealerCollection.jsp new file mode 100644 index 000000000..28cd07a23 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/DealerCollection.jsp @@ -0,0 +1,102 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<% + /* + Author: undefined 2018-10-30 + Content: + History Log: + */ + String userid=CurUser.getUserID(); + ASObjectModel doTemp = new ASObjectModel("dealer_collection"); + + //加权限 + BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); + List roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).getResultList(false); + List roleList = new ArrayList(); + String roleid = ""; + for(BizObject bo : roleListObject){ + roleid = bo.getAttribute("roleid").toString(); + roleList.add(roleid); + } + + //导出模板编号 + String template = ""; + + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401") && !roleList.contains("800R00000051")){ + doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); + //导出有权限 + template = "05d55e01017a4d80945d5b6c8a8c5faf"; + }else{ + template = "05d55e01017a4d80945d5b6c8a8c5faf"; + } + String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'"); + String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'"); + + if(roleList.contains("800R00000051")){ + doTemp.appendJboWhere(" and O.distributor_no='"+distributor_no+"'"); + template = "c5af519f27ec4b62bacde30b0014f101"; + } + + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.ShowSummary="1"; //汇总 + dwTemp.setPageSize(10); + dwTemp.genHTMLObjectWindow(""); + + //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 + String sButtons[][] = { + //{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, + //{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, + {"true","","Button","导出excel","导出excel","exportExcel()","","","","btn_icon_up",""}, + //{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml index 4e35dbda9..03442445f 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml @@ -3183,41 +3183,41 @@ - - - + + - - - - - - + + - - - - - - - - + + + + + + + + + + - - + + + + + @@ -3235,8 +3235,8 @@ - + @@ -3265,7 +3265,6 @@ - @@ -3273,6 +3272,7 @@ + From 998c163dec6e53c279c7be9607baa14c0fdebd0e Mon Sep 17 00:00:00 2001 From: zhouyahui Date: Tue, 25 Jun 2019 10:54:52 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E4=B8=8D?= =?UTF-8?q?=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vehicleAssessmentController.java | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java b/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java index 32f454753..e7f35d935 100644 --- a/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java +++ b/src_tenwa/com/tenwa/lease/app/vehicleAssessment/vehicleAssessmentController.java @@ -52,29 +52,39 @@ public class vehicleAssessmentController { String area = boLSNT.getAttribute("zone").getString(); if(area.indexOf("上海") != -1){ area = "上海上海市"; - }else if(area.indexOf("重庆") != -1){ + } + if(area.indexOf("重庆") != -1){ area = "重庆重庆市"; - }else if(area.indexOf("北京") != -1){ + } + if(area.indexOf("北京") != -1){ area = "北京北京市"; - }else if(area.indexOf("天津") != -1){ + } + if(area.indexOf("天津") != -1){ //area = "天津市市辖区"; area = "天津天津市"; - }else if(area.indexOf("地区") != -1){ + } + if(area.indexOf("地区") != -1){ area = area.substring(0,area.indexOf("地区")+2); - }else if(area.indexOf("市") != -1){ + } + if(area.indexOf("市") != -1){ area = area.substring(0,area.indexOf("市")+1); - }else if(area.indexOf("区") != -1){ + } + if(area.indexOf("区") != -1){ area = area.substring(0,area.indexOf("区")+1); - }else if(area.indexOf("自治州") != -1){ + } + if(area.indexOf("自治州") != -1){ area = area.substring(0,area.indexOf("自治州")+3); - }else if(area.indexOf("自治县") != -1){ + } + if(area.indexOf("自治县") != -1){ area = area.substring(0,area.indexOf("自治县")+3); - }else if(area.indexOf("县") != -1){ + } + if(area.indexOf("县") != -1){ area = area.substring(0,area.indexOf("县")+1); - }else if(area.indexOf("盟") != -1){ + } + if(area.indexOf("盟") != -1){ area = area.substring(0,area.indexOf("盟")+1); } - else{ + if(area ==null ||"".equals(area)){ return "请返回租赁车辆基本信息页面填写地区!"; } //到数据字典中查询对应的行政编号作为接口入参的zone参数 From 96c8fd7ab782e66b07dc2ae2114148c57814685f Mon Sep 17 00:00:00 2001 From: xiezhiwen Date: Tue, 25 Jun 2019 15:10:11 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=86=E6=B4=BE?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=98=AF,=20=E4=BA=BA=E5=91=98=E6=9C=AA?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=95=B0=E9=87=8F=E4=B8=8D=E8=83=BD=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/amarsoft/app/flow/FlowAction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/amarsoft/app/flow/FlowAction.java b/src/com/amarsoft/app/flow/FlowAction.java index 132ce379e..aa7bc87ff 100644 --- a/src/com/amarsoft/app/flow/FlowAction.java +++ b/src/com/amarsoft/app/flow/FlowAction.java @@ -632,10 +632,11 @@ public class FlowAction { if(!"".equals(role)) { String now = StringFunction.getTodayNow().replaceAll(":", "△"); SqlObject sql = null; + ArrayList ss = user.getRoleTable(); if(user.getRoleTable().contains(role)) { sql = new SqlObject(("insert into user_task_data " - + "select sys_guid() ,'" + AssignmentId + "', roleid, flowno, flowunid, project_id, contract_id, '" + now + "', endtime," - + " 'approve_status03', taskno" + + "select REPLACE(UUID(), '-', '') ,'" + AssignmentId + "', roleid, flowno, flowunid, project_id, contract_id, '" + now + "', endtime," + + " 'approve_status01', taskno" + " from user_task_data where userid = '" + userID + "' and taskno = '" + taskNo + "' and (status = 'approve_status01' or status = 'approve_status03')")); sql.setDebugSql(sql.getDebugSql().replaceAll("△", ":")); sql.setOriginalSql(sql.getOriginalSql().replaceAll("△", ":")); From 876e0940c14d02ffe172238cbfd3a28c1c8893ad Mon Sep 17 00:00:00 2001 From: xiezhiwen Date: Thu, 27 Jun 2019 11:40:15 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=87=AD=E8=AF=81=E7=9B=B8=E5=85=B3-?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E4=BF=A1=E6=81=AF=E4=BC=A0NC=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=86=85=E9=83=A8=E5=AE=A2=E5=95=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/tenwa/voucher/serviceImp/VoucherToNCforCustomer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_core/com/tenwa/voucher/serviceImp/VoucherToNCforCustomer.java b/src_core/com/tenwa/voucher/serviceImp/VoucherToNCforCustomer.java index 4f6086047..9730cb264 100644 --- a/src_core/com/tenwa/voucher/serviceImp/VoucherToNCforCustomer.java +++ b/src_core/com/tenwa/voucher/serviceImp/VoucherToNCforCustomer.java @@ -133,7 +133,7 @@ public class VoucherToNCforCustomer implements Job{ String year_month_days = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); // 查询为传输或之前传输失败的数据 - String sql="SELECT max(cif.customerid) id,cif.customer_num,MAX(cif.customername)customername,MAX(cif.customertype)customertype,MAX(cif.customerid) customerid,MAX(cif.certid) as certid FROM CUSTOMER_INFO cif LEFT JOIN lb_union_lessee lul ON lul.customer_id=cif.customerid LEFT JOIN lb_contract_info lci ON lci.id=lul.contract_id WHERE lci.contract_status >='31' AND cif.customer_num NOT IN (SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG = '1' AND XML_TYPE = '"+type+"') GROUP BY CIF.CUSTOMER_NUM "; + String sql="SELECT MAX(cif.customerid) id,cif.customer_num,MAX(cif.customername) customername,MAX(cif.customertype) customertype,MAX(cif.customerid) customerid, MAX(cif.certid) AS certid FROM CUSTOMER_INFO cif LEFT JOIN lb_union_lessee lul ON lul.customer_id = cif.customerid LEFT JOIN lb_contract_info lci ON lci.id = lul.contract_id WHERE lci.contract_status >= '31' AND cif.customer_num NOT IN (SELECT TABLE_NUM FROM NCXML_DETAIL_RECORDS WHERE FLAG = '1' AND XML_TYPE = 'customer') AND cif.customer_num NOT IN (SELECT cust_id FROM CUSTOMER_LIST WHERE CUST_STATUS = '2' ) GROUP BY CIF.CUSTOMER_NUM "; List> rs = DataOperatorUtil.getDataBySql(Sqlca,sql,null); if(rs != null && rs.size()>0) { // 批次号 From e448bef5975d4ed23306cd9f95b586ed44e559fe Mon Sep 17 00:00:00 2001 From: tangfutang Date: Thu, 27 Jun 2019 15:19:04 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=B9=BF=E5=B7=9E=E9=93=B6=E8=81=94?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=A0=E5=AF=86=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cache/CollectAuditProcess.java | 427 +++++++++--------- .../cache/MySecureProtocolSocketFactory.java | 97 ++++ .../cache/MyX509TrustManager.java | 28 ++ 3 files changed, 343 insertions(+), 209 deletions(-) create mode 100644 src_tenwa/com/tenwa/collectaudit/cache/MySecureProtocolSocketFactory.java create mode 100644 src_tenwa/com/tenwa/collectaudit/cache/MyX509TrustManager.java diff --git a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditProcess.java b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditProcess.java index 35c7580af..01796fb84 100644 --- a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditProcess.java +++ b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditProcess.java @@ -1,209 +1,218 @@ -package com.tenwa.collectaudit.cache; -import java.io.IOException; - -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.params.HttpMethodParams; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import com.amarsoft.app.awe.config.InitCollectConfig; -import com.gnete.security.crypt.Crypt; -import com.gnete.security.crypt.CryptException; - -/** - * 新签名包测试用例(依赖新签名包gnete-bc-139.jar与gnete-security.jar) - */ -public class CollectAuditProcess { - - private static Log log = LogFactory.getLog(CollectAuditProcess.class); - - /** - *代收付代收、代付交易测试URL - */ - //private static final String SERVER_URL = "http://59.41.103.98:333/gzdsf/ProcessServlet"; - - //代收付签约、银行卡验证交易测试URL - //private static final String SERVER_URL = "http://59.41.103.98:9110/gzdsf/ProcessServlet"; - - -/* public static void main(String[] args) throws CryptException { - CollectAuditProcess tp = new CollectAuditProcess( ); - tp.CollectAuditPayReq(); - } - */ - /** - * 验证签名信息 - * @throws CryptException - */ - private boolean verifySign(String strXML) throws CryptException { - //签名(代收付系统JDK环境使用GBK编码,商户使用签名包时需传送GBK编码集) - Crypt crypt = new Crypt("gbk" ); - String pathCer = InitCollectConfig.PUBLICKEYURL; - //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\gzdsf.cer"; - int iStart = strXML.indexOf(""); - if (iStart != -1) { - int end = strXML.indexOf(""); - String signedMsg = strXML.substring(iStart+12, end); - log.info(signedMsg); - String strMsg = strXML.substring(0, iStart) + strXML.substring(end+13); - //调用签名包验签接口(原文,签名,公钥路径) - if (crypt.verify(strMsg,signedMsg, pathCer)){ - log.info("verify ok"); - return true; - } - else { - log.error("verify error"); - return false; - } - } - return true; - } - - /** - * 数据签名 - * comment here - * @param strData - * @return - * @throws CryptException - * @since gnete-ora 0.0.0.1 - */ - private String signMsg(String strData) throws CryptException { - String strRnt = ""; - //签名(代收付系统JDK环境使用GBK编码,商户使用签名包时需传送GBK编码集) - Crypt crypt = new Crypt("gbk"); - String pathPfx = InitCollectConfig.PRIVATEKEYURL; - //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\cps@00019140020764901.p12"; - //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\ORA@TEST1.p12"; - String strMsg = strData.replaceAll("", ""); - //调用签名包签名接口(原文,私钥路径,密码) - String signedMsg = crypt.sign(strMsg, pathPfx, "123456"); - return strData.replaceAll("", ""+signedMsg+""); - } - - /** - * 测试请求 - * comment here - * @throws CryptException - * @since gnete-ora 0.0.0.1 - */ - protected String CollectAuditPayReq(StringBuffer sendXml,String fileSavePath,String fileName) throws CryptException { - String strSendData = sendXml.toString(); - HttpClient httpClient = new HttpClient( ); - PostMethod postMethod = - new PostMethod(InitCollectConfig.C_SERVERURL); - //设置编码 - httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK"); - strSendData = this.signMsg(strSendData); - log.info(strSendData); - System.out.println("发送报文:"+strSendData); - InterFaceFileCreate.sendDiscFileCreate(strSendData, fileSavePath, fileName); - postMethod.setRequestBody(strSendData); - try { - long start = System.currentTimeMillis(); - //执行getMethod - int statusCode = httpClient.executeMethod(postMethod); - System.out.println("cost:"+(System.currentTimeMillis()-start)); - //失败 - if (statusCode != HttpStatus.SC_OK) { - log.error( - "Method failed: " + postMethod.getStatusLine()); - //读取内容 - byte[] responseBody = postMethod.getResponseBody(); - //处理内容 - String strResp = new String(responseBody, "GBK"); - log.error(strResp); - return strResp; - } - else { - //读取内容 - byte[] responseBody = postMethod.getResponseBody(); - String strResp = new String(responseBody, "GBK"); - log.info("服务器返回:" + strResp); - InterFaceFileCreate.replyDiscFileCreate(strResp, fileSavePath, fileName); - System.out.println("服务器返回:" + strResp); - //验签 - if (this.verifySign(strResp)) { - log.info("验签正确,处理服务器返回的报文"); - } - return strResp; - } - } catch (HttpException e) { - //发生致命的异常,可能是协议不对或者返回的内容有问题 - log.error("Please check your provided http address!", e); - e.printStackTrace( ); - } catch (IOException e) { - //发生网络异常 - log.error(e); - } catch (Exception e) { - log.error(null, e); - } finally { - //释放连接 - postMethod.releaseConnection(); - } - return ""; - } - /** - * 测试验证银行卡二、三、四要素请求 - * comment here - * @throws CryptException - * @since gnete-ora 0.0.0.1 - */ - protected String CollectAuditVerifyReq(StringBuffer sendXml) throws CryptException { - String strSendData = sendXml.toString(); - HttpClient httpClient = new HttpClient(); - PostMethod postMethod = - new PostMethod(InitCollectConfig.B_SERVERURL); - //设置编码 - httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK"); - strSendData = this.signMsg(strSendData); - log.info(strSendData); - System.out.println("发送报文:"+strSendData); - postMethod.setRequestBody(strSendData); - try { - long start = System.currentTimeMillis(); - //执行getMethod - int statusCode = httpClient.executeMethod(postMethod); - System.out.println("cost:"+(System.currentTimeMillis()-start)); - //失败 - if (statusCode != HttpStatus.SC_OK) { - log.error( - "Method failed: " + postMethod.getStatusLine()); - //读取内容 - byte[] responseBody = postMethod.getResponseBody(); - //处理内容 - String strResp = new String(responseBody, "GBK"); - log.error(strResp); - return strResp; - } - else { - //读取内容 - byte[] responseBody = postMethod.getResponseBody(); - String strResp = new String(responseBody, "GBK"); - log.info("服务器返回:" + strResp); - System.out.println("服务器返回:" + strResp); - //验签 - if (this.verifySign(strResp)) { - log.info("验签正确,处理服务器返回的报文"); - } - return strResp; - } - } catch (HttpException e) { - //发生致命的异常,可能是协议不对或者返回的内容有问题 - log.error("Please check your provided http address!", e); - e.printStackTrace( ); - } catch (IOException e) { - //发生网络异常 - log.error(e); - } catch (Exception e) { - log.error(null, e); - } finally { - //释放连接 - postMethod.releaseConnection(); - } - return ""; - } - - -} +package com.tenwa.collectaudit.cache; +import java.io.IOException; + +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.params.HttpMethodParams; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.httpclient.protocol.Protocol; +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; +import com.amarsoft.app.awe.config.InitCollectConfig; +import com.gnete.security.crypt.Crypt; +import com.gnete.security.crypt.CryptException; + + +/** + * 新签名包测试用例(依赖新签名包gnete-bc-139.jar与gnete-security.jar) + */ +public class CollectAuditProcess { + + private static Log log = LogFactory.getLog(CollectAuditProcess.class); + + /** + *代收付代收、代付交易测试URL + */ + //private static final String SERVER_URL = "http://59.41.103.98:333/gzdsf/ProcessServlet"; + + //代收付签约、银行卡验证交易测试URL + //private static final String SERVER_URL = "http://59.41.103.98:9110/gzdsf/ProcessServlet"; + + +/* public static void main(String[] args) throws CryptException { + CollectAuditProcess tp = new CollectAuditProcess( ); + tp.CollectAuditPayReq(); + } + */ + /** + * 验证签名信息 + * @throws CryptException + */ + private boolean verifySign(String strXML) throws CryptException { + //签名(代收付系统JDK环境使用GBK编码,商户使用签名包时需传送GBK编码集) + Crypt crypt = new Crypt("gbk" ); + String pathCer = InitCollectConfig.PUBLICKEYURL; + //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\gzdsf.cer"; + int iStart = strXML.indexOf(""); + if (iStart != -1) { + int end = strXML.indexOf(""); + String signedMsg = strXML.substring(iStart+12, end); + log.info(signedMsg); + String strMsg = strXML.substring(0, iStart) + strXML.substring(end+13); + //调用签名包验签接口(原文,签名,公钥路径) + if (crypt.verify(strMsg,signedMsg, pathCer)){ + log.info("verify ok"); + return true; + } + else { + log.error("verify error"); + return false; + } + } + return true; + } + + /** + * 数据签名 + * comment here + * @param strData + * @return + * @throws CryptException + * @since gnete-ora 0.0.0.1 + */ + private String signMsg(String strData) throws CryptException { + String strRnt = ""; + //签名(代收付系统JDK环境使用GBK编码,商户使用签名包时需传送GBK编码集) + Crypt crypt = new Crypt("gbk"); + String pathPfx = InitCollectConfig.PRIVATEKEYURL; + //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\cps@00019140020764901.p12"; + //"D:\\BaiduNetdisk\\Download\\代收付系统接口文档和JAVA版测试demo及测试相关参数\\JAVA版测试DEMO及测试参数_20170825\\测试商户证书\\ORA@TEST1.p12"; + String strMsg = strData.replaceAll("", ""); + //调用签名包签名接口(原文,私钥路径,密码) + String signedMsg = crypt.sign(strMsg, pathPfx, "123456"); + return strData.replaceAll("", ""+signedMsg+""); + } + + /** + * 测试请求 + * comment here + * @throws CryptException + * @since gnete-ora 0.0.0.1 + */ + protected String CollectAuditPayReq(StringBuffer sendXml,String fileSavePath,String fileName) throws CryptException { + String strSendData = sendXml.toString(); + HttpClient httpClient = new HttpClient( ); + PostMethod postMethod = + new PostMethod(InitCollectConfig.C_SERVERURL); + //设置编码 + httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK"); + + //新加入代码 + ProtocolSocketFactory fcty = new MySecureProtocolSocketFactory(); + //加入相关的https请求方式 + Protocol.registerProtocol("https", new Protocol("https", fcty, 443)); + + strSendData = this.signMsg(strSendData); + log.info(strSendData); + System.out.println("发送报文:"+strSendData); + InterFaceFileCreate.sendDiscFileCreate(strSendData, fileSavePath, fileName); + postMethod.setRequestBody(strSendData); + try { + long start = System.currentTimeMillis(); + //执行getMethod + int statusCode = httpClient.executeMethod(postMethod); + System.out.println("cost:"+(System.currentTimeMillis()-start)); + //失败 + if (statusCode != HttpStatus.SC_OK) { + log.error( + "Method failed: " + postMethod.getStatusLine()); + //读取内容 + byte[] responseBody = postMethod.getResponseBody(); + //处理内容 + String strResp = new String(responseBody, "GBK"); + log.error(strResp); + return strResp; + } + else { + //读取内容 + byte[] responseBody = postMethod.getResponseBody(); + String strResp = new String(responseBody, "GBK"); + log.info("服务器返回:" + strResp); + InterFaceFileCreate.replyDiscFileCreate(strResp, fileSavePath, fileName); + System.out.println("服务器返回:" + strResp); + //验签 + if (this.verifySign(strResp)) { + log.info("验签正确,处理服务器返回的报文"); + } + return strResp; + } + } catch (HttpException e) { + //发生致命的异常,可能是协议不对或者返回的内容有问题 + log.error("Please check your provided http address!", e); + e.printStackTrace( ); + } catch (IOException e) { + //发生网络异常 + log.error(e); + } catch (Exception e) { + log.error(null, e); + } finally { + //释放连接 + postMethod.releaseConnection(); + } + return ""; + } + /** + * 测试验证银行卡二、三、四要素请求 + * comment here + * @throws CryptException + * @since gnete-ora 0.0.0.1 + */ + protected String CollectAuditVerifyReq(StringBuffer sendXml) throws CryptException { + String strSendData = sendXml.toString(); + HttpClient httpClient = new HttpClient(); + PostMethod postMethod = + new PostMethod(InitCollectConfig.B_SERVERURL); + //设置编码 + httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"GBK"); + strSendData = this.signMsg(strSendData); + log.info(strSendData); + System.out.println("发送报文:"+strSendData); + postMethod.setRequestBody(strSendData); + try { + long start = System.currentTimeMillis(); + //执行getMethod + int statusCode = httpClient.executeMethod(postMethod); + System.out.println("cost:"+(System.currentTimeMillis()-start)); + //失败 + if (statusCode != HttpStatus.SC_OK) { + log.error( + "Method failed: " + postMethod.getStatusLine()); + //读取内容 + byte[] responseBody = postMethod.getResponseBody(); + //处理内容 + String strResp = new String(responseBody, "GBK"); + log.error(strResp); + return strResp; + } + else { + //读取内容 + byte[] responseBody = postMethod.getResponseBody(); + String strResp = new String(responseBody, "GBK"); + log.info("服务器返回:" + strResp); + System.out.println("服务器返回:" + strResp); + //验签 + if (this.verifySign(strResp)) { + log.info("验签正确,处理服务器返回的报文"); + } + return strResp; + } + } catch (HttpException e) { + //发生致命的异常,可能是协议不对或者返回的内容有问题 + log.error("Please check your provided http address!", e); + e.printStackTrace( ); + } catch (IOException e) { + //发生网络异常 + log.error(e); + } catch (Exception e) { + log.error(null, e); + } finally { + //释放连接 + postMethod.releaseConnection(); + } + return ""; + } + + +} diff --git a/src_tenwa/com/tenwa/collectaudit/cache/MySecureProtocolSocketFactory.java b/src_tenwa/com/tenwa/collectaudit/cache/MySecureProtocolSocketFactory.java new file mode 100644 index 000000000..b50613e9b --- /dev/null +++ b/src_tenwa/com/tenwa/collectaudit/cache/MySecureProtocolSocketFactory.java @@ -0,0 +1,97 @@ +package com.tenwa.collectaudit.cache; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.Socket; +import java.net.UnknownHostException; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import org.apache.commons.httpclient.ConnectTimeoutException; +import org.apache.commons.httpclient.HttpClientError; +import org.apache.commons.httpclient.params.HttpConnectionParams; +import org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory; +import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; + +public class MySecureProtocolSocketFactory implements SecureProtocolSocketFactory { + + //这里添加一个属性,主要目的就是来获取ssl跳过验证 + private SSLContext sslContext = null; + /** + * Constructor for MySecureProtocolSocketFactory. + */ + public MySecureProtocolSocketFactory() { + } + /** + * 这个创建一个获取SSLContext的方法,导入MyX509TrustManager进行初始化 + * @return + */ + private static SSLContext createEasySSLContext() { + try { + SSLContext context = SSLContext.getInstance("TLSv1.2"); + context.init(null, new TrustManager[] { new MyX509TrustManager() }, + null); + return context; + } catch (Exception e) { + throw new HttpClientError(e.toString()); + } + } + + /** + * 判断获取SSLContext + * @return + */ + private SSLContext getSSLContext() { + if (this.sslContext == null) { + this.sslContext = createEasySSLContext(); + } + return this.sslContext; + } + //后面的方法基本上就是带入相关参数就可以了 + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, + * int, java.net.InetAddress, int) + */ + public Socket createSocket(String host, int port, InetAddress clientHost,int clientPort) throws IOException, UnknownHostException { + return getSSLContext().getSocketFactory().createSocket(host, port,clientHost, clientPort); + } + + /* + * (non-Javadoc) + * + * @see org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, + * int, java.net.InetAddress, int, + * org.apache.commons.httpclient.params.HttpConnectionParams) + */ + public Socket createSocket(final String host, final int port,final InetAddress localAddress, final int localPort, + final HttpConnectionParams params) throws IOException,UnknownHostException, ConnectTimeoutException { + if (params == null) { + throw new IllegalArgumentException("Parameters may not be null"); + } + int timeout = params.getConnectionTimeout(); + if (timeout == 0) { + return createSocket(host, port, localAddress, localPort); + } else { + return ControllerThreadSocketFactory.createSocket(this, host, port,localAddress, localPort, timeout); + } + } + + /* + * (non-Javadoc) + * + * @see SecureProtocolSocketFactory#createSocket(java.lang.String,int) + */ + public Socket createSocket(String host, int port) throws IOException,UnknownHostException { + return getSSLContext().getSocketFactory().createSocket(host, port); + } + + /* + * (non-Javadoc) + * + * @see SecureProtocolSocketFactory#createSocket(java.net.Socket,java.lang.String,int,boolean) + */ + public Socket createSocket(Socket socket, String host, int port,boolean autoClose) throws IOException, UnknownHostException { + return getSSLContext().getSocketFactory().createSocket(socket, host,port, autoClose); + } +} diff --git a/src_tenwa/com/tenwa/collectaudit/cache/MyX509TrustManager.java b/src_tenwa/com/tenwa/collectaudit/cache/MyX509TrustManager.java new file mode 100644 index 000000000..a013e2c01 --- /dev/null +++ b/src_tenwa/com/tenwa/collectaudit/cache/MyX509TrustManager.java @@ -0,0 +1,28 @@ +package com.tenwa.collectaudit.cache; + +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import javax.net.ssl.X509TrustManager; + +public class MyX509TrustManager implements X509TrustManager { + /* (non-Javadoc) + * @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], java.lang.String) + */ + public void checkClientTrusted(X509Certificate[] arg0, String arg1) + throws CertificateException { + + } + /* (non-Javadoc) + * @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String) + */ + public void checkServerTrusted(X509Certificate[] arg0, String arg1) + throws CertificateException { + + } + /* (non-Javadoc) + * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers() + */ + public X509Certificate[] getAcceptedIssuers() { + return null; + } +} \ No newline at end of file