Forráskód Böngészése

Merge branch 'master' of http://git_xt.git.topm.win:8080/wenhongquan/VisualInspection

# Conflicts:
#	VisualInspection/view/mytask/check.html
minitiger 9 éve
szülő
commit
67bc98506a
34 módosított fájl, 540 hozzáadás és 168 törlés
  1. 67 0
      VisualInspection/js/role/addrole.js
  2. 0 1
      VisualInspection/js/role/permision.js
  3. 43 6
      VisualInspection/js/role/role.js
  4. 61 44
      VisualInspection/js/statistics/assess_ranking.js
  5. 0 1
      VisualInspection/js/user/addUser.js
  6. 5 0
      VisualInspection/js/util/const.js
  7. 63 0
      VisualInspection/js/util/service.js
  8. 16 10
      VisualInspection/js/util/video.js
  9. 2 2
      VisualInspection/view/mytask/check.html
  10. 12 5
      VisualInspection/view/role/addrole.html
  11. 3 11
      VisualInspection/view/role/role.html
  12. 43 20
      VisualInspection/view/statistics/emp_ranking.html
  13. 1 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Role.java
  14. 8 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java
  15. 2 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java
  16. 2 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Webcam.java
  17. 5 7
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/DepartmentController.java
  18. 0 6
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/MenuController.java
  19. 6 3
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/RoleController.java
  20. 8 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java
  21. 4 3
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/UserController.java
  22. 1 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/WebcamController.java
  23. 1 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/cluster/WebcamDao.java
  24. 9 9
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml
  25. 6 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/WebcamMapper.xml
  26. 5 4
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/RoleMapper.xml
  27. 8 9
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml
  28. 2 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/DepartmentService.java
  29. 2 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/RoleService.java
  30. 1 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/WebcamService.java
  31. 51 4
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/DepartmentServiceImpl.java
  32. 44 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/RoleServiceImpl.java
  33. 57 12
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java
  34. 2 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/WebcamServiceImpl.java

+ 67 - 0
VisualInspection/js/role/addrole.js

@@ -0,0 +1,67 @@
+ var roletemp=null;
+function loadRoleData(role) {
+    $("#role_name").val("");
+    $("#role_des").val("");
+    $("#role_level").val("");
+
+    if(role!=null && edittype=="edit"){
+         $("#role_name").val(role.name);
+        $("#role_des").val(role.des);
+        $("#role_level").val(role.level);
+        roletemp = role;
+       
+    }
+
+    $("#role_add_btn").on("click", function () {
+        addrole();
+    })
+
+
+}
+
+
+function addrole() {
+
+    var role_name = $("#role_name").val();
+    var role_des = $("#role_des").val();
+    var role_level = $("#role_level").val();
+    
+
+    var data = {
+        "name": role_name,
+        "des": role_des,
+        "level":role_level
+    }
+
+    if (edittype == "add") {
+
+        RoleAdd(data, function (susd) {
+            layer.msg('添加成功!', {
+                time: 2000, //20s后自动关闭
+            }, function () {
+                $('#addRoleModal').modal('hide')
+                getrole(pagesize, 1);
+            });
+        }, function (error) {
+
+        });
+
+    }
+
+    if(edittype=="edit"){
+
+        data.id = roletemp.id;
+        RoleUpdate(data,function(params){
+            layer.msg('修改成功!', {
+                    time: 2000, //20s后自动关闭
+                }, function () {
+                    getrole(pagesize, 1);
+                     $('#addRoleModal').modal('hide')
+                });
+        },function(error){
+
+        });
+    }
+
+
+}

+ 0 - 1
VisualInspection/js/role/permision.js

@@ -120,7 +120,6 @@ $(document).ready(function () {
 
                 })
         }
-
     });
 
 });

+ 43 - 6
VisualInspection/js/role/role.js

