drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -111,7 +111,7 @@ @ApiOperationSupport(order = 4) @ApiOperation(value = "新增或修改", notes = "传入fwDevice") public R submit(@Valid @RequestBody FwDeviceDTO fwDevice) { return R.status(fwDeviceService.saveOrUpdate(FwDeviceWrapper.build().entityDTO(fwDevice))); return R.status(fwDeviceService.saveOrUpdateDevice(FwDeviceWrapper.build().entityDTO(fwDevice))); } /** drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -129,4 +129,11 @@ * @return */ boolean existsAreaBindByDeviceId(Long deviceId); /** * 新增或修改设备 * @param fwDeviceEntity * @return */ boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity); } drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -37,6 +37,8 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.utils.StringUtil; import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -150,4 +152,18 @@ public boolean existsAreaBindByDeviceId(Long deviceId) { return fwAreaDivideService.existsAreaByDeviceId(deviceId); } /** * 保存或更新设备信息 * @param fwDeviceEntity * @return */ @Override public boolean saveOrUpdateDevice(FwDeviceEntity fwDeviceEntity) { if (fwDeviceEntity.getEffectiveRangeKm() == null || fwDeviceEntity.getEffectiveRangeKm().compareTo(BigDecimal.ZERO) == 0 ) { fwDeviceEntity.setLatitude(null); fwDeviceEntity.setLongitude(null); } return saveOrUpdate(fwDeviceEntity); } }