修改经销商限制配置化

This commit is contained in:
zhulianghua 2018-06-20 15:56:43 +08:00
parent 34ec065162
commit e29dfb6c9f
9 changed files with 67 additions and 8 deletions

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -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<String> 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;
}

View File

@ -38,3 +38,6 @@ 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
#control distributor(temporary)
distributor_role = 401

View File

@ -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<String, String> attributes;
static{
attributes = new ConcurrentHashMap<String, String>();
Properties prop = new Properties();
try {
prop.load(QuartzPropertiesUtil.class.getResourceAsStream("/quartz.properties"));
for(Entry<Object, Object> 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);
}
}