From 54444c30386728b02e5958296ce703d99e61355e Mon Sep 17 00:00:00 2001 From: luojian Date: Mon, 30 Jul 2018 15:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A1=E6=89=B9=E6=84=8F?= =?UTF-8?q?=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessApplication/ApprovalForm.jsp | 36 +++++++++++++-- WebContent/WEB-INF/etc/jbo/jbo_lease.xml | 43 +++++++++++++++++- .../controller/LAElementConfigController.java | 9 ++-- .../businessapply/BusinessApproveManager.java | 6 +-- .../commcheck/ApprovalOpinionCheck.java | 44 ++++++++++--------- 5 files changed, 106 insertions(+), 32 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp index 531a9ca75..2f1538af7 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp @@ -15,7 +15,7 @@ String taskno=CurPage.getParameter("TaskNo"); String RightType= CurPage.getParameter("RightType"); String customerType= CurPage.getParameter("CustomerType"); - + String flowstate = CurPage.getParameter("flowstate"); String flowunid = CurPage.getParameter("FlowUnid"); String clean_lease_money = Sqlca.getString("select CLEAN_LEASE_MONEY from LC_CALC_CONDITION_TEMP where flowunid='"+flowunid+"'"); //int money = Integer.parseInt(clean_lease_money); @@ -25,7 +25,7 @@ double money = Double.parseDouble(clean_lease_money); CurPage.getCurComp().setAttribute("RightType", null); - String sTempletNo = "VI_BUSINESS_APPROVAL";//--模板号-- + String sTempletNo = "VI_PROJECTINFO_APPROVAL";//--模板号-- ASObjectModel doTemp = new ASObjectModel(sTempletNo); if("01".equals(customerType)){ doTemp.setVisible("SEX",false);//如果是法人客户隐藏性别字段 @@ -50,6 +50,15 @@ dwTemp.getDataObject().setRequired("firstchoice", true); dwTemp.getDataObject().setRequired("firstopinion", true); dwTemp.setGroupHidden("0030,0040,0050"); + if("BACK".equals(flowstate)||"ANYBACK".equals(flowstate)){ + dwTemp.getDataObject().setVisible("secondchoice", true); + dwTemp.getDataObject().setVisible("secondopinion", true); + dwTemp.getDataObject().setReadOnly("secondchoice", true); + dwTemp.getDataObject().setReadOnly("secondopinion", true); + dwTemp.getDataObject().setVisible("InterOpinion2", true); + dwTemp.getDataObject().setReadOnly("InterOpinion2", true); + dwTemp.setGroupHidden("0040,0050"); + } }else if("0040".equals(phaseNo)){//复审 dwTemp.getDataObject().setVisible("firstchoice", true); dwTemp.getDataObject().setVisible("firstopinion", true); @@ -59,7 +68,16 @@ dwTemp.getDataObject().setVisible("secondopinion", true); dwTemp.getDataObject().setRequired("secondchoice", true); dwTemp.getDataObject().setRequired("secondopinion", true); - dwTemp.setGroupHidden("0040,0050"); + dwTemp.setGroupHidden("0040"); + if("BACK".equals(flowstate)||"ANYBACK".equals(flowstate)){ + dwTemp.getDataObject().setVisible("thirdchoice", true); + dwTemp.getDataObject().setVisible("thirdopinion", true); + dwTemp.getDataObject().setReadOnly("thirdchoice", true); + dwTemp.getDataObject().setReadOnly("thirdopinion", true); + dwTemp.getDataObject().setVisible("INTEROPINION3", true); + dwTemp.getDataObject().setReadOnly("INTEROPINION3", true); + dwTemp.setGroupHidden("0050"); + } }else if("0050".equals(phaseNo)){//信审 if(!"true".equals(ishistory)){ dwTemp.getDataObject().setVisible("firstchoice", true); @@ -123,6 +141,11 @@ $("#A_div_1240").attr("style","display:none;"); $("#A_div_1250").attr("style","display:none;"); $("#A_div_1260").attr("style","display:none;"); + if("BACK"=="<%=flowstate%>"||"ANYBACK"=="<%=flowstate%>"){ + $("#A_div_1230").attr("style","display:block;"); + $("#A_div_1240").attr("style","display:block;"); + $("#A_div_1260").attr("style","display:block;"); + } _user_validator[0]['rules']['FIRSTCHOICE']['required0'] = true; _user_validator[0]['messages']['FIRSTCHOICE']['required0'] = '请输入初审意见'; _user_validator[0]['rules']['FIRSTOPINION']['required0'] = true; @@ -136,7 +159,10 @@ $("#FIRSTOPINION").attr("disabled","disabled");//审批意见 $("#INTEROPINION1").attr("disabled","disabled");//初审内部意见 $("#DISTRIOPINION1").attr("disabled","disabled");//初审经销商意见 - + if("BACK"=="<%=flowstate%>"||"ANYBACK"=="<%=flowstate%>"){ + $("#A_div_1250").attr("style","display:block;"); + $("#A_div_1260").attr("style","display:block;"); + } _user_validator[0]['rules']['SECONDCHOICE']['required0'] = true; _user_validator[0]['messages']['SECONDCHOICE']['required0'] = '请输入复审意见'; _user_validator[0]['rules']['SECONDOPINION']['required0'] = true; @@ -219,6 +245,7 @@ setItemValue(0,0,"firstopinion",""); $("#FIRSTOPINION").attr("disabled","disabled"); } + }) function checkCertId(){//校验证件号 @@ -263,6 +290,7 @@ if(firstchoice=="0030"){ setItemRequired(0,"InterOpinion1",false); setItemRequired(0,"DistriOpinion1",true); + setItemRequired(0,"FIRSTOPINION",false); setItemValue(0,0,"firstopinion",""); $("#FIRSTOPINION").attr("disabled","disabled"); } diff --git a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml index 7d9e3e637..0534b0ba5 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_lease.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_lease.xml @@ -1062,6 +1062,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4284,6 +4326,5 @@ - diff --git a/src_tenwa/com/tenwa/controller/LAElementConfigController.java b/src_tenwa/com/tenwa/controller/LAElementConfigController.java index f0f782610..ca0640a28 100644 --- a/src_tenwa/com/tenwa/controller/LAElementConfigController.java +++ b/src_tenwa/com/tenwa/controller/LAElementConfigController.java @@ -1,6 +1,7 @@ package com.tenwa.controller; import jbo.com.tenwa.lease.comm.VI_BUSINESS_APPROVAL; +import jbo.com.tenwa.lease.comm.VI_PROJECTINFO_APPROVAL; import jbo.com.tenwa.limit.LA_LIMIT_ELEMENT; import com.amarsoft.are.jbo.BizObject; @@ -61,17 +62,17 @@ public class LAElementConfigController { } public String queryBusinessApproval(JBOTransaction tx)throws Exception { String meagess=""; - BizObjectManager lleManager = JBOFactory.getBizObjectManager(VI_BUSINESS_APPROVAL.CLASS_NAME,tx); + BizObjectManager lleManager = JBOFactory.getBizObjectManager(VI_PROJECTINFO_APPROVAL.CLASS_NAME,tx); BizObject bo = lleManager.createQuery("FLOWUNID=:FLOWUNID ").setParameter("FLOWUNID",this.getObjectNo()).getSingleResult(false); switch (this.getPhaseNo()) { case "0030": - meagess=bo!=null?bo.getAttribute(VI_BUSINESS_APPROVAL.firstopinion).toString():"false"; + meagess=bo!=null?bo.getAttribute(VI_PROJECTINFO_APPROVAL.firstopinion).toString():"false"; break; case "0040": - meagess=meagess=bo!=null?bo.getAttribute(VI_BUSINESS_APPROVAL.secondopinion).toString():"false";; + meagess=meagess=bo!=null?bo.getAttribute(VI_PROJECTINFO_APPROVAL.secondopinion).toString():"false";; break; case "0050": - meagess=meagess=bo!=null?bo.getAttribute(VI_BUSINESS_APPROVAL.thirdopinion).toString():"false";; + meagess=meagess=bo!=null?bo.getAttribute(VI_PROJECTINFO_APPROVAL.thirdopinion).toString():"false";; break; default: meagess="false"; diff --git a/src_tenwa/com/tenwa/lease/flow/project/businessapply/BusinessApproveManager.java b/src_tenwa/com/tenwa/lease/flow/project/businessapply/BusinessApproveManager.java index 98c9d9fa5..a2a60034f 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/businessapply/BusinessApproveManager.java +++ b/src_tenwa/com/tenwa/lease/flow/project/businessapply/BusinessApproveManager.java @@ -143,8 +143,8 @@ public class BusinessApproveManager { public String saveApproveOpinion(JBOTransaction tx){ try{ BizObjectManager bomFT = JBOFactory.getBizObjectManager(FLOW_TASK.CLASS_NAME,tx); - BizObject boFT = bomFT.createQuery("objectno=:flowunid and phaseno=:phaseNo and serialno=:serialno and relativeobjectno is not null") - .setParameter("flowunid", flowunid).setParameter("phaseNo", phaseNo).setParameter("serialno", serialNo).getSingleResult(true); + BizObject boFT = bomFT.createQuery("objectno=:flowunid and phaseno=:phaseNo and relativeobjectno is not null") + .setParameter("flowunid", flowunid).setParameter("phaseNo", phaseNo).getSingleResult(true); BizObjectManager bomFO = JBOFactory.getBizObjectManager(FLOW_OPINION.CLASS_NAME,tx); BizObject bo = bomFO.createQuery("serialno='"+serialNo+"'").getSingleResult(true); if(boFT != null){ @@ -154,7 +154,7 @@ public class BusinessApproveManager { bomFT.createQuery("update O set relativeobjectno='"+serialNo+"' where serialno='"+serialNo+"'").executeUpdate(); bo.setAttributeValue(FLOW_OPINION.phaseopinion, phaseOpinion); bo.setAttributeValue(FLOW_OPINION.phasechoice, phaseChoice); - bo.setAttributeValue(FLOW_OPINION.phaseopinion1, InterOpinion1); + bo.setAttributeValue(FLOW_OPINION.InterOpinion1, InterOpinion1); bo.setAttributeValue(FLOW_OPINION.DistriOpinion1, DistriOpinion1); bo.setAttributeValue("InterOpinion2", InterOpinion2); bo.setAttributeValue("DistriOpinion2", DistriOpinion2); diff --git a/src_tenwa/com/tenwa/lease/flow/project/commcheck/ApprovalOpinionCheck.java b/src_tenwa/com/tenwa/lease/flow/project/commcheck/ApprovalOpinionCheck.java index 0bd96621f..4cc55fadd 100644 --- a/src_tenwa/com/tenwa/lease/flow/project/commcheck/ApprovalOpinionCheck.java +++ b/src_tenwa/com/tenwa/lease/flow/project/commcheck/ApprovalOpinionCheck.java @@ -22,34 +22,41 @@ public class ApprovalOpinionCheck extends DefaultBussinessCheck{ String flowunid=this.getAttribute("ObjectNo").toString(); String phaseno=this.getAttribute("PhaseNo").toString(); boolean flag = true; - SqlObject so = new SqlObject("select ft.serialno,fo.phasechoice,fo.phaseopinion from flow_task ft left join flow_opinion fo on ft.relativeobjectno=fo.serialno where ft.objectno='"+flowunid+"' and ft.phaseno='"+phaseno+"' and ft.relativeobjectno is not null"); - ASResultSet result = Sqlca.getASResultSet(so); + String sql="select case when ft.phaseno='0030' then case when fo.phasechoice is not null then 1 else 0 end when ft.phaseno='0040' then case when fo.phasechoice is not null then 1 else 0 end when ft.phaseno='0050' then case when fo.phasechoice is not null then 1 else 0 end else 99 end phasechoice,case when ft.phaseno='0030' then case when fo.phaseopinion is not null then 1 else 0 end when ft.phaseno='0040' then case when fo.phaseopinion is not null then 1 else 0 end when ft.phaseno='0050' then case when fo.phaseopinion is not null then 1 else 0 end else 99 end phaseopinion from flow_task ft left join flow_opinion fo on ft.relativeobjectno = fo.serialno " + +" where ft.objectno = '"+flowunid+"' and ft.phaseno = '"+phaseno+"' and ft.serialno='"+serialno+"' and ft.relativeobjectno is not null"; + SqlObject so = new SqlObject(sql); + ASResultSet result = Sqlca.getASResultSet(so); + String phasechoice = ""; + String phaseopinion = ""; + while(result.next()){ + phasechoice = result.getString("phasechoice"); + phaseopinion = result.getString("phaseopinion"); + } String message = ""; switch(phaseno){ case "0030": - message = "初审意见未填写!"; + if(!"1".equals(phasechoice)){ + message = "初审意见未填写!"; + flag = false; + } break; case "0040": - message = "复审意见未填写!"; + if(!"1".equals(phasechoice)){ + message = "复审意见未填写!"; flag = false; + } break; case "0050": - message = "部门负责人意见未填写!"; + if(!"1".equals(phasechoice)){ + message = "部门负责人意见未填写!"; flag = false; + } break; // case "0050": // message = "总经理意见未填写!"; // break; } - String phasechoice = ""; - String phaseopinion = ""; - String deleteSerialno = ""; - while(result.next()){ - deleteSerialno = result.getString("serialno"); - phasechoice = result.getString("phasechoice"); - phaseopinion = result.getString("phaseopinion"); - } result.close(); - String thisResult = ""; - if(!"".equals(deleteSerialno)){ + //String thisResult = ""; +/* if(!"".equals(deleteSerialno)){ thisResult = Sqlca.getString("select case when count(*)>0 then 'true' else 'false' end from flow_task where serialno='"+serialno+"' and phaseno='"+phaseno+"' and relativeobjectno is not null"); if("false".equals(thisResult)){ ASResultSet ars = Sqlca.getASResultSet(new SqlObject("select userid,orgid from flow_task where serialno='"+serialno+"'")); @@ -69,13 +76,10 @@ public class ApprovalOpinionCheck extends DefaultBussinessCheck{ } }else{ flag = false; - } - if(flag && "true".equals(thisResult)){ + }*/ + if(flag ){ putMsg("验证通过!"); setPass(true); - }else if(flag && "false".equals(thisResult)){ - putMsg("验证通过!但是意见使用的是退回前的意见!"); - setPass(true); }else{ putMsg(message); setPass(false);