合并暂降模块代码

This commit is contained in:
2022-07-14 09:43:29 +08:00
parent 014c766806
commit 638f5b8f93
56 changed files with 3133 additions and 86 deletions

View File

@@ -0,0 +1,34 @@
package com.njcn.event.utils;
import cn.hutool.core.collection.CollectionUtil;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* pqs-event
* 公共方法
* @author cdf
* @date 2022/6/30
*/
@Component
public class CommUtil {
/**
* 组装为influxdb监测点参数
*
* @param lineIds 监测点参数
* @return StringBuilder
*/
public static StringBuilder assToInfluxParam(List<String> lineIds){
StringBuilder lineIdsStr = new StringBuilder("(");
for (int i = 0; i < lineIds.size(); i++) {
if (lineIds.size() - i != 1) {
lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("' or ");
} else {
lineIdsStr.append("line_id ='").append(lineIds.get(i)).append("') ");
}
}
return lineIdsStr;
}
}