温度阈值

This commit is contained in:
杨晓东 2025-11-24 14:27:52 +08:00
parent 3533baa383
commit 7eb4a4fed8
2 changed files with 8 additions and 5 deletions

View File

@ -91,7 +91,7 @@ public class DryEquipmentInfoController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('dry:info:edit')")
@Log(title = "设备信息", businessType = BusinessType.UPDATE)
@PutMapping("/update")
@PutMapping
public AjaxResult edit(@RequestBody DryEquipmentInfo dryEquipmentInfo)
{
return toAjax(dryEquipmentInfoService.updateDryEquipmentInfo(dryEquipmentInfo));

View File

@ -86,10 +86,13 @@ public class DryEquipmentInfoServiceImpl implements IDryEquipmentInfoService {
*/
@Override
public int updateDryEquipmentInfo(DryEquipmentInfo dryEquipmentInfo) {
LambdaUpdateWrapper<DryParamThreshold> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode())
.eq(DryParamThreshold::getIsEnabled,"1");
paramMapper.update(wrapper.set(DryParamThreshold::getIsEnabled, "0"));
DryEquipmentInfo oldInfo = dryEquipmentInfoMapper.selectOne(new LambdaQueryWrapper<DryEquipmentInfo>().eq(DryEquipmentInfo::getEquipmentCode, dryEquipmentInfo.getEquipmentCode()));
if (oldInfo.getRuleCode() != null || oldInfo.getRuleCode() != " ") {
LambdaUpdateWrapper<DryParamThreshold> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode())
.eq(DryParamThreshold::getIsEnabled,"1");
paramMapper.update(wrapper.set(DryParamThreshold::getIsEnabled, "0"));
}
paramMapper.update(new LambdaUpdateWrapper<DryParamThreshold>().eq(DryParamThreshold::getRuleCode, dryEquipmentInfo.getRuleCode())
.set(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode())
.set(DryParamThreshold::getIsEnabled,"1"));