Compare commits

...

29 Commits
main ... dev

Author SHA1 Message Date
huangfeng ba5d244533 fix: 修正sf6气体pressure为空出错,导致每日汇总任务中断,后续任务都没做无数据的问题 5 days ago
huangfeng b8c7a68c13 feat: 增加最高温度位置 1 month ago
huangfeng ff491e539f perf: 增加告警温度位置 2 months ago
huangfeng 0e143215e4 perf: 增加测温保存最高温度和最低温度 2 months ago
huangfeng 083c4ec602 fix: 修正电缆趋势统计的mainTreeId错位引起的问题 2 months ago
huangfeng 667c970a01 build: 调整日志输出配置 2 months ago
huangfeng df4c18e0d0 fix: 补上equipment_id的关联 2 months ago
huangfeng fb72fd1f35 fix: 修正告警单里电缆类型的都缺少数据的问题 2 months ago
huangfeng bd406eccc1 fix: 调整电缆环流告警信息 2 months ago
郭承 688d7ec483 fix:调整 2 months ago
郭承 d97e34cbaa feat:相对压力和绝对压力换算 2 months ago
郭承 5aeb536b6f Merge branch 'dev' of http://61.169.135.146:8081/git/jkpg/dsj-back into dev 2 months ago
郭承 aa80130e45 fix: 去掉 2 months ago
huangfeng 98410e154a Revert "fix: 暂用AbsolutePressure替代Pressure20c解决导入错误"
This reverts commit e7f06a9c36.
2 months ago
郭承 4bbdf8334c feat:传感器增加批量新增 2 months ago
郭承 ed491d368f fix:调整 2 months ago
huangfeng 2b3ca992af fix: 文件上传后缀名限制 2 months ago
huangfeng 09b0adabc0 fix: 修复SQL注入漏洞 3 months ago
郭承 05047e4745 fix:告警增加站点的分组,增加评测异常的设备名称查询 3 months ago
郭承 d4734c62c9 feat:测温新增6个位置 3 months ago
郭承 c043f8ecb3 db:测温实时数据表和测温曲线表新增字段 3 months ago
郭承 d142a7f90a feat:实验数据新增避雷器设备小类查询 3 months ago
huangfeng 2a5699dfcb perf: 优化日志输出统一路径 3 months ago
huangfeng da9ea2f2e9 fix: 调整编译依赖和打包 3 months ago
huangfeng a22a0384f1 fix: 增加错误日志信息 3 months ago
huangfeng bf8f3a6acc fix: 增加校验 3 months ago
huangfeng 7b07acd376 fix: 调整上传的用相对路径 4 months ago
郭承 aed3cc73d1 fix:修正大小写 4 months ago
郭承 451bcd8573 fix:修改配置文件指向资源文件的路径 4 months ago

@ -18,8 +18,8 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:redis.properties</value> <value>file:${XYDL_DIR}/jkpg/redis.properties</value>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
</list> </list>
</property> </property>
</bean> </bean>

@ -3,8 +3,6 @@
debug="false"> debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="busi-app-control" /> <property name="appName" value="busi-app-control" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -23,10 +21,10 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>

@ -6,7 +6,8 @@
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${base.name}" /> <!--<dubbo:application name="${base.name}" />-->
<dubbo:application name="busi_app_consumer" />
<dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}" <dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}"
retries="${base.retries}" /> retries="${base.retries}" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->

@ -255,9 +255,21 @@ public final class BusiConstant {
C_O("6", "C相出线"), C_O("6", "C相出线"),
IN_SIDE("7", "柜内"), A_S("7" , "位置1"),
OUT_SIDE("8", "柜外测温点"); B_S("8" , "位置2"),
C_S("9" , "位置3"),
A_X("10" , "位置4"),
B_X("11" , "位置5"),
C_X("12" , "位置6"),
IN_SIDE("13", "柜内"),
OUT_SIDE("14", "柜外测温点");
private final String value; private final String value;
private final String name; private final String name;

@ -167,7 +167,7 @@ public class SFTPTool {
log.info("上传本地文件" + srcDirectory + srcFileName + "到远端服务器" + destDirectory + " 结束"); log.info("上传本地文件" + srcDirectory + srcFileName + "到远端服务器" + destDirectory + " 结束");
return destDirectory + "/" + status; return destDirectory + "/" + status;
} catch (Exception e) { } catch (Exception e) {
log.error("<<<<<<<<<<<<<上传文件异常>>>>>>>>>>>>>>>>>>"); log.error("<<<<<<<<<<<<<上传文件异常>>>>>>>>>>>>>>>>>>", e);
} }
return null; return null;
} }
@ -231,7 +231,7 @@ public class SFTPTool {
outputStream.close(); outputStream.close();
log.info("上传流" + srcFileName + "到远端服务器" + count + " 结束"); log.info("上传流" + srcFileName + "到远端服务器" + count + " 结束");
} catch (Exception e) { } catch (Exception e) {
log.error("<<<<<<<<<<<<<<上传异常>>>>>>>>>>>>>>>>>>>"); log.error("<<<<<<<<<<<<<<上传异常>>>>>>>>>>>>>>>>>>>", e);
} }
return destDirectory + File.separator + folderPath; return destDirectory + File.separator + folderPath;
} }
@ -272,7 +272,7 @@ public class SFTPTool {
log.info("从远端服务器下载文件" + remoteDirectory + File.separator + remoteFile + "到本地" + file.getPath() + File.separator + localFile + " 结束"); log.info("从远端服务器下载文件" + remoteDirectory + File.separator + remoteFile + "到本地" + file.getPath() + File.separator + localFile + " 结束");
return "0"; return "0";
} catch (Exception e) { } catch (Exception e) {
log.error("<<<<<<<<<下载异常>>>>>>>>>>>>"); log.error("<<<<<<<<<下载异常>>>>>>>>>>>>", e);
} }
return "1"; return "1";
} }

@ -76,6 +76,23 @@ public class BusiSensorController {
return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", ""); return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", "");
} }
/**
* Sensor
* @param frontCode
* @param code
* @param number
* @return
*/
@PostMapping(value = "/batchAdd", produces = {"application/json;charset=utf-8"})
public Map<String, Object> batchAdd(
@RequestBody BusiSensorVo busiSensorVo,
@RequestParam(value = "frontCode", required = true) String frontCode,
@RequestParam(value = "code", required = true) String code,
@RequestParam(value = "number", required = true) String number) {
busiSensorService.batchAdd(busiSensorVo,frontCode,code,Integer.parseInt(number));
return ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", "");
}
/** /**
* @Title: update @Description: @createDate: Jul 18, 2019 3:10:20 PM @param @return Map<String,Object> @throws * @Title: update @Description: @createDate: Jul 18, 2019 3:10:20 PM @param @return Map<String,Object> @throws
*/ */

