anderx 3 lat temu
rodzic
commit
ba74ebeca3

+ 0 - 12
src/main/java/com/goafanti/common/controller/BaseController.java

@@ -37,18 +37,6 @@ public class BaseController {
 	@Value(value = "${avatar.host}")
 	private String					avatarHost			= null;
 
-	@Value(value = "${upload.path}")
-	private String					uploadPath			= null;
-
-	@Value(value = "${upload.private.path}")
-	private String					uploadPrivatePath	= null;
-
-	@Value(value = "${accessKey}")
-	private String					accessKey			= null;
-
-	@Value(value = "${accessSecret}")
-	private String					accessSecret		= null;
-
 	@Value(value = "${portal.host}")
 	private String					portalHost			= null;
 

+ 4 - 9
src/main/java/com/goafanti/common/error/SystemExceptionResolver.java

@@ -21,19 +21,14 @@ import com.goafanti.core.shiro.filter.ShiroFilterUtils;
 public class SystemExceptionResolver extends SimpleMappingExceptionResolver{
 	@Resource(name = "errorResource")
 	private ResourcePropertySource	errorResource;
-	@Value(value = "${app.name}")
-	private String appName;
+
 	@Autowired
 	private ShiroFilterUtils		shiroFilterUtils;
 
 	@Override
 	protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
 			Exception ex) {
-		/*if(request.getHeader("User-Agent") != null && request.getHeader("User-Agent").indexOf(appName) > -1){
-			setExceptionMappings(new Properties());
-			return null;
-		}
-		*/
+
 		// Expose ModelAndView for chosen error view.
 		String viewName = determineViewName(ex, request);
 
@@ -50,7 +45,7 @@ public class SystemExceptionResolver extends SimpleMappingExceptionResolver{
 				return getModelAndView(viewName, ex, request);
 			} else {// JSON
 				Result res = new Result();
-				res.getError().add(new Error(viewName,ex.getMessage())); 
+				res.getError().add(new Error(viewName,ex.getMessage()));
 				shiroFilterUtils.out(response, res);
 				return null;
 			}
@@ -98,5 +93,5 @@ public class SystemExceptionResolver extends SimpleMappingExceptionResolver{
 	public void setErrorResource(ResourcePropertySource errorResource) {
 		this.errorResource = errorResource;
 	}
-	
+
 }

+ 0 - 149
src/main/java/com/goafanti/common/utils/WeChatUtils.java

@@ -1,149 +0,0 @@
-package com.goafanti.common.utils;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-
-import com.alibaba.fastjson.JSONObject;
-import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.error.BusinessException;
-
-
-@Component
-public class WeChatUtils {
-
-
-	@Value(value = "${wx.appId}")
-	private String appId;
-	@Value(value = "${wx.appSecret}")
-	private String appSecret;
-	@Value(value = "${wx.state}")
-	private String wxState;
-	@Autowired
-	private RedisUtil redisUtil;
-
-	//待审核通知
-	private static final String sptz="j7WH3EwQnxGxwuV2HwmJhryxySPE8vOiV5cVOpp-42I";
-	//审核结通知
-	private static final String jgtz="pWia-KJPFwDM8ReDu_BOa9FJn31VFc81bp3yxfBmIRI";
-	private static  String send_url="https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=ACCESS_TOKEN";
-
-
-
-
-	/**
-	 *
-	 * @param openid
-	 * @param type 状态 0驳回 1发起 2同意
-	 * @param date
-	 */
-	public Integer addNotice(String openid ,Integer type,Integer id, Date date, String aname,String remarks) {
-		Map<String, Object> map=new HashMap<String, Object>();
-		String accessToken=getAccessToken();
-		String url=send_url.replace("ACCESS_TOKEN", accessToken);
-		map.put("access_token", accessToken);
-		map.put("touser", openid);
-		map.put("page", "pages/egressDetails/index?id="+id);
-		map.put("miniprogram_state", wxState);
-		if (type==1) {
-			map.put("template_id", sptz);
-			map.put("data",getData(type,date, aname,remarks));
-		}else {
-			map.put("template_id", jgtz);
-			map.put("data",getData(type,date, aname,remarks));
-		}
-		JSONObject res=HttpUtils.httpPost(url, map);
-		if (res.get("errcode")!=null) {
-			return res.getInteger("errcode");
-		}else {
-			return 1;
-		}
-
-	}
-	private Map<String, Object> getData(Integer type,Date date, String aname, String remarks) {
-		Map<String, Object> we=new HashMap<String, Object>();
-		String strDate=DateUtils.formatDate(date, AFTConstants.YMDHMS_CHINESE);
-		if (type==1) {
-			Map<String, Object> v1=new HashMap<String, Object>();
-			v1.put("value",strDate);
-			we.put("time5", v1);
-			Map<String, Object> v2=new HashMap<String, Object>();
-			v2.put("value", aname);
-			we.put("name3", v2);
-			Map<String, Object> v3=new HashMap<String, Object>();
-			v3.put("value", remarks);
-			we.put("thing10", v3);
-		}else {
-			String thing2="";
-			if (type==0){
-				thing2="驳回";
-			}else if (type==2){
-				thing2="通过";
-			}
-			Map<String, Object> v1=new HashMap<String, Object>();
-			v1.put("value",strDate);
-			we.put("date3", v1);
-			Map<String, Object> v2=new HashMap<String, Object>();
-			v2.put("value", thing2);
-			we.put("thing2", v2);
-			Map<String, Object> v3=new HashMap<String, Object>();
-			v3.put("value", remarks);
-			we.put("thing6", v3);
-		}
-		return we;
-	}
-
-
-
-
-	public String getAccessToken() {
-		Date date = new Date();
-		if (redisUtil.presence("access_token")||redisUtil.presence("expires_in")) {
-			String access_token=redisUtil.getString("access_token");
-			String expires_in=redisUtil.getString("expires_in");
-			if (date.getTime() < Long.valueOf(expires_in)) {
-				LoggerUtils.debug(getClass(), "redis中获取accestoken");
-				return access_token;
-			} else {
-				LoggerUtils.debug(getClass(), "accestoken超时重新获取");
-				redisUtil.deleteString("access_token");
-				redisUtil.deleteString("expires_in");
-				return setSessionAccessToken(date);
-			}
-
-		} else {
-			return setSessionAccessToken(date);
-		}
-
-
-	}
-
-
-
-	private String setSessionAccessToken(Date date) {
-		String url = String.format(
-				"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appId,
-				appSecret);
-		JSONObject js = HttpUtils.httpGet(url);
-		String errcode =js.getString("errcode");
-		if (errcode!=null) {
-			throw new  BusinessException("获取AccessToken失败!");
-		}else {
-			LoggerUtils.debug(AsyncUtils.class,"获取并存入AccessToken成功,accesstoken="+js.getString("access_token"));
-		}
-		String access_token = js.getString("access_token");
-		Long expires_in = js.getLong("expires_in");
-		//返回时间为秒需要计算换成毫秒
-		expires_in=expires_in*1000;
-		expires_in+=date.getTime();
-		redisUtil.setString("access_token", access_token);
-		redisUtil.setString("expires_in", expires_in.toString());
-		return access_token;
-	}
-
-}

+ 5 - 20
src/main/java/com/goafanti/core/shiro/filter/ShiroFilterUtils.java

@@ -6,7 +6,6 @@ import java.io.PrintWriter;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.springframework.beans.factory.annotation.Value;
 
 import com.alibaba.fastjson.JSON;
 
@@ -16,36 +15,24 @@ import com.goafanti.common.utils.LoggerUtils;
 public class ShiroFilterUtils {
 	final static Class<? extends ShiroFilterUtils> CLAZZ = ShiroFilterUtils.class;
 
-	@Value(value = "${app.name}")
-	private String appName;
 
 	/**
 	 * 是否是Ajax请求
-	 * 
+	 *
 	 * @param request
 	 * @return
 	 */
 	public boolean isAjax(HttpServletRequest request) {
 		return (request.getHeader("accept") != null && request.getHeader("accept").indexOf("application/json") > -1)
 				|| (request.getHeader("X-Requested-With") != null
-						&& request.getHeader("X-Requested-With").indexOf("XMLHttpRequest") > -1)
-				|| isFromAPP(request);
+						&& request.getHeader("X-Requested-With").indexOf("XMLHttpRequest") > -1);
 	}
 
-	/**
-	 * 
-	 * @param request
-	 * @return true if App request
-	 */
-	public boolean isFromAPP(HttpServletRequest request) {
-		return request.getHeader("User-Agent") != null && request.getHeader("User-Agent").indexOf(appName) > -1;
-	}
+
 
 	/**
 	 * response 输出JSON
-	 * 
-	 * @param hresponse
-	 * @param resultMap
+	 *
 	 * @throws IOException
 	 */
 	public void out(HttpServletResponse response, Result res) {
@@ -65,7 +52,5 @@ public class ShiroFilterUtils {
 		}
 	}
 
-	public void setAppName(String appName) {
-		this.appName = appName;
-	}
+
 }

+ 0 - 79
src/main/resources/props/config_dev.properties

@@ -1,79 +0,0 @@
-#Driver
-jdbc.driverClassName=com.mysql.jdbc.Driver
-#\u6570\u636E\u5E93\u94FE\u63A5\uFF0C
-jdbc.url=jdbc:mysql://123.57.207.214:3306/pro_aft_test?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#\u5E10\u53F7
-jdbc.username=xiaolong
-#\u5BC6\u7801
-jdbc.password=!qaz2wsx
-#\u68C0\u6D4B\u6570\u636E\u5E93\u94FE\u63A5\u662F\u5426\u6709\u6548\uFF0C\u5FC5\u987B\u914D\u7F6E
-jdbc.validationQuery=SELECT 'x'
-#\u521D\u59CB\u8FDE\u63A5\u6570
-jdbc.initialSize=3
-#\u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
-jdbc.maxActive=20
-#\u53BB\u6389\uFF0C\u914D\u7F6E\u6587\u4EF6\u5BF9\u5E94\u53BB\u6389
-#jdbc.maxIdle=20
-#\u914D\u7F6E0,\u5F53\u7EBF\u7A0B\u6C60\u6570\u91CF\u4E0D\u8DB3\uFF0C\u81EA\u52A8\u8865\u5145\u3002
-jdbc.minIdle=0
-#\u83B7\u53D6\u94FE\u63A5\u8D85\u65F6\u65F6\u95F4\u4E3A1\u5206\u949F\uFF0C\u5355\u4F4D\u4E3A\u6BEB\u79D2\u3002
-jdbc.maxWait=120000
-#\u83B7\u53D6\u94FE\u63A5\u7684\u65F6\u5019\uFF0C\u4E0D\u6821\u9A8C\u662F\u5426\u53EF\u7528\uFF0C\u5F00\u542F\u4F1A\u6709\u635F\u6027\u80FD\u3002
-jdbc.testOnBorrow=false
-#\u5F52\u8FD8\u94FE\u63A5\u5230\u8FDE\u63A5\u6C60\u7684\u65F6\u5019\u6821\u9A8C\u94FE\u63A5\u662F\u5426\u53EF\u7528\u3002
-jdbc.testOnReturn=false
-#\u6B64\u9879\u914D\u7F6E\u4E3Atrue\u5373\u53EF\uFF0C\u4E0D\u5F71\u54CD\u6027\u80FD\uFF0C\u5E76\u4E14\u4FDD\u8BC1\u5B89\u5168\u6027\u3002\u610F\u4E49\u4E3A\uFF1A\u7533\u8BF7\u8FDE\u63A5\u7684\u65F6\u5019\u68C0\u6D4B\uFF0C\u5982\u679C\u7A7A\u95F2\u65F6\u95F4\u5927\u4E8EtimeBetweenEvictionRunsMillis\uFF0C\u6267\u884CvalidationQuery\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548\u3002
-jdbc.testWhileIdle=true
-#1.Destroy\u7EBF\u7A0B\u4F1A\u68C0\u6D4B\u8FDE\u63A5\u7684\u95F4\u9694\u65F6\u95F4
-#2.testWhileIdle\u7684\u5224\u65AD\u4F9D\u636E
-jdbc.timeBetweenEvictionRunsMillis=60000
-#\u4E00\u4E2A\u94FE\u63A5\u751F\u5B58\u7684\u65F6\u95F4\uFF08\u4E4B\u524D\u7684\u503C\uFF1A25200000\uFF0C\u8FD9\u4E2A\u65F6\u95F4\u6709\u70B9BT\uFF0C\u8FD9\u4E2A\u7ED3\u679C\u4E0D\u77E5\u9053\u662F\u600E\u4E48\u6765\u7684\uFF0C\u6362\u7B97\u540E\u7684\u7ED3\u679C\u662F\uFF1A25200000/1000/60/60 = 7\u4E2A\u5C0F\u65F6\uFF09
-jdbc.minEvictableIdleTimeMillis=300000
-#\u94FE\u63A5\u4F7F\u7528\u8D85\u8FC7\u65F6\u95F4\u9650\u5236\u662F\u5426\u56DE\u6536
-jdbc.removeAbandoned=true
-#\u8D85\u8FC7\u65F6\u95F4\u9650\u5236\u65F6\u95F4\uFF08\u5355\u4F4D\u79D2\uFF09\uFF0C\u76EE\u524D\u4E3A5\u5206\u949F\uFF0C\u5982\u679C\u6709\u4E1A\u52A1\u5904\u7406\u65F6\u95F4\u8D85\u8FC75\u5206\u949F\uFF0C\u53EF\u4EE5\u9002\u5F53\u8C03\u6574\u3002
-jdbc.removeAbandonedTimeout=300
-#\u94FE\u63A5\u56DE\u6536\u7684\u65F6\u5019\u63A7\u5236\u53F0\u6253\u5370\u4FE1\u606F\uFF0C\u6D4B\u8BD5\u73AF\u5883\u53EF\u4EE5\u52A0\u4E0Atrue\uFF0C\u7EBF\u4E0A\u73AF\u5883false\u3002\u4F1A\u5F71\u54CD\u6027\u80FD\u3002
-jdbc.logAbandoned=true
-#\u7EDF\u8BA1\u76D1\u63A7
-jdbc.filters=stat
-
-jedis.host=localhost
-jedis.port=6379
-jedis.timeout=5000
-jedis.password=aft@2016!redis$
-
-pwd.hash_algorithm_name=md5
-pwd.hash_iterations=2
-
-session.timeout=12000000
-session.validate.timespan=18000000
-
-app.name=AFT
-
-static.host=//afts.hnzhiming.com/1.0.44
-
-upload.path=/data/wwwroot/aft/upload
-upload.private.path=/data/upload
-
-accessKey=LTAIqTgQLLwz252Z
-accessSecret=ICGuiUnqzaar7urw4zecVcJrJ1MHg9
-
-avatar.host=//afts.hnzhiming.com
-
-aesSecretKey=aft1234567890123
-
-template.cacheable=false
-
-mobileCodeTemplate=SMS_37845022
-mobileRemindCodeTemplate=SMS_137421952
-
-portal.host=//afts.hnzhiming.com/portal/2.0.0
-
-patentTemplate=SMS_72005286
-
-avatar.upload.host=//afts.hnzhiming.com/upload
-
-easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
-easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA
-easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE

+ 6 - 42
src/main/resources/props/config_local.properties

@@ -1,12 +1,11 @@
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
-#jdbc.url=jdbc\:mysql://localhost:3306/aft20220318?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.url=jdbc\:mysql://localhost:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
-#jdbc.username=root
-#jdbc.password=123456
-jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc\:mysql://localhost:3306/kd_rd?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 jdbc.username=root
-jdbc.password=aftdev
+jdbc.password=123456
+#jdbc.url=jdbc:mysql://101.37.32.31:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+#jdbc.username=root
+#jdbc.password=aftdev
 jdbc.validationQuery=SELECT 'x'
 jdbc.initialSize=3
 jdbc.maxActive=20
@@ -36,32 +35,11 @@ pwd.hash_iterations=2
 session.timeout=12000000
 session.validate.timespan=18000000
 
-app.name=AFT
-template.cacheable=false
-user.receive.max=10
-user.private.max=1000
-#\u63D0\u524D\u63D0\u9192\u5929\u6570
-user_remind_days=15
-#\u63D0\u524D\u63D0\u9192\u5929\u6570
-user_channel_days=90
-#\u5BA2\u6237\u9650\u5236
-yxzj_max=800
-yxy_max=100
-yxjl_max=100
 
-amb.maxLvl=6
+
 
 avatar.host=//static.jishutao.com
 static.host=//static.jishutao.com/1.2.50
-#avatar.host=//172.16.0.255:3000
-#static.host=//172.16.0.255:3000/1.2.27
-#static.host=http://172.16.1.187/prod/1.2.25
-
-wx.appId=wxff2f5720ed7d7f63
-wx.appSecret=081744369d42405be58fe37f892631f7
-#developer\u4E3A\u5F00\u53D1\u7248\uFF1Btrial\u4E3A\u4F53\u9A8C\u7248\uFF1Bformal\u4E3A\u6B63\u5F0F\u7248\uFF1B
-wx.state=trial
-wx.clockInRange=1000
 
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
@@ -69,18 +47,4 @@ avatar.upload.host=//sb.jishutao.com/upload
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload
 
-accessKey=LTAIqTgQLLwz252Z
-accessSecret=ICGuiUnqzaar7urw4zecVcJrJ1MHg9
-aesSecretKey=aft1234567890123
-
-mobileCodeTemplate=SMS_37845022
-mobileRemindCodeTemplate=SMS_137421952
-patentTemplate=SMS_72005286
-
-easemob.client.url=https://a1.easemob.com/1117170814115609/jitao
-easemob.client.id=YXA6RUDGkIDSEeemq9_4PWzcNA
-easemob.client.secret=YXA61NHE0renI5N8gEgizoI5ivM9SYE
 
-jiguang.appKey=dbcea43366e038073452a04e
-jiguang.masterSecret=59792298288e4f635c737def
-jiguang.pushUrl=https://api.jpush.cn/v3/push

+ 2 - 10
src/main/resources/spring/spring-mvc.xml

@@ -58,13 +58,6 @@
 	</bean>
 
 
-	<!-- Handles HTTP GET requests for /assets/** by efficiently serving up
-		static resources in the ${webappRoot}/assets directory -->
-	<mvc:resources mapping="/static/images/**" location="/WEB-INF/images/" />
-	<mvc:resources mapping="/static/html/**" location="/WEB-INF/html/" />
-	<mvc:resources mapping="/static/**" location="/WEB-INF/build/" />
-	<mvc:resources mapping="/favicon.ico" location="/WEB-INF/assets/favicon.ico" />
-	<mvc:resources mapping="/robots.txt" location="/WEB-INF/assets/robots.txt" />
 
 	<bean id="templateResolver"
         class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
@@ -73,7 +66,7 @@
         <property name="templateMode" value="HTML" />
         <property name="characterEncoding" value="UTF-8"/>
         <!-- Template cache is set to false (default is true).        -->
-        <property name="cacheable" value="${template.cacheable}" />
+        <property name="cacheable" value="false" />
     </bean>
 
     <bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
@@ -148,11 +141,10 @@
 			</props>
 		</property>
 	</bean>
+
 	<bean id="shiroFilterUtils" class="com.goafanti.core.shiro.filter.ShiroFilterUtils" scope="singleton">
-		<property name="appName" value="${app.name}" />
 	</bean>
 
 
 
-
 </beans>