TASK:模块化;
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.ai.da.mapper.primary;
|
||||
|
||||
import com.ai.da.common.config.mybatis.plus.CommonMapper;
|
||||
import com.ai.da.mapper.primary.entity.SysFileExtra;
|
||||
|
||||
public interface SysFileExtraMapper extends CommonMapper<SysFileExtra> {
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ai.da.mapper.primary.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("sys_file_extra")
|
||||
public class SysFileExtra implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private Long sysId;
|
||||
|
||||
private String ageGroup;
|
||||
}
|
||||
@@ -68,6 +68,8 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
@Resource
|
||||
private SysFileMapper sysFileMapper;
|
||||
@Resource
|
||||
private SysFileExtraMapper sysFileExtraMapper;
|
||||
@Resource
|
||||
private FileProperties fileProperties;
|
||||
@Resource
|
||||
private LibraryModelPointService libraryModelPointService;
|
||||
@@ -755,6 +757,12 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
sysFile.setMd5(uploadDTO.getMd5());
|
||||
sysFile.setCreateDate(new Date());
|
||||
sysFileMapper.insert(sysFile);
|
||||
|
||||
SysFileExtra extra = new SysFileExtra();
|
||||
extra.setSysId(sysFile.getId());
|
||||
extra.setAgeGroup(uploadDTO.getAgeGroup());
|
||||
sysFileExtraMapper.insert(extra);
|
||||
|
||||
Library library = new Library();
|
||||
library.setId(sysFile.getId());
|
||||
library.setUrl(sysFile.getUrl());
|
||||
|
||||
@@ -65,6 +65,9 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
@Resource
|
||||
private SysFileMapper sysFileMapper;
|
||||
|
||||
@Resource
|
||||
private SysFileExtraMapper sysFileExtraMapper;
|
||||
|
||||
@Resource
|
||||
private MinioUtil minioUtil;
|
||||
|
||||
@@ -425,6 +428,17 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
// sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, SysFileLevel2TypeEnum.BODY.getRealName());
|
||||
sysFileQueryWrapper.lambda().eq(SysFile::getLevel1Type, "Models");
|
||||
sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, sex);
|
||||
|
||||
QueryWrapper<SysFileExtra> sysFileExtraQueryWrapper = new QueryWrapper<>();
|
||||
sysFileExtraQueryWrapper.lambda().eq(SysFileExtra::getAgeGroup, ageGroup);
|
||||
List<SysFileExtra> sysFileExtras = sysFileExtraMapper.selectList(sysFileExtraQueryWrapper);
|
||||
if (!CollectionUtils.isEmpty(sysFileExtras)) {
|
||||
Set<Long> collect = sysFileExtras.stream().map(SysFileExtra::getSysId).collect(Collectors.toSet());
|
||||
if (!CollectionUtils.isEmpty(collect)) {
|
||||
sysFileQueryWrapper.lambda().in(SysFile::getId, collect);
|
||||
}
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(style)) {
|
||||
sysFileQueryWrapper.lambda().eq(SysFile::getLevel3Type, style);
|
||||
}
|
||||
@@ -432,6 +446,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
// sysFileQueryWrapper.lambda().eq(SysFile::getLevel3Type, style);
|
||||
// sysFileQueryWrapper.lambda().isNull(SysFile::getLevel3Type);
|
||||
// }
|
||||
|
||||
List<SysFile> sysFileList = sysFileMapper.selectList(sysFileQueryWrapper);
|
||||
if (!CollectionUtils.isEmpty(sysFileList)) {
|
||||
List<ModelVO> modelVOList = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user