| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | 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.entity.PoliceAlarmRecordsEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.police.vo.PoliceAlarmRecordsVO; |
| | | import org.springblade.modules.police.mapper.PoliceAlarmRecordsMapper; |
| | | import org.springblade.modules.police.service.IPoliceAlarmRecordsService; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 报警记录 服务实现类 |
| | |
| | | )); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 报警记录 新增 |
| | | */ |
| | | @Override |
| | | public boolean savePoliceAlarmRecordsEntity(PoliceAlarmRecordsEntity policeAlarmRecords) { |
| | | // 根据位置设置网格,警格编号 |
| | | IGridService gridService = SpringUtils.getBean(IGridService.class); |
| | | IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class); |
| | | String point = "'POINT(" + policeAlarmRecords.getLongitude() + " " + policeAlarmRecords.getLatitude() + ")'"; |
| | | //点坐标解析网格 |
| | | List<GridEntity> gridEntityList = gridService.spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | GridEntity gridEntity = gridEntityList.get(0); |
| | | policeAlarmRecords.setGridCode(gridEntity.getGridCode()); |
| | | } |
| | | //点坐标解析警格 |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0); |
| | | policeAlarmRecords.setJwGridCode(policeAffairsGridEntity.getJwGridCode()); |
| | | } |
| | | // 插入 |
| | | return save(policeAlarmRecords); |
| | | } |
| | | } |