diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp index 1c3d01677..8138f051d 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp @@ -25,8 +25,9 @@ //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 String sButtons[][] = { - {"true","","Button","生成催收函","生成催收函","viewAndEdit()","","","","btn_icon_transfer",""}, - {"true","","Button","批量下载","批量下载","lotdown()","","","","btn_icon_transfer",""} + {"true","","Button","生成催收函","生成催收函","exportExcel('1')","","","","btn_icon_transfer",""}, + {"true","","Button","批量下载","批量下载","lotdown()","","","","btn_icon_transfer",""}, + {"true","All","Button","生成电子章","盖公司电子章","stamp()","","","",""}, }; %><%@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/src/com/tenwa/channelportal/action/ContractSignAction.java b/src/com/tenwa/channelportal/action/ContractSignAction.java index 5643df340..a7e1bad71 100644 --- a/src/com/tenwa/channelportal/action/ContractSignAction.java +++ b/src/com/tenwa/channelportal/action/ContractSignAction.java @@ -1461,7 +1461,13 @@ public void wordToPdfJar(JBOTransaction tx){ 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); + BizObject DOCRELATIVE = null; + if("null".equals(PLAN_LIST)){ + DOCRELATIVE=bom.createQuery("plan_number=:plan_number").setParameter("plan_number",PAYMENT_NUMBER).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(); @@ -1996,6 +2002,98 @@ public String claimSign(JBOTransaction tx) throws Exception { } } + + /** + * 打印租金通知书并发短信给客户 + * @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=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