Merge remote-tracking branch 'origin/dev_shb' into develop
This commit is contained in:
@@ -76,11 +76,11 @@ public class WorkspaceController {
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@DeleteMapping("/remove")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@ApiOperation(value = "删除", notes = "传入id")
|
||||
public Response remove(@ApiParam(value = "主键集合", required = true) @RequestParam Long id) {
|
||||
return Response.success(workspaceService.removeById(id));
|
||||
public Response remove(@Valid @RequestBody List<Workspace> workspaceList) {
|
||||
return Response.success(workspaceService.removeBatchByIds(workspaceList));
|
||||
}
|
||||
|
||||
@GetMapping("/enumValues")
|
||||
|
||||
@@ -109,6 +109,7 @@ public interface CollectionElementService extends IService<CollectionElement> {
|
||||
List<CollectionElement> getByOnlyCollectionId(Long collectionId);
|
||||
|
||||
DesignLibraryModelPointVO calculateTemplatePoint(LibraryModelPoint modelPoint, Integer high, Integer width, String templateUrl);
|
||||
DesignLibraryModelPointVO calculateTemplatePointTemplate(LibraryModelPoint modelPoint, Integer high, Integer width, String templateUrl);
|
||||
|
||||
/**
|
||||
* 刷新历史数据
|
||||
|
||||
@@ -415,13 +415,14 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
Assert.notNull(switchCategory, "unknown parameter switchCategory!");
|
||||
}
|
||||
//校验template
|
||||
if(Objects.nonNull(designDTO.getTemplateId())){
|
||||
LibraryModelPoint modelPoint = libraryModelPointService.getById(designDTO.getTemplateId());
|
||||
Assert.notNull(modelPoint, "template cannot by empty!");
|
||||
Library library = libraryService.getById(modelPoint.getLibraryId());
|
||||
Assert.notNull(library, "template library cannot by empty!");
|
||||
elementVO.setDesignLibraryModelPoint(calculateTemplatePoint(modelPoint,library.getHigh(),library.getWidth(),library.getUrl()));
|
||||
}
|
||||
// if(Objects.nonNull(designDTO.getTemplateId())){
|
||||
// LibraryModelPoint modelPoint = libraryModelPointService.getById(designDTO.getTemplateId());
|
||||
// Assert.notNull(modelPoint, "template cannot by empty!");
|
||||
// Library library = libraryService.getById(modelPoint.getLibraryId());
|
||||
// Assert.notNull(library, "template library cannot by empty!");
|
||||
// elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint,library.getHigh(),library.getWidth(),library.getUrl()));
|
||||
// }
|
||||
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(null,null,null,null));
|
||||
return elementVO;
|
||||
}
|
||||
@Override
|
||||
@@ -436,6 +437,27 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
libraryModelPoint.setTemplateUrl(templateUrl);
|
||||
return libraryModelPoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DesignLibraryModelPointVO calculateTemplatePointTemplate(LibraryModelPoint modelPoint, Integer high, Integer width,String templateUrl){
|
||||
DesignLibraryModelPointVO libraryModelPoint = new DesignLibraryModelPointVO();
|
||||
LibraryModelPoint template = libraryModelPointService.getById(96L);
|
||||
libraryModelPoint.setHandLeft(calculateTemplatePointOne(template.getHandLeft(),752,564));
|
||||
libraryModelPoint.setHandRight(calculateTemplatePointOne(template.getHandRight(),752,564));
|
||||
libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(template.getShoulderLeft(),752,564));
|
||||
libraryModelPoint.setShoulderRight(calculateTemplatePointOne(template.getShoulderRight(),752,564));
|
||||
libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(template.getWaistbandLeft(),752,564));
|
||||
libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(template.getWaistbandRight(),752,564));
|
||||
libraryModelPoint.setTemplateUrl("aida-mannequins/model_1693218345.2714432.png");
|
||||
// libraryModelPoint.setHandLeft(calculateTemplatePointOne(modelPoint.getHandLeft(),high,width));
|
||||
// libraryModelPoint.setHandRight(calculateTemplatePointOne(modelPoint.getHandRight(),high,width));
|
||||
// libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(modelPoint.getShoulderLeft(),high,width));
|
||||
// libraryModelPoint.setShoulderRight(calculateTemplatePointOne(modelPoint.getShoulderRight(),high,width));
|
||||
// libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(modelPoint.getWaistbandLeft(),high,width));
|
||||
// libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(modelPoint.getWaistbandRight(),high,width));
|
||||
// libraryModelPoint.setTemplateUrl(templateUrl);
|
||||
return libraryModelPoint;
|
||||
}
|
||||
private List<BigDecimal> calculateTemplatePointOne(String template,Integer high,Integer width){
|
||||
List<BigDecimal> originRatioList = JSON.parseObject(template,List.class);
|
||||
originRatioList.set(0,originRatioList.get(0).multiply(BigDecimal.valueOf(width)));
|
||||
|
||||
@@ -434,6 +434,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
designPythonOutfit.setUserId(userInfo.getId());
|
||||
designPythonOutfit.setDesignId(designId);
|
||||
designPythonOutfit.setCollectionId(collectionId);
|
||||
|
||||
designPythonOutfit.setDesignUrl(outfit.getString("synthesis_url"));
|
||||
designPythonOutfitService.save(designPythonOutfit);
|
||||
JSONArray layers = outfit.getJSONArray("layers");
|
||||
|
||||
@@ -58,13 +58,20 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
public IPage<WorkspaceVO> selectWorkspacePage(IPage<WorkspaceVO> page, WorkspaceVO workspace) {
|
||||
return page.setRecords(baseMapper.selectWorkspacePage(page, workspace));
|
||||
}
|
||||
private final static String WORKSPACE_NAME = "默认workspace名称";
|
||||
private final static Integer SYSTEM_DESIGNER_PERCENTAGE = 30;
|
||||
|
||||
@Override
|
||||
public boolean saveOrUpdate(Workspace workspace) {
|
||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||
workspace.setUserName(userInfo.getUsername());
|
||||
workspace.setIsLastIndex(0);
|
||||
if (null == workspace.getId()) {
|
||||
workspace.setIsLastIndex(0);
|
||||
workspace.setMannequinUrl("aida-mannequins/model_1693218345.2714432.png");
|
||||
workspace.setMannequinType(MannequinType.SYSTEM.getValue());
|
||||
workspace.setSex(Sex.MALE.getValue());
|
||||
workspace.setPosition(Position.OVERALL.getValue());
|
||||
workspace.setSystemDesignerPercentage(SYSTEM_DESIGNER_PERCENTAGE);
|
||||
int insert = workspaceMapper.insert(workspace);
|
||||
if (insert <= 0) {
|
||||
throw new BusinessException("insert workspace failed");
|
||||
@@ -79,9 +86,6 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
}
|
||||
}
|
||||
|
||||
private final static String WORKSPACE_NAME = "默认workspace名称";
|
||||
private final static Integer SYSTEM_DESIGNER_PERCENTAGE = 30;
|
||||
|
||||
@Override
|
||||
public WorkspaceVO getPage(WorkspaceDTO query) {
|
||||
WorkspaceVO vo = new WorkspaceVO();
|
||||
@@ -98,7 +102,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
workspace.setPosition(Position.OVERALL.getValue());
|
||||
workspace.setUserName(userName);
|
||||
workspace.setMannequinId(null);
|
||||
workspace.setMannequinUrl("aida-mannequins/model_1693218345.2714431.png");
|
||||
workspace.setMannequinUrl("aida-mannequins/model_1693218345.2714432.png");
|
||||
workspace.setMannequinType(MannequinType.SYSTEM.getValue());
|
||||
workspace.setIsLastIndex(1);
|
||||
int insert = workspaceMapper.insert(workspace);
|
||||
@@ -107,14 +111,20 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
}
|
||||
page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw);
|
||||
page.getRecords().forEach(o -> {
|
||||
o.setMannequinUrl(minioUtil.getPresignedUrl(o.getMannequinUrl(), 10));
|
||||
String url = o.getMannequinUrl();
|
||||
if (url.startsWith("aida-")) {
|
||||
o.setMannequinUrl(minioUtil.getPresignedUrl(o.getMannequinUrl(), 10));
|
||||
}
|
||||
});
|
||||
vo.setPage(PageBaseResponse.success(page));
|
||||
vo.setId(workspace.getId());
|
||||
return vo;
|
||||
}
|
||||
page.getRecords().forEach(o -> {
|
||||
o.setMannequinUrl(minioUtil.getPresignedUrl(o.getMannequinUrl(), 10));
|
||||
String url = o.getMannequinUrl();
|
||||
if (url.startsWith("aida-")) {
|
||||
o.setMannequinUrl(minioUtil.getPresignedUrl(o.getMannequinUrl(), 10));
|
||||
}
|
||||
});
|
||||
vo.setPage(PageBaseResponse.success(page));
|
||||
QueryWrapper<Workspace> qwIsLastIndex = new QueryWrapper<>();
|
||||
@@ -169,7 +179,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
ModelVO modelVO = new ModelVO();
|
||||
modelVO.setId(library.getId());
|
||||
modelVO.setUrl(library.getUrl());
|
||||
if (library.getUrl().contains("aida-")) {
|
||||
if (library.getUrl().startsWith("aida-")) {
|
||||
modelVO.setPresignedUrl(minioUtil.getPresignedUrl(library.getUrl(), 10));
|
||||
}else {
|
||||
modelVO.setPresignedUrl(library.getUrl());
|
||||
@@ -191,7 +201,7 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
ModelVO modelVO = new ModelVO();
|
||||
modelVO.setId(sysFile.getId());
|
||||
modelVO.setUrl(sysFile.getUrl());
|
||||
if (sysFile.getUrl().contains("aida-")) {
|
||||
if (sysFile.getUrl().startsWith("aida-")) {
|
||||
modelVO.setPresignedUrl(minioUtil.getPresignedUrl(sysFile.getUrl(), 10));
|
||||
}else {
|
||||
modelVO.setPresignedUrl(sysFile.getUrl());
|
||||
|
||||
Reference in New Issue
Block a user