| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | 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.BeanUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.community.entity.CommunityEntity; |
| | | import org.springblade.modules.community.service.ICommunityService; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.entity.PoliceStationEntity; |
| | | import org.springblade.modules.police.excel.PoliceAffairsGridExcel; |
| | |
| | | |
| | | @Override |
| | | public IPage<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage<PoliceAffairsGridVO> page, PoliceAffairsGridVO policeAffairsGrid) { |
| | | return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page, policeAffairsGrid)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PoliceAffairsGridVO.class, policeAffairsGrid); |
| | | return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page, |
| | | policeAffairsGrid, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList() |
| | | )); |
| | | } |
| | | |
| | | /** |
| | |
| | | public List<String> getCommunityCodeListByUserId(Long userId) { |
| | | return baseMapper.getCommunityCodeListByUserId(userId.toString()); |
| | | } |
| | | |
| | | /** |
| | | * 警务网格(辖区)表 自定义新增或修改 |
| | | * @param policeAffairsGrid |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdatePoliceAffairsGrid(PoliceAffairsGridEntity policeAffairsGrid) { |
| | | boolean flag = false; |
| | | // 查询对应的派出所及社区名称 |
| | | IPoliceStationService policeStationService = SpringUtils.getBean(IPoliceStationService.class); |
| | | QueryWrapper<PoliceStationEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("code",policeAffairsGrid.getPcsCode()); |
| | | List<PoliceStationEntity> policeStationEntityList = policeStationService.list(queryWrapper); |
| | | if (policeStationEntityList.size()>0){ |
| | | policeAffairsGrid.setPcsName(policeStationEntityList.get(0).getName()); |
| | | } |
| | | ICommunityService communityService = SpringUtils.getBean(ICommunityService.class); |
| | | QueryWrapper<CommunityEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("code",policeAffairsGrid.getCommunityCode()); |
| | | List<CommunityEntity> communityEntityList = communityService.list(wrapper); |
| | | if (communityEntityList.size()>0){ |
| | | policeAffairsGrid.setCommunityName(communityEntityList.get(0).getName()); |
| | | } |
| | | if (null!=policeAffairsGrid.getId()){ |
| | | policeAffairsGrid.setGeom(null); |
| | | // 更新 |
| | | flag = updateById(policeAffairsGrid); |
| | | }else { |
| | | policeAffairsGrid.setGeom(null); |
| | | // 新增 |
| | | flag = save(policeAffairsGrid); |
| | | } |
| | | return flag; |
| | | } |
| | | } |