This commit is contained in:
geting 2024-12-19 10:28:04 +08:00
commit 6290e7f527
139 changed files with 4667 additions and 2290 deletions

View File

@ -20,184 +20,184 @@
static datalen2mbaddrmap m_datalen2mbaddr_map;
static struDataLengthADSAddr m_datalen_adsaddr[] = {
{ 2,421,0.1 },
{ 2,409,0.1 },
{ 2,445,0.01 },
{ 2,659,0.001 },
{ 2,663,0.001 },
{ 2,400,1 },
{ 2,402,1 },
{ 2,404,1 },
{ 2,449,0.01 },
{ 2,425,0.1 },
{ 2,413,0.1 },
{ 2,-600,0.1 },
{ 2,655,0.1 },
{ 2,715,0.1 },
{ 2,461,0.1 },
{ 2,493,0.1 },
{ 2,-600,0.1 },
{ 2,497,0.1 },
{ 2,501,0.01 },
{ 2,433,0.01 },
{ 2,437,0.01 },
{ 2,441,0.01 },
{ 2,687,0.01 },
{ 2,691,0.01 },
{ 2,695,0.01 },
{ 2,517,0.1 },
{ 2,-600,0.1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 2,465,0.01 },
{ 2,469,0.1 },
{ 2,473,0.1 },
{ 2,477,0.1 },
{ 2,481,0.1 },
{ 2,485,0.1 },
{ 2,489,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.01 },
{ 2,-600,0.01 },
{ 2,-600,0.01 },
{ 2,457,0.001 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,675,0.1 },
{ 2,505,0.1 },
{ 2,509,0.1 },
{ 2,513,0.1 },
{ 2,2,0.1 },
{ 2,14,0.1 },
{ 2,26,0.1 },
{ 2,38,0.1 },
{ 2,50,0.1 },
{ 2,62,0.1 },
{ 2,74,0.1 },
{ 2,-600,0.1 },
{ 2,98,0.1 },
{ 2,110,0.1 },
{ 2,122,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,-600,0.1 },
{ 2,134,0.1 },
{ 2,146,0.1 },
{ 2,158,0.1 },
{ 2,170,0.1 },
{ 2,182,0.1 },
{ 2,206,0.1 },
{ 2,218,0.1 },
{ 2,230,0.1 },
{ 2,242,0.1 },
{ 2,254,0.1 },
{ 2,266,0.1 },
{ 2,521,0.001 },
{ 2,525,0.001 },
{ 4,537,1 },
{ 4,533,1 },
{ 4,545,1 },
{ 4,541,1 },
{ 4,-600,1 },
{ 4,-600,1 },
{ 2,549,1 },
{ 2,551,1 },
{ 2,553,1 },
{ 2,555,1 },
{ 2,557,1 },
{ 2,559,1 },
{ 2,561,1 },
{ 2,563,1 },
{ 2,565,1 },
{ 2,567,1 },
{ 2,569,1 },
{ 2,571,1 },
{ 2,573,1 },
{ 2,575,1 },
{ 2,577,1 },
{ 2,579,1 },
{ 2,581,1 },
{ 2,583,1 },
{ 2,585,1 },
{ 2,587,1 },
{ 2,589,1 },
{ 2,591,1 },
{ 2,593,1 },
{ 2,595,1 },
{ 2,597,1 },
{ 2,599,1 },
{ 2,601,1 },
{ 2,603,1 },
{ 2,605,1 },
{ 2,607,1 },
{ 2,609,1 },
{ 2,611,1 },
{ 2,613,1 },
{ 2,615,1 },
{ 2,617,1 },
{ 2,619,1 },
{ 2,621,1 },
{ 2,623,1 },
{ 2,625,1 },
{ 2,627,1 },
{ 2,629,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,1 },
{ 2,-600,0.1 },
{ 2,429,0.1 },
{ 2,-600,0.1 },
{ 2,417,0.1 },
{ 2,-600,0.01 },
{ 2,453,0.01 },
{ 2,683,0.01 },
{ 2,-600,0.1 },
{ 4,639,1 },
{ 4,631,1 },
{ 4,635,1 },
{ 2,643,0.01 },
{ 2,647,0.01 },
{ 2,651,0.01 },
{ 2,679,0.1 },
{ 2,703,0.001 },
{ 2,707,0.001 },
{ 2,667,0.001 },
{ 2,671,0.001 },
{ 2,194,0.1 },
{ 2,699,1 },
{ 2,10,0.1 }
{ 2, 421, 0.1 },
{ 2, 409, 0.1 },
{ 2, 445, 0.01 },
{ 2, 659, 0.001 },
{ 2, 663, 0.001 },
{ 2, 400, 1 },
{ 2, 402, 1 },
{ 2, 404, 1 },
{ 2, 449, 0.01 },
{ 2, 425, 0.1 },
{ 2, 413, 0.1 },
{ 2, -600, 0.1 },
{ 2, 655, 0.1 },
{ 2, 715, 0.1 },
{ 2, 461, 0.1 },
{ 2, 493, 0.1 },
{ 2, -600, 0.1 },
{ 2, 497, 0.1 },
{ 2, 501, 0.01 },
{ 2, 433, 0.01 },
{ 2, 437, 0.01 },
{ 2, 441, 0.01 },
{ 2, 687, 0.01 },
{ 2, 691, 0.01 },
{ 2, 695, 0.01 },
{ 2, 517, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 2, 465, 0.01 },
{ 2, 469, 0.1 },
{ 2, 473, 0.1 },
{ 2, 477, 0.1 },
{ 2, 481, 0.1 },
{ 2, 485, 0.1 },
{ 2, 489, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.01 },
{ 2, -600, 0.01 },
{ 2, -600, 0.01 },
{ 2, 457, 0.001 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, 675, 0.1 },
{ 2, 505, 0.1 },
{ 2, 509, 0.1 },
{ 2, 513, 0.1 },
{ 2, 2, 0.1 },
{ 2, 14, 0.1 },
{ 2, 26, 0.1 },
{ 2, 38, 0.1 },
{ 2, 50, 0.1 },
{ 2, 62, 0.1 },
{ 2, 74, 0.1 },
{ 2, -600, 0.1 },
{ 2, 98, 0.1 },
{ 2, 110, 0.1 },
{ 2, 122, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, -600, 0.1 },
{ 2, 134, 0.1 },
{ 2, 146, 0.1 },
{ 2, 158, 0.1 },
{ 2, 170, 0.1 },
{ 2, 182, 0.1 },
{ 2, 206, 0.1 },
{ 2, 218, 0.1 },
{ 2, 230, 0.1 },
{ 2, 242, 0.1 },
{ 2, 254, 0.1 },
{ 2, 266, 0.1 },
{ 2, 521, 0.001 },
{ 2, 525, 0.001 },
{ 4, 537, 1 },
{ 4, 533, 1 },
{ 4, 545, 1 },
{ 4, 541, 1 },
{ 4, -600, 1 },
{ 4, -600, 1 },
{ 2, 549, 1 },
{ 2, 551, 1 },
{ 2, 553, 1 },
{ 2, 555, 1 },
{ 2, 557, 1 },
{ 2, 559, 1 },
{ 2, 561, 1 },
{ 2, 563, 1 },
{ 2, 565, 1 },
{ 2, 567, 1 },
{ 2, 569, 1 },
{ 2, 571, 1 },
{ 2, 573, 1 },
{ 2, 575, 1 },
{ 2, 577, 1 },
{ 2, 579, 1 },
{ 2, 581, 1 },
{ 2, 583, 1 },
{ 2, 585, 1 },
{ 2, 587, 1 },
{ 2, 589, 1 },
{ 2, 591, 1 },
{ 2, 593, 1 },
{ 2, 595, 1 },
{ 2, 597, 1 },
{ 2, 599, 1 },
{ 2, 601, 1 },
{ 2, 603, 1 },
{ 2, 605, 1 },
{ 2, 607, 1 },
{ 2, 609, 1 },
{ 2, 611, 1 },
{ 2, 613, 1 },
{ 2, 615, 1 },
{ 2, 617, 1 },
{ 2, 619, 1 },
{ 2, 621, 1 },
{ 2, 623, 1 },
{ 2, 625, 1 },
{ 2, 627, 1 },
{ 2, 629, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 1 },
{ 2, -600, 0.1 },
{ 2, 429, 0.1 },
{ 2, -600, 0.1 },
{ 2, 417, 0.1 },
{ 2, -600, 0.01 },
{ 2, 453, 0.01 },
{ 2, 683, 0.01 },
{ 2, -600, 0.1 },
{ 4, 639, 1 },
{ 4, 631, 1 },
{ 4, 635, 1 },
{ 2, 643, 0.01 },
{ 2, 647, 0.01 },
{ 2, 651, 0.01 },
{ 2, 679, 0.1 },
{ 2, 703, 0.001 },
{ 2, 707, 0.001 },
{ 2, 667, 0.001 },
{ 2, 671, 0.001 },
{ 2, 194, 0.1 },
{ 2, 699, 1 },
{ 2, 10, 0.1 }
};
float adsGetUnitYCRealFromValue(int uid, int order, LONG value)
@ -967,7 +967,7 @@ BOOLEAN CHostADSBFProcess::OnTimer(void)
{
if (m_turbine == NULL)
{
vLog(LOG_DEBUG, "%s not connected.\n", m_pidName.c_str());
//vLog(LOG_DEBUG, "%s not connected.\n", m_pidName.c_str());
if ((m_apdu_t0_begin + 20) < system32.timers)
{
m_apdu_t0_begin = system32.timers;
@ -1014,18 +1014,6 @@ BOOLEAN CHostADSBFProcess::OnTimer(void)
return TRUE;
}
BOOLEAN CHostADSBFProcess::readDeviceState(const AdsDevice& route)
{
const auto state = route.GetState();
vLog(LOG_DEBUG, "ADS state: %d devState: %d\n", (uint16_t)state.ads, (uint16_t)state.device);
if ((uint16_t)state.ads >= ADSSTATE::ADSSTATE_MAXSTATES && (uint16_t)state.device >= ADSSTATE::ADSSTATE_MAXSTATES)
{
return FALSE;
}
return TRUE;
}
BOOLEAN CHostADSBFProcess::readFileID()
{
int uid = GetCurUnitID();

View File

@ -88,7 +88,6 @@ public:
private:
BOOLEAN calc(void);
BOOLEAN readDeviceState(const AdsDevice& route);
BOOLEAN readRealData(void);
BOOLEAN readFileID(void);
};

View File

@ -124,7 +124,6 @@ Socket::Socket(const struct addrinfo* const host, const int type) :
if (INVALID_SOCKET == m_Socket) {
continue;
}
if (SOCK_STREAM == type) {
if (::connect(m_Socket, rp->ai_addr, rp->ai_addrlen)) {
LOG_WARN("Socket connect["<<std::string(inet_ntoa(reinterpret_cast<sockaddr_in*>(rp->ai_addr)->sin_addr)) << "] timeout");
@ -155,7 +154,7 @@ Socket::Socket(const struct addrinfo* const host, const int type) :
Socket::~Socket()
{
Shutdown();
closesocket(m_Socket);
// closesocket(m_Socket);
if (m_WSAInitialized) {
WSACleanup();
@ -182,6 +181,7 @@ void Socket::Shutdown()
if(IsValid())
{
shutdown(m_Socket, SHUT_RDWR);
closesocket(m_Socket);
m_Socket = INVALID_SOCKET;
m_Connected = false;
}
@ -243,6 +243,7 @@ bool Socket::Select(timeval* timeout)
FD_ZERO(&readSockets);
FD_SET(m_Socket, &readSockets);
if (!IsValid()) return false;
/* wait for receive data */
const int state = NATIVE_SELECT(m_Socket + 1, &readSockets, nullptr, nullptr, timeout);
if (0 == state) {

View File

@ -4,6 +4,7 @@ import com.das.common.result.R;
import com.das.common.utils.JsonUtils;
import com.das.modules.data.domain.SnapshotValueQueryParam;
import com.das.modules.data.domain.TSValueQueryParam;
import com.das.modules.data.domain.WindowValueQueryParam;
import com.das.modules.data.service.DataService;
import com.das.modules.data.service.impl.DataServiceImpl;
import jakarta.validation.Valid;
@ -53,4 +54,17 @@ public class DataController {
}
return R.success(dataService.queryTimeSeriesValues(param));
}
/**
* 区间聚合函数
* @param param 查询条件
* @return TD数据库数据
*/
@PostMapping("/windows")
public R<Map<String, Map<String, Map<String, Object>>>> queryWindowsValues(@RequestBody @Valid WindowValueQueryParam param) {
if (log.isDebugEnabled()){
log.debug("/api/rtdbsvr/timeseries is calling");
}
return R.success(dataService.queryWindowsValues(param));
}
}

View File

@ -0,0 +1,34 @@
package com.das.modules.data.domain;
import lombok.Data;
import java.util.List;
/**
* 时序数据查询实体
*/
@Data
public class WindowValueQueryParam
{
/**
* 开始时间
*/
private String startTime;
/**
* 结束时间
*/
private String endTime;
/**
* 间隔
*/
private String interval;
/**
* 设备属性列表
*/
private List<SnapshotValueQueryParam> devices;
private String calFunction;
}

View File

@ -2,6 +2,7 @@ package com.das.modules.data.service;
import com.das.modules.data.domain.SnapshotValueQueryParam;
import com.das.modules.data.domain.TSValueQueryParam;
import com.das.modules.data.domain.WindowValueQueryParam;
import com.das.modules.node.domain.bo.CalculateRTData;
import java.util.List;
@ -13,6 +14,8 @@ public interface DataService {
Map<String, Map<String, Map<String, Object>>> queryTimeSeriesValues(TSValueQueryParam param);
Map<String, Map<String, Map<String, Object>>> queryWindowsValues(WindowValueQueryParam param);
void createTdStable();
void updateCalFieldData(List<CalculateRTData> values);

View File

@ -506,6 +506,188 @@ public class TDEngineService {
return result;
}
public Map<String, Map<String, Map<String, Object>>> fetchHighWindowsCurve(Long irn, Date startTime, Date endTime, String interval, List<String> fieldList,String calFunction) {
String tbName = String.format("h%d", irn);
Date now = new Date();
if (endTime.after(now)) {
endTime = now;
}
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>();
Map<String, Map<String, Object>> valueMap = new HashMap<>();
for (String item : fieldList) {
Map<String, Object> timeValueMap = new HashMap<>();
List<Long> times = new ArrayList<>();
List<Object> objects = new ArrayList<>();
timeValueMap.put("times", times);
timeValueMap.put("values", objects);
valueMap.put(item, timeValueMap);
}
StringBuffer sb = new StringBuffer(2048);
if (!(StrUtil.isNotBlank(interval) && interval.equals("NONE"))) {
String intervalStr = convertInterval(interval);
sb.append("select _WSTART, _WEND");
fieldList.forEach(field ->
sb.append(" ,").append(calFunction).append("(").append(field).append(") ").append("as ").append(field)
);
sb.append(" from ");
sb.append(tbName);
sb.append(" where ");
sb.append(String.format(" updatetime >= %d and updatetime < %d ", startTime.getTime(), endTime.getTime()));
sb.append(String.format(" INTERVAL(%s)", intervalStr));
sb.append(String.format(" FILL(%s)", "NONE"));
}
log.debug(sb.toString());
try (Connection conn = hikariDataSource.getConnection();
Statement smt = conn.createStatement();
ResultSet rs = smt.executeQuery(sb.toString())) {
while (rs.next()) {
for (int i = 0; i < fieldList.size(); i++) {
if (valueMap.get(fieldList.get(i)) == null) {
Map<String, Object> map = new HashMap<>();
List<Long> timeList = new ArrayList<>();
timeList.add(rs.getTimestamp(1).getTime());
List<Object> valueList = new ArrayList<>();
valueList.add(rs.getObject(fieldList.get(i).toLowerCase()));
map.put("times", timeList);
map.put("values", valueList);
valueMap.put(fieldList.get(i), map);
} else {
Map<String, Object> map = valueMap.get(fieldList.get(i));
List<Long> times = (List<Long>) map.get("times");
List<Object> values = (List<Object>) map.get("values");
times.add(rs.getTimestamp(1).getTime());
values.add(rs.getObject(fieldList.get(i).toLowerCase()));
}
}
}
result.put(irn.toString(), valueMap);
} catch (Exception e) {
log.error("获取数据异常", e);
return result;
}
return result;
}
public Map<String, Map<String, Map<String, Object>>> fetchLowWindowsCurve(Long irn, Date startTime, Date endTime, String interval, List<String> fieldList,String calFunction) {
String tbName = String.format("l%d", irn);
Date now = new Date();
if (endTime.after(now)) {
endTime = now;
}
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>();
Map<String, Map<String, Object>> valueMap = new HashMap<>();
for (String item : fieldList) {
Map<String, Object> timeValueMap = new HashMap<>();
List<Long> times = new ArrayList<>();
List<Object> objects = new ArrayList<>();
timeValueMap.put("times", times);
timeValueMap.put("values", objects);
valueMap.put(item, timeValueMap);
}
StringBuffer sb = new StringBuffer(2048);
if (!(StrUtil.isNotBlank(interval) && interval.equals("NONE"))) {
String intervalStr = convertInterval(interval);
sb.append("select _WSTART, _WEND");
fieldList.forEach(field ->
sb.append(" ,").append(calFunction).append("(").append(field).append(") ").append("as ").append(field)
);
sb.append(" from ");
sb.append(tbName);
sb.append(" where ");
sb.append(String.format(" updatetime >= %d and updatetime < %d ", startTime.getTime(), endTime.getTime()));
sb.append(String.format(" INTERVAL(%s)", intervalStr));
sb.append(String.format(" FILL(%s)", "NONE"));
}
log.debug(sb.toString());
try (Connection conn = hikariDataSource.getConnection();
Statement smt = conn.createStatement();
ResultSet rs = smt.executeQuery(sb.toString())) {
while (rs.next()) {
for (int i = 0; i < fieldList.size(); i++) {
if (valueMap.get(fieldList.get(i)) == null) {
Map<String, Object> map = new HashMap<>();
List<Long> timeList = new ArrayList<>();
timeList.add(rs.getTimestamp(1).getTime());
List<Object> valueList = new ArrayList<>();
valueList.add(rs.getObject(fieldList.get(i).toLowerCase()));
map.put("times", timeList);
map.put("values", valueList);
valueMap.put(fieldList.get(i), map);
} else {
Map<String, Object> map = valueMap.get(fieldList.get(i));
List<Long> times = (List<Long>) map.get("times");
List<Object> values = (List<Object>) map.get("values");
times.add(rs.getTimestamp(1).getTime());
values.add(rs.getObject(fieldList.get(i).toLowerCase()));
}
}
}
result.put(irn.toString(), valueMap);
} catch (Exception e) {
log.error("获取数据异常", e);
return result;
}
return result;
}
public Map<String, Map<String, Map<String, Object>>> fetchCalWindowsCurve(Long irn, Date startTime, Date endTime, String interval, String calFieldCode,String calFunction) {
Date now = new Date();
if (endTime.after(now)) {
endTime = now;
}
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>();
Map<String, Map<String, Object>> valueMap = new HashMap<>();
Map<String, Object> timeValueMap = new HashMap<>();
List<Long> times = new ArrayList<>();
List<Object> objects = new ArrayList<>();
timeValueMap.put("times", times);
timeValueMap.put("values", objects);
valueMap.put(calFieldCode, timeValueMap);
StringBuffer sb = new StringBuffer(2048);
if (!(StrUtil.isNotBlank(interval) && interval.equals("NONE"))) {
sb.append("select _WSTART, _WEND,");
sb.append(calFunction).append("(datavalue) as datavalue");
sb.append(" from c_");
sb.append(irn).append("_").append(calFieldCode);
sb.append(" where ");
sb.append(String.format(" updatetime >= %d and updatetime < %d ", startTime.getTime(), endTime.getTime()));
sb.append(String.format(" INTERVAL(%s)", interval));
sb.append(String.format(" FILL(%s)", "NONE"));
}
log.debug(sb.toString());
try (Connection conn = hikariDataSource.getConnection();
Statement smt = conn.createStatement();
ResultSet rs = smt.executeQuery(sb.toString())) {
while (rs.next()) {
if (valueMap.get(calFieldCode) == null) {
Map<String, Object> map = new HashMap<>();
List<Long> timeList = new ArrayList<>();
timeList.add(rs.getTimestamp(1).getTime());
List<Object> valueList = new ArrayList<>();
valueList.add(rs.getObject("datavalue"));
map.put("times", timeList);
map.put("values", valueList);
valueMap.put(calFieldCode, map);
} else {
Map<String, Object> map = valueMap.get(calFieldCode);
List<Long> timeList = (List<Long>) map.get("times");
List<Object> values = (List<Object>) map.get("values");
timeList.add(rs.getTimestamp(1).getTime());
values.add(rs.getObject("datavalue"));
}
}
result.put(irn.toString(), valueMap);
} catch (Exception e) {
log.error("获取数据异常", e);
return result;
}
return result;
}
public Map<String, Map<String, Map<String, Object>>> fetchLowHistoryCurve(Long irn, Date startTime, Date endTime, String interval, List<String> fieldList) {
SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String tbName = String.format("l%d", irn);
@ -614,7 +796,6 @@ public class TDEngineService {
sb.append(" order by updatetime");
} else {
sb.append("select updatetime, datavalue");
sb.append(" from ");
sb.append(" from c_");
sb.append(irn).append("_").append(calFieldCode);
sb.append(" where ");

View File

@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import com.das.common.exceptions.ServiceException;
import com.das.common.utils.AdminRedisTemplate;
import com.das.common.utils.StringUtils;
import com.das.modules.cache.domain.DeviceInfoCache;
import com.das.modules.cache.service.CacheService;
import com.das.modules.data.domain.SnapshotValueQueryParam;
import com.das.modules.data.domain.TSValueQueryParam;
import com.das.modules.data.domain.WindowValueQueryParam;
import com.das.modules.data.service.DataService;
import com.das.modules.data.service.TDEngineService;
import com.das.modules.equipment.domain.vo.IotModelFieldVo;
@ -151,6 +153,27 @@ public class DataServiceImpl implements DataService {
return result;
}
@Override
public Map<String, Map<String, Map<String, Object>>> queryWindowsValues(WindowValueQueryParam param) {
Long start = System.currentTimeMillis();
if (CollectionUtil.isEmpty(param.getDevices()) || (param.getStartTime() == null && param.getEndTime() == null && param.getCalFunction() == null)) {
throw new ServiceException("必要参数缺失");
}
Date startTime = new Date(Long.parseLong(param.getStartTime()));
Date endTime = new Date(Long.parseLong(param.getEndTime()));
String windowType = param.getCalFunction();
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>(param.getDevices().size());
List<SnapshotValueQueryParam> deviceFieldList = param.getDevices();
for (SnapshotValueQueryParam item : deviceFieldList) {
//field分为高频和低频查询
Map<String, Map<String, Map<String, Object>>> values = queryWindowsCurveValues(Long.valueOf(item.getDeviceId()), startTime, endTime, param.getInterval(), item.getAttributes(),windowType);
result.putAll(values);
}
Long end = System.currentTimeMillis();
log.debug("读取快照{}个,耗时: {}秒", param.getDevices().size(), (end-start)/ 1000.0);
return result;
}
private Map<String, Map<String, Map<String, Object>>> queryHistoryCurveValues(Long irn, Date startTime, Date endTime, String interval, String fill, List<String> attributes) {
StopWatch stopWatch = new StopWatch();
stopWatch.start("prepare resources");
@ -208,6 +231,67 @@ public class DataServiceImpl implements DataService {
return result;
}
private Map<String, Map<String, Map<String, Object>>> queryWindowsCurveValues(Long irn, Date startTime, Date endTime, String interval, List<String> attributes,String windowType) {
StopWatch stopWatch = new StopWatch();
stopWatch.start("prepare resources");
String function = mappingFunction(windowType);
if (StringUtils.isEmpty(function)){
throw new ServiceException("计算方法参数不正确,请检查参数");
}
String iotModelCode = sysIotModelFieldMapper.queryModelCodeByDeviceId(irn);
Map<String, Object> highSpeedFieldMap = highIotFieldMap.get(iotModelCode);
Map<String, Object> lowSpeedFieldMap = lowIotFieldMap.get(iotModelCode);
Map<String, String> calFieldMap = calculateIotFieldMap.get(iotModelCode);
List<String> highSpeedField = new ArrayList<>();
List<String> lowSpeedField = new ArrayList<>();
List<String> calField = new ArrayList<>();
for (String field : attributes) {
if (highSpeedFieldMap.containsKey(field)) {
highSpeedField.add(field);
}
if (lowSpeedFieldMap.containsKey(field)) {
lowSpeedField.add(field);
}
if (calFieldMap.containsKey(field)){
calField.add(field);
}
}
stopWatch.stop();
stopWatch.start("HighSpeedValues");
Map<String, Map<String, Map<String, Object>>> result = new HashMap<>();
if (!CollectionUtils.isEmpty(highSpeedField)) {
Map<String, Map<String, Map<String, Object>>> highHistoryCurve = tdEngineService.fetchHighWindowsCurve(irn, startTime, endTime, interval, highSpeedField,function);
result.putAll(highHistoryCurve);
}
stopWatch.stop();
stopWatch.start("LowSpeedValues");
if (!CollectionUtils.isEmpty(lowSpeedField)) {
Map<String, Map<String, Map<String, Object>>> lowHistoryCurve = tdEngineService.fetchLowWindowsCurve(irn, startTime, endTime, interval, lowSpeedField,function);
if (result.get(irn.toString()) == null) {
result.putAll(lowHistoryCurve);
} else {
result.get(irn.toString()).putAll(lowHistoryCurve.get(irn.toString()));
}
}
stopWatch.stop();
stopWatch.start("CalculateValues");
if (!CollectionUtils.isEmpty(calField)){
ListUtil.page(calField,COMMIT_COUNT,list -> {
for (String item : list){
Map<String, Map<String, Map<String, Object>>> calHistoryCurve = tdEngineService.fetchCalWindowsCurve(irn, startTime, endTime, interval, item,function);
if (result.get(irn.toString()) == null) {
result.putAll(calHistoryCurve);
} else {
result.get(irn.toString()).putAll(calHistoryCurve.get(irn.toString()));
}
}
});
}
stopWatch.stop();
log.debug("查询历史数据耗时: {}", stopWatch.prettyPrint());
return result;
}
@Override
public void updateCalFieldData(List<CalculateRTData> calValues) {
//更新数据至redis,TD
@ -320,4 +404,13 @@ public class DataServiceImpl implements DataService {
}
return tdEngineService.getTimeAvgValue(tableName, attr.toLowerCase(), startTime, endTime);
}
private String mappingFunction(String calFunction){
return switch (calFunction) {
case "average" -> "AVG";
case "max" -> "MAX";
case "min" -> "MIN";
default -> "";
};
}
}

View File

@ -251,8 +251,12 @@ public class SysIotModelController {
/** 物模型属性修改 */
@PostMapping("/attribute/getAllSubsystem")
public R<List<String>> getAllSubsystem() {
List<String> allSubsystem = sysIotModelService.getAllSubsystem();
public R<List<String>> getAllSubsystem(@RequestBody SysIotModelFieldDto sysIotModelFieldDto) {
Long iotModelId = sysIotModelFieldDto.getIotModelId();
if (iotModelId == null){
throw new ServiceException("参数物模型id不存在");
}
List<String> allSubsystem = sysIotModelService.getAllSubsystem(iotModelId);
return R.success(allSubsystem);
}
}

View File

@ -33,6 +33,6 @@ public interface SysIotModelFieldMapper extends BaseMapperPlus<SysIotModelField,
*/
List<SysIotModelFieldVo> selectModelFieldListByModelId(@Param("modelId") Long modelId);
List<String> getAllSubsystem();
List<String> getAllSubsystem(@Param("modelId") Long iotModelId);
}

View File

@ -47,6 +47,6 @@ public interface SysIotModelService {
List<SysIotModelVo> getSysIotModelByType(Integer objectType);
List<String> getAllSubsystem();
List<String> getAllSubsystem(Long iotModelId);
}

View File

@ -146,10 +146,13 @@ public class SysIotModelServiceImpl implements SysIotModelService {
@Override
public PageDataInfo<SysIotModelFieldVo> querySysIotModelField(SysIotModelFieldDto sysIotModelFieldDto) {
PageQuery pageQuery = new PageQuery();
pageQuery.setPageNum(sysIotModelFieldDto.getPageNum());
pageQuery.setPageSize(sysIotModelFieldDto.getPageSize());
log.info("查询物模型属性参数:{}",sysIotModelFieldDto);
IPage<SysIotModelFieldVo> iPage = sysIotModelFieldMapper.querySysIotModelFieldList(pageQuery.build(), sysIotModelFieldDto);
log.info("查询物模型属性返回总数{}:{}",iPage.getTotal(),iPage.getRecords());
return PageDataInfo.build(iPage.getRecords(), iPage.getTotal());
}
@ -545,8 +548,8 @@ public class SysIotModelServiceImpl implements SysIotModelService {
}
@Override
public List<String> getAllSubsystem() {
return sysIotModelFieldMapper.getAllSubsystem();
public List<String> getAllSubsystem(Long iotModelId) {
return sysIotModelFieldMapper.getAllSubsystem(iotModelId);
}
public void createTdStableOrColumn(SysIotModelField sysIotModelField) {

View File

@ -51,13 +51,13 @@ public class FaultRecorderController {
String code = jsonObject.getString("deviceCode");
String startTime = jsonObject.getString("startTime");
String endTime = jsonObject.getString("endTime");
List<FileNode> result = faultRecorderService.getDirOrFileList("Statuscode",code,startTime,endTime);
List<FileNode> result = faultRecorderService.getDirOrFileList("Tracelog",code,startTime,endTime);
return R.success(result);
}
@RequestMapping(value = "/parseData", method = RequestMethod.POST)
public R<Map<String, List<Object>>> parseData(@RequestBody JSONObject jsonObject) throws IOException {
Map<String, List<Object>> dataCurve = faultRecorderService.getDataCurve(jsonObject.getString("url"), jsonObject.getString("deviceCode"));
public R<Map<String, Object>> parseData(@RequestBody JSONObject jsonObject) throws IOException {
Map<String, Object> dataCurve = faultRecorderService.getDataCurve(jsonObject.getString("url"), jsonObject.getString("deviceCode"));
return R.success(dataCurve);
}

View File

@ -19,7 +19,7 @@ public interface FaultRecorderService {
void download(String path, HttpServletResponse httpServletResponse) throws IOException;
Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException;
Map<String, Object> getDataCurve(String url, String deviceCode);
void updateFdrConfig(SysEquipment sysEquipment);

View File

@ -168,9 +168,8 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
}
@Override
public Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException {
Map<String, List<Object>> resultMap = null;
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
public Map<String, Object> getDataCurve(String url, String deviceCode) {
Map<String, Object> resultMap = null;
//根据device Code查询故障录波格式
QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CODE", deviceCode);
@ -187,11 +186,13 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
if (fdrFormatVo == null){
throw new ServiceException("请添加故障录波配置");
}
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
// 解析文件内容
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
} catch (Exception e) {
e.printStackTrace();
log.error("文件解析异常:{}",e);
throw new ServiceException("文件解析异常,请检查配置");
}
return resultMap;
}
@ -210,15 +211,20 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
sysEquipmentMapper.updateById(sysEquipment);
}
public Map<String, List<Object>> parseFile(InputStream inputStream, String timeFormat, String delimiter, int validStartLine) {
public Map<String, Object> parseFile(InputStream inputStream, String timeFormat, String delimiter, int validStartLine) {
List<List<String>> result = new ArrayList<>();
Map<String, List<Object>> stringListMap = null;
Map<String, Object> stringListMap = null;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String line;
int lineNumber = 0;
while ((line = reader.readLine()) != null) {
lineNumber++;
if (lineNumber == 2){
List<String> lineData = Arrays.stream(line.split(":")).toList();
result.add(lineData);
}
// 忽略有效行之前的行
if (lineNumber < validStartLine) {
continue;
@ -230,23 +236,34 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
stringListMap = parseDataCurve(result, timeFormat);
} catch (Exception e) {
log.error("文件解析失败{}", e);
throw new ServiceException("文件解析失败");
}
return stringListMap;
}
public Map<String, List<Object>> parseDataCurve(List<List<String>> data, String timeFormat) throws ParseException {
public Map<String, Object> parseDataCurve(List<List<String>> data, String timeFormat) throws ParseException {
List<String> faultTimeList = data.get(0);
Long faultTime = null;
try {
faultTime = convertToTimestamp(faultTimeList.get(1).trim(), timeFormat);
} catch (Exception e) {
log.error("faultTime转换失败");
}
Map<String, Object> result = new HashMap<>();
result.put("faultTime", faultTime);
data.remove(0);
List<String> listField = data.get(0);
Map<String, List<Object>> map = new HashMap<>();
data.remove(0);
for (List<String> item : data) {
for (int i = 0; i < item.size(); i++) {
if (map.get(listField.get(i)) == null) {
if (i == 0){
if (i == 0) {
List<Object> timeList = new ArrayList<>();
long timestamp = convertToTimestamp(item.get(i), timeFormat);
timeList.add(timestamp);
map.put(listField.get(i),timeList);
}else {
map.put(listField.get(i), timeList);
} else {
List<Object> valueList = new ArrayList<>();
valueList.add(Double.valueOf(item.get(i)));
map.put(listField.get(i), valueList);
@ -254,18 +271,18 @@ public class FaultRecorderServiceImpl implements FaultRecorderService {
} else {
List<Object> valueList = map.get(listField.get(i));
if (i == 0){
valueList.add(convertToTimestamp(item.get(i),timeFormat));
if (i == 0) {
valueList.add(convertToTimestamp(item.get(i), timeFormat));
}
else {
} else {
valueList.add(Double.valueOf(item.get(i)));
}
}
}
}
return map;
result.put("dataCurve",map);
return result;
}
public long convertToTimestamp(String time, String pattern) throws ParseException {

View File

@ -0,0 +1,53 @@
package com.das.modules.page.controller;
import com.das.common.exceptions.ServiceException;
import com.das.common.result.R;
import com.das.modules.page.domian.dto.SysHomeParamSetDto;
import com.das.modules.page.domian.vo.SysHomeParamSetVo;
import com.das.modules.page.service.HomeParamSetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 首页参数设置 相关Controller
*/
@Slf4j
@RequestMapping("/api/page/home/set")
@RestController
public class HomeParamSetController {
@Autowired
private HomeParamSetService homeParamSetService;
/** 新增系统参数设置页面 */
@PostMapping("/add")
public R<SysHomeParamSetVo> add(@RequestBody SysHomeParamSetDto sysHomeParamSetDto) {
SysHomeParamSetVo sysHomeParamSetVo = homeParamSetService.add(sysHomeParamSetDto);
return R.success(sysHomeParamSetVo);
}
/** 获取系统参数设置页面 */
@PostMapping("/getList")
public R<List<SysHomeParamSetVo>> getList(@RequestBody SysHomeParamSetDto sysHomeParamSetDto) {
List<SysHomeParamSetVo> list = homeParamSetService.getList(sysHomeParamSetDto);
return R.success(list);
}
/** 更新系统参数设置页面 */
@PostMapping("/update")
public R<SysHomeParamSetVo> update(@RequestBody SysHomeParamSetDto sysHomeParamSetDto) {
if (sysHomeParamSetDto.getId() == null) {
throw new ServiceException("id不能为空");
}
SysHomeParamSetVo sysHomeParamSetVo = homeParamSetService.update(sysHomeParamSetDto);
return R.success(sysHomeParamSetVo);
}
}

View File

@ -0,0 +1,18 @@
package com.das.modules.page.domian.dto;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
@Data
public class SysHomeParamSetDto {
private Long id;
private String paramName;
private String paramValue;
private JSONArray paramValueJson;
private String paramDesc;
}

View File

@ -0,0 +1,18 @@
package com.das.modules.page.domian.vo;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
@Data
public class SysHomeParamSetVo {
private Long id;
private String paramName;
private String paramValue;
private JSONArray paramValueJson;
private String paramDesc;
}

View File

@ -0,0 +1,32 @@
package com.das.modules.page.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.das.common.constant.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serial;
@Data
@TableName("sys_home_param_set")
public class SysHomeParamSet extends BaseEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(value = "id", type = IdType.ASSIGN_ID)
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
private String paramName;
private String paramValue;
private String paramDesc;
}

View File

@ -0,0 +1,16 @@
package com.das.modules.page.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.das.modules.page.domian.dto.SysHomeParamSetDto;
import com.das.modules.page.domian.vo.SysHomeParamSetVo;
import com.das.modules.page.entity.SysHomeParamSet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface SysHomeParamSetMapper extends BaseMapper<SysHomeParamSet> {
List<SysHomeParamSetVo> getList(@Param("info") SysHomeParamSetDto sysHomeParamSetDto);
}

View File

@ -0,0 +1,15 @@
package com.das.modules.page.service;
import com.das.modules.page.domian.dto.SysHomeParamSetDto;
import com.das.modules.page.domian.vo.SysHomeParamSetVo;
import java.util.List;
public interface HomeParamSetService {
SysHomeParamSetVo add(SysHomeParamSetDto sysHomeParamSetDto);
List<SysHomeParamSetVo> getList(SysHomeParamSetDto sysHomeParamSetDto);
SysHomeParamSetVo update(SysHomeParamSetDto sysHomeParamSetDto);
}

View File

@ -0,0 +1,69 @@
package com.das.modules.page.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson.JSONArray;
import com.das.common.config.SessionUtil;
import com.das.common.utils.BeanCopyUtils;
import com.das.modules.auth.domain.vo.SysUserVo;
import com.das.modules.page.domian.dto.SysHomeParamSetDto;
import com.das.modules.page.domian.vo.SysHomeParamSetVo;
import com.das.modules.page.entity.SysHomeParamSet;
import com.das.modules.page.mapper.SysHomeParamSetMapper;
import com.das.modules.page.service.HomeParamSetService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class HomeParamSetServiceImpl implements HomeParamSetService {
@Autowired
private SysHomeParamSetMapper sysHomeParamSetMapper;
@Override
public SysHomeParamSetVo add(SysHomeParamSetDto sysHomeParamSetDto) {
SysHomeParamSet sysHomeParamSet = new SysHomeParamSet();
BeanCopyUtils.copy(sysHomeParamSetDto, sysHomeParamSet);
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
sysHomeParamSet.setCreatedBy(sysUserVo.getAccount());
sysHomeParamSet.setUpdatedBy(sysUserVo.getAccount());
sysHomeParamSet.setCreatedTime(new Date());
sysHomeParamSet.setUpdatedTime(new Date());
sysHomeParamSet.setRevision(1);
if (sysHomeParamSetDto.getParamValueJson() !=null){
sysHomeParamSet.setParamValue(sysHomeParamSetDto.getParamValueJson().toString());
}
sysHomeParamSetMapper.insert(sysHomeParamSet);
SysHomeParamSetVo sysHomeParamSetVo = new SysHomeParamSetVo();
BeanCopyUtils.copy(sysHomeParamSet, sysHomeParamSetVo);
return sysHomeParamSetVo;
}
@Override
public List<SysHomeParamSetVo> getList(SysHomeParamSetDto sysHomeParamSetDto) {
List<SysHomeParamSetVo> list = sysHomeParamSetMapper.getList(sysHomeParamSetDto);
for (SysHomeParamSetVo sysHomeParamSetVo : list) {
if (StringUtils.isNotBlank(sysHomeParamSetVo.getParamValue())){
JSONArray json = JSONArray.parseArray(sysHomeParamSetVo.getParamValue());
sysHomeParamSetVo.setParamValueJson(json);
}
}
return list;
}
@Override
public SysHomeParamSetVo update(SysHomeParamSetDto sysHomeParamSetDto) {
SysHomeParamSet sysHomeParamSet = new SysHomeParamSet();
BeanCopyUtils.copy(sysHomeParamSetDto, sysHomeParamSet);
if (sysHomeParamSetDto.getParamValueJson() !=null){
sysHomeParamSet.setParamValue(sysHomeParamSetDto.getParamValueJson().toString());
}
sysHomeParamSetMapper.updateById(sysHomeParamSet);
SysHomeParamSetVo sysHomeParamSetVo = new SysHomeParamSetVo();
SysHomeParamSetVo result = BeanCopyUtils.copy(sysHomeParamSet, sysHomeParamSetVo);
return result;
}
}

View File

@ -44,7 +44,7 @@ public class PlcLogsController {
String code = jsonObject.getString("deviceCode");
String startTime = jsonObject.getString("startTime");
String endTime = jsonObject.getString("endTime");
List<FileNode> result = plcLogService.getDirOrFileList("Tracelog",code,startTime,endTime);
List<FileNode> result = plcLogService.getDirOrFileList("Statuscode",code,startTime,endTime);
return R.success(result);
}

View File

@ -14,7 +14,7 @@ public interface PlcLogService {
List<FileNode> getDirOrFileList(String fileType, String name, String startTime, String endTime);
Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException;
Map<String, List<Object>> getDataCurve(String url, String deviceCode);
void updatePlcConfig(SysEquipment sysEquipment);

View File

@ -63,9 +63,8 @@ public class PlcLogsServiceImpl implements PlcLogService {
}
@Override
public Map<String, List<Object>> getDataCurve(String url, String deviceCode) throws IOException {
public Map<String, List<Object>> getDataCurve(String url, String deviceCode){
Map<String, List<Object>> resultMap = null;
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
//根据device Code查询故障录波格式
QueryWrapper<SysEquipment> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("CODE", deviceCode);
@ -82,11 +81,13 @@ public class PlcLogsServiceImpl implements PlcLogService {
if (fdrFormatVo == null){
throw new ServiceException("请添加plclog配置");
}
try (InputStream fileStream = minioViewsServcie.getFileStream(url)) {
// 解析文件内容
resultMap = parseFile(fileStream, fdrFormatVo.getTimeFormat(), fdrFormatVo.getDelimiter(), fdrFormatVo.getValidStartLine());
} catch (Exception e) {
e.printStackTrace();
log.error("文件解析异常:{}",e);
throw new ServiceException("文件解析异常,请检查配置");
}
return resultMap;
}
@ -162,6 +163,7 @@ public class PlcLogsServiceImpl implements PlcLogService {
stringListMap = parseDataCurve(result, timeFormat);
} catch (Exception e) {
log.error("文件解析失败{}", e);
throw new ServiceException("文件解析失败");
}
return stringListMap;
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.das.modules.page.mapper.SysHomeParamSetMapper">
<select id="getList" resultType="com.das.modules.page.domian.vo.SysHomeParamSetVo">
SELECT
*
FROM
sys_home_param_set
<where>
<if test="info.paramName != null and info.paramName != ''">
AND param_name = #{info.paramName}
</if>
</where>
</select>
</mapper>

View File

@ -31,7 +31,7 @@
<if test="info.subSystem != null and info.subSystem != ''">
and t.subsystem = #{info.subSystem}
</if>
<if test="info.subSystem != null and info.subSystem != ''">
<if test="info.confidential != null and info.confidential != ''">
and t.confidential = #{info.confidential}
</if>
</where>
@ -65,6 +65,6 @@
select * from sys_iot_model_field where iot_model_id = #{modelId} order by porder
</select>
<select id="getAllSubsystem" resultType="java.lang.String">
select distinct simf.subsystem from sys_iot_model_field simf
select distinct simf.subsystem from sys_iot_model_field simf where simf.iot_model_id = #{modelId}
</select>
</mapper>

View File

@ -0,0 +1,18 @@
import createAxios from '/@/utils/axios'
export function getParamList(params: object = {}) {
return createAxios({
url: '/api/page/home/set/getList',
method: 'POST',
data: params,
})
}
export function Paramupdate(params: object = {}) {
return createAxios({
url: '/api/page/home/set/update',
method: 'POST',
data: params,
})
}

View File

@ -179,3 +179,11 @@ export function queryfaultCodeDict(params: object = {}) {
showErrorMessage: false
})
}
export function getAllSubSystemReq(params: { iotModelId: string }) {
return createAxios({
url: '/api/equipment/model/attribute/getAllSubsystem',
method: 'post',
data: params
})
}

View File

@ -35,6 +35,9 @@ export const previewFileReq = (data: {
method: 'post',
data,
timeout: 60 * 1000
},
{
showErrorMessage: false
})
}

View File

@ -36,6 +36,8 @@ export const previewFileReq = (data: {
method: 'post',
data,
timeout: 60 * 1000
}, {
showErrorMessage: false
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Some files were not shown because too many files have changed in this diff Show More