扣款卡信息变更,发起电子签约

This commit is contained in:
tangfutang 2018-08-07 12:24:32 +08:00
parent 1dd92bd4d5
commit 1157d743ca
4 changed files with 172 additions and 6 deletions

View File

@ -0,0 +1,83 @@
<%@page import="jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2018-07-16
Content:
History Log:
*/
String flowunid = CurPage.getParameter("FlowUnid");
String contractid = CurPage.getParameter("ContractId");
CurPage.getParameter("PrevUrl");
ASObjectModel doTemp = new ASObjectModel("ChangeDebitCardList");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
// dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow(flowunid);
dwTemp.ReadOnly = "1";
isShowButton=true;
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","生成模板","生成模板","generatepdf()","","","",""},
{"true","All","Button","发起电子签约","查看/修改详情","stamp()","","","",""},
{"true","All","Button","查询签约结果","查看/修改详情","","","","",""},
{"true","All","Button","重新发送短息","查看/修改详情","","","","","btn_icon_refresh"},
};
//sButtonPosition = "north";
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function generatepdf(){
var param={};
var tempParam={};
var sparam="";
param["templateNo"]="3334eed6051248b88cd4f2a22e93ac96";
//生成文件关联关系
tempParam["OBJECTTYPE"]="ChangeCar";
tempParam["FLOW_UNID"]="<%=flowunid%>";
tempParam["CONTRACT_ID"]="<%=contractid%>";
//生成模板固定参数
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];
}
RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentCollectDeleteAction","deletequtation","plan_number="+getItemValue(0,getRow(0),"PAYMENT_NUMBER"));
console.log(sparam);
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","FlowUnid="+"<%=flowunid%>"+",contract_id="+"<%=contractid%>"+",PLAN_LIST=ChangeCar");
// console.log(getNowFormatDate());
alert("生成模板成功!");
reloadSelf();
}
function stamp(){
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","changeCarSignA","FlowUnid="+"<%=flowunid%>"+",contract_id="+"<%=contractid%>"+",flagType=changeCar");
if("success"==result){
alert("发起电子签约成功!!!");
location.reload();
}else{
alert("发起电子签约失败!!!");
}
}
//在加载完表格后调用
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
var html="";
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"id")+'\')><font color="blue">'+getItemValue(0,i,"FILENAME")+'</font></a>';
getObj(0,i,"file").innerHTML=html;
}
}
function downloadFile(id){
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -161,8 +161,13 @@
setErrorTips("FRAME_NUMBER","车架号已存在!");
return true;
}else{
setErrorTips("FRAME_NUMBER","");
return false;
if(framenumber.length == 17){
setErrorTips("FRAME_NUMBER","");
return false;
}else{
setErrorTips("FRAME_NUMBER","车架号必须是17位");
return true;
}
}
}
@ -414,13 +419,13 @@
}
function checkFrameNumber(){
var vin = getItemValue(0,getRow(0),"FRAME_NUMBER");
/* var vin = getItemValue(0,getRow(0),"FRAME_NUMBER");
if (!getCheckCode(vin)){
setErrorTips("FRAME_NUMBER","车架号格式有误!");
return false;
}else{
setErrorTips("FRAME_NUMBER","");
}
} */
return true;
}

View File

@ -15,8 +15,8 @@
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","新增","新增一条记录","newRecord()","","","","btn_icon_add"},
{"true","All","Button","修改","查看/修改详情","viewAndEdit()","","","","btn_icon_edit"},
{"false","All","Button","新增","新增一条记录","newRecord()","","","","btn_icon_add"},
{"false","All","Button","修改","查看/修改详情","viewAndEdit()","","","","btn_icon_edit"},
// {"true","","Button","详情","查看/修改详情","view()","","","","btn_icon_detail"},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>

View File

@ -1476,6 +1476,8 @@ public void wordToPdfJar(JBOTransaction tx){
DOCRELATIVE = bom.createQuery("CONTRACT_ID=:CONTRACT_ID and objecttype='瓊품써헌聯츠'").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{
DOCRELATIVE=bom.createQuery("plan_number=:plan_number and plan_list=:plan_list").setParameter("plan_number",PAYMENT_NUMBER).setParameter("plan_list", PLAN_LIST).getSingleResult(false);
}
@ -2016,6 +2018,82 @@ public String claimSign(JBOTransaction tx) throws Exception {
}
}
/**
* 扣款卡信息变更发电子签约
* @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<String,ContractSignInfo> map=new HashMap<String,ContractSignInfo>();
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<String, String> resultMap = null;
resultMap = requestService.createAccountContractDSign(map);
if (!resultMap.containsKey("error")) {
for (String key : resultMap.keySet()) {
if (key.indexOf("contract_") == -1) {
// DOCRELATIVE.setAttributeValue("SINGCONTRACT_ID",resultMap.get("contract_" + key));
DOCRELATIVE.setAttributeValue("TEMPLATE_ID", resultMap.get(key));
library.setAttributeValue("REMARK", "SIGNING");
contract_id = resultMap.get(key);
}
}
bom.saveObject(DOCRELATIVE);
bom1.saveObject(library);
tx.commit();
} else {
return "error";
}
}
return "success";
} catch (Exception e) {
e.printStackTrace();
return "error";
}
}
/**
* 닭澗변맨무鱇覽