| | |
| | | import org.springblade.modules.task.mapper.TaskMapper; |
| | | import org.springblade.modules.task.service.*; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Service |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskEntity> implements ITaskService { |
| | | |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | | |
| | | @Autowired |
| | | private IHouseholdService iHouseholdService; |
| | |
| | | public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | task.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)){ |
| | | if (!Strings.isBlank(roleName)) { |
| | | task.setRoleName(roleName); |
| | | if(roleName.equals("mj")) { |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | | } |
| | | if (null!=task.getReportType() && task.getReportType()==1){ |
| | | if (null != task.getReportType() && task.getReportType() == 1) { |
| | | // 查询取保候审任务列表(人房相关) |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task,regionChildCodesList,isAdministrator,gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | } |
| | | // 查询非取保候审任务列表(场所相关) |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task,regionChildCodesList,isAdministrator,gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task,regionChildCodesList,isAdministrator)); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task, regionChildCodesList, isAdministrator)); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | |
| | | */ |
| | | @Override |
| | | public Long saveTask(Integer type, String name, Integer frequency, String remark, Long createUser, |
| | | String houseCode, Integer reportType,Integer status) { |
| | | String houseCode, Integer reportType, Integer status) { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setType(type); |
| | | taskEntity.setName(name); |
| | |
| | | // 场所审核 |
| | | Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); |
| | | // 走访日志 |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode,1); |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode, 1); |
| | | // 设置 |
| | | objectObjectHashMap.put("qbhs", qbhs); |
| | | objectObjectHashMap.put("bqsj", bqsj); |
| | |
| | | |
| | | /** |
| | | * 获取网格员id |
| | | * |
| | | * @return |
| | | */ |
| | | private String getGridCode() { |
| | | GridEntity grid = SpringUtils.getBean(IGridService.class).getGridByUserId(AuthUtil.getUserId()); |
| | | if (null!=grid){ |
| | | if (null != grid) { |
| | | return grid.getGridCode(); |
| | | } |
| | | return null; |
| | |
| | | |
| | | /** |
| | | * 根据类型创建任务 |
| | | * |
| | | * @param param 参数 |
| | | * @return |
| | | */ |
| | |
| | | */ |
| | | public void createGridWordTask() { |
| | | // 肇事肇祸精神障碍患者走访任务生成,查询标签为:1006 |
| | | List<Integer> list = new ArrayList<Integer>(){{ |
| | | List<Integer> list = new ArrayList<Integer>() {{ |
| | | add(1006); |
| | | }}; |
| | | // 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户) |
| | |
| | | |
| | | /** |
| | | * 新增走访任务 |
| | | * |
| | | * @param household |
| | | */ |
| | | public void saveGridWordTask(HouseholdVO household) { |
| | |
| | | */ |
| | | public void createLabelReportingTask() { |
| | | // 打金店/二手车/二手手机任务生成,标签:130808/140304/130604 |
| | | List<String> stringList = new ArrayList<String>(){{ |
| | | List<String> stringList = new ArrayList<String>() {{ |
| | | add("130808"); |
| | | add("140304"); |
| | | add("130604"); |
| | | }}; |
| | | String tableName = "jczz_task_label_reporting_event"; |
| | | // 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所) |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName); |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList, tableName); |
| | | // 生成任务 |
| | | for (PlaceVO placeVO : placeVOList) { |
| | | String taskName = ""; |
| | | Integer reportType = 3; |
| | | if (placeVO.getLabel().equals("130808")){ |
| | | if (placeVO.getLabel().equals("130808")) { |
| | | taskName = DictConstant.SECOND_HAND_TRANSACTION; |
| | | reportType = 3; |
| | | } |
| | | if (placeVO.getLabel().equals("130604")){ |
| | | if (placeVO.getLabel().equals("130604")) { |
| | | taskName = DictConstant.USED_MOBILE_PHONES; |
| | | reportType = 4; |
| | | } |
| | | if (placeVO.getLabel().equals("140304")){ |
| | | if (placeVO.getLabel().equals("140304")) { |
| | | taskName = DictConstant.USED_CAR; |
| | | reportType = 5; |
| | | } |
| | | // 新增任务 |
| | | TaskEntity taskEntity = saveTaskEntity(placeVO.getHouseCode(), 1, taskName, 2, reportType); |
| | | // 同时新增打金店/二手车/二手手机任务 |
| | | saveGoldShop(placeVO, taskEntity,taskName,reportType); |
| | | saveGoldShop(placeVO, taskEntity, taskName, reportType); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | public void createHotelReportingTask() { |
| | | // 旅馆标签为 |
| | | List<String> stringList = new ArrayList<String>(){{ |
| | | List<String> stringList = new ArrayList<String>() {{ |
| | | add("120101"); |
| | | add("120102"); |
| | | add("120103"); |
| | |
| | | }}; |
| | | String tableName = "jczz_task_hotel_reporting"; |
| | | // 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所) |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName); |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList, tableName); |
| | | // 生成任务 |
| | | for (PlaceVO placeVO : placeVOList) { |
| | | // 新增任务 |
| | |
| | | // 校园安全自查,查询标签为教育的场所 parentNo = 1601 |
| | | String parentNo = "1601"; |
| | | QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted",0).eq("parent_no",parentNo); |
| | | wrapper.eq("is_deleted", 0).eq("parent_no", parentNo); |
| | | List<CategoryEntity> categoryEntityList = categoryService.list(wrapper); |
| | | // 取出编号集合 |
| | | List<String> stringList = categoryEntityList.stream().map(categoryEntity -> categoryEntity.getCategoryNo()).collect(Collectors.toList()); |
| | | // 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所) |
| | | String tableName = "jczz_task_campus_reporting_event"; |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName); |
| | | List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList, tableName); |
| | | // 生成任务 |
| | | for (PlaceVO placeVO : placeVOList) { |
| | | // 新增任务 |
| | |
| | | |
| | | /** |
| | | * 新增校园安全检查任务 |
| | | * |
| | | * @param placeVO |
| | | * @param taskEntity |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增旅馆安全检查任务 |
| | | * |
| | | * @param placeVO |
| | | * @param taskEntity |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增打金店/二手车/二手手机任务 |
| | | * |
| | | * @param placeVO |
| | | * @param taskEntity |
| | | * @param taskName |
| | | * @param reportType |
| | | */ |
| | | private void saveGoldShop(PlaceVO placeVO, TaskEntity taskEntity,String taskName,Integer reportType) { |
| | | private void saveGoldShop(PlaceVO placeVO, TaskEntity taskEntity, String taskName, Integer reportType) { |
| | | TaskLabelReportingEventEntity taskLabelReportingEventEntity = new TaskLabelReportingEventEntity(); |
| | | taskLabelReportingEventEntity.setTaskId(taskEntity.getId()); |
| | | taskLabelReportingEventEntity.setPlaceId(placeVO.getId()); |
| | |
| | | taskLabelReportingEventEntity.setPhoneNumber(placeVO.getPrincipalPhone()); |
| | | taskLabelReportingEventEntity.setLabelName(taskName); |
| | | // 打金店 |
| | | if (reportType==3){ |
| | | if (reportType == 3) { |
| | | taskLabelReportingEventEntity.setEventType("1"); |
| | | } |
| | | // 二手车 |
| | | if (reportType==4){ |
| | | if (reportType == 4) { |
| | | taskLabelReportingEventEntity.setEventType("3"); |
| | | } |
| | | // 二手手机 |
| | | if (reportType==5){ |
| | | if (reportType == 5) { |
| | | taskLabelReportingEventEntity.setEventType("2"); |
| | | } |
| | | // 系统下发 |
| | |
| | | |
| | | /** |
| | | * 插入任务信息 |
| | | * |
| | | * @param houseCode |
| | | * @param type |
| | | * @param taskName |
| | |
| | | // 返回 |
| | | return taskEntity; |
| | | } |
| | | |
| | | /** |
| | | * 任务审核 |
| | | * @param task |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean examine(TaskEntity task) { |
| | | // 二手交易 |
| | | if (task.getReportType().equals(5)) { |
| | | boolean b = updateById(task); |
| | | if (b) { |
| | | ITaskLabelReportingEventService bean = SpringUtils.getBean(ITaskLabelReportingEventService.class); |
| | | return bean.update(Wrappers.<TaskLabelReportingEventEntity>lambdaUpdate() |
| | | .set(TaskLabelReportingEventEntity::getConfirmFlag, task.getStatus()) |
| | | .eq(TaskLabelReportingEventEntity::getTaskId, task.getId())); |
| | | } |
| | | |
| | | } |
| | | // 消防只查 |
| | | if (task.getReportType().equals(2)) { |
| | | boolean b = updateById(task); |
| | | if (b) { |
| | | ITaskPlaceSelfCheckService bean = SpringUtils.getBean(ITaskPlaceSelfCheckService.class); |
| | | return bean.update(Wrappers.<TaskPlaceSelfCheckEntity>lambdaUpdate() |
| | | .set(TaskPlaceSelfCheckEntity::getStatus, task.getStatus()) |
| | | .eq(TaskPlaceSelfCheckEntity::getTaskId, task.getId())); |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |