Browse Source

申诉列表

minitiger 9 years ago
parent
commit
b892e0ec76

+ 23 - 16
VisualInspection/js/appeal_management/appeal_list.js

@@ -50,14 +50,14 @@ function queryTable(){
         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_name'},
-                        {width: 100, text: '考核部门',  flex: false, colClass: '',sort: 'down',field:'appeal_dept_name'},
-                        {width: 80, text: '稽查人员', type: 'string', flex: false, hide:true,colClass: '',field:'verify_person_name'},
-                        {width: 120, text: '稽查时间段', type: 'string',custom:'-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: 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, hide:hide,colClass: '',field:'verify_person_name'},
+                        {width: 120, text: '稽查时间段', type: 'string', flex: false, colClass: '',field:'check_period'},
+                        {width: 80, text: '状态', type: 'string', flex: false, colClass: '',field:'check_status_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:'seeDetail',text:'详情',col_class:''}
+                            {func:'seeCheckAudit',text:'处理',col_class:''},{func:'seeDetail',text:'详情',col_class:''}
                         ]},
                     ] ;
         
@@ -90,21 +90,28 @@ function queryUnAssignedTable(){
             "start_time": $("#start_time").val(),
             "end_time": $("#end_time").val(),
             "checked_dept": $("#dept_select").val(),
-            
+
         }
         var hide = false;
         if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
             hide = true;
         }
         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_name'},
