|
@@ -150,10 +150,14 @@ public class DeviceQualityServiceImpl extends ServiceImpl<DeviceQualityMapper, D
|
|
|
templets.forEach(templet -> {
|
|
|
JSONObject obj = templet.getJSONObject(LambdaUtils.getProperty(DeviceQualityDto.QualityResultBack::getData));
|
|
|
String type = obj.getStr(LambdaUtils.getProperty(DeviceQualityDto.QualityResultBack::getType));
|
|
|
+ QualityEnum qualityEnum = QualityEnum.getQualityEnum(type);
|
|
|
+ if (qualityEnum == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
//修改质检
|
|
|
UpdateWrapper<DeviceQuality> updateWrapper = new UpdateWrapper<DeviceQuality>()
|
|
|
- .set(QualityEnum.getQualityEnum(type).getBeginTime(), now)
|
|
|
- .set(QualityEnum.getQualityEnum(type).getEndTime(), null)
|
|
|
+ .set(qualityEnum.getBeginTime(), now)
|
|
|
+ .set(qualityEnum.getEndTime(), null)
|
|
|
.set(StringTools.humpToLine(LambdaUtils.getProperty(DeviceQuality::getUpdateTime)), now)
|
|
|
.eq(StringTools.humpToLine(LambdaUtils.getProperty(DeviceQuality::getQualityId)), rest.getQualityId());
|
|
|
update(updateWrapper);
|
|
@@ -168,7 +172,9 @@ public class DeviceQualityServiceImpl extends ServiceImpl<DeviceQualityMapper, D
|
|
|
.setTemplet(templet);
|
|
|
commandMqtts.add(commandMqtt);
|
|
|
});
|
|
|
- mqttService.senCommand(commandMqtts);
|
|
|
+ if (commandMqtts.size() > 0) {
|
|
|
+ mqttService.senCommand(commandMqtts);
|
|
|
+ }
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
@@ -202,7 +208,11 @@ public class DeviceQualityServiceImpl extends ServiceImpl<DeviceQualityMapper, D
|
|
|
templets.forEach(templet -> {
|
|
|
JSONObject obj = templet.getJSONObject(LambdaUtils.getProperty(DeviceQualityDto.QualityResultBack::getData));
|
|
|
String type = obj.getStr(LambdaUtils.getProperty(DeviceQualityDto.QualityResultBack::getType));
|
|
|
- Reflect.PropertyReflect.setPropertyValue(deviceQuality, StringTools.toCamelCase(QualityEnum.getQualityEnum(type).getBeginTime()), now);
|
|
|
+ QualityEnum qualityEnum = QualityEnum.getQualityEnum(type);
|
|
|
+ if (qualityEnum == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Reflect.PropertyReflect.setPropertyValue(deviceQuality, StringTools.toCamelCase(qualityEnum.getBeginTime()), now);
|
|
|
});
|
|
|
}
|
|
|
List<DeviceQuality> list = deviceQualitieJMap.get(deviceQuality.getDeviceId());
|