diff --git a/WebContent/Accounting/LoanSimulation_dormant/RentDormantExtensionPeriodFile.jsp b/WebContent/Accounting/LoanSimulation_dormant/RentDormantExtensionPeriodFile.jsp new file mode 100644 index 000000000..83f647831 --- /dev/null +++ b/WebContent/Accounting/LoanSimulation_dormant/RentDormantExtensionPeriodFile.jsp @@ -0,0 +1,148 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@ page import="com.tenwa.doc.action.DocListInitAction" %> +<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %> +<%@ page import="com.amarsoft.app.util.*" %> + +<% + String userId = CurUser.getUserID(); + String orgId =CurUser.getOrgID(); + System.out.print(orgId); + String falg = "true"; + String flowunid = CurPage.getParameter("FlowUnid"); + System.out.println("----------------------flowunid=" + flowunid); + BizObject condition = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP","flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); + String projectId = condition.getAttribute("PROJECT_ID").getString(); + String contractId = condition.getAttribute("CONTRACT_ID").getString(); +// System.out.println("----------------------contractId=" + contractId); +// BizObject lrdBo = JBOFactory.createBizObjectQuery("jbo.app.tenwa.calc.LB_RENT_DORMANT","FLOWUNID=:flowunid").setParameter("flowunid", flowunid).getSingleResult(false); +// String contractNo = ""; +// if(lrdBo != null){ +// contractNo = lrdBo.getAttribute("rent_dormant_num").getString(); +// } + String compClientID = request.getParameter("CompClientID"); + ASObjectModel doTemp = new ASObjectModel("RentDormantExtensionPeriodFile"); + doTemp.setDefaultValue("FlowUnid", flowunid); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + dwTemp.ReadOnly = "1"; + dwTemp.setPageSize(15); + dwTemp.MultiSelect = true; + dwTemp.genHTMLObjectWindow(flowunid); + + //0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格 + String sButtons[][] =null; + sButtons=new String[][]{ +// {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, + {falg,"All","Button","休眠展期协议生成","休眠展期协议生成","generateQuotation()","","","","btn_icon_generate"}, +// {"true","All","Button","批量下载","批量下载","lotdown()","","","","btn_icon_down"}, +// {falg,"All","Button","公司盖章","公司盖章","stamp()","","","",""}, + }; +%> + +<%/*~BEGIN~不可编辑区~[Editable=false;CodeAreaID=List05;Describe=主体页面;]~*/%> +<%@include file="/Frame/resources/include/ui/include_list.jspf"%> +<%/*~END~*/%> + +
+
+ +
+
+ +<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List06;Describe=定义按钮事件;]~*/%> + +<%/*~END~*/%> + + + + +<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List07;Describe=自定义函数;]~*/%> + +<%/*~END~*/%> + + + + +<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List08;Describe=页面装载时,进行初始化;]~*/%> + +<%/*~END~*/%> +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml index ed8636251..15e42feff 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml @@ -4639,6 +4639,23 @@ + + + + + + + + + + + + + + + + + diff --git a/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodAction.java b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodAction.java new file mode 100644 index 000000000..c06c57c89 --- /dev/null +++ b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodAction.java @@ -0,0 +1,116 @@ +package com.tenwa.channelportal.action.alpha; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.reckon.util.UUIDUtil; +import com.tenwa.util.SerialNumberUtil; +import jbo.app.tenwa.calc.LB_RENT_DORMANT_EXTENSION_PERIOD; +import org.apache.commons.lang3.StringUtils; + +/** + * 休眠还款申请-信息保存 + */ +public class RentDormantExtensionPeriodAction { + + String flowUnid;;//流程编号 + + + public String getFlowUnid() { + return flowUnid; + } + + public void setFlowUnid(String flowUnid) { + this.flowUnid = flowUnid; + } + + /** + * 休眠还款信息保存 + * @param tx + * @throws Exception + */ + public String saveRentDormantExtensionPeriodAction(JBOTransaction tx) throws Exception{ + String res = ""; + try { + String contractDate="contractDate"; + String zcContractNum="zcContractNum"; + System.out.println("saveRentDormantAction-----------------------flowUnid="+flowUnid); + BizObjectManager lcctBm = JBOFactory.getBizObjectManager(jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP.CLASS_NAME); + BizObject lcctBo = lcctBm.createQuery("FLOWUNID=:FLOWUNID ") + .setParameter("FLOWUNID", flowUnid).getSingleResult(false); + String contractId = lcctBo.getAttribute("CONTRACT_ID").getString(); + BizObjectManager lciBm = JBOFactory.getBizObjectManager(jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO.CLASS_NAME); + BizObject lciBo = lciBm.createQuery("ID=:CONTRACT_ID ") + .setParameter("CONTRACT_ID", contractId).getSingleResult(false); + String contractNo = lciBo.getAttribute("CONTRACT_NO").getString(); + String projectId = lciBo.getAttribute("PROJECT_ID").getString(); + zcContractNum = lciBo.getAttribute("ZC_CONTRACT_NUMBER").getString(); + System.out.println("saveRentDormantAction-----------------------contractNo="+contractNo); + System.out.println("saveRentDormantAction-----------------------contractNo2="+contractNo); + System.out.println("saveRentDormantAction-----------------------zcContractNum="+zcContractNum); + String rentDormantNum = null; + String contractDate2 = null; + String zcContractNum2 = null; + String rentDormantId = null; + // TODO: 2022/2/15 休眠还款信息保存 + BizObjectManager bomLRD = JBOFactory.getFactory().getManager(LB_RENT_DORMANT_EXTENSION_PERIOD.CLASS_NAME,tx); + BizObject bolLRD = bomLRD.createQuery("FLOWUNID=:FLOWUNID ") + .setParameter("FLOWUNID", flowUnid).getSingleResult(true); + if(bolLRD != null){ + rentDormantNum = bolLRD.getAttribute("rent_dormant_num").getString(); + contractDate2 = bolLRD.getAttribute("contract_date").getString(); + zcContractNum2 = bolLRD.getAttribute("zc_contract_num").getString(); + rentDormantId = bolLRD.getAttribute("ID").getString(); + if(rentDormantNum != null){ + if(contractDate2 == null || StringUtils.isEmpty(contractDate2) || !contractDate2.equals(contractDate) + || zcContractNum2 == null || StringUtils.isEmpty(zcContractNum2) || !zcContractNum2.equals(zcContractNum)){ + bolLRD.setAttributeValue("contract_date", contractDate); + bolLRD.setAttributeValue("zc_contract_num", zcContractNum); + bomLRD.saveObject(bolLRD);//修改数据 + } + return rentDormantNum; + } + } + rentDormantNum = createContractNo(lciBo, tx); + bolLRD = bomLRD.newObject(); + bolLRD.setAttributeValue("ID", UUIDUtil.getUUID()); + bolLRD.setAttributeValue("PROJECT_ID", projectId); + bolLRD.setAttributeValue("CONTRACT_ID", contractId); + bolLRD.setAttributeValue("FLOWUNID", flowUnid); + bolLRD.setAttributeValue("rent_dormant_num", rentDormantNum); + bolLRD.setAttributeValue("contract_date", contractDate); + bolLRD.setAttributeValue("zc_contract_num", zcContractNum); + bomLRD.saveObject(bolLRD); + res = rentDormantNum; + }catch (Exception e){ + e.printStackTrace(); + } + return res; + } + + /** + * 休眠还款协议生成 + * @return + */ + private String createContractNo(BizObject lciBo, JBOTransaction tx) throws Exception{ + String area_code=lciBo.getAttribute("AREA_CODE").getString(); + String subjectid=lciBo.getAttribute("subjectid").getString(); + String dept="BQAP("; + if(area_code.equals(null)||area_code.equals("")){ + area_code="0"; + } + dept+="A"; + if(lciBo.getAttribute("LEAS_FORM").toString().equals("01")){//直租 + dept+="Z"; + }else{//回租 + dept+="H"; + } + if("d989246c11c111eaaa0000163e0e11e6".equals(subjectid)){ + dept+=")TJ"; + }else{ + dept+=")SZ"; + } + return SerialNumberUtil.getContractSerialNaumber(dept,area_code, tx); + } +} \ No newline at end of file diff --git a/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodDeleteAction.java b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodDeleteAction.java new file mode 100644 index 000000000..72d1e4162 --- /dev/null +++ b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodDeleteAction.java @@ -0,0 +1,97 @@ +package com.tenwa.channelportal.action.alpha; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST; +import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP; + +import java.util.HashMap; +import java.util.Map; + +/** + * 删除征信合同记录 + */ +public class RentDormantExtensionPeriodDeleteAction { + + String objectType;//文件类型 + String planNumber;//项目编号 + String flowUnid;;//流程编号 + + + public String getFlowUnid() { + return flowUnid; + } + + public void setFlowUnid(String flowUnid) { + this.flowUnid = flowUnid; + } + + public String getObjectType() { + return objectType; + } + + public void setObjectType(String objectType) { + this.objectType = objectType; + } + + public String getPlanNumber() { + return planNumber; + } + + public void setPlanNumber(String planNumber) { + this.planNumber = planNumber; + } + + /** + * 删除征信授权文件 + * @param tx + * @throws Exception + */ + public void deleteRentDormantExtensionPeriod(JBOTransaction tx) throws Exception{ + BizObjectManager bom = JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME); + BizObject lbDocBiz = bom.createQuery("OBJECTTYPE='contractExtensionPeriod' and plan_number=:planNumber ") + .setParameter("objectType",objectType).setParameter("planNumber",planNumber).getSingleResult(false); + if(null != lbDocBiz){ + String lbDocBizId = lbDocBiz.getAttribute("id").toString(); + BizObjectManager bom1 = JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME); + String lbDocLibraryId = bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", lbDocBizId).getSingleResult(false).getAttribute("id").toString(); + BizObjectManager bom2 = JBOFactory.getBizObjectManager(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME); + String docAttributeId = bom2.createQuery("library_id=:library_id").setParameter("library_id", lbDocLibraryId).getSingleResult(false).getAttribute("id").toString(); + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, tx); + // 查询lb_doc_contract_list表 +// BizObject bo = contBom.createQuery("attribute_id=:attributeId and file_flag='yes' and sendprocess='1' ") + BizObject bo = contBom.createQuery("attribute_id=:attributeId") + .setParameter("attributeId", docAttributeId).getSingleResult(false); +// if(null == bo){ + if(null != bo){ + Map condtion= new HashMap(); + condtion.put("id", lbDocBizId); + DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCRELATIVE.CLASS_NAME, condtion, tx); + condtion.clear(); + condtion.put("id", lbDocLibraryId); + DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCLIBRARY.CLASS_NAME, condtion, tx); + condtion.clear(); + condtion.put("id", docAttributeId); + DataOperatorUtil.deleteJBOByCondtion(jbo.app.tenwa.doc.LB_DOCATTRIBUTE.CLASS_NAME, condtion, tx); + } + } + } + + /** + * 判断担保人是否为法人 + * @param tx + * @throws Exception + */ + public String checkCreditAuth(JBOTransaction tx) throws Exception{ + BizObjectManager pbm = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, tx); + BizObject pbo = pbm.createQuery("FLOWUNID=:flowUnid") + .setParameter("flowUnid", flowUnid).getSingleResult(true); + if(null == pbo){ + return ""; + } + return pbo.getAttribute("CERTTYPE").toString(); + } +} \ No newline at end of file diff --git a/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodSignAction.java b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodSignAction.java new file mode 100644 index 000000000..2621fa1d1 --- /dev/null +++ b/src/com/tenwa/channelportal/action/alpha/RentDormantExtensionPeriodSignAction.java @@ -0,0 +1,190 @@ +package com.tenwa.channelportal.action.alpha; + +import com.alibaba.fastjson.JSONObject; +import com.amarsoft.are.jbo.*; +import com.tenwa.app.dao.ContractSignInfo; +import com.tenwa.app.manage.qiyuesuo.v2.ContractSignEnums; +import com.tenwa.app.manage.qiyuesuo.v2.ContractSignVtwoUtils; +import com.tenwa.app.manage.qiyuesuo.v2.QYSParams; +import com.tenwa.channelportal.action.generativecontract.WordToPDFUtil; +import jbo.app.tenwa.doc.LB_DOCATTRIBUTE; +import jbo.app.tenwa.doc.LB_DOCLIBRARY; +import jbo.app.tenwa.doc.LB_DOCRELATIVE; +import org.apache.log4j.Logger; + +import java.io.File; + +public class RentDormantExtensionPeriodSignAction { + + private static Logger logger=Logger.getLogger(RentDormantExtensionPeriodSignAction.class); + + private String projectId; + + private String planNumber;; + + private String contractNo; + + private String contractId; + + private String subjectId; + + private String tempId; + + public String getPlanNumber() { + return planNumber; + } + + public void setPlanNumber(String planNumber) { + this.planNumber = planNumber; + } + + public String getContractNo() { + return contractNo; + } + + public void setContractNo(String contractNo) { + this.contractNo = contractNo; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getContractId() { + return contractId; + } + + public void setContractId(String contractId) { + this.contractId = contractId; + } + + public String getSubjectId() { + return subjectId; + } + + public void setSubjectId(String subjectId) { + this.subjectId = subjectId; + } + + public String getTempId() { + return tempId; + } + + public void setTempId(String tempId) { + this.tempId = tempId; + } + + /** + * 保险委托授权书附件用LibreOffice实现word转换pdf + * word转换pdf + * @throws JBOException + */ + @SuppressWarnings({ "unchecked", "static-access" }) + public String wordToPdfRentDormantExtensionPeriod(JBOTransaction tx) throws JBOException { + BizObjectManager bom=JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE=bom.createQuery(" OBJECTTYPE='contractExtensionPeriod' and plan_number=:planNumber ").setParameter("planNumber", planNumber).getSingleResult(false); + BizObjectManager attrBom=JBOFactory.getBizObjectManager(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(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); + } + } + } catch (JBOException e) { + e.printStackTrace(); + } + return attrBo.getAttribute("ID").toString(); + } + + + /** + * 休眠还款协议盖章:对接契约锁2.0 + * @param tx + * @return + * @throws Exception + */ + public String claimSignRentDormantTwo(JBOTransaction tx) throws Exception { + logger.info("claimSignRentDormantTwo 休眠还款协议盖章:对接契约锁2.0 开始 0126"); + String libraryid=""; + BizObjectManager bom=JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME); + BizObject DOCRELATIVE=bom.createQuery("OBJECTTYPE='contractExtensionPeriod' and CONTRACT_ID=:contractid ").setParameter("contractid", contractId).getSingleResult(false); + logger.info("claimSignRentDormantTwo 查询文件关联信息"); + if (DOCRELATIVE != null) { + logger.info("claimSignRentDormantTwo 查询文件关联信息不为空时"); + String DOCRELATIVEid=DOCRELATIVE.getAttribute("id").toString(); + BizObjectManager bom1=JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME); + libraryid=bom1.createQuery("relative_id=:relative_id").setParameter("relative_id", DOCRELATIVEid).getSingleResult(false).getAttribute("id").toString(); + logger.info("claimSignRentDormantTwo 查询文件关联信息libraryid="+libraryid); + } + BizObjectManager contBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx); + ContractSignInfo con = null; + BizObject bo = null; + String info=""; + try{ + bo = contBom.createQuery("library_id=:libraryid").setParameter("libraryid", libraryid).getSingleResult(true); + logger.info("claimSignRentDormantTwo 查询文件信息"); + if(bo != null){ + logger.info("claimSignRentDormantTwo 查询文件信息不为空时"); + String fileName = bo.getAttribute("FILENAME").toString(); + String filePath = bo.getAttribute("FULLPATH").toString(); + logger.info("claimSignRentDormantTwo fileName="+fileName); + logger.info("claimSignRentDormantTwo filePath="+filePath); + ContractSignVtwoUtils contractSignVtwoUtils = new ContractSignVtwoUtils(); + logger.info("claimSignRentDormantTwo 发起公司盖章"); + QYSParams qysParams = new QYSParams(); + qysParams.setList(null);//手签,无需传承租人、共同申请人、担保人信息 + qysParams.setContractSignTypeEnum(ContractSignEnums.ContractSignTypeEnum.SIGNATURE_DEFAULT);//客户手签 + qysParams.setFileName(fileName); + qysParams.setFilePath(filePath); + qysParams.setSubjectId(subjectId); + qysParams.setTempId(tempId);//合同模板id + JSONObject resJson = contractSignVtwoUtils.sign(qysParams); + if (null == resJson) { + logger.warn("claimSignRentDormantTwo 20210415 调用契约锁盖章异常,返回盖章失败"); + return "error"; + } + logger.info("claimSignRentDormantTwo 20210415 调用契约锁盖章成功,res=" + resJson.toJSONString()); + return "success"; + } else { + return "error"; + } + } catch (Exception e) { + logger.error("claimSignInsuranceTwo 系统错误,错误信息: ", e); + e.printStackTrace(); + return "error"; + } + } +} \ No newline at end of file diff --git a/src_jbo/jbo/app/tenwa/calc/LB_RENT_DORMANT_EXTENSION_PERIOD.java b/src_jbo/jbo/app/tenwa/calc/LB_RENT_DORMANT_EXTENSION_PERIOD.java new file mode 100644 index 000000000..8b4de3ac9 --- /dev/null +++ b/src_jbo/jbo/app/tenwa/calc/LB_RENT_DORMANT_EXTENSION_PERIOD.java @@ -0,0 +1,44 @@ +package jbo.app.tenwa.calc; + +/** +* 休眠还款协议信息表 - JBO命名常量类

+* Note: This file is generated by ADE tools, dont modify it.
+ +*/ +public interface LB_RENT_DORMANT_EXTENSION_PERIOD { + /** + * 休眠租金临时表

+ * 代表本类映射的BizObjectClass + */ + public static final String CLASS_NAME = "jbo.app.tenwa.calc.LB_RENT_DORMANT_EXTENSION_PERIOD"; + /** + * 标识 STRING(32)
+ */ + public static final String ID = "ID"; + /** + * 流程编号 STRING(32)
+ */ + public static final String FLOWUNID = "FLOWUNID"; + /** + * 项目编号 STRING(32)
+ */ + public static final String PROJECT_ID = "PROJECT_ID"; + /** + * 合同编号 STRING(32)
+ */ + public static final String CONTRACT_ID = "CONTRACT_ID"; + /** + * 中车合同编号 STRING(32)
+ */ + public static final String zc_contract_num = "zc_contract_num"; + /** + * 休眠还款协议编号 STRING(32)
+ */ + public static final String rent_dormant_num = "rent_dormant_num"; + + /** + * 合同签署时间 STRING(32)
+ */ + public static final String contract_date = "contract_date"; + +} \ No newline at end of file