Просмотр исходного кода

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

minitiger 8 лет назад
Родитель
Сommit
90c93980eb

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

@@ -141,7 +141,7 @@ function fullscreen() {
         '                                </div>' +
         '                                <div class="row" class="col-md-12" style="padding:5px 10px 25px 10px;text-align:center;margin:0px">' +
         '                                    <input id="full_ex1" class="col-md-12" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0"/>' +
-        '                                    <span id="full_ex1_span" style="position: absolute;left: 25px;">2017-06-12 23:00:00</span>' +
+        '                                   <br/> <span id="full_ex1_span" style="position: absolute;left: 25px;">2017-06-12 23:00:00</span>' +
         '                                    ' +
         '                                </div>' +
         '                                <div class="row" style="padding:0px 5px 0px 5px;text-align:center;margin:0px">' +
@@ -880,7 +880,7 @@ function submitCheck4Appeal() {
         offset: 'r',
         btn: ['成功', '失败'], //按钮
         // shadeClose: true,
-        shade: 0//不显示遮罩
+        shade: 0 //不显示遮罩
     }, function() {
         appeal_result = 1;
         submitCheck4AppealResult(appeal_result);

+ 57 - 0
VisualInspection/js/statistics/total_company_statistics.js

@@ -972,7 +972,11 @@ $(function() {
      */
     function each_people_points_six() {
 
+        var t_map_p = new HashMap();
+        var t_map_c = new HashMap();
+
         var sdata = new Array();
+
         for (var j = 0; j < array_all_deptname.length; j++) {
             var dept = array_all_deptname[j]
 
@@ -982,11 +986,18 @@ $(function() {
                 for (var i = 0; i < array_all_name.length; i++) {
                     var name = array_all_name[i];
                     data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
+
+                    if (t_map_p.get(i) == null) {
+                        t_map_p.set(i, d_t.get(name) == null ? 0 : d_t.get(name))
+                    } else {
+                        t_map_p.set(i, t_map_p.get(i) + (d_t.get(name) == null ? 0 : d_t.get(name)));
+                    }
                 }
                 var d_tt = {
                     name: dept,
                     type: 'bar',
                     stack: '上月',
+                    barWidth: 10,
                     data: data_a
                 }
                 sdata.push(d_tt);
@@ -995,22 +1006,38 @@ $(function() {
                 for (var i = 0; i < array_all_name.length; i++) {
                     var name = array_all_name[i];
                     data_a.push(0);
+
+                    if (t_map_p.get(i) == null) {
+                        t_map_p.set(i, 0)
+                    } else {
+                        t_map_p.set(i, t_map_p.get(i) + 0);
+                    }
                 }
                 var d_tt = {
                     name: dept,
                     type: 'bar',
                     stack: '上月',
+                    barWidth: 10,
                     data: data_a
                 }
                 sdata.push(d_tt);
             }
 
+
+
+
             if (map_month_data.get(dept) != null) {
                 var data_a = new Array();
                 var d_t = map_month_data.get(dept);
                 for (var i = 0; i < array_all_name.length; i++) {
                     var name = array_all_name[i];
                     data_a.push(d_t.get(name) == null ? 0 : d_t.get(name));
+
+                    if (t_map_c.get(i) == null) {
+                        t_map_c.set(i, d_t.get(name) == null ? 0 : d_t.get(name))
+                    } else {
+                        t_map_c.set(i, t_map_c.get(i) + (d_t.get(name) == null ? 0 : d_t.get(name)));
+                    }
                 }
                 var d_tt = {
                     name: dept,
@@ -1024,6 +1051,11 @@ $(function() {
                 for (var i = 0; i < array_all_name.length; i++) {
                     var name = array_all_name[i];
                     data_a.push(0);
+                    if (t_map_c.get(i) == null) {
+                        t_map_c.set(i, 0)
+                    } else {
+                        t_map_c.set(i, t_map_c.get(i) + 0);
+                    }
                 }
                 var d_tt = {
                     name: dept,
@@ -1035,8 +1067,33 @@ $(function() {
             }
         }
 
+        var d_s = new Array();
+        t_map_c.forEach(function(value, key) {
+            var d = {
+                name: "本月",
+                value: value,
+                xAxis: key,
+                yAxis: value
+            }
+            d_s.push(d);
+        });
+        t_map_p.forEach(function(value, key) {
+            console.log(key)
+            var d = {
+                name: "上月",
+                value: value,
+                xAxis: key == 0 ? -0.01 : (key - 0.3),
+                yAxis: value
+            }
+            d_s.push(d);
+        });
+
 
 
+        sdata[sdata.length - 1]['markPoint'] = {
+            data: d_s
+        }
+
 
         var namelist = new Array();
         for (var i = 0; i < array_all_name.length; i++) {

+ 12 - 4
VisualInspection/js/teamClass/charge_team_schedule.js

@@ -96,8 +96,8 @@
 
                   //灌南东
                   if (user_dept_id == 35) {
-                      $(".thread_charge").append("<th>收费班长(西)</th>");
-                      $(".thread_charge").append("<th>收费班长()</th>");
+                      $(".thread_charge").append("<th>收费班长()</th>");
+                      $(".thread_charge").append("<th>收费班长()</th>");
 
                   } else {
                       $(".thread_charge").append("<th>收费班长</th>");
@@ -281,7 +281,11 @@
               station_m_id = parseInt(station_m_id)
 
               if (cache) {
-                  for (var i = 2; i < lans + 1 + 2; i++) {
+                  var n_c = 2;
+                  if (user_dept_id == 35) {
+                      n_c = 3;
+                  }
+                  for (var i = 2; i < lans + 1 + n_c; i++) {
                       if ($(".tr-" + j + " td select").eq(i).val() != '' && $(".tr-" + j + " td select").eq(i).val() != null) {
                           var start_time = $("#save_user_class").data("work_date") + classCode[j].start_time + ":00";
                           if (j == 3) {
@@ -566,7 +570,11 @@
                       $(".tr-1").append("<td>" + classCode["1"].class_name + " " + classCode["1"].start_time + " - " + classCode["1"].end_time + "</td>");
                       $(".tr-2").append("<td>" + classCode[2].class_name + " " + classCode[2].start_time + " - " + classCode[2].end_time + "</td>");
                       $(".tr-3").append("<td>" + classCode[3].class_name + " " + classCode[3].start_time + " - " + classCode[3].end_time + "</td>");
-                      for (var i = 0; i < lans + 1 + 2; i++) {
+                      var n_c = 2;
+                      if (user_dept_id == 35) {
+                          n_c = 3;
+                      }
+                      for (var i = 0; i < lans + 1 + n_c; i++) {
                           $(".tr-1,.tr-2,.tr-3").append("<td></td>");
                       }
                   } else {

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

@@ -63,7 +63,7 @@
                                     </div>
                                     <div class="row" class="col-md-12" style="padding:5px 10px 25px 10px;text-align:center;margin:0px">
                                         <input id="ex1" class="col-md-12" type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="0" />
-
+                                        <br/>
                                         <span id="ex1_span" style="position: absolute;left: 25px;">2017-06-12 23:00:00</span>
                                     </div>
                                     <div class="row" style="padding:0px 5px 0px 5px;text-align:center;margin:0px">

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

@@ -135,8 +135,8 @@ public class StatisticsBean {
     // 比较大小 1 小 , -1 大
     public int compareTo(StatisticsBean o2){
     	if(this.getChecked_num()!=0 && o2.getChecked_num()!=0){
-			double a = this.getAll_check_score() / (this.getChecked_num()+0.00) / this.getPeople_num();
-			double b = o2.getAll_check_score() /(o2.getChecked_num()+0.00) / o2.getPeople_num();
+			double a = this.getAll_check_score() / (this.getChecked_num()+0.00) /*/ this.getPeople_num()*/;
+			double b = o2.getAll_check_score() /(o2.getChecked_num()+0.00) /*/ o2.getPeople_num()*/;
 			if (a > b ) {
 				return 1;
 			} else if (a < b) {

+ 5 - 6
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/master/StatisticsMapper.xml

@@ -119,13 +119,12 @@
     </select>
     
     <select id="selectFeeStationCheckedScore" parameterType="com.xintong.visualinspection.bean.StatisticsBean" resultType="com.xintong.visualinspection.bean.StatisticsBean">
-    	SELECT sum(t.check_item_score) AS score ,t.checked_dept AS dept_id ,t.checked_person AS user_id
-    		FROM check_score t 
-    		LEFT JOIN check_item c ON t.check_item_id = c.id
-    		LEFT JOIN check_task ct ON ct.id = t.task_id
-    		WHERE 1=1 and ct.check_status!=22 and  ct.id not in <include refid="taskexclouddeleteUser"/>
+    	SELECT IFNULL(sum(ct.check_item_score),0) AS score ,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
+    		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">
-		        AND	 ct.start_time &gt;= #{start_date} AND ct.end_time &lt; #{end_date}
+		        AND	 t.start_time &gt;= #{start_date} AND t.end_time &lt; #{end_date}
 			</if>
     		GROUP BY t.checked_dept,t.checked_person
     </select>

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

@@ -45,6 +45,7 @@
     <select id="getAll" resultMap="BaseResultMap"  >
         SELECT *
         FROM check_task
+        order by start_time desc
     </select>
 
     <select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
@@ -57,7 +58,7 @@
         SELECT *
         FROM check_task_status
         WHERE task_id = #{id}
-        order by update_time 
+        order by update_time
     </select>
 
     <select id="getTaskListByDept" parameterType="com.xintong.visualinspection.pojo.TaskListByDeptAppeal" resultMap="BaseResultMap" >
@@ -67,6 +68,7 @@
         <if test="end_time != null">AND appeal_time &lt;=  #{end_time}</if>
         <if test="status != null">AND appeal_result = #{status}</if>
         )
+        order by start_time desc
     </select>
 
 
@@ -103,6 +105,7 @@
 		            #{dispatch_id}
 		        </foreach>
         	</if>
+         order by t.start_time desc
     </select>
     
     <select id="getListInStatus" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
@@ -141,6 +144,7 @@
 		            #{dispatch_id}
 		        </foreach>
         	</if>
+        order by t.start_time desc
     </select>
     <select id="getListByChecked" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >
         SELECT t.*,
@@ -159,6 +163,7 @@
         	<if test="period_id != null">AND t.period_id = #{period_id}</if>
         	<if test="checked_person != null">AND t.checked_person = #{checked_person}</if>
         	<if test="appeal_result != null">AND ca.appeal_result = #{appeal_result}</if>
+        order by t.start_time desc
     </select>
 
 	<select id="getListBySubmited" parameterType="com.xintong.visualinspection.bean.Task" resultMap="BaseResultMap" >

+ 77 - 23
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/StatisticsServiceImpl.java

@@ -330,28 +330,36 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 
         List<StatisticsBo> list = getEmployeeCheckedInfo(obj);
         Map<Integer,StatisticsBo> listmap = new HashMap<>();
-		for(StatisticsBo b:list){
-            listmap.put(b.getUser().getId(),b);
+		for(StatisticsBo b:list) {
+            listmap.put(b.getUser().getId(), b);
         }
 
 
+
 		List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedScore(obj);
 		for (StatisticsBean sta : listCheckedScore) {
 			if (mapStationInfos.containsKey(sta.getDept_id())) {
 
-                StatisticsBo bo= listmap.get(sta.getUser_id().intValue());
-
 				StatisticsBean statis = mapStationInfos.get(sta.getDept_id());
 				statis.setAll_check_score(statis.getAll_check_score() + sta.getScore());
-				double sc = Double.parseDouble(bo.getCheck_score_avg());
-				if (sc <= 15) {
-					statis.setScore_fifteen(statis.getScore_fifteen() + 1);
-				} else if (sc <= 50) {
-					statis.setScore_fifty(statis.getScore_fifty() + 1);
-				} else {
-					statis.setScore_over_fifty(statis.getScore_over_fifty() + 1);
-				}
-			}
+
+                StatisticsBo b = listmap.get(sta.getUser_id().intValue());
+
+                if(b == null || b.getCheck_score_avg() == null ||  statis == null) continue;
+                double sc = Double.parseDouble(b.getCheck_score_avg());
+                if(sc==0){
+                    statis.setScore(statis.getScore()+1);
+                }else
+                if (sc <= 15) {
+                    statis.setScore_fifteen(statis.getScore_fifteen() + 1);
+                } else if (sc <= 50) {
+                    statis.setScore_fifty(statis.getScore_fifty() + 1);
+                } else {
+                    statis.setScore_over_fifty(statis.getScore_over_fifty() + 1);
+                }
+
+
+            }
 		}
 
 
@@ -972,18 +980,64 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
 //			}
 			people_num = statisticsDao.selectCheckedNum(obj);
 		}
+		if(obj.getStart_date()==null && obj.getMth()!=null){
+            Calendar cal = Calendar.getInstance();
+            Date d = DateUtil.strParseDate(obj.getMth(), "yyyy/MM");
+            cal.setTime(d);
+            cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), 25, 23, 0, 0);
+            obj.setEnd_date(cal.getTime());
+            cal.add(Calendar.MONTH, -1);
+            obj.setStart_date(cal.getTime());
+        }
 
-		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
+//		List<StatisticsBean> userLostScoreInfoList = statisticsDao.selectCheckedScoreList(obj);
 
-		for (StatisticsBean sta : userLostScoreInfoList) {
-			if (sta.getAll_check_score()  <= 15) {
-				returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
-			} else if (sta.getAll_check_score() <= 50) {
-				returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
-			} else {
-				returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
-			}
-		}
+        Long deptid=obj.getDept_id();
+        List<StatisticsBo> list = getEmployeeCheckedInfo(obj);
+        Map<Integer,StatisticsBo> listmap = new HashMap<>();
+        for(StatisticsBo b:list){
+            listmap.put(b.getUser().getId(),b);
+        }
+
+        List<StatisticsBean> listCheckedScore = statisticsDao.selectFeeStationCheckedScore(obj);
+        for (StatisticsBean sta : listCheckedScore) {
+            if (deptid!=null && sta.getDept_id().intValue()==deptid.intValue()) {
+
+                StatisticsBo b=listmap.get(sta.getUser_id().intValue());
+
+                if (b == null || b.getCheck_score_avg() == null ) continue;
+                double sc = Double.parseDouble(b.getCheck_score_avg());
+                if (sc == 0) {
+                    returnObj.setScore(returnObj.getScore() + 1);
+                } else if (sc <= 15) {
+                    returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
+                } else if (sc <= 50) {
+                    returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
+                } else {
+                    returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
+                }
+
+
+            }
+        }
+
+
+//        for (StatisticsBean sta : userLostScoreInfoList) {
+//            if (listmap.containsKey(sta.getUser_id().intValue())) {
+//                StatisticsBo bo = listmap.get(sta.getUser_id().intValue());
+//                double score =  Double.parseDouble(bo.getCheck_score_avg());
+//                if(score==0){
+//                    continue;
+//                }else
+//                if (score  <= 15) {
+//                    returnObj.setScore_fifteen(returnObj.getScore_fifteen() + 1);
+//                } else if (score <= 50 ) {
+//                    returnObj.setScore_fifty(returnObj.getScore_fifty() + 1);
+//                } else {
+//                    returnObj.setScore_over_fifty(returnObj.getScore_over_fifty() + 1);
+//                }
+//            }
+//		}
 		returnObj.setPeople_num(people_num);
 
 		return returnObj;

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

@@ -57,10 +57,10 @@ spring.redis.database=0
 #spring.redis.host=10.112.0.199
 spring.redis.host=git.topm.win
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3
-#spring.redis.port=7003
+#spring.redis.port=6379
 
 #spring.redis.port=7003
-spring.redis.port=6401 
+spring.redis.port=6401
 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
 spring.redis.password=xintong
 # \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09