소스 검색

一期修改:收费站无法查看出勤中的检查 收费站无法查看该周期内的扣分列表

温红权 8 년 전
부모
커밋
5ad07473c7

+ 27 - 14
VisualInspection/js/statistics/change_attendance.js

@@ -27,7 +27,7 @@ $(function() {
             // 检索
             // 检索
             getFsWorkInfo(0);
             getFsWorkInfo(0);
         }, userId);
         }, userId);
-    },true);
+    }, true);
 
 
     $.jeDate("#sel_month", {
     $.jeDate("#sel_month", {
         isinitVal: true,
         isinitVal: true,
@@ -65,15 +65,15 @@ $(function() {
         // if (center_manage_id == '') {
         // if (center_manage_id == '') {
         //     $("#fs_station,#fs_employee").html('');
         //     $("#fs_station,#fs_employee").html('');
         // } else {
         // } else {
-            getFsStationList(center_manage_id, function(obj) {
-                $("#fs_station").html(obj);
-                //默认选中第一个
-                $("#fs_station option:first").attr("selected", 'selected');
-                if (roleContains("STATION")) {
-                    var dept = getCurrentUser().organid;
-                    $("#fs_station").val(dept);
-                }
-            },true);
+        getFsStationList(center_manage_id, function(obj) {
+            $("#fs_station").html(obj);
+            //默认选中第一个
+            $("#fs_station option:first").attr("selected", 'selected');
+            if (roleContains("STATION")) {
+                var dept = getCurrentUser().organid;
+                $("#fs_station").val(dept);
+            }
+        }, true);
         // }
         // }
     })
     })
 
 
@@ -155,15 +155,28 @@ function getTableContent(obj, seq) {
             class_type = d;
             class_type = d;
         }
         }
 
 
+        var normal = false;
+
+        if (roleContains("STATION")) {
+            normal = true;
+        }
+        if (roleContains("ROAD_MANAGER")) {
+            normal = true;
+        }
+        if (hasRole("ROLE_STATION")) {
+            normal = true;
+        }
+
+
         for (var i = 26; i <= days; i++) {
         for (var i = 26; i <= days; i++) {
             if (map_class[i + "-" + class_type] != undefined) {
             if (map_class[i + "-" + class_type] != undefined) {
                 if (map_class[i + "-" + class_type] == 1) {
                 if (map_class[i + "-" + class_type] == 1) {
                     class_html[d] += '<td>/</td width="20px">';
                     class_html[d] += '<td>/</td width="20px">';
                 } else {
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                     }
 
 
                 }
                 }
@@ -177,9 +190,9 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                     }
                 }
                 }
             } else {
             } else {

+ 26 - 14
VisualInspection/js/statistics/common_attendance.js

@@ -32,7 +32,7 @@ $(function() {
                 // 检索
                 // 检索
                 getFsWorkInfo(0);
                 getFsWorkInfo(0);
             }, userId);
             }, userId);
-        },true);
+        }, true);
 
 
         // 当初始化月份值
         // 当初始化月份值
         var months = month_method_2();
         var months = month_method_2();
@@ -67,15 +67,15 @@ $(function() {
             // if (center_manage_id == '') {
             // if (center_manage_id == '') {
             //     $("#fs_station,#fs_employee").html('');
             //     $("#fs_station,#fs_employee").html('');
             // } else {
             // } else {
-                getFsStationList(center_manage_id, function(obj) {
-                    $("#fs_station").html(obj);
-                    //默认选中第一个
-                    $("#fs_station option:first").attr("selected", 'selected');
-                    if (roleContains("STATION")) {
-                        var dept = getCurrentUser().organid;
-                        $("#fs_station").val(dept);
-                    }
-                },true);
+            getFsStationList(center_manage_id, function(obj) {
+                $("#fs_station").html(obj);
+                //默认选中第一个
+                $("#fs_station option:first").attr("selected", 'selected');
+                if (roleContains("STATION")) {
+                    var dept = getCurrentUser().organid;
+                    $("#fs_station").val(dept);
+                }
+            }, true);
             // }
             // }
         })
         })
 
 
