Explorar o código

扣分等级统计修改

温红权 %!s(int64=7) %!d(string=hai) anos
pai
achega
bc43867ec0

+ 59 - 56
VisualInspection/js/statistics/assess_situation.js

@@ -116,7 +116,7 @@
         }
 
         function getTotalHtml(data) {
-            var html = "<tr><td>合计</td><td></td><td></td><td>" + data.totalMan + "</td><td>" + data.totalcheckedMan + "</td><td>" + data.totalcheckedCount + "</td><td>" + data.total0 + "</td><td>" + data.total15 + "</td><td>" + data.total50 + "</td><td>" + data.totalOver50 + "</td><td>" + data.totalAll + "</td><td>-</td><td>-</td></tr>";
+            var html = "<tr><td>合计</td><td></td><td>" + data.totalMan + "</td><td>" + data.totalcheckedMan + "</td><td>" + data.totalcheckedCount + "</td><td>" + data.total0 + "</td><td>" + data.total15 + "</td><td>" + data.total50 + "</td><td>" + data.totalOver50 + "</td><td>" + data.totalAll + "</td><td>-</td></tr>";
             return html;
         }
         /**
@@ -134,62 +134,61 @@
             rank.length = 0;
             // 把收费站得分分别添加到3个数组
             for (i = 0; i < data.length; i++) {
-                if (i >= 0 && i <= 6)
-                    lianyungang_Station.push(filterByZeroHandle(filterJudge(data[i].all_check_score, data[i].checked_num), '0'));
-                else if (i > 6 && i <= 12)
-                    yancheng_Station.push(filterByZeroHandle(filterJudge(data[i].all_check_score, data[i].checked_num), '0'));
-                else
-                    nantong_Station.push(filterByZeroHandle(filterJudge(data[i].all_check_score, data[i].checked_num), '0'));
+                // if (i >= 0 && i <= 6)
+                lianyungang_Station.push(filterByZeroHandle(caculatescore(data[i].all_check_score, data[i].all_check_deptw_score), '0'));
+                // else if (i > 6 && i <= 12)
+                //     yancheng_Station.push(filterByZeroHandle(filterJudge(data[i].all_check_score, data[i].checked_num), '0'));
+                // else
+                //     nantong_Station.push(filterByZeroHandle(filterJudge(data[i].all_check_score, data[i].checked_num), '0'));
             }
             // 得分转化为3个排名数组
-            for (var i = 1; i <= 3; i++) {
-                station_rank(i);
-            }
+            // for (var i = 1; i <= 3; i++) {
+            station_rank(1);
+            // }
             // 将3个排名数组合并成一个数组
-            rank = r1.concat(r2).concat(r3);
+            rank = r1;
         }
 
         function gethtml(data, i) {
             var strTbody = "";
-            if (i == 0 || i == 7 || i == 13) {
-                var ranking;
-                var name = "";
-                var rowspan = 0;
-                if (i == 0) {
-                    name = "连云港";
-                    rowspan = 7;
-                    ranking = rank[i];
-                } else if (i == 7) {
-                    name = "盐城";
-                    rowspan = 6;
-                    ranking = rank[i];
-                } else if (i == 13) {
-                    name = "南通";
-                    rowspan = 9;
-                    ranking = rank[i];
-                }
+            // if (i == 0 || i == 7 || i == 13) {
+            //     var ranking;
+            //     var name = "";
+            //     var rowspan = 0;
+            //     // if (i == 0) {
+            //     //     name = "连云港";
+            //     //     rowspan = 7;
+            //     //     ranking = rank[i];
+            //     // } else if (i == 7) {
+            //     //     name = "盐城";
+            //     //     rowspan = 6;
+            //     //     ranking = rank[i];
+            //     // } else if (i == 13) {
+            //     //     name = "南通";
+            //     //     rowspan = 9;
+            //         ranking = rank[i];
+            //     // }
 
-                strTbody += "<tr><td rowspan=" + rowspan + " width='10%'>" + name + "</td>";
-                strTbody += "<td width='7%'>" + ranking + "</td><td width='8%'>" + data.name + "</td><td width='8%'>" + filter(data.people_num, 0) +
-                    "</td><td width='6%'>" + filter(data.checked_people_num, 0) + "</td><td width='6%'>" + filter(data.checked_num, 0) +
-                    "</td><td width='7%'>" + (data.checked_people_num - (data.score_fifteen + data.score_fifty + data.score_over_fifty)) +
-                    "</td><td width='7%'>" + data.score_fifteen + "</td><td width='7%'>" + data.score_fifty + "</td><td width='7%'>" +
-                    data.score_over_fifty + "</td><td width='7%'>" + data.all_check_score + "</td><td width='7%'>" +
-                    filterByZeroHandle(filterJudge(data.all_check_score, data.checked_num), '0') + "</td><td width='7%'>" +
-                    filterByZeroHandle((1000 - filterJudge(data.all_check_score, data.checked_num)), '1000') + "</td>";
-                strTbody += "</tr>";
-            } else {
-                strTbody += "<tr>"
-                strTbody += "<td width='7%'>" + rank[i] + "</td><td width='8%'>" + data.name + "</td><td width='8%'>" + filter(data.people_num, '0') +
-                    "</td><td width='6%'>" + filter(data.checked_people_num, 0) + "</td><td width='6%'>" + filter(data.checked_num, '0') +
-                    "</td><td width='6%'>" + (data.checked_people_num - (data.score_fifteen + data.score_fifty + data.score_over_fifty)) +
-                    "</td><td width='7%'>" + data.score_fifteen + "</td><td width='7%'>" + data.score_fifty + "</td><td width='7%'>" +
-                    data.score_over_fifty + "</td><td width='7%'>" + data.all_check_score + "</td><td width='7%'>" +
-                    filterByZeroHandle(filterJudge(data.all_check_score, data.checked_num), '0') + "</td><td width='7%'>" +
-                    filterByZeroHandle((1000 - filterJudge(data.all_check_score, data.checked_num)), '1000') + "</td>";
-                strTbody += "</tr>";
+            //     // strTbody += "<tr><td rowspan=" + rowspan + " width='10%'>" + name + "</td>";
+            //     strTbody += "<td width='7%'>" + ranking + "</td><td width='8%'>" + data.name + "</td><td width='8%'>" + filter(data.people_num, 0) +
+            //         "</td><td width='6%'>" + filter(data.checked_people_num, 0) + "</td><td width='6%'>" + filter(data.checked_num, 0) +
+            //         "</td><td width='7%'>" + (data.checked_people_num - (data.score_fifteen + data.score_fifty + data.score_over_fifty)) +
+            //         "</td><td width='7%'>" + data.score_fifteen + "</td><td width='7%'>" + data.score_fifty + "</td><td width='7%'>" +
+            //         data.score_over_fifty + "</td><td width='7%'>" + data.all_check_score + "</td><td width='7%'>" +
+            //         filterByZeroHandle(filterJudge(data.all_check_score, data.checked_num), '0') + "</td><td width='7%'>" +
+            //         filterByZeroHandle((1000 - filterJudge(data.all_check_score, data.checked_num)), '1000') + "</td>";
+            //     strTbody += "</tr>";
+            // } else {
+            strTbody += "<tr>"
+            strTbody += "<td width='7%'>" + rank[i] + "</td><td width='8%'>" + data.name + "</td><td width='8%'>" + filter(data.people_num, '0') +
+                "</td><td width='6%'>" + filter(data.checked_people_num, 0) + "</td><td width='6%'>" + filter(data.checked_num, '0') +
+                "</td><td width='6%'>" + (data.checked_people_num - (data.score_fifteen + data.score_fifty + data.score_over_fifty)) +
+                "</td><td width='7%'>" + data.score_fifteen + "</td><td width='7%'>" + data.score_fifty + "</td><td width='7%'>" +
+                data.score_over_fifty + "</td><td width='7%'>" + caculatescore(data.all_check_score, data.all_check_deptw_score) + "</td><td width='7%'>" +
+                filterByZeroHandle((100 - caculatescore(data.all_check_score, data.all_check_deptw_score)), '100') + "</td>";
+            strTbody += "</tr>";
 
-            }
+            // }
             return strTbody;
         }
 
@@ -212,13 +211,13 @@
          * @param {*} type
          */
         function station_rank(type) {
-            if (type == 1) {
-                station_rank_method(lianyungang_Station, r1);
-            } else if (type == 2) {
-                station_rank_method(yancheng_Station, r2);
-            } else if (type == 3) {
-                station_rank_method(nantong_Station, r3);
-            }
+            // if (type == 1) {
+            station_rank_method(lianyungang_Station, r1);
+            // } else if (type == 2) {
+            //     station_rank_method(yancheng_Station, r2);
+            // } else if (type == 3) {
+            //     station_rank_method(nantong_Station, r3);
+            // }
         }
 
         function filter(value, default_display_value) {
@@ -247,6 +246,10 @@
             }
         }
 
