Răsfoiți Sursa

1. 特情稽查人员转站问题
2. 排除人员统计后数据统计值同步

温红权 8 ani în urmă
părinte
comite
7b0b6ef8fb

+ 14 - 0
VisualInspection/js/other_check/other_check.js

@@ -6,6 +6,7 @@ var check_type;
 var check_item_tree = null;
 var edittype = "add";
 var al_data = [];
+var isconfirmC = false;
 // 页面初始化
 function init() {
     $(document).delegate("#editImage img", "mouseenter", function() {
@@ -210,6 +211,12 @@ $("#add_btn").click(function() {
     layerUpdateTeam('form-div', '稽查记录新增', '550px');
     $("#save-check").html("保存");
 
+    if (check_type == 2) {
+        //特情稽查处理
+        $("#confirmC").prop('checked', false);
+        isconfirmC = false;
+    }
+
 
     //debugger;
     var nodedata;
@@ -227,6 +234,10 @@ $("#add_btn").click(function() {
     })
 })
 
+function confirmCfun() {
+    isconfirmC = $("#confirmC").prop("checked");
+}
+
 function queryTable() {
     $(".datatable").empty();
     var data = {
@@ -526,6 +537,9 @@ function setPersonal(selectUserId) {
 }
 // 部门改变后 重新生成人员下拉框
 $("#select-dept").change(function() {
+    if (check_type == 2) {
+        if (isconfirmC) return;
+    }
     setPersonal();
 });
 

+ 58 - 30
VisualInspection/js/statistics/assess_ranking.js

@@ -264,11 +264,11 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
                 var showNumberHtml = (isshownumber ? (filter(data[i].checked_num, '0') + (data[i].checked_num < 6 ? html : "")) : "-");
                 if (hasRole(ROLE_ADMIN) || hasRole(ROLE_JICHA_ADMIN)) {
                     showNumberHtml = (ischage ? ("<span style='color:red;' data-toggle='tooltip' data-placement='right' title=" + tiptext + ">" + userChangeStation.old_dept_check_num + "+" + userChangeStation.new_dept_check_num + "</span>") : filter(data[i].checked_num, '0')) + html;
-                    exuserHtml = '<div class="switch"><input type="checkbox" onchange="exUserfun(this,'+data[i].user.id+','+data[i].period_id+')" '+ (data[i].isEx?'checked="checked"':'') +' > <label>排除</label></div>';
+                    exuserHtml = '<div class="switch"><input type="checkbox" onchange="exUserfun(this,' + data[i].user.id + ',' + data[i].period_id + ')" ' + (data[i].isEx ? 'checked="checked"' : '') + ' > <label>排除</label></div>';
                     $("#th_14").html("是否排除统计");
                 }
 
-               
+
 
 
                 strTbody += "<tr><td width='4%;'>" + (count + 1) + "</td><td width='6%;'>" + data[i].user.fee_station_name + "</td>" +
@@ -281,7 +281,7 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
                     "<td width='4%;'>" + getItemScore(data[i], '工作纪律') + "</td><td width='4%'>" + getItemScore(data[i], '便民服务') + "</td><td width='4%;'>" +
                     getItemScore(data[i], '安全管理') + "</td><td width='4%;'>" + data[i].check_all_score + "</td>" +
                     "<td width='6%;'>" + showNumberHtml + "</td><td width='4%;'>" + filterSlash(filterByZeroHandle(data[i].check_score_avg, '0'), filter(data[i].checked_num + data[i].checked_m_num, '0')) + "</td>" +
-                    "<td width='4%;'>" + filterSlash(score, filter(data[i].checked_num + data[i].checked_m_num, '0')) + "</td><td width='4%;'>" + "</td><td width='4%;'>" +(exuserHtml)+ "</td></tr>";
+                    "<td width='4%;'>" + filterSlash(score, filter(data[i].checked_num + data[i].checked_m_num, '0')) + "</td><td width='4%;'>" + "</td><td width='4%;'>" + (exuserHtml) + "</td></tr>";
                 count++;
             }
         }
@@ -292,35 +292,63 @@ function getEmployeeInfosClick(url, param, start_score, end_score, start_num, en
         return "";
     });
 }
-function exUserfun(o,u,p){
-   var check = $(o).prop("checked");
-   if(check){
-       //add
-
-       var url = "statistics/userex/add"
-       var param = {
-           "user_id": u,
-           "period_id": p
-       }
-       post_common_service(url, param, function(data) {
+
+function exUserfun(o, u, p) {
+    var check = $(o).prop("checked");
+
+    var start_date = $("#start-time").val();
+    var end_date = $("#end-time").val();
+
+    if (start_date == '' || end_date == '') {
+        tip("请选择起止日期");
+        return;
+    } else {
+        start_date += " 23:00:00";
+        end_date += " 23:00:00";
+    }
+    var startStr = start_date.replace(/-/g, '/');
+    var endStr = end_date.replace(/-/g, '/');
+    var start = new Date(startStr);
+    //开始日期取前一天的23:00
+    start.setDate(start.getDate() - 1);
+    start_date = start.Format("yyyy-MM-dd HH:mm:ss");
+    var end = new Date(endStr);
+    if (start > end) {
+        tip("开始时间不能比结束时间大");
+        return;
+    }
+
+    if (check) {
+        //add
+
+        var url = "statistics/userex/add";
+        var param = {
+            "user_id": u,
+            "period_id": p,
+            "start_date": start_date,
+            "end_date": end_date
+        }
+        post_common_service(url, param, function(data) {
             $(o).prop("checked", true)
-       },function(e){
+        }, function(e) {
             $(o).prop("checked", false)
-       });
-   }else{
-       //delete
-       var url = "statistics/userex/delete"
-       var param = {
-        "user_id": u,
-        "period_id": p
-       }
-       post_common_service(url, param, function(data) {
-        $(o).prop("checked", false)
-       },function(e){
-        $(o).prop("checked", true)
-   });
-
-   }
+        });
+    } else {
+        //delete
+        var url = "statistics/userex/delete"
+        var param = {
+            "user_id": u,
+            "period_id": p,
+            "start_date": start_date,
+            "end_date": end_date
+        }
+        post_common_service(url, param, function(data) {
+            $(o).prop("checked", false)
+        }, function(e) {
+            $(o).prop("checked", true)
+        });
+
+    }
 }
 
 

+ 5 - 0
VisualInspection/view/other_check/special_check.html

@@ -66,6 +66,11 @@
                         <div class="div-select"><select class="form-control" id="select-personal"></select></button>
                         </div>
                     </div>
+                    <div class="checkbox" style="position:fixed;right:20px">
+                        <label>
+                        <input type="checkbox" onchange="confirmCfun()" id="confirmC"> 确认人员
+                      </label>
+                    </div>
                 </div>
                 <div style="width:100%;margin-top:10px;">
                     <div style="width:80px;float:left;">

+ 1 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/CheckDeptStatisticsMapper.xml

@@ -57,6 +57,7 @@
         SET
         <if test="score != null">score = #{score},</if>
         <if test="integral != null">integral = #{integral},</if>
+        id = id
         WHERE
         dept_id = #{dept_id} and period_id = #{period_id}
     </sql>

+ 12 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -232,6 +232,7 @@
         SELECT COUNT(DISTINCT ct.checked_person) as num FROM check_task ct
         WHERE ct.check_status != 22 and ct.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  ct.id not in <include refid="selectExuserTask"/>
         <if test="dept_id!=null">
             AND ct.checked_dept = #{dept_id}
         </if>
@@ -318,6 +319,7 @@
         LEFT JOIN check_score ct ON t.id = ct.task_id
         WHERE 1=1 and t.check_status!=22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  t.id not in <include refid="selectExuserTask"/>
         <if test="start_date!=null and end_date != null">
             AND t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date}
         </if>
@@ -369,6 +371,7 @@
         ( select * From check_task t
         where t.check_status != 22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  t.id not in <include refid="selectExuserTask"/>
         <if test="start_date !=null">
             AND t.start_time >= #{start_date}
         </if>
@@ -396,6 +399,7 @@
         t.checked_person IS NOT NULL
         AND t.check_status != 22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  t.id not in <include refid="selectExuserTask"/>
         <if test="start_date !=null">
             AND t.start_time >= #{start_date}
         </if>
@@ -432,6 +436,7 @@
         t.checked_person IS NOT NULL
         AND t.check_status != 22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  t.id not in <include refid="selectExuserTask"/>
         <if test="start_date !=null">
             AND t.start_time >= #{start_date}
         </if>
@@ -578,6 +583,7 @@
         ) m ON t.id = m.task_id
         where t.check_status !=22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
+        AND  t.id not in <include refid="selectExuserTask"/>
         AND monthfunc( t.start_time ) = #{mth}
         GROUP BY m.parent_id,m.checked_dept order by m.checked_dept
     </select>
@@ -1118,4 +1124,10 @@
     </insert>
 
 
+
+    <sql id="selectExuserTask">
+        (select a.id from check_task a,check_statistic_exclude_users b where a.checked_person = b.user_id  and a.period_id = b.period_id)
+    </sql>
+
+
 </mapper>

+ 13 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/pojo/StatisticExUser.java

@@ -1,6 +1,10 @@
 package com.xintong.visualinspection.pojo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
 
 @Data
 public class StatisticExUser {
@@ -11,4 +15,13 @@ public class StatisticExUser {
     //周期编号
     private  Integer period_id;
 
+    //开始日期
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date start_date ;
+
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date end_date ;
+
 }

+ 19 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -16,6 +16,7 @@ import java.util.Map.Entry;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.sun.org.glassfish.external.statistics.Statistic;
 import com.xintong.visualinspection.bean.*;
 import com.xintong.visualinspection.dao.master.*;
 import com.xintong.visualinspection.pojo.StatisiticPojo;
@@ -2109,6 +2110,13 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		return sortList;
 	}
 
+
+    private void updateDeptStatistic(StatisticsBean obj){
+        this.getOperationInfo(obj);
+    }
+
+
+
 	@Override
 	public void getOperationInfo(StatisticsBean obj, HttpServletRequest req, HttpServletResponse resp) {
 		List<StatisticsBean> lists= getOperationInfo(obj);
@@ -2570,6 +2578,11 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 	public Object addcheckSExUser(StatisticExUser statisticExUser) {
 		try {
 			statisticsDao.addcheckSExUser(statisticExUser);
+
+            StatisticsBean obj = new StatisticsBean();
+            obj.setStart_date(statisticExUser.getStart_date());
+            obj.setEnd_date(statisticExUser.getEnd_date());
+			updateDeptStatistic(obj);
 		}catch (Exception e){
             return null;
 		}
@@ -2581,12 +2594,18 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 	public Object deletecheckSExUser(StatisticExUser statisticExUser) {
 		try {
 			statisticsDao.deletecheckSExUser(statisticExUser);
+            StatisticsBean obj = new StatisticsBean();
+            obj.setStart_date(statisticExUser.getStart_date());
+            obj.setEnd_date(statisticExUser.getEnd_date());
+            updateDeptStatistic(obj);
 		}catch (Exception e){
 			return null;
 		}
 		return "";
 	}
 
+
+
 	@Override
 	public Map<String, List<DeptStatistic>> getDeptStatistic(DeptStatistic obj) {
 		List<CheckTaskPeriod> checkTaskPeriods = checkTaskPeriodDao.select(new CheckTaskPeriod());