| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import liquibase.pro.packaged.W; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.entity.CategoryEntity; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridWorkLogService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.house.service.IHouseRentalService; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseRentalTenantVO; |
| | |
| | | * @since 2023-11-06 |
| | | */ |
| | | @Service |
| | | public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements ITaskService { |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskEntity> implements ITaskService { |
| | | |
| | | @Autowired |
| | | private IPlaceService placeService; |
| | |
| | | |
| | | @Autowired |
| | | private IHouseRentalService iHouseRentalService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ICategoryService categoryService; |
| | |
| | | |
| | | @Override |
| | | public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null != dept) { |
| | | task.setCommunityCode(dept.getRegionCode()); |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task)); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task,regionChildCodesList,isAdministrator)); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | } |
| | | // 非民警角色 |
| | | List<TaskVO> taskVOS = baseMapper.selectTaskPage(page, task); |
| | | List<TaskVO> taskVOS = baseMapper.selectTaskPage(page, task,regionChildCodesList,isAdministrator); |
| | | return page.setRecords(taskVOS); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task) { |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null != dept) { |
| | | task.setCommunityCode(dept.getRegionCode()); |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task)); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task,regionChildCodesList,isAdministrator)); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | |
| | | taskVO.setNeiCode(neiCode); |
| | | taskVO.setReportType(2); |
| | | taskVO.setIsDeleted(0); |
| | | // 查询网格员对应的网格id |
| | | String gridCode = getGridCode(); |
| | | // 标签事件 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO); |
| | | taskVO.setReportType(1); |
| | |
| | | Integer czsh = iHouseRentalService.getStatisticsCount(houseRentalTenantVO); |
| | | // 场所审核 |
| | | Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); |
| | | // 走访日志 |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode,1); |
| | | // 设置 |
| | | objectObjectHashMap.put("qbhs", qbhs); |
| | | objectObjectHashMap.put("bqsj", bqsj); |
| | | objectObjectHashMap.put("bsbx", bsbx); |
| | | objectObjectHashMap.put("zhsh", zhsh); |
| | | objectObjectHashMap.put("czsh", czsh); |
| | | objectObjectHashMap.put("cssh", cssh); |
| | | objectObjectHashMap.put("zfrw", zfrw); |
| | | return objectObjectHashMap; |
| | | } |
| | | |
| | | /** |
| | | * 获取网格员id |
| | | * @return |
| | | */ |
| | | private String getGridCode() { |
| | | GridEntity grid = SpringUtils.getBean(IGridService.class).getGridByUserId(AuthUtil.getUserId()); |
| | | if (null!=grid){ |
| | | return grid.getGridCode(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | GridWorkLogEntity gridWorkLogEntity = new GridWorkLogEntity(); |
| | | gridWorkLogEntity.setHouseholdId(household.getId()); |
| | | gridWorkLogEntity.setType(2); |
| | | gridWorkLogEntity.setPersonType(20); |
| | | gridWorkLogEntity.setPersonType(1006); |
| | | // 系统下发 |
| | | gridWorkLogEntity.setSource(2); |
| | | // 待处理 |
| | | gridWorkLogEntity.setStatus(1); |
| | | // 新增 |
| | | gridWorkLogService.save(gridWorkLogEntity); |
| | | } |
| | |
| | | if (reportType==5){ |
| | | taskLabelReportingEventEntity.setEventType("2"); |
| | | } |
| | | taskLabelReportingEventEntity.setEventType(taskName); |
| | | // 系统下发 |
| | | taskLabelReportingEventEntity.setSource(2); |
| | | // 待完善 |
| | |
| | | taskEntity.setCreateTime(new Date()); |
| | | taskEntity.setHouseCode(houseCode); |
| | | taskEntity.setReportType(reportType); |
| | | // 系统下发 |
| | | taskEntity.setSource(2); |
| | | // 待场所负责人上报完善处理 |
| | | taskEntity.setStatus(4); |
| | | // 新增 |