Bladeren bron

人员分组管理、申诉管理关联优化

DESKTOP-C0VON0P\wuxinglong 9 jaren geleden
bovenliggende
commit
528d56a137

+ 26 - 6
VisualInspection/js/appeal_management/appeal_list.js

@@ -8,21 +8,25 @@ $(document).ready(function(){
         }
         var start_time = $("#start-time").val();
         var end_time = $("#end-time").val();
+        var dept_select = $("#dept_select").val();
         if(start_time != ''){
             data.start_time = start_time;
         }
         if(end_time != ''){
             data.end_time = end_time;
         }
+        if(dept_select!='' && dept_select != 0){
+            data.appeal_dept = dept_select;
+        }
         var cols = [
                         {width: 30, text: '序号', flex: false, colClass: 'text-center',field:'num'},
                         {width: 100, text: '任务名称', flex: false,colClass: '',field:'name'},
-                        {width: 80, text: '考核人员',  flex: false, colClass: '',field:'appeal_man'},
-                        {width: 80, text: '考核部门',  flex: false, colClass: '',sort: 'down',field:'appeal_dept'},
-                        {width: 80, text: '稽查人员', type: 'string', flex: false, colClass: '',field:'verify_person'},
-                        {width: 120, text: '稽查时间段', type: 'date',date_type:'yyyy-MM-dd',custom:' 00:00-24:00', flex: false, colClass: '',field:'start_time'},
-                        {width: 80, text: '状态', type: 'string', flex: false, colClass: '',field:'check_status'},
-                        {width: 120, text: '上次稽查时间', type: 'date',date_type:'yyyy-MM-dd hh:mm', flex: false, colClass: '',field:'start_time'},
+                        {width: 80, text: '考核人员',  flex: false, colClass: '',field:'appeal_man_name'},
+                        {width: 100, text: '考核部门',  flex: false, colClass: '',sort: 'down',field:'appeal_dept_name'},
+                        {width: 80, text: '稽查人员', type: 'string', flex: false, colClass: '',field:'verify_person_name'},
+                        {width: 120, text: '稽查时间段', type: 'string',custom:' 00:00-24:00', flex: false, colClass: '',field:'start_time'},
+                        {width: 80, text: '状态', type: 'string', flex: false, colClass: '',field:'code_name'},
+                        {width: 120, text: '上次稽查时间', type: 'string', flex: false, colClass: '',field:'start_time'},
                         {width: 100, text: '操作',  flex: false, colClass: '',field:'id',field_other:'task_id',oper:[
                             {func:'seeCheckAudit',text:'查看稽查结果',col_class:''},{func:'distributionAgain',text:'在分配',col_class:''}
                         ]},
@@ -38,6 +42,22 @@ $(document).ready(function(){
         queryTable();
     })
 
+    getDeptList();
+    //初始化部门下拉框
+    function getDeptList(){
+        data ={}
+        post_common_service("dept/get/all", data, function(data){
+            $("#dept_select").empty();
+            $("#dept_select").append('<option value="">全部</option>');
+           
+            for(i=0;i<data.length;i++){
+                $("#dept_select").append('<option value="'+data[i].id+'">'+data[i].organname+'</option>');
+            }
+        }, function(){
+
+        });
+    }
+
 
 })
 //查看稽查结果

+ 4 - 5
VisualInspection/js/term_management/charge_terms_m.js

@@ -11,7 +11,7 @@
         }
         var cols = [
                         {width: 30, text: '序号', flex: false, colClass: 'text-center',field:'num'},
-                        {width: 160, text: '班组名称', flex: false,colClass: '',field:'name'},
+                        {width: 100, text: '班组名称', flex: false,colClass: '',field:'name'},
                         {width: 80, text: '所属人员分类',  flex: false, colClass: '',field:'type',func:function(obj){
                             if(obj==1){
                                 return "收费人员";
@@ -19,9 +19,9 @@
                                 return "稽查人员";
                             }
                         }},
-                        {width: 80, text: '班长', type: 'string', flex: false, sort: 'down',field:'monitor'},
-                        {width: 80, text: '副班长', type: 'string', flex: false, colClass: '',field:'sub_monitor'},
-                        {width: 80, text: '人员',  flex: false, colClass: '',field:'user_ids'},
+                        {width: 80, text: '班长', type: 'string', flex: false, sort: 'down',field:'monitor_name'},
+                        {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'}
                         ]},
@@ -47,7 +47,6 @@
             $("#second-monitor").empty();
             $("#member").empty();
             for(i=0;i<data.length;i++){
-                console.log(data[i])
                 $("#monitor").append('<option value="'+data[i].id+'">'+data[i].truename+'</option>');
                 $("#second-monitor").append('<option value="'+data[i].id+'">'+data[i].truename+'</option>');
                 $("#member").append('<div style="width:83px;float:left;">\

+ 4 - 5
VisualInspection/js/term_management/check_terms_m.js

@@ -11,7 +11,7 @@
         }
         var cols = [
                         {width: 30, text: '序号', flex: false, colClass: 'text-center',field:'num'},
-                        {width: 160, text: '班组名称', flex: false,colClass: '',field:'name'},
+                        {width: 100, text: '班组名称', flex: false,colClass: '',field:'name'},
                         {width: 80, text: '所属人员分类',  flex: false, colClass: '',field:'type',func:function(obj){
                             if(obj==1){
                                 return "收费人员";
@@ -19,9 +19,9 @@
                                 return "稽查人员";
                             }
                         }},
-                        {width: 80, text: '班长', type: 'string', flex: false, sort: 'down',field:'monitor'},
-                        {width: 80, text: '副班长', type: 'string', flex: false, colClass: '',field:'sub_monitor'},
-                        {width: 80, text: '人员',  flex: false, colClass: '',field:'user_ids'},
+                        {width: 80, text: '班长', type: 'string', flex: false, sort: 'down',field:'monitor_name'},
+                        {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'}
                         ]},
@@ -47,7 +47,6 @@
             $("#second-monitor").empty();
             $("#member").empty();
             for(i=0;i<data.length;i++){
-                console.log(data[i])
                 $("#monitor").append('<option value="'+data[i].id+'">'+data[i].truename+'</option>');
                 $("#second-monitor").append('<option value="'+data[i].id+'">'+data[i].truename+'</option>');
                 $("#member").append('<div style="width:83px;float:left;">\

+ 1 - 1
VisualInspection/view/appeal_management/appeal_list.html

@@ -13,7 +13,7 @@
                     </div>
                     <label for="exampleInputAccount1" class="col-sm-1">稽查部门</label>
                     <div class="col-sm-2">
-                        <select class="form-control">
+                        <select class="form-control" id="dept_select">
                             <option value="">全部</option>
                         </select>
                     </div>

+ 10 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckAppeal.java

@@ -36,6 +36,14 @@ public class CheckAppeal {
     private String remark;
     
     
+    //申诉人
+    private String appeal_man_name;
+    //核实人
+    private String verify_person_name;
+    //申诉部门
+    private String appeal_dept_name;
+    
+    
     //稽查任务关联信息
     //任务名称
     private String name;
@@ -43,5 +51,7 @@ public class CheckAppeal {
     private Date start_time;
     //任务结束时间
     private Date end_time;
+    //申诉状态
+    private String code_name;
     
 }

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

@@ -33,4 +33,6 @@ public class Team {
     
     private String sub_monitor_name;
     
+    private String user_ids_name;
+    
 }

+ 11 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/DepartmentController.java

@@ -87,6 +87,17 @@ public class DepartmentController extends BaseController {
      * @param size
      * @return
      */
+    @RequestMapping(value = "/get/all",method=RequestMethod.POST,produces="application/json;charset=UTF-8")
+    public String getAll(){
+        try{
+        	Organ organ=new Organ();
+        	organ.setStatus(0);
+        	List<Organ> organs= departmentService.getAll();
+        	return returnResult(0, "获取成功", organs);
+        }catch(Exception e){
+        	throw new BusinessException(20001);
+        }
+    }
     @RequestMapping(value = "/get/all",method=RequestMethod.GET,produces="application/json;charset=UTF-8")
     public String getAllDept(){
         try{

+ 5 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckAppealMapper.xml

@@ -17,15 +17,19 @@
         <result column="name" property="name" jdbcType="VARCHAR" />
         <result column="start_time" property="start_time" jdbcType="DATE" />
         <result column="end_time" property="end_time" jdbcType="DATE" />
+        
+        <result column="code_name" property="code_name" jdbcType="VARCHAR" />
     </resultMap>
 
     <select id="getList" resultMap="BaseResultMap" parameterType="com.xintong.visualinspection.bean.CheckAppeal" >
-        SELECT ca.*,ct.name,ct.start_time,ct.end_time FROM check_appeal ca LEFT JOIN check_task ct ON ca.task_id=ct.id 
+        SELECT ca.*,ct.name,ct.start_time,ct.end_time,sc.code_name FROM check_appeal ca LEFT JOIN check_task ct ON ca.task_id=ct.id 
+        LEFT JOIN sys_code sc ON ca.check_status=sc.code_value
         WHERE 1=1 
         <if test="start_time != null">AND ct.start_time >= #{start_time}</if>
         <if test="end_time != null">
         	<![CDATA[ AND ct.end_time < #{end_time}]]>
         </if>
+        <if test="appeal_dept != null">AND ca.appeal_dept = #{appeal_dept}</if>
         ORDER BY ca.appeal_time DESC
     </select>
 

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

@@ -4,6 +4,7 @@ import com.xintong.visualinspection.bean.User;
 import org.springframework.security.core.userdetails.UserDetails;
 import org.springframework.security.core.userdetails.UserDetailsService;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**

+ 26 - 3
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/CheckAppealServiceImpl.java

@@ -1,6 +1,6 @@
 package com.xintong.visualinspection.service.impl;
 
-import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 import org.slf4j.LoggerFactory;
@@ -11,6 +11,8 @@ import com.xintong.visualinspection.bean.CheckAppeal;
 import com.xintong.visualinspection.dao.master.CheckAppealDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.CheckAppealService;
+import com.xintong.visualinspection.service.UserService;
+import com.xintong.visualinspection.util.CacheUtil;
 
 /**
  * 文件名:UserServiceImpl
@@ -24,12 +26,33 @@ public class CheckAppealServiceImpl extends BaseService implements CheckAppealSe
 
     @Autowired
     private CheckAppealDao checkAppealDao;
-
+    @Autowired
+    private UserService userService;
 
 	@Override
 	public List<CheckAppeal> getList(CheckAppeal param) {
 		List<CheckAppeal> list = checkAppealDao.getList(param);
-		return list ;
+		return getList(list) ;
+	}
+	public List<CheckAppeal> getList(List<CheckAppeal> checkAppeallist){
+		for (CheckAppeal checkAppeal : checkAppeallist) {
+			if(CacheUtil.userMap.get(checkAppeal.getAppeal_man().intValue())==null){
+				checkAppeal.setAppeal_man_name("-");
+			}else{
+				checkAppeal.setAppeal_man_name(CacheUtil.userMap.get(checkAppeal.getAppeal_man().intValue()).getTruename());
+			}
+			if(CacheUtil.userMap.get(checkAppeal.getVerify_person().intValue())==null){
+				checkAppeal.setVerify_person_name("-");
+			}else{
+				checkAppeal.setVerify_person_name(CacheUtil.userMap.get(checkAppeal.getVerify_person().intValue()).getTruename());
+			}
+			if(CacheUtil.deptMap.get(checkAppeal.getAppeal_dept().intValue())==null){
+				checkAppeal.setAppeal_dept_name("-");
+			}else{
+				checkAppeal.setAppeal_dept_name(CacheUtil.deptMap.get(checkAppeal.getAppeal_dept().intValue()).getOrganname());
+			}
+		}
+		return checkAppeallist;
 	}
 
 	@Override

+ 40 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/TeamServiceImpl.java

@@ -1,16 +1,18 @@
 package com.xintong.visualinspection.service.impl;
 
+import java.util.HashMap;
 import java.util.List;
 
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.xintong.visualinspection.bean.Constant;
 import com.xintong.visualinspection.bean.Team;
 import com.xintong.visualinspection.dao.master.TeamDao;
 import com.xintong.visualinspection.service.BaseService;
 import com.xintong.visualinspection.service.TeamService;
+import com.xintong.visualinspection.service.UserService;
+import com.xintong.visualinspection.util.CacheUtil;
 
 /**
  * 文件名:UserServiceImpl
@@ -24,7 +26,8 @@ public class TeamServiceImpl extends BaseService implements TeamService {
 
     @Autowired
     private TeamDao teamDao;
-
+    @Autowired
+    private UserService userService;
 
 	@Override
 	public List<Team> getAll() {
@@ -71,7 +74,40 @@ public class TeamServiceImpl extends BaseService implements TeamService {
 	@Override
 	public List<Team> getTeamByName(Team team) {
 		// TODO Auto-generated method stub
-		return teamDao.getTeamByName(team);
+		return getList(teamDao.getTeamByName(team));
+	}
+	
+	public List<Team> getList(List<Team> teamlist){
+		for (Team team : teamlist) {
+			if(CacheUtil.userMap.get(team.getMonitor().intValue()) == null){
+				team.setMonitor_name("-");
+			}else{
+				team.setMonitor_name(CacheUtil.userMap.get(team.getMonitor().intValue()).getTruename());
+			}
+			if(CacheUtil.userMap.get(team.getSub_monitor().intValue())==null){
+				team.setSub_monitor_name("-");
+			}else{
+				team.setSub_monitor_name(CacheUtil.userMap.get(team.getSub_monitor().intValue()).getTruename());
+			}
+			String[] user_ids = team.getUser_ids().split(",");
+			String user_ids_name = "";
+			for(int i=0;i<user_ids.length;i++){
+				if(CacheUtil.userMap.get(Integer.valueOf(user_ids[i]))==null){
+					if(i == 0){
+						user_ids_name = user_ids_name + "-";
+					}else{
+						user_ids_name = user_ids_name + "、-";
+					}
+				}else{
+					if(i==0){
+						user_ids_name = user_ids_name + CacheUtil.userMap.get(Integer.valueOf(user_ids[i])).getTruename();
+					}else{
+						user_ids_name = user_ids_name + "、" + CacheUtil.userMap.get(Integer.valueOf(user_ids[i])).getTruename();
+					}
+				}
+			}
+			team.setUser_ids_name(user_ids_name);
+		}
+		return teamlist;
 	}
-
 }