|
@@ -591,6 +591,16 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.ok(copy(DeviceInfoDto.Vo.class, list));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("根据点位ID更新坐标")
|
|
|
+ public R updateLonByPlaceId(@RequestBody @Validated DeviceInfoDto.UpdateLonByPlaceId dto) {
|
|
|
+ LambdaUpdateWrapper<DeviceInfo> luw = new LambdaUpdateWrapper<DeviceInfo>()
|
|
|
+ .eq(DeviceInfo::getPlaceId, dto.getPlaceId())
|
|
|
+ .set(DeviceInfo::getLon, dto.getLon())
|
|
|
+ .set(DeviceInfo::getLat, dto.getLat());
|
|
|
+ update(luw);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("修改")
|
|
|
@PostMapping("update")
|
|
|
public R update(@RequestBody @Validated DeviceInfoDto.Update update) {
|
|
@@ -603,6 +613,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
.setPlaceId(update.getPlaceId())
|
|
|
.setMercId(deviceInfo.getMercId());
|
|
|
mercUserBindDeviceService.bindByDeviceUpdate(bindByPlaceIdDTto);
|
|
|
+ //更新坐标为点位的坐标
|
|
|
+ MercPlaceDto.ObjVo place = mercPlaceService.obj(new MercPlaceDto.Obj().setId(update.getPlaceId())).getData();
|
|
|
+ update.setLat(place.getLat()).setLon(place.getLon());
|
|
|
}
|
|
|
DeviceInfo deviceSave = copy(DeviceInfo.class, update)
|
|
|
.setUpdateTime(LocalDateTime.now());
|