2 years ago
parent
commit
9683bfe41a

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

@@ -172,10 +172,10 @@
         <if test="type != null and type != ''">
             and checkjob.type = #{type}
         </if>
-        <if test="searchStartTime != null and status==null">
-            and checkjob.start_time <![CDATA[ >= ]]> #{searchStartTime}
+        <if test="searchStartTime != null and status==null or status==1 or status==2">
+            and checkjob.start_time <![CDATA[ >= ]]> date_format(#{searchStartTime},'%Y-%m-%d')
         </if>
-        <if test="searchEndTime != null and status==null">
+        <if test="searchEndTime != null and status==null or status==1 or status==2">
             and checkjob.start_time <![CDATA[ <= ]]> #{searchEndTime}
         </if>
         <if test="searchStartTime != null and status!=null and status==3">
@@ -204,7 +204,7 @@
     <select id="selectList" parameterType="com.platform.dao.dto.check.CheckJobDTO"
             resultType="com.platform.dao.vo.query.check.CheckJobVO">
         select checkjob.*, u.real_name as checkUserName,
-        sbinfo.name sbName, sbinfo.no sbNo, sbinfo.level sbLevel,sbinfo.id
+        sbinfo.name sbName, sbinfo.no sbNo, sbinfo.level sbLevel,sbinfo.id,
         partinfo.name partName,
         standard.no standardNo, standard.name standardName,standard.level standardLevel,
         standard.period period, standard.period_type periodType

+ 2 - 2
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -6,7 +6,6 @@
         user.real_name as userName,
         user2.real_name as repairUserName,
         user3.real_name as checkUserName,
-        user4.real_name as repairUser,
         sb.name as sbName,part.name as partName,
         sb.no as sbNo, sb.cph as sbCph, sb.model_id as modelId,
         error.name as repairErrorTypeName
@@ -14,7 +13,8 @@
     <select id="selectPageList" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
             resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
         select
-        <include refid="Base_Column_List"/>
+        <include refid="Base_Column_List"/>,
+        user4.real_name as repairUser
         from t_repair_application_form application
         left join t_sys_user user on application.user_id = user.user_id
         left join t_sys_user user2 on application.repair_user_id = user2.user_id

+ 13 - 10
platform-service/src/main/java/com/platform/service/check/impl/CheckJobServiceImpl.java

@@ -202,14 +202,15 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
             UserInfo userInfo = SecurityUtils.getUserInfo();
             model.setCheckUserId(userInfo.getUserId());
         }
+
         if (model.getSearchType() != null && 1 == model.getSearchType()) {
-            //model.setSearchStartTime(DateUtils.getTodayStartTime());
+            model.setSearchStartTime(DateUtils.getTodayStartTime());
             model.setSearchEndTime(DateUtils.getTodayEndTime());
         } else if (model.getSearchType() != null && 2 == model.getSearchType()) {
-           // model.setSearchStartTime(DateUtils.getMondayOfThisWeek());
+            model.setSearchStartTime(DateUtils.getMondayOfThisWeek());
             model.setSearchEndTime(DateUtils.getSundayOfThisWeek());
         } else if (model.getSearchType() != null && 3 == model.getSearchType()) {
-            //model.setSearchStartTime(DateUtils.getFirstDayOfThisMonth());
+            model.setSearchStartTime(DateUtils.getFirstDayOfThisMonth());
             model.setSearchEndTime(DateUtils.getLastDayOfThisMonth());
         }
         PageHelper.startPage(pageNum, pageSize);
@@ -1041,12 +1042,13 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
         }
         checkJob.setRealHours(DateUtils.getDurationMinutes(checkJob.getActualStartTime(), checkJob.getActualEndTime()) + "");
         OauthUser oauthUser = SecurityUtils.checkAndGetUser();
-        SbInfoVO sbInfoVO = new SbInfoVO();
+        SbInfoVO sbInfoVO =  sbInfoService.getById(checkJob.getSbId());
+        if (sbInfoVO == null) {
+            throw new BusinessException("设备不存在,无法完成任务");
+        }
         if(oauthUser==null){// 未登录,在获取设备的使用人员
-            sbInfoVO= sbInfoService.getById(checkJob.getSbId());
-            if (sbInfoVO == null) {
-                throw new BusinessException("设备不存在,无法完成任务");
-            }
+//            sbInfoVO= sbInfoService.getById(checkJob.getSbId());
+
             checkJob.setUpdateUserId(sbInfoVO.getSaveUser());
             checkJob.setUpdateUserName(sbInfoVO.getSaveUserName());
         }else{
@@ -1062,7 +1064,6 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
 
         // 提交完成图片信息
         this.saveFile(dto);
-
         //需判断设备是否处于使用中的状态,若不处于使用中的状态,则不需要生成保养任务
         if (!sbInfoVO.getStatus().equals(SbInfoStatusEnum.IN_USE.getValue()))
             return;
@@ -1260,7 +1261,9 @@ public class CheckJobServiceImpl extends BaseServiceImpl<CheckJobMapper, CheckJo
             if(searchType != null) {
                 // 查询当日的任务数
                 if (searchType == 1) {
-                    weekendCriteria.andLessThan(CheckJob::getStartTime, DateUtils.getTodayEndTime());
+//                    weekendCriteria.andLessThan(CheckJob::getStartTime, DateUtils.getTodayEndTime());
+//                    weekendCriteria.andBetween(CheckJob::getStartTime,DateUtils.getTodayStartTime(),DateUtils.getTodayEndTime());
+                    weekendCriteria.andEqualTo(CheckJob::getStartTime,LocalDate.now());
                 } else if (searchType == 2) {
                     // 查询当周的任务数
                     weekendCriteria.andLessThan(CheckJob::getStartTime, DateUtils.getSundayOfThisWeek());