休眠展期协议生成代码20220727
This commit is contained in:
parent
89dd7199e2
commit
d2bc70e6a8
@ -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~*/%>
|
||||
|
||||
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
|
||||
<div style="display:none">
|
||||
<input id="sqlString" name="sqlString" value="">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List06;Describe=定义按钮事件;]~*/%>
|
||||
<script type="text/javascript">
|
||||
//在加载完表格后调用
|
||||
function afterSearch(){
|
||||
for(var i=0;i<getRowCount(0);i++){
|
||||
var html="";
|
||||
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"ID")+'\')><font color="blue">'+"下载     "+'</font></a>';
|
||||
getObj(0,i,"FILENAME").innerHTML=html+'<font >'+getObj(0,i,"FILENAME").innerHTML+'</font>';
|
||||
};
|
||||
}
|
||||
function downloadFile(id){
|
||||
if(typeof(id)==undefined || id=='') {
|
||||
alert("请先生成休眠展期协议再下载!");
|
||||
return;
|
||||
}
|
||||
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
|
||||
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
|
||||
}
|
||||
/**
|
||||
* 生成休眠还款协议
|
||||
*/
|
||||
function generateQuotation(){
|
||||
<%--var contract_no="<%=contractNo%>";--%>
|
||||
<%--var contract_no="<%=contractNo%>";--%>
|
||||
var result = AsControl.RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantExtensionPeriodAction","saveRentDormantExtensionPeriodAction","flowUnid=<%=flowunid%>");
|
||||
alert("休眠展期协议编号为:" + result);
|
||||
var contract_no=result;
|
||||
if(contract_no == ''){
|
||||
alert("请先进行休眠调整,生成休眠还款协议编号!");
|
||||
return;
|
||||
}
|
||||
var param={};
|
||||
var tempParam={};
|
||||
var sparam="";
|
||||
//模板号
|
||||
// var tempId = "11b12cbfd98611eb970e00163e0ad611";
|
||||
var tempId = "11b12cbfd98611eb970e00163e0ad622";
|
||||
var flowUnid = "<%=flowunid%>";
|
||||
param["templateNo"]= tempId;
|
||||
//文件类型:休眠展期协议
|
||||
var objectType = "contractExtensionPeriod";
|
||||
//生成文件关联关系
|
||||
tempParam["OBJECTTYPE"]=objectType;
|
||||
tempParam["contract_no"]=contract_no;
|
||||
tempParam["contract_id"]=contract_no;
|
||||
tempParam["project_id"]=contract_no;
|
||||
tempParam["PROJ_ID"]="<%=projectId%>";//注意变量名,不要改
|
||||
tempParam["CONTRACT_ID"]="<%=contractId%>";//注意变量名,不要改
|
||||
tempParam["CUST_ID"]=contract_no;//注意变量名,不要改
|
||||
tempParam["PLAN_NUMBER"]=contract_no;//注意变量名,不要改
|
||||
tempParam["FLOW_UNID"]=flowUnid;
|
||||
//生成模板固定参数
|
||||
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
|
||||
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
|
||||
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
|
||||
|
||||
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
|
||||
for(var key in param){
|
||||
if(sparam.length>0){sparam+=",";}
|
||||
sparam+=key+"="+param[key];
|
||||
}
|
||||
var deleteresult=RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantExtensionPeriodDeleteAction",
|
||||
"deleteRentDormantExtensionPeriod", "planNumber="+contract_no+",objectType="+objectType);
|
||||
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate", sparam);
|
||||
// word转pdf
|
||||
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantExtensionPeriodSignAction",
|
||||
"wordToPdfRentDormantExtensionPeriod","contractNo="+contract_no+",contractId="+contract_no+",projectId="+contract_no+",planNumber="+contract_no);
|
||||
if(typeof(id)=="undefined" || id.length <= 0 || id==""){
|
||||
RunJavaMethodTrans("com.tenwa.channelportal.action.alpha.RentDormantExtensionPeriodDeleteAction", "deleteRentDormantExtensionPeriod", "planNumber="+contract_no+",objectType="+objectType);
|
||||
}else{
|
||||
alert("生成成功!!!");
|
||||
}
|
||||
reloadSelf();
|
||||
}
|
||||
</script>
|
||||
<%/*~END~*/%>
|
||||
|
||||
|
||||
|
||||
|
||||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List07;Describe=自定义函数;]~*/%>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
</script>
|
||||
<%/*~END~*/%>
|
||||
|
||||
|
||||
|
||||
|
||||
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=List08;Describe=页面装载时,进行初始化;]~*/%>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
<%/*~END~*/%>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -4639,6 +4639,23 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LB_RENT_DORMANT_EXTENSION_PERIOD" label="休眠展期协议信息表" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="标识" type="STRING" length="32"/>
|
||||
<attribute name="FLOWUNID" label="流程编号" type="STRING" length="32"/>
|
||||
<attribute name="PROJECT_ID" label="项目编号" type="STRING" length="32"/>
|
||||
<attribute name="CONTRACT_ID" label="合同编号" type="STRING" length="32"/>
|
||||
<attribute name="rent_dormant_num" label="休眠还款协议编号" type="STRING" length="32"/>
|
||||
<attribute name="zc_contract_num" label="中车合同编号" type="STRING" length="32"/>
|
||||
<attribute name="contract_date" label="合同签署时间" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="LB_RENT_DORMANT_EXTENSION_PERIOD" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_DORMANT_RENT_ADJUST_TEMP" label="休眠租金临时表" keyAttributes="ID">
|
||||
<attributes>
|
||||
<attribute name="ID" label="标识" type="STRING" length="32"/>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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<String,String> condtion= new HashMap<String,String>();
|
||||
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();
|
||||
}
|
||||
}
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package jbo.app.tenwa.calc;
|
||||
|
||||
/**
|
||||
* 休眠还款协议信息表 - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface LB_RENT_DORMANT_EXTENSION_PERIOD {
|
||||
/**
|
||||
* 休眠租金临时表<br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.app.tenwa.calc.LB_RENT_DORMANT_EXTENSION_PERIOD";
|
||||
/**
|
||||
* 标识 STRING(32)<br>
|
||||
*/
|
||||
public static final String ID = "ID";
|
||||
/**
|
||||
* 流程编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String FLOWUNID = "FLOWUNID";
|
||||
/**
|
||||
* 项目编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String PROJECT_ID = "PROJECT_ID";
|
||||
/**
|
||||
* 合同编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String CONTRACT_ID = "CONTRACT_ID";
|
||||
/**
|
||||
* 中车合同编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String zc_contract_num = "zc_contract_num";
|
||||
/**
|
||||
* 休眠还款协议编号 STRING(32)<br>
|
||||
*/
|
||||
public static final String rent_dormant_num = "rent_dormant_num";
|
||||
|
||||
/**
|
||||
* 合同签署时间 STRING(32)<br>
|
||||
*/
|
||||
public static final String contract_date = "contract_date";
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user