| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.task.entity.TaskEntity; |
| | |
| | | @Component("SelfExaminationTaskHandler") |
| | | public class SelfExaminationTaskHandler implements TaskHandle { |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(SelfExaminationTaskHandler.class); |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | |
| | |
| | | Query query = new Query(); |
| | | IPage<PlaceVO> page = Condition.getPage(query); |
| | | PlaceVO placeVO = new PlaceVO(); |
| | | placeVO.setPoiCodes(customTask.getPlaceLabel().toString()); |
| | | placeVO.setPlaceLabel(customTask.getPlaceLabel()); |
| | | placeVO.setPlaceSmallLabel(customTask.getPlaceSmallLabel()); |
| | | placeVO.setNineType(customTask.getNineType()); |
| | | placeVO.setColor(customTask.getLabelColor()); |
| | | placeVO.setTaskRange(customTask.getTaskRange()); |
| | | IPage<PlaceVO> placePage = placeService.getPlacePage(page, placeVO); |
| | | ITaskService iTaskService = SpringUtils.getBean(ITaskService.class); |
| | | // 计算总页数 |
| | | long pages = placePage.getPages(); |
| | | System.out.println("总页数:" + pages); |
| | | for (int i = 1; i <= pages; i++) { |
| | | page = Condition.getPage(query); |
| | | page.setCurrent(i); |
| | |
| | | placePage.getRecords().forEach(place -> { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setType(1); |
| | | taskEntity.setName("自查"); |
| | | taskEntity.setName(customTask.getName()); |
| | | taskEntity.setCreateTime(new Date()); |
| | | taskEntity.setHouseCode(place.getHouseCode()); |
| | | taskEntity.setReportType(7); |
| | |
| | | taskPlaceSelfCheck.setHouseCode(place.getHouseCode()); |
| | | taskPlaceSelfCheck.setPlaceName(place.getPlaceName()); |
| | | taskPlaceSelfCheck.setStatus(4); |
| | | taskPlaceSelfCheck.setType("1"); |
| | | taskPlaceSelfCheckService.save(taskPlaceSelfCheck); |
| | | // taskPlaceSelfCheckList.add(taskPlaceSelfCheck); |
| | | }); |