更新多人电子签约

This commit is contained in:
tangfutang 2018-07-06 13:12:39 +08:00
parent a25e5f1404
commit a0d86a87f5
2 changed files with 69 additions and 15 deletions

View File

@ -121,7 +121,7 @@
}
//自然人电子签约
var sReturn = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","signIng","ProjectId=<%=projectId%>,CurUserID=<%=CurUser.getUserID()%>");
var sReturn = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","signIng","ProjectId=<%=projectId%>,CurUserID=<%=CurUser.getUserID()%>,FlowUnid=<%=flowunid%>");
var sReturns = sReturn.split("@");
if("success"==sReturns[0]){
AsDebug.showMessage("提示","电子签约发起成功!","","",true,"","","",function(){
@ -152,23 +152,23 @@
function getStatus(){
var results = RunJavaMethodTrans("com.tenwa.action.channelportal.businesshanding.contractaward.ContractAward","projectStatus","project_id=<%=projectId%>");
var result=results.split("@");
debugger;
if(eval(result[0])<3){
AsDebug.showMessage("提示","请生成合同,在电子签约","","",true);
return;
};
if(eval(result[0])==4){
<%-- if(eval(result[0])==4){
var sReturns = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","downloadDoc","ProjectId=<%=projectId%>,CurUserID=<%=CurUser.getUserID()%>");
AsDebug.showMessage("提示","电子签约已完成!","","",true);
return;
}
} --%>
if(eval(result[0])!=8 && result[2]=="false"){
AsDebug.showMessage("提示","没有发起电子签约,无法获取签约状态!","","",true);
return;
}
var sParams="ProjectId=<%=projectId%>,customerType=<%=custtype%>,CurUserID=<%=CurUser.getUserID()%>";
var sReturn=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","contractSignStatus",sParams);
AsDebug.showMessage("提示",sReturn,"","",true,'','','',function(){
AsDebug.showMessage("提示",sReturn,"","",true,'','','',function(){
var sReturns = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","downloadDoc","ProjectId=<%=projectId%>,CurUserID=<%=CurUser.getUserID()%>");
window.location.reload();
});
}
@ -180,7 +180,7 @@
//(无法完成电子签约,请采用下载纸质合同)
html='<tr id="contractsign" class="test"><td>合同签约操作步骤:<br/>1.制作合同<br/>2.发起电子签约<br/>3.完成电子签约</td></tr>';
}else{
html='<tr id="contractsign" class="test"><td>合同签约操作步骤:<br/>1.制作合同<br/>2.下载纸质合同</td></tr>';
html='<tr id="contractsign" class="test"><td>合同签约操作步骤:<br/>1.发起电子签约<br/>2.查询签约结果</td></tr>';
}
$("#ListTable").prepend(html);
$("#myiframe0_static").height($("#myiframe0_static").height()-78);

View File

@ -14,6 +14,7 @@ import java.util.Map;
import org.apache.log4j.Logger;
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
import jbo.app.tenwa.doc.LB_DOCLIBRARY;
@ -23,6 +24,7 @@ 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_UNION_LESSEE_TEMP;
import jbo.sys.CODE_LIBRARY;
@ -203,12 +205,20 @@ public class ContractSignAction{
// 查询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[] customerName = keys.getAttribute("CUSTOMERNAME").toString().split(",");
String info = null;
String docName = keys.getAttribute("DOC_NAME").toString();
// 自然人和调查表
String info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString();
// String info = "唐福堂@18516860186,朱荟辰@17778045090";
List<ContractSignInfo> list = map.get(info);
if(docName.indexOf("融资租赁合同")>-1){
//需要多个人签约的info.deleteCharAt(info.length() - 1)
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);
}
}else{
//需要一个人签字的
info = keys.getAttribute("CUSTOMERNAME").toString() + "@" + keys.getAttribute("TELEPHONE").toString();
}
List<ContractSignInfo> list = map.get(info);
if (list == null) {
list = new ArrayList<ContractSignInfo>();
map.put(info, list);
@ -320,6 +330,35 @@ public class ContractSignAction{
}
}
//获取电子签约人员列表
public StringBuffer manyPeople() throws JBOException{
//获取担保人信息
StringBuffer info = new StringBuffer();
BizObjectManager cptm = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME);
List<BizObject> cpts = cptm.createQuery("select * from O left join jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP lgu on lgu.ASSUROR=O.CUSTOMERID where "
+ "lgu.flowunid=:FlowUnid AND lgu.DATA_STATE='guarantee' AND "
+ "lgu.flowunid=O.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
@ -822,6 +861,7 @@ public class ContractSignAction{
BizObjectManager ldBom = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, tx);
BizObject pbo = pbm.createQuery("id=:id").setParameter("id", ProjectId).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'";
@ -838,7 +878,10 @@ public class ContractSignAction{
}
for (String key : map.keySet()) {
try {
String signStatus = requestService.getContractSignStatus(key);
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<BizObject> ldclList =
@ -896,7 +939,16 @@ public class ContractSignAction{
if (status.length() < 1) {
return "获取签约状态失败,没有合同文件";
} else {
return status.substring(5);
status = status.substring(5);
String[] peopleStat = peopleStatus.split(",");
if(peopleStat.length>1){
status = status+"<br>";
for(int i=0;i<peopleStat.length;i++){
String[] stat = peopleStat[i].split("@");
status = status+stat[0]+":"+stat[1]+";";
}
}
return status;
}
}
/**
@ -1658,13 +1710,15 @@ public String claimSign(JBOTransaction tx) throws Exception {
*/
public String updateDocContractStatus(JBOTransaction tx) throws JBOException{
// BizObjectManager attBom=JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME,tx);
// 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();
//attBom.createQuery("update O set status='1' WHERE id='"+key.getAttribute("ATTRIBUTE_ID").toString()+"'").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();