修改添加系统模特到个人lib接口
This commit is contained in:
@@ -848,10 +848,13 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
if (Objects.isNull(sysFile)) {
|
||||
throw new BusinessException("model.not.found", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
SysFileExtra sysFileExtra = sysFileExtraMapper.selectOne(new QueryWrapper<SysFileExtra>().eq("sys_id", sysFile.getId()));
|
||||
|
||||
// 添加模特信息到library
|
||||
Library library = CopyUtil.copyObject(sysFile, Library.class);
|
||||
library.setId(null);
|
||||
library.setAccountId(accountId);
|
||||
library.setLevel3Type(sysFileExtra.getAgeGroup());
|
||||
library.setName(DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD));
|
||||
List<Integer> imagesWidthAndHeight = minioUtil.getImagesWidthAndHeight(sysFile.getUrl());
|
||||
library.setWidth(imagesWidthAndHeight.get(0));
|
||||
@@ -860,6 +863,14 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
library.setUpdateDate(null);
|
||||
libraryMapper.insert(library);
|
||||
|
||||
// 添加点位信息到library
|
||||
LibraryModelPoint sysModelPoint = libraryModelPointService.getByRelationId(sysModelId, "System");
|
||||
sysModelPoint.setId(null);
|
||||
sysModelPoint.setModelType("Library");
|
||||
sysModelPoint.setRelationId(library.getId());
|
||||
sysModelPoint.setCreateDate(new Date());
|
||||
libraryModelPointService.save(sysModelPoint);
|
||||
|
||||
return library.getId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user