Merge remote-tracking branch 'origin/dev_shb' into develop
# Conflicts: # src/main/java/com/ai/da/service/impl/DesignServiceImpl.java # src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java
This commit is contained in:
@@ -15,7 +15,8 @@ public enum DesignTypeEnum {
|
|||||||
/**
|
/**
|
||||||
* Library
|
* Library
|
||||||
*/
|
*/
|
||||||
LIBRARY("Library");
|
LIBRARY("Library"),
|
||||||
|
GENERATE("Generate");
|
||||||
|
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package com.ai.da.controller;
|
|||||||
import com.ai.da.common.response.Response;
|
import com.ai.da.common.response.Response;
|
||||||
import com.ai.da.common.utils.MinioUtil;
|
import com.ai.da.common.utils.MinioUtil;
|
||||||
import com.ai.da.mapper.entity.Workspace;
|
import com.ai.da.mapper.entity.Workspace;
|
||||||
|
import com.ai.da.model.dto.ModelsDotDTO;
|
||||||
import com.ai.da.model.dto.WorkspaceDTO;
|
import com.ai.da.model.dto.WorkspaceDTO;
|
||||||
import com.ai.da.model.enums.BizJson;
|
import com.ai.da.model.enums.BizJson;
|
||||||
|
import com.ai.da.model.vo.ModelsVO;
|
||||||
import com.ai.da.model.vo.WorkspaceVO;
|
import com.ai.da.model.vo.WorkspaceVO;
|
||||||
import com.ai.da.service.WorkspaceService;
|
import com.ai.da.service.WorkspaceService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -38,29 +40,6 @@ public class WorkspaceController {
|
|||||||
@Resource
|
@Resource
|
||||||
private WorkspaceService workspaceService;
|
private WorkspaceService workspaceService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MinioUtil minIoUtil;
|
|
||||||
|
|
||||||
@Value("${minio.endpoint}")
|
|
||||||
public String address;
|
|
||||||
|
|
||||||
@Value("${minio.bucketName}")
|
|
||||||
public String bucketName;
|
|
||||||
|
|
||||||
@PostMapping("/upload")
|
|
||||||
public Object upload(MultipartFile file) {
|
|
||||||
|
|
||||||
List<String> upload = minIoUtil.upload(new MultipartFile[]{file});
|
|
||||||
|
|
||||||
return address+"/"+bucketName+"/"+upload.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/getUrl")
|
|
||||||
public Object getUrl() {
|
|
||||||
|
|
||||||
return minIoUtil.getPresignedUrl("test", "R-C_1694066189047.png", 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
@@ -112,5 +91,13 @@ public class WorkspaceController {
|
|||||||
return Response.success(bizJsonList);
|
return Response.success(bizJsonList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getMannequins")
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@ApiOperation(value = "获取模特")
|
||||||
|
public Response<List<ModelsVO>> getMannequins() {
|
||||||
|
List<ModelsVO> modelsVO = workspaceService.getMannequins();
|
||||||
|
return Response.success(modelsVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ public class CollectionElement implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long collectionId;
|
private Long collectionId;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 一级类型
|
* 一级类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
13
src/main/java/com/ai/da/model/vo/ModelVO.java
Normal file
13
src/main/java/com/ai/da/model/vo/ModelVO.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package com.ai.da.model.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ModelVO {
|
||||||
|
private Long id;
|
||||||
|
private String url;
|
||||||
|
}
|
||||||
14
src/main/java/com/ai/da/model/vo/ModelsVO.java
Normal file
14
src/main/java/com/ai/da/model/vo/ModelsVO.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package com.ai.da.model.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ModelsVO {
|
||||||
|
|
||||||
|
private List<ModelVO> modelList;
|
||||||
|
private String type;
|
||||||
|
}
|
||||||
@@ -28,6 +28,8 @@ public class ValidateElementVO {
|
|||||||
List<Long> usedElementIds = Lists.newArrayList();
|
List<Long> usedElementIds = Lists.newArrayList();
|
||||||
//用于存储library 生成collection
|
//用于存储library 生成collection
|
||||||
List<CollectionElement> libraryCollectionElements = Lists.newArrayList();
|
List<CollectionElement> libraryCollectionElements = Lists.newArrayList();
|
||||||
|
//用于存储generate 生成collection
|
||||||
|
List<CollectionElement> generateCollectionElements = Lists.newArrayList();
|
||||||
//存储template打点数据
|
//存储template打点数据
|
||||||
DesignLibraryModelPointVO designLibraryModelPoint =null;
|
DesignLibraryModelPointVO designLibraryModelPoint =null;
|
||||||
//存储本次design已经使用的上衣和下衣的的MD5list 去重用
|
//存储本次design已经使用的上衣和下衣的的MD5list 去重用
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,15 @@
|
|||||||
package com.ai.da.service;
|
package com.ai.da.service;
|
||||||
|
|
||||||
|
import com.ai.da.mapper.entity.Design;
|
||||||
|
import com.ai.da.mapper.entity.Generate;
|
||||||
import com.ai.da.model.dto.GenerateLikeDTO;
|
import com.ai.da.model.dto.GenerateLikeDTO;
|
||||||
import com.ai.da.model.dto.GenerateThroughImageTextDTO;
|
import com.ai.da.model.dto.GenerateThroughImageTextDTO;
|
||||||
import com.ai.da.model.vo.GenerateCaptionVO;
|
import com.ai.da.model.vo.GenerateCaptionVO;
|
||||||
import com.ai.da.model.vo.GenerateCollectionVO;
|
import com.ai.da.model.vo.GenerateCollectionVO;
|
||||||
import com.ai.da.model.vo.GenerateLikeVO;
|
import com.ai.da.model.vo.GenerateLikeVO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
public interface GenerateService {
|
public interface GenerateService extends IService<Generate> {
|
||||||
|
|
||||||
GenerateCaptionVO generateCaption(Long sketchElementId);
|
GenerateCaptionVO generateCaption(Long sketchElementId);
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.ai.da.service;
|
|||||||
import com.ai.da.mapper.entity.Workspace;
|
import com.ai.da.mapper.entity.Workspace;
|
||||||
import com.ai.da.model.dto.WorkspaceDTO;
|
import com.ai.da.model.dto.WorkspaceDTO;
|
||||||
import com.ai.da.model.enums.BizJson;
|
import com.ai.da.model.enums.BizJson;
|
||||||
|
import com.ai.da.model.vo.ModelsVO;
|
||||||
import com.ai.da.model.vo.WorkspaceVO;
|
import com.ai.da.model.vo.WorkspaceVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
@@ -35,4 +36,6 @@ public interface WorkspaceService extends IService<Workspace> {
|
|||||||
List<BizJson> getEnumValues(String enumName);
|
List<BizJson> getEnumValues(String enumName);
|
||||||
|
|
||||||
Workspace getByIdNew(Long id);
|
Workspace getByIdNew(Long id);
|
||||||
|
|
||||||
|
List<ModelsVO> getMannequins();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
@Resource
|
@Resource
|
||||||
private LibraryService libraryService;
|
private LibraryService libraryService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private GenerateService generateService;
|
||||||
|
@Resource
|
||||||
private LibraryModelPointService libraryModelPointService;
|
private LibraryModelPointService libraryModelPointService;
|
||||||
@Resource
|
@Resource
|
||||||
private TCollectionElementRelationService tCollectionElementRelationService;
|
private TCollectionElementRelationService tCollectionElementRelationService;
|
||||||
@@ -231,6 +233,7 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
|
|
||||||
List<Long> usedElementIds = elementVO.getUsedElementIds();
|
List<Long> usedElementIds = elementVO.getUsedElementIds();
|
||||||
List<CollectionElement> libraryCollectionElements = elementVO.getLibraryCollectionElements();
|
List<CollectionElement> libraryCollectionElements = elementVO.getLibraryCollectionElements();
|
||||||
|
List<CollectionElement> generateCollectionElements = elementVO.getGenerateCollectionElements();
|
||||||
//校验moodboard
|
//校验moodboard
|
||||||
if (CollectionUtil.isNotEmpty(designDTO.getMoodBoards())) {
|
if (CollectionUtil.isNotEmpty(designDTO.getMoodBoards())) {
|
||||||
//校验designType
|
//校验designType
|
||||||
@@ -258,6 +261,17 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys,null));
|
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys,null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// generate
|
||||||
|
List<Long> generateIds = designDTO.getMoodBoards().stream()
|
||||||
|
.filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName())))
|
||||||
|
.map(DesignCollectionElementDTO::getId)
|
||||||
|
.collect((Collectors.toList()));
|
||||||
|
if(CollectionUtil.isNotEmpty(generateIds)) {
|
||||||
|
List<Generate> generateList = generateService.listByIds(generateIds);
|
||||||
|
if(CollectionUtil.isNotEmpty(generateList)){
|
||||||
|
generateCollectionElements.addAll(covertGeneratesToCollections(generateList,null));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
|
if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
|
||||||
//校验designType
|
//校验designType
|
||||||
@@ -289,6 +303,20 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
libraryCollectionElements.addAll(covertLibrarysToPrintCollections(librarys,idToMap));
|
libraryCollectionElements.addAll(covertLibrarysToPrintCollections(librarys,idToMap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// generate
|
||||||
|
List<Long> generateIds = designDTO.getPrintBoards().stream()
|
||||||
|
.filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName())))
|
||||||
|
.map(DesignCollectionPrintElementDTO::getId)
|
||||||
|
.collect((Collectors.toList()));
|
||||||
|
if(CollectionUtil.isNotEmpty(generateIds)) {
|
||||||
|
List<Generate> generateList = generateService.listByIds(generateIds);
|
||||||
|
if(CollectionUtil.isNotEmpty(generateList)){
|
||||||
|
Map<Long,DesignCollectionPrintElementDTO> idToMap = designDTO.getPrintBoards()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(DesignCollectionPrintElementDTO::getId,v ->v));
|
||||||
|
generateCollectionElements.addAll(covertGeneratesToPrintCollections(generateList,idToMap));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
|
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
|
||||||
//校验PIN是否满足 上衣或者下衣必须不超过8
|
//校验PIN是否满足 上衣或者下衣必须不超过8
|
||||||
@@ -335,6 +363,20 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys,idToMap));
|
libraryCollectionElements.addAll(covertLibrarysToCollections(librarys,idToMap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// generate
|
||||||
|
List<Long> generateIds = designDTO.getSketchBoards().stream()
|
||||||
|
.filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName())))
|
||||||
|
.map(CollectionSketchDTO::getSketchBoardId)
|
||||||
|
.collect((Collectors.toList()));
|
||||||
|
if(CollectionUtil.isNotEmpty(generateIds)) {
|
||||||
|
List<Generate> generateList = generateService.listByIds(generateIds);
|
||||||
|
if(CollectionUtil.isNotEmpty(generateList)){
|
||||||
|
Map<Long,CollectionSketchDTO> idToMap = designDTO.getSketchBoards()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId,v ->v));
|
||||||
|
generateCollectionElements.addAll(covertGeneratesToCollections(generateList,idToMap));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//校验marketingSketch
|
//校验marketingSketch
|
||||||
// 2023.12版本去掉了这个入参
|
// 2023.12版本去掉了这个入参
|
||||||
@@ -411,11 +453,30 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<CollectionElement> covertGeneratesToCollections(List<Generate> generates, Map<Long,CollectionSketchDTO> idToMap){
|
||||||
|
return CopyUtil.copyList(generates,CollectionElement.class,(o,d) ->{
|
||||||
|
if(null != idToMap){
|
||||||
|
CollectionSketchDTO sketchDTO = idToMap.get(o.getId());
|
||||||
|
d.setLevel2Type(sketchDTO.getLevel2Type());
|
||||||
|
d.setHasPin(sketchDTO.getIsPin());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private List<CollectionElement> covertLibrarysToPrintCollections(List<Library> libraries, Map<Long,DesignCollectionPrintElementDTO> idToMap){
|
private List<CollectionElement> covertLibrarysToPrintCollections(List<Library> libraries, Map<Long,DesignCollectionPrintElementDTO> idToMap){
|
||||||
return CopyUtil.copyList(libraries,CollectionElement.class,(o,d) ->{
|
return CopyUtil.copyList(libraries,CollectionElement.class,(o,d) ->{
|
||||||
if(null != idToMap){
|
if(null != idToMap){
|
||||||
DesignCollectionPrintElementDTO sketchDTO = idToMap.get(o.getId());
|
DesignCollectionPrintElementDTO printDTO = idToMap.get(o.getId());
|
||||||
d.setHasPin(sketchDTO.getIsPin());
|
d.setHasPin(printDTO.getIsPin());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<CollectionElement> covertGeneratesToPrintCollections(List<Generate> generates, Map<Long,DesignCollectionPrintElementDTO> idToMap){
|
||||||
|
return CopyUtil.copyList(generates,CollectionElement.class,(o,d) ->{
|
||||||
|
if(null != idToMap){
|
||||||
|
DesignCollectionPrintElementDTO printDTO = idToMap.get(o.getId());
|
||||||
|
d.setHasPin(printDTO.getIsPin());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class DesignItemServiceImpl extends ServiceImpl<DesignItemMapper, DesignI
|
|||||||
private PanToneService panToneService;
|
private PanToneService panToneService;
|
||||||
@Resource
|
@Resource
|
||||||
private MinioUtil minioUtil;
|
private MinioUtil minioUtil;
|
||||||
@Value("${minio.bucketName}")
|
@Value("${minio.bucketName.results}")
|
||||||
private String bucketName;
|
private String bucketName;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.ai.da.common.config.FileProperties;
|
|||||||
import com.ai.da.common.config.exception.BusinessException;
|
import com.ai.da.common.config.exception.BusinessException;
|
||||||
import com.ai.da.common.context.UserContext;
|
import com.ai.da.common.context.UserContext;
|
||||||
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
|
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
|
||||||
|
import com.ai.da.common.enums.DesignTypeEnum;
|
||||||
import com.ai.da.common.enums.SysFileLevel2TypeEnum;
|
import com.ai.da.common.enums.SysFileLevel2TypeEnum;
|
||||||
import com.ai.da.common.utils.*;
|
import com.ai.da.common.utils.*;
|
||||||
import com.ai.da.mapper.DesignMapper;
|
import com.ai.da.mapper.DesignMapper;
|
||||||
@@ -83,44 +84,46 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
private PythonTAllInfoService pythonTAllInfoService;
|
private PythonTAllInfoService pythonTAllInfoService;
|
||||||
@Value("${minio.endpoint}")
|
@Value("${minio.endpoint}")
|
||||||
private String endpoint;
|
private String endpoint;
|
||||||
@Value("${minio.bucketName}")
|
@Value("${minio.bucketName.results}")
|
||||||
private String bucketName;
|
private String bucketName;
|
||||||
|
|
||||||
// @Transactional
|
// @Transactional
|
||||||
@Override
|
@Override
|
||||||
public DesignCollectionVO designCollection(DesignCollectionDTO designDTO) {
|
public DesignCollectionVO designCollection(DesignCollectionDTO designDTO) {
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
//校验collection element
|
//校验collection element
|
||||||
ValidateElementVO elementVO =collectionElementService.validateElement(designDTO);
|
ValidateElementVO elementVO = collectionElementService.validateElement(designDTO);
|
||||||
//design
|
//design
|
||||||
return designOrRedesignOperateNew(designDTO,userInfo,null,elementVO);
|
return designOrRedesignOperateNew(designDTO, userInfo, null, elementVO);
|
||||||
}
|
}
|
||||||
private void calculateLibraryAndSysFile(DesignCollectionDTO designDTO,ValidateElementVO elementVO,AuthPrincipalVo userInfo){
|
|
||||||
|
private void calculateLibraryAndSysFile(DesignCollectionDTO designDTO, ValidateElementVO elementVO, AuthPrincipalVo userInfo) {
|
||||||
//查询用户 sketch library
|
//查询用户 sketch library
|
||||||
List<LibraryVo> libraryVos ;
|
List<LibraryVo> libraryVos;
|
||||||
if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){
|
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
|
||||||
List<String> sketchUrlList = elementVO.getSketchBoardElements()
|
List<String> sketchUrlList = elementVO.getSketchBoardElements()
|
||||||
.stream()
|
.stream()
|
||||||
.map(CollectionElement::getUrl)
|
.map(CollectionElement::getUrl)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
DesignAttributeRetrievalDTO designAttributeRetrievalDTO =
|
DesignAttributeRetrievalDTO designAttributeRetrievalDTO =
|
||||||
pythonService.generateAttributeRetrieval(sketchUrlList,userInfo.getId());
|
pythonService.generateAttributeRetrieval(sketchUrlList, userInfo.getId());
|
||||||
if(CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())){
|
if (CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())) {
|
||||||
libraryVos = null;
|
libraryVos = null;
|
||||||
}else{
|
} else {
|
||||||
libraryVos =libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(),userInfo.getId());
|
libraryVos = libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(), userInfo.getId());
|
||||||
}
|
}
|
||||||
List<SysFileVO> sysFileVOS =sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS());
|
List<SysFileVO> sysFileVOS = sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS());
|
||||||
elementVO.setSysFileVo(sysFileVOS);
|
elementVO.setSysFileVo(sysFileVOS);
|
||||||
}else{
|
} else {
|
||||||
libraryVos =libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(),
|
libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(),
|
||||||
Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()));
|
Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()));
|
||||||
}
|
}
|
||||||
elementVO.setLibraryVos(libraryVos);
|
elementVO.setLibraryVos(libraryVos);
|
||||||
//校验比列
|
//校验比列
|
||||||
validateRatio(designDTO,libraryVos);
|
validateRatio(designDTO, libraryVos);
|
||||||
}
|
}
|
||||||
private void validateRatio(DesignCollectionDTO designDTO, List<LibraryVo> libraryVos){
|
|
||||||
|
private void validateRatio(DesignCollectionDTO designDTO, List<LibraryVo> libraryVos) {
|
||||||
//校验系统比列,先去掉 考虑到程序已经进入比较后面了,该校验不重要,且会产生脏数据
|
//校验系统比列,先去掉 考虑到程序已经进入比较后面了,该校验不重要,且会产生脏数据
|
||||||
// BigDecimal bigDecimal = designDTO.getSystemScale();
|
// BigDecimal bigDecimal = designDTO.getSystemScale();
|
||||||
// //池子是包括三部分 = 本次用户上传的sketch + library的sketch +系统的sketch,systemScale计算的是 library和sysFile的比列
|
// //池子是包括三部分 = 本次用户上传的sketch + library的sketch +系统的sketch,systemScale计算的是 library和sysFile的比列
|
||||||
@@ -130,127 +133,179 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
// throw new BusinessException("No sketch, please increase the system rate");
|
// throw new BusinessException("No sketch, please increase the system rate");
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
private void saveCollectionElemntsByLibrarys(ValidateElementVO elementVO,Long collectionId){
|
|
||||||
if(CollectionUtils.isEmpty(elementVO.getLibraryCollectionElements())){
|
private void saveCollectionElemntsByLibrarys(ValidateElementVO elementVO, Long collectionId) {
|
||||||
|
if (CollectionUtils.isEmpty(elementVO.getLibraryCollectionElements())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elementVO.getLibraryCollectionElements()
|
elementVO.getLibraryCollectionElements()
|
||||||
.forEach(element ->{
|
.forEach(element -> {
|
||||||
element.setCollectionId(collectionId);
|
element.setCollectionId(collectionId);
|
||||||
Byte hasPin = element.getHasPin();
|
Byte hasPin = element.getHasPin();
|
||||||
if(Objects.isNull(hasPin)){
|
if (Objects.isNull(hasPin)) {
|
||||||
element.setHasPin((byte) 0);
|
element.setHasPin((byte) 0);
|
||||||
}
|
}
|
||||||
element.setId(null);
|
element.setId(null);
|
||||||
|
// element.setType(DesignTypeEnum.LIBRARY.getRealName());
|
||||||
});
|
});
|
||||||
List<CollectionElement> saveElements = elementVO.getLibraryCollectionElements();
|
List<CollectionElement> saveElements = elementVO.getLibraryCollectionElements();
|
||||||
collectionElementService.saveBatch(saveElements);
|
collectionElementService.saveBatch(saveElements);
|
||||||
elementVO.getUsedElementIds().addAll(saveElements.stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
elementVO.getUsedElementIds().addAll(saveElements.stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||||
//sketch
|
//sketch
|
||||||
List<CollectionElement> newSketchAboard =saveElements.stream()
|
List<CollectionElement> newSketchAboard = saveElements.stream()
|
||||||
.filter(f->f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()))
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(!CollectionUtils.isEmpty(newSketchAboard)){
|
if (!CollectionUtils.isEmpty(newSketchAboard)) {
|
||||||
elementVO.getSketchBoardElements().addAll(newSketchAboard);
|
elementVO.getSketchBoardElements().addAll(newSketchAboard);
|
||||||
}
|
}
|
||||||
//print
|
//print
|
||||||
List<CollectionElement> newPrintboard =saveElements.stream()
|
List<CollectionElement> newPrintboard = saveElements.stream()
|
||||||
.filter(f->f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName()))
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(!CollectionUtils.isEmpty(newPrintboard)){
|
if (!CollectionUtils.isEmpty(newPrintboard)) {
|
||||||
elementVO.getPrintBoardElements().addAll(newPrintboard);
|
elementVO.getPrintBoardElements().addAll(newPrintboard);
|
||||||
}
|
}
|
||||||
|
//mood
|
||||||
|
List<CollectionElement> newMoodboard = saveElements.stream()
|
||||||
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.MOOD_BOARD.getRealName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(newMoodboard)) {
|
||||||
|
elementVO.getMoodBoardElements().addAll(newMoodboard);
|
||||||
}
|
}
|
||||||
private DesignCollectionVO designOrRedesignOperate(DesignCollectionDTO designDTO,AuthPrincipalVo userInfo,
|
}
|
||||||
Long collectionIdParam,ValidateElementVO elementVO){
|
|
||||||
if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){
|
private void saveCollectionElemntsByGenerates(ValidateElementVO elementVO, Long collectionId) {
|
||||||
|
if (CollectionUtils.isEmpty(elementVO.getGenerateCollectionElements())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
elementVO.getGenerateCollectionElements()
|
||||||
|
.forEach(element -> {
|
||||||
|
element.setCollectionId(collectionId);
|
||||||
|
Byte hasPin = element.getHasPin();
|
||||||
|
if (Objects.isNull(hasPin)) {
|
||||||
|
element.setHasPin((byte) 0);
|
||||||
|
}
|
||||||
|
element.setId(null);
|
||||||
|
// element.setType(DesignTypeEnum.GENERATE.getRealName());
|
||||||
|
});
|
||||||
|
List<CollectionElement> saveElements = elementVO.getGenerateCollectionElements();
|
||||||
|
collectionElementService.saveBatch(saveElements);
|
||||||
|
elementVO.getUsedElementIds().addAll(saveElements.stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||||
|
//sketch
|
||||||
|
List<CollectionElement> newSketchAboard = saveElements.stream()
|
||||||
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(newSketchAboard)) {
|
||||||
|
elementVO.getSketchBoardElements().addAll(newSketchAboard);
|
||||||
|
}
|
||||||
|
//print
|
||||||
|
List<CollectionElement> newPrintboard = saveElements.stream()
|
||||||
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(newPrintboard)) {
|
||||||
|
elementVO.getPrintBoardElements().addAll(newPrintboard);
|
||||||
|
}
|
||||||
|
//mood
|
||||||
|
List<CollectionElement> newMoodboard = saveElements.stream()
|
||||||
|
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.MOOD_BOARD.getRealName()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (!CollectionUtils.isEmpty(newMoodboard)) {
|
||||||
|
elementVO.getMoodBoardElements().addAll(newMoodboard);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private DesignCollectionVO designOrRedesignOperate(DesignCollectionDTO designDTO, AuthPrincipalVo userInfo,
|
||||||
|
Long collectionIdParam, ValidateElementVO elementVO) {
|
||||||
|
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
|
||||||
//编辑sketchBoard
|
//编辑sketchBoard
|
||||||
collectionElementService.editSketchBoardsElement(elementVO,designDTO.getSketchBoards());
|
collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards());
|
||||||
}
|
}
|
||||||
if(CollectionUtil.isNotEmpty(designDTO.getPrintBoards())){
|
if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
|
||||||
//编辑printBoard
|
//编辑printBoard
|
||||||
collectionElementService.editPrintBoardsElement(elementVO,designDTO.getPrintBoards());
|
collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards());
|
||||||
}
|
}
|
||||||
//保存collection
|
//保存collection
|
||||||
Long collectionId = (null == collectionIdParam) ?
|
Long collectionId = (null == collectionIdParam) ?
|
||||||
collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam;
|
collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId()) : collectionIdParam;
|
||||||
List<Long> elementIds = getElementId(elementVO);
|
List<Long> elementIds = getElementId(elementVO);
|
||||||
//批量关联element 到 collection
|
//批量关联element 到 collection
|
||||||
collectionElementService.relationCollection(elementIds,collectionId);
|
collectionElementService.relationCollection(elementIds, collectionId);
|
||||||
//library转化为collection(生成)
|
//library转化为collection(生成)
|
||||||
saveCollectionElemntsByLibrarys(elementVO,collectionId);
|
saveCollectionElemntsByLibrarys(elementVO, collectionId);
|
||||||
//保存颜色版
|
//保存颜色版
|
||||||
List<CollectionElementVO> colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone());
|
List<CollectionElementVO> colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone());
|
||||||
//保存design
|
//保存design
|
||||||
Long designId = saveOne(designDTO,collectionId,userInfo.getId());
|
Long designId = saveOne(designDTO, collectionId, userInfo.getId());
|
||||||
//计算library
|
//计算library
|
||||||
calculateLibraryAndSysFile(designDTO,elementVO,userInfo);
|
calculateLibraryAndSysFile(designDTO, elementVO, userInfo);
|
||||||
//组装design入参
|
//组装design入参
|
||||||
DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(),
|
DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(),
|
||||||
designDTO.getSingleOverall(),designDTO.getSwitchCategory(),elementVO);
|
designDTO.getSingleOverall(), designDTO.getSwitchCategory(), elementVO);
|
||||||
//缓存保存的文件 方便后面处理进度问题
|
//缓存保存的文件 方便后面处理进度问题
|
||||||
setDesignProcess(userInfo.getId(),pythonObjects);
|
setDesignProcess(userInfo.getId(), pythonObjects);
|
||||||
//design
|
//design
|
||||||
pythonService.design(pythonObjects);
|
pythonService.design(pythonObjects);
|
||||||
//生成library
|
//生成library
|
||||||
generateLibrary(elementVO,designDTO.getTimeZone());
|
generateLibrary(elementVO, designDTO.getTimeZone());
|
||||||
//处理关联关系,修复element覆盖得情况
|
//处理关联关系,修复element覆盖得情况
|
||||||
List<CollectionElement> reLationelements =collectionElementService.getByOnlyCollectionId(collectionId);
|
List<CollectionElement> reLationelements = collectionElementService.getByOnlyCollectionId(collectionId);
|
||||||
List<Long> reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
List<Long> reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||||
handleCollectionElementRelation(collectionId,(null == collectionIdParam) ? false :true,reLationelementIds);
|
handleCollectionElementRelation(collectionId, (null == collectionIdParam) ? false : true, reLationelementIds);
|
||||||
//保存python返回信息
|
//保存python返回信息
|
||||||
// return savePythonDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone(),responseJSONObject);
|
// return savePythonDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone(),responseJSONObject);
|
||||||
//保存designItem 和detail
|
//保存designItem 和detail
|
||||||
return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone());
|
return saveDesignItemAndDetail(pythonObjects, designId, collectionId, userInfo, designDTO.getTimeZone());
|
||||||
}
|
}
|
||||||
|
|
||||||
private DesignCollectionVO designOrRedesignOperateNew(DesignCollectionDTO designDTO,AuthPrincipalVo userInfo,
|
private DesignCollectionVO designOrRedesignOperateNew(DesignCollectionDTO designDTO, AuthPrincipalVo userInfo,
|
||||||
Long collectionIdParam,ValidateElementVO elementVO){
|
Long collectionIdParam, ValidateElementVO elementVO) {
|
||||||
if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){
|
if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) {
|
||||||
//编辑sketchBoard
|
//编辑sketchBoard
|
||||||
collectionElementService.editSketchBoardsElement(elementVO,designDTO.getSketchBoards());
|
collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards());
|
||||||
}
|
}
|
||||||
if(CollectionUtil.isNotEmpty(designDTO.getPrintBoards())){
|
if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) {
|
||||||
//编辑printBoard
|
//编辑printBoard
|
||||||
collectionElementService.editPrintBoardsElement(elementVO,designDTO.getPrintBoards());
|
collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards());
|
||||||
}
|
}
|
||||||
//保存collection
|
//保存collection
|
||||||
Long collectionId = (null == collectionIdParam) ?
|
Long collectionId = (null == collectionIdParam) ?
|
||||||
collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam;
|
collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId()) : collectionIdParam;
|
||||||
List<Long> elementIds = getElementId(elementVO);
|
List<Long> elementIds = getElementId(elementVO);
|
||||||
//批量关联element 到 collection
|
//批量关联element 到 collection
|
||||||
collectionElementService.relationCollection(elementIds,collectionId);
|
collectionElementService.relationCollection(elementIds, collectionId);
|
||||||
//library转化为collection(生成)
|
//library转化为collection(生成)
|
||||||
saveCollectionElemntsByLibrarys(elementVO,collectionId);
|
saveCollectionElemntsByLibrarys(elementVO, collectionId);
|
||||||
|
//generate转化为collection(生成)
|
||||||
|
saveCollectionElemntsByGenerates(elementVO, collectionId);
|
||||||
//保存颜色版
|
//保存颜色版
|
||||||
List<CollectionElementVO> colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone());
|
List<CollectionElementVO> colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone());
|
||||||
//保存design
|
//保存design
|
||||||
Long designId = saveOne(designDTO,collectionId,userInfo.getId());
|
Long designId = saveOne(designDTO, collectionId, userInfo.getId());
|
||||||
//计算library
|
//计算library
|
||||||
calculateLibraryAndSysFile(designDTO,elementVO,userInfo);
|
calculateLibraryAndSysFile(designDTO, elementVO, userInfo);
|
||||||
//组装design入参
|
//组装design入参
|
||||||
DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(),
|
DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(),
|
||||||
designDTO.getSingleOverall(),designDTO.getSwitchCategory(),elementVO);
|
designDTO.getSingleOverall(), designDTO.getSwitchCategory(), elementVO);
|
||||||
//缓存保存的文件 方便后面处理进度问题
|
//缓存保存的文件 方便后面处理进度问题
|
||||||
setDesignProcess(userInfo.getId(),pythonObjects);
|
setDesignProcess(userInfo.getId(), pythonObjects);
|
||||||
// pythonObjects增加image_id关联
|
// pythonObjects增加image_id关联
|
||||||
relationImageId(pythonObjects);
|
relationImageId(pythonObjects);
|
||||||
//design
|
//design
|
||||||
JSONObject responseJSONObject = pythonService.designNew(pythonObjects);
|
JSONObject responseJSONObject = pythonService.designNew(pythonObjects);
|
||||||
//生成library
|
//生成library
|
||||||
generateLibrary(elementVO,designDTO.getTimeZone());
|
generateLibrary(elementVO, designDTO.getTimeZone());
|
||||||
//处理关联关系,修复element覆盖得情况
|
//处理关联关系,修复element覆盖得情况
|
||||||
List<CollectionElement> reLationelements =collectionElementService.getByOnlyCollectionId(collectionId);
|
List<CollectionElement> reLationelements = collectionElementService.getByOnlyCollectionId(collectionId);
|
||||||
List<Long> reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
List<Long> reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||||
handleCollectionElementRelation(collectionId,(null == collectionIdParam) ? false :true,reLationelementIds);
|
handleCollectionElementRelation(collectionId, (null == collectionIdParam) ? false : true, reLationelementIds);
|
||||||
//保存python返回信息
|
//保存python返回信息
|
||||||
return savePythonDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone(),responseJSONObject);
|
return savePythonDesignItemAndDetail(pythonObjects, designId, collectionId, userInfo, designDTO.getTimeZone(), responseJSONObject);
|
||||||
//保存designItem 和detail
|
//保存designItem 和detail
|
||||||
// return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone());
|
// return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void relationImageId(DesignPythonObjects pythonObjects) {
|
private void relationImageId(DesignPythonObjects pythonObjects) {
|
||||||
if(Objects.isNull(pythonObjects)) {
|
if (Objects.isNull(pythonObjects)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pythonObjects.getObjects().forEach(
|
pythonObjects.getObjects().forEach(
|
||||||
@@ -260,21 +315,21 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
if (StringUtils.isEmpty(path)) {
|
if (StringUtils.isEmpty(path)) {
|
||||||
String bodyPath = item.getBody_path();
|
String bodyPath = item.getBody_path();
|
||||||
Long imageId = pythonTAllInfoService.getImageIdByPath(bodyPath);
|
Long imageId = pythonTAllInfoService.getImageIdByPath(bodyPath);
|
||||||
item.setImageId(imageId);
|
item.setImage_id(imageId);
|
||||||
}else {
|
} else {
|
||||||
Long imageId = pythonTAllInfoService.getImageIdByPath(path);
|
Long imageId = pythonTAllInfoService.getImageIdByPath(path);
|
||||||
item.setImageId(imageId);
|
item.setImage_id(imageId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleCollectionElementRelation(Long collectionId ,Boolean isEdit,List<Long> elementIds ){
|
private void handleCollectionElementRelation(Long collectionId, Boolean isEdit, List<Long> elementIds) {
|
||||||
if (CollectionUtils.isEmpty(elementIds) || collectionId == null){
|
if (CollectionUtils.isEmpty(elementIds) || collectionId == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(isEdit){
|
if (isEdit) {
|
||||||
//删除
|
//删除
|
||||||
tCollectionElementRelationService.deleteByCollectionId(collectionId);
|
tCollectionElementRelationService.deleteByCollectionId(collectionId);
|
||||||
}
|
}
|
||||||
@@ -287,31 +342,33 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
.build()
|
.build()
|
||||||
).collect(Collectors.toList()));
|
).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
private void generateLibrary(ValidateElementVO elementVO,String timeZone){
|
|
||||||
|
private void generateLibrary(ValidateElementVO elementVO, String timeZone) {
|
||||||
List<CollectionElement> elements = Lists.newArrayList();
|
List<CollectionElement> elements = Lists.newArrayList();
|
||||||
if(!CollectionUtils.isEmpty(elementVO.getMoodBoardElements())){
|
if (!CollectionUtils.isEmpty(elementVO.getMoodBoardElements())) {
|
||||||
elements.addAll(elementVO.getMoodBoardElements());
|
elements.addAll(elementVO.getMoodBoardElements());
|
||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(elementVO.getPrintBoardElements())){
|
if (!CollectionUtils.isEmpty(elementVO.getPrintBoardElements())) {
|
||||||
elements.addAll(elementVO.getPrintBoardElements());
|
elements.addAll(elementVO.getPrintBoardElements());
|
||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(elementVO.getSketchBoardElements())){
|
if (!CollectionUtils.isEmpty(elementVO.getSketchBoardElements())) {
|
||||||
elements.addAll(elementVO.getSketchBoardElements());
|
elements.addAll(elementVO.getSketchBoardElements());
|
||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())){
|
if (!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())) {
|
||||||
elements.addAll(elementVO.getMarketingSketchElements());
|
elements.addAll(elementVO.getMarketingSketchElements());
|
||||||
}
|
}
|
||||||
collectionElementService.saveLibraryByCollectionElement(elements,timeZone);
|
collectionElementService.saveLibraryByCollectionElement(elements, timeZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal countDesignProcess(){
|
public BigDecimal countDesignProcess() {
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
List<String> saveNames = LocalCacheUtils.getDesignProcessCache(userInfo.getId());
|
List<String> saveNames = LocalCacheUtils.getDesignProcessCache(userInfo.getId());
|
||||||
if (CollectionUtils.isEmpty(saveNames)){
|
if (CollectionUtils.isEmpty(saveNames)) {
|
||||||
return BigDecimal.ZERO;
|
return BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
int totalProcess =0;
|
int totalProcess = 0;
|
||||||
log.info("design 统计进度###totalProcess1{}",totalProcess);
|
log.info("design 统计进度###totalProcess1{}", totalProcess);
|
||||||
//转成本地文件先
|
//转成本地文件先
|
||||||
for (String saveName : saveNames) {
|
for (String saveName : saveNames) {
|
||||||
String localFileUrl = saveName;
|
String localFileUrl = saveName;
|
||||||
@@ -319,32 +376,34 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
if (!StringUtils.isEmpty(linuxDomain)) {
|
if (!StringUtils.isEmpty(linuxDomain)) {
|
||||||
//linux 系统
|
//linux 系统
|
||||||
String oldPath = fileProperties.getSys().getPath();
|
String oldPath = fileProperties.getSys().getPath();
|
||||||
localFileUrl = saveName.replace(linuxDomain,oldPath);
|
localFileUrl = saveName.replace(linuxDomain, oldPath);
|
||||||
}
|
}
|
||||||
File file = new File(localFileUrl);
|
File file = new File(localFileUrl);
|
||||||
if(file.exists()){
|
if (file.exists()) {
|
||||||
totalProcess++;
|
totalProcess++;
|
||||||
log.info("design 统计进度++###totalProcess+++{}",totalProcess);
|
log.info("design 统计进度++###totalProcess+++{}", totalProcess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.info("design 统计进度###totalProcess2{}",totalProcess);
|
log.info("design 统计进度###totalProcess2{}", totalProcess);
|
||||||
BigDecimal result = BigDecimal.valueOf(totalProcess).divide(BigDecimal.valueOf(8)).setScale(3,BigDecimal.ROUND_HALF_UP);
|
BigDecimal result = BigDecimal.valueOf(totalProcess).divide(BigDecimal.valueOf(8)).setScale(3, BigDecimal.ROUND_HALF_UP);
|
||||||
if (result.compareTo(BigDecimal.ONE) == 0){
|
if (result.compareTo(BigDecimal.ONE) == 0) {
|
||||||
LocalCacheUtils.delDesignProcessCache(userInfo.getId());
|
LocalCacheUtils.delDesignProcessCache(userInfo.getId());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDesignProcess(Long userId,DesignPythonObjects pythonObjects){
|
private void setDesignProcess(Long userId, DesignPythonObjects pythonObjects) {
|
||||||
List<String> saveNames = pythonObjects.getObjects().stream().map(object ->{
|
List<String> saveNames = pythonObjects.getObjects().stream().map(object -> {
|
||||||
return object.getBasic().getSave_name();}).collect(Collectors.toList());
|
return object.getBasic().getSave_name();
|
||||||
LocalCacheUtils.setDesignProcessCache(userId,saveNames);
|
}).collect(Collectors.toList());
|
||||||
|
LocalCacheUtils.setDesignProcessCache(userId, saveNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MinioUtil minIoUtil;
|
private MinioUtil minIoUtil;
|
||||||
|
|
||||||
private DesignCollectionVO savePythonDesignItemAndDetail(DesignPythonObjects pythonObjects
|
private DesignCollectionVO savePythonDesignItemAndDetail(DesignPythonObjects pythonObjects
|
||||||
,Long designId,Long collectionId,AuthPrincipalVo userInfo,String timeZone, JSONObject responseJSONObject){
|
, Long designId, Long collectionId, AuthPrincipalVo userInfo, String timeZone, JSONObject responseJSONObject) {
|
||||||
DesignCollectionVO response = new DesignCollectionVO();
|
DesignCollectionVO response = new DesignCollectionVO();
|
||||||
response.setDesignId(designId);
|
response.setDesignId(designId);
|
||||||
response.setCollectionId(collectionId);
|
response.setCollectionId(collectionId);
|
||||||
@@ -363,7 +422,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
designItem.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
designItem.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
//生成的八张图片
|
//生成的八张图片
|
||||||
designItem.setDesignUrl(item.getBasic().getSave_name());
|
designItem.setDesignUrl(item.getBasic().getSave_name());
|
||||||
designItem.setHasLike((byte)0);
|
designItem.setHasLike((byte) 0);
|
||||||
//生成designItem
|
//生成designItem
|
||||||
Long designItemId = designItemService.saveOne(designItem);
|
Long designItemId = designItemService.saveOne(designItem);
|
||||||
// python design返回入库及封装
|
// python design返回入库及封装
|
||||||
@@ -391,7 +450,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
for (int i2 = 0; i2 < position.size(); i2++) {
|
for (int i2 = 0; i2 < position.size(); i2++) {
|
||||||
if (i2 != position.size() - 1) {
|
if (i2 != position.size() - 1) {
|
||||||
builder.append(position.getInteger(i2)).append(",");
|
builder.append(position.getInteger(i2)).append(",");
|
||||||
}else {
|
} else {
|
||||||
builder.append(position.getInteger(i2));
|
builder.append(position.getInteger(i2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -403,7 +462,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
for (int i2 = 0; i2 < imageSize.size(); i2++) {
|
for (int i2 = 0; i2 < imageSize.size(); i2++) {
|
||||||
if (i2 != imageSize.size() - 1) {
|
if (i2 != imageSize.size() - 1) {
|
||||||
builder.append(imageSize.getInteger(i2)).append(",");
|
builder.append(imageSize.getInteger(i2)).append(",");
|
||||||
}else {
|
} else {
|
||||||
builder.append(imageSize.getInteger(i2));
|
builder.append(imageSize.getInteger(i2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -420,29 +479,33 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
designCollectionItemVO.setDesignItemId(designItemId);
|
designCollectionItemVO.setDesignItemId(designItemId);
|
||||||
designCollectionItemVO.setDesignItemUrl(designItem.getDesignUrl());
|
designCollectionItemVO.setDesignItemUrl(designItem.getDesignUrl());
|
||||||
designCollectionItemVO.setDesignOutfitId(designPythonOutfit.getId());
|
designCollectionItemVO.setDesignOutfitId(designPythonOutfit.getId());
|
||||||
designCollectionItemVO.setDesignOutfitUrl(minIoUtil.getPresignedUrl(bucketName, designPythonOutfit.getDesignUrl(), 5));
|
String designUrl = designPythonOutfit.getDesignUrl();
|
||||||
|
if (!StringUtils.isEmpty(designUrl) && designUrl.contains("/")) {
|
||||||
|
int firstIndex = designUrl.indexOf("/");
|
||||||
|
designCollectionItemVO.setDesignOutfitUrl(minIoUtil.getPresignedUrl(designUrl.substring(0,firstIndex), designUrl.substring(firstIndex+1), 5));
|
||||||
|
}
|
||||||
//response
|
//response
|
||||||
designCollectionItems.add(designCollectionItemVO);
|
designCollectionItems.add(designCollectionItemVO);
|
||||||
|
|
||||||
List<DesignItemDetail> designItemDetails = Lists.newArrayList();
|
List<DesignItemDetail> designItemDetails = Lists.newArrayList();
|
||||||
item.getItems().forEach(detail ->{
|
item.getItems().forEach(detail -> {
|
||||||
if(null == detail){
|
if (null == detail) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DesignItemDetail designItemDetail = CopyUtil.copyObject(detail,DesignItemDetail.class);
|
DesignItemDetail designItemDetail = CopyUtil.copyObject(detail, DesignItemDetail.class);
|
||||||
designItemDetail.setAccountId(userInfo.getId());
|
designItemDetail.setAccountId(userInfo.getId());
|
||||||
designItemDetail.setDesignId(designId);
|
designItemDetail.setDesignId(designId);
|
||||||
designItemDetail.setDesignItemId(designItemId);
|
designItemDetail.setDesignItemId(designItemId);
|
||||||
designItemDetail.setCollectionElementId(detail.getElementId());
|
designItemDetail.setCollectionElementId(detail.getElementId());
|
||||||
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
if(SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())){
|
if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) {
|
||||||
designItemDetail.setPath(detail.getBody_path());
|
designItemDetail.setPath(detail.getBody_path());
|
||||||
//BODY不关联businessId
|
//BODY不关联businessId
|
||||||
designItemDetail.setBusinessId(0L);
|
designItemDetail.setBusinessId(0L);
|
||||||
}
|
}
|
||||||
designItemDetail.setIconPath(detail.getIcon());
|
designItemDetail.setIconPath(detail.getIcon());
|
||||||
DesignPythonItemPrint printObject = detail.getPrint();
|
DesignPythonItemPrint printObject = detail.getPrint();
|
||||||
designItemDetail.setPrintPath(Objects.isNull(printObject)? "" :printObject.getPath());
|
designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath());
|
||||||
designItemDetails.add(designItemDetail);
|
designItemDetails.add(designItemDetail);
|
||||||
});
|
});
|
||||||
designItemDetailService.saveBatch(designItemDetails);
|
designItemDetailService.saveBatch(designItemDetails);
|
||||||
@@ -452,14 +515,14 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
private DesignCollectionVO saveDesignItemAndDetail(DesignPythonObjects pythonObjects
|
private DesignCollectionVO saveDesignItemAndDetail(DesignPythonObjects pythonObjects
|
||||||
,Long designId,Long collectionId,AuthPrincipalVo userInfo,String timeZone){
|
, Long designId, Long collectionId, AuthPrincipalVo userInfo, String timeZone) {
|
||||||
DesignCollectionVO response = new DesignCollectionVO();
|
DesignCollectionVO response = new DesignCollectionVO();
|
||||||
response.setDesignId(designId);
|
response.setDesignId(designId);
|
||||||
response.setCollectionId(collectionId);
|
response.setCollectionId(collectionId);
|
||||||
List<DesignCollectionItemVO> designCollectionItems = Lists.newArrayList();
|
List<DesignCollectionItemVO> designCollectionItems = Lists.newArrayList();
|
||||||
response.setDesignCollectionItems(designCollectionItems);
|
response.setDesignCollectionItems(designCollectionItems);
|
||||||
|
|
||||||
pythonObjects.getObjects().forEach(item ->{
|
pythonObjects.getObjects().forEach(item -> {
|
||||||
DesignItem designItem = new DesignItem();
|
DesignItem designItem = new DesignItem();
|
||||||
designItem.setAccountId(userInfo.getId());
|
designItem.setAccountId(userInfo.getId());
|
||||||
designItem.setCollectionId(collectionId);
|
designItem.setCollectionId(collectionId);
|
||||||
@@ -467,47 +530,48 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
designItem.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
designItem.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
//生成的八张图片
|
//生成的八张图片
|
||||||
designItem.setDesignUrl(item.getBasic().getSave_name());
|
designItem.setDesignUrl(item.getBasic().getSave_name());
|
||||||
designItem.setHasLike((byte)0);
|
designItem.setHasLike((byte) 0);
|
||||||
//生成designItem
|
//生成designItem
|
||||||
Long designItemId = designItemService.saveOne(designItem);
|
Long designItemId = designItemService.saveOne(designItem);
|
||||||
//response
|
//response
|
||||||
designCollectionItems.add(new DesignCollectionItemVO(designItemId,designItem.getDesignUrl(), null, null));
|
designCollectionItems.add(new DesignCollectionItemVO(designItemId, designItem.getDesignUrl(), null, null));
|
||||||
|
|
||||||
List<DesignItemDetail> designItemDetails = Lists.newArrayList();
|
List<DesignItemDetail> designItemDetails = Lists.newArrayList();
|
||||||
item.getItems().forEach(detail ->{
|
item.getItems().forEach(detail -> {
|
||||||
if(null == detail){
|
if (null == detail) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DesignItemDetail designItemDetail = CopyUtil.copyObject(detail,DesignItemDetail.class);
|
DesignItemDetail designItemDetail = CopyUtil.copyObject(detail, DesignItemDetail.class);
|
||||||
designItemDetail.setAccountId(userInfo.getId());
|
designItemDetail.setAccountId(userInfo.getId());
|
||||||
designItemDetail.setDesignId(designId);
|
designItemDetail.setDesignId(designId);
|
||||||
designItemDetail.setDesignItemId(designItemId);
|
designItemDetail.setDesignItemId(designItemId);
|
||||||
designItemDetail.setCollectionElementId(detail.getElementId());
|
designItemDetail.setCollectionElementId(detail.getElementId());
|
||||||
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
if(SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())){
|
if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) {
|
||||||
designItemDetail.setPath(detail.getBody_path());
|
designItemDetail.setPath(detail.getBody_path());
|
||||||
//BODY不关联businessId
|
//BODY不关联businessId
|
||||||
designItemDetail.setBusinessId(0L);
|
designItemDetail.setBusinessId(0L);
|
||||||
}
|
}
|
||||||
designItemDetail.setIconPath(detail.getIcon());
|
designItemDetail.setIconPath(detail.getIcon());
|
||||||
DesignPythonItemPrint printObject = detail.getPrint();
|
DesignPythonItemPrint printObject = detail.getPrint();
|
||||||
designItemDetail.setPrintPath(Objects.isNull(printObject)? "" :printObject.getPath());
|
designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath());
|
||||||
designItemDetails.add(designItemDetail);
|
designItemDetails.add(designItemDetail);
|
||||||
});
|
});
|
||||||
designItemDetailService.saveBatch(designItemDetails);
|
designItemDetailService.saveBatch(designItemDetails);
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
private List<Long> getElementId(ValidateElementVO elementVO){
|
|
||||||
|
private List<Long> getElementId(ValidateElementVO elementVO) {
|
||||||
List<Long> elementIds = Lists.newArrayList();
|
List<Long> elementIds = Lists.newArrayList();
|
||||||
// collection type
|
// collection type
|
||||||
if(CollectionUtil.isNotEmpty(elementVO.getSketchBoardElements())){
|
if (CollectionUtil.isNotEmpty(elementVO.getSketchBoardElements())) {
|
||||||
elementIds.addAll(elementVO.getSketchBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
elementIds.addAll(elementVO.getSketchBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
if(CollectionUtil.isNotEmpty(elementVO.getMoodBoardElements())){
|
if (CollectionUtil.isNotEmpty(elementVO.getMoodBoardElements())) {
|
||||||
elementIds.addAll(elementVO.getMoodBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
elementIds.addAll(elementVO.getMoodBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
if(CollectionUtil.isNotEmpty(elementVO.getPrintBoardElements())){
|
if (CollectionUtil.isNotEmpty(elementVO.getPrintBoardElements())) {
|
||||||
elementIds.addAll(elementVO.getPrintBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
elementIds.addAll(elementVO.getPrintBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
// if(CollectionUtil.isNotEmpty(elementVO.getMarketingSketchElements())){
|
// if(CollectionUtil.isNotEmpty(elementVO.getMarketingSketchElements())){
|
||||||
@@ -520,18 +584,18 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
public DesignCollectionVO reDesignCollection(ReDesignCollectionDTO reDesignDTO) {
|
public DesignCollectionVO reDesignCollection(ReDesignCollectionDTO reDesignDTO) {
|
||||||
//校验collection
|
//校验collection
|
||||||
Collection collection = collectionService.findById(reDesignDTO.getCollectionId());
|
Collection collection = collectionService.findById(reDesignDTO.getCollectionId());
|
||||||
Assert.notNull(collection,"Collection does not exist!");
|
Assert.notNull(collection, "Collection does not exist!");
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
//查询用户 sketch library
|
//查询用户 sketch library
|
||||||
List<LibraryVo> libraryVos =libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(),
|
List<LibraryVo> libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(),
|
||||||
Arrays.asList(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(),
|
Arrays.asList(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(),
|
||||||
CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()));
|
CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName()));
|
||||||
//校验collection element
|
//校验collection element
|
||||||
ValidateElementVO elementVO =collectionElementService.validateElement(
|
ValidateElementVO elementVO = collectionElementService.validateElement(
|
||||||
CopyUtil.copyObject(reDesignDTO,DesignCollectionDTO.class));
|
CopyUtil.copyObject(reDesignDTO, DesignCollectionDTO.class));
|
||||||
//计算并删除对应的未关联的element
|
//计算并删除对应的未关联的element
|
||||||
collectionElementService.batchDelete(
|
collectionElementService.batchDelete(
|
||||||
calculateNoRelationElement(reDesignDTO.getCollectionId(),elementVO.getUsedElementIds()));
|
calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds()));
|
||||||
Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId());
|
Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId());
|
||||||
//删除老的关联的design
|
//删除老的关联的design
|
||||||
deleteByCollectionId(reDesignDTO.getCollectionId());
|
deleteByCollectionId(reDesignDTO.getCollectionId());
|
||||||
@@ -539,18 +603,19 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
designItemDetailService.deleteByDesignId(oldDesign.getId());
|
designItemDetailService.deleteByDesignId(oldDesign.getId());
|
||||||
//redesign
|
//redesign
|
||||||
return designOrRedesignOperate(CopyUtil.copyObject(
|
return designOrRedesignOperate(CopyUtil.copyObject(
|
||||||
reDesignDTO,DesignCollectionDTO.class),userInfo,reDesignDTO.getCollectionId(),elementVO);
|
reDesignDTO, DesignCollectionDTO.class), userInfo, reDesignDTO.getCollectionId(), elementVO);
|
||||||
}
|
}
|
||||||
private List<Long> calculateNoRelationElement(Long collectionId ,List<Long> usedElementIds){
|
|
||||||
|
private List<Long> calculateNoRelationElement(Long collectionId, List<Long> usedElementIds) {
|
||||||
List<CollectionElement> collectionElements = collectionElementService.getByCollectionId(collectionId);
|
List<CollectionElement> collectionElements = collectionElementService.getByCollectionId(collectionId);
|
||||||
if(CollectionUtils.isEmpty(collectionElements)){
|
if (CollectionUtils.isEmpty(collectionElements)) {
|
||||||
throw new BusinessException("get collection elements cannot be empty");
|
throw new BusinessException("get collection elements cannot be empty");
|
||||||
}
|
}
|
||||||
if(CollectionUtils.isEmpty(usedElementIds)){
|
if (CollectionUtils.isEmpty(usedElementIds)) {
|
||||||
return collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
return collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
return collectionElements.stream()
|
return collectionElements.stream()
|
||||||
.filter(filter ->!usedElementIds.contains(filter.getId()))
|
.filter(filter -> !usedElementIds.contains(filter.getId()))
|
||||||
.map(CollectionElement::getId)
|
.map(CollectionElement::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@@ -558,17 +623,18 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
@Override
|
@Override
|
||||||
public DesignCollectionVO designItemList(Long designId) {
|
public DesignCollectionVO designItemList(Long designId) {
|
||||||
Design design = getById(designId);
|
Design design = getById(designId);
|
||||||
Assert.notNull(design,"design does not exist!");
|
Assert.notNull(design, "design does not exist!");
|
||||||
List<DesignItem> designItems = designItemService.getByDesignId(designId);
|
List<DesignItem> designItems = designItemService.getByDesignId(designId);
|
||||||
if(CollectionUtils.isEmpty(designItems)){
|
if (CollectionUtils.isEmpty(designItems)) {
|
||||||
return new DesignCollectionVO(designId,design.getCollectionId(),null);
|
return new DesignCollectionVO(designId, design.getCollectionId(), null);
|
||||||
}
|
}
|
||||||
return new DesignCollectionVO(designId,design.getCollectionId(),coverDesignItemToVO(designItems));
|
return new DesignCollectionVO(designId, design.getCollectionId(), coverDesignItemToVO(designItems));
|
||||||
}
|
}
|
||||||
private List<DesignCollectionItemVO> coverDesignItemToVO( List<DesignItem> designItems){
|
|
||||||
|
private List<DesignCollectionItemVO> coverDesignItemToVO(List<DesignItem> designItems) {
|
||||||
List<DesignCollectionItemVO> response = Lists.newArrayList();
|
List<DesignCollectionItemVO> response = Lists.newArrayList();
|
||||||
designItems.forEach(designItem -> {
|
designItems.forEach(designItem -> {
|
||||||
response.add(new DesignCollectionItemVO(designItem.getId(),designItem.getDesignUrl(), null, null));
|
response.add(new DesignCollectionItemVO(designItem.getId(), designItem.getDesignUrl(), null, null));
|
||||||
});
|
});
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -579,81 +645,83 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
Long groupDetailId = null;
|
Long groupDetailId = null;
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
DesignItem designItem = designItemService.getById(designLikeDTO.getDesignItemId());
|
DesignItem designItem = designItemService.getById(designLikeDTO.getDesignItemId());
|
||||||
Assert.notNull(designItem,"designItem does not exist!");
|
Assert.notNull(designItem, "designItem does not exist!");
|
||||||
if(Objects.nonNull(designLikeDTO.getUserGroupId())){
|
if (Objects.nonNull(designLikeDTO.getUserGroupId())) {
|
||||||
userGroupId = designLikeDTO.getUserGroupId();
|
userGroupId = designLikeDTO.getUserGroupId();
|
||||||
|
|
||||||
UserLikeGroup userLikeGroup = userLikeGroupService.getById(designLikeDTO.getUserGroupId());
|
UserLikeGroup userLikeGroup = userLikeGroupService.getById(designLikeDTO.getUserGroupId());
|
||||||
Assert.notNull(userLikeGroup,"History does not exist!");
|
Assert.notNull(userLikeGroup, "History does not exist!");
|
||||||
// if(designItem.getCollectionId().equals(userLikeGroup.getCollectionId())){
|
// if(designItem.getCollectionId().equals(userLikeGroup.getCollectionId())){
|
||||||
// //相同collection直接跳过 不需要往element加元素
|
// //相同collection直接跳过 不需要往element加元素
|
||||||
// return new DesignLikeVO();
|
// return new DesignLikeVO();
|
||||||
// }
|
// }
|
||||||
List<CollectionElement> oldElements = collectionElementService.getByCollectionId(userLikeGroup.getCollectionId());
|
List<CollectionElement> oldElements = collectionElementService.getByCollectionId(userLikeGroup.getCollectionId());
|
||||||
Assert.notEmpty(oldElements,"old elements does not exist!");
|
Assert.notEmpty(oldElements, "old elements does not exist!");
|
||||||
List<DesignItemDetail> designItemDetails = designItemDetailService.selectByDesignItemId(designLikeDTO.getDesignItemId());
|
List<DesignItemDetail> designItemDetails = designItemDetailService.selectByDesignItemId(designLikeDTO.getDesignItemId());
|
||||||
Assert.notEmpty(designItemDetails,"new designItemDetails does not exist!");
|
Assert.notEmpty(designItemDetails, "new designItemDetails does not exist!");
|
||||||
//判断老的element合并到新的是否满足 数量不超过15
|
//判断老的element合并到新的是否满足 数量不超过15
|
||||||
List<Long> newElementIds = validateMergeElement(oldElements,designItemDetails);
|
List<Long> newElementIds = validateMergeElement(oldElements, designItemDetails);
|
||||||
//合并,关联新的element到collection
|
//合并,关联新的element到collection
|
||||||
collectionElementService.relationCollection(newElementIds,userLikeGroup.getCollectionId());
|
collectionElementService.relationCollection(newElementIds, userLikeGroup.getCollectionId());
|
||||||
//处理关联关系,修复element覆盖得情况
|
//处理关联关系,修复element覆盖得情况
|
||||||
handleCollectionElementRelation(userLikeGroup.getCollectionId(),false,newElementIds);
|
handleCollectionElementRelation(userLikeGroup.getCollectionId(), false, newElementIds);
|
||||||
UserLike userLike = resolveUserLike(designLikeDTO.getUserGroupId(), designItem.getDesignId(),
|
UserLike userLike = resolveUserLike(designLikeDTO.getUserGroupId(), designItem.getDesignId(),
|
||||||
designLikeDTO.getDesignItemId(),designItem.getDesignUrl(),designLikeDTO.getTimeZone());
|
designLikeDTO.getDesignItemId(), designItem.getDesignUrl(), designLikeDTO.getTimeZone());
|
||||||
userLikeService.save(userLike);
|
userLikeService.save(userLike);
|
||||||
groupDetailId = userLike.getId();
|
groupDetailId = userLike.getId();
|
||||||
}else{
|
} else {
|
||||||
//第一次like
|
//第一次like
|
||||||
userGroupId = userLikeGroupService.insertUserGroup(userInfo.getId(),designItem.getCollectionId(),designLikeDTO.getTimeZone());
|
userGroupId = userLikeGroupService.insertUserGroup(userInfo.getId(), designItem.getCollectionId(), designLikeDTO.getTimeZone());
|
||||||
UserLike userLike =resolveUserLike(userGroupId,
|
UserLike userLike = resolveUserLike(userGroupId,
|
||||||
designItem.getDesignId(),designLikeDTO.getDesignItemId(),designItem.getDesignUrl(),designLikeDTO.getTimeZone());
|
designItem.getDesignId(), designLikeDTO.getDesignItemId(), designItem.getDesignUrl(), designLikeDTO.getTimeZone());
|
||||||
userLikeService.save(userLike);
|
userLikeService.save(userLike);
|
||||||
groupDetailId = userLike.getId();
|
groupDetailId = userLike.getId();
|
||||||
}
|
}
|
||||||
//修改designItem为like状态
|
//修改designItem为like状态
|
||||||
designItemService.updateLikeStatus(designLikeDTO.getDesignItemId(),(byte)1);
|
designItemService.updateLikeStatus(designLikeDTO.getDesignItemId(), (byte) 1);
|
||||||
return new DesignLikeVO(userGroupId,groupDetailId);
|
return new DesignLikeVO(userGroupId, groupDetailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Long> validateMergeElement(List<CollectionElement> oldElements,List<DesignItemDetail> designItemDetails){
|
private List<Long> validateMergeElement(List<CollectionElement> oldElements, List<DesignItemDetail> designItemDetails) {
|
||||||
List<DesignItemDetail> hasCollections = designItemDetails.stream()
|
List<DesignItemDetail> hasCollections = designItemDetails.stream()
|
||||||
.filter(f->Objects.nonNull(f.getCollectionElementId()))
|
.filter(f -> Objects.nonNull(f.getCollectionElementId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(hasCollections)){
|
if (CollectionUtils.isEmpty(hasCollections)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<Long> oldIds = oldElements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
List<Long> oldIds = oldElements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||||
List<Long> elementIds = hasCollections.stream().map(DesignItemDetail::getCollectionElementId).collect(Collectors.toList());
|
List<Long> elementIds = hasCollections.stream().map(DesignItemDetail::getCollectionElementId).collect(Collectors.toList());
|
||||||
//本次新增collection个数
|
//本次新增collection个数
|
||||||
List<Long> adds = elementIds.stream().filter(id ->!oldIds.contains(id)).collect(Collectors.toList());
|
List<Long> adds = elementIds.stream().filter(id -> !oldIds.contains(id)).collect(Collectors.toList());
|
||||||
if(CollectionUtils.isEmpty(adds)){
|
if (CollectionUtils.isEmpty(adds)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
//校验15次
|
//校验15次
|
||||||
Map<String,List<CollectionElement>> group = oldElements.stream()
|
Map<String, List<CollectionElement>> group = oldElements.stream()
|
||||||
.collect(Collectors.groupingBy(CollectionElement::getLevel1Type));
|
.collect(Collectors.groupingBy(CollectionElement::getLevel1Type));
|
||||||
|
|
||||||
group.forEach((k,v) ->{
|
group.forEach((k, v) -> {
|
||||||
List<CollectionElement> thisElement = group.get(k);
|
List<CollectionElement> thisElement = group.get(k);
|
||||||
int groupNum = calculateGroupNum(thisElement,adds);
|
int groupNum = calculateGroupNum(thisElement, adds);
|
||||||
if(groupNum >15){
|
if (groupNum > 15) {
|
||||||
throw new BusinessException("The size of element type" +k+ "exceeds 15");
|
throw new BusinessException("The size of element type" + k + "exceeds 15");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return adds;
|
return adds;
|
||||||
}
|
}
|
||||||
private int calculateGroupNum(List<CollectionElement> thisElement,List<Long> adds){
|
|
||||||
|
private int calculateGroupNum(List<CollectionElement> thisElement, List<Long> adds) {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
List<Long> groupOldIds = thisElement.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
List<Long> groupOldIds = thisElement.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||||
for (Long add : adds) {
|
for (Long add : adds) {
|
||||||
if(groupOldIds.contains(add)){
|
if (groupOldIds.contains(add)) {
|
||||||
num ++ ;
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num +thisElement.size();
|
return num + thisElement.size();
|
||||||
}
|
}
|
||||||
private UserLike resolveUserLike(Long userGroupId,Long designId,Long designItemId, String designUrl,String timeZone){
|
|
||||||
|
private UserLike resolveUserLike(Long userGroupId, Long designId, Long designItemId, String designUrl, String timeZone) {
|
||||||
UserLike userLike = new UserLike();
|
UserLike userLike = new UserLike();
|
||||||
userLike.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
userLike.setCreateDate(DateUtil.getByTimeZone(timeZone));
|
||||||
userLike.setDesignId(designId);
|
userLike.setDesignId(designId);
|
||||||
@@ -667,21 +735,21 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
public Boolean dislike(DisDesignLikeDTO disDesignLikeDTO) {
|
public Boolean dislike(DisDesignLikeDTO disDesignLikeDTO) {
|
||||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
UserLike userLike = userLikeService.getById(disDesignLikeDTO.getGroupDetailId());
|
UserLike userLike = userLikeService.getById(disDesignLikeDTO.getGroupDetailId());
|
||||||
Assert.notNull(userLike,"History detail does not exist!");
|
Assert.notNull(userLike, "History detail does not exist!");
|
||||||
Design design = getById(disDesignLikeDTO.getDesignId());
|
Design design = getById(disDesignLikeDTO.getDesignId());
|
||||||
Assert.notNull(design,"design does not exist!");
|
Assert.notNull(design, "design does not exist!");
|
||||||
if(!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())){
|
if (!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())) {
|
||||||
//不是相同的design不会合并
|
//不是相同的design不会合并
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
//修改designItem为dislike状态
|
//修改designItem为dislike状态
|
||||||
designItemService.updateLikeStatus(userLike.getDesignItemId(),(byte)0);
|
designItemService.updateLikeStatus(userLike.getDesignItemId(), (byte) 0);
|
||||||
//删除关联的collection,先不做
|
//删除关联的collection,先不做
|
||||||
|
|
||||||
//删除对应的history
|
//删除对应的history
|
||||||
userLikeService.removeById(disDesignLikeDTO.getGroupDetailId());
|
userLikeService.removeById(disDesignLikeDTO.getGroupDetailId());
|
||||||
List<UserLikeVO> userLikeVOS = userLikeService.getGroupDetail(userLike.getUserLikeGroupId());
|
List<UserLikeVO> userLikeVOS = userLikeService.getGroupDetail(userLike.getUserLikeGroupId());
|
||||||
if(CollectionUtils.isEmpty(userLikeVOS)){
|
if (CollectionUtils.isEmpty(userLikeVOS)) {
|
||||||
//group 下面没有元素时候 直接删除
|
//group 下面没有元素时候 直接删除
|
||||||
userLikeGroupService.removeById(userLike.getUserLikeGroupId());
|
userLikeGroupService.removeById(userLike.getUserLikeGroupId());
|
||||||
}
|
}
|
||||||
@@ -691,41 +759,41 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
@Override
|
@Override
|
||||||
public String generateHighDesign(GenerateHighDesignDTO generateHighDesignDTO) {
|
public String generateHighDesign(GenerateHighDesignDTO generateHighDesignDTO) {
|
||||||
DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId());
|
DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId());
|
||||||
Assert.notNull(designItem,"design item does not exist!");
|
Assert.notNull(designItem, "design item does not exist!");
|
||||||
String highUrl = pythonService.generateHighDesign(designItem.getDesignUrl());
|
String highUrl = pythonService.generateHighDesign(designItem.getDesignUrl());
|
||||||
//存储
|
//存储
|
||||||
designItemService.updateDesignHighUrl(designItem.getId(),highUrl,generateHighDesignDTO.getTimeZone());
|
designItemService.updateDesignHighUrl(designItem.getId(), highUrl, generateHighDesignDTO.getTimeZone());
|
||||||
return highUrl ;
|
return highUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteHighDesign(GenerateHighDesignDTO generateHighDesignDTO) {
|
public Boolean deleteHighDesign(GenerateHighDesignDTO generateHighDesignDTO) {
|
||||||
DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId());
|
DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId());
|
||||||
Assert.notNull(designItem,"design item does not exist!");
|
Assert.notNull(designItem, "design item does not exist!");
|
||||||
if(StringUtils.isEmpty(designItem.getHighDesignUrl())){
|
if (StringUtils.isEmpty(designItem.getHighDesignUrl())) {
|
||||||
//并发情况 ,不提示 直接返回
|
//并发情况 ,不提示 直接返回
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
//存储
|
//存储
|
||||||
designItemService.updateDesignHighUrl(designItem.getId(),"",generateHighDesignDTO.getTimeZone());
|
designItemService.updateDesignHighUrl(designItem.getId(), "", generateHighDesignDTO.getTimeZone());
|
||||||
FileUtil.delete(designItem.getHighDesignUrl());
|
FileUtil.delete(designItem.getHighDesignUrl());
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DesignItemDetailVO detail(Long designPythonOutfitId,Long designItemId) {
|
public DesignItemDetailVO detail(Long designPythonOutfitId, Long designItemId) {
|
||||||
DesignItem designItem = designItemService.getById(designItemId);
|
DesignItem designItem = designItemService.getById(designItemId);
|
||||||
Assert.notNull(designItem,"design item does not exist!");
|
Assert.notNull(designItem, "design item does not exist!");
|
||||||
Design design = getById(designItem.getDesignId());
|
Design design = getById(designItem.getDesignId());
|
||||||
Assert.notNull(design,"design does not exist!");
|
Assert.notNull(design, "design does not exist!");
|
||||||
List<DesignItemDetail> designItemDetails = designItemDetailService.selectByDesignItemId(designItemId);
|
List<DesignItemDetail> designItemDetails = designItemDetailService.selectByDesignItemId(designItemId);
|
||||||
Assert.notEmpty(designItemDetails,"designItemDetails does not exist!");
|
Assert.notEmpty(designItemDetails, "designItemDetails does not exist!");
|
||||||
// 添加判断designPythonOutfitId是否存在
|
// 添加判断designPythonOutfitId是否存在
|
||||||
TDesignPythonOutfit designPythonOutfit = new TDesignPythonOutfit();
|
TDesignPythonOutfit designPythonOutfit = new TDesignPythonOutfit();
|
||||||
Boolean flag = Boolean.FALSE;
|
Boolean flag = Boolean.FALSE;
|
||||||
if (Objects.nonNull(designPythonOutfitId)){
|
if (Objects.nonNull(designPythonOutfitId)) {
|
||||||
designPythonOutfit = designPythonOutfitService.getById(designPythonOutfitId);
|
designPythonOutfit = designPythonOutfitService.getById(designPythonOutfitId);
|
||||||
Assert.notNull(designPythonOutfit,"designPythonOutfit does not exist!");
|
Assert.notNull(designPythonOutfit, "designPythonOutfit does not exist!");
|
||||||
flag = Boolean.TRUE;
|
flag = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,23 +806,23 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
List<DesignItemDetail> filterDetail = designItemDetails.stream()
|
||||||
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType()))
|
.filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
response.setClothes(CopyUtil.copyList(filterDetail,DesignItemClothesDetailVO.class,(o,d)->{
|
response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> {
|
||||||
d.setId(o.getBusinessId());
|
d.setId(o.getBusinessId());
|
||||||
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
d.setLevel1Type(converTypeToLevel1(o.getType()));
|
||||||
String printJson = o.getPrintJson();
|
String printJson = o.getPrintJson();
|
||||||
if(StringUtils.isEmpty(printJson)){
|
if (StringUtils.isEmpty(printJson)) {
|
||||||
d.setPrintObject(new DesignPythonItemPrint(o.getPrintPath(),
|
d.setPrintObject(new DesignPythonItemPrint(o.getPrintPath(),
|
||||||
CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(),0.3f,Boolean.FALSE));
|
CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(), 0.3f, Boolean.FALSE));
|
||||||
}else{
|
} else {
|
||||||
d.setPrintObject(JSON.parseObject(printJson,DesignPythonItemPrint.class));
|
d.setPrintObject(JSON.parseObject(printJson, DesignPythonItemPrint.class));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
//single 和 Models(模特)时候 系统元素为空
|
//single 和 Models(模特)时候 系统元素为空
|
||||||
List<DesignItemDetail> filterDetail2 =designItemDetails.stream()
|
List<DesignItemDetail> filterDetail2 = designItemDetails.stream()
|
||||||
// .filter(f -> SYS_HAIRSTYLE_SHOES.contains(f.getType()) )
|
// .filter(f -> SYS_HAIRSTYLE_SHOES.contains(f.getType()) )
|
||||||
.filter(f -> SYS_HAIRSTYLE_SHOES_BODY.contains(f.getType()) )
|
.filter(f -> SYS_HAIRSTYLE_SHOES_BODY.contains(f.getType()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
response.setOthers(CopyUtil.copyList(filterDetail2,DesignItemOthersDetailVO.class,(o,d)->{
|
response.setOthers(CopyUtil.copyList(filterDetail2, DesignItemOthersDetailVO.class, (o, d) -> {
|
||||||
d.setId(o.getBusinessId());
|
d.setId(o.getBusinessId());
|
||||||
d.setPrintObject(new DesignPythonItemPrint());
|
d.setPrintObject(new DesignPythonItemPrint());
|
||||||
}));
|
}));
|
||||||
@@ -762,15 +830,16 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
minIoUtil.splitThenGetPreviewUrl(designItem.getDesignUrl(),480),
|
minIoUtil.splitThenGetPreviewUrl(designItem.getDesignUrl(),480),
|
||||||
editResponseColor(designItemDetails,response));
|
editResponseColor(designItemDetails,response));
|
||||||
}
|
}
|
||||||
private String converTypeToLevel1(String type){
|
|
||||||
if(StringUtils.isEmpty(type)){
|
private String converTypeToLevel1(String type) {
|
||||||
|
if (StringUtils.isEmpty(type)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SysFileLevel2TypeEnum sysFileLevel2TypeEnum = SysFileLevel2TypeEnum.realNameOf(type);
|
SysFileLevel2TypeEnum sysFileLevel2TypeEnum = SysFileLevel2TypeEnum.realNameOf(type);
|
||||||
if(Objects.isNull(sysFileLevel2TypeEnum)){
|
if (Objects.isNull(sysFileLevel2TypeEnum)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(OUTWEAR_DRESS_BLOUSE.contains(type) || SKIRT_TROUSERS.contains(type) ){
|
if (OUTWEAR_DRESS_BLOUSE.contains(type) || SKIRT_TROUSERS.contains(type)) {
|
||||||
return CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName();
|
return CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -781,16 +850,17 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
queryWrapper.eq("collection_id", collectionId);
|
queryWrapper.eq("collection_id", collectionId);
|
||||||
return designMapper.selectOne(queryWrapper);
|
return designMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteByCollectionId(Long collectionId) {
|
private int deleteByCollectionId(Long collectionId) {
|
||||||
QueryWrapper<Design> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Design> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("collection_id", collectionId);
|
queryWrapper.eq("collection_id", collectionId);
|
||||||
Design design = new Design();
|
Design design = new Design();
|
||||||
design.setCollectionId(0L);
|
design.setCollectionId(0L);
|
||||||
return designMapper.update(design,queryWrapper);
|
return designMapper.update(design, queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long saveOne(DesignCollectionDTO designDTO,Long collectionId,Long accountId) {
|
private Long saveOne(DesignCollectionDTO designDTO, Long collectionId, Long accountId) {
|
||||||
Design design = CopyUtil.copyObject(designDTO,Design.class);
|
Design design = CopyUtil.copyObject(designDTO, Design.class);
|
||||||
design.setCreateDate(DateUtil.getByTimeZone(designDTO.getTimeZone()));
|
design.setCreateDate(DateUtil.getByTimeZone(designDTO.getTimeZone()));
|
||||||
design.setCollectionId(collectionId);
|
design.setCollectionId(collectionId);
|
||||||
design.setAccountId(accountId);
|
design.setAccountId(accountId);
|
||||||
@@ -800,7 +870,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
return design.getId();
|
return design.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
private DesignItemDetailVO editResponseColor(List<DesignItemDetail> designItemDetails,DesignItemDetailVO designItemDetailVO){
|
private DesignItemDetailVO editResponseColor(List<DesignItemDetail> designItemDetails, DesignItemDetailVO designItemDetailVO) {
|
||||||
/*designItemDetails.forEach(d -> {
|
/*designItemDetails.forEach(d -> {
|
||||||
if (!StringUtil.isNullOrEmpty(d.getColor())){
|
if (!StringUtil.isNullOrEmpty(d.getColor())){
|
||||||
PantoneVO pantoneByRgb = panToneService.getPantoneByRgb(d.getColor());
|
PantoneVO pantoneByRgb = panToneService.getPantoneByRgb(d.getColor());
|
||||||
@@ -823,8 +893,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
|
|
||||||
HashMap<Long, String> businessIdColor = new HashMap<>();
|
HashMap<Long, String> businessIdColor = new HashMap<>();
|
||||||
designItemDetails.forEach(designItemDetail -> {
|
designItemDetails.forEach(designItemDetail -> {
|
||||||
if (!StringUtil.isNullOrEmpty(designItemDetail.getColor())){
|
if (!StringUtil.isNullOrEmpty(designItemDetail.getColor())) {
|
||||||
businessIdColor.put(designItemDetail.getBusinessId(),designItemDetail.getColor());
|
businessIdColor.put(designItemDetail.getBusinessId(), designItemDetail.getColor());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -844,13 +914,13 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private DesignItemDetailVO editDesignItemLayer(Boolean flag,TDesignPythonOutfit designPythonOutfit,String designItemUrl,DesignItemDetailVO designItemDetailVO){
|
private DesignItemDetailVO editDesignItemLayer(Boolean flag, TDesignPythonOutfit designPythonOutfit, String designItemUrl, DesignItemDetailVO designItemDetailVO) {
|
||||||
ArrayList<DesignPythonOutfitVO> detailsVO = new ArrayList<>();
|
ArrayList<DesignPythonOutfitVO> detailsVO = new ArrayList<>();
|
||||||
|
|
||||||
if (flag){
|
if (flag) {
|
||||||
// 1、判断designPythonOutfitId查出的图层信息是否为空(不允许为空,系统内部错误)
|
// 1、判断designPythonOutfitId查出的图层信息是否为空(不允许为空,系统内部错误)
|
||||||
List<TDesignPythonOutfitDetail> details = designPythonOutfitDetailService.getDetailByDesignPythonOutfitId(designPythonOutfit.getId());
|
List<TDesignPythonOutfitDetail> details = designPythonOutfitDetailService.getDetailByDesignPythonOutfitId(designPythonOutfit.getId());
|
||||||
Assert.notEmpty(details,"Some errors occurred, please restart the design");
|
Assert.notEmpty(details, "Some errors occurred, please restart the design");
|
||||||
details.forEach(detail -> {
|
details.forEach(detail -> {
|
||||||
detailsVO.add(designPythonOutfitDetailService.convertToDesignPythonOutfitVO(detail));
|
detailsVO.add(designPythonOutfitDetailService.convertToDesignPythonOutfitVO(detail));
|
||||||
});
|
});
|
||||||
@@ -875,9 +945,10 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
|||||||
detail.getImageCategory().equals(type)).collect(Collectors.toList());
|
detail.getImageCategory().equals(type)).collect(Collectors.toList());
|
||||||
o.setLayersObject(outfitVOS);
|
o.setLayersObject(outfitVOS);
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
designItemDetailVO.setDesignItemUrl(designItemUrl);
|
designItemDetailVO.setDesignItemUrl(designItemUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return designItemDetailVO;
|
return designItemDetailVO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -48,6 +49,10 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
private LibraryModelPointService libraryModelPointService;
|
private LibraryModelPointService libraryModelPointService;
|
||||||
@Resource
|
@Resource
|
||||||
private MinioUtil minioUtil;
|
private MinioUtil minioUtil;
|
||||||
|
@Value("minio.bucketName.mannequins")
|
||||||
|
private String mannequins;
|
||||||
|
@Value("minio.bucketName.users")
|
||||||
|
private String users;
|
||||||
|
|
||||||
private static List<String> top = Arrays.asList(CollectionLevel2TypeEnum.DRESS.getRealName(),
|
private static List<String> top = Arrays.asList(CollectionLevel2TypeEnum.DRESS.getRealName(),
|
||||||
CollectionLevel2TypeEnum.OUTWEAR.getRealName(),CollectionLevel2TypeEnum.BLOUSE.getRealName());
|
CollectionLevel2TypeEnum.OUTWEAR.getRealName(),CollectionLevel2TypeEnum.BLOUSE.getRealName());
|
||||||
@@ -144,39 +149,49 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
|||||||
Assert.isTrue(!( level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD)
|
Assert.isTrue(!( level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD)
|
||||||
&& StringUtils.isEmpty(libraryUploadDTO.getLevel2Type()) ),"level2Type cannot be empty!");
|
&& StringUtils.isEmpty(libraryUploadDTO.getLevel2Type()) ),"level2Type cannot be empty!");
|
||||||
String path = calculateFileUrl(level1TypeEnum, userInfo.getId());
|
String path = calculateFileUrl(level1TypeEnum, userInfo.getId());
|
||||||
File file = FileUtil.upload(libraryUploadDTO.getFile(), path);
|
String bucketName = null;
|
||||||
|
switch (level1TypeEnum) {
|
||||||
|
case MODELS:
|
||||||
|
bucketName = mannequins;
|
||||||
|
break;
|
||||||
|
case MOOD_BOARD:
|
||||||
|
case PRINT_BOARD:
|
||||||
|
case SKETCH_BOARD:
|
||||||
|
bucketName = users;
|
||||||
|
break;
|
||||||
|
case MARKETING_SKETCH:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new BusinessException("unknown level1_type");
|
||||||
|
}
|
||||||
|
String filePath = minioUtil.upload(bucketName, path, libraryUploadDTO.getFile());
|
||||||
//保存element元素
|
//保存element元素
|
||||||
Library library = resolveData(libraryUploadDTO, userInfo, file);
|
Library library = resolveData(libraryUploadDTO, userInfo, filePath, bucketName);
|
||||||
saveOne(library);
|
|
||||||
return CopyUtil.copyObject(library,LibraryUpdateVo.class);
|
return CopyUtil.copyObject(library,LibraryUpdateVo.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Library resolveData(LibraryUploadDTO uploadDTO, AuthPrincipalVo userInfo, File file) {
|
private Library resolveData(LibraryUploadDTO uploadDTO, AuthPrincipalVo userInfo, String filePath, String bucketName) {
|
||||||
Library library = CopyUtil.copyObject(uploadDTO, Library.class);
|
Library library = CopyUtil.copyObject(uploadDTO, Library.class);
|
||||||
library.setAccountId(userInfo.getId());
|
library.setAccountId(userInfo.getId());
|
||||||
String pictureName = file.getName();
|
|
||||||
//获取图片后缀
|
|
||||||
String suffix = pictureName.substring(pictureName.lastIndexOf("."));
|
|
||||||
//获取图片前缀
|
|
||||||
String prefix = pictureName.substring(0,pictureName.lastIndexOf("."));
|
|
||||||
library.setName(DateUtil.dateToStr(new Date(),DateUtil.YYYY_MM_DD));
|
library.setName(DateUtil.dateToStr(new Date(),DateUtil.YYYY_MM_DD));
|
||||||
library.setUrl(file.getAbsolutePath());
|
library.setUrl(bucketName + File.separator + filePath);
|
||||||
//按时区计算
|
//按时区计算
|
||||||
library.setCreateDate(DateUtil.getByTimeZone(uploadDTO.getTimeZone()));
|
library.setCreateDate(DateUtil.getByTimeZone(uploadDTO.getTimeZone()));
|
||||||
String linuxDomain = fileProperties.getLinuxDomain();
|
// String linuxDomain = fileProperties.getLinuxDomain();
|
||||||
if (!StringUtils.isEmpty(linuxDomain)) {
|
// if (!StringUtils.isEmpty(linuxDomain)) {
|
||||||
//linux 系统
|
// //linux 系统
|
||||||
String oldPath = fileProperties.getSys().getPath();
|
// String oldPath = fileProperties.getSys().getPath();
|
||||||
library.setUrl(file.getAbsolutePath().replace(oldPath, linuxDomain));
|
// library.setUrl(file.getAbsolutePath().replace(oldPath, linuxDomain));
|
||||||
}
|
// }
|
||||||
|
libraryMapper.insert(library);
|
||||||
return library;
|
return library;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String calculateFileUrl(LibraryLevel1TypeEnum level1TypeEnum, Long userId) {
|
private String calculateFileUrl(LibraryLevel1TypeEnum level1TypeEnum, Long userId) {
|
||||||
String rootPath = fileProperties.getSys().getPath();
|
// String rootPath = fileProperties.getSys().getPath();
|
||||||
String day = DateUtil.dateToStr(new Date(), DateUtil.YYYYMM);
|
String day = DateUtil.dateToStr(new Date(), DateUtil.YYYYMM);
|
||||||
return rootPath + day + File.separator + "userFile" + File.separator + "library"
|
return day + File.separator + "userFile" + File.separator + "library"
|
||||||
+ File.separator + level1TypeEnum.getRealName() + File.separator + userId + File.separator+UUID.randomUUID().toString();
|
+ File.separator + level1TypeEnum.getRealName() + File.separator + userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import java.util.Objects;
|
|||||||
@Service
|
@Service
|
||||||
public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl<TDesignPythonOutfitDetailMapper, TDesignPythonOutfitDetail> implements ITDesignPythonOutfitDetailService {
|
public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl<TDesignPythonOutfitDetailMapper, TDesignPythonOutfitDetail> implements ITDesignPythonOutfitDetailService {
|
||||||
|
|
||||||
@Value("${minio.bucketName2}")
|
@Value("${minio.bucketName.clothing}")
|
||||||
private String bucketName2;
|
private String bucketName2;
|
||||||
@Value("${minio.bucketName3}")
|
@Value("${minio.bucketName3}")
|
||||||
private String bucketName3;
|
private String bucketName3;
|
||||||
|
|||||||
@@ -2,9 +2,15 @@ package com.ai.da.service.impl;
|
|||||||
|
|
||||||
import com.ai.da.common.config.exception.BusinessException;
|
import com.ai.da.common.config.exception.BusinessException;
|
||||||
import com.ai.da.common.context.UserContext;
|
import com.ai.da.common.context.UserContext;
|
||||||
|
import com.ai.da.common.enums.LibraryLevel1TypeEnum;
|
||||||
|
import com.ai.da.common.enums.SysFileLevel1TypeEnum;
|
||||||
|
import com.ai.da.common.enums.SysFileLevel2TypeEnum;
|
||||||
import com.ai.da.common.response.PageBaseResponse;
|
import com.ai.da.common.response.PageBaseResponse;
|
||||||
|
import com.ai.da.mapper.LibraryMapper;
|
||||||
|
import com.ai.da.mapper.SysFileMapper;
|
||||||
import com.ai.da.mapper.WorkspaceMapper;
|
import com.ai.da.mapper.WorkspaceMapper;
|
||||||
import com.ai.da.mapper.entity.Account;
|
import com.ai.da.mapper.entity.Library;
|
||||||
|
import com.ai.da.mapper.entity.SysFile;
|
||||||
import com.ai.da.mapper.entity.Workspace;
|
import com.ai.da.mapper.entity.Workspace;
|
||||||
import com.ai.da.model.dto.WorkspaceDTO;
|
import com.ai.da.model.dto.WorkspaceDTO;
|
||||||
import com.ai.da.model.enums.BizJson;
|
import com.ai.da.model.enums.BizJson;
|
||||||
@@ -12,21 +18,20 @@ import com.ai.da.model.enums.IEnumDisplay;
|
|||||||
import com.ai.da.model.enums.Position;
|
import com.ai.da.model.enums.Position;
|
||||||
import com.ai.da.model.enums.Sex;
|
import com.ai.da.model.enums.Sex;
|
||||||
import com.ai.da.model.vo.AuthPrincipalVo;
|
import com.ai.da.model.vo.AuthPrincipalVo;
|
||||||
|
import com.ai.da.model.vo.ModelVO;
|
||||||
|
import com.ai.da.model.vo.ModelsVO;
|
||||||
import com.ai.da.model.vo.WorkspaceVO;
|
import com.ai.da.model.vo.WorkspaceVO;
|
||||||
|
import com.ai.da.service.LibraryService;
|
||||||
|
import com.ai.da.service.SysFileService;
|
||||||
import com.ai.da.service.WorkspaceService;
|
import com.ai.da.service.WorkspaceService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@@ -42,6 +47,12 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
@Resource
|
@Resource
|
||||||
private WorkspaceMapper workspaceMapper;
|
private WorkspaceMapper workspaceMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LibraryMapper libraryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysFileMapper sysFileMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<WorkspaceVO> selectWorkspacePage(IPage<WorkspaceVO> page, WorkspaceVO workspace) {
|
public IPage<WorkspaceVO> selectWorkspacePage(IPage<WorkspaceVO> page, WorkspaceVO workspace) {
|
||||||
return page.setRecords(baseMapper.selectWorkspacePage(page, workspace));
|
return page.setRecords(baseMapper.selectWorkspacePage(page, workspace));
|
||||||
@@ -58,7 +69,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
throw new BusinessException("insert workspace failed");
|
throw new BusinessException("insert workspace failed");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}else {
|
} else {
|
||||||
int update = workspaceMapper.updateById(workspace);
|
int update = workspaceMapper.updateById(workspace);
|
||||||
if (update <= 0) {
|
if (update <= 0) {
|
||||||
throw new BusinessException("update workspace failed");
|
throw new BusinessException("update workspace failed");
|
||||||
@@ -128,12 +139,51 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
|||||||
Workspace oldIsLastIndex = workspaceMapper.selectOne(qwOld);
|
Workspace oldIsLastIndex = workspaceMapper.selectOne(qwOld);
|
||||||
oldIsLastIndex.setIsLastIndex(0);
|
oldIsLastIndex.setIsLastIndex(0);
|
||||||
workspaceMapper.updateById(oldIsLastIndex);
|
workspaceMapper.updateById(oldIsLastIndex);
|
||||||
Workspace newIsLastIndex= workspaceMapper.selectById(id);
|
Workspace newIsLastIndex = workspaceMapper.selectById(id);
|
||||||
newIsLastIndex.setIsLastIndex(1);
|
newIsLastIndex.setIsLastIndex(1);
|
||||||
workspaceMapper.updateById(newIsLastIndex);
|
workspaceMapper.updateById(newIsLastIndex);
|
||||||
return newIsLastIndex;
|
return newIsLastIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelsVO> getMannequins() {
|
||||||
|
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||||
|
List<ModelsVO> result = new ArrayList<>();
|
||||||
|
QueryWrapper<Library> libraryQueryWrapper = new QueryWrapper<>();
|
||||||
|
libraryQueryWrapper.lambda().eq(Library::getAccountId, userInfo.getId());
|
||||||
|
libraryQueryWrapper.lambda().eq(Library::getLevel1Type, LibraryLevel1TypeEnum.MODELS.getRealName());
|
||||||
|
List<Library> libraries = libraryMapper.selectList(libraryQueryWrapper);
|
||||||
|
if (!CollectionUtils.isEmpty(libraries)) {
|
||||||
|
List<ModelVO> modelVOList = new ArrayList<>();
|
||||||
|
for (Library library : libraries) {
|
||||||
|
ModelVO modelVO = new ModelVO();
|
||||||
|
modelVO.setId(library.getId());
|
||||||
|
modelVO.setUrl(library.getUrl());
|
||||||
|
}
|
||||||
|
ModelsVO vo = new ModelsVO();
|
||||||
|
vo.setModelList(modelVOList);
|
||||||
|
vo.setType("Library");
|
||||||
|
result.add(vo);
|
||||||
|
}
|
||||||
|
QueryWrapper<SysFile> sysFileQueryWrapper = new QueryWrapper<>();
|
||||||
|
sysFileQueryWrapper.lambda().eq(SysFile::getLevel1Type, SysFileLevel1TypeEnum.ACCESSORIES.getRealName());
|
||||||
|
sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, SysFileLevel2TypeEnum.BODY.getRealName());
|
||||||
|
List<SysFile> sysFileList = sysFileMapper.selectList(sysFileQueryWrapper);
|
||||||
|
if (!CollectionUtils.isEmpty(sysFileList)) {
|
||||||
|
List<ModelVO> modelVOList = new ArrayList<>();
|
||||||
|
for (SysFile sysFile : sysFileList) {
|
||||||
|
ModelVO modelVO = new ModelVO();
|
||||||
|
modelVO.setId(sysFile.getId());
|
||||||
|
modelVO.setUrl(sysFile.getUrl());
|
||||||
|
}
|
||||||
|
ModelsVO vo = new ModelsVO();
|
||||||
|
vo.setModelList(modelVOList);
|
||||||
|
vo.setType("System");
|
||||||
|
result.add(vo);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private List<BizJson> getEnumValues(Class clazz) {
|
private List<BizJson> getEnumValues(Class clazz) {
|
||||||
List<BizJson> kvs = new ArrayList<BizJson>();
|
List<BizJson> kvs = new ArrayList<BizJson>();
|
||||||
IEnumDisplay[] items = (IEnumDisplay[]) clazz.getEnumConstants();
|
IEnumDisplay[] items = (IEnumDisplay[]) clazz.getEnumConstants();
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
server.port=5566
|
server.port=5567
|
||||||
|
|
||||||
#datasource
|
#datasource
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
spring.datasource.url=jdbc:mysql://18.167.251.121:33006/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=QWa998345
|
spring.datasource.password=root
|
||||||
|
#spring.datasource.password=QWa998345
|
||||||
|
|
||||||
#security
|
#security
|
||||||
spring.security.jwtSecret=JWTSECRET
|
spring.security.jwtSecret=JWTSECRET
|
||||||
@@ -14,7 +15,7 @@ spring.security.jwtTokenPrefix=Bearer-
|
|||||||
spring.security.jwtExpiration=8640000000
|
spring.security.jwtExpiration=8640000000
|
||||||
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
#spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource
|
||||||
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\
|
||||||
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**
|
/api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/workspace/**
|
||||||
spring.security.authApi=/auth/login
|
spring.security.authApi=/auth/login
|
||||||
|
|
||||||
|
|
||||||
@@ -24,6 +25,9 @@ rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8
|
|||||||
mybatis-plus.global-config.banner=false
|
mybatis-plus.global-config.banner=false
|
||||||
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml
|
||||||
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
#mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
|
mybatis-plus.global-config.db-config.logic-delete-field=isDeleted
|
||||||
|
mybatis-plus.global-config.db-config.logic-delete-value=1
|
||||||
|
mybatis-plus.global-config.db-config.logic-not-delete-value=0
|
||||||
|
|
||||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||||
|
|
||||||
@@ -36,3 +40,14 @@ spring.servlet.multipart.max-file-size = 5MB
|
|||||||
spring.servlet.multipart.max-request-size= 5MB
|
spring.servlet.multipart.max-request-size= 5MB
|
||||||
#访问python服务的ip(对应环境)
|
#访问python服务的ip(对应环境)
|
||||||
access.python.ip=http://43.198.80.117
|
access.python.ip=http://43.198.80.117
|
||||||
|
#access.python.ip=http://18.167.251.121
|
||||||
|
#access.python.ip=http://18.167.251.121:9991/
|
||||||
|
|
||||||
|
minio.endpoint=http://18.167.251.121:9000
|
||||||
|
minio.accessKey=minioadmin
|
||||||
|
minio.secretKey=minioadmin
|
||||||
|
minio.bucketName.clothing=aida-clothing
|
||||||
|
minio.bucketName.mannequins=aida-mannequins
|
||||||
|
minio.bucketName.results=aida-results
|
||||||
|
minio.bucketName.sysImage=aida-sys-image
|
||||||
|
minio.bucketName.users=aida-users
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#<23><><EFBFBD><EFBFBD>application-test<73>ļ<EFBFBD>(<28><><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>)
|
#<23><><EFBFBD><EFBFBD>application-test<73>ļ<EFBFBD>(<28><><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>)
|
||||||
spring.profiles.active=test
|
spring.profiles.active=prod
|
||||||
|
|
||||||
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
#<23><><EFBFBD><EFBFBD>application-prod<6F>ļ<EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
#spring.profiles.active=prod
|
#spring.profiles.active=prod
|
||||||
|
|||||||
Reference in New Issue
Block a user