|
|
|
|
@ -5,6 +5,7 @@ import com.mh.common.core.domain.AjaxResult;
|
|
|
|
|
import com.mh.common.core.domain.entity.CollectionParamsManage; |
|
|
|
|
import com.mh.common.core.domain.entity.CommunicationParams; |
|
|
|
|
import com.mh.common.core.domain.entity.SysDictData; |
|
|
|
|
import com.mh.common.core.domain.vo.CollectionParamsManageVO; |
|
|
|
|
import com.mh.common.core.domain.vo.CollectionParamsManageVO2; |
|
|
|
|
import com.mh.common.core.domain.vo.EnergyConsumptionVO; |
|
|
|
|
import com.mh.common.core.domain.vo.EnergyQueryVO; |
|
|
|
|
@ -54,6 +55,35 @@ public class ChillersParamsController extends BaseController {
|
|
|
|
|
public TableDataInfo list(CollectionParamsManage collectionParamsManage) { |
|
|
|
|
collectionParamsManage.setIsUse(0); |
|
|
|
|
List<CollectionParamsManage> list = iCollectionParamsManageService.selectCollectionParamsManageList(collectionParamsManage); |
|
|
|
|
|
|
|
|
|
// 这里遍历collectionParamsManages,判断otherName,
|
|
|
|
|
// 如果otherName="1号主机-A回路运行电流"的curValue大于5A,则修改otherName="1号主机-机组开机关机"的curValue=1,则赋值给runStatus
|
|
|
|
|
// 如果otherName="1号主机-负载"或者otherName="1号主机-负荷限制",其curValue值乘以10
|
|
|
|
|
|
|
|
|
|
// 1. 找出"1号主机-A回路运行电流"的curValue
|
|
|
|
|
BigDecimal runningCurrentValue = list.stream() |
|
|
|
|
.filter(p -> "1号主机-A回路运行电流".equals(p.getOtherName())) |
|
|
|
|
.map(CollectionParamsManage::getCurValue) |
|
|
|
|
.findFirst() |
|
|
|
|
.orElse(null); |
|
|
|
|
|
|
|
|
|
// 如果运行电流大于5A,则设置"1号主机-运行状态"的curValue=1
|
|
|
|
|
if (runningCurrentValue != null && runningCurrentValue.compareTo(new BigDecimal("5")) > 0) { |
|
|
|
|
list.stream() |
|
|
|
|
.filter(p -> "1号主机-运行状态".equals(p.getOtherName())) |
|
|
|
|
.forEach(p -> p.setCurValue(new BigDecimal("1"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 2. "1号主机-负载" 和 "1号主机-负荷限制" 的curValue乘以10
|
|
|
|
|
list.stream() |
|
|
|
|
.filter(p -> "1号主机-负载".equals(p.getOtherName()) |
|
|
|
|
|| "1号主机-负荷限制".equals(p.getOtherName())) |
|
|
|
|
.forEach(p -> { |
|
|
|
|
if (p.getCurValue() != null) { |
|
|
|
|
p.setCurValue(p.getCurValue().multiply(new BigDecimal("10"))); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// list中的CollectionParamsManage中的other_name去掉“号主机”之前数据
|
|
|
|
|
list.forEach(item -> { |
|
|
|
|
String otherName = item.getOtherName(); |
|
|
|
|
|