Prechádzať zdrojové kódy

修改前台业务逻辑

minitiger 9 rokov pred
rodič
commit
7bfd068ec1

+ 6 - 1
VisualInspection/js/lib/mytable.js

@@ -54,7 +54,11 @@
             var param = options.param;
             // var obj = this.obj;
             post_common_service(url+"/"+p_cur+"/"+page_size, param, function(data) {
-                // $(element).html("");
+                console.log(data);
+                if(!data){
+                    data = {list:[]};
+                    // return;
+                }
                  // 这边把请求过来的数据缓存到table选择器中
                 $(element).data("data_cache",data.list);
                 element.tt_data=data.list;
@@ -83,6 +87,7 @@
             var cols = options.cols;
             var tableData = datas;
             // var pager = options.pager;
+           
             clearTable(cols);
             var rowData = formatTableData(tableData, cols, p_cur);
 

+ 2 - 0
VisualInspection/js/mytask/check.js

@@ -51,6 +51,8 @@ function initInfo() {
 }
 // 使用data参数更新数据:
 function queryScores() {
+    //$('#score_datatable').score_datatable("");
+    console.log("任务id:"+$.checkTask.id);
     var data = {
         "task_id": $.checkTask.id
     }

+ 18 - 6
VisualInspection/js/util/video.js

@@ -9,12 +9,24 @@ function doAction(func){
 
 function queryVideoList(){
     console.log("视屏:"+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;
-    var str = curVideo+'|'+startTime+'|'+endTime;
-    callFunc("findvideolist",str);
+    //alert(curVideo);
+    if(!curVideo) {
+        var videos = $.checkTask.video_id.split(',');
+        curVideo = videos[0];
+        //alert(curVideo);
+    }
+    // alert(curVideo);
+    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;
+        // alert(curVideo);
+        var str = curVideo+'|'+startTime+'|'+endTime;
+        callFunc("findvideolist",str);
+    }else{
+
+    }
 }
 
 function playVideo(id){

+ 15 - 3
VisualInspection/view/appeal_management/appealDetail.html

@@ -8,11 +8,10 @@
                 <input type="text" class="form-control" id="appeal_reason" placeholder="">
             </div>
         </div>
-        <div class="form-group">
+        <!--<div class="form-group">
             <label class="col-md-4 col-sm-2">申诉附件</label>
             <div class="col-md-6 col-sm-10">
                 <div id="uploader" class="wu-example">
-                    <!--用来存放文件信息-->
                     <div id="thelist" class="uploader-list"></div>
                     <div class="btns">
                         <div id="picker">选择文件</div>
@@ -20,11 +19,24 @@
                     </div>
                 </div>
             </div>
-        </div>
+        </div>-->
     </form>
 </div>
 <script>
  $(document).ready(function() {
      initUpLoad();
  });
+
+ function saveAppeal(){
+    var param = {
+        "task_id": $.checkTask.id,
+        "appeal_reason": $("#appeal_reason").val()
+    }
+    no_return_common_service("/checkAppeal/add/", param, function (data) {
+        layer.msg("申诉提交成功", {
+            time: 2000//20s后自动关闭
+        });
+        changePage("/view/mytask/unchecked.html");
+    });
+ }
  </script>

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

@@ -163,8 +163,8 @@
         $('[data-tab]').on('shown.zui.tab', function(e) {
             // console.log('当前被激活的标签页', $(e.target).attr('bbb'));
             // console.log('上一个标签页', e.relatedTarget);
-            var i = $(e.target).attr('bbb');
-            var videos = $.checkTask.video_id.split(',');
+            var i = $(e.target).attr('bbb');           
+            var videos = $.checkTask.video_id.split(',');     
             if(videos[i]) curVideo = videos[i];
             queryVideoList();
         });

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

@@ -191,6 +191,7 @@
     }
 
     function showAppeal(){
-        appealLayer = showPopup4Common('申诉',null,'600px','#appealDetail-div');
+        appealLayer = showPopup4Common('申诉',saveAppeal,'600px','#appealDetail-div');
     }
+
     </script>

+ 21 - 4
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/CheckAppealController.java

@@ -1,8 +1,8 @@
 package com.xintong.visualinspection.controller;
 
-import java.util.Date;
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,8 +15,11 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.xintong.system.err.BusinessException;
 import com.xintong.visualinspection.bean.CheckAppeal;
-import com.xintong.visualinspection.bean.Team;
+import com.xintong.visualinspection.bean.Task;
+import com.xintong.visualinspection.bean.User;
 import com.xintong.visualinspection.service.CheckAppealService;
+import com.xintong.visualinspection.service.TaskService;
+import com.xintong.visualinspection.util.Constants;
 
 /**
  * 文件名:CheckItemController
@@ -28,7 +31,8 @@ public class CheckAppealController extends BaseController {
 
     @Autowired
     private CheckAppealService checkAppealService;
-
+    @Autowired
+    TaskService taskService;
    
     /**
      * 添加考核项
@@ -38,8 +42,21 @@ public class CheckAppealController extends BaseController {
      * @since  1.0.0
      */
     @RequestMapping(value = "/add")
-    public String add(@Valid @RequestBody CheckAppeal checkAppeal){
+    public String add(HttpServletRequest request,@Valid @RequestBody CheckAppeal checkAppeal){
+//    	CheckAppeal ca = checkAppealService.getByTaskId(checkAppeal.getTask_id());
+//		if(ca!=null) {
+//			throw new BusinessException(21201);
+//		}
+		
+    	User u = getCurrentUser(request);
+    	checkAppeal.setAppeal_man(new Long(u.getId()));
+    	checkAppeal.setCheck_status(Constants.STATUS_APPEALING);
+    	if(u.getOrganid()!=null)
+    		checkAppeal.setAppeal_dept(new Long(u.getOrganid()));
     	checkAppealService.insert(checkAppeal);
+    	Task task = taskService.getById(checkAppeal.getTask_id());
+    	task.setCheck_status(checkAppeal.getCheck_status());
+    	taskService.update(task);
     	return super.returnSuccessResult("添加成功");
     }
     

+ 2 - 1
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/ScoreMapper.xml

@@ -28,12 +28,13 @@
         WHERE id = #{id}
     </select>
     
-    <select id="getScoreList" parameterType="java.lang.Long" resultMap="BaseResultMap" >
+    <select id="getScoreList" parameterType="com.xintong.visualinspection.bean.Score" resultMap="BaseResultMap" >
         SELECT *,
         	  a.score as check_item_score,
         	  a.name as check_item_name
         FROM check_score left join check_item a on check_item_id=a.id
         WHERE 1=1
+        	 <if test="task_id != null">AND task_id = #{task_id}</if>
         	 <if test="checked_person != null">AND checked_person = #{checked_person}</if>
         	 <if test="check_item_id != null">AND check_item_id = #{check_item_id}</if>
         	 <if test="checked_dept != null">AND checked_dept = #{checked_dept}</if>

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

@@ -36,17 +36,17 @@ public class CheckAppealServiceImpl extends BaseService implements CheckAppealSe
 	}
 	public List<CheckAppeal> getList(List<CheckAppeal> checkAppeallist){
 		for (CheckAppeal checkAppeal : checkAppeallist) {
-			if(CacheUtil.userMap.get(checkAppeal.getAppeal_man().longValue())==null){
+			if(checkAppeal.getAppeal_man()==null||CacheUtil.userMap.get(checkAppeal.getAppeal_man().longValue())==null){
 				checkAppeal.setAppeal_man_name("-");
 			}else{
 				checkAppeal.setAppeal_man_name(CacheUtil.userMap.get(checkAppeal.getAppeal_man().longValue()).getTruename());
 			}
-			if(CacheUtil.userMap.get(checkAppeal.getVerify_person().longValue())==null){
+			if(checkAppeal.getVerify_person() == null || CacheUtil.userMap.get(checkAppeal.getVerify_person().longValue())==null){
 				checkAppeal.setVerify_person_name("-");
 			}else{
 				checkAppeal.setVerify_person_name(CacheUtil.userMap.get(checkAppeal.getVerify_person().longValue()).getTruename());
 			}
-			if(CacheUtil.deptMap.get(checkAppeal.getAppeal_dept().longValue())==null){
+			if(checkAppeal.getAppeal_dept()==null || CacheUtil.deptMap.get(checkAppeal.getAppeal_dept().longValue())==null){
 				checkAppeal.setAppeal_dept_name("-");
 			}else{
 				checkAppeal.setAppeal_dept_name(CacheUtil.deptMap.get(checkAppeal.getAppeal_dept().longValue()).getOrganname());