Ver Fonte

缺失功能补充

ZhuDeKang há 2 meses atrás
pai
commit
2af2617098
19 ficheiros alterados com 790 adições e 10 exclusões
  1. 7 2
      ruoyi-admin/src/test/java/com/ruoyi/JasyptTest.java
  2. 53 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/ContainerController.java
  3. 44 2
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdDataSetController.java
  4. 96 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdModelRunLogController.java
  5. 34 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceLogStatisServiceController.java
  6. 81 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdModelRunLog.java
  7. 15 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/LineChart.java
  8. 15 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/PtServiceLogStatisVo.java
  9. 65 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdModelRunLogMapper.java
  10. 4 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/PtServiceLogStatisMapper.java
  11. 62 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdModelRunLogService.java
  12. 4 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IPtServiceLogStatisService.java
  13. 1 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/MdModelContainerService.java
  14. 10 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdModelContainerServiceImpl.java
  15. 95 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdModelRunLogServiceImpl.java
  16. 11 0
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/PtServiceLogStatisServiceImpl.java
  17. 6 4
      ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/snailJob/ServiceLogStatisJob.java
  18. 85 0
      ruoyi-api-patform/src/main/resources/mapper/interfaces/MdModelRunLogMapper.xml
  19. 102 2
      ruoyi-api-patform/src/main/resources/mapper/interfaces/PtServiceLogStatisMapper.xml

+ 7 - 2
ruoyi-admin/src/test/java/com/ruoyi/JasyptTest.java

@@ -6,6 +6,7 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.SM4Util;
+import com.ruoyi.common.utils.json.JSONUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.interfaces.domain.MdModelInfo;
 import com.ruoyi.interfaces.domain.PtService;
@@ -82,10 +83,14 @@ public class JasyptTest {
             datasourceService.updateSysMetaDatasource(p);
 
         });*/
-
+/*
         String encrypt = sm4Util.decrypt("oMd930VR5zYn5ySU4ZJHPg==");
 
-        System.out.println(encrypt);
+        System.out.println(encrypt);*/
+
+        List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
+        String prettyJsonString = JSONUtils.toPrettyJsonString(sysMetaDatasources);
+        System.out.println(prettyJsonString);
 
     }
 }

+ 53 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/ContainerController.java

@@ -2,7 +2,15 @@ package com.ruoyi.interfaces.controller;
 
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.interfaces.domain.MdModelContainer;
+import com.ruoyi.interfaces.domain.MdModelInfo;
+import com.ruoyi.interfaces.domain.MdModelRunLog;
+import com.ruoyi.interfaces.mapper.MdModelRunLogMapper;
+import com.ruoyi.interfaces.service.IMdModelInfoService;
+import com.ruoyi.interfaces.service.IMdModelRunLogService;
+import com.ruoyi.interfaces.service.MdModelContainerService;
 import com.ruoyi.interfaces.service.container.ContainerService;
 import com.ruoyi.interfaces.service.impl.container.DockerImageService;
 import io.swagger.annotations.ApiOperation;
