Commit d38ccc257c252e031363aef6c8fa19aff1a65692

Authored by chenzhangyue
1 parent 9a64be46

页面表单更新修复,这里update应该为查出来的DO,不是前端的DO,采用更安全的redis策略,更新DB删除缓存,查询设备的时候补充缓存

src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -544,18 +544,19 @@ public class DeviceServiceImpl implements IDeviceService { @@ -544,18 +544,19 @@ public class DeviceServiceImpl implements IDeviceService {
544 if (deviceInStore.getGeoCoordSys() != null) { 544 if (deviceInStore.getGeoCoordSys() != null) {
545 // 坐标系变化,需要重新计算GCJ02坐标和WGS84坐标 545 // 坐标系变化,需要重新计算GCJ02坐标和WGS84坐标
546 if (!deviceInStore.getGeoCoordSys().equals(device.getGeoCoordSys())) { 546 if (!deviceInStore.getGeoCoordSys().equals(device.getGeoCoordSys())) {
547 - updateDeviceChannelGeoCoordSys(device); 547 + deviceInStore.setGeoCoordSys(device.getGeoCoordSys());
  548 + updateDeviceChannelGeoCoordSys(deviceInStore);
548 } 549 }
549 }else { 550 }else {
550 - device.setGeoCoordSys("WGS84"); 551 + deviceInStore.setGeoCoordSys("WGS84");
551 } 552 }
552 if (device.getCharset() == null) { 553 if (device.getCharset() == null) {
553 - device.setCharset("GB2312"); 554 + deviceInStore.setCharset("GB2312");
554 } 555 }
555 556
556 // 更新redis 557 // 更新redis
557 - redisCatchStorage.updateDevice(device);  
558 - deviceMapper.updateCustom(device); 558 + deviceMapper.updateCustom(deviceInStore);
  559 + redisCatchStorage.removeDevice(deviceInStore.getDeviceId());
559 } 560 }
560 561
561 @Override 562 @Override