BUGFIX:系统模特上传;
This commit is contained in:
@@ -62,6 +62,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
@Resource
|
@Resource
|
||||||
private LibraryService libraryService;
|
private LibraryService libraryService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private SysFileService sysFileService;
|
||||||
|
@Resource
|
||||||
private GenerateService generateService;
|
private GenerateService generateService;
|
||||||
@Resource
|
@Resource
|
||||||
private LibraryModelPointService libraryModelPointService;
|
private LibraryModelPointService libraryModelPointService;
|
||||||
@@ -447,20 +449,31 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
// Assert.notNull(modelPoint, "template cannot by empty!");
|
// Assert.notNull(modelPoint, "template cannot by empty!");
|
||||||
// Library library = libraryService.getById(modelPoint.getLibraryId());
|
// Library library = libraryService.getById(modelPoint.getLibraryId());
|
||||||
// Assert.notNull(library, "template library cannot by empty!");
|
// Assert.notNull(library, "template library cannot by empty!");
|
||||||
// if (designDTO.getModelType().equals(ModelType.LIBRARY.getValue())) {
|
if (designDTO.getModelType().equals(ModelType.LIBRARY.getValue())) {
|
||||||
// Library byId = libraryService.getById(designDTO.getTemplateId());
|
Library byId = libraryService.getById(designDTO.getTemplateId());
|
||||||
// QueryWrapper<LibraryModelPoint> qw = new QueryWrapper<>();
|
QueryWrapper<LibraryModelPoint> qw = new QueryWrapper<>();
|
||||||
// qw.lambda().eq(LibraryModelPoint::getModelType, ModelType.LIBRARY.getValue());
|
qw.lambda().eq(LibraryModelPoint::getModelType, ModelType.LIBRARY.getValue());
|
||||||
// qw.lambda().eq(LibraryModelPoint::getRelationId, byId.getId());
|
qw.lambda().eq(LibraryModelPoint::getRelationId, byId.getId());
|
||||||
// LibraryModelPoint modelPoint = libraryModelPointService.getOne(qw);
|
LibraryModelPoint modelPoint = libraryModelPointService.getOne(qw);
|
||||||
// if (Objects.isNull(modelPoint)) {
|
if (Objects.isNull(modelPoint)) {
|
||||||
// throw new BusinessException("error modelPoint get");
|
throw new BusinessException("error modelPoint get");
|
||||||
// }
|
}
|
||||||
// elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint,1654,1170,byId.getUrl()));
|
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint,1654,1170,byId.getUrl()));
|
||||||
// }
|
}else if (designDTO.getModelType().equals(ModelType.SYSTEM.getValue())) {
|
||||||
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(null,null,null,null));
|
SysFileVO byId = sysFileService.getById(designDTO.getTemplateId());
|
||||||
|
QueryWrapper<LibraryModelPoint> qw = new QueryWrapper<>();
|
||||||
|
qw.lambda().eq(LibraryModelPoint::getModelType, ModelType.SYSTEM.getValue());
|
||||||
|
qw.lambda().eq(LibraryModelPoint::getRelationId, byId.getId());
|
||||||
|
LibraryModelPoint modelPoint = libraryModelPointService.getOne(qw);
|
||||||
|
if (Objects.isNull(modelPoint)) {
|
||||||
|
throw new BusinessException("error modelPoint get");
|
||||||
|
}
|
||||||
|
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(modelPoint,1654,1170,byId.getUrl()));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
throw new BusinessException("templateId or modelType can't be null");
|
||||||
}
|
}
|
||||||
elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(null,null,null,null));
|
// elementVO.setDesignLibraryModelPoint(calculateTemplatePointTemplate(null,null,null,null));
|
||||||
return elementVO;
|
return elementVO;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@@ -479,21 +492,21 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
|||||||
@Override
|
@Override
|
||||||
public DesignLibraryModelPointVO calculateTemplatePointTemplate(LibraryModelPoint modelPoint, Integer high, Integer width,String templateUrl){
|
public DesignLibraryModelPointVO calculateTemplatePointTemplate(LibraryModelPoint modelPoint, Integer high, Integer width,String templateUrl){
|
||||||
DesignLibraryModelPointVO libraryModelPoint = new DesignLibraryModelPointVO();
|
DesignLibraryModelPointVO libraryModelPoint = new DesignLibraryModelPointVO();
|
||||||
LibraryModelPoint template = libraryModelPointService.getById(96L);
|
// LibraryModelPoint template = libraryModelPointService.getById(96L);
|
||||||
libraryModelPoint.setHandLeft(calculateTemplatePointOne(template.getHandLeft(),752,564));
|
// libraryModelPoint.setHandLeft(calculateTemplatePointOne(template.getHandLeft(),752,564));
|
||||||
libraryModelPoint.setHandRight(calculateTemplatePointOne(template.getHandRight(),752,564));
|
// libraryModelPoint.setHandRight(calculateTemplatePointOne(template.getHandRight(),752,564));
|
||||||
libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(template.getShoulderLeft(),752,564));
|
// libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(template.getShoulderLeft(),752,564));
|
||||||
libraryModelPoint.setShoulderRight(calculateTemplatePointOne(template.getShoulderRight(),752,564));
|
// libraryModelPoint.setShoulderRight(calculateTemplatePointOne(template.getShoulderRight(),752,564));
|
||||||
libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(template.getWaistbandLeft(),752,564));
|
// libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(template.getWaistbandLeft(),752,564));
|
||||||
libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(template.getWaistbandRight(),752,564));
|
// libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(template.getWaistbandRight(),752,564));
|
||||||
libraryModelPoint.setTemplateUrl("aida-mannequins/model_1693218345.2714432.png");
|
// libraryModelPoint.setTemplateUrl("aida-mannequins/model_1693218345.2714432.png");
|
||||||
// libraryModelPoint.setHandLeft(calculateTemplatePointOne(modelPoint.getHandLeft(),high,width));
|
libraryModelPoint.setHandLeft(calculateTemplatePointOne(modelPoint.getHandLeft(),high,width));
|
||||||
// libraryModelPoint.setHandRight(calculateTemplatePointOne(modelPoint.getHandRight(),high,width));
|
libraryModelPoint.setHandRight(calculateTemplatePointOne(modelPoint.getHandRight(),high,width));
|
||||||
// libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(modelPoint.getShoulderLeft(),high,width));
|
libraryModelPoint.setShoulderLeft(calculateTemplatePointOne(modelPoint.getShoulderLeft(),high,width));
|
||||||
// libraryModelPoint.setShoulderRight(calculateTemplatePointOne(modelPoint.getShoulderRight(),high,width));
|
libraryModelPoint.setShoulderRight(calculateTemplatePointOne(modelPoint.getShoulderRight(),high,width));
|
||||||
// libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(modelPoint.getWaistbandLeft(),high,width));
|
libraryModelPoint.setWaistbandLeft(calculateTemplatePointOne(modelPoint.getWaistbandLeft(),high,width));
|
||||||
// libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(modelPoint.getWaistbandRight(),high,width));
|
libraryModelPoint.setWaistbandRight(calculateTemplatePointOne(modelPoint.getWaistbandRight(),high,width));
|
||||||
// libraryModelPoint.setTemplateUrl(templateUrl);
|
libraryModelPoint.setTemplateUrl(templateUrl);
|
||||||
return libraryModelPoint;
|
return libraryModelPoint;
|
||||||
}
|
}
|
||||||
private List<BigDecimal> calculateTemplatePointOne(String template,Integer high,Integer width){
|
private List<BigDecimal> calculateTemplatePointOne(String template,Integer high,Integer width){
|
||||||
|
|||||||
Reference in New Issue
Block a user