Преглед на файлове

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

# Conflicts:
#	VisualInspection/js/config.js
minitiger преди 9 години
родител
ревизия
cc4172f8b8
променени са 30 файла, в които са добавени 345 реда и са изтрити 76 реда
  1. 1 0
      .gitignore
  2. 0 0
      VisualInspection/css/role/role.css
  3. 4 4
      VisualInspection/js/config.js
  4. 29 16
      VisualInspection/js/main.js
  5. 45 0
      VisualInspection/js/role/role.js
  6. 89 29
      VisualInspection/js/teamClass/charge_team_schedule.js
  7. 2 2
      VisualInspection/js/teamClass/check_team_schedule.js
  8. 1 1
      VisualInspection/js/term_management/charge_terms_m.js
  9. 1 1
      VisualInspection/js/term_management/check_terms_m.js
  10. 17 0
      VisualInspection/js/util/service.js
  11. 1 1
      VisualInspection/view/common/head.html
  12. 28 0
      VisualInspection/view/role/role.html
  13. 3 3
      VisualInspection/view/term_management/charge_stuff_schedule.html
  14. 28 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/ClassCode.java
  15. 2 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Permission.java
  16. 1 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Role.java
  17. 1 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java
  18. 17 6
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/MenuController.java
  19. 15 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TeamClassController.java
  20. 1 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/UserController.java
  21. 3 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/TeamClassDao.java
  22. 2 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/cluster/DepartmentMapper.xml
  23. 3 2
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/PermissionDaoMapper.xml
  24. 5 3
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/RoleMapper.xml
  25. 7 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TeamClassMapper.xml
  26. 2 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/MenuService.java
  27. 3 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/TeamClassService.java
  28. 0 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/AuthServiceImpl.java
  29. 27 1
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/MenuServiceImpl.java
  30. 7 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/TeamClassServiceImpl.java

+ 1 - 0
.gitignore

@@ -12,3 +12,4 @@
 # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
 hs_err_pid*
 
+jicha/

+ 0 - 0
VisualInspection/css/role/role.css


+ 4 - 4
VisualInspection/js/config.js

@@ -1,6 +1,6 @@
-var base_ui_url = "http://192.168.68.126:8081/";
-var base_server_url = "http://192.168.68.126:8089/";
+// var base_ui_url = "http://192.168.68.126:8081/";
+// var base_server_url = "http://192.168.68.126:8089/";
 var base_image_server_url = "http://10.112.0.236:8088/";
 
-// var base_ui_url = "http://localhost:8081/";
-// var base_server_url = "http://localhost:8089/";
+var base_ui_url = "http://localhost:8080/";
+var base_server_url = "http://localhost:8089/";

+ 29 - 16
VisualInspection/js/main.js

@@ -1,25 +1,25 @@
 var MENU;
 //计算左面的