+        function caculatescore(totalsc, wsc) {
+            return totalsc - wsc + (wsc >= 20 ? 2 : wsc < 10 ? 0 : 1)
+        }
+
         function filterJudge(num1, num2) {
             if (num2 == 0) {
                 return 0;
@@ -271,4 +274,4 @@
                 start_date = start.Format("yyyy-MM-dd HH:mm:ss");
             }
             window.open(getserveraddr() + "/file/score/info?start_date=" + start_date + "&end_date=" + end_date);
-        }
+        }

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

@@ -4,7 +4,7 @@
     <div class="form-div">
         <form class="form-horizontal">
             <div class="form-group">
-                <div  class="form-group col-sm-5">
+                <div class="form-group col-sm-5">
                     <label class="col-sm-2">查询日期</label>
                     <div class="col-sm-5">
                         <input type="text" id="start-time" class="form-control form-date" placeholder="开始日期">
@@ -13,7 +13,7 @@
                         <input type="text" id="end-time" class="form-control form-date" placeholder="结束日期">
                     </div>
                 </div>
-                <div  class="form-group col-sm-3">
+                <div class="form-group col-sm-3">
                     <div class="col-sm-6">
                         <button class="btn btn-info2 " type="button" onclick="querySituationClick()">查询</button>
                     </div>