@@ -156,6 +156,17 @@ function getTableContent(obj, seq) {
         if (d != 0) {
         if (d != 0) {
             class_type = d;
             class_type = d;
         }
         }
+        var normal = false;
+
+        if (roleContains("STATION")) {
+            normal = true;
+        }
+        if (roleContains("ROAD_MANAGER")) {
+            normal = true;
+        }
+        if (hasRole("ROLE_STATION")) {
+            normal = true;
+        }
 
 
         for (var i = 26; i <= days; i++) {
         for (var i = 26; i <= days; i++) {
             if (map_class[i + "-" + class_type] != undefined) {
             if (map_class[i + "-" + class_type] != undefined) {
@@ -163,9 +174,9 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                     }
                 }
                 }
             } else {
             } else {
@@ -178,10 +189,11 @@ function getTableContent(obj, seq) {
                     class_html[d] += '<td width="20px">/</td>';
                     class_html[d] += '<td width="20px">/</td>';
                 } else {
                 } else {
                     if (map_class[i + "-" + class_type] == 3) {
                     if (map_class[i + "-" + class_type] == 3) {
-                        class_html[d] += '<td class="b-grey" width="20px"></td>';
+                        class_html[d] += '<td  ' + (normal ? "" : "class='b-grey'") + ' width="20px"></td>';
                     } else {
                     } else {
-                        class_html[d] += '<td class="b-grey" width="20px">/</td>';
+                        class_html[d] += '<td ' + (normal ? "" : "class='b-grey'") + ' width="20px">/</td>';
                     }
                     }
+
                 }
                 }
             } else {
             } else {
                 class_html[d] += '<td width="20px"></td>';
                 class_html[d] += '<td width="20px"></td>';

+ 28 - 7
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -1,15 +1,15 @@
 package com.xintong.visualinspection.controller;
 package com.xintong.visualinspection.controller;
 
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 import com.xintong.system.err.BusinessException;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.*;
 import com.xintong.visualinspection.bean.*;
 import com.xintong.visualinspection.pojo.StatisiticPojo;
 import com.xintong.visualinspection.pojo.StatisiticPojo;
 import com.xintong.visualinspection.pojo.StatisticExUser;
 import com.xintong.visualinspection.pojo.StatisticExUser;
 import com.xintong.visualinspection.pojo.UserRankingData;
 import com.xintong.visualinspection.pojo.UserRankingData;
+import com.xintong.visualinspection.util.AuthorUtil;
 import com.xintong.visualinspection.util.CacheUtil;
 import com.xintong.visualinspection.util.CacheUtil;
+import com.xintong.visualinspection.util.Constants;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -18,6 +18,8 @@ import com.github.pagehelper.PageInfo;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.util.CodeUtil;
 import com.xintong.visualinspection.util.CodeUtil;
 
 
+import javax.servlet.http.HttpServletRequest;
+
 /**
 /**
  * 文件名:StatisticsController
  * 文件名:StatisticsController
  * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
  * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
@@ -289,11 +291,30 @@ public class StatisticsController extends BaseController {
      * 获取收费站具体某个人的扣分详情
      * 获取收费站具体某个人的扣分详情
      */
      */
     @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
     @RequestMapping(value = "/one/checkedItem/detail/info/{page}/{size}")
-    public String getFsOnePersonCheckedItemDetailInfo(@RequestBody StatisticsBean obj,@PathVariable Integer page,@PathVariable Integer size){
+    public String getFsOnePersonCheckedItemDetailInfo(HttpServletRequest request, @RequestBody StatisticsBean obj, @PathVariable Integer page, @PathVariable Integer size){
     	//PageHelper.offsetPage(page, size);
     	//PageHelper.offsetPage(page, size);
-    	PageHelper.startPage(page, size);
-    	List<StatisticsBean> returnList=  statisticsService.getOneCheckedDetailInfo(obj);
-    	return super.returnSuccessResult(new PageInfo(returnList));
+        boolean isshow = true;
+        //获取个人权限
+        User user = getCurrentUser(request);
+        if(AuthorUtil.hasRole(user, Constants.ROLE_STATION_ADMIN)
+                ||AuthorUtil.hasRole(user, Constants.ROLE_STATION)
+                ||AuthorUtil.hasRole(user, Constants.ROLE_STATION_AGENT)
+                ||AuthorUtil.containsRole(user, "ROLE_STATION")){
+            //判断是否是单钱周期
+            Date a = new Date();
+            if(obj.getEnd_date()!=null && obj.getEnd_date().getTime()>a.getTime()){
+                isshow = false;
+            }
+        }
+
+        if(isshow){
+            PageHelper.startPage(page, size);
+            List<StatisticsBean> returnList=  statisticsService.getOneCheckedDetailInfo(obj);
+            return super.returnSuccessResult(new PageInfo(returnList));
+        }else{
+            return super.returnSuccessResult(new PageInfo(new ArrayList<StatisticsBean>()));
+        }
+
     }
     }
     
     
     
     

+ 4 - 4
VisualInspection_server/src/main/resources/application.properties

@@ -3,7 +3,7 @@ spring.thymeleaf.cache=false
 context.listener.classes=com.xintong.SystemInit
 context.listener.classes=com.xintong.SystemInit
 
 
 #master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
-master.datasource.url = jdbc:mysql://git.topm.win:9003/visualinspection?useUnicode=true&characterEncoding=utf-8
+master.datasource.url = jdbc:mysql://127.0.0.1:7004/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf-8
 #master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf-8
 master.datasource.username = root
 master.datasource.username = root
@@ -13,7 +13,7 @@ master.mapper-locations=classpath:com/xintong/visualinspection/mapper/master/*.x
 
 
 ## \u7528\u6237\u6570\u636E\u6E90\u914D\u7F6E
 ## \u7528\u6237\u6570\u636E\u6E90\u914D\u7F6E
 #cluster.datasource.url=jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf8
 #cluster.datasource.url=jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf8
-cluster.datasource.url=jdbc:mysql://git.topm.win:9003/visualinspection?useUnicode=true&characterEncoding=utf8
+cluster.datasource.url=jdbc:mysql://127.0.0.1:7004/visualinspection?useUnicode=true&characterEncoding=utf8
 #cluster.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #cluster.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
 #cluster.datasource.url=jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf8
 #cluster.datasource.url=jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf8
 cluster.datasource.username=root
 cluster.datasource.username=root
@@ -57,12 +57,12 @@ spring.datasource.useGlobalDataSourceStat=true
 spring.redis.database=0  
 spring.redis.database=0  
 # Redis\u670D\u52A1\u5668\u5730\u5740
 # Redis\u670D\u52A1\u5668\u5730\u5740
 #spring.redis.host=10.112.0.199
 #spring.redis.host=10.112.0.199
-spring.redis.host=git.topm.win
+spring.redis.host=127.0.0.1
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
 #spring.redis.port=6379
 #spring.redis.port=6379
 
 
 #spring.redis.port=7003
 #spring.redis.port=7003
-spring.redis.port=9004
+spring.redis.port=7006
 #spring.redis.port=6380
 #spring.redis.port=6380
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
 spring.redis.password=xintong
 spring.redis.password=xintong