Merge remote-tracking branch 'origin/master'
| | |
| | | import javax.annotation.security.PermitAll; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | |
| | | public static final String JsonSavePath = "D:/hk-project/json";//海康威视抓取图片上传路径 |
| | | // public static final String JsonSavePath = "D:/DLUT/json";//海康威视抓取图片上传路径 |
| | | |
| | | // public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; |
| | | public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; |
| | | public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; |
| | | // public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; |
| | | |
| | | public static final String ModelCode = "Image_feature";//模型代码 |
| | | |
| | |
| | | @Operation(summary = "预测数据图表") |
| | | PreDataSingleChartRespVO getPreDataSingleChart(@RequestBody PreDataSingleChartReqVO reqVO); |
| | | |
| | | @PostMapping(PREFIX + "/predict-data/cur") |
| | | @Operation(summary = "获取当前预测数据") |
| | | Map<String, List<Object[]>> getPreDataCur(PreDataJsonReqVO reqVO); |
| | | |
| | | @PostMapping(PREFIX + "/plan-data/single-chart") |
| | | @Operation(summary = "计划数据图表") |
| | | PlanDataSingleChartRespVO getPlanDataSingleChart(@RequestBody PreDataSingleChartReqVO reqVO); |
| | |
| | | |
| | | @GetMapping(PREFIX + "/alarm-message/list") |
| | | @Operation(summary = "获取预警信息列表") |
| | | List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam Map<String, Object> params); |
| | | List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam("params") Map<String, Object> params); |
| | | |
| | | @GetMapping(PREFIX + "/alarm-config/list") |
| | | @Operation(summary = "获取预警配置列表") |
| | | List<AlarmConfigRespDTO> listAlarmConfig(@RequestParam("params") Map<String, Object> params); |
| | | |
| | | @GetMapping(PREFIX + "/alarm-message/last-one") |
| | | @Operation(summary = "获取最新预警信息") |
| | | AlarmMessageRespDTO getLastAlarmMessage(@RequestParam("alarmObj") String alarmObj); |
| | | |
| | | @PostMapping(PREFIX + "/schedule-suggest/create") |
| | | @Operation(summary = "添加调度建议") |
| | |
| | | |
| | | @GetMapping(PREFIX + "/schedule-suggest/list") |
| | | @Operation(summary = "获取调度建议列表") |
| | | List<ScheduleSuggestRespDTO> listScheduleSuggest(@RequestParam ScheduleSuggestReqDTO params); |
| | | List<ScheduleSuggestRespDTO> listScheduleSuggest(@RequestParam("params") ScheduleSuggestReqDTO params); |
| | | |
| | | @PostMapping(PREFIX + "/predict-model-setting/modify") |
| | | @Operation(summary = "修改预测模型设置参数") |
| | | Boolean modifyPredictModelSetting(@RequestBody List<PredictModelSettingReqDTO> dtos); |
| | | |
| | | @GetMapping(PREFIX + "/schedule-suggest/last-limit") |
| | | @Operation(summary = "获取调度建议列表") |
| | | List<ScheduleSuggestRespDTO> getLastLimitScheduleSuggest(@RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit); |
| | | |
| | | |
| | | @PostMapping(PREFIX + "/schedule-model-setting/modify") |
| | | @Operation(summary = "修改调度模型设置参数") |
| | | Boolean modifyScheduleModelSetting(@RequestBody List<ScheduleModelSettingReqDTO> dtos); |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型平台 - Request VO") |
| | | @Data |
| | | public class AlarmConfigReqDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "消息标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "监控对象") |
| | | private String alarmObj; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警配置 Response VO") |
| | | @Data |
| | | public class AlarmConfigRespDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "消息标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "监控对象") |
| | | private String alarmObj; |
| | | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "输出ID") |
| | | private String outId; |
| | | |
| | | private String outName; |
| | | |
| | | @Schema(description = "比较长度") |
| | | private Integer compLength; |
| | | |
| | | @Schema(description = "上限") |
| | | private BigDecimal upperLimit; |
| | | |
| | | @Schema(description = "下限") |
| | | private BigDecimal lowerLimit; |
| | | |
| | | @Schema(description = "单位") |
| | | private String unit; |
| | | |
| | | @Schema(description = "转换系数") |
| | | private BigDecimal coefficient; |
| | | |
| | | @Schema(description = "调度方案") |
| | | private String scheduleId; |
| | | |
| | | @Schema(description = "是否启用(0禁用 1启用)") |
| | | private Integer isEnable; |
| | | |
| | | @Schema(description = "创建者") |
| | | private String creator; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @Schema(description = "更新者") |
| | | private String updater; |
| | | |
| | | @Schema(description = "更新时间") |
| | | private Date updateTime; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月27日 |
| | | */ |
| | | @Data |
| | | public class PreDataJsonReqVO implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "预测时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date predictTime; |
| | | |
| | | @Schema(description = "预测输出ID") |
| | | private List<String> outputIdList; |
| | | } |
| | |
| | | import com.iailab.module.model.common.enums.PreLineTypeEnum; |
| | | import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
| | | import com.iailab.module.model.mcs.pre.service.*; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mpk.service.ChartService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private ChartService chartService; |
| | | |
| | | @Autowired |
| | | private MmPredictAlarmMessageService mmPredictAlarmMessageService; |
| | | |
| | | @Autowired |
| | | private StScheduleSuggestService stScheduleSuggestService; |
| | | |
| | | @Autowired |
| | | private PlanItemApi planItemApi; |
| | | |
| | | @Autowired |
| | | private MmPredictAlarmConfigService mmPredictAlarmConfigService; |
| | | |
| | | |
| | | private int HOUR_MINS = 60; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<Object[]>> getPreDataCur(PreDataJsonReqVO reqVO) { |
| | | Map<String, List<Object[]>> result = new HashMap<>(); |
| | | if (reqVO == null || reqVO.getPredictTime() == null || CollectionUtils.isEmpty(reqVO.getOutputIdList())) { |
| | | return result; |
| | | } |
| | | reqVO.getOutputIdList().forEach(outPutId -> { |
| | | result.put(outPutId, mmItemResultJsonService.getData(outPutId, reqVO.getPredictTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public PlanDataSingleChartRespVO getPlanDataSingleChart(PreDataSingleChartReqVO reqVO) { |
| | | PlanDataSingleChartRespVO result = new PlanDataSingleChartRespVO(); |
| | | Map<String, String> chartParams = chartService.getByChartCode(reqVO.getChartCode()); |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 新增预警信息 |
| | | * |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean createAlarmMessage(AlarmMessageRespDTO dto) { |
| | | return true; |
| | | try { |
| | | mmPredictAlarmMessageService.create(ConvertUtils.sourceToTarget(dto, MmPredictAlarmMessageSaveReqVO.class)); |
| | | return true; |
| | | } catch (Exception e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmMessageRespDTO> listAlarmMessage(Map<String, Object> params) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmConfigRespDTO> listAlarmConfig(Map<String, Object> params) { |
| | | return mmPredictAlarmConfigService.list(params); |
| | | } |
| | | |
| | | @Override |
| | | public AlarmMessageRespDTO getLastAlarmMessage(String alarmObj) { |
| | | MmPredictAlarmMessageEntity entity = mmPredictAlarmMessageService.getLast(alarmObj); |
| | | return ConvertUtils.sourceToTarget(entity, AlarmMessageRespDTO.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestRespDTO> listScheduleSuggest(ScheduleSuggestReqDTO params) { |
| | | return null; |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestRespDTO> getLastLimitScheduleSuggest(String scheduleObj, Integer limit) { |
| | | List<StScheduleSuggestEntity> list = stScheduleSuggestService.getList(scheduleObj, limit); |
| | | return ConvertUtils.sourceToTarget(list, ScheduleSuggestRespDTO.class); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| | | |
| | | /** |
| | |
| | | |
| | | @GetMapping("/predict-data/exportValue") |
| | | @Operation(summary = "导出预测数据") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportPointValue(@RequestParam("itemId") String itemId, |
| | | @RequestParam("startTime") String startTime, |
| | | @RequestParam("endTime") String endTime, |
| | |
| | | reqVO.setItemId(itemId); |
| | | try { |
| | | if (startTime == "") { |
| | | reqVO.setStartTime(new Date((new Date()).getTime() - 60*60*1000)); |
| | | reqVO.setStartTime(new Date((new Date()).getTime() - 60 * 60 * 1000)); |
| | | } else { |
| | | reqVO.setStartTime(formatter.parse(startTime)); |
| | | |
| | | } |
| | | if (endTime == "") { |
| | | reqVO.setEndTime(new Date((new Date()).getTime() + 60*60*1000)); |
| | | reqVO.setEndTime(new Date((new Date()).getTime() + 60 * 60 * 1000)); |
| | | } else { |
| | | reqVO.setEndTime(formatter.parse(endTime)); |
| | | } |
| | |
| | | } |
| | | PreDataItemChartRespVO respVO = mcsApi.getPreDataItemChart(reqVO); |
| | | try { |
| | | String sheetTitle = "sheet1"; |
| | | String sheetTitle = "sheet1"; |
| | | ExcelUtil.exportchart(sheetTitle, respVO, response); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/alarm-message/last-one") |
| | | @Operation(summary = "根据监控对象获取最新预警信息") |
| | | public CommonResult<AlarmMessageRespDTO> getLastAlarmMessage(HttpServletResponse response, HttpServletRequest |
| | | request, @RequestParam("alarmObj") String alarmObj) { |
| | | AlarmMessageRespDTO data = mcsApi.getLastAlarmMessage(alarmObj); |
| | | return CommonResult.success(data); |
| | | } |
| | | |
| | | @GetMapping("/schedule-suggest/last-limit") |
| | | @Operation(summary = "根据监控对象获取最新预警信息") |
| | | public CommonResult<List<ScheduleSuggestRespDTO>> getLastLimitScheduleSuggest(HttpServletResponse response, HttpServletRequest |
| | | request, @RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit) { |
| | | List<ScheduleSuggestRespDTO> data = mcsApi.getLastLimitScheduleSuggest(scheduleObj, limit); |
| | | return CommonResult.success(data); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * @author lirm |
| | | * @Description |
| | | * @createTime 2024年11月25日 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/model/item/accuracy-his") |
| | | public class MmItemAccuracyHisController { |
| | | |
| | | @Autowired |
| | | private MmItemAccuracyHisService mmItemAccuracyHisService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建预测精准度历史配置") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-his:create')") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody MmItemAccuracyHisSaveReqVO createReqVO) { |
| | | mmItemAccuracyHisService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新预测精准度历史配置") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-his:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody MmItemAccuracyHisSaveReqVO updateReqVO) { |
| | | mmItemAccuracyHisService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除预测精准度历史配置") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-his:delete')") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | mmItemAccuracyHisService.delete(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get/{id}") |
| | | @Operation(summary = "获得预测精准度历史配置") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')") |
| | | public CommonResult<MmItemAccuracyHisRespVO> getInfo(@PathVariable("id") String id) { |
| | | MmItemAccuracyHisEntity entity = mmItemAccuracyHisService.getInfo(id); |
| | | return success(BeanUtils.toBean(entity, MmItemAccuracyHisRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得预测精准度历史配置分页") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-his:query')") |
| | | public CommonResult<PageResult<MmItemAccuracyHisRespVO>> getTenantPage(@Valid MmItemAccuracyHisPageReqVO pageVO) { |
| | | PageResult<MmItemAccuracyHisEntity> pageResult = mmItemAccuracyHisService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, MmItemAccuracyHisRespVO.class)); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * @author lirm |
| | | * @Description |
| | | * @createTime 2024年11月25日 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/model/item/accuracy-rate") |
| | | public class MmItemAccuracyRateController { |
| | | |
| | | @Autowired |
| | | private MmItemAccuracyRateService mmItemAccuracyRateService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建预测精准度配置") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-rate:create')") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody MmItemAccuracyRateSaveReqVO createReqVO) { |
| | | mmItemAccuracyRateService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "更新预测精准度配置") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-rate:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody MmItemAccuracyRateSaveReqVO updateReqVO) { |
| | | mmItemAccuracyRateService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "删除预测精准度配置") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-rate:delete')") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | mmItemAccuracyRateService.delete(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get/{id}") |
| | | @Operation(summary = "获得预测精准度配置") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-rate:query')") |
| | | public CommonResult<MmItemAccuracyRateRespVO> getInfo(@PathVariable("id") String id) { |
| | | MmItemAccuracyRateEntity entity = mmItemAccuracyRateService.getInfo(id); |
| | | return success(BeanUtils.toBean(entity, MmItemAccuracyRateRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得预测精准度配置分页") |
| | | @PreAuthorize("@ss.hasPermission('item:accuracy-rate:query')") |
| | | public CommonResult<PageResult<MmItemAccuracyRateRespVO>> getTenantPage(@Valid MmItemAccuracyRatePageReqVO pageVO) { |
| | | PageResult<MmItemAccuracyRateEntity> pageResult = mmItemAccuracyRateService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, MmItemAccuracyRateRespVO.class)); |
| | | } |
| | | } |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @GetMapping("/get/{id}") |
| | | @Operation(summary = "获得预警配置") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('pre:alarm-config:query')") |
| | | public CommonResult<MmPredictAlarmConfigRespVO> getInfo(@RequestParam("id") String id) { |
| | | public CommonResult<MmPredictAlarmConfigRespVO> getInfo(@PathVariable("id") String id) { |
| | | MmPredictAlarmConfigEntity entity = mmPredictAlarmConfigService.getInfo(id); |
| | | return success(BeanUtils.toBean(entity, MmPredictAlarmConfigRespVO.class)); |
| | | } |
| | |
| | | @Operation(summary = "获得预警配置分页") |
| | | @PreAuthorize("@ss.hasPermission('pre:alarm-config:query')") |
| | | public CommonResult<PageResult<MmPredictAlarmConfigRespVO>> getTenantPage(@Valid MmPredictAlarmConfigPageReqVO pageVO) { |
| | | PageResult<MmPredictAlarmConfigEntity> pageResult = mmPredictAlarmConfigService.page(pageVO); |
| | | PageResult<MmPredictAlarmConfigRespVO> pageResult = mmPredictAlarmConfigService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, MmPredictAlarmConfigRespVO.class)); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.dao; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface MmItemAccuracyHisDao extends BaseMapperX<MmItemAccuracyHisEntity> { |
| | | } |
| | | |
| | | default PageResult<MmItemAccuracyHisEntity> selectPage(MmItemAccuracyHisPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MmItemAccuracyHisEntity>() |
| | | .likeIfPresent(MmItemAccuracyHisEntity::getRateId, reqVO.getRateId()) |
| | | .likeIfPresent(MmItemAccuracyHisEntity::getInDeviation, reqVO.getInDeviation()) |
| | | .orderByDesc(MmItemAccuracyHisEntity::getCreateTime)); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.dao; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface MmItemAccuracyRateDao extends BaseMapperX<MmItemAccuracyRateEntity> { |
| | | |
| | | default PageResult<MmItemAccuracyRateEntity> selectPage(MmItemAccuracyRatePageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MmItemAccuracyRateEntity>() |
| | | .orderByDesc(MmItemAccuracyRateEntity::getCreateTime)); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | @Mapper |
| | | public interface MmPredictAlarmConfigDao extends BaseMapperX<MmPredictAlarmConfigEntity> { |
| | | |
| | | default PageResult<MmPredictAlarmConfigEntity> selectPage(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<MmPredictAlarmConfigEntity>() |
| | | .likeIfPresent(MmPredictAlarmConfigEntity::getTitle, reqVO.getTitle()) |
| | | .likeIfPresent(MmPredictAlarmConfigEntity::getAlarmObj, reqVO.getAlarmObj()) |
| | | .orderByDesc(MmPredictAlarmConfigEntity::getCreateTime)); |
| | | IPage<MmPredictAlarmConfigRespVO> getPageList(IPage<MmPredictAlarmConfigEntity> page, @Param("params") MmPredictAlarmConfigPageReqVO reqVO); |
| | | |
| | | default IPage<MmPredictAlarmConfigRespVO> selectPage(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | return getPageList(getPage(reqVO), reqVO); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月19日 |
| | | */ |
| | | public interface MmItemAccuracyHisService { |
| | | |
| | | PageResult<MmItemAccuracyHisEntity> page(MmItemAccuracyHisPageReqVO pageVO); |
| | | |
| | | MmItemAccuracyHisEntity getInfo(String id); |
| | | |
| | | void create(MmItemAccuracyHisSaveReqVO createReqVO); |
| | | |
| | | void update(MmItemAccuracyHisSaveReqVO updateReqVO); |
| | | |
| | | void delete(String id); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月19日 |
| | | */ |
| | | public interface MmItemAccuracyRateService { |
| | | |
| | | PageResult<MmItemAccuracyRateEntity> page(MmItemAccuracyRatePageReqVO pageVO); |
| | | |
| | | MmItemAccuracyRateEntity getInfo(String id); |
| | | |
| | | void create(MmItemAccuracyRateSaveReqVO createReqVO); |
| | | |
| | | void update(MmItemAccuracyRateSaveReqVO updateReqVO); |
| | | |
| | | void delete(String id); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | */ |
| | | public interface MmPredictAlarmConfigService extends BaseService<MmPredictAlarmConfigEntity> { |
| | | |
| | | PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO); |
| | | PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO); |
| | | |
| | | MmPredictAlarmConfigEntity getInfo(String id); |
| | | |
| | |
| | | void update(MmPredictAlarmConfigSaveReqVO reqVO); |
| | | |
| | | void delete(String id); |
| | | |
| | | List<AlarmConfigRespDTO> list(Map<String, Object> params); |
| | | } |
| | |
| | | |
| | | MmPredictAlarmMessageEntity getInfo(String id); |
| | | |
| | | MmPredictAlarmMessageEntity getLast(String alarmObj); |
| | | |
| | | void create(MmPredictAlarmMessageSaveReqVO reqVO); |
| | | |
| | | void update(MmPredictAlarmMessageSaveReqVO reqVO); |
| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.module.model.mcs.pre.dao.MmItemAccuracyHisDao; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyHisEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyHisService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyHisSaveReqVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | * @createTime 2024年11月19日 |
| | | */ |
| | | @Service |
| | | public class MmItemAccuracyHisServiceImpl implements MmItemAccuracyHisService { |
| | | public class MmItemAccuracyHisServiceImpl extends BaseServiceImpl<MmItemAccuracyHisDao, MmItemAccuracyHisEntity> |
| | | implements MmItemAccuracyHisService { |
| | | @Override |
| | | public PageResult<MmItemAccuracyHisEntity> page(MmItemAccuracyHisPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | public MmItemAccuracyHisEntity getInfo(String id) { |
| | | return baseDao.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void create(MmItemAccuracyHisSaveReqVO reqVO) { |
| | | MmItemAccuracyHisEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyHisEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setCreateTime(new Date()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void update(MmItemAccuracyHisSaveReqVO reqVO) { |
| | | MmItemAccuracyHisEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyHisEntity.class); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.module.model.mcs.pre.dao.MmItemAccuracyRateDao; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemAccuracyRateEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemAccuracyRateService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRatePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmItemAccuracyRateSaveReqVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | * @createTime 2024年11月19日 |
| | | */ |
| | | @Service |
| | | public class MmItemAccuracyRateServiceImpl implements MmItemAccuracyRateService { |
| | | public class MmItemAccuracyRateServiceImpl extends BaseServiceImpl<MmItemAccuracyRateDao, MmItemAccuracyRateEntity> |
| | | implements MmItemAccuracyRateService { |
| | | @Override |
| | | public PageResult<MmItemAccuracyRateEntity> page(MmItemAccuracyRatePageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | public MmItemAccuracyRateEntity getInfo(String id) { |
| | | return baseDao.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void create(MmItemAccuracyRateSaveReqVO reqVO) { |
| | | MmItemAccuracyRateEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyRateEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setCreateTime(new Date()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void update(MmItemAccuracyRateSaveReqVO reqVO) { |
| | | MmItemAccuracyRateEntity entity = BeanUtils.toBean(reqVO, MmItemAccuracyRateEntity.class); |
| | | entity.setUpdateTime(new Date()); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
| | | import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; |
| | | import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | implements MmPredictAlarmConfigService { |
| | | |
| | | @Override |
| | | public PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) { |
| | | IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO); |
| | | return new PageResult<>(page.getRecords(), page.getTotal()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void create(MmPredictAlarmConfigSaveReqVO reqVO) { |
| | | MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setCreator(SecurityFrameworkUtils.getLoginUserNickname()); |
| | | entity.setCreateTime(new Date()); |
| | | baseDao.insert(entity); |
| | | } |
| | |
| | | @Override |
| | | public void update(MmPredictAlarmConfigSaveReqVO reqVO) { |
| | | MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); |
| | | entity.setUpdater(SecurityFrameworkUtils.getLoginUserNickname()); |
| | | entity.setUpdateTime(new Date()); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmConfigRespDTO> list(Map<String, Object> params) { |
| | | QueryWrapper<MmPredictAlarmConfigEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_enable", 1); |
| | | return BeanUtils.toBean(baseDao.selectList(wrapper), AlarmConfigRespDTO.class); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessagePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public MmPredictAlarmMessageEntity getLast(String alarmObj) { |
| | | QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("alarm_obj", alarmObj) |
| | | .orderByDesc("alarm_time") |
| | | .last("limit 1"); |
| | | return baseDao.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void create(MmPredictAlarmMessageSaveReqVO reqVO) { |
| | | MmPredictAlarmMessageEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmMessageEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型平台 - Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class MmItemAccuracyHisPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "预测精准度ID") |
| | | private String rateId; |
| | | |
| | | @Schema(description = "精准误差") |
| | | private String inDeviation; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警配置 Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MmItemAccuracyHisRespVO { |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | private String rateId; |
| | | |
| | | private BigDecimal inDeviation; |
| | | |
| | | private BigDecimal inAccuracyRate; |
| | | |
| | | private BigDecimal outDeviation; |
| | | |
| | | private BigDecimal outAccuracyRate; |
| | | |
| | | private Date createTime; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警信息创建/修改 Request VO") |
| | | @Data |
| | | public class MmItemAccuracyHisSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | private String rateId; |
| | | |
| | | private BigDecimal inDeviation; |
| | | |
| | | private BigDecimal inAccuracyRate; |
| | | |
| | | private BigDecimal outDeviation; |
| | | |
| | | private BigDecimal outAccuracyRate; |
| | | |
| | | private Date createTime; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型平台 - Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class MmItemAccuracyRatePageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警配置 Response VO") |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class MmItemAccuracyRateRespVO { |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | |
| | | private String itemId; |
| | | |
| | | |
| | | private String outId; |
| | | |
| | | |
| | | private Integer sampleLength; |
| | | |
| | | |
| | | private Integer valueType; |
| | | |
| | | |
| | | private Date beginTime; |
| | | |
| | | |
| | | private BigDecimal inDeviation; |
| | | |
| | | |
| | | private BigDecimal inAccuracyRate; |
| | | |
| | | |
| | | private BigDecimal outDeviation; |
| | | |
| | | |
| | | private BigDecimal outAccuracyRate; |
| | | |
| | | |
| | | private Integer isEnable; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | |
| | | private Date updateTime; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.pre.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警信息创建/修改 Request VO") |
| | | @Data |
| | | public class MmItemAccuracyRateSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | |
| | | private String itemId; |
| | | |
| | | |
| | | private String outId; |
| | | |
| | | |
| | | private Integer sampleLength; |
| | | |
| | | |
| | | private Integer valueType; |
| | | |
| | | |
| | | private Date beginTime; |
| | | |
| | | |
| | | private BigDecimal inDeviation; |
| | | |
| | | |
| | | private BigDecimal inAccuracyRate; |
| | | |
| | | |
| | | private BigDecimal outDeviation; |
| | | |
| | | |
| | | private BigDecimal outAccuracyRate; |
| | | |
| | | |
| | | private Integer isEnable; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | |
| | | private Date updateTime; |
| | | } |
| | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "输出ID") |
| | | private String outId; |
| | | |
| | | private String outName; |
| | | |
| | | @Schema(description = "比较长度") |
| | | private Integer compLength; |
| | |
| | | package com.iailab.module.model.mcs.sche.dao; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface StScheduleSuggestDao extends BaseMapperX<StScheduleSuggestEntity> { |
| | | |
| | | default PageResult<StScheduleSuggestEntity> selectPage(StScheduleSuggestPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<StScheduleSuggestEntity>() |
| | | .likeIfPresent(StScheduleSuggestEntity::getTitle, reqVO.getTitle()) |
| | | .likeIfPresent(StScheduleSuggestEntity::getScheduleObj, reqVO.getScheduleObj()) |
| | | .orderByDesc(StScheduleSuggestEntity::getCreateTime)); |
| | | } |
| | | } |
| | |
| | | private Date scheduleTime; |
| | | |
| | | /** |
| | | * 状态 |
| | | * 状态(0未处理 1已采纳 2已忽略) |
| | | */ |
| | | private Integer status; |
| | | |
| | |
| | | package com.iailab.module.model.mcs.sche.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | * @createTime 2024年09月06日 |
| | | */ |
| | | public interface StScheduleSuggestService extends BaseService<StScheduleSuggestEntity> { |
| | | |
| | | PageResult<StScheduleSuggestEntity> page(StScheduleSuggestPageReqVO reqVO); |
| | | |
| | | void create(StScheduleSuggestSaveReqVO createReqVO); |
| | | |
| | | void update(StScheduleSuggestSaveReqVO createReqVO); |
| | | |
| | | void delete(String id); |
| | | |
| | | StScheduleSuggestEntity getInfo(String id); |
| | | |
| | | List<StScheduleSuggestEntity> getList(String scheduleObj, Integer limit); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | @Service |
| | | public class StScheduleSuggestServiceImpl extends BaseServiceImpl<StScheduleSuggestDao, StScheduleSuggestEntity> |
| | | implements StScheduleSuggestService { |
| | | |
| | | @Override |
| | | public PageResult<StScheduleSuggestEntity> page(StScheduleSuggestPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | public void create(StScheduleSuggestSaveReqVO createReqVO) { |
| | | StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void update(StScheduleSuggestSaveReqVO createReqVO) { |
| | | StScheduleSuggestEntity entity = BeanUtils.toBean(createReqVO, StScheduleSuggestEntity.class); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public StScheduleSuggestEntity getInfo(String id) { |
| | | return baseDao.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StScheduleSuggestEntity> getList(String scheduleObj, Integer limit) { |
| | | QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>(); |
| | | limit = limit == null ? 1 : limit; |
| | | queryWrapper.eq("schedule_obj", scheduleObj) |
| | | .orderByDesc("create_time") |
| | | .last("limit " + limit); |
| | | return baseDao.selectList(queryWrapper); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月27日 |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议分页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class StScheduleSuggestPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "标题,模糊匹配", example = "") |
| | | private String title; |
| | | |
| | | @Schema(description = "调整对象,模糊匹配", example = "") |
| | | private String scheduleObj; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月27日 |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议 Response VO") |
| | | @Data |
| | | public class StScheduleSuggestRespVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "内容") |
| | | private String content; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "方案ID") |
| | | private String schemeId; |
| | | |
| | | @Schema(description = "预警ID") |
| | | private String alarmId; |
| | | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象") |
| | | private String scheduleObj; |
| | | |
| | | @Schema(description = "调整类型") |
| | | private String scheduleType; |
| | | |
| | | @Schema(description = "调整策略") |
| | | private String scheduleStrategy; |
| | | |
| | | @Schema(description = "调整方式") |
| | | private String adjustMode; |
| | | |
| | | @Schema(description = "调整值") |
| | | private BigDecimal adjustValue; |
| | | |
| | | @Schema(description = "调整单位") |
| | | private String adjustUnit; |
| | | |
| | | @Schema(description = "持续时长") |
| | | private BigDecimal adjustTimes; |
| | | |
| | | @Schema(description = "调整开始时间") |
| | | private Date adjustStart; |
| | | |
| | | @Schema(description = "调整结束时间") |
| | | private Date adjustEnd; |
| | | |
| | | @Schema(description = "调度时间") |
| | | private Date scheduleTime; |
| | | |
| | | @Schema(description = "状态(0未处理 1已采纳 2已忽略)") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "处理人") |
| | | private String handler; |
| | | |
| | | @Schema(description = "处理时间") |
| | | private Date handleTime; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private Date createTime; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月27日 |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StScheduleSuggestSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "标题") |
| | | @NotNull(message = "应用编号不能为空") |
| | | private String title; |
| | | |
| | | @Schema(description = "内容") |
| | | @NotNull(message = "应用编号不能为空") |
| | | private String content; |
| | | |
| | | @Schema(description = "排序") |
| | | @NotNull(message = "应用编号不能为空") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "方案ID") |
| | | private String schemeId; |
| | | |
| | | @Schema(description = "预警ID") |
| | | private String alarmId; |
| | | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象") |
| | | @NotNull(message = "应用编号不能为空") |
| | | private String scheduleObj; |
| | | |
| | | @Schema(description = "调整类型") |
| | | private String scheduleType; |
| | | |
| | | @Schema(description = "调整策略") |
| | | private String scheduleStrategy; |
| | | |
| | | @Schema(description = "调整方式") |
| | | private String adjustMode; |
| | | |
| | | @Schema(description = "调整值") |
| | | private BigDecimal adjustValue; |
| | | |
| | | @Schema(description = "调整单位") |
| | | private String adjustUnit; |
| | | |
| | | @Schema(description = "持续时长") |
| | | private BigDecimal adjustTimes; |
| | | |
| | | @Schema(description = "调整开始时间") |
| | | private Date adjustStart; |
| | | |
| | | @Schema(description = "调整结束时间") |
| | | private Date adjustEnd; |
| | | |
| | | @Schema(description = "调度时间") |
| | | private Date scheduleTime; |
| | | |
| | | @Schema(description = "状态(0未处理 1已采纳 2已忽略)") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "处理人") |
| | | private String handler; |
| | | |
| | | @Schema(description = "处理时间") |
| | | private Date handleTime; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private Date createTime; |
| | | } |
| | |
| | | - t_mm_item_result_json |
| | | - t_mm_item_result_last_point |
| | | - t_mm_item_accuracy_rate |
| | | - t_mm_item_accuracy_his |
| | | - t_mm_predict_alarm_config |
| | | - t_mm_predict_alarm_message |
| | | - t_mm_sequence_num |
| | |
| | | |
| | | <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmItemOutputDao"> |
| | | |
| | | <select id="queryList" resultType="com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO"> |
| | | select * from t_mm_item_output t |
| | | <where> |
| | | <if test="params.itemid != null and params.itemid != ''"> |
| | | AND t.itemid LIKE CONCAT('%', #{params.itemid},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao"> |
| | | <select id="getPageList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO"> |
| | | select t1.*,t2.itemname itemName,t3.tagname outName |
| | | from t_mm_predict_alarm_config t1 |
| | | left join t_mm_predict_item t2 on t2.id = t1.item_id |
| | | left join t_mm_item_output t3 on t3.id = t1.out_id |
| | | <where> |
| | | <if test="params.title != null and params.title != ''"> |
| | | AND t.title LIKE CONCAT('%', #{params.title},'%') |
| | | </if> |
| | | <if test="params.alarmObj != null and params.alarmObj != ''"> |
| | | AND t.alarmObj LIKE CONCAT('%', #{params.alarmObj},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |