diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp index 658d6e331..160e5fae0 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApproval/ProjectApprovalCreationInfo.jsp @@ -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);//定义流程中需要的参数 diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoManage.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoManage.java index 4850ad994..e4762ec3e 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoManage.java +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/CustomerInfoManage.java @@ -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); } diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/TermValidityCheck.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/TermValidityCheck.java new file mode 100644 index 000000000..3b2842955 --- /dev/null +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/TermValidityCheck.java @@ -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 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> 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> resFlowList = DataOperatorUtil.getDataBySql(Sqlca, sqlFlow, null); + String objectNoXs = null; + if(resFlowList.size()>0){ + objectNoXs = resFlowList.get(0).get("flow_unid"); + } + List 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 记录不存在endTime!objectNo=" + 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; + } +}