| | |
| | | */ |
| | | package org.sxkj.gd.workorder.service.impl; |
| | | |
| | | import org.sxkj.gd.utils.GeomUtils; |
| | | import org.sxkj.gd.workorder.entity.GdManageDeviceEntity; |
| | | import org.sxkj.gd.workorder.vo.GdManageDeviceVO; |
| | | import org.sxkj.gd.workorder.excel.GdManageDeviceExcel; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return page.setRecords(baseMapper.selectGdManageDevicePage(page, gdManageDevice)); |
| | | } |
| | | |
| | | @Override |
| | | public List<GdManageDeviceVO> selectGdManageDevice(GdManageDeviceVO gdManageDevice) { |
| | | return baseMapper.selectGdManageDevice(gdManageDevice); |
| | | } |
| | | |
| | | @Override |
| | | public List<GdManageDeviceExcel> exportGdManageDevice(Wrapper<GdManageDeviceEntity> queryWrapper) { |
| | | List<GdManageDeviceExcel> gdManageDeviceList = baseMapper.exportGdManageDevice(queryWrapper); |
| | | //gdManageDeviceList.forEach(gdManageDevice -> { |
| | | // gdManageDeviceList.forEach(gdManageDevice -> { |
| | | // gdManageDevice.setTypeName(DictCache.getValue(DictEnum.YES_NO, GdManageDevice.getType())); |
| | | //}); |
| | | return gdManageDeviceList; |
| | | } |
| | | |
| | | /** |
| | | * 保存或更新设备信息 |
| | | * |
| | | * @param gdManageDeviceEntity |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateDevice(GdManageDeviceEntity gdManageDeviceEntity) throws Exception { |
| | | // 获取设备位置 生成缓冲区 |
| | | if (gdManageDeviceEntity.getLongitude() != null && gdManageDeviceEntity.getLatitude() != null) { |
| | | String bufferAroundPointAsString = GeomUtils.getBufferAroundPointAsString(gdManageDeviceEntity.getLongitude(), gdManageDeviceEntity.getLatitude(), 5 * 1000); |
| | | gdManageDeviceEntity.setGeom(bufferAroundPointAsString); |
| | | } |
| | | return saveOrUpdate(gdManageDeviceEntity); |
| | | } |
| | | } |