Merge remote-tracking branch 'origin/release20210415' into release20210415

This commit is contained in:
zhangbeibei 2021-03-23 17:28:34 +08:00
commit c598252096
3 changed files with 124 additions and 6 deletions

View File

@ -1,4 +1,5 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="com.tenwa.util.ProjectConstant"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info00;Describe=注释区;]~*/%>
@ -40,7 +41,9 @@
System.out.println(distributorType);
String sApplyType = CurPage.getParameter("ApplyType");
String sInputUserID = CurUser.getUserID();
String distributorNoConfig = ProjectConstant.DISTIRBUTOR_NO;//获取需要配置经销商
if(StringX.isSpace(sApplyType)) sApplyType = "";
if(StringX.isSpace(sInputUserID)) sInputUserID = "";
@ -240,11 +243,9 @@
sParams = sParams+",sex=1";
}
}
//判断是否是中车经销商。如果是中车的渠道类型是为ZC如果是正常的合同渠道类型是CG
if("<%=distributorType%>" == "types03"){
//判断是否是中车经销商。如果是中车的渠道类型是为ZC其它的则不存
if("<%=distributorNoConfig%>" == "<%=distributorNo%>" ){
sParams = sParams+",channel=ZC";
}else{
sParams = sParams+",channel=CG";
}
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.projectapproval.BusinessApprovalStartAction","initFLow",sParams);//定义流程中需要的参数

View File

@ -421,7 +421,9 @@ public class CustomerInfoManage {
proj.setAttributeValue("inputName", inputName);
proj.setAttributeValue("inputTel", inputTel);
proj.setAttributeValue("PROJECT_NO", projectNo);
proj.setAttributeValue("CHANNEL", channel);
if(channel != null && "ZC".equals(channel)){//只存中车进单的标识
proj.setAttributeValue("CHANNEL", channel);
}
proj.setAttributeValue("ZC_PROJECT_NUMBER", zcProjectNumber);
proj.setAttributeValue("ZC_CONTRACT_NUMBER", zcContractNumber);
}

View File

@ -0,0 +1,115 @@
package com.tenwa.lease.flow.project.commcheck;
import java.text.SimpleDateFormat;
import java.util.*;
import com.amarsoft.are.jbo.JBOException;
import com.tenwa.lease.app.allinpay.util.AllinpayProperties;
import com.tenwa.reckon.util.DateUtil;
import com.tenwa.reckon.util.DateUtils;
import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
import com.amarsoft.app.util.ProductParamUtil;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.util.Transaction;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.doc.action.DocListInitAction;
import com.tenwa.template.check.DefaultBussinessCheck;
import jbo.sys.FLOW_TASK;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 信审通过有效期校验
* @author 20210324
*
*/
public class TermValidityCheck extends DefaultBussinessCheck {
private static final Logger logger = LoggerFactory.getLogger(TermValidityCheck.class);
@Override
public Object run(Transaction Sqlca) throws Exception {
//如果放款流程涉及退回再提交则不判断信审有效期
boolean validityBack = false;//是否发生退回
List<BizObject> flowTaskList = JBOFactory.createBizObjectQuery(FLOW_TASK.CLASS_NAME, "OBJECTNO=:OBJECTNO").setParameter("OBJECTNO", this.getAttribute("ObjectNo").toString()).getResultList(false);
if(CollectionUtils.isEmpty(flowTaskList)){
logger.error("当前流程对应 flow_task 记录不存在objectNo=" + this.getAttribute("ObjectNo").toString());
putMsg("系统繁忙,请稍后再试!");
setPass(false);
return null;
}
for(BizObject flowTask: flowTaskList){
if("0020".equals(flowTask.getAttribute("PHASENO").getString())){
logger.info("当前流程含有退回再提交流程,故不校验有效期!");
validityBack = true;//含有初审流程
break;
}
}
if(validityBack){
logger.info("当前流程含有退回再提交流程,故不校验有效期!");
setPass(true);
return null;
}
//获取配置的超时天数
String sql1 = "SELECT max(INPUTTIME) inputtime,over_date FROM lb_business_overdate where inputtime is not null and over_date>0 group by INPUTTIME";
List<Map<String, String>> ds = DataOperatorUtil.getDataBySql(Sqlca, sql1, null);
String overDate = "";
if(ds.size()>0){
overDate = ds.get(0).get("over_date");
}
if(overDate ==""||Integer.parseInt(overDate)==0){
logger.error("请配置信审通过有效期天数!");
putMsg("请配置信审通过有效期天数");
setPass(false);
return null;
}
//获取信审通过时间
BizObject flowBus = JBOFactory.createBizObjectQuery(FLOW_BUSSINESS_OBJECT.CLASS_NAME, "flow_unid=:flowunid").setParameter("flowunid", this.getAttribute("ObjectNo").toString()).getSingleResult(false);
String projectId = flowBus.getAttribute("proj_id").toString();
String sqlFlow = "SELECT InputTime as inputtime,flow_unid FROM flow_bussiness_object where proj_id='"+ projectId +"' and flow_name in('业务申请流程','业务变更流程') order by InputTime desc limit 1";
List<Map<String, String>> resFlowList = DataOperatorUtil.getDataBySql(Sqlca, sqlFlow, null);
String objectNoXs = null;
if(resFlowList.size()>0){
objectNoXs = resFlowList.get(0).get("flow_unid");
}
List<BizObject> flowAuditTaskList = JBOFactory.createBizObjectQuery(FLOW_TASK.CLASS_NAME, "OBJECTNO=:OBJECTNO").setParameter("OBJECTNO", objectNoXs).getResultList(false);
if(CollectionUtils.isEmpty(flowAuditTaskList)){
logger.error("当前流程对应 flow_task 记录不存在objectNo=" + objectNoXs);
putMsg("系统繁忙,请稍后再试!");
setPass(false);
return null;
}
String endTime = null;
for(BizObject flow: flowAuditTaskList){
if("1000".equals(flow.getAttribute("PHASENO").getString())){//通过
endTime = flow.getAttribute("ENDTIME").getString();//含有初审流程
break;
}
}
if (null == endTime){
logger.error("当前流程对应 flow_task 记录不存在endTimeobjectNo=" + objectNoXs);
putMsg("系统繁忙,请稍后再试!");
setPass(false);
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
Date endDate = sdf2.parse(sdf2.format(sdf.parse(endTime)));
Date nowDate = new Date();
int daySum =(int)((nowDate.getTime() - endDate.getTime())/86400000l) ;
//求出信审通过时间和现在的时间差
int overDays = Integer.parseInt(overDate);
// 比较 是否在信审有效期内
if(daySum - overDays > 0){
setPass(false);
}else{
setPass(true);
}
return null;
}
}