@ -2,6 +2,8 @@ package com.huatek.busi.controller;
import java.util.Map; import java.util.Map;
import com.huatek.frame.base.util.SqlEscapeUtil;
import com.huatek.torch.frame.exception.OwlException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -85,6 +87,26 @@ public class SysConfigController {
@KerLog(projectName = "PROJECTNAME", modelName = "SYSCONFIG.MODELNAME", methodName = "SYSCONFIG.METHODNAME.UPDATESYSCONFIG") @KerLog(projectName = "PROJECTNAME", modelName = "SYSCONFIG.MODELNAME", methodName = "SYSCONFIG.METHODNAME.UPDATESYSCONFIG")
@PostMapping(value = "/updateSysConfig", produces = {"application/json;charset=utf-8"}) @PostMapping(value = "/updateSysConfig", produces = {"application/json;charset=utf-8"})
public Map<String, Object> updateSysConfig(String token,@RequestBody SysConfigDTO sysConfigDTO){ public Map<String, Object> updateSysConfig(String token,@RequestBody SysConfigDTO sysConfigDTO){
boolean flag = SqlEscapeUtil.sqlValidate(sysConfigDTO.getParamKey());
if (flag) {
throw new OwlException("参数名包含非法字符!");
}
flag = SqlEscapeUtil.sqlValidate(sysConfigDTO.getParamValue());
if (flag) {
throw new OwlException("参数值包含非法字符!");
}
flag = SqlEscapeUtil.sqlValidate(sysConfigDTO.getRemark());
if (flag) {
throw new OwlException("备注包含非法字符!");
}
flag = SqlEscapeUtil.sqlValidate(sysConfigDTO.getId());
if (flag) {
throw new OwlException("id包含非法字符!");
}
flag = SqlEscapeUtil.sqlValidate(sysConfigDTO.getStatus());
if (flag) {
throw new OwlException("状态包含非法字符!");
}
int count = sysConfigService.updateSysConfig(sysConfigDTO); int count = sysConfigService.updateSysConfig(sysConfigDTO);
logger.debug("updateSysConfig: {}", count); logger.debug("updateSysConfig: {}", count);
Map<String, Object> map = ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", ""); Map<String, Object> map = ResultUtil.put(ConstantUtil.REQUEST_SUCCESS, "", "");

@ -8,6 +8,7 @@ import com.huatek.busi.entity.GlobalSettingItem;
import com.huatek.busi.entity.WiringDiagram; import com.huatek.busi.entity.WiringDiagram;
import com.huatek.busi.service.*; import com.huatek.busi.service.*;
import com.huatek.busi.where.*; import com.huatek.busi.where.*;
import com.huatek.torch.frame.exception.OwlException;
import com.huatek.torch.frame.tools.ConstantUtil; import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil; import com.huatek.torch.frame.tools.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -18,10 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Base64; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Api(tags={"一次接线图管理接口"}) @Api(tags={"一次接线图管理接口"})
@RestController @RestController
@ -61,7 +59,28 @@ public class WiringDiagramController {
if(globalSettingItem == null || (globalSettingItem.getFileUploadNumber() == null && globalSettingItem.getFileUploadNumber() <= 0)){ if(globalSettingItem == null || (globalSettingItem.getFileUploadNumber() == null && globalSettingItem.getFileUploadNumber() <= 0)){
return ResultUtil.put(ConstantUtil.REQUEST_FAIL, "BUSINESS.UPLOAD.ANNEX.NUM", ""); return ResultUtil.put(ConstantUtil.REQUEST_FAIL, "BUSINESS.UPLOAD.ANNEX.NUM", "");
} }
// 检查文件是否为空
if (file.isEmpty()) {
throw new OwlException("文件不能为空");
}
// 获取原始文件名并校验
String fileNamenew = file.getOriginalFilename(); String fileNamenew = file.getOriginalFilename();
if (fileNamenew == null || fileNamenew.isEmpty()) {
throw new OwlException("无效的文件名");
}
// 提取文件后缀(处理包含多个"."的情况)
int lastDotIndex = fileNamenew.lastIndexOf('.');
if (lastDotIndex == -1) {
throw new OwlException("文件缺少扩展名");
}
String suffix = fileNamenew.substring(lastDotIndex + 1).toLowerCase();
// 定义允许的后缀列表(可从配置读取)
List<String> allowedSuffixes = Arrays.asList("jpg", "png", "pdf", "docx", "doc", "xlsx", "xls");
// 校验后缀合法性
if (!allowedSuffixes.contains(suffix)) {
throw new OwlException("不支持的文件类型");
}
// 上传根目录 // 上传根目录
String rootPath = globalSettingItem.getRootPath(); String rootPath = globalSettingItem.getRootPath();
return iWiringDiagramService.importFile(file.getBytes(), token, "0", fileNamenew, rootPath,type,fileName); return iWiringDiagramService.importFile(file.getBytes(), token, "0", fileNamenew, rootPath,type,fileName);

@ -17,8 +17,8 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:redis.properties</value> <value>file:${XYDL_DIR}/jkpg/redis.properties</value>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
</list> </list>
</property> </property>
<property name="fileEncoding"> <property name="fileEncoding">

@ -3,8 +3,6 @@
debug="false"> debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="busi-back-control" /> <property name="appName" value="busi-back-control" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -23,10 +21,10 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>

@ -6,7 +6,7 @@
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${base.name}" /> <dubbo:application name="busi_consumer" />
<dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}" <dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}"
retries="${base.retries}" /> retries="${base.retries}" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->

@ -95,6 +95,30 @@ public class CwzzTemperature extends Pojo implements Serializable {
@FieldName("tmp") @FieldName("tmp")
private String tmp; private String tmp;
/**
*
*/
@FieldName("max_tmp")
private String maxTmp;
/**
*
*/
@FieldName("min_tmp")
private String minTmp;
/**
*
*/
@FieldName("max_location")
private String maxLocation;
/**
*
*/
@FieldName("alarm_location")
private String alarmLocation;
/** /**
* ID * ID
*/ */

@ -120,6 +120,45 @@ public class RptTemper extends Pojo implements Serializable {
*/ */
@FieldName("c_o_sensor_id") @FieldName("c_o_sensor_id")
private String cOSensorId; private String cOSensorId;
@FieldName("a_s_temper")
private BigDecimal aSTemper;
@FieldName("a_s_sensor_id")
private String aSSensorId;
@FieldName("b_s_temper")
private BigDecimal bSTemper;
@FieldName("b_s_sensor_id")
private String bSSensorId;
@FieldName("c_s_temper")
private BigDecimal cSTemper;
@FieldName("c_s_sensor_id")
private String cSSensorId;
@FieldName("a_x_temper")
private BigDecimal aXTemper;
@FieldName("a_x_sensor_id")
private String aXSensorId;
@FieldName("b_x_temper")
private BigDecimal bXTemper;
@FieldName("b_x_sensor_id")
private String bXSensorId;
@FieldName("c_x_temper")
private BigDecimal cXTemper;
@FieldName("c_x_sensor_id")
private String cXSensorId;
/** /**
* *
*/ */

@ -147,6 +147,42 @@ public class RptTemperCharts extends Pojo implements Serializable {
@FieldName("co_sensor_id") @FieldName("co_sensor_id")
private String coSensorId; private String coSensorId;
@FieldName("as_temper")
private BigDecimal asTemper;
@FieldName("as_sensor_id")
private String asSensorId;
@FieldName("bs_temper")
private BigDecimal bsTemper;
@FieldName("bs_sensor_id")
private String bsSensorId;
@FieldName("cs_temper")
private BigDecimal csTemper;
@FieldName("cs_sensor_id")
private String csSensorId;
@FieldName("ax_temper")
private BigDecimal axTemper;
@FieldName("ax_sensor_id")
private String axSensorId;
@FieldName("bx_temper")
private BigDecimal bxTemper;
@FieldName("bx_sensor_id")
private String bxSensorId;
@FieldName("cx_temper")
private BigDecimal cxTemper;
@FieldName("cx_sensor_id")
private String cxSensorId;
/** /**
* *
*/ */

@ -94,6 +94,29 @@ public class CwzzTemperatureVo implements Serializable {
@ExcelAnnotation(exportName = "温度(℃)") @ExcelAnnotation(exportName = "温度(℃)")
private String tmp; private String tmp;
/**
*
*/
@ExcelAnnotation(exportName = "最高温度(℃)")
private String maxTmp;
/**
*
*/
private String minTmp;
/**
*
*/
@ExcelAnnotation(exportName = "告警温度位置")
private String alarmLocation;
/**
*
*/
@ExcelAnnotation(exportName = "最高温度位置")
private String maxLocation;
/** /**
* CAC 17 * CAC 17
*/ */

@ -44,7 +44,12 @@ public interface BusiSensorService {
* @throws * @throws
*/ */
boolean add(BusiSensorVo busiSensorVo); boolean add(BusiSensorVo busiSensorVo);
/**
*
*/
boolean batchAdd(BusiSensorVo busiSensorVo, String frontCode, String code, int number);
/** /**
* @Title: update * @Title: update
* @Description: * @Description:

@ -19,4 +19,6 @@ public interface IRMasterDataService {
int updateByIdAndEquType(String eqType, String refId); int updateByIdAndEquType(String eqType, String refId);
List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType); List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType);
List<DeviceSubclassOrTestItemListVo> BLQDeviceSubclassList(String equType);
} }

@ -118,7 +118,76 @@
<!-- <version>1.0</version>--> <!-- <version>1.0</version>-->
<!-- <scope>compile</scope>--> <!-- <scope>compile</scope>-->
<!-- </dependency>--> <!-- </dependency>-->
<dependency>
<groupId>local</groupId>
<artifactId>matlabplot</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/matlabplot.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>javabuilder</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/javabuilder.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>assess</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/assess.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>Cable_eval</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/Cable_eval.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>GISmec</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/GISmec.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>lifeassess</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/lifeassess.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>sim_oil_gas</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/sim_oil_gas.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>switchtest</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/switchtest.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>testc</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/testc.jar</systemPath>
</dependency>
<dependency>
<groupId>local</groupId>
<artifactId>Plosweb</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/src/main/webapp/WEB-INF/lib/Plosweb.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>busi-back-serviceImpl</finalName> <finalName>busi-back-serviceImpl</finalName>
@ -154,6 +223,7 @@
<overWriteIfNewer>true</overWriteIfNewer> <overWriteIfNewer>true</overWriteIfNewer>
<includeScope>compile</includeScope> <includeScope>compile</includeScope>
<excludeScope>provided</excludeScope> <excludeScope>provided</excludeScope>
<excludeArtifactIds>Plosweb,testc,switchtest,sim_oil_gas,lifeassess,GISmec,Cable_eval,assess,javabuilder,matlabplot</excludeArtifactIds>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

@ -43,7 +43,7 @@ import com.huatek.busi.vo.warning.BusiHomePageWarningVo;
* *
*sensorCode *sensorCode
* */ * */
Integer getCurrentWarningSum(@Param("sensorCode") String sensorCode, @Param("eqType") String eqType, @Param("gzType") String gzType); Integer getCurrentWarningSum(@Param("mainTreeId") String mainTreeId, @Param("sensorCode") String sensorCode, @Param("eqType") String eqType, @Param("gzType") String gzType);
Integer getBusiEqmWarningCount(Map<String, Object> param); Integer getBusiEqmWarningCount(Map<String, Object> param);

@ -32,7 +32,7 @@ public interface CwzzTemperatureMapper extends BaseCurveSensorMapper, BaseMonito
* @param transformerInfraredTemperatureDto /021010022002023002024007Dto * @param transformerInfraredTemperatureDto /021010022002023002024007Dto
* @return Page /021010022002023002024007List * @return Page /021010022002023002024007List
*/ */
Page<TransformerInfraredTemperatureVo> selectTransformerInfraredTemperaturePage(TransformerInfraredTemperatureDto transformerInfraredTemperatureDto); // Page<TransformerInfraredTemperatureVo> selectTransformerInfraredTemperaturePage(TransformerInfraredTemperatureDto transformerInfraredTemperatureDto);
/** /**
* CAC * CAC

@ -54,4 +54,6 @@ public interface RMasterDataMapper {
int updateDlByIdAndEquType(@Param("eqType") String eqType, @Param("refId") String refId); int updateDlByIdAndEquType(@Param("eqType") String eqType, @Param("refId") String refId);
List<DeviceSubclassOrTestItemListVo> deviceSubclassList(@Param("equType") String equType); List<DeviceSubclassOrTestItemListVo> deviceSubclassList(@Param("equType") String equType);
List<DeviceSubclassOrTestItemListVo> BLQDeviceSubclassList(@Param("equType") String equType);
} }

@ -72,21 +72,21 @@
t.sensor_manufactor, t.sensor_manufactor,
t.sensor_name, --> t.sensor_name, -->
CONCAT_WS('', t_sensor.sensor_name, g_sensor.sensor_name,ge_sensor.sensor_name, a_sensor.sensor_name, o_sensor.sensor_name, CONCAT_WS('', t_sensor.sensor_name, g_sensor.sensor_name,ge_sensor.sensor_name, a_sensor.sensor_name, o_sensor.sensor_name,
p_sensor.sensor_name) AS sensorName, p_sensor.sensor_name, cab_sensor.sensor_name) AS sensorName,
CONCAT_WS('', t_sensor.sensor_brand, g_sensor.sensor_brand,ge_sensor.sensor_brand, a_sensor.sensor_brand, o_sensor.sensor_brand, CONCAT_WS('', t_sensor.sensor_brand, g_sensor.sensor_brand,ge_sensor.sensor_brand, a_sensor.sensor_brand, o_sensor.sensor_brand,
p_sensor.sensor_brand) AS sensorBrand, p_sensor.sensor_brand, cab_sensor.sensor_brand) AS sensorBrand,
CONCAT_WS('', t_sensor.manufactor, g_sensor.manufactor,ge_sensor.manufactor, a_sensor.manufactor, o_sensor.manufactor, CONCAT_WS('', t_sensor.manufactor, g_sensor.manufactor,ge_sensor.manufactor, a_sensor.manufactor, o_sensor.manufactor,
p_sensor.manufactor) AS sensorManufactor, p_sensor.manufactor, cab_sensor.manufactor) AS sensorManufactor,
CONCAT_WS('', t_sensor.position_des, g_sensor.position_des,ge_sensor.position_des, a_sensor.position_des, o_sensor.position_des, CONCAT_WS('', t_sensor.position_des, g_sensor.position_des,ge_sensor.position_des, a_sensor.position_des, o_sensor.position_des,
p_sensor.position_des) AS sensorInstallLocation, p_sensor.position_des, cab_sensor.position_des) AS sensorInstallLocation,
CONCAT_WS('', t_sensor.use_date, g_sensor.use_date,ge_sensor.use_date, a_sensor.use_date, o_sensor.use_date, p_sensor.use_date) AS CONCAT_WS('', t_sensor.use_date, g_sensor.use_date,ge_sensor.use_date, a_sensor.use_date, o_sensor.use_date, p_sensor.use_date,
sensorUseDate, cab_sensor.use_date) AS sensorUseDate,
CONCAT_WS('',t_sensor.position,g_sensor.position,ge_sensor.position,a_sensor.position,o_sensor.position,p_sensor.position) AS CONCAT_WS('',t_sensor.position,g_sensor.position,ge_sensor.position,a_sensor.position,o_sensor.position,p_sensor.position,
sensorPosition, cab_sensor.position) AS sensorPosition,
t.run_state as runState, t.run_state as runState,
bst.name AS mainEquipmentName, bst.name AS mainEquipmentName,
CONCAT_WS('',transformer_sub.equipment_type,gis_sub.equipment_type,gen_sub.equipment_type,arrester_sub.equipment_type,other_sub.equipment_type) CONCAT_WS('',transformer_sub.equipment_type,gis_sub.equipment_type,gen_sub.equipment_type,arrester_sub.equipment_type,other_sub.equipment_type,
as subEquipmentType cab_sensor.equipment_type) as subEquipmentType
</sql> </sql>
<!-- 表关联 --> <!-- 表关联 -->
@ -100,7 +100,7 @@
LEFT JOIN busi_temper_point p_sensor ON t.sensor_id = p_sensor.sensor_code LEFT JOIN busi_temper_point p_sensor ON t.sensor_id = p_sensor.sensor_code
LEFT JOIN busi_cable_sensor cab_sensor ON t.sensor_id = cab_sensor.sensor_code LEFT JOIN busi_cable_sensor cab_sensor ON t.sensor_id = cab_sensor.sensor_code
LEFT JOIN busi_external_equipment ext ON CONCAT_WS('',t_sensor.equipment_id,g_sensor.equipment_id,a_sensor.equipment_id,o_sensor.equipment_id) = ext.equipment_id LEFT JOIN busi_external_equipment ext ON CONCAT_WS('',t_sensor.equipment_id,g_sensor.equipment_id,a_sensor.equipment_id,o_sensor.equipment_id,cab_sensor.equipment_id) = ext.equipment_id
LEFT JOIN busi_transformer_sub_tree transformer_sub ON t_sensor.equipment_id = transformer_sub.id LEFT JOIN busi_transformer_sub_tree transformer_sub ON t_sensor.equipment_id = transformer_sub.id
LEFT JOIN busi_gis_sub_tree gis_sub ON g_sensor.equipment_id = gis_sub.id LEFT JOIN busi_gis_sub_tree gis_sub ON g_sensor.equipment_id = gis_sub.id
LEFT JOIN busi_generator_sub_tree gen_sub ON ge_sensor.equipment_id = gen_sub.id LEFT JOIN busi_generator_sub_tree gen_sub ON ge_sensor.equipment_id = gen_sub.id
@ -389,8 +389,8 @@
t.mainTreeId AS mainTreeId, t.mainTreeId AS mainTreeId,
t.warningId AS warningId, t.warningId AS warningId,
t.siteId as siteId, t.siteId as siteId,
t.sensorInstallLocation AS sensorInstallLocation, t.sensorInstallLocation AS sensorInstallLocation
CONCAT_WS(",",t.oName,t.cableName,t.tName,t.gName,t.aName,t.genName) as sensorName -- CONCAT_WS(",",t.oName,t.cableName,t.tName,t.gName,t.aName,t.genName) as sensorName
from ( from (
select select
warn.id AS warningId, warn.id AS warningId,
@ -401,13 +401,13 @@
warn.warning_time AS warningTime, warn.warning_time AS warningTime,
warn.main_tree_id AS mainTreeId, warn.main_tree_id AS mainTreeId,
warn.site_id as siteId, warn.site_id as siteId,
warn.sensor_install_location AS sensorInstallLocation, warn.sensor_install_location AS sensorInstallLocation
( select os.sensor_name from busi_other_sensor os where os.sensor_code=warn.sensor_id and os.status= '1') as oName, /*( select os.sensor_name from busi_other_sensor os where os.sensor_code=warn.sensor_id and os.status= '1') as oName,
( select cable.sensor_name from busi_cable_sensor cable where cable.sensor_code=warn.sensor_id and cable.status= '1') as cableName, ( select cable.sensor_name from busi_cable_sensor cable where cable.sensor_code=warn.sensor_id and cable.status= '1') as cableName,
( select ts.sensor_name from busi_transformer_sensor ts where ts.sensor_code=warn.sensor_id and ts.status= '1') as tName, ( select ts.sensor_name from busi_transformer_sensor ts where ts.sensor_code=warn.sensor_id and ts.status= '1') as tName,
( select gs.sensor_name from busi_gis_sensor gs where gs.sensor_code=warn.sensor_id and gs.status= '1') as gName, ( select gs.sensor_name from busi_gis_sensor gs where gs.sensor_code=warn.sensor_id and gs.status= '1') as gName,
( select asensor.sensor_name from busi_arrester_sensor asensor where asensor.sensor_code=warn.sensor_id and asensor.status= '1') as aName, ( select asensor.sensor_name from busi_arrester_sensor asensor where asensor.sensor_code=warn.sensor_id and asensor.status= '1') as aName,
( select generator.sensor_name from busi_generator_sensor generator where generator.sensor_code=warn.sensor_id and generator.status= '1') as genName ( select generator.sensor_name from busi_generator_sensor generator where generator.sensor_code=warn.sensor_id and generator.status= '1') as genName*/
from from
busi_eqm_warning warn busi_eqm_warning warn
<where> <where>
@ -419,10 +419,33 @@
AND warn.gz_type = #{gzType} AND warn.gz_type = #{gzType}
</if> </if>
</where> </where>
GROUP BY warn.sensor_id GROUP BY warn.sensor_id,warn.main_tree_id
ORDER BY ORDER BY
warn.warning_time DESC warn.warning_time DESC
) t ) t
<!--select
warn.id AS warningId,
warn.sensor_id AS sensorCode,
warn.eq_type AS eqType,
warn.gz_type AS gzType,
warn.warning_msg AS warningMsg,
warn.warning_time AS warningTime,
warn.main_tree_id AS mainTreeId,
warn.site_id as siteId,
warn.sensor_install_location AS sensorInstallLocation
from
busi_eqm_warning warn
<where>
warn.del_flag = '1' AND warn.deal_status = '0'
<if test="eqType != null and eqType != ''">
AND warn.eq_type = #{eqType}
</if>
<if test="gzType != null and gzType != ''">
AND warn.gz_type = #{gzType}
</if>
</where>
ORDER BY
warn.warning_time DESC-->
</select> </select>
@ -441,6 +464,9 @@
<where> <where>
b.del_flag = '1' b.del_flag = '1'
AND b.deal_status = '0' AND b.deal_status = '0'
<if test="mainTreeId != null and mainTreeId != ''">
and b.main_tree_id = #{mainTreeId}
</if>
<choose> <choose>
<when test="sensorCode != null and sensorCode != ''"> <when test="sensorCode != null and sensorCode != ''">
AND (b.sensor_id = #{sensorCode} OR b.sensor_id is NULL) AND (b.sensor_id = #{sensorCode} OR b.sensor_id is NULL)

@ -79,11 +79,11 @@
Cable_sub.name as subEquipmentName, Cable_sub.name as subEquipmentName,
Cable_sub.equipment_type as subEquipmentType, Cable_sub.equipment_type as subEquipmentType,
bew.create_time as warnTime bew.create_time as warnTime
FROM busi_offline_Cable_repair t FROM busi_offline_cable_repair t
LEFT JOIN busi_Cable_sensor Cable ON t.sensor_code = Cable.sensor_code LEFT JOIN busi_cable_sensor Cable ON t.sensor_code = Cable.sensor_code
LEFT JOIN busi_eqm_malfunction em ON t.warning_id = em.id LEFT JOIN busi_eqm_malfunction em ON t.warning_id = em.id
LEFT JOIN busi_eqm_warning bew ON bew.id = em.warning_id LEFT JOIN busi_eqm_warning bew ON bew.id = em.warning_id
LEFT JOIN busi_Cable_sub_tree Cable_sub ON Cable.equipment_id = Cable_sub.id LEFT JOIN busi_cable_sub_tree Cable_sub ON Cable.equipment_id = Cable_sub.id
LEFT JOIN busi_site_tree bst ON Cable_sub.equipment_id = bst.id LEFT JOIN busi_site_tree bst ON Cable_sub.equipment_id = bst.id
<where> <where>
and t.is_delete = '1' and t.is_delete = '1'
@ -138,13 +138,13 @@
SELECT SELECT
<include refid="Base_Column_List2"/> <include refid="Base_Column_List2"/>
FROM FROM
busi_offline_Cable_repair t busi_offline_cable_repair t
WHERE t.id = #{id} WHERE t.id = #{id}
</select> </select>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<update id="deleteBusiOfflineCableRepair" parameterType="java.util.List"> <update id="deleteBusiOfflineCableRepair" parameterType="java.util.List">
update busi_offline_Cable_repair set is_delete='2' update busi_offline_cable_repair set is_delete='2'
where id in where id in
<foreach collection="idList" index="index" item="id" separator="," open="(" close=")"> <foreach collection="idList" index="index" item="id" separator="," open="(" close=")">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
@ -155,7 +155,7 @@
SELECT SELECT
COUNT(*) COUNT(*)
FROM FROM
busi_offline_Cable_repair t busi_offline_cable_repair t
WHERE WHERE
t.is_delete = '1' and t.deal_status = '1' t.is_delete = '1' and t.deal_status = '1'
<if test="subEquipmentId != null and subEquipmentId != ''"> <if test="subEquipmentId != null and subEquipmentId != ''">
@ -197,7 +197,7 @@
SELECT SELECT
<include refid="Base_Column_List2"/>, <include refid="Base_Column_List2"/>,
w.warning_code AS warningCode w.warning_code AS warningCode
FROM busi_offline_Cable_repair t LEFT JOIN busi_eqm_warning w ON t.warning_id = w.id FROM busi_offline_cable_repair t LEFT JOIN busi_eqm_warning w ON t.warning_id = w.id
<where> <where>
and t.is_delete = '1' and t.is_delete = '1'
<if test="defectCategory != null and defectCategory != ''"> <if test="defectCategory != null and defectCategory != ''">
@ -223,7 +223,7 @@
SELECT SELECT
<include refid="Base_Column_List2"/>, <include refid="Base_Column_List2"/>,
w.warning_code AS warningCode w.warning_code AS warningCode
FROM busi_offline_Cable_repair t LEFT JOIN busi_eqm_warning w ON t.warning_id = w.id FROM busi_offline_cable_repair t LEFT JOIN busi_eqm_warning w ON t.warning_id = w.id
WHERE t.main_equipment_id = #{mainTreeId} WHERE t.main_equipment_id = #{mainTreeId}
AND t.site_id = #{siteId} AND t.site_id = #{siteId}
ORDER BY t.create_time DESC ORDER BY t.create_time DESC
@ -235,7 +235,7 @@
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM FROM
busi_offline_Cable_repair t busi_offline_cable_repair t
WHERE t.deal_status='0' and is_delete='1' and t.warning_id = #{malfunctionId} WHERE t.deal_status='0' and is_delete='1' and t.warning_id = #{malfunctionId}
</select> </select>

@ -392,7 +392,7 @@
t.time_stamp as timeStamp, t.time_stamp as timeStamp,
CAST(t.${subType} AS decimal(20, 4)) as val CAST(t.${subType} AS decimal(20, 4)) as val
FROM busi_cable_circulation t FROM busi_cable_circulation t
WHERE t.sub_equipment_id = #{dto.mainTreeId} WHERE t.main_tree_id = #{dto.mainTreeId}
<if test="dto.sensorCode != null and dto.sensorCode != ''"> <if test="dto.sensorCode != null and dto.sensorCode != ''">
AND t.sensor_id = #{dto.sensorCode} AND t.sensor_id = #{dto.sensorCode}
</if> </if>
@ -408,19 +408,19 @@
count(*) as count count(*) as count
FROM busi_cable_circulation t FROM busi_cable_circulation t
WHERE t.time_stamp &gt;= #{startTime} and t.time_stamp &lt; #{endTime} WHERE t.time_stamp &gt;= #{startTime} and t.time_stamp &lt; #{endTime}
GROUP BY t.sensor_id, t.sub_equipment_id GROUP BY t.sensor_id, t.main_tree_id
</select> </select>
<select id="getDaylyPointStatistics" resultType="com.huatek.busi.dto.curve.PointItemDto"> <select id="getDaylyPointStatistics" resultType="com.huatek.busi.dto.curve.PointItemDto">
SELECT SELECT
t.sub_equipment_id AS mainTreeId, t.main_tree_id AS mainTreeId,
t.sensor_id AS sensorCode, t.sensor_id AS sensorCode,
COUNT(*) AS count, COUNT(*) AS count,
CAST(SUM(t.${subType}) AS decimal(20, 4)) AS total, CAST(SUM(t.${subType}) AS decimal(20, 4)) AS total,
MAX(CAST(t.${subType} AS decimal(20, 4))) AS max, MAX(CAST(t.${subType} AS decimal(20, 4))) AS max,
MIN(CAST(t.${subType} AS decimal(20, 4))) AS min MIN(CAST(t.${subType} AS decimal(20, 4))) AS min
FROM busi_cable_circulation t FROM busi_cable_circulation t
WHERE t.sub_equipment_id = #{mainTreeId} WHERE t.main_tree_id = #{mainTreeId}
<if test="sensorCode != null and sensorCode != ''"> <if test="sensorCode != null and sensorCode != ''">
AND t.sensor_id = #{sensorCode} AND t.sensor_id = #{sensorCode}
</if> </if>

@ -6,6 +6,10 @@
t.phase as phase, t.phase as phase,
t.site_id as siteId, t.site_id as siteId,
t.tmp as tmp, t.tmp as tmp,
t.max_tmp as maxTmp,
t.min_tmp as minTmp,
t.alarm_location as alarmLocation,
t.max_location as maxLocation,
t.sensor_id as sensorId, t.sensor_id as sensorId,
t.time_stamp as timeStamp, t.time_stamp as timeStamp,
t.main_tree_id as mainTreeId, t.main_tree_id as mainTreeId,

@ -258,4 +258,7 @@
<select id="deviceSubclassList" resultType="com.huatek.busi.vo.DeviceSubclassOrTestItemListVo"> <select id="deviceSubclassList" resultType="com.huatek.busi.vo.DeviceSubclassOrTestItemListVo">
select id,sheet_name as value from x_r_master_data where deleted = 0 and equipment_type = #{equType} group by sheet_name select id,sheet_name as value from x_r_master_data where deleted = 0 and equipment_type = #{equType} group by sheet_name
</select> </select>
<select id="BLQDeviceSubclassList" resultType="com.huatek.busi.vo.DeviceSubclassOrTestItemListVo">
select distinct sheet_name as value from x_r_arrester_data where deleted = 0 and equipment_type = #{equType}
</select>
</mapper> </mapper>

@ -2,16 +2,15 @@ package com.huatek.busi.service.impl;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.alibaba.dubbo.config.annotation.Reference; import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.huatek.busi.common.BusiConstant; import com.huatek.busi.common.BusiConstant;
import com.huatek.busi.dto.PushAlarmsDto; import com.huatek.busi.dto.PushAlarmsDto;
import com.huatek.busi.entity.*; import com.huatek.busi.entity.*;
import com.huatek.busi.mapper.BusiSiteMapper;
import com.huatek.busi.mapper.BusiSiteTreeMapper;
import com.huatek.busi.service.*; import com.huatek.busi.service.*;
import com.huatek.busi.service.arrester.BusiArresterSensorService; import com.huatek.busi.service.arrester.BusiArresterSensorService;
import com.huatek.busi.service.gis.BusiGisSensorService; import com.huatek.busi.service.gis.BusiGisSensorService;
@ -70,6 +69,12 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
@Autowired @Autowired
private BusiEqmWarningDao busiEqmWarningDao; private BusiEqmWarningDao busiEqmWarningDao;
@Autowired
private BusiSiteMapper busiSiteMapper;
@Autowired
private BusiSiteTreeMapper busiSiteTreeMapper;
@Autowired @Autowired
private BusiEqmMalfunctionService busiEqmMalfunctionService; private BusiEqmMalfunctionService busiEqmMalfunctionService;
@ -321,10 +326,22 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
private void setData(BusiHomePageWarningVo warning) { private void setData(BusiHomePageWarningVo warning) {
if(BusiConstant.EqType.EQ_TYPE1.equals(warning.getEqType())) if(BusiConstant.GzType.GZ_TYPE25.equals(warning.getGzType())) {
String siteId = busiSiteMapper.getSiteInfo().getId();
BusiSiteTree busiSiteTree = busiSiteTreeMapper.findByMainEquipmentIdAndSiteId(warning.getMainTreeId(), siteId);
if ( null != busiSiteTree ) {
warning.setSensorName(busiSiteTree.getName());
String msg = warning.getWarningMsg();
int i = msg.indexOf("-");
if (-1 != i) {
warning.setWarningMsg(warning.getSensorName()+"-"+warning.getWarningMsg().substring(0,i));
}
}
} else if(BusiConstant.EqType.EQ_TYPE1.equals(warning.getEqType()))
{ {
if (BusiConstant.GzType.GZ_TYPE9.equals(warning.getGzType())) { if (BusiConstant.GzType.GZ_TYPE9.equals(warning.getGzType())) {
warning.setWarningCount(busiEqmWarningMapper.getCurrentWarningSum(warning.getSensorCode(), warning.getEqType(), warning.getGzType())); warning.setWarningCount(busiEqmWarningMapper.getCurrentWarningSum(warning.getMainTreeId() ,warning.getSensorCode(), warning.getEqType(), warning.getGzType()));
return; return;
} }
if(!StringUtils.isEmpty(warning.getSensorCode())){ if(!StringUtils.isEmpty(warning.getSensorCode())){
@ -335,8 +352,7 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
} }
} }
} } else if(BusiConstant.EqType.EQ_TYPE2.equals(warning.getEqType()))
if(BusiConstant.EqType.EQ_TYPE2.equals(warning.getEqType()))
{ if(!StringUtils.isEmpty(warning.getSensorCode())){ { if(!StringUtils.isEmpty(warning.getSensorCode())){
if(warning.getSensorCode().equals("GISPD")){ if(warning.getSensorCode().equals("GISPD")){
warning.setSensorName("GIS局部放电诊断"); warning.setSensorName("GIS局部放电诊断");
@ -354,8 +370,7 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
} }
} }
} } else if(BusiConstant.EqType.EQ_TYPE3.equals(warning.getEqType()))
if(BusiConstant.EqType.EQ_TYPE3.equals(warning.getEqType()))
{ {
if(warning.getSensorCode().equals("switch")){ if(warning.getSensorCode().equals("switch")){
warning.setSensorName("开关柜机械故障诊断"); warning.setSensorName("开关柜机械故障诊断");
@ -365,24 +380,21 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
warning.setSensorName(sensorCode.getSensorName()); warning.setSensorName(sensorCode.getSensorName());
warning.setPosition(sensorCode.getPosition()); warning.setPosition(sensorCode.getPosition());
} }
} } else if(BusiConstant.EqType.EQ_TYPE4.equals(warning.getEqType()))
if(BusiConstant.EqType.EQ_TYPE4.equals(warning.getEqType()))
{ {
if(!StringUtils.isEmpty(warning.getSensorCode())) { if(!StringUtils.isEmpty(warning.getSensorCode())) {
BusiTemperPoint sensorCode = busiTemperPointService.findSensorBySensorCode(warning.getSensorCode()); BusiTemperPoint sensorCode = busiTemperPointService.findSensorBySensorCode(warning.getSensorCode());
warning.setSensorName(sensorCode.getSensorName()); warning.setSensorName(sensorCode.getSensorName());
warning.setPosition(sensorCode.getPosition()); warning.setPosition(sensorCode.getPosition());
} }
} } else if(BusiConstant.EqType.EQ_TYPE5.equals(warning.getEqType()))
if(BusiConstant.EqType.EQ_TYPE5.equals(warning.getEqType()))
{ {
if(!StringUtils.isEmpty(warning.getSensorCode())) { if(!StringUtils.isEmpty(warning.getSensorCode())) {
BusiOtherSensor sensorCode = busiOtherSensorService.findSensorBySensorCode(warning.getSensorCode()); BusiOtherSensor sensorCode = busiOtherSensorService.findSensorBySensorCode(warning.getSensorCode());
warning.setSensorName(sensorCode.getSensorName()); warning.setSensorName(sensorCode.getSensorName());
warning.setPosition(sensorCode.getPosition()); warning.setPosition(sensorCode.getPosition());
} }
} } else if(Objects.equals(BusiConstant.EqType.EQ_TYPE6, warning.getEqType())){
if(Objects.equals(BusiConstant.EqType.EQ_TYPE6, warning.getEqType())){
if(warning.getSensorCode().equals("Generator")){ if(warning.getSensorCode().equals("Generator")){
warning.setSensorName("发电机定子绝缘状态"); warning.setSensorName("发电机定子绝缘状态");
warning.setPosition("/"); warning.setPosition("/");
@ -391,8 +403,7 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
// warning.setSensorName(busiGeneratorSensor.getSensorName()); // warning.setSensorName(busiGeneratorSensor.getSensorName());
// warning.setPosition(busiGeneratorSensor.getPosition()); // warning.setPosition(busiGeneratorSensor.getPosition());
} }
} } else if(Objects.equals(BusiConstant.EqType.EQ_TYPE7, warning.getEqType())){
if(Objects.equals(BusiConstant.EqType.EQ_TYPE7, warning.getEqType())){
if(warning.getSensorCode().equals("Cable")){ if(warning.getSensorCode().equals("Cable")){
warning.setSensorName("电缆故障诊断"); warning.setSensorName("电缆故障诊断");
warning.setPosition("/"); warning.setPosition("/");
@ -402,7 +413,7 @@ public class BusiEqmWarningServiceImpl implements BusiEqmWarningService {
warning.setPosition(busiCableSensor.getPosition()); warning.setPosition(busiCableSensor.getPosition());
} }
} }
warning.setWarningCount(busiEqmWarningMapper.getCurrentWarningSum(warning.getSensorCode(), warning.getEqType(), warning.getGzType())); warning.setWarningCount(busiEqmWarningMapper.getCurrentWarningSum(warning.getMainTreeId() ,warning.getSensorCode(), warning.getEqType(), warning.getGzType()));
} }
@Override @Override

@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*; import java.util.*;
@ -116,6 +117,37 @@ public class BusiSensorServiceImpl implements BusiSensorService {
return false; return false;
} }
@Override
public boolean batchAdd(BusiSensorVo busiSensorVo, String frontCode, String code, int number) {
String equipmentType = busiSensorVo.getEquipmentType();
for(int i=1; i<=number; i++) {
String n = "000";
if(i>9){
n = "00";
}else if(i>99){
n = "0";
}
String sensorCode = frontCode + n + i + code;
busiSensorVo.setSensorCode(sensorCode);
if (SiteConstants.ExternalTypeEnum.BYQ.getValue().equals(equipmentType)) {
busiTransformerSensorService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.GIS.getValue().equals(equipmentType)) {
busiGisSensorService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.CW.getValue().equals(equipmentType)) {
busiTemperPointService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.BLQ.getValue().equals(equipmentType)) {
busiArresterSensorService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.OTHER.getValue().equals(equipmentType)) {
busiOtherSensorService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.GEN.getValue().equals(equipmentType)) {
busiGeneratorSensorService.add(busiSensorVo);
} else if (SiteConstants.ExternalTypeEnum.DL.getValue().equals(equipmentType)) {
busiCableSensorService.add(busiSensorVo);
}
}
return false;
}
@Override @Override
public boolean update(String token, BusiSensorVo busiSensorVo) { public boolean update(String token, BusiSensorVo busiSensorVo) {
String equipmentType = busiSensorVo.getEquipmentType(); String equipmentType = busiSensorVo.getEquipmentType();

@ -536,7 +536,8 @@ public class LabReportBasisDataServiceImpl extends BaseDao<LabRepor
} }
BusiSiteTreeVo equipmentInfo = null; BusiSiteTreeVo equipmentInfo = null;
if (Objects.equals(eqType, SiteConstants.ExternalTypeEnum.GIS.getValue()) || Objects.equals(eqType, SiteConstants.ExternalTypeEnum.CW.getValue())) { if (Objects.equals(eqType, SiteConstants.ExternalTypeEnum.GIS.getValue()) || Objects.equals(eqType, SiteConstants.ExternalTypeEnum.CW.getValue())
|| Objects.equals(eqType, SiteConstants.ExternalTypeEnum.BLQ.getValue()) ) {
equipmentInfo = labReportBasisDataMapper.findGisInfo(equipmentId, jgId); equipmentInfo = labReportBasisDataMapper.findGisInfo(equipmentId, jgId);
} else { } else {
equipmentInfo = labReportBasisDataMapper.findByqInfo(equipmentId); equipmentInfo = labReportBasisDataMapper.findByqInfo(equipmentId);
@ -2188,7 +2189,12 @@ public class LabReportBasisDataServiceImpl extends BaseDao<LabRepor
@Override @Override
public List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType) { public List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType) {
List<DeviceSubclassOrTestItemListVo> deviceSubclassList = rMasterDataService.deviceSubclassList(equType); List<DeviceSubclassOrTestItemListVo> deviceSubclassList = null;
if (Objects.equals(equType, SiteConstants.ExternalTypeEnum.GIS.getValue()) || Objects.equals(equType, SiteConstants.ExternalTypeEnum.BYQ.getValue())) {
deviceSubclassList = rMasterDataService.deviceSubclassList(equType);
} else if (Objects.equals(equType, SiteConstants.ExternalTypeEnum.BLQ.getValue())) {
deviceSubclassList = rMasterDataService.BLQDeviceSubclassList(equType);
}
return deviceSubclassList; return deviceSubclassList;
} }

@ -109,4 +109,8 @@ public class RMasterDataServiceImpl extends BaseDao<RMasterData, String> impleme
public List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType) { public List<DeviceSubclassOrTestItemListVo> deviceSubclassList(String equType) {
return rMasterDataMapper.deviceSubclassList(equType); return rMasterDataMapper.deviceSubclassList(equType);
} }
public List<DeviceSubclassOrTestItemListVo> BLQDeviceSubclassList(String equType) {
return rMasterDataMapper.BLQDeviceSubclassList(equType);
}
} }

@ -155,7 +155,7 @@ public class WiringDiagramImpl extends BaseDao<WiringDiagram, String> implements
} }
String path = rootPath + File.separator + destDirectory; String path = rootPath + File.separator + destDirectory;
SftpConnectConfig sftpConnectConfig = sftpConnectConfigService.findOne(); SftpConnectConfig sftpConnectConfig = sftpConnectConfigService.findOne();
String httpPath= "http://"+ sftpConnectConfig.getHost()+":"+sftpConnectConfig.getHttpPort()+"/"+folderPath.replace(File.separator, Constants.NO_DATA)+"/"+fileNameNew; String httpPath= "/"+folderPath.replace(File.separator, Constants.NO_DATA)+"/"+fileNameNew;
WiringDiagram wiringDiagram=new WiringDiagram(); WiringDiagram wiringDiagram=new WiringDiagram();
wiringDiagram.setId(uUID); wiringDiagram.setId(uUID);
wiringDiagram.setFileName(fileName); wiringDiagram.setFileName(fileName);

