diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ActivePowerVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ActivePowerVo.java index 9de2b1b..e1c16f7 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ActivePowerVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/main/vo/ActivePowerVo.java @@ -12,6 +12,9 @@ import lombok.Data; @ApiModel(value = "当日机组有功功率") public class ActivePowerVo { + @ApiModelProperty(value = "字符串时间") + private String strHour; + @ApiModelProperty(value = "小时") private Integer hour; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java index fdd0378..5f7260e 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceLibraryEntity.java @@ -35,13 +35,23 @@ public class OperMaintenanceLibraryEntity extends TenantEntity { @ApiModelProperty(value = "库编码,后台自动生成") @QueryField(condition = SqlCondition.LIKE) private String libraryCode; + + @ApiModelProperty(value = "站点编号") + @QueryField(condition = SqlCondition.EQUAL) + private String stationCode; + + @ApiModelProperty(value = "站点名称") + private String stationName; /** * 设备编码 */ @ApiModelProperty(value = "设备编码,多个按,分隔") - @QueryField(condition = SqlCondition.EQUAL) + @QueryField(condition = SqlCondition.LIKE) private String emCode; + @ApiModelProperty(value = "设备名称,多个按,分隔") + private String emName; + @ApiModelProperty(value = "维护模式 01=人员 02=值班") @JsonSerialize(nullsUsing = NullSerializer.class) private Integer maintenanceModel; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java index d1f9a3f..e473eba 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java @@ -8,6 +8,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; import java.util.Date; @@ -26,6 +28,16 @@ public class OperMaintenancePlanEntity extends TenantEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "站点编号") + private String stationCode; + + @ApiModelProperty(value = "站点名称") + @QueryField(condition = SqlCondition.EQUAL) + private String stationName; + + @ApiModelProperty(value = "设备名称,多个按,分隔") + private String emName; + /** * 设备编码 */ @@ -115,11 +127,9 @@ public class OperMaintenancePlanEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) private Long messageTemplateId; - - /** - * 站点code - */ - private String stationCode; + @ApiModelProperty(value = "周期(单位:小时)") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer period; @ApiModelProperty(value = "创建用户名称") private String createUserName; diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java index a06949a..2a94015 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenanceTaskEntity.java @@ -10,6 +10,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; import org.springblade.core.tool.utils.DateUtil; import org.springframework.format.annotation.DateTimeFormat; @@ -31,6 +33,16 @@ public class OperMaintenanceTaskEntity extends TenantEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "站点编号") + private String stationCode; + + @ApiModelProperty(value = "站点名称") + @QueryField(condition = SqlCondition.EQUAL) + private String stationName; + + @ApiModelProperty(value = "设备名称,多个按,分隔") + private String emName; + /** * 设备编码 */ @@ -107,6 +119,9 @@ public class OperMaintenanceTaskEntity extends TenantEntity { */ @ApiModelProperty(value = "维护内容") private String content; + @ApiModelProperty(value = "周期(单位:小时)") + @JsonSerialize(nullsUsing = NullSerializer.class) + private Integer period; /** * 操作规范 */ diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/AlarmDefaulConfigMapper.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/AlarmDefaulConfigMapper.java new file mode 100644 index 0000000..0c72ee8 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/mapper/alarm/AlarmDefaulConfigMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.mapper.alarm; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.alarm.config.entity.AlarmDefaultConfigEntity; + +/** + * @author ysj + */ +public interface AlarmDefaulConfigMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmDefaulConfigService.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmDefaulConfigService.java new file mode 100644 index 0000000..6ad4b2a --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/AlarmDefaulConfigService.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.scheduled.service.alarm; + +import com.hnac.hzims.alarm.config.entity.AlarmDefaultConfigEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + */ +public interface AlarmDefaulConfigService extends BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmDefaulConfigServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmDefaulConfigServiceImpl.java new file mode 100644 index 0000000..2cd8f08 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmDefaulConfigServiceImpl.java @@ -0,0 +1,21 @@ +package com.hnac.hzims.scheduled.service.alarm.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hnac.hzims.alarm.config.entity.AlarmDefaultConfigEntity; +import com.hnac.hzims.scheduled.mapper.alarm.AlarmDefaulConfigMapper; +import com.hnac.hzims.scheduled.service.alarm.AlarmDefaulConfigService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@AllArgsConstructor +@Service +@Slf4j +@DS("alarm") +public class AlarmDefaulConfigServiceImpl extends BaseServiceImpl implements AlarmDefaulConfigService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java index 616374e..dba937a 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/alarm/impl/AlarmServiceImpl.java @@ -3,12 +3,14 @@ package com.hnac.hzims.scheduled.service.alarm.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.alarm.config.constants.AlarmConstants; +import com.hnac.hzims.alarm.config.entity.AlarmDefaultConfigEntity; import com.hnac.hzims.alarm.config.entity.AlarmEntity; import com.hnac.hzims.business.interruption.constants.InterruptionConstants; import com.hnac.hzims.business.interruption.entity.InterruptionEntity; import com.hnac.hzims.operational.main.constant.HomePageConstant; import com.hnac.hzims.operational.main.vo.HydropowerUnitRealVo; import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.scheduled.service.alarm.AlarmDefaulConfigService; import com.hnac.hzims.scheduled.service.alarm.AlarmQueryService; import com.hnac.hzims.scheduled.service.alarm.AlarmService; import com.hnac.hzims.scheduled.service.operation.station.StationService; @@ -42,6 +44,8 @@ public class AlarmServiceImpl implements AlarmService { private final AlarmQueryService alarmQueryService; + private final AlarmDefaulConfigService defaulConfigService; + private final InterruptionAlarmServiceImpl interruptionAlarmService; private final ISoeClient soeClient; @@ -68,13 +72,20 @@ public class AlarmServiceImpl implements AlarmService { if(CollectionUtil.isEmpty(stations)){ return; } - + // 查询开关机默认告警配置 + AlarmDefaultConfigEntity start = defaulConfigService.getOne(Wrappers.lambdaQuery() + .eq(AlarmDefaultConfigEntity::getSource,5) + .eq(AlarmDefaultConfigEntity::getAlarmChiledType,50) + ); + AlarmDefaultConfigEntity stop = defaulConfigService.getOne(Wrappers.lambdaQuery() + .eq(AlarmDefaultConfigEntity::getSource,5) + .eq(AlarmDefaultConfigEntity::getAlarmChiledType,51) + ); // 获取站点设备实时数据 List reals = (List) redisTemplate.opsForValue().get(load_hydropower_unit_real_key); if(CollectionUtil.isEmpty(reals)){ return; } - Map refresh = new HashMap<>(); // 实时设备遍历 reals.forEach(real->{ @@ -96,24 +107,25 @@ public class AlarmServiceImpl implements AlarmService { return; } // 比对开机状态 - if(Math.abs(real.getActivePower()) > 0){ + if(real.getActivePower() > 0){ if(startStopMap.get(real.getDeviceCode()) == 0){ refresh.put(real.getDeviceCode(),1); // 记录开机告警 - this.saveStartStopAlarm(station,real,1); + this.saveStartStopAlarm(station,real,start,1); }else{ - refresh.put(real.getDeviceCode(),0); + refresh.put(real.getDeviceCode(),1); } }else{ if(startStopMap.get(real.getDeviceCode()) == 1){ refresh.put(real.getDeviceCode(),0); // 记录关机告警 - this.saveStartStopAlarm(station,real,0); + this.saveStartStopAlarm(station,real,stop,0); }else{ - refresh.put(real.getDeviceCode(),1); + refresh.put(real.getDeviceCode(),0); } } }); + log.error("start_stop_alarm : {}",refresh); redisTemplate.opsForValue().set(start_stop_cache_final,refresh); } @@ -132,7 +144,7 @@ public class AlarmServiceImpl implements AlarmService { * @param real * @param state */ - private void saveStartStopAlarm(StationEntity station, HydropowerUnitRealVo real, int state) { + private void saveStartStopAlarm(StationEntity station, HydropowerUnitRealVo real,AlarmDefaultConfigEntity defaultConfig, int state) { AlarmEntity alarm = new AlarmEntity(); alarm.setStationId(station.getCode()); alarm.setStationName(station.getName()); @@ -148,14 +160,25 @@ public class AlarmServiceImpl implements AlarmService { } alarm.setStatus(0); alarm.setAlarmTime(new Date()); - alarm.setIsRightTabulation(0); - alarm.setIsShowAlert(1); - alarm.setIsSmallBell(1); - alarm.setIsMask(1); - alarm.setIsBroadcast(1); - alarm.setIsPlatformMessage(1); - alarm.setIsShortMessage(1); - alarm.setIsWxMessage(1); + if(ObjectUtil.isEmpty(defaultConfig)){ + alarm.setIsRightTabulation(0); + alarm.setIsShowAlert(1); + alarm.setIsSmallBell(1); + alarm.setIsMask(1); + alarm.setIsBroadcast(1); + alarm.setIsPlatformMessage(1); + alarm.setIsShortMessage(1); + alarm.setIsWxMessage(1); + }else{ + alarm.setIsRightTabulation(defaultConfig.getIsRightTabulation()); + alarm.setIsShowAlert(defaultConfig.getIsShowAlert()); + alarm.setIsSmallBell(defaultConfig.getIsSmallBell()); + alarm.setIsMask(defaultConfig.getIsMask()); + alarm.setIsBroadcast(defaultConfig.getIsBroadcast()); + alarm.setIsPlatformMessage(defaultConfig.getIsPlatformMessage()); + alarm.setIsShortMessage(defaultConfig.getIsShortMessage()); + alarm.setIsWxMessage(defaultConfig.getIsWxMessage()); + } alarm.setTenantId(station.getTenantId()); alarm.setCreateDept(station.getRefDept()); alarm.setCreateUser(station.getCreateUser()); diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java index 26b56ec..d6e87bc 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/home/impl/RealTargetServiceImpl.java @@ -1379,8 +1379,12 @@ public class RealTargetServiceImpl implements RealTargetService { * @return */ private List getLoadsByDay(EminfoAndEmParamVo device) { - String start = DateUtil.format(new Date(), DateUtil.PATTERN_DATE) + " 00:00:00"; - String end = DateUtil.format(new Date(), DateUtil.PATTERN_DATETIME); + // 结束日期 + Calendar calendar = Calendar.getInstance(); + String end = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATETIME); + // 开始日期 + calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) - 24); + String start = DateUtil.format(calendar.getTime(),DateUtil.PATTERN_DATE) + " 00:00:00"; List records = dataService.periodTargetData(start, end, 3, 2, device.getEmCode(), HomePageConstant.PV_LOAD); if (CollectionUtil.isEmpty(records)) { return new ArrayList<>(); @@ -1388,10 +1392,11 @@ public class RealTargetServiceImpl implements RealTargetService { return records.stream().map(record -> { ActivePowerVo load = new ActivePowerVo(); Date time = DateUtil.parse(record.getTs(), "yyyy-MM-dd HH:mm:ss.s"); + load.setStrHour(DateUtil.format(time,"yyyy-MM-dd HH")); load.setHour(time.getHours()); load.setActivePower(Optional.ofNullable(record.getVal()).orElse("0")); return load; - }).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList()); + }).sorted(Comparator.comparing(ActivePowerVo::getStrHour)).sorted(Comparator.comparing(ActivePowerVo::getHour)).collect(Collectors.toList()); } /** diff --git a/hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/AlarmDefaulConfigMapper.xml b/hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/AlarmDefaulConfigMapper.xml new file mode 100644 index 0000000..b8876c6 --- /dev/null +++ b/hzims-service/hzims-scheduled/src/main/resources/mapper/alarm/AlarmDefaulConfigMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java index c318d5a..fe22696 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/scheduled/MaintenanceTaskSchedule.java @@ -3,6 +3,7 @@ package com.hnac.hzims.operational.maintenance.scheduled; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.operational.constants.FlowKeyConstants; import com.hnac.hzims.operational.constants.RedisKeyConstants; @@ -61,6 +62,7 @@ public class MaintenanceTaskSchedule { private final IFlowClient flowClient; private final IImsDutyMainService dutyMainService; private final RedisTemplate redisTemplate; + private final IEmInfoClient emInfoClient; @XxlJob(GENERATE_MAINTENANCE_TASK_SCHEDULE) public ReturnT execute(String param) throws Exception { @@ -87,24 +89,24 @@ public class MaintenanceTaskSchedule { OperMaintenanceTaskEntity taskEntity = BeanUtil.copy(plan,OperMaintenanceTaskEntity.class); taskEntity.setPlanId(plan.getId()); taskEntity.setDisposer(Optional.ofNullable(plan.getDisposer()).map(String::valueOf).orElse(null)); - taskEntity.setDisposerName(Optional.ofNullable(plan.getDisposer()).map(s -> - { - User user = UserCache.getUser(s); - if (ObjectUtil.isNotEmpty(user)){ - return user.getName(); - }else { - return ""; - } - }).filter(s->StringUtils.isNotBlank(s)).orElse(null)); + String disposerName = Optional.ofNullable(plan.getDisposer()).map(UserCache::getUser).map(User::getName).orElse(null); + taskEntity.setDisposerName(disposerName); LocalDateTime disposeTime = taskEntity.getDisposeTime().toInstant() .atZone(ZoneId.systemDefault()).toLocalDateTime(); taskEntity.setPlanEndTime(disposeTime.plusHours(taskEntity.getHours())); if(StringUtil.isNotBlank(plan.getEmCode())){ - String[] emCodeList = plan.getEmCode().split(","); - for(String emCode : emCodeList){ + List emCodeList = Func.toStrList(",", plan.getEmCode()); + emCodeList.stream().filter(StringUtil::isNotBlank).forEach(emCode -> { + EmInfoEntity emInfoEntity = emInfoClient.getByCode(emCode); + if(ObjectUtil.isEmpty(emInfoEntity)) { + log.error( "[{}]设备编号未查询到相关设备,生成任务失败!",emCode); + XxlJobLogger.log("[" + emCode + "]设备编号未查询到相关设备,生成任务失败!"); + return; + } taskEntity.setEmCode(emCode); + taskEntity.setEmName(emInfoEntity.getName()); this.createTask(taskEntity,plan); - } + }); } else { this.createTask(taskEntity,plan); @@ -139,7 +141,7 @@ public class MaintenanceTaskSchedule { Instant instant = task.getDisposeTime().toInstant(); ZoneId zoneId = ZoneId.systemDefault(); LocalDateTime disposeTime = instant.atZone(zoneId).toLocalDateTime(); - task.setPlanEndTime(disposeTime.plusHours(task.getHours())); + task.setPlanEndTime(disposeTime.plusHours(task.getPeriod())); // 当模式为班次时 Integer maintenanceModel = plan.getMaintenanceModel(); if(Func.isNotEmpty(maintenanceModel) && maintenanceModel == 2 ) { @@ -149,20 +151,11 @@ public class MaintenanceTaskSchedule { ImsDutyMainEntity entity = dutyMainService.getOne(dutyQuery); if (ObjectUtil.isNotEmpty(entity) && StringUtils.isNotEmpty(entity.getDutyPersonIds())) { String userId = entity.getDutyPersonIds(); - String[] split = userId.split("\\^"); task.setDisposer(userId.replaceAll("\\^", ",")); - if (ArrayUtils.isNotEmpty(split)){ - List list = Arrays.asList(split); - String disposerName= list.stream().map(s->{ - User user = UserCache.getUser(Long.valueOf(s)); - if (ObjectUtil.isNotEmpty(user)){ - return user.getName();} - return ""; - }).filter(s->StringUtils.isNotBlank(s)).collect(Collectors.joining(",")); - if (StringUtils.isNotBlank(disposerName)) { - task.setDisposerName(disposerName); - } - } + List userIdList = Func.toLongList("\\^", userId); + String disposerName = userIdList.stream().map(UserCache::getUser).filter(Func::isNotEmpty) + .map(User::getName).filter(StringUtil::isNotBlank).collect(Collectors.joining(",")); + task.setDisposerName(Optional.ofNullable(disposerName).filter(StringUtil::isNotBlank).orElse(null)); } else { XxlJobLogger.log("ID为:"+plan.getId()+"的日常维护计划未获取到值班人员,未生成任务。"); @@ -205,5 +198,4 @@ public class MaintenanceTaskSchedule { R flowResult = flowClient.startProcessInstanceContainNameByKey(FlowKeyConstants.MAINTENANCE_TASK_FLOW_KEY, String.valueOf(task.getId()), task.getTitle(), params); return Optional.ofNullable(flowResult).filter(r -> r.isSuccess()).map(R::getData).map(BladeFlow::getProcessInstanceId).orElse(null); } - } diff --git a/hzims-service/operational/src/main/resources/db/1.0.0.sql b/hzims-service/operational/src/main/resources/db/1.0.0.sql index 31fa6f7..c060a25 100644 --- a/hzims-service/operational/src/main/resources/db/1.0.0.sql +++ b/hzims-service/operational/src/main/resources/db/1.0.0.sql @@ -789,7 +789,7 @@ CREATE TABLE IF NOT EXISTS `HZIMS_FLV_VIDEO_CONFIG` ( `ID` BIGINT(20) NOT NULL COMMENT '主键ID', `NAME` VARCHAR(255) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '视频源名称', `TIME` VARCHAR(50) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '时间间隔', - `CONFIG_ENTITY` VARCHAR(1000) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '配置JSON', + `CONFIG_ENTITY` TEXT CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '配置JSON', `TYPE` TINYINT(4) NULL DEFAULT 1 COMMENT '类型', `SAVE_PEOPLE` VARCHAR(100) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '保存人姓名', `TENANT_ID` VARCHAR(12) CHARACTER SET UTF8 COLLATE UTF8_GENERAL_CI NULL DEFAULT NULL COMMENT '租户ID', @@ -800,9 +800,9 @@ CREATE TABLE IF NOT EXISTS `HZIMS_FLV_VIDEO_CONFIG` ( `IS_DELETED` TINYINT(4) NOT NULL DEFAULT 0 COMMENT '是否删除', `STATUS` TINYINT(4) NULL DEFAULT NULL COMMENT '状态 ', `CREATE_DEPT` BIGINT(20) NULL DEFAULT NULL COMMENT '创建部门', - PRIMARY KEY (`ID`) USING BTREE, - INDEX ```XCONFIG_ENTITY```(`CONFIG_ENTITY`) USING BTREE -) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; + PRIMARY KEY (`ID`) USING BTREE + ) ENGINE = INNODB CHARACTER SET = UTF8 COLLATE = UTF8_GENERAL_CI ROW_FORMAT = DYNAMIC; +ALTER TABLE HZIMS_FLV_VIDEO_CONFIG ADD FULLTEXT(`CONFIG_ENTITY`); -- ---------------------------- -- TABLE STRUCTURE FOR HZIMS_FOCUS_ATTRIBUTE diff --git a/hzims-service/operational/src/main/resources/db/2.0.3.sql b/hzims-service/operational/src/main/resources/db/2.0.3.sql new file mode 100644 index 0000000..c8df871 --- /dev/null +++ b/hzims-service/operational/src/main/resources/db/2.0.3.sql @@ -0,0 +1,14 @@ +-- 设备维护库添加站点、设备名称 +alter table `hzims_oper_maintenance_library` add column `station_code` varchar(20) comment '站点编号'; +alter table `hzims_oper_maintenance_library` add column `station_name` varchar(100) comment '站点名称'; +alter table `hzims_oper_maintenance_library` add column `em_name` varchar(255) comment '设备名称'; +-- 日常维护计划添加站点、设备名称 +alter table `hzims_oper_maintenance_plan` add column `station_name` varchar(100) comment '站点名称'; +alter table `hzims_oper_maintenance_plan` add column `em_name` varchar(255) comment '设备名称'; +-- 日常维护任务添加站点、设备名称 +alter table `hzims_oper_maintenance_task` add column `station_code` varchar(20) comment '站点编号'; +alter table `hzims_oper_maintenance_task` add column `station_name` varchar(100) comment '站点名称'; +alter table `hzims_oper_maintenance_task` add column `em_name` varchar(255) comment '设备名称'; +-- 日常维护计划、任务添加周期字段 +alter table `hzims_oper_maintenance_plan` add column `period` int(11) comment '周期(单位:小时)'; +alter table `hzims_oper_maintenance_task` add column `period` int(11) comment '周期(单位:小时)'; \ No newline at end of file