فهرست منبع

添加稽查次数显示

minitiger 8 سال پیش
والد
کامیت
28a01cbbec

+ 51 - 23
VisualInspection/js/mytask/check.js

@@ -43,9 +43,7 @@ function initCheck() {
         format: "yyyy-mm-dd"
     });
     if ($.checkTask) {
-        getUserCheckCount(function(userList){
-            $("#checked_count").html(userList.length);
-        });
+        getUserCheckCount();
         initCheckAppealBtns();
         setFeSelect("#fsList", $.checkTask.checked_dept);
         // setFeeUserSelect("#check_checked_person_select", $.checkTask.checked_person);
@@ -182,16 +180,32 @@ function fullscreen() {
 
 }
 
-function getUserCheckCount(callback) {
+function getUserCheckCount() {
     var param = {
         "id":$.checkTask.id,
         "checked_person":$.checkTask.checked_person
     };
     post_common_service("/task/getUserCount/", param, function (userList) { 
-        callback(userList);//$("#checked_count").html(userList.length);
+        $("#checked_count").html(userList.length);
     });
 }
 
+function checkUserCount() {
+    var param = {
+        "id":$.checkTask.id,
+        "checked_person":$.checkTask.checked_person,
+        "class_type":$.checkTask.class_type
+    };
+    post_common_service("/task/getUserCount/", param, function(data){
+        if(data>=2){
+            layer.msg("本周期稽查次数已满,不能再被稽查!", {
+                time: 2000//20s后自动关闭
+            });
+            return false;
+        }
+        return true;
+    });
+}
 function showCheckDetailCount(){
     
 }
@@ -467,25 +481,39 @@ function showChangeUser() {
 }
 
 function changePerson(id) {
-    // $('#checked_person').html(id);
+    var flag=true;
     var param = {
-        "id": $.checkTask.id,
-        "checked_person": id,
-    }
-    post_common_service("task/update/", param, function (task_data) {
-        //重置当前任务
-        $.checkTask = task_data;
-        //获取用户信息
-        get_common_service('user/getUserById/' + id, null, function (data) {
-            changePersonContent(data);
-        })
-        //更新用户次数表
-        no_return_common_service('task/updateUserCount/', param, function (data) {
-            // changePersonContent(data);
-        })
-        layer.close(changePersonLayer);
-    }, function (error) {
-        alert(error);
+        "id":$.checkTask.id,
+        "checked_person":id,
+        "class_type":$.checkTask.class_type
+    };
+    post_common_service("/task/getUserCount/", param, function(data){
+        if(data && data.length>=2){
+            layer.msg("本周期稽查次数已满,不能再被稽查!", {
+                time: 2000//20s后自动关闭
+            });
+        }else{
+            // $('#checked_person').html(id);
+            var param1 = {
+                "id": $.checkTask.id,
+                "checked_person": id,
+            }
+            post_common_service("task/update/", param1, function (task_data) {
+                //重置当前任务
+                $.checkTask = task_data;
+                //获取用户信息
+                get_common_service('user/getUserById/' + id, null, function (data) {
+                    changePersonContent(data);
+                })
+                //更新用户次数表
+                no_return_common_service('task/updateUserCount/', param, function (data) {
+                    // changePersonContent(data);
+                })
+                layer.close(changePersonLayer);
+            }, function (error) {
+                alert(error);
+            });
+        }
     });
 }
 

+ 9 - 2
VisualInspection/view/mytask/taskDetail.html

@@ -44,6 +44,13 @@
                     <td>
                     </td>
                 </tr>
+                <tr>
+                    <td width="20%">复核结果:
+                         <label id="recheck_result"></label>
+                    </td>
+                    <td>
+                    </td>
+                </tr>
             </table>
         </div>
       </div>
@@ -107,9 +114,9 @@
         if($.checkTask.appeal) {
             $("#appeal_div").show();
             $("#appeal_time").html($.checkTask.appeal.appeal_time);
-            $("#appeal_reason").html($.checkTask.appeal.appeal_reason);
-            
+            $("#appeal_reason").html($.checkTask.appeal.appeal_reason);       
             $("#appeal_file_list").html(genAppeaFiles($.checkTask.appeal.file_src));
+            $("#recheck_result").html($.checkTask.appeal.recheck_result);
         }else{
             $("#appeal_div").hide();
         }

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

@@ -80,4 +80,6 @@ public class Task{
     private Long[] dispatch_ids;
     
     private Integer[] check_status_arr;
+    
+    private Integer class_type;
 }

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

@@ -20,6 +20,7 @@
         <result column="checked_location_type" property="checked_location_type" jdbcType="INTEGER" />
         <result column="remark" property="remark" jdbcType="VARCHAR" />
         <result column="check_period" property="check_period" jdbcType="VARCHAR" />
+        <result column="class_type" property="class_type" jdbcType="INTEGER" />
     </resultMap>
     <resultMap id="taskStatusMap" type="com.xintong.visualinspection.bean.TaskStatus">
         <id property="id" column="ID"/>
@@ -32,10 +33,9 @@
     </resultMap>
     <resultMap id="userCountMap" type="com.xintong.visualinspection.bean.UserClassCount">
         <id property="id" column="ID"/>
-        <result property="task_id" column="task_id"/>
-        <result property="user_id" column="user_id"/>
+        <result property="task_id" column="id"/>
+        <result property="user_id" column="checked_person"/>
         <result property="class_type" column="class_type"/>
-        <result property="days" column="days"/>
         <result property="period_id" column="period_id"/>
     </resultMap>
 
@@ -262,6 +262,7 @@
         FROM check_task
         WHERE check_status!=22
           and checked_person = #{checked_person}
+          <if test="class_type != null">and class_type = #{class_type}</if>
           and period_id = (
           	select period_id
           	from check_task

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

@@ -3,8 +3,8 @@ spring.thymeleaf.cache=false
 context.listener.classes=com.xintong.SystemInit
 
 #master.datasource.url = jdbc:mysql://10.112.0.199:3306/visualinspection?useUnicode=true&characterEncoding=utf-8
-master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
-#master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf-8
+#master.datasource.url = jdbc:mysql://git.topm.win:6381/visualinspection?useUnicode=true&characterEncoding=utf-8
+master.datasource.url = jdbc:mysql://10.112.0.199:7002/visualinspection?useUnicode=true&characterEncoding=utf-8
 master.datasource.username = root
 master.datasource.password = root
 master.datasource.driver-class-name = com.mysql.jdbc.Driver
@@ -12,8 +12,8 @@ master.mapper-locations=classpath:com/xintong/visualinspection/mapper/master/*.x
 
 ## \u7528\u6237\u6570\u636e\u6e90\u914d\u7f6e
 #cluster.datasource.url=jdbc:mysql://10.112.0.199:3306/yanhai?useUnicode=true&characterEncoding=utf8
-cluster.datasource.url=jdbc:mysql://git.topm.win:6381/yanhai?useUnicode=true&characterEncoding=utf8
-#cluster.datasource.url=jdbc:mysql://10.112.0.199:7002/yanhai?useUnicode=true&characterEncoding=utf8
+#cluster.datasource.url=jdbc:mysql://git.topm.win:6381/yanhai?useUnicode=true&characterEncoding=utf8
+cluster.datasource.url=jdbc:mysql://10.112.0.199:7002/yanhai?useUnicode=true&characterEncoding=utf8
 cluster.datasource.username=root
 cluster.datasource.password=root
 cluster.datasource.driver-class-name = com.mysql.jdbc.Driver
@@ -54,12 +54,12 @@ spring.datasource.useGlobalDataSourceStat=true
 # Redis\u6570\u636e\u5e93\u7d22\u5f15\uff08\u9ed8\u8ba4\u4e3a0\uff09
 spring.redis.database=0  
 # Redis\u670d\u52a1\u5668\u5730\u5740
-#spring.redis.host=10.112.0.199
-spring.redis.host=git.topm.win
+spring.redis.host=10.112.0.199
+#spring.redis.host=git.topm.win
 # Redis\u670d\u52a1\u5668\u8fde\u63a5\u7aef\u53e3
-spring.redis.port=6380
+#spring.redis.port=6380
 
-#spring.redis.port=7003
+spring.redis.port=7003
 #spring.redis.port=6379 
 # Redis\u670d\u52a1\u5668\u8fde\u63a5\u5bc6\u7801\uff08\u9ed8\u8ba4\u4e3a\u7a7a\uff09
 spring.redis.password=xintong