| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.param.GridSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.backblast.entity.BackblastPubRecordEntity; |
| | | import org.springblade.modules.backblast.vo.BackblastPubRecordVO; |
| | | import org.springblade.modules.backblast.mapper.BackblastPubRecordMapper; |
| | | import org.springblade.modules.backblast.service.IBackblastPubRecordService; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 反炸宣传记录表 服务实现类 |
| | |
| | | */ |
| | | @Override |
| | | public boolean addOrUpdateBackblastPubRecordEntity(BackblastPubRecordEntity backblastPubRecord) { |
| | | // 点落面计算警格,网格,警格 |
| | | GridSet invoke = new GridSet().invoke(BackblastPubRecordEntity.class, backblastPubRecord, |
| | | "lng", "lat", "gridCode", "jwGridCode"); |
| | | // 设置民警姓名电话(非民警暂时也记录) |
| | | User user = SpringUtils.getBean(IUserService.class).getById(AuthUtil.getUserId()); |
| | | if (null!=user){ |
| | |
| | | // 新增 |
| | | return save(backblastPubRecord); |
| | | } |
| | | |
| | | /** |
| | | * 设置警格网格信息 |
| | | * @param backblastPubRecord |
| | | */ |
| | | public void setGridInfo(BackblastPubRecordEntity backblastPubRecord) { |
| | | // 根据位置设置网格,警格编号 |
| | | IGridService gridService = SpringUtils.getBean(IGridService.class); |
| | | IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class); |
| | | String point = "'POINT(" + backblastPubRecord.getLng() + " " + backblastPubRecord.getLat() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | backblastPubRecord.setGridCode(gridEntity.getGridCode()); |
| | | } |
| | | //点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | backblastPubRecord.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 反炸宣传记录表 自定义详情 |
| | | * @param backblastPubRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public BackblastPubRecordVO getDetail(BackblastPubRecordVO backblastPubRecord) { |
| | | return baseMapper.getDetail(backblastPubRecord); |
| | | } |
| | | } |