| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.google.common.base.Joiner; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataAddDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataDeleteDTO; |
| | | import com.panzhihua.common.model.dtos.grid.EventGridDataEditDTO; |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridDataDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.grid.*; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_grid.dao.*; |
| | | import com.panzhihua.service_grid.model.dos.*; |
| | | import com.panzhihua.service_grid.dao.EventGridDataMapper; |
| | | import com.panzhihua.service_grid.dao.EventMapper; |
| | | import com.panzhihua.service_grid.dao.LcCompareCodeMapper; |
| | | import com.panzhihua.service_grid.model.dos.EventGridDataDO; |
| | | import com.panzhihua.service_grid.model.dos.EventGridMemberRelationDO; |
| | | import com.panzhihua.service_grid.model.dos.LcCompareCodeDO; |
| | | import com.panzhihua.service_grid.service.EventGridDataService; |
| | | import com.panzhihua.service_grid.service.EventGridMemberRelationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class EventGridDataServiceImpl extends ServiceImpl<EventGridDataMapper, EventGridDataDO> implements EventGridDataService { |
| | | public class EventGridDataServiceImpl extends ServiceImpl<EventGridDataMapper, EventGridDataDO> |
| | | implements EventGridDataService { |
| | | |
| | | @Resource |
| | | private EventGridDataMapper eventGridDataMapper; |
| | |
| | | private EventGridMemberRelationService eventGridMemberRelationService; |
| | | @Resource |
| | | private LcCompareCodeMapper lcCompareCodeMapper; |
| | | |
| | | /** |
| | | * 新增区县/街道/社区/网格员网格数据管理 |
| | | * |
| | | * @param eventGridDataAddDTO |
| | | * @return 新增结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改区县/街道/社区/网格员网格数据管理 |
| | | * |
| | | * @param eventGridDataEditDTO |
| | | * @return 维护结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除区县/街道/社区/网格员网格数据管理 |
| | | * |
| | | * @param EventGridDataDeleteDTO |
| | | * @return 平台用户信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询区县/街道/社区/网格员网格数据管理详细信息 |
| | | * @param id 区县/街道/社区/网格员网格数据管理 id |
| | | * |
| | | * @param id |
| | | * 区县/街道/社区/网格员网格数据管理 id |
| | | * @return 查找结果 |
| | | */ |
| | | public R<EventGridDataDetailsVO> eventGridDataDetails(Long id){ |
| | |
| | | |
| | | /** |
| | | * 地图模块-根据网格id查询网格详细信息 |
| | | * @param gridId 网格id |
| | | * |
| | | * @param gridId |
| | | * 网格id |
| | | * @return 网格详细信息 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 分页查询网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * |
| | | * @param eventGridDataDTO |
| | | * 请求参数 |
| | | * @return 网格列表 |
| | | */ |
| | | @Override |
| | | public R getGridMemberList(PageEventGridDataAdminDTO eventGridDataDTO){ |
| | | IPage<EventGridAdminVO> gridAdminVOIPage = this.baseMapper.findByPage(new Page(eventGridDataDTO.getPageNum(),eventGridDataDTO.getPageSize()),eventGridDataDTO); |
| | | IPage<EventGridAdminVO> gridAdminVOIPage = this.baseMapper |
| | | .findByPage(new Page(eventGridDataDTO.getPageNum(), eventGridDataDTO.getPageSize()), eventGridDataDTO); |
| | | if(!gridAdminVOIPage.getRecords().isEmpty()){ |
| | | gridAdminVOIPage.getRecords().forEach(gridMember -> { |
| | | List<GridMemberAdminVO> members = this.baseMapper.getGridMember(gridMember.getId()); |
| | |
| | | |
| | | /** |
| | | * 查询社区下所有网格员 |
| | | * @param communityId 社区id |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 网格员列表 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 后台新增网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * |
| | | * @param eventGridDataDTO |
| | | * 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | if(eventGridDataDTO.getLcGridId() != null){ |
| | | //关联市平台网格 |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectOne(new QueryWrapper<LcCompareCodeDO>().lambda() |
| | | .eq(LcCompareCodeDO::getLcGridId,eventGridDataDTO.getLcGridId())); |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectOne(new QueryWrapper<LcCompareCodeDO>() |
| | | .lambda().eq(LcCompareCodeDO::getLcGridId, eventGridDataDTO.getLcGridId())); |
| | | if(compareCodeDO != null){ |
| | | compareCodeDO.setLocalGridId(gridDataDO.getId().toString()); |
| | | compareCodeDO.setGridName(gridDataDO.getGridName()); |
| | |
| | | |
| | | /** |
| | | * 后台修改网格 |
| | | * @param eventGridDataDTO 请求参数 |
| | | * |
| | | * @param eventGridDataDTO |
| | | * 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | |
| | | //查询已存在的关系需要清除 |
| | | lcCompareCodeMapper.delete(new QueryWrapper<LcCompareCodeDO>() |
| | | .lambda().eq(LcCompareCodeDO::getLocalGridId,gridDataDO.getId())); |
| | | lcCompareCodeMapper.delete(new QueryWrapper<LcCompareCodeDO>().lambda() |
| | | .eq(LcCompareCodeDO::getLocalGridId, gridDataDO.getId())); |
| | | if(eventGridDataDTO.getLcGridId() != null){ |
| | | //关联市平台网格 |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectOne(new QueryWrapper<LcCompareCodeDO>().lambda() |
| | | .eq(LcCompareCodeDO::getLcGridId,eventGridDataDTO.getLcGridId())); |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectOne(new QueryWrapper<LcCompareCodeDO>() |
| | | .lambda().eq(LcCompareCodeDO::getLcGridId, eventGridDataDTO.getLcGridId())); |
| | | if(compareCodeDO != null){ |
| | | compareCodeDO.setLocalGridId(gridDataDO.getId().toString()); |
| | | compareCodeDO.setGridName(gridDataDO.getGridName()); |
| | |
| | | |
| | | @Override |
| | | public R getGridDataListByCommunity(Long communityId) { |
| | | List<EventGridDataAreaVO> eventGridDataAreaVOList = this.getBaseMapper().getGridDataListByCommunity(communityId); |
| | | List<EventGridDataAreaVO> eventGridDataAreaVOList = |
| | | this.getBaseMapper().getGridDataListByCommunity(communityId); |
| | | return R.ok(eventGridDataAreaVOList); |
| | | } |
| | | |