hfxc226 3 years ago
parent
commit
47ba83d35f

+ 4 - 0
platform-dao/src/main/java/com/platform/dao/dto/check/CheckJobDTO.java

@@ -102,6 +102,10 @@ public class CheckJobDTO extends BaseDTO implements Serializable {
      * 保养等级
      */
     private Integer standardLevel;
+    /**
+     * 保养等级
+     */
+    private List<Integer> standardLevelList;
     /**
      * 周期类型
      */

+ 6 - 0
platform-dao/src/main/resources/mapper/check/CheckJobMapper.xml

@@ -152,6 +152,12 @@
         <if test="standardLevel != null and standardLevel != ''">
             and standard.level = #{standardLevel}
         </if>
+        <if test="standardLevelList != null and standardLevelList.size > 0">
+            AND standard.level in
+            <foreach item="item" index="index" collection="standardLevelList" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="checkUserId != null and checkUserId != ''">
             and checkjob.check_user_id = #{checkUserId}
         </if>

+ 14 - 1
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -1275,6 +1275,15 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         return result;
     }
 
+    /**
+     * 统计保养二级和三级的,一级不统计
+     *
+     * @param checkJobDTO
+     * @param searchYear
+     * @param startMonth
+     * @param endMonth
+     * @return
+     */
     @Override
     public List<CheckJobReportWeekHoursVO> getWeekReport(CheckJobDTO checkJobDTO, Integer searchYear, LocalDate startMonth, LocalDate endMonth) {
         List<Map<String, LocalDateTime>> monthStartAndEndList = DateUtils.getWeekStartAndEndByYear(searchYear);
@@ -1288,6 +1297,10 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         checkJobDTO.setSearchStartTime(searchStartTime);
         checkJobDTO.setSearchEndTime(searchEndTime);
         checkJobDTO.setType(CheckStandardTypeEnum.POLLING.getValue());
+        List<Integer> levelList = new ArrayList<Integer>();
+        levelList.add(CheckStandardLevelEnum.B.getValue());
+        levelList.add(CheckStandardLevelEnum.C.getValue());
+        checkJobDTO.setStandardLevelList(levelList);
         List<CheckJobVO> list = mapper.selectList(checkJobDTO);
         List<CheckJobReportWeekHoursVO> result = new ArrayList<CheckJobReportWeekHoursVO>();
         int i = 1;
@@ -1295,7 +1308,7 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
             CheckJobReportWeekHoursVO vo = new CheckJobReportWeekHoursVO();
             List<CheckJobVO> detailList = new ArrayList<CheckJobVO>();
             vo.setYear(searchYear+"");
-            vo.setWeek((i++) + "");
+            vo.setWeek((i++) + "");
             double totalHours = 0;
             for(CheckJobVO checkJob: list){
                 if(checkJob.getStartTime().isAfter(map.get("searchStartTimeWeek").toLocalDate()) && checkJob.getStartTime().isBefore(map.get("searchEndTimeWeek").toLocalDate())){