@ -174,7 +174,7 @@ public class CableCirculationtemperIncreaseRateServiceImpl implements CableCircu
// 保存告警 // 保存告警
BusiEqmWarning busiEqmWarning = BusiEqmWarning busiEqmWarning =
busiEqmWarningService.saveBusiEqmWarning(equipmentInfoCable, eqType, gzType, busiEqmWarningService.saveBusiEqmWarning(equipmentInfoCable, eqType, gzType,
cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiCableSensor.getSensorName(), busiCableCirculationIncreaseRate.getDailyGrowthRate()), "1"); cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiCableSensor.getSensorName(), busiCableCirculationIncreaseRate.getDailyGrowthRate(), "日"), "1");
// 保存告警详情 // 保存告警详情
BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo(); BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo();
vo.setMainTreeId(busiCableThreshold.getMainTreeId()); vo.setMainTreeId(busiCableThreshold.getMainTreeId());
@ -193,7 +193,7 @@ public class CableCirculationtemperIncreaseRateServiceImpl implements CableCircu
// 保存告警 // 保存告警
BusiEqmWarning busiEqmWarning = BusiEqmWarning busiEqmWarning =
busiEqmWarningService.saveBusiEqmWarning(equipmentInfoCable, eqType, gzType, busiEqmWarningService.saveBusiEqmWarning(equipmentInfoCable, eqType, gzType,
cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiCableSensor.getSensorName(), busiCableCirculationIncreaseRate.getMonthlyGrowthRate()), "1"); cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiCableSensor.getSensorName(), busiCableCirculationIncreaseRate.getMonthlyGrowthRate(), "月"), "1");
// 保存告警详情 // 保存告警详情
BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo(); BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo();
vo.setMainTreeId(busiCableThreshold.getMainTreeId()); vo.setMainTreeId(busiCableThreshold.getMainTreeId());
@ -223,7 +223,7 @@ public class CableCirculationtemperIncreaseRateServiceImpl implements CableCircu
// 保存告警 // 保存告警
BusiEqmWarning busiEqmWarning = BusiEqmWarning busiEqmWarning =
busiEqmWarningService.saveBusiEqmWarning(equipmentInfo, eqType, gzType, busiEqmWarningService.saveBusiEqmWarning(equipmentInfo, eqType, gzType,
cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiOtherSensor.getSensorName(), busiCableCirculationIncreaseRate.getDailyGrowthRate()), "1"); cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiOtherSensor.getSensorName(), busiCableCirculationIncreaseRate.getDailyGrowthRate(), "日"), "1");
// 保存告警详情 // 保存告警详情
BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo(); BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo();
vo.setMainTreeId(busiOtherThreshold.getMainTreeId()); vo.setMainTreeId(busiOtherThreshold.getMainTreeId());
@ -242,7 +242,7 @@ public class CableCirculationtemperIncreaseRateServiceImpl implements CableCircu
// 保存告警 // 保存告警
BusiEqmWarning busiEqmWarning = BusiEqmWarning busiEqmWarning =
busiEqmWarningService.saveBusiEqmWarning(equipmentInfo, eqType, gzType, busiEqmWarningService.saveBusiEqmWarning(equipmentInfo, eqType, gzType,
cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiOtherSensor.getSensorName(), busiCableCirculationIncreaseRate.getMonthlyGrowthRate()), "1"); cacMonitorTypeCode, day.atStartOfDay(), formateCableWarningMsg(busiOtherSensor.getSensorName(), busiCableCirculationIncreaseRate.getMonthlyGrowthRate(), "月"), "1");
// 保存告警详情 // 保存告警详情
BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo(); BusiCableCirculationIncreaseRateVo vo = new BusiCableCirculationIncreaseRateVo();
vo.setMainTreeId(busiOtherThreshold.getMainTreeId()); vo.setMainTreeId(busiOtherThreshold.getMainTreeId());
@ -262,8 +262,8 @@ public class CableCirculationtemperIncreaseRateServiceImpl implements CableCircu
return growthRate.compareTo(thresholdValue) > 0; return growthRate.compareTo(thresholdValue) > 0;
} }
private String formateCableWarningMsg(String phase, String tmp) { private String formateCableWarningMsg(String sensorName, String growthRate, String type) {
return String.format("%s电缆环流%s%%增长率告警", phase, tmp); return String.format("%s电缆环流%s%%%s增长率告警", sensorName, growthRate, type);
} }
// 获取月增长率 // 获取月增长率

