| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | 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; |
| | |
| | | private EventMapper eventMapper; |
| | | @Resource |
| | | private EventGridMemberRelationService eventGridMemberRelationService; |
| | | @Resource |
| | | private LcCompareCodeMapper lcCompareCodeMapper; |
| | | /** |
| | | * 新增区县/街道/社区/网格员网格数据管理 |
| | | * @param eventGridDataAddDTO |
| | |
| | | } |
| | | } |
| | | |
| | | if(eventGridDataDTO.getLcGridId() != null){ |
| | | //关联市平台网格 |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectById(eventGridDataDTO.getLcGridId()); |
| | | if(compareCodeDO != null){ |
| | | compareCodeDO.setLocalGridId(gridDataDO.getId().toString()); |
| | | compareCodeDO.setGridName(gridDataDO.getGridName()); |
| | | lcCompareCodeMapper.updateById(compareCodeDO); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | EventGridDataDO gridDataDO = this.baseMapper.selectById(eventGridDataDTO.getGridId()); |
| | | if(gridDataDO != null){ |
| | | BeanUtils.copyProperties(eventGridDataDTO,gridDataDO); |
| | | gridDataDO.setRemarks(eventGridDataDTO.getRemarks()); |
| | | gridDataDO.setUpdateBy(eventGridDataDTO.getUserId()); |
| | | if(this.baseMapper.updateById(gridDataDO) > 0){ |
| | | //移除网格员和网格关系 |
| | |
| | | eventGridMemberRelationService.saveBatch(memberRelationDOList); |
| | | } |
| | | } |
| | | |
| | | if(eventGridDataDTO.getLcGridId() != null){ |
| | | |
| | | //查询已存在的关系需要清除 |
| | | LcCompareCodeDO oldCompareCodeDO = lcCompareCodeMapper.selectOne(new QueryWrapper<LcCompareCodeDO>() |
| | | .lambda().eq(LcCompareCodeDO::getLocalGridId,gridDataDO.getId())); |
| | | if(oldCompareCodeDO != null){ |
| | | lcCompareCodeMapper.updateLcCompareCode(gridDataDO.getId()); |
| | | } |
| | | |
| | | //关联市平台网格 |
| | | LcCompareCodeDO compareCodeDO = lcCompareCodeMapper.selectById(eventGridDataDTO.getLcGridId()); |
| | | if(compareCodeDO != null){ |
| | | compareCodeDO.setLocalGridId(gridDataDO.getId().toString()); |
| | | compareCodeDO.setGridName(gridDataDO.getGridName()); |
| | | lcCompareCodeMapper.updateById(compareCodeDO); |
| | | } |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |