Browse Source

#限制查询一个月内巡检用户任务

zhongwei
yang_shj 5 months ago
parent
commit
c578b6817b
  1. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java

@ -334,9 +334,12 @@ public class InspectOfflineServiceImpl implements IOfflineDataService {
List<String> fileJson = new ArrayList<>();
// 查询当天数据(条件)
String currentDate = DateUtil.formatDateTime(DateUtil.now());
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH,-1);
// 巡检任务ID集合
List<TaskUserEntity> taskUsers = this.taskUserService.list(new LambdaQueryWrapper<TaskUserEntity>() {{
eq(TaskUserEntity::getUserId, user.getUserId());
ge(TaskUserEntity::getCreateTime, DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE));
}});
if(CollectionUtil.isEmpty(taskUsers)){
throw new ServiceException("巡检用户数据不存在!");

Loading…
Cancel
Save