@ -239,7 +239,7 @@ public class DataOutputUtil {
Files.deleteIfExists(file); Files.deleteIfExists(file);
log.debug("删除文件:{}", file.getFileName()); log.debug("删除文件:{}", file.getFileName());
} catch (IOException e1) { } catch (IOException e1) {
log.error("删除文件:{}", file.getFileName()); log.error("删除文件:{}", file.getFileName(), e1);
} }
}); });
//删除文件夹 //删除文件夹

@ -104,6 +104,18 @@ public class GisSf6PressureServiceImpl extends AbstractCacEtlService<GisSf6Press
@Override @Override
protected void saveHistoryData(GisSf6Pressure cacEntity, EquipmentInfoDto equipmentInfo) { protected void saveHistoryData(GisSf6Pressure cacEntity, EquipmentInfoDto equipmentInfo) {
try {
if (cacEntity.getAbsolutePressure() != null && cacEntity.getPressure20c() == null) {
int absolutePressureInt = Integer.parseInt(cacEntity.getAbsolutePressure()) - 100;
cacEntity.setPressure20c(absolutePressureInt+"");
}
if (cacEntity.getPressure20c() != null && cacEntity.getAbsolutePressure() == null) {
int pressure20cInt = Integer.parseInt(cacEntity.getPressure20c()) + 100;
cacEntity.setAbsolutePressure(pressure20cInt+"");
}
} catch (Exception ignore) {
}
String equipmentSensitivity = "--"; String equipmentSensitivity = "--";
BusiGisSensor sensorInfo = this.getSensorInfo(cacEntity.getSensorId()); BusiGisSensor sensorInfo = this.getSensorInfo(cacEntity.getSensorId());
if (null != sensorInfo) { if (null != sensorInfo) {
@ -133,7 +145,7 @@ public class GisSf6PressureServiceImpl extends AbstractCacEtlService<GisSf6Press
} }
if (!"".equals(standardPressure) && standardPressure != null) { if (!"".equals(standardPressure) && standardPressure != null) {
cacEntity.setDailyLeakLate(CalcUtil.calcLoseRate(new BigDecimal(standardPressure.trim()), cacEntity.setDailyLeakLate(CalcUtil.calcLoseRate(new BigDecimal(standardPressure.trim()),
new BigDecimal(cacEntity.getTemperature()), new BigDecimal(cacEntity.getAbsolutePressure())).toString()); new BigDecimal(cacEntity.getTemperature()), new BigDecimal(cacEntity.getPressure20c())).toString());
} }
if(StringUtils.isNotEmpty(cacEntity.getPressure20c())){ if(StringUtils.isNotEmpty(cacEntity.getPressure20c())){
//折合20度的压力值 //折合20度的压力值
@ -503,7 +515,10 @@ public class GisSf6PressureServiceImpl extends AbstractCacEtlService<GisSf6Press
{ {
if(mapObj.get("pressure") != null) if(mapObj.get("pressure") != null)
{ {
listRes.add(new BigDecimal(mapObj.get("pressure").toString())); String str = mapObj.get("pressure").toString();
if (!StringUtils.isBlank(str)) {
listRes.add(new BigDecimal(str));
}
} }
} }
if(!listRes.isEmpty()) if(!listRes.isEmpty())
@ -524,7 +539,10 @@ public class GisSf6PressureServiceImpl extends AbstractCacEtlService<GisSf6Press
{ {
if(mapObj1.get("pressure") != null) if(mapObj1.get("pressure") != null)
{ {
listRes1.add(new BigDecimal(mapObj1.get("pressure").toString())); String str = mapObj1.get("pressure").toString();
if (!StringUtils.isBlank(str)) {
listRes1.add(new BigDecimal(str));
}
} }
} }
if(!listRes1.isEmpty()) if(!listRes1.isEmpty())

@ -49,7 +49,7 @@ public class CustomJobBean extends QuartzJobBean {
//获取spring bean //获取spring bean
ScheduleJobLogService scheduleJobLogService = SpringContextUtils.getBean(ScheduleJobLogService.class); ScheduleJobLogService scheduleJobLogService = SpringContextUtils.getBean(ScheduleJobLogService.class);
logger.info("任务准备执行,任务ID" + scheduleJob.getId()); logger.info("任务准备执行,任务" + scheduleJob.getBeanName());
//数据库保存执行记录 //数据库保存执行记录
ScheduleJobLog log = new ScheduleJobLog(); ScheduleJobLog log = new ScheduleJobLog();
log.setId(Uuid.getUUID()); log.setId(Uuid.getUUID());
@ -71,9 +71,9 @@ public class CustomJobBean extends QuartzJobBean {
log.setTimes((int)times); log.setTimes((int)times);
//任务状态 0成功 1失败 //任务状态 0成功 1失败
log.setStatus(0); log.setStatus(0);
logger.info("任务执行完毕,任务ID" + scheduleJob.getId() + " 总共耗时:" + times + "毫秒"); logger.info("任务执行完毕,任务" + scheduleJob.getBeanName() + " 总共耗时:" + times + "毫秒");
} catch (Exception e) { } catch (Exception e) {
logger.error("任务执行失败,任务ID" + scheduleJob.getId(), e); logger.error("任务执行失败,任务" + scheduleJob.getBeanName(), e);
//任务执行总时长 //任务执行总时长
long times = System.currentTimeMillis() - startTime; long times = System.currentTimeMillis() - startTime;
log.setTimes((int)times); log.setTimes((int)times);

@ -104,6 +104,30 @@ public class RptTemperChartsServiceImpl implements RptTemperChartsService {
rptTemperCharts.setCoTemper(item.getTmp()); rptTemperCharts.setCoTemper(item.getTmp());
rptTemperCharts.setCoSensorId(item.getSensorCode()); rptTemperCharts.setCoSensorId(item.getSensorCode());
break; break;
case A_S:
rptTemperCharts.setAsTemper(item.getTmp());
rptTemperCharts.setAsSensorId(item.getSensorCode());
break;
case B_S:
rptTemperCharts.setBsTemper(item.getTmp());
rptTemperCharts.setBsSensorId(item.getSensorCode());
break;
case C_S:
rptTemperCharts.setCsTemper(item.getTmp());
rptTemperCharts.setCsSensorId(item.getSensorCode());
break;
case A_X:
rptTemperCharts.setAxTemper(item.getTmp());
rptTemperCharts.setAxSensorId(item.getSensorCode());
break;
case B_X:
rptTemperCharts.setBxTemper(item.getTmp());
rptTemperCharts.setBxSensorId(item.getSensorCode());
break;
case C_X:
rptTemperCharts.setCxTemper(item.getTmp());
rptTemperCharts.setCxSensorId(item.getSensorCode());
break;
case IN_SIDE: case IN_SIDE:
rptTemperCharts.setBoxTemper(item.getTmp()); rptTemperCharts.setBoxTemper(item.getTmp());
rptTemperCharts.setBoxSensorId(item.getSensorCode()); rptTemperCharts.setBoxSensorId(item.getSensorCode());

@ -97,6 +97,30 @@ public class RptTemperServiceImpl implements RptTemperService {
rptTemper.setCOTemper(transData(cacEntity.getTmp())); rptTemper.setCOTemper(transData(cacEntity.getTmp()));
rptTemper.setCOSensorId(cacEntity.getSensorId()); rptTemper.setCOSensorId(cacEntity.getSensorId());
break; break;
case A_S:
rptTemper.setASTemper(transData(cacEntity.getTmp()));
rptTemper.setASSensorId(cacEntity.getSensorId());
break;
case B_S:
rptTemper.setBSTemper(transData(cacEntity.getTmp()));
rptTemper.setBSSensorId(cacEntity.getSensorId());
break;
case C_S:
rptTemper.setCSTemper(transData(cacEntity.getTmp()));
rptTemper.setCSSensorId(cacEntity.getSensorId());
break;
case A_X:
rptTemper.setAXTemper(transData(cacEntity.getTmp()));
rptTemper.setAXSensorId(cacEntity.getSensorId());
break;
case B_X:
rptTemper.setBXTemper(transData(cacEntity.getTmp()));
rptTemper.setBXSensorId(cacEntity.getSensorId());
break;
case C_X:
rptTemper.setCXTemper(transData(cacEntity.getTmp()));
rptTemper.setCXSensorId(cacEntity.getSensorId());
break;
case IN_SIDE: case IN_SIDE:
rptTemper.setBoxTemper(transData(cacEntity.getTmp())); rptTemper.setBoxTemper(transData(cacEntity.getTmp()));
rptTemper.setBoxSensorId(cacEntity.getSensorId()); rptTemper.setBoxSensorId(cacEntity.getSensorId());

@ -54,6 +54,9 @@ public class AgingHealthIndexUtil {
log.info("---> 变压器:{}, 初始老化系数:{}", name, B0); log.info("---> 变压器:{}, 初始老化系数:{}", name, B0);
log.info("---> 变压器:{}, 投运时间:{}", name, deliveryTime); log.info("---> 变压器:{}, 投运时间:{}", name, deliveryTime);
if (deliveryTime == null){
throw new OwlException("变压器:" + name + ",缺少投运时间");
}
long dayDiff = instance.calcDateDifference(deliveryTime, LocalDate.now(), "YEARS"); long dayDiff = instance.calcDateDifference(deliveryTime, LocalDate.now(), "YEARS");
log.info("---> 变压器:{}, 运行时间:{}", name, dayDiff); log.info("---> 变压器:{}, 运行时间:{}", name, dayDiff);

@ -3,8 +3,6 @@
debug="false"> debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="busi-back-serviceImpl" /> <property name="appName" value="busi-back-serviceImpl" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -16,6 +14,9 @@
<!--控制台输出 --> <!--控制台输出 -->
<appender name="consoleAppender" <appender name="consoleAppender"
class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder> <encoder>
<pattern>${LOG_PATTERN}</pattern> <pattern>${LOG_PATTERN}</pattern>
</encoder> </encoder>
@ -23,16 +24,16 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>
<triggeringPolicy <triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>20MB</maxFileSize> <maxFileSize>200MB</maxFileSize>
</triggeringPolicy> </triggeringPolicy>
<encoder> <encoder>
<pattern>${LOG_PATTERN}</pattern> <pattern>${LOG_PATTERN}</pattern>

@ -61,7 +61,8 @@
scope="prototype"> scope="prototype">
<property name="patterns"> <property name="patterns">
<list> <list>
<value>${base.service.package}</value> <!-- <value>${base.service.package}</value> -->
<value>com.huatek.busi.service.*</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -85,8 +86,9 @@
<property name="mapperLocations"> <property name="mapperLocations">
<array> <array>
<value>${base.mapper.path}</value> <!-- <value>${base.mapper.path}</value> -->
<value>classpath:com/huatek/torch/sql/mapping/*Mapper.xml</value> <value>classpath:com/huatek/busi/mapping/*Mapping.xml</value>
<value>classpath:com/huatek/torch/sql/mapping/*Mapper.xml</value>
</array> </array>
</property> </property>

@ -10,9 +10,9 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:jdbc.properties</value> <value>file:${XYDL_DIR}/jkpg/jdbc.properties</value>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
<value>classpath:redis.properties</value> <value>file:${XYDL_DIR}/jkpg/redis.properties</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -22,15 +22,17 @@
<import resource="spring-redis.xml" /> <import resource="spring-redis.xml" />
<import resource="spring-quartz.xml" /> <import resource="spring-quartz.xml" />
<dubbo:application name="${base.name}" /> <dubbo:application name="busi_provider" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->
<dubbo:registry address="${base.zookeepr}" /> <dubbo:registry address="${base.zookeepr}" />
<!-- 用dubbo协议在28080端口暴露服务 --> <!-- 用dubbo协议在28080端口暴露服务 -->
<dubbo:protocol name="dubbo" port="${base.port}"/> <!-- <dubbo:protocol name="dubbo" port="${base.port}"/> -->
<dubbo:protocol name="dubbo" port="10100"/>
<dubbo:provider timeout="${base.timeout}" threadpool="${base.threadpool}" <dubbo:provider timeout="${base.timeout}" threadpool="${base.threadpool}"
threads="${base.threads}" accepts="${base.accepts}" retries="${base.retries}" threads="${base.threads}" accepts="${base.accepts}" retries="${base.retries}"
filter="busiExceptionFilter,-exception" payload="21557050"/> filter="busiExceptionFilter,-exception" payload="21557050"/>
<!-- filter="busiExceptionFilter,-exception" --> <!-- filter="busiExceptionFilter,-exception" -->
<dubbo:annotation package="${base.service.impl.package}" /> <!-- <dubbo:annotation package="${base.service.impl.package}" /> -->
<dubbo:annotation package="com.huatek.busi.service.impl" />
</beans> </beans>

@ -16,6 +16,9 @@
<!--控制台输出 --> <!--控制台输出 -->
<appender name="consoleAppender" <appender name="consoleAppender"
class="ch.qos.logback.core.ConsoleAppender"> class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder> <encoder>
<pattern>${LOG_PATTERN}</pattern> <pattern>${LOG_PATTERN}</pattern>
</encoder> </encoder>
@ -32,7 +35,7 @@
</rollingPolicy> </rollingPolicy>
<triggeringPolicy <triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>20MB</maxFileSize> <maxFileSize>200MB</maxFileSize>
</triggeringPolicy> </triggeringPolicy>
<encoder> <encoder>
<pattern>${LOG_PATTERN}</pattern> <pattern>${LOG_PATTERN}</pattern>

@ -20,7 +20,7 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
</list> </list>
</property> </property>
</bean> </bean>

@ -2,8 +2,6 @@
<configuration scan="true" scanPeriod="60 seconds" debug="false"> <configuration scan="true" scanPeriod="60 seconds" debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="busi-back-ws" /> <property name="appName" value="busi-back-ws" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -23,10 +21,10 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>

@ -6,7 +6,7 @@
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${base.name}" /> <dubbo:application name="base_ws_consumer" />
<dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}" <dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}"
retries="${base.retries}" /> retries="${base.retries}" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->

@ -0,0 +1,61 @@
package com.huatek.frame.base.util;
import org.apache.commons.lang3.StringUtils;
public class SqlEscapeUtil {
/**
*
**/
public static final String ESCAPE = "/";
/**
*
*
* @param param
* @return String
*/
public static String escape(String param) {
if (StringUtils.isNotEmpty(param)) {
String temp = param.replaceAll("/", ESCAPE + "/");
temp = temp.replaceAll("%", ESCAPE + "%");
temp = temp.replaceAll("_", ESCAPE + "_");
temp = temp.replaceAll("'", "''");
return temp.trim();
}
return null;
}
// public static void main (String[] args) {
// StringBuilder stringBuilder = new StringBuilder();
// stringBuilder.append("asd").deleteCharAt(stringBuilder.length() - 1);
// System.out.println(stringBuilder.toString());
// }
/**
* @param @param str
* @param @return
* @return boolean truefalse
* @author ampsycho.hw
* @Title: sqlValidate
* @Description: sql
*/
public static boolean sqlValidate(String str) {
if (StringUtils.isBlank(str)) {
return false;
}
str = str.toLowerCase();// 统一转为小写
String badStr = "'|exec|and|or|execute|insert|select|delete|update|drop|%|master|truncate|"
+ "declare|sitename|net user|xp_cmdshell|like'|exec|execute|insert|create|drop|"
+ "table|grant|use|group_concat|column_name|information_schema.columns|table_schema|"
+ "select|delete|update|master|truncate|declare|-- |like|//|%";// 过滤掉的sql关键字可以手动添加
String[] badStrs = badStr.split("\\|");
for (int i = 0; i < badStrs.length; i++) {
if (str.contains(badStrs[i])) {
return true;
}
}
return false;
}
}

@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON;
import com.huatek.frame.base.dto.ModelComponentDataDTO; import com.huatek.frame.base.dto.ModelComponentDataDTO;
import com.huatek.frame.base.dto.ModelDTO; import com.huatek.frame.base.dto.ModelDTO;
import com.huatek.frame.base.service.ModelService; import com.huatek.frame.base.service.ModelService;
import com.huatek.frame.base.util.SqlEscapeUtil;
import com.huatek.torch.frame.exception.OwlException;
import com.huatek.torch.frame.tools.ConstantUtil; import com.huatek.torch.frame.tools.ConstantUtil;
import com.huatek.torch.frame.tools.ResultUtil; import com.huatek.torch.frame.tools.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -123,6 +125,14 @@ public class ModelController {
@ApiOperation(value = "部件管理-查询主设备列表") @ApiOperation(value = "部件管理-查询主设备列表")
@GetMapping(value="/selectMainEquipmentListByModelType") @GetMapping(value="/selectMainEquipmentListByModelType")
public Map<String, Object> selectMainEquipmentListByModelType(@RequestParam(value = "siteId") String siteId, @RequestParam(value = "modelType") String modelType) { public Map<String, Object> selectMainEquipmentListByModelType(@RequestParam(value = "siteId") String siteId, @RequestParam(value = "modelType") String modelType) {
boolean flag = SqlEscapeUtil.sqlValidate(siteId);
if (flag) {
throw new OwlException("siteId包含非法字符!");
}
flag = SqlEscapeUtil.sqlValidate(modelType);
if (flag) {
throw new OwlException("modelType包含非法字符!");
}
Map<String, Object> map = modelService.selectMainEquipmentListByModelType(siteId, modelType); Map<String, Object> map = modelService.selectMainEquipmentListByModelType(siteId, modelType);
return map; return map;
} }

@ -18,8 +18,8 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:redis.properties</value> <value>file:${XYDL_DIR}/jkpg/redis.properties</value>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
</list> </list>
</property> </property>
</bean> </bean>

@ -3,8 +3,6 @@
debug="false"> debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="frame-base-control" /> <property name="appName" value="frame-base-control" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -23,10 +21,10 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>

@ -6,7 +6,7 @@
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<dubbo:application name="${base.name}" /> <dubbo:application name="base_consumer" />
<dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}" <dubbo:consumer timeout="${base.timeout}" loadbalance="${base.roundrobin}"
retries="${base.retries}" /> retries="${base.retries}" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->

@ -3,8 +3,6 @@
debug="false"> debug="false">
<!-- 模块名称, 影响日志配置名,日志文件名 --> <!-- 模块名称, 影响日志配置名,日志文件名 -->
<property name="appName" value="frame-base-serviceImpl" /> <property name="appName" value="frame-base-serviceImpl" />
<!-- 日志路径,这里是相对路径 -->
<property name="rootPath" value="/logs" />
<!-- contextName --> <!-- contextName -->
<contextName>${appName}</contextName> <contextName>${appName}</contextName>
@ -22,10 +20,10 @@
<appender name="fileAppender" <appender name="fileAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender"> class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${rootPath}/${appName}.log</file> <file>${XYDL_DIR}/jkpg/logs/${appName}.log</file>
<rollingPolicy <rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${rootPath}/${appName}.%i.log.zip</fileNamePattern> <fileNamePattern>${XYDL_DIR}/jkpg/logs/${appName}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex> <minIndex>1</minIndex>
<maxIndex>20</maxIndex> <maxIndex>20</maxIndex>
</rollingPolicy> </rollingPolicy>

@ -57,7 +57,7 @@
scope="prototype"> scope="prototype">
<property name="patterns"> <property name="patterns">
<list> <list>
<value>${base.service.package}</value> <value>com.huatek.frame.base.service.*</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -81,7 +81,7 @@
<property name="mapperLocations"> <property name="mapperLocations">
<array> <array>
<value>${base.mapper.path}</value> <value>classpath:com/huatek/frame/base/mapping/*Mapper.xml</value>
<value>classpath:com/huatek/torch/sql/mapping/*Mapper.xml</value> <value>classpath:com/huatek/torch/sql/mapping/*Mapper.xml</value>
</array> </array>
</property> </property>

@ -10,9 +10,9 @@
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath:jdbc.properties</value> <value>file:${XYDL_DIR}/jkpg/jdbc.properties</value>
<value>classpath:application.properties</value> <value>file:${XYDL_DIR}/jkpg/application.properties</value>
<value>classpath:redis.properties</value> <value>file:${XYDL_DIR}/jkpg/redis.properties</value>
</list> </list>
</property> </property>
</bean> </bean>
@ -21,13 +21,13 @@
<import resource="spring-database.xml" /> <import resource="spring-database.xml" />
<import resource="spring-redis.xml" /> <import resource="spring-redis.xml" />
<dubbo:application name="${base.name}" /> <dubbo:application name="base_provider" />
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->
<dubbo:registry address="${base.zookeepr}" /> <dubbo:registry address="${base.zookeepr}" />
<!-- 用dubbo协议在28080端口暴露服务 --> <!-- 用dubbo协议在28080端口暴露服务 -->
<dubbo:protocol name="dubbo" port="${base.port}" /> <dubbo:protocol name="dubbo" port="10001" />
<dubbo:provider timeout="${base.timeout}" threadpool="${base.threadpool}" <dubbo:provider timeout="${base.timeout}" threadpool="${base.threadpool}"
threads="${base.threads}" accepts="${base.accepts}" retries="${base.retries}" /> threads="${base.threads}" accepts="${base.accepts}" retries="${base.retries}" />
<dubbo:annotation package="${base.service.impl.package}" /> <dubbo:annotation package="com.huatek.frame.base.service.impl" />
</beans> </beans>

@ -263,3 +263,33 @@ ALTER TABLE iec_points_conf MODIFY COLUMN unit varchar(10) CHARACTER SET utf8 CO
1:kV() 2:V() 3:kA() 4:A() 5:mA() 6:() 7:Pa() 8:KPa() 9:MPa() 10:pF() 1:kV() 2:V() 3:kA() 4:A() 5:mA() 6:() 7:Pa() 8:KPa() 9:MPa() 10:pF()
11:pC() 12:dB() 13:μL() 14:mL() 15:L() 16:m/s(/) 17:rpm&r/min(/)'; 11:pC() 12:dB() 13:μL() 14:mL() 15:L() 16:m/s(/) 17:rpm&r/min(/)';
ALTER TABLE iec_points_conf MODIFY COLUMN sysunit varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '0: 无效,暂留未用,指运行评测表中的字段值单位,系统定义单位,参见字段unit的定义'; ALTER TABLE iec_points_conf MODIFY COLUMN sysunit varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '0: 无效,暂留未用,指运行评测表中的字段值单位,系统定义单位,参见字段unit的定义';
/*新增6个位置 测温实时数据表(rpt_temper)和测温曲线表(rpt_temper_charts)*/
ALTER TABLE `rpt_temper`
ADD COLUMN `a_s_temper` DECIMAL(10,2) NULL AFTER `create_time`,
ADD COLUMN `a_s_sensor_id` VARCHAR(50) NULL AFTER `a_s_temper`,
ADD COLUMN `b_s_temper` DECIMAL(10,2) NULL AFTER `a_s_sensor_id`,
ADD COLUMN `b_s_sensor_id` VARCHAR(50) NULL AFTER `b_s_temper`,
ADD COLUMN `c_s_temper` DECIMAL(10,2) NULL AFTER `b_s_sensor_id`,
ADD COLUMN `c_s_sensor_id` VARCHAR(50) NULL AFTER `c_s_temper`,
ADD COLUMN `a_x_temper` DECIMAL(10,2) NULL AFTER `c_s_sensor_id`,
ADD COLUMN `a_x_sensor_id` VARCHAR(50) NULL AFTER `a_x_temper`,
ADD COLUMN `b_x_temper` DECIMAL(10,2) NULL AFTER `a_x_sensor_id`,
ADD COLUMN `b_x_sensor_id` VARCHAR(50) NULL AFTER `b_x_temper`,
ADD COLUMN `c_x_temper` DECIMAL(10,2) NULL AFTER `b_x_sensor_id`,
ADD COLUMN `c_x_sensor_id` VARCHAR(50) NULL AFTER `c_x_temper`;
ALTER TABLE `rpt_temper_charts`
ADD COLUMN `as_temper` DECIMAL(20,4) NULL AFTER `create_time`,
ADD COLUMN `as_sensor_id` VARCHAR(50) NULL AFTER `as_temper`,
ADD COLUMN `bs_temper` DECIMAL(20,4) NULL AFTER `as_sensor_id`,
ADD COLUMN `bs_sensor_id` VARCHAR(50) NULL AFTER `bs_temper`,
ADD COLUMN `cs_temper` DECIMAL(20,4) NULL AFTER `bs_sensor_id`,
ADD COLUMN `cs_sensor_id` VARCHAR(50) NULL AFTER `cs_temper`,
ADD COLUMN `ax_temper` DECIMAL(20,4) NULL AFTER `cs_sensor_id`,
ADD COLUMN `ax_sensor_id` VARCHAR(50) NULL AFTER `ax_temper`,
ADD COLUMN `bx_temper` DECIMAL(20,4) NULL AFTER `ax_sensor_id`,
ADD COLUMN `bx_sensor_id` VARCHAR(50) NULL AFTER `bx_temper`,
ADD COLUMN `cx_temper` DECIMAL(20,4) NULL AFTER `bx_sensor_id`,
ADD COLUMN `cx_sensor_id` VARCHAR(50) NULL AFTER `cx_temper`;
Loading…
Cancel
Save