@@ -24,7 +24,7 @@
             </div>
         </form>
     </div>
-    <div class="table-title"><span>温馨服务检查分考核扣分情况汇总表</span></div>
+    <div class="table-title"><span>温馨服务检查分考核扣分情况汇总表</span></div>
 
     <div class="row">
         <!-- 使用一个div来显示数据表格 -->
@@ -33,14 +33,14 @@
                 <table border="1" width="100%" height="90px" align="center" class="a">
                     <thead>
                         <tr>
-                            <th rowspan="2" width="10%" id="tb_th_1">道管</th>
-                            <th rowspan="2" width="7%" id="tb_th_2">道管内排名</th>
+
+                            <th rowspan="2" width="7%" id="tb_th_2">排名</th>
                             <th rowspan="2" width="8%" id="tb_th_3">站名</th>
                             <th rowspan="2" width="8%" id="tb_th_4">收费值机人数</th>
                             <th rowspan="2" width="6%" id="tb_th_5">受检人数</th>
                             <th rowspan="2" width="6%" id="tb_th_6">受检次数</th>
-                            <th colspan="6" height="5%" id="tb_th_7">扣分情况</th>
-                            <th rowspan="2" width="7%" id="tb_th_8">平均得分(千分)</th>
+                            <th colspan="5" height="5%" id="tb_th_7">扣分情况</th>
+                            <th rowspan="2" width="7%" id="tb_th_8">得分(百分)</th>
                         </tr>
                         <tr>
                             <th width="7%" id="tb_th_7_1">满分(人)</th>
@@ -48,7 +48,7 @@
                             <th width="7%" id="tb_th_7_3">≤50分(人)</th>
                             <th width="7%" id="tb_th_7_4">50分(人)</th>
                             <th width="7%" id="tb_th_7_5">总扣分(分)</th>
-                            <th width="7%" id="tb_th_7_6">平均每人次扣分(分)</th>
+
                         </tr>
                     </thead>
                     <!-- <tbody class="table-tbody" style="background:white" align="center" height="500px">
@@ -98,4 +98,4 @@
 
         initQuerySituation();
     });
-</script>
+</script>

+ 3 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/StatisticsBean.java