@@ -18,6 +26,16 @@ public class ContainerController extends BaseController {
     @Autowired
     private ContainerService containerService;
 
+    @Autowired
+    private IMdModelRunLogService modelRunLogService;
+
+    @Autowired
+    private IMdModelInfoService modelInfoService;
+
+    @Autowired
+    private MdModelContainerService mdModelContainerService;
+
+
     @ApiOperation("获取容器列表")
     @GetMapping(value = "/list")
     public AjaxResult listContainers() {
@@ -28,31 +46,66 @@ public class ContainerController extends BaseController {
     @ApiOperation("根据主键获取数据")
     @PostMapping(value = "/createContainer")
     public AjaxResult createContainer(@RequestBody MdModelContainer container) {
+
         MdModelContainer newContainer = containerService.createContainer(container);
+        insertMdModelRunLog(newContainer.getId(), "CREATE");
         return AjaxResult.success(newContainer);
     }
 
     @ApiOperation("根据主键获取数据")
     @PostMapping(value = "/{containerId}/start")
     public AjaxResult startContainer(@PathVariable String containerId) {
+        insertMdModelRunLog(containerId, "START");
         containerService.startContainer(containerId);
         return AjaxResult.success();
     }
 
+
+    /**
+     * 添加模型运行时间监控日志
+     *
+     * @param containerId 镜像id
+     * @param event       时间类型
+     */
+    public void insertMdModelRunLog(String containerId, String event) {
+        MdModelContainer mdModelContainer = mdModelContainerService.selectById(containerId);
+        if (StringUtils.isNotNull(mdModelContainer)) {
+            MdModelInfo mdModelInfo = modelInfoService.selectMdModelInfoByMdid(mdModelContainer.getMdid());
+            if (StringUtils.isNotNull(mdModelInfo)) {
+                MdModelRunLog mdModelRunLog = new MdModelRunLog();
+                mdModelRunLog.setEvent(event);
+                mdModelRunLog.setMdid(mdModelContainer.getMdid());
+                mdModelRunLog.setMdName(mdModelContainer.getName());
+                mdModelRunLog.setCreateBy(getUsername());
+                mdModelRunLog.setCreateTime(DateUtils.getNowDate());
+                modelRunLogService.insertMdModelRunLog(mdModelRunLog);
+
+            }
+        }
+    }
+
     @PostMapping("/{containerId}/stop")
     public AjaxResult stopContainer(@PathVariable String containerId) {
+
+        /**
+         * 添加模型运行时间监控日志
+         */
+        insertMdModelRunLog(containerId, "STOP");
+
         containerService.stopContainer(containerId);
         return AjaxResult.success();
     }
 
     @PostMapping("/{containerId}/restart")
     public AjaxResult restartContainer(@PathVariable String containerId) {
+        insertMdModelRunLog(containerId, "RESTART");
         containerService.restartContainer(containerId);
         return AjaxResult.success();
     }
 
     @PostMapping("/{containerId}/delete")
     public AjaxResult deleteContainer(@PathVariable String containerId) {
+        insertMdModelRunLog(containerId, "DELETE");
         containerService.deleteContainer(containerId);
         return AjaxResult.success();
     }

+ 44 - 2
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdDataSetController.java

@@ -7,17 +7,27 @@ import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.common.utils.json.JSONUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.utils.uuid.UUID;
 import com.ruoyi.interfaces.domain.MdDataCate;
 import com.ruoyi.interfaces.domain.MdDataField;
 import com.ruoyi.interfaces.domain.MdDataSet;
+import com.ruoyi.interfaces.domain.SysMetaDatasource;
 import com.ruoyi.interfaces.service.IMdDataCateService;
 import com.ruoyi.interfaces.service.IMdDataFieldService;
 import com.ruoyi.interfaces.service.IMdDataSetService;
+import com.ruoyi.interfaces.service.ISysMetaDatasourceService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -119,9 +129,41 @@ public class MdDataSetController extends BaseController {
     }
 
     @GetMapping("/getBizData/{id}")
-    public AjaxResult getBizDataById(@PathVariable String id) {
+    public AjaxResult getBizDataById(@PathVariable String id ) {
         Map<String, String> params = ServletUtils.getParamMap(ServletUtils.getRequest());
-        return AjaxResult.success(mdDataSetService.getBizDataById(id,params));
+        return AjaxResult.success(mdDataSetService.getBizDataById(id, params));
+    }
+    @Autowired
+    private ISysMetaDatasourceService datasourceService;
+
+    @GetMapping("API/download")
+    public void download(MdDataSet mdDataSet, HttpServletResponse response) throws UnsupportedEncodingException {
+
+        System.out.println(mdDataSet.toString());
+        String prettyJsonString = "";
+
+        List<SysMetaDatasource> sysMetaDatasources = datasourceService.selectSysMetaDatasourceList(null);
+        prettyJsonString = JSONUtils.toPrettyJsonString(sysMetaDatasources);
+        /*switch (mdDataSet.getDcType()) {
+            case "API":
+                Map<String, String> params = ServletUtils.getParamMap(ServletUtils.getRequest());
+                Object bizDataById = mdDataSetService.getBizDataById(mdDataSet.getDcCode(), params);
+                if (StringUtils.isNotNull(bizDataById)) {
+                    prettyJsonString = JSONUtils.toPrettyJsonString(bizDataById);
+                }
+                break;
+        }*/
+        String realFileName = UUID.fastUUID()+".txt";
+        FileUtils.setAttachmentResponseHeader(response, realFileName);
+        // 直接将JSON字符串写入响应流
+        try (OutputStream outputStream = response.getOutputStream()) {
+            outputStream.write(prettyJsonString.getBytes(StandardCharsets.UTF_8));
+            outputStream.flush();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+        // 直接将JSON字符串写入响应流
+
     }
 
 }

+ 96 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/MdModelRunLogController.java

@@ -0,0 +1,96 @@
+package com.ruoyi.interfaces.controller;
+
+import java.util.List;
+
+import com.ruoyi.interfaces.domain.MdModelRunLog;
+import com.ruoyi.interfaces.service.IMdModelRunLogService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 模型运行监控日志Controller
+ * 
+ * @author ruoyi
+ * @date 2025-11-02
+ */
+@RestController
+@RequestMapping("/model/run/log")
+public class MdModelRunLogController extends BaseController
+{
+    @Autowired
+    private IMdModelRunLogService mdModelRunLogService;
+
+    /**
+     * 查询模型运行监控日志列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(MdModelRunLog mdModelRunLog)
+    {
+        startPage();
+        List<MdModelRunLog> list = mdModelRunLogService.selectMdModelRunLogList(mdModelRunLog);
+        return getDataTable(list);
+    }
+
+
+
+    /**
+     * 导出模型运行监控日志列表
+     */
+    @GetMapping("/export")
+    public AjaxResult export(MdModelRunLog mdModelRunLog)
+    {
+        List<MdModelRunLog> list = mdModelRunLogService.selectMdModelRunLogList(mdModelRunLog);
+        ExcelUtil<MdModelRunLog> util = new ExcelUtil<MdModelRunLog>(MdModelRunLog.class);
+        return util.exportExcel(list, "模型运行监控日志数据");
+    }
+
+    /**
+     * 获取模型运行监控日志详细信息
+     */
+    @GetMapping(value = "/{logId}")
+    public AjaxResult getInfo(@PathVariable("logId") Long logId)
+    {
+        return AjaxResult.success(mdModelRunLogService.selectMdModelRunLogByLogId(logId));
+    }
+
+    /**
+     * 新增模型运行监控日志
+     */
+    @PostMapping
+    public AjaxResult add(@RequestBody MdModelRunLog mdModelRunLog)
+    {
+        return toAjax(mdModelRunLogService.insertMdModelRunLog(mdModelRunLog));
+    }
+
+    /**
+     * 修改模型运行监控日志
+     */
+    @PutMapping
+    public AjaxResult edit(@RequestBody MdModelRunLog mdModelRunLog)
+    {
+        return toAjax(mdModelRunLogService.updateMdModelRunLog(mdModelRunLog));
+    }
+
+    /**
+     * 删除模型运行监控日志
+     */
+	@DeleteMapping("/{logIds}")
+    public AjaxResult remove(@PathVariable Long[] logIds)
+    {
+        return toAjax(mdModelRunLogService.deleteMdModelRunLogByLogIds(logIds));
+    }
+}

+ 34 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/controller/PtServiceLogStatisServiceController.java

@@ -32,6 +32,11 @@ public class PtServiceLogStatisServiceController extends BaseController {
         return success(ptServiceLogStatis);
     }
 
+    /**
+     * 查询有数据的模型列表
+     * @param logStatis
+     * @return
+     */
     @RequestMapping("/mdList")
     public AjaxResult mdList(PtServiceLogStatis logStatis) {
 
@@ -39,6 +44,30 @@ public class PtServiceLogStatisServiceController extends BaseController {
         return success(ptServiceLogStatis);
     }
 
+    /**
+     * 查询所有模型的列表
+     * @param logStatis
+     * @return
+     */
+    @RequestMapping("/mdAllList")
+    public AjaxResult mdAllList(PtServiceLogStatis logStatis) {
+
+        List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisMdAllList(logStatis);
+        return success(ptServiceLogStatis);
+    }
+
+    /**
+     * 模型、状态、统计数据
+     * @param logStatis
+     * @return
+     */
+    @RequestMapping("/mdStatusSum")
+    public AjaxResult mdStatusSum(PtServiceLogStatis logStatis) {
+
+        List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisStatusSum(logStatis);
+        return success(ptServiceLogStatis);
+    }
+
     @RequestMapping("/toDaylist")
     public AjaxResult toDaylist(PtServiceLogStatis logStatis) {
         if (StringUtils.isNull(logStatis.getParams().get("beginTime"))) {
@@ -52,6 +81,11 @@ public class PtServiceLogStatisServiceController extends BaseController {
         return success(nowList);
     }
 
+    /**
+     * 月颗粒度
+     * @param logStatis
+     * @return
+     */
     @RequestMapping("/monthList")
     public AjaxResult monthList(PtServiceLogStatis logStatis) {
         List<PtServiceLogStatisVo> ptServiceLogStatis = logStatisServices.selectPtServiceLogStatisMonthList(logStatis);

+ 81 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/MdModelRunLog.java

@@ -0,0 +1,81 @@
+package com.ruoyi.interfaces.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 模型运行监控日志对象 md_model_run_log
+ * 
+ * @author ruoyi
+ * @date 2025-11-02
+ */
+public class MdModelRunLog extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 日志id */
+    private Long logId;
+
+    /** 模型id */
+    @Excel(name = "模型id")
+    private String mdid;
+
+    /** 模型名称 */
+    @Excel(name = "模型名称")
+    private String mdName;
+
+    /** 监控事件 */
+    @Excel(name = "监控事件")
+    private String event;
+
+    public void setLogId(Long logId) 
+    {
+        this.logId = logId;
+    }
+
+    public Long getLogId() 
+    {
+        return logId;
+    }
+    public void setMdid(String mdid) 
+    {
+        this.mdid = mdid;
+    }
+
+    public String getMdid() 
+    {
+        return mdid;
+    }
+    public void setMdName(String mdName) 
+    {
+        this.mdName = mdName;
+    }
+
+    public String getMdName() 
+    {
+        return mdName;
+    }
+    public void setEvent(String event) 
+    {
+        this.event = event;
+    }
+
+    public String getEvent() 
+    {
+        return event;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("logId", getLogId())
+            .append("mdid", getMdid())
+            .append("mdName", getMdName())
+            .append("event", getEvent())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .toString();
+    }
+}

+ 15 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/LineChart.java

@@ -0,0 +1,15 @@
+package com.ruoyi.interfaces.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LineChart {
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date time;
+    private Integer num;
+
+}

+ 15 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/domain/vo/PtServiceLogStatisVo.java

@@ -3,6 +3,7 @@ package com.ruoyi.interfaces.domain.vo;
 import com.ruoyi.interfaces.domain.PtServiceLogStatis;
 
 import java.util.Date;
+import java.util.List;
 
 public class PtServiceLogStatisVo extends PtServiceLogStatis {
     private String mdName;
@@ -19,6 +20,20 @@ public class PtServiceLogStatisVo extends PtServiceLogStatis {
      */
     private String execTmLv;
 
+    /**
+     * 折线图对象
+     */
+    private List<LineChart> lineCharts;
+
+
+    public List<LineChart> getLineCharts() {
+        return lineCharts;
+    }
+
+    public void setLineCharts(List<LineChart> lineCharts) {
+        this.lineCharts = lineCharts;
+    }
+
     public String getExecTmLv() {
         return execTmLv;
     }

+ 65 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/MdModelRunLogMapper.java

@@ -0,0 +1,65 @@
+package com.ruoyi.interfaces.mapper;
+
+import com.ruoyi.common.annotation.DataSource;
+import com.ruoyi.common.enums.DataSourceType;
+import com.ruoyi.interfaces.domain.MdModelRunLog;
+
+import java.util.List;
+
+/**
+ * 模型运行监控日志Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2025-11-02
+ */
+@DataSource(DataSourceType.SLAVE)
+public interface MdModelRunLogMapper 
+{
+    /**
+     * 查询模型运行监控日志
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 模型运行监控日志
+     */
+    public MdModelRunLog selectMdModelRunLogByLogId(Long logId);
+
+    /**
+     * 查询模型运行监控日志列表
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 模型运行监控日志集合
+     */
+    public List<MdModelRunLog> selectMdModelRunLogList(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 新增模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    public int insertMdModelRunLog(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 修改模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    public int updateMdModelRunLog(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 删除模型运行监控日志
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 结果
+     */
+    public int deleteMdModelRunLogByLogId(Long logId);
+
+    /**
+     * 批量删除模型运行监控日志
+     * 
+     * @param logIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteMdModelRunLogByLogIds(Long[] logIds);
+}

+ 4 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/mapper/PtServiceLogStatisMapper.java

@@ -31,4 +31,8 @@ public interface PtServiceLogStatisMapper {
     List<PtServiceLogStatisVo> selectMdQuality(MdModelInfo modelInfo);
 
     List<PtServiceLogStatisVo> selectMdEfficiency(MdModelInfo modelInfo);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisStatusSum(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMdAllList(PtServiceLogStatis logStatis);
 }

+ 62 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IMdModelRunLogService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.interfaces.service;
+
+import com.ruoyi.interfaces.domain.MdModelRunLog;
+
+import java.util.List;
+
+/**
+ * 模型运行监控日志Service接口
+ * 
+ * @author ruoyi
+ * @date 2025-11-02
+ */
+public interface IMdModelRunLogService 
+{
+    /**
+     * 查询模型运行监控日志
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 模型运行监控日志
+     */
+    public MdModelRunLog selectMdModelRunLogByLogId(Long logId);
+
+    /**
+     * 查询模型运行监控日志列表
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 模型运行监控日志集合
+     */
+    public List<MdModelRunLog> selectMdModelRunLogList(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 新增模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    public int insertMdModelRunLog(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 修改模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    public int updateMdModelRunLog(MdModelRunLog mdModelRunLog);
+
+    /**
+     * 批量删除模型运行监控日志
+     * 
+     * @param logIds 需要删除的模型运行监控日志主键集合
+     * @return 结果
+     */
+    public int deleteMdModelRunLogByLogIds(Long[] logIds);
+
+    /**
+     * 删除模型运行监控日志信息
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 结果
+     */
+    public int deleteMdModelRunLogByLogId(Long logId);
+}

+ 4 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/IPtServiceLogStatisService.java

@@ -23,4 +23,8 @@ public interface IPtServiceLogStatisService {
     List<PtServiceLogStatisVo> selectMdQuality(MdModelInfo modelInfo);
 
     List<PtServiceLogStatisVo> selectMdEfficiency(MdModelInfo modelInfo);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisStatusSum(PtServiceLogStatis logStatis);
+
+    List<PtServiceLogStatisVo> selectPtServiceLogStatisMdAllList(PtServiceLogStatis logStatis);
 }

+ 1 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/MdModelContainerService.java

@@ -15,5 +15,6 @@ public interface MdModelContainerService extends IService<MdModelContainer> {
     boolean updateStatus(String containerId, String status);
 
     List<MdModelContainerVO> listContainer(MdModelContainer modelContainer);
+    public MdModelContainer selectById(String id) ;
 
 }

+ 10 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdModelContainerServiceImpl.java

@@ -56,4 +56,14 @@ public class MdModelContainerServiceImpl extends ServiceImpl<MdModelContainerMap
         return baseMapper.listContainer(modelContainer);
     }
 
+    /**
+     * 通过id获取对象
+     * @param id
+     * @return
+     */
+    @Override
+    public MdModelContainer selectById(String id) {
+        return baseMapper.selectById(id);
+    }
+
 }

+ 95 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/MdModelRunLogServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.interfaces.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.interfaces.domain.MdModelRunLog;
+import com.ruoyi.interfaces.mapper.MdModelRunLogMapper;
+import com.ruoyi.interfaces.service.IMdModelRunLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 模型运行监控日志Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2025-11-02
+ */
+@Service
+public class MdModelRunLogServiceImpl implements IMdModelRunLogService
+{
+    @Autowired
+    private MdModelRunLogMapper mdModelRunLogMapper;
+
+    /**
+     * 查询模型运行监控日志
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 模型运行监控日志
+     */
+    @Override
+    public MdModelRunLog selectMdModelRunLogByLogId(Long logId)
+    {
+        return mdModelRunLogMapper.selectMdModelRunLogByLogId(logId);
+    }
+
+    /**
+     * 查询模型运行监控日志列表
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 模型运行监控日志
+     */
+    @Override
+    public List<MdModelRunLog> selectMdModelRunLogList(MdModelRunLog mdModelRunLog)
+    {
+        return mdModelRunLogMapper.selectMdModelRunLogList(mdModelRunLog);
+    }
+
+    /**
+     * 新增模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    @Override
+    public int insertMdModelRunLog(MdModelRunLog mdModelRunLog)
+    {
+        mdModelRunLog.setCreateTime(DateUtils.getNowDate());
+        return mdModelRunLogMapper.insertMdModelRunLog(mdModelRunLog);
+    }
+
+    /**
+     * 修改模型运行监控日志
+     * 
+     * @param mdModelRunLog 模型运行监控日志
+     * @return 结果
+     */
+    @Override
+    public int updateMdModelRunLog(MdModelRunLog mdModelRunLog)
+    {
+        return mdModelRunLogMapper.updateMdModelRunLog(mdModelRunLog);
+    }
+
+    /**
+     * 批量删除模型运行监控日志
+     * 
+     * @param logIds 需要删除的模型运行监控日志主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdModelRunLogByLogIds(Long[] logIds)
+    {
+        return mdModelRunLogMapper.deleteMdModelRunLogByLogIds(logIds);
+    }
+
+    /**
+     * 删除模型运行监控日志信息
+     * 
+     * @param logId 模型运行监控日志主键
+     * @return 结果
+     */
+    @Override
+    public int deleteMdModelRunLogByLogId(Long logId)
+    {
+        return mdModelRunLogMapper.deleteMdModelRunLogByLogId(logId);
+    }
+}

+ 11 - 0
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/service/impl/PtServiceLogStatisServiceImpl.java

@@ -103,4 +103,15 @@ public class PtServiceLogStatisServiceImpl implements IPtServiceLogStatisService
         });
         return ptServiceLogStatisVos;
     }
+
+    @Override
+    public List<PtServiceLogStatisVo> selectPtServiceLogStatisStatusSum(PtServiceLogStatis logStatis) {
+
+        return ptServiceLogStatisMapper.selectPtServiceLogStatisStatusSum(logStatis);
+    }
+
+    @Override
+    public List<PtServiceLogStatisVo> selectPtServiceLogStatisMdAllList(PtServiceLogStatis logStatis) {
+        return ptServiceLogStatisMapper.selectPtServiceLogStatisMdAllList(logStatis);
+    }
 }

+ 6 - 4
ruoyi-api-patform/src/main/java/com/ruoyi/interfaces/snailJob/ServiceLogStatisJob.java

@@ -40,8 +40,10 @@ public class ServiceLogStatisJob {
     @JobExecutor(name = "serviceLogStatisJob")
     public ExecuteResult ServiceLogStatisJob(JobArgs jobArgs) {
         HashMap<String, String> hashMap = null;
-        if (StringUtils.isNotEmpty(jobArgs.getJobParams().toString()))
-            hashMap = JsonUtils.jsonToPojo(jobArgs.getJobParams().toString(), HashMap.class);
+
+        if (StringUtils.isNotNull(jobArgs.getJobParams()))
+            if (StringUtils.isNotEmpty(jobArgs.getJobParams().toString()))
+                hashMap = JsonUtils.jsonToPojo(jobArgs.getJobParams().toString(), HashMap.class);
         Date schedule = null;
         Date endTime = DateUtils.getNowDate();
 
@@ -54,9 +56,9 @@ public class ServiceLogStatisJob {
             }
         } else {
             if (StringUtils.isNotNull(hashMap.get("beginTime")))
-            schedule = DateUtils.dateTime(DateUtils.YYYY_MM_DD, hashMap.get("beginTime").toString());
+                schedule = DateUtils.dateTime(DateUtils.YYYY_MM_DD, hashMap.get("beginTime").toString());
             if (StringUtils.isNotNull(hashMap.get("endTime")))
-            endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD, hashMap.get("endTime").toString());
+                endTime = DateUtils.dateTime(DateUtils.YYYY_MM_DD, hashMap.get("endTime").toString());
         }
 
         for (long i = schedule.getTime(); i <= endTime.getTime(); ) {

+ 85 - 0
ruoyi-api-patform/src/main/resources/mapper/interfaces/MdModelRunLogMapper.xml

@@ -0,0 +1,85 @@
+<?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.ruoyi.interfaces.mapper.MdModelRunLogMapper">
+
+    <resultMap type="com.ruoyi.interfaces.domain.MdModelRunLog" id="MdModelRunLogResult">
+        <result property="logId" column="log_id"/>
+        <result property="mdid" column="mdid"/>
+        <result property="mdName" column="md_name"/>
+        <result property="event" column="event"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+    </resultMap>
+
+    <sql id="selectMdModelRunLogVo">
+        select log_id, mdid, md_name, event, create_by, create_time
+        from md_model_run_log
+    </sql>
+
+    <select id="selectMdModelRunLogList" parameterType="com.ruoyi.interfaces.domain.MdModelRunLog"
+            resultMap="MdModelRunLogResult">
+        <include refid="selectMdModelRunLogVo"/>
+        <where>
+            <if test="mdid != null  and mdid != ''">and mdid = #{mdid}</if>
+            <if test="mdName != null  and mdName != ''">and md_name like concat('%', #{mdName}, '%')</if>
+            <if test="event != null  and event != ''">and event = #{event}</if>
+            <if test="params.beginTime != null">
+                and create_time &gt;= to_date(#{params.beginTime},'yyyy-mm-dd hh24:mi:ss')
+            </if>
+            <if test="params.endTime != null">
+                and create_time &lt;= to_date(#{params.endTime},'yyyy-mm-dd hh24:mi:ss')
+            </if>
+        </where>
+    </select>
+
+    <select id="selectMdModelRunLogByLogId" parameterType="Long" resultMap="MdModelRunLogResult">
+        <include refid="selectMdModelRunLogVo"/>
+        where log_id = #{logId}
+    </select>
+
+    <insert id="insertMdModelRunLog" parameterType="com.ruoyi.interfaces.domain.MdModelRunLog" useGeneratedKeys="true"
+            keyProperty="logId">
+        insert into md_model_run_log
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="mdid != null">mdid,</if>
+            <if test="mdName != null">md_name,</if>
+            <if test="event != null">event,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="mdid != null">#{mdid},</if>
+            <if test="mdName != null">#{mdName},</if>
+            <if test="event != null">#{event},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateMdModelRunLog" parameterType="com.ruoyi.interfaces.domain.MdModelRunLog">
+        update md_model_run_log
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="mdid != null">mdid = #{mdid},</if>
+            <if test="mdName != null">md_name = #{mdName},</if>
+            <if test="event != null">event = #{event},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where log_id = #{logId}
+    </update>
+
+    <delete id="deleteMdModelRunLogByLogId" parameterType="Long">
+        delete
+        from md_model_run_log
+        where log_id = #{logId}
+    </delete>
+
+    <delete id="deleteMdModelRunLogByLogIds" parameterType="String">
+        delete from md_model_run_log where log_id in
+        <foreach item="logId" collection="array" open="(" separator="," close=")">
+            #{logId}
+        </foreach>
+    </delete>
+</mapper>

+ 102 - 2
ruoyi-api-patform/src/main/resources/mapper/interfaces/PtServiceLogStatisMapper.xml

@@ -13,7 +13,9 @@
         <result property="statisNumTrue" column="STATIS_NUM_TRUE" jdbcType="INTEGER"/>
         <result property="execTm" column="EXEC_TM" jdbcType="BIGINT"/>
     </resultMap>
+
     <sql id="selectPtServiceLogStatis">
+
         select l.STATIS_TM,
                l.MD_ID,
                l.SER_ID,
@@ -270,12 +272,12 @@
         </where>
         ORDER BY m.sort
     </select>
-    <select id="selectMdEfficiency" resultMap="PtServiceLogStatisMap" >
+    <select id="selectMdEfficiency" resultMap="PtServiceLogStatisMap">
         SELECT m.mdid MD_ID, m.name as MD_NAME, d.STATIS_NUM, d.EXEC_TM
         FROM md_model_info m
         LEFT JOIN (SELECT md_id,
         sum(statis_num) statis_num,
-        sum(exec_tm)    exec_tm
+        sum(exec_tm) exec_tm
         FROM PT_SERVICE_LOG_STATIS
         WHERE STATIS_TM &gt;= to_date(#{params.beginTime}, 'yyyy-mm-dd')
         AND STATIS_TM &lt;= to_date(#{params.endTime}, 'yyyy-mm-dd')
@@ -288,5 +290,103 @@
         </where>
         ORDER BY m.sort
     </select>
+    <select id="selectPtServiceLogStatisStatusSum"
+            resultMap="PtServiceLogStatisMap">
+        select
+        null as STATIS_TM,
+        l.MD_ID,
+        '' as SER_ID,
+        STATUS_CODE as STATUS_CODE,
+        l.STATIS_NUM,
+        m.name as MD_NAME,
+        '' as SER_NAME
+        from md_model_info m left join(
+        SELECT
+        MD_ID,STATUS_CODE, sum(statis_num) statis_num
+        FROM (
+        SELECT t.* FROM PT_SERVICE_LOG_STATIS t
+        <where>
+            <if test="params.beginTime != null">
+                and STATIS_TM &gt;= to_date(#{params.beginTime},'yyyy-mm-dd')
+            </if>
+            <if test="params.endTime != null">
+                and STATIS_TM &lt;= to_date(#{params.endTime},'yyyy-mm-dd')
+            </if>
+            <if test="mdId != null and mdId != ''">
+                and t.MD_ID = #{mdId}
+            </if>
+            <if test="serId != null and serId != ''">
+                and t.SER_ID = #{serId}
+            </if>
+            <if test="statusCode != null and statusCode != ''">
+                and STATUS_CODE = #{statusCode}
+            </if>
+        </where>
+        ) GROUP BY MD_ID ,STATUS_CODE
+        ) l
+        on l.MD_ID = m.MDID
+        <where>
+            and m.name is not null
+        </where>
+    </select>
+
+    <resultMap type="com.ruoyi.interfaces.domain.vo.PtServiceLogStatisVo" id="PtServiceLogStatisLineChartMap">
+        <result property="mdId" column="MD_ID" jdbcType="VARCHAR"/>
+        <result property="mdName" column="MD_NAME" jdbcType="VARCHAR"/>
+        <result property="serId" column="SER_ID" jdbcType="VARCHAR"/>
+        <result property="serName" column="SER_NAME" jdbcType="VARCHAR"/>
+        <result property="statusCode" column="STATUS_CODE" jdbcType="VARCHAR"/>
+        <result property="statisNumTrue" column="STATIS_NUM_TRUE" jdbcType="INTEGER"/>
+        <result property="execTm" column="EXEC_TM" jdbcType="BIGINT"/>
+        <collection property="lineCharts" ofType="com.ruoyi.interfaces.domain.vo.LineChart" resultMap="LineChartMap"/>
+    </resultMap>
+    <resultMap id="LineChartMap" type="com.ruoyi.interfaces.domain.vo.LineChart">
+        <result property="time" column="STATIS_TM" jdbcType="DATE"/>
+        <result property="num" column="STATIS_NUM" jdbcType="INTEGER"/>
+    </resultMap>
+    <select id="selectPtServiceLogStatisMdAllList"
+            resultMap="PtServiceLogStatisLineChartMap">
+
+        SELECT DAY_DATE AS STATIS_TM,
+        m.MDID AS MD_ID,
+        '' as SER_ID,
+        '' as STATUS_CODE,
+        case when  l.STATIS_NUM is NULL THEN 0 ELSE l.STATIS_NUM end AS  STATIS_NUM,
+        m.name as MD_NAME,
+        '' as SER_NAME FROM (
+        SELECT * FROM (
+        SELECT to_date(#{params.beginTime},'yyyy-mm-dd') + LEVEL - 1 AS day_date
+        FROM DUAL
+        CONNECT BY LEVEL &lt;=  to_date(#{params.endTime},'yyyy-mm-dd') -  to_date(#{params.beginTime},'yyyy-mm-dd') + 1
+        ORDER BY day_date
+        ) d LEFT JOIN md_model_info m ON 1=1
+        ) m left join(
+        SELECT
+        STATIS_TM ,MD_ID,sum(statis_num) statis_num
+        FROM (
+        SELECT t.* FROM PT_SERVICE_LOG_STATIS t
+        <where>
+            <if test="params.beginTime != null">
+                and STATIS_TM &gt;= to_date(#{params.beginTime},'yyyy-mm-dd')
+            </if>
+            <if test="params.endTime != null">
+                and STATIS_TM &lt;= to_date(#{params.endTime},'yyyy-mm-dd')
+            </if>
+            <if test="mdId != null and mdId != ''">
+                and t.MD_ID = #{mdId}
+            </if>
+            <if test="serId != null and serId != ''">
+                and t.SER_ID = #{serId}
+            </if>
+            <if test="statusCode != null and statusCode != ''">
+                and STATUS_CODE = #{statusCode}
+            </if>
+        </where>
+        ) GROUP BY STATIS_TM,MD_ID
+        ) l
+        on l.MD_ID = m.MDID AND m.DAY_DATE = l.STATIS_TM
+        WHERE  m.name is not NULL
+        ORDER BY m.mdid,DAY_DATE
+    </select>
 
 </mapper>