-                        {width: 100, text: '考核部门',  flex: false, colClass: '',sort: 'down',field:'appeal_dept_name'},
-                        {width: 80, text: '稽查人员', type: 'string', flex: false, hide:true,colClass: '',field:'verify_person_name'},
-                        {width: 120, text: '稽查时间段', type: 'string', 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: 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_name'},
+                        // {width: 100, text: '考核部门',  flex: false, colClass: '',sort: 'down',field:'appeal_dept_name'},
+                        // {width: 80, text: '稽查人员', type: 'string', flex: false, hide:true,colClass: '',field:'verify_person_name'},
+                        // {width: 120, text: '稽查时间段', type: 'string', 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: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
+                        {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
+                        {width: 80, text: '申诉人员', type: 'string', flex: true, field: 'checked_person_name'},
+                        {width: 160, text: '申诉部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
+                        {width: 80, text: '稽查人员', type: 'string', flex: true, hide:hide,field: 'checkman_name'},
+                        {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
+                        {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
                         {width: 100, text: '操作',  flex: false, colClass: '',field:'id',field_other:'task_id',oper:[
                             {func:'seeCheckAudit',text:'查看稽查结果',col_class:''},{func:'seeDetail',text:'详情',col_class:''}
                         ]},

+ 2 - 2
VisualInspection/js/config.js

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

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

@@ -16,6 +16,8 @@ public class CheckAppeal {
     private String file_src;
     //申诉状态
     private Integer check_status;
+    //状态名称
+    private String check_status_name;
     //申诉时间
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
     @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")  
@@ -55,5 +57,11 @@ public class CheckAppeal {
     private String code_name;
     
     private String code_flag;
+    //任务时间段
+    private String check_period;
+    //第一次稽查人
+    private Long checkman;
+    //第二次稽查人
+    private Long recheckman;
     
 }

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

@@ -63,4 +63,6 @@ public class Task{
     private String user_class_id;
     
     private Integer status_search_type;
+    //任务稽查时间段
+    private String check_period;
 }

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

@@ -179,6 +179,7 @@ public class BaseController {
 			UserDetails u = redisCacheUtil.getUserByUserName(username);
 			User u_t = (User) JSON.parseObject(JSON.toJSONString(u),User.class) ; 
 			User user = CacheUtil.userMap.get(new Long(u_t.getId()));
+			user.setRoles(u_t.getRoles());
 			return user;
 		}
 		return null;

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

@@ -21,6 +21,7 @@ import com.xintong.visualinspection.bean.Task;
 import com.xintong.visualinspection.bean.TaskStatus;
 import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.service.TaskService;
+import com.xintong.visualinspection.util.AuthorUtil;
 import com.xintong.visualinspection.util.CacheUtil;
 import com.xintong.visualinspection.util.Constants;
 
@@ -186,7 +187,12 @@ public class TaskController extends BaseController {
     public String getTaskList(HttpServletRequest request, @PathVariable Integer page,@PathVariable Integer size, @RequestBody Task task){
     	PageHelper.startPage(page, size); 
     	User user = getCurrentUser(request);
-    	task.setCheckman(new Long(user.getId()));
+    	if(AuthorUtil.hasRole(user, Constants.ROLE_STATION_ADMIN)
+    			||AuthorUtil.hasRole(user, Constants.ROLE_STATION)){
+    		task.setChecked_dept((long)user.getOrganid());
+    	}else if(AuthorUtil.hasRole(user, Constants.ROLE_JICHA)){
+    		task.setCheckman(new Long(user.getId()));
+    	}
     	List<Task> taskList = taskService.getTaskList(task);
     	if(taskList==null) return super.returnSuccessResult(new PageInfo(new ArrayList()));
     	return super.returnSuccessResult(new PageInfo(taskList));

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

@@ -12,6 +12,7 @@
         <id property="id" column="ID"/>
         <result property="username" column="username"/>
         <result property="password" column="PASSWORD"/>
+        <result property="truename" column="truename"/>
         <result column="organid" property="organid" jdbcType="INTEGER" />
         <collection property="roles" ofType="com.xintong.visualinspection.bean.Role">
             <result column="name" property="name"/>
@@ -45,13 +46,7 @@
         SET
         <if test="username != null">username = #{username},</if>
         <if test="age != null">age = #{age},</if>
-        <if test="organid != null">ORGANID = #{organid},</if>
         <if test="password != null">password = #{password},</if>
-        <if test="truename != null">TRUENAME = #{truename},</if>
-        <if test="workno != null">workno = #{workno},</if>
-        <if test="mobile != null">mobile = #{mobile},</if>
-        <if test="idno != null">idno = #{idno},</if>
-        <if test="positionid != null">positionid = #{positionid},</if>
         <if test="pic != null">pic = #{pic},</if>
         id = #{id}
         WHERE

+ 8 - 3
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckAppealMapper.xml

@@ -17,15 +17,20 @@
         <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="check_period" property="check_period" jdbcType="VARCHAR" />
+        <result column="checkman" property="checkman" jdbcType="INTEGER" />
+        <result column="recheckman" property="recheckman" jdbcType="INTEGER" />
         
         <result column="code_name" property="code_name" jdbcType="VARCHAR" />
         <result column="code_flag" property="code_flag" jdbcType="VARCHAR" />
     </resultMap>
 
     <select id="getList" resultMap="BaseResultMap" parameterType="com.xintong.visualinspection.bean.CheckAppeal" >
-        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 AND sc.code_flag=#{code_flag} 
+        SELECT ca.*,ct.name,ct.start_time,ct.end_time,ct.checkman,ct.recheckman,ct.check_status as check_status,
+        		CONCAT(substr(ct.start_time,1,16),'-',substr(ct.end_time,12,5)) as check_period,
+        		(select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=ct.check_status) as check_status_name    		
+        FROM check_appeal ca LEFT JOIN check_task ct ON ca.task_id=ct.id 
+        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}]]>

+ 3 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TaskMapper.xml

@@ -18,7 +18,7 @@
         <result column="checked_location" property="checked_location" jdbcType="VARCHAR" />
         <result column="checked_location_type" property="checked_location_type" jdbcType="INTEGER" />
         <result column="remark" property="remark" jdbcType="VARCHAR" />
-        <result column="remark" property="remark" jdbcType="VARCHAR" />
+        <result column="check_period" property="check_period" jdbcType="VARCHAR" />
     </resultMap>
     <resultMap id="taskStatusMap" type="com.xintong.visualinspection.bean.TaskStatus">
         <id property="id" column="ID"/>
@@ -50,6 +50,7 @@
     
     <select id="getList" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
         SELECT *,
+        		CONCAT(substr(start_time,1,16),'-',substr(end_time,12,5)) as check_period,
               (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
         FROM check_task
         WHERE 1=1
@@ -63,6 +64,7 @@
     
     <select id="getListByChecked" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
         SELECT *,
+        	  CONCAT(substr(start_time,1,16),'-',substr(end_time,11,6)) as check_period,
               (select a.code_name from sys_code a where a.code_flag='task_status' and a.code_value=check_status) as check_status_name
         FROM check_task
         WHERE 1=1

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

@@ -91,7 +91,7 @@ public class TaskServiceImpl extends BaseService implements TaskService {
 		taskDao.update(task);
 		
 		//状态不一致才保存
-		if(!oldTask.getCheck_status().equals(task.getCheck_status())){
+		if(!oldTask.getCheck_status().equals(task.getCheck_status()) && task.getCheck_status()!=null){
 			TaskStatus status = new TaskStatus();
 			status.setTask_id(task.getId());
 			status.setUpdate_time(new Date());

+ 16 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/util/AuthorUtil.java

@@ -0,0 +1,16 @@
+package com.xintong.visualinspection.util;
+
+import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
+
+public class AuthorUtil {
+	
+	public static boolean hasRole(User user, String role) {
+		for(Role r:user.getRoles()) {
+			if(role.equals(r.getName())){
+				return true;
+			}
+		}
+		return false;
+	}
+}

+ 7 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/util/Constants.java

@@ -13,4 +13,11 @@ public class Constants {
 	public static int STATUS_APPLYING = 21;
 	public static int STATUS_APPLY_SUCCEED = 22;
 	public static int STATUS_APPLY_FAILED = 23;
+	
+	
+	public static String ROLE_JICHA_ADMIN="ROLE_JICHA_ADMIN";
+	public static String ROLE_STATION_ADMIN="ROLE_STATION_ADMIN";
+	public static String ROLE_STATION="ROLE_STATION";
+	public static String ROLE_JICHA="ROLE_JICHA";
+	public static String ROLE_MANAGER="ROLE_MANAGER";
 }