|
@@ -229,14 +229,6 @@ public class WaterMeterReplaceLogServiceImpl implements WaterMeterReplaceLogServ
|
|
|
newDevice.setWaterMeterNo(waterMeterReplaceInputDto.getNewElectronicNo());
|
|
|
}
|
|
|
if (waterMeterReplaceInputDto.getNewDeviceTypeId() != null && waterMeterReplaceInputDto.getNewDeviceTypeId()!=0) {
|
|
|
- DeviceTypeDto deviceTypeDto = deviceTypeMapper.getById(waterMeterReplaceInputDto.getNewDeviceTypeId());
|
|
|
- if(!device.getDeviceType().equals(waterMeterReplaceInputDto.getNewDeviceTypeId())){
|
|
|
- if (deviceTypeDto != null && deviceTypeDto.getIsRegister() == 1) {
|
|
|
- String udipId = udipUnitService.updateUdipUnit(device.getUdipId(),waterMeterReplaceLog.getNewDeviceNo(),device.getCustomerId(),deviceTypeDto);
|
|
|
- newDevice.setUdipId(udipId);
|
|
|
- newDevice.setRegisterStatus(1);
|
|
|
- }
|
|
|
- }
|
|
|
if(device.getSysId()!=-99){
|
|
|
ChannelDeviceTypeUse use = channelDeviceTypeUseMapper.findByDeviceId(waterMeterReplaceInputDto.getNewDeviceTypeId());
|
|
|
if (use != null) {
|
|
@@ -246,10 +238,14 @@ public class WaterMeterReplaceLogServiceImpl implements WaterMeterReplaceLogServ
|
|
|
newDevice.setDeviceType(waterMeterReplaceInputDto.getNewDeviceTypeId());
|
|
|
|
|
|
}
|
|
|
- if (device.getUdipId() != null) {
|
|
|
+ if (device.getRegisterStatus() != null && device.getRegisterStatus() == 1) {
|
|
|
DeviceTypeDto deviceTypeDto = deviceTypeMapper.getById(device.getDeviceType());
|
|
|
- String udipId = udipUnitService.updateUdipUnit(device.getUdipId(),device.getDeviceNo(),device.getCustomerId(),deviceTypeDto);
|
|
|
- newDevice.setUdipId(udipId);
|
|
|
+ String udipId = udipUnitService.updateUdipUnit(device.getUdipId(),waterMeterReplaceLog.getNewDeviceNo(),device.getCustomerId(),deviceTypeDto);
|
|
|
+ if (udipId != null) {
|
|
|
+ newDevice.setUdipId(udipId);
|
|
|
+ newDevice.setRegisterStatus(1);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
newDevice.setDateUpdate(LocalDateTime.now());
|
|
|
deviceMapper.updateByPrimaryKeySelective(newDevice);
|