-$(document).ready(function() {
+$(document).ready(function () {
 
     console.log($.zui.store.enable)
 
     setletftime();
 
-    $('#treeMenu').on('click', 'a', function() {
+    $('#treeMenu').on('click', 'a', function () {
         if ($(this).hasClass("p_m")) { return; }
         $('#treeMenu li.active').removeClass('active');
         $(this).closest('li').addClass('active');
         getPageInfo(this.id)
-            // $("#main_content").html(getPageInfo(this.id));
+        // $("#main_content").html(getPageInfo(this.id));
     });
 
     //获取用户信息
     var user = $.zui.store.get("user")
-    if (user == null || typeof(user) == "undefined") {
+    if (user == null || typeof (user) == "undefined") {
         layer.msg('登陆已经过期,将重新登陆!', {
             time: 2000, //20s后自动关闭
-        }, function() {
+        }, function () {
             self.location = base_ui_url + UI_USER_LOGIN
         })
 
@@ -29,9 +29,22 @@ $(document).ready(function() {
         $("#user").html(html);
     }
 
+    $("#user").on("click", function () {
+        layer.confirm('您确定要退出登录?', {
+            btn: ['确定'] //按钮
+        }, function () {
+            UserLoginOUT(function () {
+               
+                self.location = base_ui_url + UI_USER_LOGIN
+            }, function (error) {
+                layer.msg(error, { icon: 3 });
+            })
+        });
+    });
+
 
 
-    MenuGetAll(function(data) {
+    MenuGetAll(function (data) {
         //初始化菜单
         var treedata = [];
         for (var i = 0; i < data.length; i++) {
@@ -62,11 +75,11 @@ $(document).ready(function() {
         //获取当前页
         var currentpage = 0;
         currentpage = $.zui.store.get("currentpage");
-        if (typeof(currentpage) != undefined && currentpage != null) {
+        if (typeof (currentpage) != undefined && currentpage != null) {
             //改变页面
             getPageInfo(currentpage);
         }
-    }, function(error) {});
+    }, function (error) { });
 
 });
 
@@ -93,11 +106,11 @@ function setletftime() {
 function getPageInfo(id) {
     //设置当前页面
     $.zui.store.set("currentpage", id);
-    if (typeof(MENU) != "undefined" && MENU != null) {
+    if (typeof (MENU) != "undefined" && MENU != null) {
         for (var i = 0; i < MENU.length; i++) {
             var menu = MENU[i];
             if (menu.id == id) {
-                if (typeof(menu.url) != "undefined") {
+                if (typeof (menu.url) != "undefined") {
                     changePage(menu.url);
                     chageToPageUI(menu)
                     return;
@@ -108,7 +121,7 @@ function getPageInfo(id) {
                 for (var j = 0; j < menu.childs.length; j++) {
                     var mtemp = menu.childs[j];
                     if (mtemp.id == id) {
-                        if (typeof(mtemp.url) != "undefined") {
+                        if (typeof (mtemp.url) != "undefined") {
                             changePage(mtemp.url);
                             chageToPageUI(mtemp)
                             return;
@@ -127,13 +140,13 @@ function getPageInfo(id) {
 
 
 function changePage(url) {
-    if (typeof(url) != "undefined") {
-        CURRENT_PAGE_URL=url;
+    if (typeof (url) != "undefined") {
+        CURRENT_PAGE_URL = url;
         $("#main_content").load(base_ui_url + url);
 
         event = document.createEvent('MessageEvent');
-		var origin = window.location.protocol + '//' + window.location.host;
-		event.initMessageEvent ('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
-		document.dispatchEvent (event);
+        var origin = window.location.protocol + '//' + window.location.host;
+        event.initMessageEvent('changepage', true, true, CURRENT_PAGE_URL, origin, 1234, window, null);
+        document.dispatchEvent(event);
     }
 }

+ 45 - 0
VisualInspection/js/role/role.js

@@ -0,0 +1,45 @@
+  var cols = [{
+      width: 'auto',
+      text: '序号',
+      type: 'number',
+      flex: true,
+      colClass: 'text-center'
+  }, {
+      width: 'auto',
+      text: '角色名称',
+      type: 'string',
+      flex: true,
+      colClass: 'text-center'
+  }, {
+      width: 'auto',
+      text: '组织机构',
+      type: 'string',
+      flex: true,
+      sort: 'down',
+      colClass: 'text-center'
+  }, {
+      width: 'auto',
+      text: '用户数',
+      type: 'number',
+      flex: true,
+      colClass: 'text-center'
+  }, {
+      width: 'auto',
+      text: '操作',
+      type: 'string',
+      flex: true,
+      colClass: 'text-center'
+  }];
+  $(document).ready(function() {
+
+      $("#main_content_title").html("角色管理")
+
+      $('.datatable').datatable({
+          checkable: false,
+          sortable: false,
+          data: {
+              cols: cols,
+              rows: [{ checked: false, data: [1, '2016-01-18 11:05:15', '名称示例1', 22, '<button class="btn btn-primary" name="user_edit" id=' + 1 + '><i class="icon icon-edit"></i>修改</button>  <button class="btn btn-primary" name="user_delete" id=' + 1 + ' ><i class="icon icon-remove-circle"></i>删除</button>'] }]
+          }
+      });
+  });

+ 89 - 29
VisualInspection/js/teamClass/charge_team_schedule.js

@@ -84,6 +84,8 @@
 
 
         var lans = 0;
+        var entrance_number = 0;
+        var exit_number = 0;
 
         // 获取收费站信息
         function getStation(){
@@ -91,16 +93,47 @@
                 if(data != null){
                     $(".thread_charge").append("<th>"+data.name+"</th>");
                     $(".thread_charge").append("<th>值班室</th>");
+                    // console.log(data);
                     lans = data.lanes_number;
-                    for(var i=0;i<data.lanes_number;i++){
+                    entrance_number = data.entrance_numer ;
+                    exit_number = data.exit_numer ;
+                    // for(var i=0;i<data.lanes_number;i++){
+                    //     $(".thread_charge").append("<th>进口车道"+(i+1)+"</th>");
+                    // }
+                    for(var i=0;i<entrance_number;i++){
                         $(".thread_charge").append("<th>进口车道"+(i+1)+"</th>");
                     }
+                    for(var i=0;i<exit_number;i++){
+                         $(".thread_charge").append("<th>出口车道"+(i+1)+"</th>");
+                    }
                 }
             },function(error){
                 return "" ;
             })
         }
 
+        getClassCode();
+
+        var classCode = {};
+
+
+        /**
+         * 获取班组信息
+         */
+        function getClassCode(){
+            var data = {} ;
+            post_common_service( "teamClass/getClassCode",data,function(data){
+                for(var i=0;i<data.length;i++){
+                    classCode[data[i].code] = data[i];
+                }
+                console.log(classCode);
+                $(".class_type_1").html(classCode[1].class_name);
+                $(".class_type_2").html(classCode[2].class_name);
+                $(".class_type_3").html(classCode[3].class_name);
+            },function(error){
+                return "" ;
+            })
+        }
 
         // 更新日历数据
         function updateCalendar(data){
@@ -165,8 +198,10 @@
 
                 if(cache) {
                     for(var i=0;i<lans+1;i++){
-                        var obj = { "work_date":work_date,"dept_id":cache.dept_id,"user_id": $(".tr-"+j+" td select").eq(i).val() , "class_type":j,"team_id":cache.team_id,"start_time":work_date, "end_time":work_date,"lane":i };
-                        dutyList.push(obj);
+                        if($(".tr-"+j+" td select").eq(i).val()!='' ){
+                            var obj = { "work_date":work_date,"dept_id":cache.dept_id,"user_id": $(".tr-"+j+" td select").eq(i).val() , "class_type":j,"team_id":cache.team_id,"start_time":work_date, "end_time":work_date,"lane":$(".tr-"+j+" td select").eq(i).parent().attr('tag') };
+                            dutyList.push(obj);
+                        }
                     }
                 }
             }
@@ -216,49 +251,79 @@
                     for(var i=0;i<data.length;i++){
                         if(data[i].class_type == 1){
                             $(".tr-1").data("cache",data[i]);
-                            $(".tr-1").append("<td>早班 6:00 - 12:00</td>");
+                            // $(".tr-1").append("<td>早班 6:00 - 12:00</td>");
+                             $(".tr-1").append("<td>"+ classCode["1"].class_name +" "+classCode["1"].start_time+" - "+classCode["1"].end_time +"</td>");
                             var selectv = "<select class='form-control'>"
                                     // console.log(data[i]);
+                            selectv += ("<option value=''>请选择人员</option>");
                             for(var j=0;j<data[i].users.length;j++){
                                     var obj = data[i].users[j];
                                     selectv += ("<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>");
                             }
                             selectv += "</select>";
-                            for(var z=0;z<lans+1;z++){
-                                 $(".tr-1").append("<td>"+ selectv +"</td>")
+                            // for(var z=0;z<lans+1;z++){
+                            //      $(".tr-1").append("<td>"+ selectv +"</td>")
+                            // }
+                            $(".tr-1").append("<td class='c-1-0' tag='0'>"+ selectv +"</td>")
+                            for(var z=0;z<entrance_number;z++){
+                                $(".tr-1").append("<td class='c-1-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv +"</td>")
+                            }
+                            for(var z=0;z<exit_number;z++){
+                               $(".tr-1").append("<td class='c-1--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv +"</td>")
                             }
+
+
                         }else if(data[i].class_type == 2){
-                             $(".tr-2").append("<td>中班 12:00 - 20:00</td>");
+                            //  $(".tr-2").append("<td>中班 12:00 - 20:00</td>");
+                            $(".tr-2").append("<td>"+ classCode[2].class_name +" "+classCode[2].start_time+" - "+classCode[2].end_time +"</td>");
                               $(".tr-2").data("cache",data[i]);
                             var selectv2 = "<select class='form-control'>"
+                            selectv2 += ("<option value=''>请选择人员</option>");
                             for(var j=0;j<data[i].users.length;j++){
                                  if(data[i].users[j]!=null)
                                 selectv2 += ("<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>")
                             }
                             selectv2 += "</select>";
 
-                            for(var z=0;z<lans+1;z++){
-                                 $(".tr-2").append("<td>"+ selectv2 +"</td>")
+                            // for(var z=0;z<lans+1;z++){
+                            //      $(".tr-2").append("<td>"+ selectv2 +"</td>")
+                            // }
+                             $(".tr-2").append("<td class='c-2-0' tag='0'>"+ selectv2 +"</td>")
+                            for(var z=0;z<entrance_number;z++){
+                                $(".tr-2").append("<td class='c-2-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv2 +"</td>")
+                            }
+                            for(var z=0;z<exit_number;z++){
+                               $(".tr-2").append("<td class='c-2--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv2 +"</td>")
                             }
                         }else if(data[i].class_type == 3){
-                            $(".tr-3").append("<td>晚班 20:00 - 6:00</td>");
+                            // $(".tr-3").append("<td>晚班 20:00 - 6:00</td>");
+                             $(".tr-3").append("<td>"+ classCode[3].class_name +" "+classCode[3].start_time+" - "+classCode[3].end_time +"</td>");
                              $(".tr-3").data("cache",data[i]);
                             var selectv3 = "<select class='form-control'>"
+                            selectv3 += ("<option value=''>请选择人员</option>");
                             for(var j=0;j<data[i].users.length;j++){
                                  if(data[i].users[j]!=null)
                                 selectv3 += "<option value='"+data[i].users[j].id+"'>"+ data[i].users[j].truename  +"</option>"
                             }
                             selectv3 += "</select>";
 
-                            for(var z=0;z<lans+1;z++){
-                                 $(".tr-3").append("<td>"+ selectv3 +"</td>")
+                             $(".tr-3").append("<td class='c-3-0' tag='0'>"+ selectv3 +"</td>")
+                            for(var z=0;z<entrance_number;z++){
+                                $(".tr-3").append("<td class='c-3-"+(z+1)+"' tag='"+(z+1)+"'>"+ selectv3 +"</td>")
+                            }
+                            for(var z=0;z<exit_number;z++){
+                               $(".tr-3").append("<td class='c-3--"+(z+1)+"' tag='-"+(z+1)+"'>"+ selectv3 +"</td>")
                             }
+
+                            // for(var z=0;z<lans+1;z++){
+                            //      $(".tr-3").append("<td>"+ selectv3 +"</td>")
+                            // }
                         }
                     }
                      if(data.length ==0){
-                        $(".tr-1").append("<td>早班 6:00 - 12:00</td>");
-                        $(".tr-2").append("<td>中班 12:00 - 20:00</td>");
-                        $(".tr-3").append("<td>晚班 20:00 - 6:00</td>");
+                        $(".tr-1").append("<td>"+ classCode["1"].class_name +" "+classCode["1"].start_time+" - "+classCode["1"].end_time +"</td>");
+                        $(".tr-2").append("<td>"+ classCode[2].class_name +" "+classCode[2].start_time+" - "+classCode[2].end_time +"</td>");
+                        $(".tr-3").append("<td>"+ classCode[3].class_name +" "+classCode[3].start_time+" - "+classCode[3].end_time +"</td>");
                         for(var i=0;i<lans+1;i++){
                              $(".tr-1,.tr-2,.tr-3").append("<td></td>");
                         }
@@ -266,7 +331,7 @@
                          var cache = $(".tr-1").data("cache");
                          var work_date = $("#save_user_class").data("work_date");
                          var param = {
-                            'dept_id':cache.dept_id,
+                            'dept_id':user_dept_id,
                             'work_date':work_date
                         }
 
@@ -280,16 +345,11 @@
                                      $("#save_user_class").html("生成今日值班");
                                       $("#save_user_class").data("modify_flag",false);
                                 }
-                                console.log(data);
+                                // console.log(data);
                                 for(var i=0;i<data.length;i++){
-                                    // if(data[i].class_type == 1){
-
-                                    // }else if(data[i].class_type == 2){
-
-                                    // }else if(data[i].class_type == 3){
-
-                                    // }
-                                    $(".table .tr-"+data[i].class_type+" select").eq(i%(lans+1)).val(data[i].user_id);
+                                   
+                                   $(".c-"+data[i].class_type+"-"+data[i].lane+" select").val(data[i].user_id);
+                                    // $(".table .tr-"+data[i].class_type+" select").eq(i%(lans+1)).val(data[i].user_id);
                                 }
                             },function(error){
                                 return "" ;
@@ -382,8 +442,8 @@
                         "class_type":i+1,
                         "team_id":$("select[id*='_term']").eq(i).val(),
                         "work_date": $("#save_term_class").data("date")+" 00:00:00",
-                        "start_time": $("#save_term_class").data("date")+" 00:00:00",
-                        "end_time": $("#save_term_class").data("date")+" 00:00:00",
+                        "start_time": $("#save_term_class").data("date")+" "+ classCode[i+1].start_time+":00" ,
+                        "end_time": $("#save_term_class").data("date")+" "+classCode[i+1].end_time+":00",
                         "dept_id":user_dept_id
                     };
                     data.push(obj);
@@ -435,9 +495,9 @@
        if(class_type == 1){
            return "早班";
        }else if(class_type == 2){
-            return "中班";
+            return  "中班";
        }else if(class_type == 3){
-           return "晚班";
+           return  "晚班";
        }else if(class_type == 4){
            return "全班";
        }

+ 2 - 2
VisualInspection/js/teamClass/check_team_schedule.js

@@ -33,12 +33,12 @@
             }
             getTeamClass(data,function(data){
                 var newEvents = [];
-                 console.log(data);
+                //  console.log(data);
                 for(var i=0;i<data.length;i++){
                     var obj = {id:data[i].id ,desc:data[i].team_name ,title: data[i].team_name+"-"+getTeamName(data[i].class_type),  start: data[i].start_time, end: data[i].end_time};
                     newEvents.push(obj);
                 }
-                console.log(newEvents)
+                // console.log(newEvents)
                 calendar.addEvents(newEvents);
             })
         }

+ 1 - 1
VisualInspection/js/term_management/charge_terms_m.js

@@ -27,7 +27,7 @@
                         {width: 80, text: '副班长', type: 'string', flex: false, colClass: '',field:'sub_monitor_name'},
                         {width: 120, text: '人员',  flex: false, colClass: '',field:'user_ids_name'},
                         {width: 50, text: '操作',  flex: false, colClass: '',field:'id',oper:[
-                            {func:'updateCheckTeam',text:'修改',col_class:'icon-edit'},{func:'deleteCheckTeam',text:'删除',col_class:'icon-remove-circle'}
+                            {func:'updateCheckTeam',text:'修改',icon_class:'icon-edit'},{func:'deleteCheckTeam',text:'删除',icon_class:'icon-remove-circle'}
                         ]},
                     ] ;
         

+ 1 - 1
VisualInspection/js/term_management/check_terms_m.js

@@ -27,7 +27,7 @@
                         {width: 80, text: '副班长', type: 'string', flex: false, colClass: '',field:'sub_monitor_name'},
                         {width: 120, text: '人员',  flex: false, colClass: '',field:'user_ids_name'},
                         {width: 50, text: '操作',  flex: false, colClass: '',field:'id',oper:[
-                            {func:'updateCheckTeam',text:'修改',col_class:'icon-edit'},{func:'deleteCheckTeam',text:'删除',col_class:'icon-remove-circle'}
+                            {func:'updateCheckTeam',text:'修改',icon_class:'icon-edit'},{func:'deleteCheckTeam',text:'删除',icon_class:'icon-remove-circle'}
                         ]},
                     ] ;
         

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

@@ -14,6 +14,23 @@ function UserLogin(body, success, fail) {
         fail("网络错误");
     });
 }
+function UserLoginOUT(success, fail) {
+    var url = base_server_url + USER_LOGOUT
+    ajaxGet(url, "", function(response) {
+        var data = response;
+        if (data.result_code == 0) {
+            //存储token
+            $.zui.store.set("user", "");
+            success()
+        } else {
+            fail(data.result_desc);
+        }
+    }, function(error) {
+        fail("网络错误");
+    });
+}
+
+
 
 function UserGetList(data, success, fail) {
     var url = base_server_url + USER_GET_LIST

+ 1 - 1
VisualInspection/view/common/head.html

@@ -13,7 +13,7 @@
 
         <ul class="nav navbar-nav navbar-right">
             <li>
-                <p id="user" class="header_font" style="padding-right:20px"></p>
+                <p id="user" class="header_font" style="padding-right:20px;cursor:pointer;"></p>
             </li>
             <li>
                 <p id="time_p" class="header_font"></p>

+ 28 - 0
VisualInspection/view/role/role.html

@@ -0,0 +1,28 @@
+<link rel="stylesheet" type="text/css" href="/css/role/role.css?__inline">
+<!--<script type="text/javascript" src="/node_modules/zui/dist/lib/dashboard/zui.dashboard.min.js?__inline"></script>
+<link rel="stylesheet" type="text/css" href="/node_modules/zui/dist/lib/dashboard/zui.dashboard.min.css">-->
+<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">
+
+            <button class="btn btn-primary" style="float:right" type="button">添加角色</button>
+
+        </div>
+    </div>
+    <div class="row" style="padding-top:20px">
+        <div class="datatable" style="border: 1px solid #ddd" data-checkable="true" data-sortable="true"></div>
+
+    </div>
+
+</div>

+ 3 - 3
VisualInspection/view/term_management/charge_stuff_schedule.html

@@ -21,7 +21,7 @@
             <div class="container-fluid ">
                 <div class="form-horizontal">
                     <div class="form-group">
-                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">早班</label>
+                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2 class_type_1"></label>
                         <div class="col-md-6 col-sm-8">
                             <select id="mooring_term" type="text" class="form-control class_team_1" >
                                 <option value=''>请选择班组</option>
@@ -29,7 +29,7 @@
                         </div>
                     </div>
                     <div class="form-group">
-                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">中班</label>
+                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2 class_type_2"></label>
                         <div class="col-md-6 col-sm-8">
                             <select id="middle_term" type="text" class="form-control class_team_2" >
                                 <option value=''>请选择班组</option>
@@ -37,7 +37,7 @@
                         </div>
                     </div>
                     <div class="form-group">
-                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2">晚班</label>
+                        <label for="exampleInputAccount4" class="col-sm-offset-1 col-sm-2 class_type_3"></label>
                         <div class="col-md-6 col-sm-8">
                             <select id="night_term" type="text" class="form-control class_team_3" >
                                 <option value=''>请选择班组</option>

+ 28 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/ClassCode.java

@@ -0,0 +1,28 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+/**
+ * 文件名:ScoreDeducting
+ * 版本信息:日期:2017/4/18 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class ClassCode {
+    //编号
+    private Long id;
+  
+    //上班时间
+
+    private String start_time;
+   
+    private String end_time;
+    
+    private String class_name ;
+    
+
+    
+    private Integer position_id ;
+    
+    private Integer code ;
+    
+}

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

@@ -20,5 +20,7 @@ public class Permission {
 	private int type;
 	// 0 正常 -1 删除
 	private int status;
+	//1-读写 2-读 3-删除 
+	private int permission_type;
 
 }

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

@@ -9,5 +9,6 @@ import lombok.Data;
 @Data
 public class Role {
     private Integer id;
+    private String des;
     private String name;
 }

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

@@ -67,7 +67,7 @@ public class User implements UserDetails {
 	// 性别
 	private String sex;
 	// 工号
-	private Integer workno;
+	private String workno;
 	// 身份证号
 	private String idno;
 	

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

@@ -1,6 +1,11 @@
 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;
@@ -14,6 +19,9 @@ 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;
 
 /**
@@ -32,6 +40,7 @@ public class MenuController extends BaseController {
     private MenuService menuService;
     
     
+    
     /**
      * 添加菜单
      * @return
@@ -90,10 +99,10 @@ public class MenuController extends BaseController {
      */
 
     @RequestMapping(value = "/get/all",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
-    public String getAllMenu(){
+    public String getAllMenu(HttpServletRequest request){
         try{
-        
-        	List<Menu> menus= menuService.getMenus(new Menu());
+        	User u = getCurrentUser(request);
+        	List<Menu> menus= menuService.getMenus(new Menu(),u);
         	return returnResult(0, "获取成功", menus);
         }catch(Exception e){
         	throw new BusinessException(20001);
@@ -115,13 +124,13 @@ public class MenuController extends BaseController {
     }
     
     @RequestMapping(value = "/getMenuById/{menuid}",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
-    public String getMenuById(@PathVariable Integer menuid){
+    public String getMenuById(@PathVariable Integer menuid,HttpServletRequest request){
         try{
-        	
+        	User u = getCurrentUser(request);
         	Menu menu = new Menu();
         	menu.setId(menuid);
         	
-        	List<Menu> menus = menuService.getMenus(menu);
+        	List<Menu> menus = menuService.getMenus(menu,u);
         	if(menus==null||menus.size()<1 ) throw  new BusinessException(20001);
         	return returnResult(0, "获取成功", menus.get(0));
         }catch(Exception e){
@@ -130,6 +139,8 @@ public class MenuController extends BaseController {
     }
     
     
+   
+    
     
 
 

+ 15 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TeamClassController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.xintong.system.err.BusinessException;
+import com.xintong.visualinspection.bean.ClassCode;
 import com.xintong.visualinspection.bean.TeamClass;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.service.TeamClassService;
@@ -158,4 +159,18 @@ public class TeamClassController extends BaseController {
     	return super.returnSuccessResult(tcList);
     }
     
+    /**
+     * 获取team_class 信息
+     * @param teamClass
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = "/getClassCode")
+    public String getClassCodeInfo(@RequestBody ClassCode classCode){
+    	
+    	List<TeamClass> tcList = teamClassService.getClassCode(classCode);
+    	return super.returnSuccessResult(tcList);
+    }
+    
+    
 }

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

@@ -62,7 +62,7 @@ public class UserController extends BaseController {
     		redisCacheUtil.removeForUserName(username);
     	}
     	//返回成功
-    	return returnSuccessResult("退出成功");
+    	return returnResult(0, "退出成功", null);
     }
     
     

+ 3 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/master/TeamClassDao.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Mapper;
 
+import com.xintong.visualinspection.bean.ClassCode;
 import com.xintong.visualinspection.bean.TeamClass;
 
 /**
@@ -18,5 +19,7 @@ public interface TeamClassDao  {
     public void update(TeamClass teamClass);
     public void delete(Long id);
     public void deleteByDeptWorkdate(TeamClass teamClass);
+    
+    public List<TeamClass> getClassCode(ClassCode teamClass);
    
 }

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

@@ -17,8 +17,8 @@
         <id column="id" property="id" jdbcType="INTEGER" />
         <result column="name" property="name" jdbcType="VARCHAR" />
         <result column="lanes_number" property="lanes_number" jdbcType="INTEGER" />
-        <result column="exit_numer" property="exit_numer" jdbcType="VARCHAR" />
-        <result column="entrance_numer" property="entrance_numer" jdbcType="VARCHAR" />
+        <result column="exit_number" property="exit_numer" jdbcType="INTEGER" />
+        <result column="entrance_number" property="entrance_numer" jdbcType="INTEGER" />
         <result column="exit_etc" property="exit_etc" jdbcType="VARCHAR" />
         <result column="entrance_etc" property="entrance_etc" jdbcType="VARCHAR" />
         <result column="organ_id" property="deptid" jdbcType="VARCHAR" />

+ 3 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/PermissionDaoMapper.xml

@@ -9,7 +9,8 @@
         <result column="pid" property="pid" jdbcType="INTEGER" />
         <result column="type" property="type" jdbcType="INTEGER" />     
         <result column="resourceid" property="resourceid" jdbcType="INTEGER" />  
-        <result column="status" property="status" jdbcType="INTEGER" />        
+        <result column="status" property="status" jdbcType="INTEGER" />     
+         <result column="permission_type" property="permission_type" jdbcType="INTEGER" />
     </resultMap>
 
 
@@ -64,7 +65,7 @@
     </delete>
 
     <select id="findByAdminUserId" parameterType="int" resultType="com.xintong.visualinspection.bean.Permission">
-        select p.*
+      select p.*,spr.permission_type 
         from sys_permission p
         LEFT JOIN sys_role_user sru on sru.sys_user_id = #{userId}
         LEFT JOIN sys_role r on sru.sys_role_id=r.id

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

@@ -4,12 +4,13 @@
     <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.Role" >
         <id column="id" property="id" jdbcType="INTEGER" />
         <result column="name" property="name" jdbcType="VARCHAR" />
+        <result column="des" property="des" jdbcType="VARCHAR" />
     </resultMap>
     
     
      <select id="getRole" parameterType="com.xintong.visualinspection.bean.Role" resultMap="BaseResultMap">
         SELECT 
-        id,name,status 
+        * 
          FROM sys_role
          where 1=1
          <if test="id != null and id != 0">and id = #{id}</if>
@@ -20,9 +21,9 @@
     <insert id="insert" parameterType="com.xintong.visualinspection.bean.Role" >
         INSERT INTO
         sys_role
-        (name)
+        (name,des)
         VALUES
-        (#{name})
+        (#{name},#{des})
     </insert>
 
     <update id="update" parameterType="com.xintong.visualinspection.bean.Role" >
@@ -30,6 +31,7 @@
         sys_role
         SET
         <if test="name != null">name = #{name},</if>
+        <if test="des != null">des = #{des},</if>
         id = #{id}
         WHERE
         id = #{id}

+ 7 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TeamClassMapper.xml

@@ -71,4 +71,11 @@
         work_date =#{work_date} and dept_id=#{dept_id}
     </delete>
     
+    <select id="getClassCode" parameterType="com.xintong.visualinspection.bean.ClassCode" resultType="com.xintong.visualinspection.bean.ClassCode">
+    	SELECT * FROM sys_class_type where 1=1 
+    	<if test="position_id!=null">
+    		AND position_id = #{position_id}
+    	</if>
+    </select>
+    
 </mapper>

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

@@ -3,13 +3,14 @@ package com.xintong.visualinspection.service;
 import java.util.List;
 
 import com.xintong.visualinspection.bean.Menu;
+import com.xintong.visualinspection.bean.User;
 
 /**
  * 文件名:UserService
  * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
  */
 public interface MenuService {
-    public List<Menu> getMenus(Menu menu);
+    public List<Menu> getMenus(Menu menu,User user);
     public List<Menu> getMenuByParent(Menu menu);
     public void insert(Menu menu);
     public void update(Menu menu);

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

@@ -2,7 +2,7 @@ package com.xintong.visualinspection.service;
 
 import java.util.List;
 
-import com.xintong.visualinspection.bean.Constant;
+import com.xintong.visualinspection.bean.ClassCode;
 import com.xintong.visualinspection.bean.TeamClass;
 
 /**
@@ -25,4 +25,6 @@ public interface TeamClassService {
     public void update(TeamClass teamClass);
     public void delete(Long id);
     public void updateList(List<TeamClass> teamClasses);
+    
+    public List<TeamClass> getClassCode(ClassCode teamClass);
 }

+ 0 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/AuthServiceImpl.java

@@ -54,7 +54,6 @@ public class AuthServiceImpl extends BaseService implements AuthService {
 	        UsernamePasswordAuthenticationToken upToken = new UsernamePasswordAuthenticationToken(username, password);
 	        final Authentication authentication = authenticationManager.authenticate(upToken);
 	        SecurityContextHolder.getContext().setAuthentication(authentication);
-
 	        User userDetails =(User) userDetailsService.loadUserByUsername(username);
 	        
 	        final String token = jwtTokenUtil.generateToken(userDetails);

+ 27 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/MenuServiceImpl.java

@@ -10,7 +10,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.xintong.visualinspection.bean.Menu;
+import com.xintong.visualinspection.bean.Permission;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.master.MenuDao;
+import com.xintong.visualinspection.dao.master.PermissionDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.MenuService;
 
@@ -28,11 +31,14 @@ public class MenuServiceImpl extends BaseService implements MenuService {
 
 	@Autowired
 	private MenuDao menuDao;
+	@Autowired
+	private PermissionDao permissionDao;
 
 	@Override
-	public List<Menu> getMenus(Menu menu) {
+	public List<Menu> getMenus(Menu menu,User user) {
 		
 		List<Menu> menus = 	menuDao.getMenu(menu);
+		menus=getMenusByPermison(menus,user);
 		
 		List<Menu> mlist = 	new ArrayList<>();
 		
@@ -88,5 +94,25 @@ public class MenuServiceImpl extends BaseService implements MenuService {
 		List<Menu> menus = 	menuDao.getMenuByParent(menu);
 		return menus;
 	}
+	
+	
+	 private List<Menu> getMenusByPermison(List<Menu> menus,User user){
+	    	//判断有权限的资源
+	    	//获取权限资源
+	    	List<Permission> permissions= permissionDao.findByAdminUserId(user.getId());
+	    	Map<Integer,Permission> pmap = new HashMap<>();
+	    	for(Permission p : permissions){
+	    		pmap.put(p.getResourceid(), p);
+	    	}
+	    	List<Menu> menulist = new ArrayList<>();
+	    	for(Menu m : menus){
+	    		//为有权限的资源
+	    		if(pmap.get(m.getId())!=null && pmap.get(m.getId()).getPermission_type()==1){
+	    			menulist.add(m);
+	    		}
+	    	}
+
+	    	return menulist;
+	    }
 
 }

+ 7 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/TeamClassServiceImpl.java

@@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.xintong.visualinspection.bean.ClassCode;
 import com.xintong.visualinspection.bean.TeamClass;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.dao.master.TeamClassDao;
@@ -93,4 +94,10 @@ public class TeamClassServiceImpl extends BaseService implements TeamClassServic
 		teamClassDao.delete(id);
 	}
 
+	@Override
+	public List<TeamClass> getClassCode(ClassCode teamClass) {
+		// TODO Auto-generated method stub
+		return teamClassDao.getClassCode(teamClass);
+	}
+
 }