diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHistoryVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHistoryVo.java new file mode 100644 index 0000000..feac662 --- /dev/null +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHistoryVo.java @@ -0,0 +1,50 @@ +package com.hnac.hzims.alarm.config.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; + +/** + * @author ysj + */ +@Data +public class AlarmHistoryVo { + + @ApiModelProperty(value = "站点编号") + private String stationId; + + @ApiModelProperty(value = "站点名称") + private String stationName; + + @ApiModelProperty(value = "告警类型") + private Integer alarmType; + + @ApiModelProperty(value = "告警内容") + private String alarmContext; + + @ApiModelProperty("处理人") + private Long handleUser; + + @ApiModelProperty("处理人名称") + private Long handleUserName; + + @ApiModelProperty("处理附件地址") + private String filePath; + + @ApiModelProperty(value = "告警时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + private LocalDateTime alarmTime; + + @ApiModelProperty("处理时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date handleTime; +} \ No newline at end of file diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java new file mode 100644 index 0000000..5660404 --- /dev/null +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/show/vo/AlarmHistoryParamVo.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.alarm.show.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author ysj + * @date 2023/03/17 10:02:33 + * @version 4.0.0 + */ +@Data +public class AlarmHistoryParamVo { + + @ApiModelProperty(value = "站点编号") + private String stationId; + + @ApiModelProperty(value = "告警日期 : yyyy-MM-dd") + private String alarmTime; + + @ApiModelProperty(value = "告警类型") + private Integer alarmType; + + @ApiModelProperty(value = "处理方式") + private Long handleWay; +} + diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/DeviceElectricVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/DeviceElectricVo.java new file mode 100644 index 0000000..9c1f934 --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/electric/vo/DeviceElectricVo.java @@ -0,0 +1,27 @@ +package com.hnac.hzims.electric.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +/** + * @author 表头 + */ +@Data +public class DeviceElectricVo { + + @ApiModelProperty(value = "设备编号") + private String deviceCode; + + @ApiModelProperty(value = "字符串格式时间") + private String strTime; + + @ApiModelProperty(value = "时间") + private Integer time; + + @ApiModelProperty(value = "有功电量") + private Double generate; + + @ApiModelProperty(value = "无功电量") + private Double reactiveGenerate; +} \ No newline at end of file diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectContentEntity.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectContentEntity.java index 508c4f6..16b621a 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectContentEntity.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ProjectContentEntity.java @@ -65,6 +65,20 @@ public class ProjectContentEntity extends BaseEntity { private String checkTypeSon; /** + * 检测类型子类(多组) + */ + @ApiModelProperty(value = "检测类型子类(多组)") + @TableField(exist = false) + private String multiCheckTypeSon; + + /** + * ai识别分析方式,设备或大模型 + */ + @ApiModelProperty(value = "ai识别分析方式,设备或大模型") + @TableField(exist = false) + private String analyserType; + + /** * 表针识别,表盘ID */ @ApiModelProperty(value = "表针识别,表盘ID") diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java index fd81755..ecff4d7 100644 --- a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/constants/SafeProductConstant.java @@ -20,6 +20,7 @@ public interface SafeProductConstant { */ String DOCX_SUFFIX = ".docx"; String PDF_SUFFIX = ".pdf"; + String XLSX_SUFFIX = ".xlsx"; /** * 培训管理 diff --git a/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java new file mode 100644 index 0000000..2987b84 --- /dev/null +++ b/hzims-service-api/safeproduct-api/src/main/java/com/hnac/hzims/safeproduct/dto/HygieneEvaluationExportDTO.java @@ -0,0 +1,59 @@ +package com.hnac.hzims.safeproduct.dto; + +import com.hnac.hzims.safeproduct.vo.HygieneEvaluationPeopleVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liwen + * @date 2024-08-20 + */ +@Data +@ApiModel(value = "卫生考核导出DTO类") +public class HygieneEvaluationExportDTO { + + @ApiModelProperty(value = "年份") + private String year; + + @ApiModelProperty(value = "月份") + private String month; + + @ApiModelProperty(value = "第一周开始日") + private String firstWeekStart; + + @ApiModelProperty(value = "第一周结束日") + private String firstWeekEnd; + + @ApiModelProperty(value = "第二周开始日") + private String secondWeekStart; + + @ApiModelProperty(value = "第二周结束日") + private String secondWeekEnd; + + @ApiModelProperty(value = "第三周开始日") + private String thirdWeekStart; + + @ApiModelProperty(value = "第三周结束日") + private String thirdWeekEnd; + + @ApiModelProperty(value = "第四周开始日") + private String fourthWeekStart; + + @ApiModelProperty(value = "第四周结束日") + private String fourthWeekEnd; + + @ApiModelProperty(value = "第五周开始日") + private String fifthWeekStart; + + @ApiModelProperty(value = "第五周结束日") + private String fifthWeekEnd; + + @ApiModelProperty(value = "备注") + private String remark; + + @ApiModelProperty(value = "考核人员列表") + private List evaluationList; +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java index 651732a..2c7e061 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/ElectricReportServiceImpl.java @@ -2,25 +2,37 @@ package com.hnac.hzims.electric.service.impl; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.hnac.hzims.common.logs.utils.StringUtils; import com.hnac.hzims.electric.entity.ThirtyEntity; import com.hnac.hzims.electric.entity.ThreeEntity; import com.hnac.hzims.electric.service.IElectricReportService; import com.hnac.hzims.electric.service.ThirtyService; import com.hnac.hzims.electric.service.ThreeService; +import com.hnac.hzims.electric.vo.DeviceElectricVo; import com.hnac.hzims.electric.vo.TableHeadVo; +import com.hnac.hzims.equipment.entity.EmInfoEntity; +import com.hnac.hzims.equipment.service.IEmInfoService; import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.vo.StationsByDeptIdsParamVo; +import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; +import com.hnac.hzinfo.datasearch.analyse.po.AnalyseCodeByAnalyseDataPO; +import com.hnac.hzinfo.datasearch.analyse.po.AnalyzeDataConditionPO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyseDataTaosVO; +import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; import org.springframework.stereotype.Service; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -36,10 +48,14 @@ public class ElectricReportServiceImpl implements IElectricReportService { private final ThirtyService thirtyService; + private final IEmInfoService deviceService; + private final ISysClient sysClient; private final IStationClient stationClient; + private final IAnalyseDataSearchClient analyseDataSearchClient; + /** * 基础报表 * @param deptId @@ -433,7 +449,65 @@ public class ElectricReportServiceImpl implements IElectricReportService { Map result = new HashMap<>(); // 日 if (type == 0) { + // 站点设备集合 + List devices = deviceService.list(Wrappers.lambdaQuery() + .eq(EmInfoEntity::getCreateDept,station.getData().getRefDept()) + .eq(EmInfoEntity::getEmType,2) + .eq(EmInfoEntity::getHomePageDisplay,1) + ); + if(CollectionUtil.isEmpty(devices)){ + return new HashMap<>(); + } + Date date = DateUtil.parse(time,DateUtil.PATTERN_DATE); + // 根据设备查询当日有功/无功电量 + List electrics = this.deviceElectrics(devices,date); + + // 表头 + List tableHeads = new ArrayList<>(); + TableHeadVo firstHead = new TableHeadVo(); + firstHead.setTableName("时间"); + firstHead.setIsChildren(false); + tableHeads.add(firstHead); + TableHeadVo secondHead = new TableHeadVo(); + secondHead.setTableName("时总计发电量"); + secondHead.setIsChildren(true); + secondHead.setChildren(Arrays.asList("时总有功","时总无功")); + tableHeads.add(secondHead); + + // 根据设备分组 + devices.forEach(device->{ + TableHeadVo tableHead = new TableHeadVo(); + tableHead.setTableName(device.getName() + "发电量(kWh)"); + tableHead.setIsChildren(true); + tableHead.setChildren(Arrays.asList("时有功","时无功")); + tableHeads.add(tableHead); + }); + result.put("tableHead",tableHeads); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + Date end = calendar.getTime(); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + Date start = calendar.getTime(); + List> tableDate = new ArrayList<>(); + while (start.compareTo(end) < 0){ + List item = new ArrayList<>(); + String hours = DateUtil.format(start,"yyyy-MM-dd HH"); + item.add(start.getMonth() + 1 + "月"); + // 总计:有功、无功 + item.add(electrics.stream().filter(electric -> electric.getStrTime().contains(hours)).mapToDouble(DeviceElectricVo::getGenerate).sum()); + item.add(electrics.stream().filter(electric -> electric.getStrTime().contains(hours)).mapToDouble(DeviceElectricVo::getReactiveGenerate).sum()); + // 遍历机组 + devices.stream().sorted(Comparator.comparing(EmInfoEntity::getEmIndex)).forEach(device->{ + item.add(electrics.stream().filter(electric -> electric.getDeviceCode().equals(device.getNumber()) && electric.getStrTime().contains(hours)).mapToDouble(DeviceElectricVo::getGenerate).sum()); + item.add(electrics.stream().filter(electric -> electric.getDeviceCode().equals(device.getNumber()) && electric.getStrTime().contains(hours)).mapToDouble(DeviceElectricVo::getReactiveGenerate).sum()); + }); + calendar.add(Calendar.DAY_OF_MONTH,1); + start = calendar.getTime(); + tableDate.add(item); + } + result.put("tableDate",tableDate); } // 月 else if (type == 1) { @@ -561,4 +635,80 @@ public class ElectricReportServiceImpl implements IElectricReportService { } return result; } + + /** + * 查询设备当日有功/无功电量 + * @param devices + * @return + */ + private List deviceElectrics(List devices,Date date) { + List electrics = new ArrayList<>(); + devices.forEach(device->{ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + Date endTime = calendar.getTime(); + LocalDateTime end = LocalDateTime.parse(DateUtil.format(new Date(), DateUtil.format(endTime,DateUtil.PATTERN_DATETIME)), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)); + calendar.add(Calendar.HOUR_OF_DAY,-calendar.get(Calendar.HOUR_OF_DAY)); + Date startTime = calendar.getTime(); + LocalDateTime start = LocalDateTime.parse(DateUtil.format(new Date(), DateUtil.format(startTime,DateUtil.PATTERN_DATETIME)), DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME)); + AnalyseCodeByAnalyseDataPO param = new AnalyseCodeByAnalyseDataPO(); + param.setDeviceCode(device.getNumber()); + List conditions = new ArrayList<>(); + // 有功电量 + AnalyzeDataConditionPO generate = new AnalyzeDataConditionPO(); + generate.setFull(1); + generate.setKeepFigures(2); + generate.setAccessRules(6); + generate.setSaveTimeType(2); + generate.setSignages("generation_capacity"); + generate.setTimeInterval(1); + generate.setBeginTime(start); + generate.setEndTime(end); + conditions.add(generate); + // 无功电量 + AnalyzeDataConditionPO reactive = new AnalyzeDataConditionPO(); + reactive.setFull(1); + reactive.setKeepFigures(2); + reactive.setAccessRules(6); + reactive.setSaveTimeType(2); + reactive.setSignages("reactive_generation"); + reactive.setTimeInterval(1); + reactive.setBeginTime(start); + reactive.setEndTime(end);conditions.add(reactive); + param.setSignboardConditions(conditions); + R> result = analyseDataSearchClient.getAnalyzeDataByAnalyzeCodeAndSignages(param); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData())){ + return; + } + while (startTime.compareTo(endTime) < 0){ + DeviceElectricVo electric = new DeviceElectricVo(); + electric.setStrTime(DateUtil.format(startTime,"yyyy-MM-dd HH")); + electric.setTime(startTime.getHours()); + if(ObjectUtil.isEmpty(result.getData().get(0)) || CollectionUtil.isEmpty(result.getData().get(0).getList())){ + electric.setGenerate(result.getData().get(0).getList().stream().filter(o->o.getTs().contains(electric.getStrTime())).mapToDouble(val->{ + if(StringUtils.isEmpty(val.getVal())){ + return 0.0; + } + return Double.parseDouble(val.getVal()); + }).sum()); + }else{ + electric.setGenerate(0.0); + } + if(ObjectUtil.isEmpty(result.getData().get(1)) || CollectionUtil.isEmpty(result.getData().get(1).getList())){ + electric.setReactiveGenerate(result.getData().get(1).getList().stream().filter(o->o.getTs().contains(electric.getStrTime())).mapToDouble(val->{ + if(StringUtils.isEmpty(val.getVal())){ + return 0.0; + } + return Double.parseDouble(val.getVal()); + }).sum()); + }else{ + electric.setReactiveGenerate(0.0); + } + electrics.add(electric); + calendar.add(Calendar.HOUR_OF_DAY,+1); + startTime = calendar.getTime(); + } + }); + return electrics; + } } \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/DeviceHistoryController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/DeviceHistoryController.java index df8ae59..8efc43e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/DeviceHistoryController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/controller/DeviceHistoryController.java @@ -73,4 +73,12 @@ public class DeviceHistoryController extends BladeController { public R> historyCurve(@RequestBody HistoryDataParamVo param) { return R.data(service.historyCurve(param)); } + + @PostMapping("/history_tabulation") + @ApiOperationSupport(order = 3) + @ApiOperation(value = "设备历史数据列表", notes = "获取设备历史数据列表") + public R> historyTabulation(@RequestBody HistoryDataParamVo param) { + return R.data(service.historyTabulation(param)); + } + } \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/IHistoryDeviceService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/IHistoryDeviceService.java index f8e47df..3634011 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/IHistoryDeviceService.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/IHistoryDeviceService.java @@ -27,4 +27,5 @@ public interface IHistoryDeviceService { Map historyCurve(HistoryDataParamVo param); + Map historyTabulation(HistoryDataParamVo param); } \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java index 9184934..1fbc4ad 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryDeviceServiceImpl.java @@ -191,6 +191,16 @@ public class HistoryDeviceServiceImpl implements IHistoryDeviceService { return result.getData(); } + /** + * 获取设备历史数据列表 + * @param param + * @return + */ + @Override + public Map historyTabulation(HistoryDataParamVo param) { + return null; + } + /** * 计算查询数据维度 diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java index c1d24d0..0b5fe63 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.alarm.config.entity.AlarmEntity; import com.hnac.hzims.alarm.config.vo.AlarmCountVo; +import com.hnac.hzims.alarm.config.vo.AlarmHistoryVo; import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.show.vo.AlarmHistoryParamVo; import com.hnac.hzims.alarm.show.vo.AlarmVideoVo; import com.hnac.hzims.alarm.show.vo.ShowQueryVo; import com.hnac.hzims.alarm.source.service.SystemAlarmService; @@ -66,4 +68,11 @@ public class ShowAlarmController extends BladeController { return R.data(alarmService.alarmVideos(stationCode,deviceCode,realId,alarmType)); } + @GetMapping ("/history") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数") + public R> history(AlarmHistoryParamVo param, Query query) { + return R.data(alarmService.pageCondition(param,Condition.getPage(query))); + } + } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java index d6519c2..ae2a948 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java @@ -1,7 +1,11 @@ package com.hnac.hzims.alarm.show.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.alarm.config.entity.AlarmEntity; +import com.hnac.hzims.alarm.config.vo.AlarmHistoryVo; +import com.hnac.hzims.alarm.show.vo.AlarmHistoryParamVo; +import org.apache.ibatis.annotations.Param; /** * @author ysj @@ -9,4 +13,5 @@ import com.hnac.hzims.alarm.config.entity.AlarmEntity; public interface AlarmMapper extends BaseMapper { + IPage pageCondition(@Param(value="param") AlarmHistoryParamVo param, IPage page); } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml index 3fd4b39..f583dc7 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml @@ -2,4 +2,27 @@ + diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java index 2d142a7..46abe4b 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java @@ -4,9 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.hnac.hzims.alarm.config.entity.*; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.alarm.config.vo.AlarmCountVo; +import com.hnac.hzims.alarm.config.vo.AlarmHistoryVo; +import com.hnac.hzims.alarm.show.vo.AlarmHistoryParamVo; import com.hnac.hzims.alarm.show.vo.AlarmVideoVo; import com.hnac.hzims.alarm.show.vo.ShowQueryVo; -import com.hnac.hzims.business.ws.alart.vo.AlartParamVo; import org.springframework.web.socket.TextMessage; import java.util.List; @@ -25,4 +26,6 @@ public interface AlarmService extends IService { TextMessage majorAlarm(List stations); List alarmVideos(String stationCode, String deviceCode, String realId,Integer alarmType); + + IPage pageCondition(AlarmHistoryParamVo param, IPage page); } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java index 9981857..063d5b5 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java @@ -9,14 +9,15 @@ import com.hnac.hzims.alarm.config.constants.AlarmConstants; import com.hnac.hzims.alarm.config.entity.AlarmEntity; import com.hnac.hzims.alarm.config.service.AlarmConfigService; import com.hnac.hzims.alarm.config.vo.AlarmCountVo; +import com.hnac.hzims.alarm.config.vo.AlarmHistoryVo; import com.hnac.hzims.alarm.config.vo.ChildAlarmCountVo; import com.hnac.hzims.alarm.show.mapper.AlarmMapper; import com.hnac.hzims.alarm.show.service.AlarmHandleService; import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.show.vo.AlarmHistoryParamVo; import com.hnac.hzims.alarm.show.vo.AlarmVideoVo; import com.hnac.hzims.alarm.show.vo.ShowQueryVo; import com.hnac.hzims.alarm.source.service.MessageService; -import com.hnac.hzims.business.ws.alart.vo.AlartParamVo; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.entity.EmVideoBandingEntity; import com.hnac.hzims.equipment.feign.IEmInfoClient; @@ -418,6 +419,7 @@ public class AlarmServiceImpl extends ServiceImpl impl throw new ServiceException("未查询到告警视频信息!"); } + /** *查询站点绑定视频信息 * @param stationCode @@ -544,4 +546,15 @@ public class AlarmServiceImpl extends ServiceImpl impl return alarmVideo; }).collect(Collectors.toList()); } + + /** + * 告警历史分页查询 + * @param param + * @param page + * @return + */ + @Override + public IPage pageCondition(AlarmHistoryParamVo param, IPage page) { + return this.baseMapper.pageCondition(param,page); + } } \ No newline at end of file diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java index 7dae059..0f0925a 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/zhipuai/handler/ZhipuAnalysisHandlerGlm4v.java @@ -1,5 +1,6 @@ package com.hnac.hzims.bigmodel.zhipuai.handler; +import cn.hutool.core.lang.Assert; import com.hnac.hzinfo.exception.HzServiceException; import com.zhipu.oapi.Constants; import com.zhipu.oapi.service.v4.model.ChatCompletionRequest; @@ -35,7 +36,7 @@ public class ZhipuAnalysisHandlerGlm4v extends AbstractZhipuAnalysisHandler { @Override public ModelApiResponse sendRequest(String text, String url) { ChatCompletionRequest request = getRequest(text, url); - log.info("send zhipu ai request :{}", Optional.ofNullable(request).map(req -> JsonUtil.toJson(req)).orElse("null")); + log.info("send zhipu ai request :{}", Optional.ofNullable(request).map(JsonUtil::toJson).orElse("null")); return client.invokeModelApi(request); } @@ -70,19 +71,18 @@ public class ZhipuAnalysisHandlerGlm4v extends AbstractZhipuAnalysisHandler { @Override public String getResult(String text, String url) { ModelApiResponse response = sendRequest(text, url); - log.info("get zhi pu ai response : {}", Optional.ofNullable(response).map(resp -> JsonUtil.toJson(resp)).orElse("null")); - if (response.isSuccess()) { - try { - String resultJson = response.getData().getChoices().get(0).getMessage().getContent().toString(); - resultJson = resultJson.substring(resultJson.indexOf("{"), resultJson.lastIndexOf("}") + 1).trim(); - return resultJson; - } catch (Exception e) { - log.info("get data from response error", e); - } - } else { + log.info("get zhi pu ai response : {}", Optional.ofNullable(response).map(JsonUtil::toJson).orElse("null")); + Assert.isTrue(Objects.nonNull(response) && response.isSuccess(), () -> { throw new HzServiceException(response.getMsg()); + }); + try { + String resultJson = response.getData().getChoices().get(0).getMessage().getContent().toString(); + resultJson = resultJson.substring(resultJson.indexOf("{"), resultJson.lastIndexOf("}") + 1).trim(); + return resultJson; + } catch (Exception e) { + log.info("get data from response error", e); + throw new HzServiceException("获取数据失败"); } - return null; } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml index 9f9d5d5..517898c 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/mapper/ProjectContentMapper.xml @@ -3,7 +3,7 @@