已修改17个文件
已添加1个文件
271 ■■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/db/mysql.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemRespVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/common/MdkConstant.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/common/utils/CmdUtils.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dao/MpkFileDao.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dao/ProjectDao.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MpkFileService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/ProjectDao.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/db/mysql.sql
@@ -709,7 +709,7 @@
    `file_path`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '文件路径',
    `version`     varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '版本号',
    `log`         varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新日志',
    `model_names` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '打包模型名称(“,”分割)',
    `model_names` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '打包模型名称(“,”分割)',
    `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
    PRIMARY KEY (`id`, `project_id`) USING BTREE,
    INDEX         `del_package_history`(`project_id` ASC) USING BTREE,
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -302,6 +302,11 @@
        if (resultStr == null) {
            return result;
        }
        String resultIndex = chartParams.get(CommonConstant.RESULT_INDEX);
        if (resultIndex == null) {
            return result;
        }
        ItemVO predictItem = mmPredictItemService.getItemByItemNo(itemCode);
        if (predictItem == null || predictItem.getLastTime() == null) {
            return result;
@@ -322,7 +327,7 @@
        List<String> categories = DateUtils.getTimeScale(startTime, endTime, predictItem.getGranularity(), timeFormat);
        List<String> legend = new ArrayList<>();
        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr);
        MmItemOutputEntity outPut = mmItemOutputService.getByItemid(predictItem.getId(), resultStr, Integer.parseInt(resultIndex));
        PreDataViewRespDTO dataView = new PreDataViewRespDTO();
        dataView.setItemId(predictItem.getId());
        dataView.setItemName(predictItem.getItemName());
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/common/enums/CommonConstant.java
@@ -36,6 +36,8 @@
    String RESULT_STR = "RESULT_STR";
    String RESULT_INDEX = "RESULT_INDEX";
    String LENGTH_LEFT = "LENGTH_LEFT";
    String LENGTH_RIGHT = "LENGTH_RIGHT";
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java
@@ -22,7 +22,7 @@
    List<MmItemOutputEntity> getByItemid(String itemId);
    MmItemOutputEntity getByItemid(String itemid, String resultstr);
    MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex);
    void deleteByItemId(String itemId);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java
@@ -74,9 +74,11 @@
    }
    @Override
    public MmItemOutputEntity getByItemid(String itemid, String resultstr) {
    public MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex) {
        QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("itemid", itemid).eq("resultstr", resultstr);
        queryWrapper.eq("itemid", itemid)
                .eq("resultstr", resultstr)
                .eq("result_index", resultIndex);
        return mmItemOutputDao.selectOne(queryWrapper);
    }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java
@@ -20,5 +20,6 @@
    private String itemname;
    private String itemtypeid;
    private String itemtypename;
    private String modulename;
    private String status;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemRespVO.java
@@ -103,6 +103,10 @@
    @ExcelProperty("运行耗时")
    private Long duration;
    @Schema(description = "管网名称")
    @ExcelProperty("管网名称")
    private String modulename;
    private List<MmItemOutputRespVO> outPuts;
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/common/MdkConstant.java
@@ -15,10 +15,14 @@
     */
    String IMPL = "impl";
    /**
     * impl
     * C++
     */
    String C = "C++";
    /**
     * IAILMDK
     */
    String IAILMDK = "IAILMDK";
    /**
     * Algs
     */
    String ALGS = "Algs";
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/common/utils/CmdUtils.java
对比新文件
@@ -0,0 +1,64 @@
package com.iailab.module.model.mpk.common.utils;
import com.iailab.module.model.mpk.common.MdkConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
@Slf4j
public class CmdUtils {
    public static void exec(String cmd, String directory) {
        Process process = null;
        BufferedReader normalReader = null;
        BufferedReader errorReader = null;
        try {
            log.info("执行cmd命令:" + cmd);
            ProcessBuilder builder = new ProcessBuilder("cmd", "/c", cmd);
            if (StringUtils.isNotBlank(directory)) {
                builder.directory(new File(directory));
            }
            process = builder.start();
            normalReader = new BufferedReader(new InputStreamReader(process.getInputStream(),"GBK"));
            errorReader = new  BufferedReader(new  InputStreamReader(process.getErrorStream(),"GBK"));
            String line = null;
            while ((line = normalReader.readLine()) != null) {
                log.info("脚本文件执行信息normalStream:{}", line);
            }
            String errorLine;
            while ((errorLine = errorReader.readLine()) != null) {
                log.warn("脚本文件执行信息ErrorStream:{}", errorLine);
            }
            process.waitFor();
        } catch (Exception e) {
            throw new RuntimeException("执行cmd命令异常,【" + cmd + "】",e);
        } finally {
            if (null != normalReader) {
                try {
                    normalReader.close();
                } catch (IOException e) {
                    log.error("流文件关闭异常:", e);
                }
            }
            if (null != errorReader) {
                try {
                    errorReader.close();
                } catch (IOException e) {
                    log.error("流文件关闭异常:", e);
                }
            }
            if (null != process) {
                process.destroy();
            }
        }
    }
    public static void exec(String cmd) {
        exec(cmd,null);
    }
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/MpkFileController.java
@@ -118,10 +118,10 @@
    }
    @GetMapping("packageModel")
    public void packageModel(String ids ,String projectId,String log ,String projectName,String version,String zipFileName,HttpServletResponse response) throws IOException {
    public void packageModel(String projectId,String log ,String projectName,String version,String zipFileName,HttpServletResponse response) throws IOException {
        byte[] data;
        try {
            data = mpkFileService.packageModel(Arrays.asList(ids.split(",")),projectId,projectName,zipFileName,log,version);
            data = mpkFileService.packageModel(projectId,projectName,zipFileName,log,version);
        } catch (InterruptedException e) {
            throw new RuntimeException("模型打包失败",e);
        }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dao/MpkFileDao.java
@@ -32,4 +32,6 @@
    List<MpkFileDTO> getProjectModel(@Param("params") Map<String, Object> params);
    List<MpkFileDTO> list(@Param("params") Map<String, Object> params);
    List<MpkFileDTO> selectByProjectId(@Param("projectId") String projectId);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dao/ProjectDao.java
@@ -18,6 +18,4 @@
@TenantDS
@Mapper
public interface ProjectDao extends BaseDao<ProjectEntity> {
    IPage<ProjectDTO> getPageList(IPage<ProjectEntity> page, @Param("params") Map<String, Object> params);
}
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/MpkFileService.java
@@ -32,7 +32,7 @@
    byte[] generatorCode(String id, String remark, String zipFileName);
    byte[] packageModel(List<String> ids,String projectId,String projectName,String fileName,String log,String version) throws IOException, InterruptedException;
    byte[] packageModel(String projectId,String projectName,String fileName,String log,String version) throws IOException, InterruptedException;
    Map<String,String> savePyFile(MultipartFile file) throws IOException;
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MpkFileServiceImpl.java
@@ -1,7 +1,6 @@
package com.iailab.module.model.mpk.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.RuntimeUtil;
import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
@@ -16,6 +15,7 @@
import com.iailab.framework.tenant.core.context.TenantContextHolder;
import com.iailab.module.infra.api.config.ConfigApi;
import com.iailab.module.model.mpk.common.MdkConstant;
import com.iailab.module.model.mpk.common.utils.CmdUtils;
import com.iailab.module.model.mpk.common.utils.DllUtils;
import com.iailab.module.model.mpk.common.utils.GenUtils;
import com.iailab.module.model.mpk.dao.MpkFileDao;
@@ -39,10 +39,12 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.io.File;
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -272,27 +274,24 @@
        }
        List<String> javaFilePaths = new ArrayList<>();
        List<String> cppFilePaths = new ArrayList<>();
        //生成java文件
        File javaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + entity.getPyName() + ".java");
        File javaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + entity.getPyName() + ".java");
        GenUtils.drawTemplate("abstract.java.vm", dataContext, javaFile);
        javaFilePaths.add(javaFile.getAbsolutePath());
        //生成Impl.java文件
        File implJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + MdkConstant.IMPL + File.separator + entity.getPyName() + "Impl.java");
        File implJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + MdkConstant.IMPL + File.separator + entity.getPyName() + "Impl.java");
        GenUtils.drawTemplate("impl.java.vm", dataContext, implJavaFile);
        javaFilePaths.add(implJavaFile.getAbsolutePath());
        //生成.cpp文件
        File cppFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + ".cpp");
        GenUtils.drawTemplate("cpp.vm", dataContext, cppFile);
        cppFilePaths.add(cppFile.getAbsolutePath());
        //生成Jni.cpp文件
        File jniCppFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + "Jni.cpp");
        GenUtils.drawTemplate("Jni.cpp.vm", dataContext, jniCppFile);
        cppFilePaths.add(jniCppFile.getAbsolutePath());
        //生成.h文件
        File hFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + ".h");
@@ -312,23 +311,23 @@
        //生成dll文件
        String dllSavePath = dirPath.getAbsolutePath() + File.separator + MdkConstant.LIBS + File.separator + "IAIL.MDK.Mid.Jni.dll";
        createDllFile(dirPath.getAbsolutePath(),cppFilePaths,dllSavePath);
        createDllFile(dirPath.getAbsolutePath(),dllSavePath);
        //备份dll文件,用于后续运行
        String dllBakPath = mpkTenantBakFilePath + File.separator + MdkConstant.DLL + File.separator + entity.getPyName() + ".dll";
        FileUtil.mkParentDirs(dllBakPath);
        FileUtil.copy(dllSavePath, dllBakPath, true);
        //utils + env java文件
        File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "utils" + File.separator + "AlgsUtils.java");
        File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "utils" + File.separator + "AlgsUtils.java");
        FileUtil.mkParentDirs(utilsJavaFile);
        FileUtil.copy(mpkResources + File.separator +"IAILMDK/utils/AlgsUtils.java", utilsJavaFile.getAbsolutePath(), true);
        javaFilePaths.add(utilsJavaFile.getAbsolutePath());
        File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "common" + File.separator + "Environment.java");
        File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "common" + File.separator + "Environment.java");
        FileUtil.mkParentDirs(envJavaFile);
        FileUtil.copy(mpkResources + File.separator +"IAILMDK/common/Environment.java", envJavaFile.getAbsolutePath(), true);
        javaFilePaths.add(envJavaFile.getAbsolutePath());
        // 生成class文件
        createClassFile(javaFilePaths);
        createClassFile(dirPath.getAbsolutePath(),javaFilePaths);
        // 删除java源文件
        deleteJavaFile(javaFilePaths);
        // 打jar包
@@ -363,12 +362,12 @@
    @Override
    @DSTransactional(rollbackFor = Exception.class)
    public byte[] packageModel(List<String> ids, String projectId, String projectName, String zipFileName, String logs, String version) throws IOException, InterruptedException {
    public byte[] packageModel(String projectId, String projectName, String zipFileName, String logs, String version) throws IOException {
        Long tenantId = TenantContextHolder.getTenantId();
        // 备份文件 租户隔离
        String mpkTenantBakFilePath = mpkBakFilePath + File.separator + tenantId;
        List<MpkFileDTO> entities = baseDao.selectByIds(ids);
        List<MpkFileDTO> entities = baseDao.selectByProjectId(projectId);
        //模板数据
//        Map<String, Object> map = new HashMap<>();
@@ -397,7 +396,6 @@
        GenUtils.drawTemplate("menu.xml.vm", new VelocityContext(map1), xmlFile);
        List<String> javaFilePaths = new ArrayList<>();
        List<String> cppFilePaths = new ArrayList<>();
        //生成java文件
        for (MpkFileDTO entity : entities) {
@@ -409,24 +407,22 @@
            data.put("pyModule", entity.getPyModule());
            VelocityContext dataContext = new VelocityContext(data);
            //生成java文件
            File javaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + entity.getPyName() + ".java");
            File javaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + entity.getPyName() + ".java");
            GenUtils.drawTemplate("abstract.java.vm", dataContext, javaFile);
            javaFilePaths.add(javaFile.getAbsolutePath());
            //生成Impl.java文件
            File implJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + MdkConstant.IMPL + File.separator + entity.getPyName() + "Impl.java");
            File implJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + entity.getPkgName().replace(".", File.separator) + File.separator + MdkConstant.IMPL + File.separator + entity.getPyName() + "Impl.java");
            GenUtils.drawTemplate("impl.java.vm", dataContext, implJavaFile);
            javaFilePaths.add(implJavaFile.getAbsolutePath());
            //生成.cpp文件
            File cppFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + ".cpp");
            GenUtils.drawTemplate("cpp.vm", dataContext, cppFile);
            cppFilePaths.add(cppFile.getAbsolutePath());
            //生成Jni.cpp文件
            File jniCppFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + "Jni.cpp");
            GenUtils.drawTemplate("Jni.cpp.vm", dataContext, jniCppFile);
            cppFilePaths.add(jniCppFile.getAbsolutePath());
            //生成.h文件
            File hFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.C + File.separator + entity.getPyName() + ".h");
@@ -447,7 +443,7 @@
        //生成dll文件
        String dllSavePath = dirPath.getAbsolutePath() + File.separator + MdkConstant.LIBS + File.separator + "IAIL.MDK.Mid.Jni.dll";
        createDllFile(dirPath.getAbsolutePath(),cppFilePaths,dllSavePath);
        createDllFile(dirPath.getAbsolutePath(),dllSavePath);
        // 打包历史id
        String historyId = UUID.randomUUID().toString();
        //备份dll,发布时使用
@@ -460,16 +456,16 @@
        }
        //utils + env java文件
        File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "utils" + File.separator + "AlgsUtils.java");
        File utilsJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "utils" + File.separator + "AlgsUtils.java");
        FileUtil.mkParentDirs(utilsJavaFile);
        FileUtil.copy(mpkResources + File.separator +"IAILMDK/utils/AlgsUtils.java", utilsJavaFile.getAbsolutePath(), true);
        javaFilePaths.add(utilsJavaFile.getAbsolutePath());
        File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + "IAILMDK" + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "common" + File.separator + "Environment.java");
        File envJavaFile = new File(dirPath.getAbsolutePath() + File.separator + MdkConstant.IAILMDK + File.separator + "iail" + File.separator + "mdk" + File.separator + "model" + File.separator + "common" + File.separator + "Environment.java");
        FileUtil.mkParentDirs(envJavaFile);
        FileUtil.copy(mpkResources + File.separator +"IAILMDK/common/Environment.java", envJavaFile.getAbsolutePath(), true);
        javaFilePaths.add(envJavaFile.getAbsolutePath());
        // 生成class文件
        createClassFile(javaFilePaths);
        createClassFile(dirPath.getAbsolutePath(),javaFilePaths);
        // 删除java源文件
        deleteJavaFile(javaFilePaths);
        // 打jar包
@@ -525,23 +521,10 @@
        return bytes;
    }
    private void createDllFile(String dirPath, List<String> cppFilePaths, String dllSavePath) {
    private void createDllFile(String dirPath, String dllSavePath) {
        try {
            String paths = cppFilePaths.stream().collect(Collectors.joining(" "));
            String command = "cl /LD " + paths + " /EHsc /o " + dllSavePath + " /link " + "IAIL.MDK.Mid.Windows.lib";
            log.info("执行cmd命令生成dll:" + command);
            ProcessBuilder builder = new ProcessBuilder("cmd", "/c", command);
            builder.directory(new File(dirPath + File.separator + MdkConstant.LIBS));
            Process process = builder.start();
            // 获取命令输出结果
            InputStream inputStream = process.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK
            String line;
            while ((line = reader.readLine()) != null) {
                log.info(line);
            }
            // 等待命令执行完成
            process.waitFor();
            String command = "cl /LD *.cpp /EHsc /o " + dllSavePath + " /link " + "IAIL.MDK.Mid.Windows.lib";
            CmdUtils.exec(command,dirPath + File.separator + MdkConstant.C);
        } catch (Exception e) {
            throw new RuntimeException("执行cmd命令生成dll异常",e);
        }
@@ -607,19 +590,7 @@
        try {
            String command = "python setup.py build_ext --inplace";
            log.info("执行cmd命令编译pyd:" + command);
            ProcessBuilder builder = new ProcessBuilder("cmd", "/c", command);
            builder.directory(new File(dir));  // 设置工作目录
            builder.redirectErrorStream(true);  // 将错误输出和标准输出合并
            Process process = builder.start();
            // 获取命令输出结果
            InputStream inputStream = process.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "GBK")); // 设置编码为GBK
            String line;
            while ((line = reader.readLine()) != null) {
                log.info(line);
            }
            // 等待命令执行完成
            process.waitFor();
            CmdUtils.exec(command,dir);
        } catch (Exception e) {
            throw new RuntimeException("执行cmd命令生成dll异常", e);
        }
@@ -711,12 +682,10 @@
            StringBuilder sb = new StringBuilder();
            sb.append("jar -cvf");
            sb.append(" ").append(jarSavePath);
            sb.append(" -C ").append(dirPath).append(File.separator).append("IAILMDK").append(File.separator).append(" .");
            log.info("执行cmd命令打jar包:" + sb);
            Process process = RuntimeUtil.exec(sb.toString());
            process.waitFor();
            sb.append(" -C ").append(dirPath).append(File.separator).append(MdkConstant.IAILMDK).append(File.separator).append(" .");
            CmdUtils.exec(sb.toString());
            return jarSavePath;
        } catch (InterruptedException e) {
        } catch (Exception e) {
            throw new RuntimeException("执行cmd命令打jar包异常",e);
        }
    }
@@ -727,17 +696,23 @@
        }
    }
    private void createClassFile(List<String> javaFilePaths){
    private void createClassFile(String dirPath,List<String> javaFilePaths){
        try {
            Set<String> pathSet = javaFilePaths.stream().map(path -> {
                // 替换为相对路径
                path = path.replace(dirPath + File.separator + MdkConstant.IAILMDK, ".");
                // 删除文件名,替换为通配符*
                path = path.substring(0, path.lastIndexOf("\\") + 1) + "*.java";
                return path;
            }).collect(Collectors.toSet());
            StringBuilder sb = new StringBuilder();
            sb.append("javac -encoding utf-8");
            for (String path : javaFilePaths) {
            for (String path : pathSet) {
                sb.append(" ").append(path);
            }
            log.info("执行cmd命令生成class:" + sb);
            Process process = RuntimeUtil.exec(sb.toString());
            process.waitFor();
        } catch (InterruptedException e) {
            CmdUtils.exec(sb.toString(),dirPath + File.separator + MdkConstant.IAILMDK);
        } catch (Exception e) {
            throw new RuntimeException("执行cmd命令生成class异常",e);
        }
    }
iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectServiceImpl.java
@@ -49,9 +49,9 @@
    @Override
    public PageData<ProjectDTO> page(Map<String, Object> params) {
        IPage<ProjectDTO> page = baseDao.getPageList(
        IPage<ProjectEntity> page = baseDao.selectPage(
                getPage(params, null, false),
                params
                getWrapper(params)
        );
        return getPageData(page, ProjectDTO.class);
@@ -166,10 +166,12 @@
    public QueryWrapper<ProjectEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");
        String projectName = (String)params.get("projectName");
        String projectCode = (String)params.get("projectCode");
        QueryWrapper<ProjectEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id)
                .like(StringUtils.isNotBlank(projectName),"project_name",projectName);
                .like(StringUtils.isNotBlank(projectName),"project_name",projectName)
                .like(StringUtils.isNotBlank(projectCode),"project_code",projectCode);
        return wrapper;
    }
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/MmPredictItemDao.xml
@@ -41,11 +41,13 @@
        TDMI.CATEGORYID,
        TMIS.last_time,
        TMIS.status run_status,
        TMIS.duration
        TMIS.duration,
        TDMM.modulename
        FROM T_MM_PREDICT_ITEM TMPI
        LEFT JOIN T_MM_ITEM_TYPE TMIT ON TMIT.ID = TMPI.ITEMTYPEID
        LEFT JOIN T_DM_MODULE_ITEM TDMI ON TDMI.ITEMID = TMPI.ID
        LEFT JOIN t_mm_item_status TMIS ON TMIS.item_id = TMPI.ID
        LEFT JOIN T_DM_MODULE TDMM ON TDMM.id = TDMI.moduleid
        <where>
            <if test="params.itemno != null and params.itemno != ''">
                AND TMPI.ITEMNO LIKE CONCAT('%', #{params.itemno},'%')
@@ -62,6 +64,9 @@
            <if test="params.status != null and params.status != ''">
                AND TMPI.STATUS = #{params.status}
            </if>
            <if test="params.modulename != null and params.modulename != ''">
                AND TDMM.modulename LIKE CONCAT('%', #{params.modulename},'%')
            </if>
        </where>
        ORDER BY TMPI.CREATE_TIME DESC
    </select>
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/MpkFileDao.xml
@@ -182,4 +182,34 @@
                LEFT JOIN t_mpk_method_setting t5 ON t4.id = t5.method_id
                LEFT JOIN t_mpk_setting_select t6 ON t5.id = t6.setting_id
    </select>
    <select id="selectByProjectId" resultMap="mpkFile" parameterType="java.lang.String">
        SELECT
        a.*,
        b.id method_id,
        b.method_name,
        b.data_length,
        b.model,
        b.result_key,
        c.id setting_id,
        c.setting_key,
        c.name setting_name,
        c.value,
        c.type,
        c.value_type,
        c.max,
        c.min,
        d.id select_id,
        d.select_key,
        d.name select_name
        FROM
        t_mpk_file a
        LEFT JOIN t_mpk_project_model p ON a.id = p.model_id
        LEFT JOIN t_mpk_model_method b ON a.id = b.mpk_file_id
        LEFT JOIN t_mpk_method_setting c ON b.id = c.method_id
        LEFT JOIN t_mpk_setting_select d ON c.id = d.setting_id
        LEFT JOIN t_mpk_file_menu e ON e.name = a.menu_name
        LEFT JOIN t_mpk_file_group f ON f.menu_id = e.id and f.name = a.group_name
        WHERE p.project_id = #{projectId}
        ORDER BY b.sort,c.sort,d.sort,e.sort,f.sort,a.create_date
    </select>
</mapper>
iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mpk/ProjectDao.xml
@@ -12,27 +12,4 @@
            <result property="pyName" column="py_name"/>
        </collection>
    </resultMap>
    <select id="getPageList" resultMap="projectModel" resultType="com.iailab.module.model.mpk.dto.ProjectDTO">
        SELECT
            t1.id,
            t1.project_name,
            t1.project_code,
            t1.create_time,
            t2.model_id,
            t3.py_name
        FROM
            t_mpk_project t1
                LEFT JOIN t_mpk_project_model t2 on t1.id = t2.project_id
                LEFT JOIN t_mpk_file t3 ON t2.model_id = t3.id
        <where>
            <if test="params.projectName != null and params.projectName != ''">
                and t1.project_name like CONCAT('%',#{params.projectName},'%')
            </if>
            <if test="params.projectCode != null and params.projectCode != ''">
                and t1.project_code like CONCAT('%',#{params.projectCode},'%')
            </if>
        </where>
        order by t1.create_time desc
    </select>
</mapper>