From e29dfb6c9f04d17e7109fd2b563fbecad1db3302 Mon Sep 17 00:00:00 2001 From: zhulianghua Date: Wed, 20 Jun 2018 15:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=8F=E9=94=80=E5=95=86?= =?UTF-8?q?=E9=99=90=E5=88=B6=E9=85=8D=E7=BD=AE=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseFlowList/BaseFlowApplyListStart.jspf | 5 ++- .../FlowManager/FlowPage/FlowPageViewTab.jsp | 5 ++- .../Tenwa/Core/MyWork/AppMyWorkDraft.jsp | 5 ++- .../Tenwa/Core/MyWork/AppMyWorkHasDo.jsp | 5 ++- .../Tenwa/Core/MyWork/AppMyWorkPass.jsp | 5 ++- .../Tenwa/Core/MyWork/AppMyWorkPassClose.jsp | 5 ++- .../Tenwa/Core/MyWork/AppMyWorkToDo.jsp | 5 ++- config/quartz.properties | 5 ++- .../resources/QuartzPropertiesUtil.java | 35 +++++++++++++++++++ 9 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 src_tenwa/com/tenwa/httpclient/resources/QuartzPropertiesUtil.java diff --git a/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf b/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf index c562a6b3b..2240a6108 100644 --- a/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf +++ b/WebContent/Tenwa/Core/FlowManager/BaseFlowList/BaseFlowApplyListStart.jspf @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@page import="com.amarsoft.biz.workflow.ApplyManager"%> <%@page import="java.util.Date"%> <%@page import="com.amarsoft.awe.control.model.Parameter" %> @@ -58,8 +59,10 @@ } boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp b/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp index a3380e4bd..28deaed72 100644 --- a/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp +++ b/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@page import="com.amarsoft.biz.workflow.FlowTask"%> <%@page import="com.amarsoft.dict.als.manage.CodeManager"%> <%@page import="com.amarsoft.app.lc.workflow.action.GetFlowAction"%> @@ -33,8 +34,10 @@ //control distributor(temporary) boolean flag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { flag = true; break; } diff --git a/WebContent/Tenwa/Core/MyWork/AppMyWorkDraft.jsp b/WebContent/Tenwa/Core/MyWork/AppMyWorkDraft.jsp index 578a253cb..6c46f055b 100644 --- a/WebContent/Tenwa/Core/MyWork/AppMyWorkDraft.jsp +++ b/WebContent/Tenwa/Core/MyWork/AppMyWorkDraft.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> <%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> @@ -15,8 +16,10 @@ //control distributor(temporary) boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/WebContent/Tenwa/Core/MyWork/AppMyWorkHasDo.jsp b/WebContent/Tenwa/Core/MyWork/AppMyWorkHasDo.jsp index 22c611a83..fe5ce677c 100644 --- a/WebContent/Tenwa/Core/MyWork/AppMyWorkHasDo.jsp +++ b/WebContent/Tenwa/Core/MyWork/AppMyWorkHasDo.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> <%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> @@ -18,8 +19,10 @@ //control distributor(temporary) boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/WebContent/Tenwa/Core/MyWork/AppMyWorkPass.jsp b/WebContent/Tenwa/Core/MyWork/AppMyWorkPass.jsp index e1a98301c..7e89a05bd 100644 --- a/WebContent/Tenwa/Core/MyWork/AppMyWorkPass.jsp +++ b/WebContent/Tenwa/Core/MyWork/AppMyWorkPass.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> <%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> @@ -15,8 +16,10 @@ //control distributor(temporary) boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/WebContent/Tenwa/Core/MyWork/AppMyWorkPassClose.jsp b/WebContent/Tenwa/Core/MyWork/AppMyWorkPassClose.jsp index a58213980..c54e894ca 100644 --- a/WebContent/Tenwa/Core/MyWork/AppMyWorkPassClose.jsp +++ b/WebContent/Tenwa/Core/MyWork/AppMyWorkPassClose.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> <%@include file="/Tenwa/Core/FlowManager/BaseFunction/BaseFlowListFunction.jspf" %> @@ -15,8 +16,10 @@ String jboWhere=" FLOW_READER.isRead='1' and FLOW_READER.reader='"+custid+"' "; //control distributor(temporary) boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/WebContent/Tenwa/Core/MyWork/AppMyWorkToDo.jsp b/WebContent/Tenwa/Core/MyWork/AppMyWorkToDo.jsp index f077a7dc7..ac62fad5b 100644 --- a/WebContent/Tenwa/Core/MyWork/AppMyWorkToDo.jsp +++ b/WebContent/Tenwa/Core/MyWork/AppMyWorkToDo.jsp @@ -1,3 +1,4 @@ +<%@page import="com.tenwa.httpclient.resources.QuartzPropertiesUtil"%> <%@page import="java.util.Date"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> @@ -26,8 +27,10 @@ //control distributor(temporary) boolean bFlag = false; List roles = CurUser.getRoleTable(); + String distributorRole = QuartzPropertiesUtil.get("distributor_role"); + distributorRole = distributorRole == null ? "" : distributorRole; for(String role : roles) { - if(role.startsWith("4") || "399".equals(role)) { + if(distributorRole.indexOf(role) != -1) { bFlag = true; break; } diff --git a/config/quartz.properties b/config/quartz.properties index 821d96aea..62306b0e7 100644 --- a/config/quartz.properties +++ b/config/quartz.properties @@ -37,4 +37,7 @@ org.quartz.jobStore.tablePrefix=QRTZ_ org.quartz.jobStore.isClustered=false org.quartz.jobStore.clusterCheckinInterval=15000 org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate -org.quartz.dataSource.zhulhDS.maxConnections=50 \ No newline at end of file +org.quartz.dataSource.zhulhDS.maxConnections=50 + +#control distributor(temporary) +distributor_role = 401 \ No newline at end of file diff --git a/src_tenwa/com/tenwa/httpclient/resources/QuartzPropertiesUtil.java b/src_tenwa/com/tenwa/httpclient/resources/QuartzPropertiesUtil.java new file mode 100644 index 000000000..d42668de3 --- /dev/null +++ b/src_tenwa/com/tenwa/httpclient/resources/QuartzPropertiesUtil.java @@ -0,0 +1,35 @@ +package com.tenwa.httpclient.resources; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; + +import com.amarsoft.are.ARE; + +public class QuartzPropertiesUtil { + private static final Map attributes; + + static{ + attributes = new ConcurrentHashMap(); + Properties prop = new Properties(); + try { + prop.load(QuartzPropertiesUtil.class.getResourceAsStream("/quartz.properties")); + for(Entry entry : prop.entrySet()) { + if(entry.getKey() == null || entry.getValue() == null) { + continue; + } + attributes.put(entry.getKey().toString(), entry.getValue().toString()); + } + } catch (IOException e) { + e.printStackTrace(); + ARE.getLog().error("init QuartzPropertiesUtil info failed"); + } + ARE.getLog().info("init QuartzPropertiesUtil info success"); + } + + public static String get(String propName) { + return attributes.get(propName); + } +}