@@ -10,6 +10,13 @@ var cols = [{
     type: 'string',
     flex: true,
     colClass: 'text-center'
+},
+{
+    width: 'auto',
+    text: '角色等级',
+    type: 'number',
+    flex: true,
+    colClass: 'text-center'
 }, {
     width: 'auto',
     text: '用户数',
@@ -24,6 +31,9 @@ var cols = [{
     colClass: 'text-center'
 }];
 var pageNo = null;
+var edittype = "add";
+var pagesize = 30;
+var RoleMap = new HashMap()
 $(document).ready(function () {
 
     $("#main_content_title").html("角色管理")
@@ -37,7 +47,31 @@ $(document).ready(function () {
         }
     });
 
-    var pagesize = 15;
+
+    $('.datatable').on('click', 'button', function () {
+        if (this.name == "user_edit") {
+
+            edittype = "edit"
+            loadRoleData(RoleMap.get(parseInt(this.id)));
+
+            $('#addRoleModal').modal('show');
+        }
+        if (this.name == "user_delete") {
+
+            RoleDelete(this.id, function (data) {
+                layer.msg('角色删除成功!', {
+                    time: 2000, //20s后自动关闭
+                }, function () {
+                    getrole(pagesize, 1);
+                });
+            },
+                function (error) {
+
+                })
+        }
+    });
+
+
     if (pageNo == null || pageNo == "") {
         getrole(pagesize, 1);
     } else {
@@ -46,10 +80,11 @@ $(document).ready(function () {
 
 
 
-   $("#add_role_btn").on("click",function(){
-
-       $('#addRoleModal').modal('show');
-   })
+    $("#add_role_btn").on("click", function () {
+        edittype = "add";
+        loadRoleData(null);
+        $('#addRoleModal').modal('show');
+    })
 
 });
 
@@ -66,10 +101,12 @@ function getrole(size, page) {
                 var role = data.list[i];
                 var userdata = {};
                 userdata["checked"] = false;
-                userdata["data"] = [i + 1, role.des, role.usercount, '<button class="btn btn-primary" name="user_edit" id=' + role.id + '><i class="icon icon-edit"></i>修改</button>  <button class="btn btn-primary" name="user_delete" id=' + role.id + ' ><i class="icon icon-remove-circle"></i>删除</button>'];
+                userdata["data"] = [i + 1, role.des,role.level, role.usercount, '<button class="btn btn-primary" name="user_edit" id=' + role.id + '><i class="icon icon-edit"></i>修改</button>  <button class="btn btn-primary" name="user_delete" id=' + role.id + ' ><i class="icon icon-remove-circle"></i>删除</button>'];
                 rowdata.push(userdata);
+                RoleMap.set(role.id,role);
             }
         }
+       
 
         // 使用data参数更新数据:
         $('.datatable').datatable('load', {

+ 61 - 44
VisualInspection/js/statistics/assess_ranking.js

@@ -5,8 +5,8 @@ function queryEmpClick(){
     var start_date = $("#start-time").val();
     var end_date = $("#end-time").val();
     if(start_date==null||start_date==''||start_date==undefined||end_date==null||end_date==''||end_date==undefined){
-        alert("请选择起止日期");
-                return ;
+        tip("请选择起止日期");
+        return ;
     }else{
         start_date += " 00:00:00";
         end_date += " 00:00:00";
@@ -21,29 +21,9 @@ function queryEmpClick(){
         "end_date": end_date,
     }
     var url = "statistics/employee/order";
-    var strTbody='';
-    post_common_service( url,param,function(data){
-                for(var i=0;i<data.length;i++){
-                     strTbody+="<tr>";
-      
-       strTbody+="<td>"+(i+1)+"</td><td>"+"</td>"
-                 +"<td>"+data[i].user.truename+"</td><td>"+"</td>"
-                 +"<td>"+data[i].user.workno+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+data[i].check_all_score+"</td>"
-                 +"<td>"+"</td><td>"+"</td>"
-                 +"<td>"+"</td><td>"+"</td>";
-                 strTbody+="</tr>";
-                }
-       $(".table-tbody").append(strTbody);
-               
-            },function(error){
-                return "" ;
-            });
+    getEmployeeInfos(url,param)
 }
 
-
 function initQueryEmp(){
     // 默认初始化前两天查所有
     var endD = new Date();
@@ -57,30 +37,67 @@ function initQueryEmp(){
         "end_date": end_date,
     }
     var url = "statistics/employee/order";
-    var strTbody='';
-   
+    getEmployeeInfos(url,param);
+}
+
+function getEmployeeInfos(url,param){
     post_common_service( url,param,function(data){
-                for(var i=0;i<data.length;i++){
-                     strTbody+="<tr>";
-      
-       strTbody+="<td>"+(i+1)+"</td><td>"+"</td>"
-                 +"<td>"+data[i].user.truename+"</td><td>"+"</td>"
-                 +"<td>"+data[i].user.workno+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+0+"</td>"
-                 +"<td>"+0+"</td><td>"+data[i].check_all_score+"</td>"
-                 +"<td>"+"</td><td>"+"</td>"
-                 +"<td>"+"</td><td>"+"</td>";
-                 strTbody+="</tr>";
-                }
-       $(".table-tbody").append(strTbody);
-               
-            },function(error){
-                return "" ;
-            });
-    
+        var strTbody='';
+        for(var i=0;i<data.length;i++){
+            strTbody+="<tr><td width='67px;'>"+(i+1)+"</td><td width='87px;'>"+data[i].user.fee_station_name+"</td>"
+                +"<td width='67px;'>"+data[i].user.truename+"</td><td width='67px;'>"+"</td>"
+                +"<td width='77px;'>"+data[i].user.workno+"</td><td width='67px;'>"+ getItemScore(data[i], '环境') +"</td>"
+                +"<td width='67px;'>"+getItemScore(data[i], '仪容仪表')+"</td><td width='67px;'>"+getItemScore(data[i], '表情')+"</td>"
+                +"<td width='67px;'>"+getItemScore(data[i], '动作')+"</td><td width='67px;'>"+getItemScore(data[i], '文明用语')+"</td>"
+                +"<td width='67px;'>"+ getItemScore(data[i], '工作纪律') +"</td><td width='67px;'>"+data[i].check_all_score+"</td>"
+                +"<td width='67px;'>"+filter(data[i].checked_num,'0')+"</td><td width='67px;'>"+average(data[i])+"</td>"
+                +"<td width='75px;'>"+"</td><td>"+"</td></tr>";
+        }
+       $(".table-tbody").append(strTbody);   
+    },function(error){
+        return "" ;
+    });
+}
+
+function average(obj){
+    if(filter(obj.checked_num,'0') == 0){
+        return 0 ;
+    }else{
+        return obj.check_all_score / filter(obj.checked_num,'1')
+    }
 }
 
+/**
+ * 过滤undefined
+ * @param {*} value 
+ * @param {*} default_display_value 
+ */
+function filter(value , default_display_value){
+    if(value!='' && value!=undefined ){
+        return value ;
+    }else if(default_display_value != undefined){
+        return default_display_value ;
+    }else{
+        return "" ;
+    }
+}
+
+/**
+ * 获取扣分详情
+ * @param {*} obj 
+ * @param {*} check_item_name 
+ */
+function getItemScore(obj, check_item_name){
+    var names = obj.checked_socre_name ;
+    var scores = obj.checked_score ;
+
+    for(var i=0;i<names.length ;i++){
+        if( names[i].indexOf(check_item_name) > -1){
+            return scores[i] ;
+        }
+    }
+    return 0 ;
+}
 
 
 

+ 0 - 1
VisualInspection/js/user/addUser.js

@@ -152,7 +152,6 @@ function addUser() {
         "idno": useridno,
         "email": useremail,
         "pic": userpic,
-        "birth": userbirth,
         "organid": dept_selectinput.value,
         "positionid": 1,
         "truename": usertruename,

+ 5 - 0
VisualInspection/js/util/const.js

@@ -39,9 +39,14 @@ var PERMISION_ROLE_DELETE = "/permission/deleteRolePermission"
 var ROLE_GET_ALL = "/role/get/all/"
 var ROLE_GET_ALL_DATA = "/role/get/alldata/"
 var ROLE_GET_BY_PERMISION = "/role/getRoleByPermision/"
+var ROLE_ADD = "/role/addRole"
+var ROLE_EDIT = "/role/updateRole/"
+var ROLE_DELETE = "/role/deleteRole/"
 
 
 
+var VIDEO_GET_ID = "/webcam/getVideoById/"
+
 
 
 //File

+ 63 - 0
VisualInspection/js/util/service.js

@@ -279,6 +279,22 @@ function getConstantList(url, param, success, fail) {
     });
 }
 
+
+function VideoGetById(id, success, fail) {
+    var url = base_server_url + VIDEO_GET_ID +id;
+    ajaxGet(url, "", function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            success(data.result_data)
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
+
 function no_return_common_service(url, param, success, fail) {
     var url = base_server_url + url;
     ajaxPost(url, param, function(response) {
@@ -368,6 +384,53 @@ function RoleGetALLNoData(success, fail) {
     });
 }
 
+function RoleAdd(data,success, fail) {
+    var url = base_server_url + ROLE_ADD;
+    ajaxPost(url, data, function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            success(data.result_data)
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
+function RoleUpdate(data,success, fail) {
+    var url = base_server_url + ROLE_EDIT+data.id;
+    ajaxPut(url, data, function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            success(data.result_data)
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
+function RoleDelete(roleid,success, fail) {
+    var url = base_server_url + ROLE_DELETE +roleid;
+    ajaxDelete(url, "", function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            success(data.result_data)
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
+
+
+
+
+
 function RoleGetByPermision(permisionid,success, fail) {
     var url = base_server_url + ROLE_GET_BY_PERMISION+permisionid;
     ajaxGet(url, "", function(response) {

+ 16 - 10
VisualInspection/js/util/video.js

@@ -8,22 +8,28 @@ function doAction(func){
 }
 
 function queryVideoList(){
-    console.log("视屏:"+curVideo);
-    //alert(curVideo);
-    if(!curVideo) {
-        var videos = $.checkTask.video_id.split(',');
-        curVideo = videos[0];
-        //alert(curVideo);
-    }
-    // alert(curVideo);
+
+    var videos = $.checkTask.video_id.split(',');
+    curVideo = videos[0];
+
     if(curVideo) {
         s1 = $.checkTask.start_time.replace(/-/g,"/");
         var startTime = new Date(s1).getTime()/1000;
         s1 = $.checkTask.end_time.replace(/-/g,"/");
         var endTime = new Date(s1).getTime()/1000;
+     
+        //获取摄像头信息
+        VideoGetById(curVideo,function(data){
+            if(data!=null && typeof(data)!="undefined"){
+                var str = curVideo+'|'+startTime+'|'+endTime+'|'+data.cameratype+'|'+data.playtype;
+                callFunc("findvideolist",str);
+            }
+        },function(error){
+
+        });
+
         // alert(curVideo);
-        var str = 120+'|'+startTime+'|'+endTime;
-        callFunc("findvideolist",str);
+        
     }else{
 
     }

+ 2 - 2
VisualInspection/view/mytask/check.html

@@ -50,13 +50,13 @@
                             <div class="tab-pane" id="tabContent3" class="col-sm-12">
                             </div>
                         </div>
-                        <div class="row" class="col-md-12" style="padding:5px;margin-top:30px;text-align:center">
+                        <div class="row" class="col-md-12" style="padding:5px;margin-top:5px;text-align:center">
                             <input id="ex1" class="col-md-12"  type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0"/>
                         </div>
                         <div class="row" style="padding:0 10px;margin-top:5px;text-align:center">
                             <select class="form-control" id="video_list" style="width:200px;float:left;"></select>
                             <div class="btn-group" style="float:right;">
-                                <button type="button" class="btn btn-info" onclick="doAction('play')"><i class="icon icon-play-circle icon-2x"></i></button>
+                                <button type="button" class="btn btn-info" onclick="doAction('start')"><i class="icon icon-play-circle icon-2x"></i></button>
                                 <button type="button" class="btn btn-info" onclick="doAction('stop')"><i class="icon icon-pause icon-2x"></i></button>
                                 <button type="button" class="btn btn-info" onclick="doAction('fast')"><i class="icon icon-forward icon-2x"></i></button>
                                 <button type="button" class="btn btn-info" onclick="doAction('slow')"><i class="icon icon-backward icon-2x"></i></button>

+ 12 - 5
VisualInspection/view/role/addrole.html

@@ -11,17 +11,24 @@
 <div class="container-fluid ">
     <form class="form-horizontal">
        
-
         <div class="form-group">
-            <label for="exampleInputPassword4" class="col-sm-2">角色:</label>
+            <label for="exampleInputAccount4" class="col-sm-2">名称:</label>
             <div class="col-md-6 col-sm-10">
-                <div id="role_select">角色</div>
+                <input type="text" id="role_name" class="form-control" id="code_flag" placeholder="ROLE_JICHA_M/C_T  权限_部门_人员_子部门_人员">
             </div>
         </div>
+
          <div class="form-group">
-            <label for="exampleInputAccount4" class="col-sm-2">权限:</label>
+            <label for="exampleInputAccount4" class="col-sm-2">描述:</label>
+            <div class="col-md-6 col-sm-10">
+                <input type="text" id="role_des" class="form-control" id="code_flag" placeholder="超级管理员">
+            </div>
+        </div>
+
+        <div class="form-group">
+            <label for="exampleInputAccount4" class="col-sm-2">等级:</label>
             <div class="col-md-6 col-sm-10">
-                <input type="text" id="permission_mod" class="form-control" id="code_flag" placeholder="1-读写 2-读 3-删除 ">
+                <input type="number" id="role_level" class="form-control" id="code_flag" placeholder="数值越小等级越大">
             </div>
         </div>
     </form>

+ 3 - 11
VisualInspection/view/role/role.html

@@ -4,17 +4,8 @@
 <script type="text/javascript" src="/js/role/role.js?__inline"></script>
 <div class="container-fluid " style="padding-left:0;padding-right:0">
     <div class="row" style="padding-left:10px;padding-right:10px">
-        <div class="col-md-6">
-            <div class="row">
-                <div class="col-md-2">
-                    <p style="line-height:32px;text-align: right;">关键词</p>
-                </div>
-                <div class="col-md-6"><input type="text" class="form-control" placeholder="关键词"></div>
-                <div class="col-md-2"><button class="btn btn-primary" type="button">查询</button></div>
-            </div>
-
-        </div>
-        <div class="col-md-6">
+ 
+        <div class="col-md-12">
 
             <button class="btn btn-primary" id="add_role_btn" style="float:right" type="button">添加角色</button>
 
@@ -36,6 +27,7 @@
                 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                 <h4 class="modal-title">添加角色</h4>
             </div>
+             
             <div class="modal-body">
                 <link rel="import" href="/view/role/addrole.html?__inline">
             </div>

+ 43 - 20
VisualInspection/view/statistics/emp_ranking.html

@@ -24,33 +24,56 @@
     <div class="table-title"><span>温馨服务考核情况反馈表(所有员工排名)</span></div>
 
     <div class="row">
-          <!-- 使用一个div来显示数据表格 -->
-          <div class="datatable" data-checkable="false" data-sortable="false">
-              <div class="table-head" >
-                  <table border="1" width="100%" height="90px" align="center">
-                      <thead class="table-thead" align="center">
-                  <tr>
-                  <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="67px">站名</th><th rowspan="2" width="67px">姓名</th>
-                  <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="67px">工号</th><th colspan="7" height="40px">考核扣分</th>
-                  <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th>
-                  <th rowspan="2" width="75px">服务评价</th><th rowspan="2" width="75px">备注</th>
-                  </tr>
-                  <tr> 
-                  <th width="67px">环境卫生</th><th width="67px">仪容仪表</th><th width="67px">表情</th>
-                  <th width="67px">收费动作</th><th width="67px">文明用语</th><th width="67px">工作纪律</th>
-                  <th width="67px">扣分合计</th>
-                  </tr>
-                      </thead>
-                      <tbody class="table-tbody" style="background:white" align="center">
+          <!-- 使用一个div来显示数据表格   -->
+          <div class="datatable" data-checkable="false" style="margin-bottom: 0px;margin-right:10px;" data-sortable="false">
+                <div class="table-head"  > 
+                    <table border="1" width="100%"  align="center">
+                        <thead class="table-thead" align="center">
+                            <tr>
+                            <th rowspan="2" width="67px;">序号</th><th rowspan="2" width="87px">站名</th><th rowspan="2" width="67px">姓名</th>
+                            <th rowspan="2" width="67px">岗位</th><th rowspan="2" width="77px">工号</th><th colspan="7" height="40px">考核扣分</th>
+                            <th rowspan="2" width="67px">受检次数</th><th rowspan="2" width="67px">平均扣分(千分制)</th>
+                            <th rowspan="2" width="75px">服务评价</th><th rowspan="2">备注</th>
+                            </tr>
+                            <tr> 
+                            <th width="67px">环境卫生</th><th width="67px">仪容仪表</th><th width="67px">表情</th>
+                            <th width="67px">收费动作</th><th width="67px">文明用语</th><th width="67px">工作纪律</th>
+                            <th width="67px">扣分合计</th>
+                            </tr>
+                        </thead>
+                       
 
-                      </tbody>
+                    </table>
+                </div>
+            </div>
+            <div id="scrollTable" style="height:300px;overflow:scroll;">
+                 <table style="border-top:0;" border="1" width="100%"  align="center">
+                    <thead class="table-thead" style="height:0;" align="center">
+                        <tr style="display:none;">
+                            <th rowspan="2" width="67px;"></th><th rowspan="2" width="77px"></th><th rowspan="2" width="67px"></th>
+                            <th rowspan="2" width="67px"></th><th rowspan="2" width="67px"></th><th colspan="7" height="40px"></th>
+                            <th rowspan="2" width="67px"></th><th rowspan="2" width="67px"></th>
+                            <th rowspan="2" width="75px"></th><th rowspan="2" width="75px"></th>
+                        </tr>
+                        <tr style="display:none;"> 
+                            <th width="67px"></th><th width="67px"></th><th width="67px"></th>
+                            <th width="67px"></th><th width="67px"></th><th width="67px"></th>
+                            <th width="67px"></th>
+                        </tr>
+                    </thead>
+                    <tbody class="table-tbody" style="background:white; " align="center">
 
-                  </table></div>
+                    </tbody>   
+                 </table>  
             </div>
     </div>
 </div>
 <script>
     $(document).ready(function() {
+
+        // 设置滚动表格的高度
+        $("#scrollTable").height(  document.body.clientHeight  - 360 );
+
         // 仅选择日期
         $("#start-time").datetimepicker(
         {

+ 1 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Role.java

@@ -12,4 +12,5 @@ public class Role {
     private String des;
     private String name;
     private Integer mod;
+    private Integer level;
 }

+ 8 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java

@@ -1,6 +1,8 @@
 package com.xintong.visualinspection.bean;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -39,6 +41,8 @@ public class StatisticsBean {
 
     private Integer checked_num;
     
+    private Integer checked_people_num ;
+    
     private Integer people_num;
     
     private int score_fifteen;
@@ -48,4 +52,8 @@ public class StatisticsBean {
     private int score_over_fifty ;
     
     private int all_check_score ;
+    
+    private List<String> checked_socre_name = new ArrayList<>() ;
+    
+    private List<Integer> checked_score = new ArrayList<>() ;
 }

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java

@@ -75,6 +75,8 @@ public class User implements UserDetails {
 	private String email;
 	private String pic;
 	
+	private String fee_station_name ;
+	
 	private List<String> roleids;
 
 	private List<Role> roles;

+ 2 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Webcam.java

@@ -34,6 +34,8 @@ public class Webcam {
 	private String ip;
 	private Integer port;
 	private Integer channel;
+	private Integer cameratype;
+	private Integer playtype;
 }
 
 

+ 5 - 7
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/DepartmentController.java

@@ -5,15 +5,12 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.Organ;
@@ -102,11 +99,12 @@ public class DepartmentController extends BaseController {
         }
     }
     @RequestMapping(value = "/get/all",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
-    public String getAllDept(){
+    public String getAllDept(HttpServletRequest request){
         try{
+        	User u = getCurrentUser(request);
         	Organ organ=new Organ();
         	organ.setStatus(0);
-        	List<Organ> organs= departmentService.getOrgans(organ);
+        	List<Organ> organs= departmentService.getOrgans(organ,u);
         	return returnResult(0, "获取成功", organs);
         }catch(Exception e){
         	throw new BusinessException(20001);
@@ -119,7 +117,7 @@ public class DepartmentController extends BaseController {
    
         	Organ organ = new Organ();
         	organ.setParentid(pid);
-        	List<Organ> organs= departmentService.getOrgans(organ);
+        	List<Organ> organs= departmentService.getOrgans(organ,null);
         	return returnResult(0, "获取成功",(organs));
         }catch(Exception e){
         	throw new BusinessException(20001);
@@ -132,7 +130,7 @@ public class DepartmentController extends BaseController {
         	Organ organ = new Organ();
         	organ.setId(organid);
         	
-        	List<Organ> organs = departmentService.getOrgans(organ);
+        	List<Organ> organs = departmentService.getOrgans(organ,null);
         	if(organs==null||organs.size()<1 ) throw  new BusinessException(20001);
         	return returnResult(0, "获取成功", organs.get(0));
         }catch(Exception e){

+ 0 - 6
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/MenuController.java

@@ -1,14 +1,10 @@
 package com.xintong.visualinspection.controller;
 
-import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,9 +16,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.Menu;
-import com.xintong.visualinspection.bean.Permission;
 import com.xintong.visualinspection.bean.User;
-import com.xintong.visualinspection.dao.master.PermissionDao;
 import com.xintong.visualinspection.service.MenuService;
 
 /**

+ 6 - 3
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/RoleController.java

@@ -3,6 +3,8 @@ package com.xintong.visualinspection.controller;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -14,6 +16,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.pojo.RoleData;
 import com.xintong.visualinspection.service.RoleService;
 
@@ -89,10 +92,10 @@ public class RoleController extends BaseController {
 	 * @return
 	 */
 	@RequestMapping(value = "/get/all", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
-	public String getAllRole() {
+	public String getAllRole(HttpServletRequest request) {
 		try {
-	
-			List<Role> roles = roleService.getRoles(new Role());
+			User u = getCurrentUser(request);
+			List<Role> roles = roleService.getRoles(new Role(),u);
 
 			return returnResult(0, "获取成功", roles);
 		} catch (Exception e) {

+ 8 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/StatisticsController.java

@@ -46,4 +46,12 @@ public class StatisticsController extends BaseController {
     	return super.returnSuccessResult(lists);
     }
     
+    /**
+     * 温馨服务检查情况统计表
+     */
+    @RequestMapping(value = "/score/Item/info")
+    public String getScoreItemInfo(@RequestBody StatisticsBean obj){
+    	List<StatisticsBean> lists=  statisticsService.getFeeStationCheckItemScore(obj);
+    	return super.returnSuccessResult(lists);
+    }
 }

+ 4 - 3
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/UserController.java

@@ -2,9 +2,10 @@ package com.xintong.visualinspection.controller;
 
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -17,7 +18,6 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.system.securityTools.RedisCacheUtil;
-import com.xintong.visualinspection.bean.Role;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.service.AuthService;
 import com.xintong.visualinspection.service.RoleService;
@@ -147,8 +147,9 @@ public class UserController extends BaseController {
      * @return
      */
     @RequestMapping(value = "/get/all/{page}/{size}",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
-    public String getallUsers(@PathVariable Integer page,@PathVariable Integer size ){
+    public String getallUsers(@PathVariable Integer page,@PathVariable Integer size ,HttpServletRequest request){
         try{
+        	
         	PageHelper.startPage(page, size); 
         	List<User> users= userService.getAll();
         	

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/WebcamController.java

@@ -56,7 +56,7 @@ public class WebcamController extends BaseController {
 	}
 
 	@RequestMapping(value = "/getVideoById/{webcamid}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
-	public String getVideoById(@PathVariable Integer webcamid) {
+	public String getVideoById(@PathVariable String webcamid) {
 		try {
 			Webcam u = webcamService.getOne(webcamid);
 			return returnResult(0, "获取成功", u);

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/cluster/WebcamDao.java

@@ -13,7 +13,7 @@ import com.xintong.visualinspection.bean.Webcam;
 @Mapper
 public interface WebcamDao {
     public List<Webcam> getAll();
-    public Webcam getOne(Integer id);
+    public Webcam getOne(String deviceid);
     public List<Webcam> getWebcams(Webcam webcam);
 
 }

+ 9 - 9
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/UserInfoMapper.xml

@@ -35,9 +35,9 @@
     <insert id="insert" parameterType="com.xintong.visualinspection.bean.User" >
         INSERT INTO
         t_sys_users
-        (username,password,TRUENAME,ORGANID,BIRTH,MOBILE,PHONE,POSITIONID,WORKNO,IDNO,EMAIL,PIC)
+        (username,password,TRUENAME,ORGANID,MOBILE,PHONE,POSITIONID,WORKNO,IDNO,EMAIL,PIC)
         VALUES
-        (#{username},#{password},#{truename},#{organid},#{birth},#{mobile},#{phone},#{positionid},#{workno},#{idno},#{email},#{pic})
+        (#{username},#{password},#{truename},#{organid},#{mobile},#{phone},#{positionid},#{workno},#{idno},#{email},#{pic})
     </insert>
 
     <update id="update" parameterType="com.xintong.visualinspection.bean.User" >
@@ -72,13 +72,13 @@
     
     <select id="getUsers" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >
         SELECT
-        *
-        FROM t_sys_users
-        where 1=1 and status>0 
-        <if test="organid != null and organid != 0">and organid = #{organid} </if>
-        <if test="positionid != null and positionid != 0">and positionid = #{positionid} </if>
-        <if test="classid != null and classid != 0">and classid = #{classid} </if>
-        <if test="teamid != null and teamid != 0">and teamid = #{teamid} </if>
+        t.* , fs.name AS fee_station_name
+        FROM t_sys_users t LEFT JOIN t_br_layer_fee_station fs ON t.organid = fs.organ_id
+        where 1=1 and t.status>0 
+        <if test="organid != null and organid != 0">and t.organid = #{organid} </if>
+        <if test="positionid != null and positionid != 0">and t.positionid = #{positionid} </if>
+        <if test="classid != null and classid != 0">and t.classid = #{classid} </if>
+        <if test="teamid != null and teamid != 0">and t.teamid = #{teamid} </if>
         
     </select>
     <select id="getAllCheckmans" parameterType="com.xintong.visualinspection.bean.User" resultMap="BaseResultMap"  >

+ 6 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/WebcamMapper.xml

@@ -54,6 +54,10 @@
 			jdbcType="INTEGER" />
 		<result column="channel" property="channel"
 			jdbcType="INTEGER" />
+			<result column="cameratype" property="cameratype"
+			jdbcType="INTEGER" />
+			<result column="playtype" property="playtype"
+			jdbcType="INTEGER" />
 	
 	</resultMap>
 	
@@ -65,11 +69,11 @@
 		t_br_layer_webcam
 	</select>
 
-	<select id="getOne" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+	<select id="getOne" parameterType="String" resultMap="BaseResultMap">
 		SELECT
 		*
 		FROM t_br_layer_webcam
-		WHERE id = #{id}
+		WHERE DEVICE_ID =  #{deviceid,jdbcType=VARCHAR}
 	</select>
 
 	<select id="getWebcams" parameterType="com.xintong.visualinspection.bean.Webcam"

+ 5 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/RoleMapper.xml

@@ -6,6 +6,7 @@
         <result column="name" property="name" jdbcType="VARCHAR" />
         <result column="des" property="des" jdbcType="VARCHAR" />
         <result column="mod" property="mod" jdbcType="INTEGER" />
+        <result column="level" property="level" jdbcType="INTEGER" />
     </resultMap>
     
      <resultMap id="BaseRoleDaataMap" type="com.xintong.visualinspection.pojo.RoleData" >
@@ -37,9 +38,9 @@
     <insert id="insert" parameterType="com.xintong.visualinspection.bean.Role" >
         INSERT INTO
         sys_role
-        (name,des)
+        (name,des,level)
         VALUES
-        (#{name},#{des})
+        (#{name},#{des},#{level})
     </insert>
 
     <update id="update" parameterType="com.xintong.visualinspection.bean.Role" >
@@ -48,14 +49,14 @@
         SET
         <if test="name != null">name = #{name},</if>
         <if test="des != null">des = #{des},</if>
+        <if test="level != null and level != 0">level = #{level},</if>
         id = #{id}
         WHERE
         id = #{id}
     </update>
 
     <delete id="delete" parameterType="java.lang.Integer" >
-        update sys_role
-         set status=-1
+        delete from sys_role
         WHERE
         id =#{id}
     </delete>

+ 8 - 9
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -30,7 +30,7 @@
     </select>
     
     <select id="selectFeeStationCheckNum" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT COUNT(DISTINCT( t.checked_person )) AS check_num ,t.checked_dept AS dept_id FROM check_task  t
+    	SELECT COUNT(DISTINCT( t.checked_person )) AS checked_people_num , COUNT(t.checked_person) AS checked_num  ,t.checked_dept AS dept_id FROM check_task  t
     	WHERE 1=1
     		<if test="start_date!=null and end_date != null">
 		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date} 
@@ -43,21 +43,20 @@
     		FROM check_score t 
     		WHERE 1=1
     		<if test="start_date!=null and end_date != null">
-		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date} 
+		        AND	 t.update_time &gt;= #{start_date} AND t.update_time &lt;= #{end_date} 
 			</if>
     		GROUP BY t.checked_dept,t.checked_person
     </select>
     
     <select id="selectFeeStationCheckedPersonScoreDetail" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT  u.checked_person AS user_id , u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
-			SELECT t.checked_person , t.checked_dept,ci.parent_id, t.score  FROM check_score t 
+    	    SELECT  u.checked_dept AS dept_id ,u.parent_id AS item_id ,sum(u.score) AS score ,s.name  FROM (
+			SELECT  t.checked_dept,ci.parent_id, t.score  FROM check_score t 
 			LEFT JOIN check_item ci ON t.check_item_id = ci.id
 			WHERE 1=1
 			<if test="start_date!=null and end_date != null">
-		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt;= #{end_date} 
-			</if>
-			 )
-			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY checked_person,id
+		        AND	 t.update_time &gt;= #{start_date} AND t.update_time &lt;= #{end_date} 
+			</if> )
+			u LEFT JOIN check_item s ON u.parent_id = s.id GROUP  BY dept_id,item_id
     </select>
-    
+       
 </mapper>

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/DepartmentService.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.bean.User;
 
 /**
  * 文件名:UserService 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
@@ -11,7 +12,7 @@ import com.xintong.visualinspection.bean.Organ;
 public interface DepartmentService {
 	public List<Organ> getAll();
 	
-	public List<Organ> getOrgans(Organ organ);
+	public List<Organ> getOrgans(Organ organ,User u);
 
 	public void insert(Organ organ);
 

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/RoleService.java

@@ -4,13 +4,14 @@ import java.util.List;
 import java.util.Map;
 
 import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.pojo.RoleData;
 
 /**
  * 文件名:UserService 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
  */
 public interface RoleService {
-	public List<Role> getRoles(Role role);
+	public List<Role> getRoles(Role role,User u);
 
 	public void insert(Role role);
 

+ 1 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/WebcamService.java

@@ -10,6 +10,6 @@ import com.xintong.visualinspection.bean.Webcam;
  */
 public interface WebcamService {
     public List<Webcam> getAll();
-    public Webcam getOne(Integer id);
+    public Webcam getOne(String deviceid);
     public List<Webcam> getWebcams(Webcam webcam);
 }

+ 51 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/DepartmentServiceImpl.java

@@ -12,6 +12,9 @@ import org.springframework.stereotype.Service;
 import com.xintong.visualinspection.bean.FeeStation;
 import com.xintong.visualinspection.bean.Menu;
 import com.xintong.visualinspection.bean.Organ;
+import com.xintong.visualinspection.bean.Permission;
+import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.cluster.DepartmentDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.DepartmentService;
@@ -23,7 +26,6 @@ import lombok.Data;
  * 版权所有.
  */
 @Service
-@Data
 public class DepartmentServiceImpl extends BaseService implements DepartmentService {
 
 	private static final org.slf4j.Logger logger = LoggerFactory.getLogger(DepartmentService.class);
@@ -32,7 +34,7 @@ public class DepartmentServiceImpl extends BaseService implements DepartmentServ
 	private DepartmentDao departmentDao;
 
 	@Override
-	public List<Organ> getOrgans(Organ organ) {
+	public List<Organ> getOrgans(Organ organ,User u) {
 
 		List<Organ> organs = departmentDao.getOrgan(organ);
 		List<Organ> olist = new ArrayList<>();
@@ -60,7 +62,7 @@ public class DepartmentServiceImpl extends BaseService implements DepartmentServ
 			}
 		}
 
-		return olist;
+		return getOragnsByPermison(olist,u);
 	}
 
 	@Override
@@ -87,7 +89,7 @@ public class DepartmentServiceImpl extends BaseService implements DepartmentServ
 
 	@Override
 	public List<Organ> getAll() {
-		// TODO Auto-generated method stub
+
 		return departmentDao.getAll();
 	}
 
@@ -95,5 +97,50 @@ public class DepartmentServiceImpl extends BaseService implements DepartmentServ
 	public FeeStation getFSByDeptId(Integer id) {
 		return departmentDao.getFsBydeptId(id);
 	}
+	
+	private List<Organ> getOragnsByPermison(List<Organ> oragns,User user){
+		if(user == null ) return oragns;
+		boolean hasrole = false;
+		for(Role r:user.getRoles()){
+			if(r.getName().equals("ROLE_ADMIN")){
+				hasrole = true;
+				break;
+			}
+		}
+		if(hasrole){
+			return oragns;
+		}
+		
+		//找出自己
+		Organ temp = null;
+		for(Organ o :oragns){
+			temp = findOrgan(o,user.getOrganid());
+			if(temp!=null) break;	
+		}
+
+		if(temp!=null){
+			oragns = new ArrayList<>();
+			oragns.add(temp);
+		} 
+	    	
+	    return oragns;
+	}
+	
+	private Organ findOrgan(Organ o,Integer organid)
+	{
+		if(o.getId().intValue() == organid.intValue()){
+			return o;
+		}else{
+			if(o.getChilds()!=null && o.getChilds().size()>0){
+				for(Organ s:o.getChilds()){
+					Organ oo = findOrgan(s, organid);
+					if(oo!=null) return oo;
+				}
+				return null;
+			}else{
+				return null;
+			}
+		}
+	}
 
 }

+ 44 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/RoleServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xintong.visualinspection.service.impl;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
 
 import com.xintong.visualinspection.bean.Permission;
 import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.master.PermissionDao;
 import com.xintong.visualinspection.dao.master.RoleDao;
 import com.xintong.visualinspection.pojo.RoleData;
@@ -34,8 +36,48 @@ public class RoleServiceImpl extends BaseService implements RoleService {
 
 
 	@Override
-	public List<Role> getRoles(Role role) {
-		return roleDao.getRole(role);
+	public List<Role> getRoles(Role role,User u) {
+		
+		List<Role> roles = roleDao.getRole(role);
+		
+		if(u == null || u.getRoles()==null || u.getRoles().size() ==0) return roles;
+		boolean hasrole = false;
+		for(Role r:u.getRoles()){
+			if(r.getName().equals("ROLE_ADMIN")){
+				hasrole = true;
+				break;
+			}
+		}
+		if(hasrole) return roles;
+		//获取用户最高权限
+		int level=Integer.MAX_VALUE;
+		List<String> names = new ArrayList<>();
+		for(Role r:u.getRoles()){
+			if(r.getLevel()<level) level = r.getLevel();
+			names.add(r.getName());
+		}
+		
+		
+		List<Role> roletemp = new ArrayList<Role>();
+		for(Role r:roles){
+			if(r.getLevel()>=level){
+				boolean hasrole1 = false;
+				for(String s:names){
+					if(s.contains(r.getName())){
+						hasrole1 = true;
+					}
+				}
+				if(hasrole1){
+					roletemp.add(r);
+				}
+				
+			}
+			
+			
+		}
+		
+		roles = roletemp;
+		return roles;
 	}
 
 

+ 57 - 12
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -16,7 +16,9 @@ import com.xintong.visualinspection.bean.StatisticsBean;
 import com.xintong.visualinspection.bean.StatisticsBo;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.cluster.DepartmentDao;
+import com.xintong.visualinspection.dao.cluster.UserInfoDao;
 import com.xintong.visualinspection.dao.master.StatisticsDao;
+import com.xintong.visualinspection.dao.master.UserDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.StatisticsService;
 import com.xintong.visualinspection.util.CacheUtil;
@@ -36,6 +38,9 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
     @Autowired
     private DepartmentDao departmentDao ;
     
+    @Autowired
+    private UserInfoDao userInfoDao;
+    
 	@Override
 	public List<StatisticsBo> getEmployeeCheckedInfo(StatisticsBean obj) {
 		// 查看是否有部门id
@@ -46,17 +51,30 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<StatisticsBean> timesList = statisticsDao.selectCheckedTimes(obj);
 		
 		Map<Long,StatisticsBo> statisticBoMap = new HashMap<Long,StatisticsBo>();
-				
-		for(User user:CacheUtil.userMap.values()){
-			if(user.getPositionid() ==1){
-				if(organId ==null ||  user.getOrganid()+0L == organId+0L ){
-					StatisticsBo tmp = new StatisticsBo();
-					tmp.setUser(user);
-					statisticBoMap.put(user.getId()+0L,tmp);
-				}
+		
+		User user = new User();
+		user.setPositionid(1);
+		if(obj.getDept_id()!=null)
+			user.setOrganid(obj.getDept_id().intValue());
+		List<User> listUserts = userInfoDao.getUsers(user);
+		for(User u:listUserts){
+			if(u.getFee_station_name()!=null){
+				StatisticsBo tmp = new StatisticsBo();
+				tmp.setUser(u);
+				statisticBoMap.put(u.getId()+0L, tmp);				
 			}
 		}
 		
+//		for(User user:CacheUtil.userMap.values()){
+//			if(user.getPositionid() ==1){
+//				if(organId ==null ||  user.getOrganid()+0L == organId+0L ){
+//					StatisticsBo tmp = new StatisticsBo();
+//					tmp.setUser(user);
+//					statisticBoMap.put(user.getId()+0L,tmp);
+//				}
+//			}
+//		}
+		
 		for( StatisticsBean statisticsBean : list ){
 			if(statisticBoMap.containsKey(statisticsBean.getUser_id())){
 				StatisticsBo tmp = statisticBoMap.get(statisticsBean.getUser_id());
@@ -78,7 +96,6 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		List<StatisticsBo> lists = new ArrayList<>(statisticBoMap.values());
 		// 进行排序
 		lists.sort(new Comparator<StatisticsBo>() {
-
 			@Override
 			public int compare(StatisticsBo o1, StatisticsBo o2) {
 				if(o1.getCheck_all_score() >= o2.getCheck_all_score() ){
@@ -101,11 +118,12 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			mapStationInfos.put(sta.getDept_id(), sta);
 		}
 		
-		// 检索受检次数
+		// 检查人数 和 检查次数
 		List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
 		for(StatisticsBean sta:listCheckNum){
 			if(mapStationInfos.containsKey(sta.getDept_id())){
 				mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
+				mapStationInfos.get(sta.getDept_id()).setChecked_people_num(sta.getChecked_people_num());
 			}
 		}
 		
@@ -129,8 +147,35 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 	@Override
 	public List<StatisticsBean> getFeeStationCheckItemScore(StatisticsBean obj) {
-		// TODO Auto-generated method stub
-		return null;
+
+		// 获取收费站信息收费站人数
+		List<StatisticsBean> lists = departmentDao.selectFeeStationGroup(obj);
+		Map<Long,StatisticsBean> mapStationInfos = new HashMap<>();
+		for(StatisticsBean sta:lists){
+			mapStationInfos.put(sta.getDept_id(), sta);
+		}
+		
+		//  检查人数 和 检查次数
+		List<StatisticsBean> listCheckNum = statisticsDao.selectFeeStationCheckNum(obj);
+		for(StatisticsBean sta:listCheckNum){
+			if(mapStationInfos.containsKey(sta.getDept_id())){
+				mapStationInfos.get(sta.getDept_id()).setChecked_num(sta.getChecked_num());
+				mapStationInfos.get(sta.getDept_id()).setChecked_people_num(sta.getChecked_people_num());
+			}
+		}
+		
+		List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedPersonScoreDetail(obj);
+		for(StatisticsBean sta:listCheckedScore){
+			if(mapStationInfos.containsKey(sta.getDept_id())){
+				StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
+				statis.setAll_check_score( statis.getAll_check_score()+sta.getScore());
+				statis.getChecked_socre_name().add(sta.getName());
+				statis.getChecked_score().add(sta.getScore());
+			}
+		}
+		
+		return new ArrayList<>(mapStationInfos.values());
+	
 	}
     
 }

+ 2 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/WebcamServiceImpl.java

@@ -33,8 +33,8 @@ public class WebcamServiceImpl extends BaseService implements WebcamService {
 
 
 	@Override
-	public Webcam getOne(Integer id) {
-	    return webcamDao.getOne(id);
+	public Webcam getOne(String deviceid) {
+	    return webcamDao.getOne(deviceid);
 	}