| | |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private TTaskCleanService taskCleanService; |
| | | @Autowired |
| | | private TTemplateCountService templateCountService; |
| | | |
| | | |
| | | // 每一个小时执行一次 |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | @Scheduled(fixedRate = 1500000000) |
| | | |
| | | public void dayOfCreateInspection() { |
| | | try { |
| | | |
| | |
| | | List<TLocation> locationList = locationService.list(Wrappers.lambdaQuery(TLocation.class) |
| | | .in(TLocation::getLocationCleaner, cleanersIds)); |
| | | // 查询点位类型 |
| | | // List<TLocationType> locationTypes = locationTypeService.list(Wrappers.lambdaQuery(TLocationType.class) |
| | | // .orderByDesc(TLocationType::getCreateTime)); |
| | | JSONArray jsonArray = JSONObject.parseArray(num4); |
| | | List<TLocation> tLocationList = new ArrayList<>(); |
| | | for (Object o : jsonArray) { |
| | |
| | | task.setTaskCode(nameAndCode); |
| | | tasks.add(task); |
| | | } |
| | | |
| | | // 添加应生成任务数量 |
| | | TTemplateCount templateCount = new TTemplateCount(); |
| | | templateCount.setTemplateId(detail.getId()); |
| | | templateCount.setTaskCount(tLocationList.size()* cycle); |
| | | templateCount.setUserId(sysUser.getUserId()); |
| | | templateCountService.save(templateCount); |
| | | |
| | | taskCleanService.saveBatch(tasks); |
| | | template.setTaskCount(tasks.size()); |
| | | templateService.updateById(template); |