| | |
| | | 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.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | 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; |
| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.task.entity.*; |
| | | import org.springblade.modules.task.mapper.TaskMapper; |
| | | import org.springblade.modules.task.service.*; |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService; |
| | | 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; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(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; |
| | | // String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | // if (!Strings.isBlank(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; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)) { |
| | | task.setRoleName(roleName); |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | | } |
| | | // if (!Strings.isBlank(roleName)) { |
| | | // task.setRoleName(roleName); |
| | | // if (roleName.equals("mj")) { |
| | | // regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | // } |
| | | // if (roleName.equals("wgy")) { |
| | | // gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | // } |
| | | // } |
| | | // if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | // task.setCommunityCode("361102003027"); |
| | | // } |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,task); |
| | | if (null != task.getReportType() && task.getReportType() == 1) { |
| | | // 查询取保候审任务列表(人房相关) |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task, commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList())); |
| | | } |
| | | // 查询非取保候审任务列表(场所相关) |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task, regionChildCodesList, isAdministrator, gridCodeList)); |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task, commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList())); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class, task); |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task, regionChildCodesList, isAdministrator)); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | |
| | | taskVO.setStatus(1); |
| | | taskVO.setUserId(roleType > 0 ? AuthUtil.getUserId() : null); |
| | | taskVO.setNeiCode(neiCode); |
| | | taskVO.setReportType(2); |
| | | taskVO.setReportType(5); |
| | | taskVO.setIsDeleted(0); |
| | | // 查询网格员对应的网格id |
| | | String gridCode = getGridCode(); |
| | | // 标签事件 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskVO.class,taskVO); |
| | | |
| | | // 标签报事-二手交易 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList()); |
| | | taskVO.setReportType(1); |
| | | // 取保候审 |
| | | Integer qbhs = baseMapper.selectTaskCount(taskVO); |
| | | Integer qbhs = baseMapper.selectTaskCount(taskVO,commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(),commonParamSet.getGridCodeList()); |
| | | // 报事报修 |
| | | Integer bsbx = SpringUtils.getBean(ITaskReportForRepairsService.class).getStatistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode); |
| | | // 住房审核 |
| | | Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode); |
| | | // 住户审核 |
| | | Integer zhsh = iHouseholdService.statistics(roleType > 0 ? AuthUtil.getUserId() : null, neiCode,0); |
| | | // 出租审核 |
| | | HouseRentalTenantVO houseRentalTenantVO = new HouseRentalTenantVO(); |
| | | houseRentalTenantVO.setUserId(roleType > 0 ? AuthUtil.getUserId() : null); |
| | | houseRentalTenantVO.setNeiCode(neiCode); |
| | | Integer czsh = iHouseRentalService.getStatisticsCount(houseRentalTenantVO); |
| | | // 场所审核 |
| | | Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); |
| | | // 走访日志 |
| | | // 查询网格员对应的网格id |
| | | String gridCode = getGridCode(); |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode, 1); |
| | | // 消防自查 |
| | | Integer xfzc = SpringUtils.getBean(ITaskPlaceSelfCheckService.class).getCount(neiCode, 1); |
| | | // 消防隐患整改 |
| | | Integer xfyhzg = SpringUtils.getBean(ITaskPlaceRectificationService.class).getCount(neiCode, 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); |
| | | 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);// 走访日志 |
| | | objectObjectHashMap.put("xfzc", xfzc);// 消防自查 |
| | | objectObjectHashMap.put("xfyhzg", xfyhzg);// 消防隐患整改 |
| | | return objectObjectHashMap; |
| | | } |
| | | |
| | |
| | | taskVO.setUserId(AuthUtil.getUserId()); |
| | | taskVO.setFrequency(1); |
| | | taskVO.setStatus(1); |
| | | Integer disposable = baseMapper.selectTaskCount(taskVO); |
| | | Integer disposable = baseMapper.selectTaskCount(taskVO,null,null,null); |
| | | taskVO.setFrequency(2); |
| | | Integer periodicity = baseMapper.selectTaskCount(taskVO); |
| | | Integer periodicity = baseMapper.selectTaskCount(taskVO,null,null,null); |
| | | objectObjectHashMap.put("disposable", disposable); |
| | | objectObjectHashMap.put("periodicity", periodicity); |
| | | return objectObjectHashMap; |