| | |
| | | import org.springblade.modules.grid.service.IGridWorkLogService; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.modules.house.vo.UserHouseLabelVO; |
| | | import org.springblade.modules.task.service.TaskHandle; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public void taskHandle(CustomTaskEntity customTask) { |
| | | System.out.println("走访任务"); |
| | | // 查询有标签的颜色的人 |
| | | List<UserHouseLabelEntity> list = userHouseLabelService.list(Wrappers.<UserHouseLabelEntity>lambdaQuery() |
| | | .eq(UserHouseLabelEntity::getLableType, 1) |
| | | .eq(UserHouseLabelEntity::getLabelId, customTask.getLabelId()) |
| | | .eq(UserHouseLabelEntity::getColor, customTask.getLabelColor()) |
| | | .isNotNull(UserHouseLabelEntity::getHouseholdId)); |
| | | // List<UserHouseLabelEntity> list = userHouseLabelService.list(Wrappers.<UserHouseLabelEntity>lambdaQuery() |
| | | // .eq(UserHouseLabelEntity::getLableType, 1) |
| | | // .eq(UserHouseLabelEntity::getLabelId, customTask.getLabelId()) |
| | | // .eq(UserHouseLabelEntity::getColor, customTask.getLabelColor()) |
| | | // .isNotNull(UserHouseLabelEntity::getHouseholdId)); |
| | | UserHouseLabelVO userHouseLabelVO = new UserHouseLabelVO(); |
| | | userHouseLabelVO.setLabelId(customTask.getLabelId().longValue()); |
| | | userHouseLabelVO.setColor(customTask.getLabelColor()); |
| | | userHouseLabelVO.setTaskRange(customTask.getTaskRange()); |
| | | List<UserHouseLabelEntity> list = userHouseLabelService.getUserHouseLabelList(userHouseLabelVO); |
| | | List<GridWorkLogEntity> gridWorkLogEntities = new ArrayList<>(); |
| | | list.forEach(userHouseLabelEntity -> { |
| | | // 创建任务 |
| | | GridWorkLogEntity gridWorkLogEntity = new GridWorkLogEntity(); |
| | | gridWorkLogEntity.setType(1); |
| | | gridWorkLogEntity.setType(2); |
| | | gridWorkLogEntity.setHouseholdId(userHouseLabelEntity.getHouseholdId()); |
| | | gridWorkLogEntity.setPersonType(1); |
| | | gridWorkLogEntity.setPersonType(customTask.getLabelId()); |
| | | gridWorkLogEntity.setSource(2); |
| | | gridWorkLogEntity.setStatus(1); |
| | | gridWorkLogEntities.add(gridWorkLogEntity); |