Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 2 months ago
parent
commit
b95e31b51c
  1. 7
      hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java
  2. 3
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java
  3. 55
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java
  4. 2
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml
  5. 110
      hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql
  6. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java
  7. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java
  8. 28
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java
  9. 28
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java
  10. 7
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java
  11. 14
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java
  12. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java
  13. 6
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java
  14. 44
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java
  15. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java
  16. 1
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  17. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java
  18. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java
  19. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java
  20. 3
      hzims-service/operational/src/main/resources/db/3.0.5.sql

7
hzims-biz-common/src/main/java/com/hnac/hzims/common/utils/FileUtil.java

@ -134,13 +134,8 @@ public class FileUtil {
}
public static ByteArrayMultipartFile getMultipartFileFromUrl(String urlStr) throws IOException {
String pureUrl = getPureUrl(urlStr);
return getMultipartFileFromPureUrl(pureUrl);
}
public static ByteArrayMultipartFile getMultipartFileFromPureUrl(String pureUrlStr) throws IOException {
ByteArrayMultipartFile result = null;
URL url = new URL(pureUrlStr);
URL url = new URL(urlStr);
byte[] bytes = getUrlByte(url);
String name = url.getPath();
String originalName = getOriginalFilename(name);

3
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/constant/MainConstants.java

@ -88,6 +88,9 @@ public interface MainConstants {
// 站点实时数据
String REAL_TIME_DATA = "realTimeData";
String LOAD_STATION_ON_LINE = "loadStationOnLine";
// 光伏站-机组指标数据
String LOAD_PHOTOVOLTAIC_TARGET = "loadPhotovoltaicTarget";

55
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/vo/DeviceModelData.java

@ -4,14 +4,19 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO;
import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import lombok.NoArgsConstructor;
/**
* @Author: ypj
* @Date: 2024/9/19 7:55
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DeviceModelData {
/**
* 模型id
@ -157,20 +162,50 @@ public class DeviceModelData {
private String type;
public static DeviceModelData of(ModelAttrVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class);
deviceModelData.setType("0");
return deviceModelData;
return DeviceModelData.builder()
.modelId(null != data.getModelId() ? data.getModelId().toString() : null)
.name(data.getName())
.signage(data.getSignage())
.dbType(data.getDbType())
.fieldLength(data.getFieldLength())
.keepFigures(null != data.getKeepFigures() ? data.getKeepFigures().toString() : null)
.accessRules(null != data.getAccessRules() ? data.getAccessRules().toString() : null)
.descs(data.getDescs())
.modelClassifyId(null != data.getModelClassifyId() ? data.getModelClassifyId().toString() : null)
.type("0").build();
}
public static DeviceModelData of(ModelFuncVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class);
deviceModelData.setType("1");
return deviceModelData;
return DeviceModelData.builder()
.modelId(null != data.getModelId() ? data.getModelId().toString() : null)
.name(data.getName())
.signage(data.getSignage())
.parameterJson(data.getParameterJson())
.controlStatus(null != data.getControlStatus() ? data.getControlStatus().toString() : null)
.parameterTag(data.getParameterTag())
.isPopup(null != data.getIsPopup() ? data.getIsPopup().toString() : null)
.isCheck(null != data.getIsCheck() ? data.getIsCheck().toString() : null)
.parameterSource(null != data.getParameterSource() ? data.getParameterSource().toString() : null)
.sourceAttrSignage(data.getSourceAttrSignage())
.controlParameter(null != data.getControlParameter() ? data.getControlParameter().toString() : null)
.intervalLength(null != data.getIntervalLength() ? data.getIntervalLength().toString() : null)
.minValue(null != data.getMinValue() ? data.getMinValue().toString() : null)
.maxValue(null != data.getMaxValue() ? data.getMaxValue().toString() : null)
.coefficient(null != data.getCoefficient() ? data.getCoefficient().toString() : null)
.descs(data.getDescs())
.type("1").build();
}
public static DeviceModelData of(ModelEventVO data) {
DeviceModelData deviceModelData = Func.copyProperties(data, DeviceModelData.class);
deviceModelData.setType("2");
return deviceModelData;
return DeviceModelData.builder()
.modelId(null != data.getModelId() ? data.getModelId().toString() : null)
.name(data.getName())
.signage(data.getSignage())
.modelClassifyId(null != data.getModelClassifyId() ? data.getModelClassifyId().toString() : null)
.level(null != data.getLevel() ? data.getLevel().toString() : null)
.duration(null != data.getDuration() ? data.getDuration().toString() : null)
.descs(data.getDescs())
.modelClassifyId(null != data.getModelClassifyId() ? data.getModelClassifyId().toString() : null)
.type("2").build();
}
}

2
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml

@ -15,5 +15,7 @@
FROM
knowledge_file_segment AS `segment`
LEFT JOIN knowledge_file_info `info` ON `segment`.DOC_ID = `info`.ID
WHERE
`segment`.IS_DELETED = 0
</select>
</mapper>

110
hzims-service/gglm-big-model/src/main/resources/db/2.0.2.sql

@ -1,10 +1,11 @@
CREATE TABLE `HZIMS_VECTOR_PARAM` (
CREATE TABLE IF NOT EXISTS `gglm_vector_param` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称',
`URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'URL',
`PROJECT_PREFIX` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目前缀',
`TABLE_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '数据库表名',
`ATTRIBUTE_MAP` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '向量键值对',
`REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
@ -13,5 +14,110 @@ CREATE TABLE `HZIMS_VECTOR_PARAM` (
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
`SYNCHRONIZATION_TIME` datetime(0) NULL DEFAULT NULL COMMENT '同步时间',
`SYNCHRONIZATION_REMARK` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '同步说明',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量键值对信息' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量库配置信息' ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `gglm_vector_param_log` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`VECTOR_PARAM_ID` bigint(20) NOT NULL COMMENT '参数id',
`CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '日志内容',
`TYPE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '日志类型',
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '向量数据库操作日志' ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `gglm_agent_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`chat_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '每轮对话的id',
`q_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '问题ID',
`model_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'hx自用',
`agent` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'hx自用',
`q` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '问题',
`prompt` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '问题提示',
`system` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
`a` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '答案',
`a_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '答案类型,0直接回答、1参数提取、2意图分类',
`user_conclusion` tinyint(4) NULL DEFAULT NULL COMMENT '用户结论,0为错误,1为正确',
`label_status` tinyint(4) NULL DEFAULT 0 COMMENT '标注状态,0为错误,1为正确',
`label_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '标注内容,json字符串',
`label_result` tinyint(4) NULL DEFAULT NULL COMMENT '标注结果,0为错误,1为正确',
`label_operator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标注人名称',
`label_time` datetime(0) NULL DEFAULT NULL COMMENT '标注时间',
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1833310958482192892 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `knowledge_file_info` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '名称',
`URL` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT 'URL',
`SIZE` bigint(18) NULL DEFAULT NULL COMMENT '文件大小',
`BRIEFS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL COMMENT '简介',
`TAGS` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '标签',
`DOMAIN` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '业务领域',
`AUTHORITY_CLASS` tinyint(4) NULL DEFAULT NULL COMMENT '权限等级,5个等级',
`VISIBLE` tinyint(4) NULL DEFAULT 1 COMMENT '是否可见,0为不可见,1为可见',
`FILE_STATUS` tinyint(4) NULL DEFAULT 0 COMMENT '文件状态,0为未入库,1为已入库,2为入库中',
`REMARK` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '备注',
`CREATE_USER_NAME` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '创建人名称',
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '知识库文件信息表' ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `knowledge_file_segment` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
`DOC_QS` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
`DOC_CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
`DOC_PAGE_INDEX` int(11) NULL DEFAULT NULL,
`DOC_ID` bigint(20) NULL DEFAULT NULL,
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '知识库文件分段表' ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `question_answer_comment` (
`ID` bigint(20) NOT NULL COMMENT '主键ID',
`CHAT_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '对话id',
`QUESTION_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '问题id',
`USER_ID` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '用户id',
`PRAISE` tinyint(4) NULL DEFAULT 0 COMMENT '点赞',
`CONTENT` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
`TENANT_ID` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL COMMENT '租户ID',
`STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态',
`CREATE_DEPT` bigint(20) NULL DEFAULT NULL COMMENT '创建单位',
`CREATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '创建人',
`CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '修改人',
`UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
`IS_DELETED` tinyint(4) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '问题评价' ROW_FORMAT = Dynamic;

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/DutyNoticeScheduledTask.java

@ -109,7 +109,6 @@ public class DutyNoticeScheduledTask {
List<String> userList = userListByRoleAlias.stream().map(s -> s.getId().toString()).collect(Collectors.toList());
String userIds = String.join(",", userList);
if (StringUtils.isBlank(userIds)) {
log.error("推送的消息不能为空哦,{}", userIds);
throw new ServiceException("推送的消息不能为空");
}
message.setCreateUser(Long.valueOf(userList.get(0)));

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/GenerationScheduledTask.java

@ -63,10 +63,9 @@ public class GenerationScheduledTask {
* @param param
* @return
*/
//@XxlJob(THIS_DAY_POWER_GENERATION)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> thisDayPowerGeneration() {
String param = "";
@XxlJob(THIS_DAY_POWER_GENERATION)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> thisDayPowerGeneration(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -79,10 +78,9 @@ public class GenerationScheduledTask {
* @param param
* @return
*/
//@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadThreeYearPowerGeneration() {
String param = "";
@XxlJob(LOAD_THREE_YEAR_POWER_GENERATION)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadThreeYearPowerGeneration(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

28
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/MonitorScheduledTask.java

@ -29,10 +29,9 @@ public class MonitorScheduledTask {
/**
* realId刷新
*/
//@XxlJob(REAL_ID_DATA)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealId() {
String param = "";
@XxlJob(REAL_ID_DATA)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealId(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -44,10 +43,9 @@ public class MonitorScheduledTask {
* 实时数据刷新
* @return ReturnT<String>
*/
//@XxlJob(REAL_TIME_DATA)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData() {
String param = "";
@XxlJob(REAL_TIME_DATA)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadRealData(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -59,10 +57,9 @@ public class MonitorScheduledTask {
* 站点在线状态同步
* @return ReturnT<String>
*/
//@XxlJob(REAL_TIME_DATA)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadStationOnLine() {
String param = "";
@XxlJob(LOAD_STATION_ON_LINE)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadStationOnLine(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -75,10 +72,9 @@ public class MonitorScheduledTask {
* 集中监控数据处理
* @return ReturnT<String>
*/
//@XxlJob(CENTRALIZED_MONITORING)
@Scheduled(cron = "0/4 * * * * ? ")
public ReturnT<String> loadMonitoring() {
String param = "";
@XxlJob(CENTRALIZED_MONITORING)
//@Scheduled(cron = "0/4 * * * * ? ")
public ReturnT<String> loadMonitoring(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

28
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/RealTargetScheduledTask.java

@ -33,10 +33,9 @@ public class RealTargetScheduledTask {
* @return
* @throws Exception
*/
//@XxlJob(LOAD_EM_INFO)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadEmInfo() {
String param = "";
@XxlJob(LOAD_EM_INFO)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> loadEmInfo(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -47,10 +46,9 @@ public class RealTargetScheduledTask {
/**
* 水电站-机组实时加载
*/
//@XxlJob(LOAD_HYDROPOWER_UNIT_REAL)
@Scheduled(cron = "0/5 * * * * ? ")
public ReturnT<String> loadHydropowerReal() {
String param = "";
@XxlJob(LOAD_HYDROPOWER_UNIT_REAL)
//@Scheduled(cron = "0/5 * * * * ? ")
public ReturnT<String> loadHydropowerReal(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -61,10 +59,9 @@ public class RealTargetScheduledTask {
/**
* 水电站-机组指标加载
*/
//@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET)
@Scheduled(cron = "0 0/3 * * * ? ")
public ReturnT<String> loadHydropowerTarget() {
String param = "";
@XxlJob(LOAD_HYDROPOWER_UNIT_TARGET)
//@Scheduled(cron = "0 0/3 * * * ? ")
public ReturnT<String> loadHydropowerTarget(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -113,10 +110,9 @@ public class RealTargetScheduledTask {
/**
* 水利-站点水位数据
*/
//@XxlJob(LOAD_WATER_LEVEL)
@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadWaterLevel() {
String param = "";
@XxlJob(LOAD_WATER_LEVEL)
//@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadWaterLevel(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

7
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/ShowScheduledTask.java

@ -42,10 +42,9 @@ public class ShowScheduledTask {
/**
* 首页-区域班组数据
*/
// @XxlJob(REGIONAL_DUTY_INFO)
@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadRegionalDuty() {
String param = "";
@XxlJob(REGIONAL_DUTY_INFO)
//@Scheduled(cron = "0 0/5 * * * ? ")
public ReturnT<String> loadRegionalDuty(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
}

14
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/scheduled/StartStopScheduledTask.java

@ -30,10 +30,9 @@ public class StartStopScheduledTask {
/**
* 单日开停机记录
*/
//@XxlJob(THIS_DAY_START_STOP_RECORD)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> thisDayStartStopRecord() {
String param = "";
@XxlJob(THIS_DAY_START_STOP_RECORD)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> thisDayStartStopRecord(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}
@ -44,10 +43,9 @@ public class StartStopScheduledTask {
/**
* 设备开停机时间记录
*/
//@XxlJob(START_STOP_TIME_RECORD)
@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> startStopTimeRecord() {
String param = "";
@XxlJob(START_STOP_TIME_RECORD)
//@Scheduled(cron = "0/40 * * * * ? ")
public ReturnT<String> startStopTimeRecord(String param) {
if (Func.isBlank(param)) {
param = DateUtil.format(new Date(), "yyyy-MM");
}

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java

@ -128,7 +128,6 @@ public class AlarmServiceImpl implements AlarmService {
}
}
});
log.error("start_stop_alarm : {}",refresh);
redisTemplate.opsForValue().set(start_stop_cache_final,refresh);
}
@ -279,7 +278,6 @@ public class AlarmServiceImpl implements AlarmService {
alarm.setRealId(entity.getRealId());
alarm.setContext(entity.getSoeExplain());
alarm.setState(entity.getStatus());
log.error("send_interruption_msg : {}",JsonUtil.toJson(alarm));
mqttSender.sendToMqtt(InterruptionConstants.HZ3000_TOPIC_PREFIX + entity.getStationId(), JsonUtil.toJson(alarm));
});
}

6
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ObtainGenerationServiceImpl.java

@ -206,10 +206,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
});
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,e.getMessage());
}
});
}
@ -356,10 +354,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
});
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,e.getMessage());
}
});
}
@ -450,10 +446,8 @@ public class ObtainGenerationServiceImpl implements ObtainGenerationService {
threeGenerateService.saveBatch(this.saveFillGenerate(station,start,end));
});
countDownLatch.countDown();
log.error("save_generation_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
log.error("save_generation_execute_complete_error : {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}
});
}

44
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java

@ -34,12 +34,10 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO;
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeCodeBySignagesVO;
import com.hnac.hzinfo.datasearch.history.IHistoryDataSearchClient;
import com.hnac.hzinfo.datasearch.history.OriginalDataQuery;
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO;
import com.hnac.hzinfo.sdk.analyse.po.MultiAnalyzeCodePO;
import com.hnac.hzinfo.sdk.core.response.HzPage;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
@ -698,21 +696,17 @@ public class RealTargetServiceImpl implements RealTargetService {
list.add(waterLevelVo);
}
countDownLatch.countDown();
XxlJobLogger.log("load_water_level : 子线程执行完成 {}", item.getInstanceCode());
} catch (Exception exception) {
countDownLatch.countDown();
XxlJobLogger.log("load_water_level_error : 子线程执行失败 {}", exception.getMessage());
}
});
}
try {
XxlJobLogger.log("load_water_level :等待线程执行");
countDownLatch.await();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
XxlJobLogger.log("load_water_level :线程执行结束");
redisTemplate.opsForValue().set(loadwater_level_key,list);
}
@ -1444,7 +1438,6 @@ public class RealTargetServiceImpl implements RealTargetService {
powerMap.put(station.getCode(),generateMap);
});
countDownLatch.countDown();
log.error("pool_item_execute_complete: {}" ,item.stream().map(StationEntity::getName).collect(Collectors.toList()));
}catch (Exception e){
countDownLatch.countDown();
}
@ -1461,43 +1454,6 @@ public class RealTargetServiceImpl implements RealTargetService {
}
private Map<String, Float> lastReduceFirst(StationEntity station, List<EminfoAndEmParamVo> devices, String start, String end) {
List<PowerMonthVo> datas = new ArrayList<>();
// 设备采集发电量
if(CollectionUtil.isNotEmpty(devices)){
devices.forEach(device->{
List<Map<String, String>> records = dataService.lastFirstBySignage(start,end,7,5,device.getEmCode(),HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(CollectionUtil.isEmpty(records)){
return;
}
datas.addAll(records.stream().map(record -> {
PowerMonthVo generate = new PowerMonthVo();
Date time;
if(record.get("ts").contains(".0")){
time = DateUtil.parse(record.get("ts"), "yyyy-MM-dd HH:mm:ss.s");
}else{
time = DateUtil.parse(record.get("ts") + ".0", "yyyy-MM-dd HH:mm:ss.s");
}
generate.setStrMonth(DateUtil.format(time,DateUtil.PATTERN_DATE));
String val = record.get(HomePageConstant.HYDROPOWER_GENERATE_POWER);
if(StringUtil.isEmpty(val)){
generate.setPower(0f);
}else{
generate.setPower(Float.parseFloat(String.valueOf(Double.parseDouble(val) * device.getRideCount())));
}
return generate;
}).collect(Collectors.toList()));
});
}
// 补充填报数据
datas.addAll(this.generateFill(station,start,end));
if(CollectionUtil.isEmpty(datas)){
return null;
}
return datas.stream().collect(Collectors.toMap(PowerMonthVo::getStrMonth, PowerMonthVo::getPower, Float::sum));
}
/**
* 近年发电量数据
*

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/ShowServiceImpl.java

@ -627,7 +627,6 @@ public class ShowServiceImpl implements ShowService {
target.setTaget_three(0.0);
target.setTaget_four(0.0);
target.setCharge(0);
log.error("charge_target_exception: {} ", e.getMessage());
}
return target;
}

1
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -211,7 +211,6 @@ public class MonitorServiceImpl implements MonitorService {
if(CollectionUtil.isEmpty(realIds)){
return;
}
log.error("real_time_data: {},{}",stationReal.getStation(),realIds);
List<String> objects = redisClient.getBatchRealDataByRealId(stationReal.getStation(),realIds);
for(int i = 0; i < realIds.size() ;i++){
if(ObjectUtil.isNotEmpty(objects.get(i))){

4
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/plate/impl/DataServiceImpl.java

@ -109,12 +109,10 @@ public class DataServiceImpl implements DataService {
analyzeDataConditionPO.setEndTime(LocalDateTime.parse(DateUtil.format(new Date(), endTime), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)));
signboardConditions.add(analyzeDataConditionPO);
po.setSignboardConditions(signboardConditions);
log.error("period_target_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_target_data_resp {}",result);
return result.getData().get(0).getList();
}
@ -147,12 +145,10 @@ public class DataServiceImpl implements DataService {
signboardConditions.add(analyzeDataConditionPO);
});
po.setSignboardConditions(signboardConditions);
log.error("period_targets_data_request {}",po);
R<List<AnalyzeDataConditionVO>> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(po);
if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) {
return new ArrayList<>();
}
log.error("period_targets_data_resp {}",result);
return result.getData();
}

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/homePage/service/impl/HydroelectricServiceImpl.java

@ -168,6 +168,10 @@ public class HydroelectricServiceImpl implements HydroelectricService {
device.setStartupDurationYear(-1.0);
device.setShutDownDurationYear(-1.0);
}
if(CollectionUtil.isEmpty(startStopTimes)){
device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0);
}else{
// 开停机数据
Optional<StartStopTimeVO> startStop = startStopTimes.stream().filter(o->iter.getEmCode().equals(o.getDeviceCode())).findFirst();
if(startStop.isPresent()){
@ -188,6 +192,7 @@ public class HydroelectricServiceImpl implements HydroelectricService {
device.setStartDownTime("-1");
device.setStartupDownDuration(-1.0);
}
}
return device;
}).collect(Collectors.toList()));
}

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -225,7 +225,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
if(CollectionUtil.isEmpty(realStationVoList)){
return null;
}
log.info("步骤1获取所有监控缓存数据 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 集中监控响应站点数据
List<RealStationVo> validList = realStationVoList.stream().filter(o -> message.getDeptIds().contains(o.getStationDeptId())).collect(Collectors.toList());
@ -240,11 +239,9 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
Map<String, HeWeatherWeatherNowResponse> nowWeather = this.weatherService.getNowWeather(codes);
// 七日内天气
Map<String, HeWeatherWeatherDailyResponse> weekWeather = this.weatherService.getWeekWeather(codes);
log.info("步骤2获取天气 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 站点水位数据
List<WaterLevelVo> levelList = (List<WaterLevelVo>) redisTemplate.opsForValue().get(loadwater_level_key);
log.info("步骤3获取水位数据 耗时 : {}",System.currentTimeMillis() - beginTime);
beginTime = System.currentTimeMillis();
// 遍历站点
validList.forEach(item->{
@ -253,7 +250,6 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
// 前池水位
this.waterLevel(levelList,item);
});
log.info("步骤4站点数据处理 耗时 : {}",System.currentTimeMillis() - beginTime);
return new TextMessage(JSONObject.toJSONString(validList.stream().peek(o->{
if(ObjectUtil.isEmpty(o.getSort())){
o.setSort(999);

3
hzims-service/operational/src/main/resources/db/3.0.5.sql

@ -0,0 +1,3 @@
-- 月报告添加结论修改和评价
ALTER TABLE `hzims_run_month_report` ADD COLUMN `CONCLUSION` text NULL COMMENT '重新判定的结论';
ALTER TABLE `hzims_run_month_report` ADD COLUMN `EVALUATION` text NULL COMMENT '评价';
Loading…
Cancel
Save