潘志宝
2024-12-12 3374d19db03cce97572c3a294f137d1ea70b307f
Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat
已修改8个文件
75 ■■■■■ 文件已修改
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 4 ●●●● 补丁 | 查看 | 原始文档 | 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/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/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
@@ -363,12 +363,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<>();
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/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>