Răsfoiți Sursa

Merge branch 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection

* 'master' of http://git_xt.jsxt.jsjtyxt.com/wenhongquan/VisualInspection:
  添加一键下发所有无扣分任务
温红权 8 ani în urmă
părinte
comite
d05c21e129

+ 36 - 1
VisualInspection/css/main.css

@@ -77,11 +77,16 @@ footer p {
 a:hover{
     text-decoration: none;
 }
-
+a:focus {
+    text-decoration: none;
+}
 #breadcrumb_menu a{
     font-weight: bold;
     color:#03b8cf;
 }
+#breadcrumb_menu a:focus{
+    text-decoration: none;
+}
 .btn-info1{
     padding: 5px 5px;
     color:#03b8cf;
@@ -99,6 +104,14 @@ a:hover{
     color:#fff;
     background-color: #03b8cf;
 }
+.btn-info1:visited{
+    padding: 5px 5px;
+    color:#03b8cf;
+    background-color: #fff;
+    border-radius: 10px;
+    border-color: #03b8cf;
+    text-shadow: none;
+}
 
 .btn-info2{
     color:#fff;
@@ -116,6 +129,12 @@ a:hover{
     color:#03b8cf;
     background-color: #fff;
 }
+.btn-info2:active{
+    color:#fff;
+    background-color: #03b8cf;
+    border-radius: 4px;
+    border-color: #03b8cf;
+}
 .btn-info3{
     color:#fff;
     background-color: #38b03f;
@@ -132,6 +151,22 @@ a:hover{
     color:#38b03f;
     background-color: #fff;
 }
+.btn-info4{
+    color:#fff;
+    background-color: #B71C1C;
+    border-radius: 4px;
+    border-color: #B71C1C;
+    text-shadow: none;
+}
+.btn-info4:hover {
+    color:#B71C1C;
+    background-color: #fff;
+    border-color: #B71C1C;
+}
+.btn-info4:focus {
+    color:#B71C1C;
+    background-color: #fff;
+}
 
 .btn-table{
     color:#fff;

+ 1 - 1
VisualInspection/js/lib/kkpager_green.css

@@ -47,7 +47,7 @@
 }
 
 #kkpager a:hover {
-    border: 1px solid #146CC0;
+    border: 0px solid #146CC0;
     background-color: #146CC0;
     color: #fff;
 }

+ 1 - 1
VisualInspection/js/main.js

@@ -6,7 +6,7 @@ $(document).ready(function() {
     // $('#mum_left').perfectScrollbar();
     $('#mum_left').height($(document).height() - 60);
     $('#main_panel').height($(document).height() - 100);
-    $('#main_panel_body').height($(document).height() - 180);
+    $('#main_panel_body').height($(document).height() - 170);
     // $('#mum_right .panel').height($(document).height()-100);
     initUserinfo();
     setletftime();

+ 25 - 2
VisualInspection/js/mytask/task_list.js

@@ -66,9 +66,10 @@ function initQueryParams() {
         cur_status = page_params.status;
     }
     if(hasRole(ROLE_JICHA_ADMIN) && cur_status==4){
-        $("#dispatchPatchBtn").show(); 
+        $("#dispatchPatchBtn").show();
+        $("#dispatchAllNoScoreBtn").show();            
     }
-    if(cur_status==5){
+    if(roleContains("STATION") && cur_status==5){
         $("#confirmPatchBtn").show(); 
     }
     $("#checkPersonDiv").show();
@@ -263,6 +264,28 @@ function dispatchTaskById(id){
     });
     
 }
+function dispatchAllNoScoreTask(){
+    layer.confirm('确定下发选择时间内所有无扣分任务?', {
+        btn: ['确定','取消'] //按钮
+    }, function(){
+        var start_time = "";
+        if($("#start_time").val()) start_time = $("#start_time").val()+" 00:00:00";
+        var end_time = "";
+        if($("#end_time").val()) end_time = $("#end_time").val()+" 23:59:59"; 
+        var param = {
+            "start_time": start_time,
+            "end_time": end_time
+        }
+        no_return_common_service('/task/dispatchAllNoScoreTask', param, function(data){
+            queryTask();
+            layer.msg(data, {
+                time: 2000//20s后自动关闭
+            });
+        });
+    }, function(index){
+        layer.close(index);
+    });
+}
 
 function confirmTaskPatch(){
     var param = {

+ 14 - 5
VisualInspection/view/mytask/task_list.html

@@ -28,12 +28,12 @@
                 </div>
                 
                 <div class="form-group col-sm-2">
-                    <button class="btn btn-info2" style="width:80px;" type="button" onclick="queryTask()">查询</button>
-                    <div id="dispatchPatchBtn" style="float:right;display:none;">
-                        <button class="btn btn-info3" type="button" onclick="dispatchTaskPatch()"><i class="icon icon-plus-sign"></i> 一键下发</button>
+                    <button class="btn btn-info2 col-sm-1" style="width:80px;" type="button" onclick="queryTask()">查询</button>
+                    <div id="dispatchPatchBtn" class="col-sm-1" style="display:none;">
+                        <button class="btn btn-info3" type="button" onclick="dispatchTaskPatch()"><i class="icon icon-signin"></i> 批量下发</button>
                     </div>
-                    <div id="confirmPatchBtn" style="float:right;display:none;">
-                        <button class="btn btn-info3" type="button" onclick="confirmTaskPatch()"><i class="icon icon-plus-sign"></i> 一键确认</button>
+                    <div id="confirmPatchBtn" class="col-sm-1" style="display:none;">
+                        <button class="btn btn-info3" type="button" onclick="confirmTaskPatch()"><i class="icon icon-hand-up"></i> 一键确认</button>
                     </div>
                 </div>
             </div>
@@ -55,6 +55,15 @@
                         </select>
                     </div>
                 </div>
+                <div class="form-group col-sm-2">
+                </div>
+                <div class="form-group col-sm-2">
+                    <div class="form-group col-sm-1">
+                    </div>
+                    <div id="dispatchAllNoScoreBtn" class="col-sm-1" style="display:none;padding:0px;">
+                        <button class="btn btn-info4" type="button" onclick="dispatchAllNoScoreTask()"><i class="icon icon-signin"></i> 下发无扣分任务</button>
+                    </div>
+                </div>
             </div>
         </form>
     </div>

+ 4 - 4
VisualInspection/view/statistics/assess_situation.html

@@ -57,10 +57,10 @@
                 </table>
             </div>
         </div>
-        <div id="scrollTable" style="height:300px;overflow:scroll;margin-right:-10px;">
+        <div id="scrollTable" style="overflow:auto;margin-right:-10px;">
             <div class="table-head" style="margin:0px;">
-                <table border="1" width="100%" height="90px" align="center" class="a" style="border-top:0px;">
-                    <tbody class="table-tbody" style="background:white" align="center" height="500px">
+                <table border="1" width="100%" align="center" class="a" style="border-top:0px;">
+                    <tbody class="table-tbody" style="background:white" align="center">
                     </tbody>
                 </table>
             </div>
@@ -70,7 +70,7 @@
 <script>
     $(document).ready(function() {
         // 设置滚动表格的高度
-        $("#scrollTable").height($(window).height() - 360);
+        $("#scrollTable").height($(window).height() - 300);
         // 仅选择日期
         $("#start-time").datetimepicker({
             language: "zh-CN",

+ 2 - 2
VisualInspection/view/statistics/assess_type.html

@@ -48,7 +48,7 @@
                     </tbody> -->
                 </table></div>
           </div>
-          <div id="scrollTable" style="height:300px;overflow:scroll;margin-right:-10px;">
+          <div id="scrollTable" style="overflow:auto;margin-right:-10px;">
               <div class="table-head" style="margin:0px;">
                   <table border="1" width="100%" height="90px" align="center" style="border-top:0px;">
                     <tbody class="table-tbody" style="background:white" align="center">
@@ -62,7 +62,7 @@
    
     $(document).ready(function() {
         // 设置滚动表格的高度
-        $("#scrollTable").height($(window).height() - 360);
+        $("#scrollTable").height($(window).height() - 300);
         // 仅选择日期
         $("#start-time").datetimepicker(
         {

+ 32 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TaskController.java

@@ -179,6 +179,38 @@ public class TaskController extends BaseController {
     	return super.returnSuccessResult("下发成功");
     }
     
+    @RequestMapping(value = "/dispatchAllNoScoreTask")
+    public String dispatchAllNoScoreTask(HttpServletRequest request, @RequestBody Task task){
+    	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){
+    		task.setCheck_status(Constants.STATUS_CHECK_END);
+    	}
+    	
+    	if(task.getUpdate_check_status()==null || "".equals(task.getUpdate_check_status())){
+    		task.setUpdate_check_status(Constants.STATUS_CHECK_DISPATCH);
+    	}
+    	if(task.getCheck_status()==Constants.STATUS_CHECK_END){
+    		task.setHasScore(2);//无扣分
+    		List<Task> taskList = taskService.getTaskList(task);
+    		List<TaskStatus> taskStatusList = new ArrayList<TaskStatus>();
+    		User u = getCurrentUser(request);
+    		for(Task t:taskList) {
+    			//插入状态到表
+    			TaskStatus status = new TaskStatus();
+    			status.setTask_id(t.getId());
+    			status.setUpdate_time(new Date());
+    			status.setUpdate_user(new Long(u.getId()));
+    			status.setUpdate_username(u.getTruename());
+    			status.setCheck_status(task.getUpdate_check_status());
+    			String name = (CacheUtil.codeMap.get("task_status_"+task.getUpdate_check_status())).getCode_name();
+    			status.setCheck_status_name(name);
+    			taskStatusList.add(status);
+    		}
+    		taskService.dispatch(task);
+    		taskService.insertStatusBatch(taskStatusList);
+    		return super.returnSuccessResult("下发成功");
+    	}
+    	return super.returnSuccessResult("下发失败,请选择需下发任务!");
+    }
     @RequestMapping(value = "/confirm")
     public String confirm(HttpServletRequest request, @RequestBody Task task){
     	if(task.getCheck_status()==null || "".equals(task.getCheck_status())){

+ 6 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/TaskMapper.xml

@@ -259,6 +259,12 @@
 		            #{dispatch_id}
 		        </foreach>
         	</if>
+        	<if test="hasScore == 1">AND 
+        		id in (select task_id from check_score)
+        	</if>
+        	<if test="hasScore == 2">AND 
+        		id not in (select task_id from check_score)
+        	</if>
     </update>
     
     <update id="dispatchById" parameterType="com.xintong.visualinspection.bean.Task" >