@@ -49,6 +49,8 @@ public class StatisticsBean {
     private String parent_name ;
     
     private int score;
+
+    private int deptwscore;
     
     private Integer item_id ;
 
@@ -65,6 +67,7 @@ public class StatisticsBean {
     private int score_over_fifty ;
     
     private int all_check_score ;
+    private int all_check_deptw_score ;
     
     // 满分
     private int check_no_score ;

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

@@ -97,7 +97,7 @@ public class StatisticsController extends BaseController {
     		total15+=bean.getScore_fifteen();
     		total50+=bean.getScore_fifty();
     		totalOver50+=bean.getScore_over_fifty();
-    		totalAll+=bean.getAll_check_score();
+    		totalAll+=bean.getAll_check_score()-bean.getAll_check_deptw_score()+(bean.getAll_check_deptw_score() >= 20 ? 2 : bean.getAll_check_deptw_score() < 10 ? 0 : 1);
     	}
     	Map<String,Object> resultMap = new HashMap<String,Object>();
     	resultMap.put("list", lists);

+ 7 - 2
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -309,9 +309,14 @@
     </select>
     <select id="selectFeeStationCheckedScore" parameterType="com.xintong.visualinspection.bean.StatisticsBean"
             resultType="com.xintong.visualinspection.bean.StatisticsBean">
-        SELECT IFNULL(sum(ct.check_item_score),0) AS score ,t.checked_dept AS dept_id ,t.checked_person AS user_id
+        SELECT IFNULL(sum(ct.check_item_score),0) AS score,sum(IF(ct.p=1052,ct.check_item_score,0)) as deptwscore ,t.checked_dept AS dept_id ,t.checked_person AS user_id
         FROM check_task t
-        LEFT JOIN check_score ct ON t.id = ct.task_id
+        LEFT JOIN (select cck1.* ,IF ((
+        SELECT parent_id FROM check_item WHERE id=cck1.cid) IS NULL,cck1.cid,(
+        SELECT parent_id FROM check_item WHERE id=cck1.cid)) as p from (
+        SELECT ck1.*, IF ((
+        SELECT parent_id FROM check_item WHERE id=ck1.check_item_id) IS NULL,ck1.check_item_id,(
+        SELECT parent_id FROM check_item WHERE id=ck1.check_item_id)) as cid FROM check_score ck1) cck1) ct ON t.id = ct.task_id
         WHERE 1=1 and t.check_status!=22 and t.id not in
         <include refid="taskexclouddeleteUser"/>
         <if test="start_date!=null and end_date != null">

+ 24 - 21
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -335,13 +335,13 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 		Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
 		int i = 0;
 		for (StatisticsBean sta : lists) {
-			if (i < 7) {
+//			if (i < 7) {
 				sta.setId(1);
-			} else if (i < 13) {
-				sta.setId(2);
-			} else {
-				sta.setId(3);
-			}
+//			} else if (i < 13) {
+//				sta.setId(2);
+//			} else {
+//				sta.setId(3);
+//			}
 			i++;
 			mapStationInfos.put(sta.getDept_id(), sta);
 		}
@@ -368,6 +368,7 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
 				StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
 				statis.setAll_check_score(statis.getAll_check_score() + sta.getScore());
+				statis.setAll_check_deptw_score(statis.getAll_check_deptw_score()+sta.getDeptwscore());
 
 				StatisticsBo b = listmap.get(sta.getUser_id().intValue());
 
@@ -394,26 +395,28 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 			public int compare(StatisticsBean o1, StatisticsBean o2) {
 				if (o1.getId() > o2.getId()) {
 					return 1;
-				} else if (o1.getId() == o2.getId()) {
-					if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
-						if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) > o2.getAll_check_score()
-								/ (o2.getChecked_num() + 0.0)) {
+				} else if (o1.getId().equals( o2.getId())) {
+//					if (o1.getChecked_num() != 0 && o2.getChecked_num() != 0) {
+                        int  wsc = o1.getAll_check_deptw_score();
+                        int  wsc2 = o2.getAll_check_deptw_score();
+						if ((o1.getAll_check_score() - wsc +(wsc >= 20 ? 2 : wsc < 10 ? 0 : 1 ) + 0.0) > (o2.getAll_check_score()
+								-wsc2 + (wsc2 >= 20 ? 2 : wsc2 < 10 ? 0 : 1) + 0.0)) {
 							return 1;
-						} else if (o1.getAll_check_score() / (o1.getChecked_num() + 0.0) < o2.getAll_check_score()
-								/ (o2.getChecked_num() + 0.0)) {
+						} else if ((o1.getAll_check_score() - wsc +(wsc >= 20 ? 2 : wsc < 10 ? 0 : 1 ) + 0.0) < (o2.getAll_check_score()
+                                -wsc2 + (wsc2 >= 20 ? 2 : wsc2 < 10 ? 0 : 1) + 0.0)) {
 							return -1;
 						} else {
 							return 0;
 						}
-					} else {
-						if (o1.getChecked_num() == 0) {
-							return -1;
-						} else if (o2.getChecked_num() == 0) {
-							return 1;
-						} else {
-							return 0;
-						}
-					}
+//					} else {
+//						if (o1.getChecked_num() == 0) {
+//							return -1;
+//						} else if (o2.getChecked_num() == 0) {
+//							return 1;
+//						} else {
+//							return 0;
+//						}
+//					}
 				} else {
 					return -1;
 				}