| | |
| | | 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.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.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.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; |
| | | |
| | |
| | | private IHouseRentalService iHouseRentalService; |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ICategoryService categoryService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @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; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (AuthUtil.getUserRole().equals("mj")) { |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | return page.setRecords(baseMapper.selectTaskPageBy(page, task,regionChildCodesList,isAdministrator)); |
| | | } else { |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | | task.setUserId(null); |
| | | if (!Strings.isBlank(roleName)){ |
| | | task.setRoleName(roleName); |
| | | if(roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (AuthUtil.getUserRole().equals("wgy")) { |
| | | task.setUserId(AuthUtil.getUserId()); |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | // 非民警角色 |
| | | List<TaskVO> taskVOS = baseMapper.selectTaskPage(page, task,regionChildCodesList,isAdministrator); |
| | | return page.setRecords(taskVOS); |
| | | } |
| | | if (AuthUtil.getUserAccount().equals("18879306957")) { |
| | | task.setCommunityCode("361102003027"); |
| | | } |
| | | if (null!=task.getReportType() && task.getReportType()==1){ |
| | | // 查询取保候审任务列表(人房相关) |
| | | return page.setRecords(baseMapper.selectTaskPageByPerson(page, task,regionChildCodesList,isAdministrator,gridCodeList)); |
| | | } |
| | | // 查询非取保候审任务列表(场所相关) |
| | | return page.setRecords(baseMapper.selectTaskPage(page, task,regionChildCodesList,isAdministrator,gridCodeList)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Long saveTask(Integer type, String name, Integer frequency, String remark, Long createUser, String houseCode, Integer reportType) { |
| | | public Long saveTask(Integer type, String name, Integer frequency, String remark, Long createUser, |
| | | String houseCode, Integer reportType,Integer status) { |
| | | TaskEntity taskEntity = new TaskEntity(); |
| | | taskEntity.setType(type); |
| | | taskEntity.setName(name); |
| | |
| | | taskEntity.setCreateUser(createUser); |
| | | taskEntity.setHouseCode(houseCode); |
| | | taskEntity.setReportType(reportType); |
| | | taskEntity.setStatus(status); |
| | | return baseMapper.insert(taskEntity) > 0 ? taskEntity.getId() : 0; |
| | | } |
| | | |
| | |
| | | taskVO.setReportType(2); |
| | | taskVO.setIsDeleted(0); |
| | | // 查询网格员对应的网格id |
| | | Integer gridId = getGridId(); |
| | | String gridCode = getGridCode(); |
| | | // 标签事件 |
| | | Integer bqsj = baseMapper.selectTaskCount(taskVO); |
| | | taskVO.setReportType(1); |
| | |
| | | // 场所审核 |
| | | Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); |
| | | // 走访日志 |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridId,1); |
| | | Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridCode,1); |
| | | // 设置 |
| | | objectObjectHashMap.put("qbhs", qbhs); |
| | | objectObjectHashMap.put("bqsj", bqsj); |
| | |
| | | * 获取网格员id |
| | | * @return |
| | | */ |
| | | private Integer getGridId() { |
| | | QueryWrapper<GridmanEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted",0).eq("user_id",AuthUtil.getUserId()); |
| | | List<GridmanEntity> list = SpringUtils.getBean(IGridmanService.class).list(wrapper); |
| | | if (list.size()>0){ |
| | | return list.get(0).getGridId(); |
| | | private String getGridCode() { |
| | | GridEntity grid = SpringUtils.getBean(IGridService.class).getGridByUserId(AuthUtil.getUserId()); |
| | | if (null!=grid){ |
| | | return grid.getGridCode(); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | String taskName = ""; |
| | | Integer reportType = 3; |
| | | if (placeVO.getLabel().equals("130808")){ |
| | | taskName = DictConstant.DA_JIN_DIAN; |
| | | taskName = DictConstant.SECOND_HAND_TRANSACTION; |
| | | reportType = 3; |
| | | } |
| | | if (placeVO.getLabel().equals("130604")){ |