终端运维管理优化
This commit is contained in:
@@ -846,7 +846,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
device.Name name,
|
device.Name name,
|
||||||
sub.Name substation,
|
sub.Name substation,
|
||||||
m.Time_Id updateTime,
|
device.Update_Time updateTime,
|
||||||
b.run_flag runFlag,
|
b.run_flag runFlag,
|
||||||
b.com_flag comFlag,
|
b.com_flag comFlag,
|
||||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
ifnull(g.name,'/') version,
|
ifnull(g.name,'/') version,
|
||||||
ifnull(d.flow,(select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlowMeal,
|
ifnull(d.flow,(select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlowMeal,
|
||||||
ifnull(d1.flow,0) reamFlowMeal,
|
ifnull(d1.flow,0) reamFlowMeal,
|
||||||
FORMAT(ifnull(mo.statis_value,0)/1024/1024,2) as statisValue
|
ROUND(ifnull(mo.Actual_Value,0)/1024/1024,2) statisValue
|
||||||
FROM
|
FROM
|
||||||
pq_line a
|
pq_line a
|
||||||
INNER JOIN pq_device b ON a.id = b.id
|
INNER JOIN pq_device b ON a.id = b.id
|
||||||
@@ -139,10 +139,11 @@ FROM
|
|||||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlow,
|
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlow,
|
||||||
IFNULL(d1.flow, 0) extendFlow,
|
IFNULL(d1.flow, 0) extendFlow,
|
||||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + IFNULL(d1.flow, 0) flowMeal
|
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + IFNULL(d1.flow, 0) flowMeal
|
||||||
FROM cld_dev_meal c
|
FROM pq_line device
|
||||||
|
LEFT JOIN cld_dev_meal c ON device.id = c.Line_Id
|
||||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||||
WHERE c.Line_Id = #{devId} AND d.State =1 AND d1.State =1
|
WHERE device.Id = #{devId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
||||||
|
|||||||
@@ -282,12 +282,12 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
|||||||
public List<TerminalDaliyFlowVO> getFlowManageDetail(TerminalMainQueryParam param) {
|
public List<TerminalDaliyFlowVO> getFlowManageDetail(TerminalMainQueryParam param) {
|
||||||
List<TerminalDaliyFlowVO> list = new ArrayList<>();
|
List<TerminalDaliyFlowVO> list = new ArrayList<>();
|
||||||
TerminalDaliyFlowVO flowManageDetail = terminalMaintainMapper.getFlowManageDetail(param.getDevId());
|
TerminalDaliyFlowVO flowManageDetail = terminalMaintainMapper.getFlowManageDetail(param.getDevId());
|
||||||
if (flowManageDetail ==null) {
|
// if (flowManageDetail ==null) {
|
||||||
flowManageDetail = new TerminalDaliyFlowVO();
|
// flowManageDetail = new TerminalDaliyFlowVO();
|
||||||
flowManageDetail.setBaseFlow(1024f);
|
// flowManageDetail.setBaseFlow(1024f);
|
||||||
flowManageDetail.setExtendFlow(0f);
|
// flowManageDetail.setExtendFlow(0f);
|
||||||
flowManageDetail.setFlowMeal(1024f);
|
// flowManageDetail.setFlowMeal(1024f);
|
||||||
}
|
// }
|
||||||
List<DeviceDayFlow> deviceDayFlowList = getFlowManageDetailFromInfluxDB(param);
|
List<DeviceDayFlow> deviceDayFlowList = getFlowManageDetailFromInfluxDB(param);
|
||||||
float sum = (float) deviceDayFlowList.stream().mapToDouble(DeviceDayFlow::getDailyActualValue).sum();
|
float sum = (float) deviceDayFlowList.stream().mapToDouble(DeviceDayFlow::getDailyActualValue).sum();
|
||||||
flowManageDetail.setDeviceDayFlowsList(deviceDayFlowList);
|
flowManageDetail.setDeviceDayFlowsList(deviceDayFlowList);
|
||||||
@@ -310,7 +310,7 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
|||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime()))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime()))).append("' and ");
|
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime()))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime()))).append("' and ");
|
||||||
stringBuilder.append("dev_id ='").append(param.getDevId()).append("'");
|
stringBuilder.append("dev_id ='").append(param.getDevId()).append("'");
|
||||||
String sql = "select * from " + InfluxDBPublicParam.PQS_ACTUAL_FLOW + " where " + stringBuilder.toString() + InfluxDBPublicParam.TIME_ZONE;
|
String sql = "select * from " + InfluxDBPublicParam.CLD_STATIS_FLOW + " where " + stringBuilder.toString() + InfluxDBPublicParam.TIME_ZONE;
|
||||||
QueryResult result = influxDbUtils.query(sql);
|
QueryResult result = influxDbUtils.query(sql);
|
||||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||||
List<DeviceDayFlow> deviceDayFlow = influxDBResultMapper.toPOJO(result, DeviceDayFlow.class);
|
List<DeviceDayFlow> deviceDayFlow = influxDBResultMapper.toPOJO(result, DeviceDayFlow.class);
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ import lombok.AllArgsConstructor;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.Pattern;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,6 +173,7 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
|||||||
public List<EventReportDictVO> selectReleation(String id) {
|
public List<EventReportDictVO> selectReleation(String id) {
|
||||||
List<EventReportDictVO> list = new ArrayList<>();
|
List<EventReportDictVO> list = new ArrayList<>();
|
||||||
List<String> configs = templateRelMapper.selectReleation(id);
|
List<String> configs = templateRelMapper.selectReleation(id);
|
||||||
|
configs = configs.stream().filter(t -> !isContainChinese(t)).collect(Collectors.toList());
|
||||||
configs.forEach(config -> {
|
configs.forEach(config -> {
|
||||||
EventReportDictVO eventReportDictVO = new EventReportDictVO();
|
EventReportDictVO eventReportDictVO = new EventReportDictVO();
|
||||||
eventReportDictVO.setName(config);
|
eventReportDictVO.setName(config);
|
||||||
@@ -182,6 +183,22 @@ public class EventTemplateServiceImpl extends ServiceImpl<EventTemplateMapper, E
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字符串是否包含中文
|
||||||
|
*
|
||||||
|
* @param str 待校验字符串
|
||||||
|
* @return true 包含中文字符 false 不包含中文字符
|
||||||
|
*/
|
||||||
|
public static boolean isContainChinese(String str) {
|
||||||
|
|
||||||
|
// if (StringUtils.isEmpty(str)) {
|
||||||
|
// throw new EmptyException("sms context is empty!");
|
||||||
|
// }
|
||||||
|
Pattern p = Pattern.compile("[\u4E00-\u9FA5|\\!|\\,|\\。|\\(|\\)|\\《|\\》|\\“|\\”|\\?|\\:|\\;|\\【|\\】]");
|
||||||
|
Matcher m = p.matcher(str);
|
||||||
|
return m.find();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 名称重复校验
|
* 名称重复校验
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user