Commit d32580b57f87c06aee55aedf506491b9b5bed103
1 parent
8ba098bf
1.当前执行班次接口加入实际发车时间信息
Showing
5 changed files
with
42 additions
and
2 deletions
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
| @@ -67,6 +67,9 @@ public class AdminUtilsController { | @@ -67,6 +67,9 @@ public class AdminUtilsController { | ||
| 67 | @Autowired | 67 | @Autowired |
| 68 | private BasicData.BasicDataLoader basicDataLoader; | 68 | private BasicData.BasicDataLoader basicDataLoader; |
| 69 | 69 | ||
| 70 | + @Autowired | ||
| 71 | + private SQLInjectFilter sqlInjectFilter; | ||
| 72 | + | ||
| 70 | /** | 73 | /** |
| 71 | * 出现重复班次的车辆 | 74 | * 出现重复班次的车辆 |
| 72 | * | 75 | * |
| @@ -320,4 +323,17 @@ public class AdminUtilsController { | @@ -320,4 +323,17 @@ public class AdminUtilsController { | ||
| 320 | 323 | ||
| 321 | return "error"; | 324 | return "error"; |
| 322 | } | 325 | } |
| 326 | + | ||
| 327 | + @RequestMapping("/setSqlInjectEnabled") | ||
| 328 | + public String setInjectStr(@RequestParam boolean sqlInjectEnabled) { | ||
| 329 | + Map<String, Object> result = new HashMap<>(); | ||
| 330 | + try { | ||
| 331 | + sqlInjectFilter.setSqlInjectEnabled(sqlInjectEnabled); | ||
| 332 | + return "success"; | ||
| 333 | + } catch (Exception e) { | ||
| 334 | + e.printStackTrace(); | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + return "error"; | ||
| 338 | + } | ||
| 323 | } | 339 | } |
| 324 | \ No newline at end of file | 340 | \ No newline at end of file |
src/main/java/com/bsth/controller/realcontrol/ServiceDataInterface.java
| @@ -99,8 +99,10 @@ public class ServiceDataInterface { | @@ -99,8 +99,10 @@ public class ServiceDataInterface { | ||
| 99 | map.put("qdzName", sch.getQdzName()); | 99 | map.put("qdzName", sch.getQdzName()); |
| 100 | map.put("zdzName", sch.getZdzName()); | 100 | map.put("zdzName", sch.getZdzName()); |
| 101 | map.put("fcsj", sch.getFcsj()); | 101 | map.put("fcsj", sch.getFcsj()); |
| 102 | + map.put("fcsjActualTime", sch.getFcsjActualTime()); | ||
| 102 | map.put("dfsj", sch.getDfsj()); | 103 | map.put("dfsj", sch.getDfsj()); |
| 103 | map.put("zdsj", sch.getZdsj()); | 104 | map.put("zdsj", sch.getZdsj()); |
| 105 | + map.put("zdsjActualTime", sch.getZdsjActualTime()); | ||
| 104 | map.put("bcType", sch.getBcType()); | 106 | map.put("bcType", sch.getBcType()); |
| 105 | map.put("remarks", sch.getRemark()); | 107 | map.put("remarks", sch.getRemark()); |
| 106 | map.put("status", sch.getStatus()); | 108 | map.put("status", sch.getStatus()); |
src/main/java/com/bsth/filter/SQLInjectFilter.java
| 1 | package com.bsth.filter; | 1 | package com.bsth.filter; |
| 2 | 2 | ||
| 3 | +import org.springframework.beans.factory.annotation.Value; | ||
| 3 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
| 4 | 5 | ||
| 5 | import javax.servlet.FilterChain; | 6 | import javax.servlet.FilterChain; |
| @@ -16,15 +17,24 @@ public class SQLInjectFilter extends BaseFilter{ | @@ -16,15 +17,24 @@ public class SQLInjectFilter extends BaseFilter{ | ||
| 16 | 17 | ||
| 17 | private final static String specialUri = "adminUtils"; | 18 | private final static String specialUri = "adminUtils"; |
| 18 | 19 | ||
| 20 | + @Value("${enabled.sqlinject}") | ||
| 21 | + private boolean sqlInjectEnabled; | ||
| 22 | + | ||
| 19 | @Override | 23 | @Override |
| 20 | public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) | 24 | public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) |
| 21 | throws IOException, ServletException { | 25 | throws IOException, ServletException { |
| 26 | + if (!sqlInjectEnabled) { | ||
| 27 | + chain.doFilter(request, response); | ||
| 28 | + return; | ||
| 29 | + } | ||
| 30 | + | ||
| 22 | //获取请求对象中的参数名称 | 31 | //获取请求对象中的参数名称 |
| 23 | Enumeration enu = request.getParameterNames(); | 32 | Enumeration enu = request.getParameterNames(); |
| 24 | String uri = request.getRequestURI(); | 33 | String uri = request.getRequestURI(); |
| 25 | 34 | ||
| 26 | if (uri.indexOf(specialUri) > -1) { | 35 | if (uri.indexOf(specialUri) > -1) { |
| 27 | chain.doFilter(request, response); | 36 | chain.doFilter(request, response); |
| 37 | + return; | ||
| 28 | } | 38 | } |
| 29 | 39 | ||
| 30 | //遍历枚举 | 40 | //遍历枚举 |
| @@ -59,4 +69,12 @@ public class SQLInjectFilter extends BaseFilter{ | @@ -59,4 +69,12 @@ public class SQLInjectFilter extends BaseFilter{ | ||
| 59 | public static void setInjStr(String injStr) { | 69 | public static void setInjStr(String injStr) { |
| 60 | SQLInjectFilter.injStr = injStr; | 70 | SQLInjectFilter.injStr = injStr; |
| 61 | } | 71 | } |
| 72 | + | ||
| 73 | + public boolean isSqlInjectEnabled() { | ||
| 74 | + return sqlInjectEnabled; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public void setSqlInjectEnabled(boolean sqlInjectEnabled) { | ||
| 78 | + this.sqlInjectEnabled = sqlInjectEnabled; | ||
| 79 | + } | ||
| 62 | } | 80 | } |
src/main/resources/application-prod.properties
| @@ -56,4 +56,6 @@ dsm.ack.url= http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm? | @@ -56,4 +56,6 @@ dsm.ack.url= http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm? | ||
| 56 | ## cp ack interface | 56 | ## cp ack interface |
| 57 | cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confirm/ | 57 | cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confirm/ |
| 58 | ## admin mail | 58 | ## admin mail |
| 59 | -admin.mail= 3090342880@qq.com | ||
| 60 | \ No newline at end of file | 59 | \ No newline at end of file |
| 60 | +admin.mail= 3090342880@qq.com | ||
| 61 | +## enabled | ||
| 62 | +enabled.sqlinject= false | ||
| 61 | \ No newline at end of file | 63 | \ No newline at end of file |
src/main/resources/application-test.properties
| @@ -56,4 +56,6 @@ dsm.ack.url= http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm? | @@ -56,4 +56,6 @@ dsm.ack.url= http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm? | ||
| 56 | ## cp ack interface | 56 | ## cp ack interface |
| 57 | cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confirm/ | 57 | cp.ack.url= http://114.80.178.12:8778/prod-api/serverApi/instructionsIssue/confirm/ |
| 58 | ## admin mail | 58 | ## admin mail |
| 59 | -admin.mail= 3090342880@qq.com | ||
| 60 | \ No newline at end of file | 59 | \ No newline at end of file |
| 60 | +admin.mail= 3090342880@qq.com | ||
| 61 | +## enabled | ||
| 62 | +enabled.sqlinject= false | ||
| 61 | \ No newline at end of file | 63 | \ No newline at end of file |