Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface ProjectDao extends BaseDao<ProjectEntity> { |
| | | |
| | | IPage<ProjectDTO> getPageList(IPage<ProjectEntity> page, @Param("params") Map<String, Object> params); |
| | | } |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | |
| | | @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<>(); |
| | |
| | | |
| | | @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); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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> |
| | |
| | | <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> |