规则列表接口完成
This commit is contained in:
parent
64350a6f49
commit
32bcd96d79
@ -70,7 +70,8 @@ public class DryEquipmentInfoServiceImpl implements IDryEquipmentInfoService {
|
||||
@Override
|
||||
public int insertDryEquipmentInfo(DryEquipmentInfo dryEquipmentInfo) {
|
||||
paramMapper.update(new LambdaUpdateWrapper<DryParamThreshold>().eq(DryParamThreshold::getRuleCode, dryEquipmentInfo.getRuleCode())
|
||||
.set(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode()));
|
||||
.set(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode())
|
||||
.set(DryParamThreshold::getIsEnabled,"1"));
|
||||
dryEquipmentInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
dryEquipmentInfo.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -85,8 +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"));
|
||||
paramMapper.update(new LambdaUpdateWrapper<DryParamThreshold>().eq(DryParamThreshold::getRuleCode, dryEquipmentInfo.getRuleCode())
|
||||
.set(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode()));
|
||||
.set(DryParamThreshold::getEquipmentCode, dryEquipmentInfo.getEquipmentCode())
|
||||
.set(DryParamThreshold::getIsEnabled,"1"));
|
||||
dryEquipmentInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
dryEquipmentInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -150,6 +156,7 @@ public class DryEquipmentInfoServiceImpl implements IDryEquipmentInfoService {
|
||||
List<ParamThresholdDTO> result = new ArrayList<>();
|
||||
for (DryParamThreshold item : list) {
|
||||
ParamThresholdDTO param = new ParamThresholdDTO();
|
||||
param.ruleCode = item.getRuleCode();
|
||||
param.ruleName = item.getRuleName();
|
||||
result.add(param);
|
||||
}
|
||||
|
||||
@ -73,6 +73,7 @@ public class DryEquipmentScreenServiceImpl implements IDryEquipmentScreenService
|
||||
String setTem = (equipment != null && StringUtils.isNotBlank(equipment.getRuleCode()))
|
||||
? Optional.ofNullable(paramMapper.selectOne(
|
||||
new LambdaQueryWrapper<DryParamThreshold>().eq(DryParamThreshold::getRuleCode, equipment.getRuleCode())
|
||||
.eq(DryParamThreshold::getIsEnabled,"1")
|
||||
)).map(DryParamThreshold::getMaxValue).orElse(null)
|
||||
: null;
|
||||
EquipmentScreenDTO.DryingDTO dto = new EquipmentScreenDTO.DryingDTO();
|
||||
@ -132,7 +133,7 @@ public class DryEquipmentScreenServiceImpl implements IDryEquipmentScreenService
|
||||
private Map<String, List<EquipmentScreenDTO.ParamDTO>> getParamMap(List<String> equipmentCodes) {
|
||||
// 批量查询设备的所有阈值规则
|
||||
LambdaQueryWrapper<DryParamThreshold> paramWrapper = new LambdaQueryWrapper<>();
|
||||
paramWrapper.in(DryParamThreshold::getEquipmentCode, equipmentCodes);
|
||||
paramWrapper.in(DryParamThreshold::getEquipmentCode, equipmentCodes).eq(DryParamThreshold::getIsEnabled, "1");
|
||||
List<DryParamThreshold> thresholdList = paramMapper.selectList(paramWrapper);
|
||||
|
||||
// 转换为ParamDTO并按设备号分组
|
||||
@ -185,6 +186,7 @@ public class DryEquipmentScreenServiceImpl implements IDryEquipmentScreenService
|
||||
String setTem = (equipment != null && StringUtils.isNotBlank(equipment.getRuleCode()))
|
||||
? Optional.ofNullable(paramMapper.selectOne(
|
||||
new LambdaQueryWrapper<DryParamThreshold>().eq(DryParamThreshold::getRuleCode, equipment.getRuleCode())
|
||||
.eq(DryParamThreshold::getIsEnabled,"1")
|
||||
)).map(DryParamThreshold::getMaxValue).orElse(null)
|
||||
: null;
|
||||
EquipmentScreenDTO.DrynessDTO dto = new EquipmentScreenDTO.DrynessDTO();
|
||||
@ -203,7 +205,6 @@ public class DryEquipmentScreenServiceImpl implements IDryEquipmentScreenService
|
||||
String tempValue = paramData.getOrDefault("TEMP", ""); // 温度值
|
||||
String dewValue = paramData.getOrDefault("DEW", ""); // 露点值
|
||||
|
||||
// 方案1:如果DTO有单独的温度/露点字段,直接赋值(推荐)
|
||||
dto.setTempValue(tempValue);
|
||||
dto.setDewValue(dewValue);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user