BUGFIX:1. 单品设计返回的优先级不对 2. 修改项目参数会导致多一个模特
This commit is contained in:
@@ -1425,7 +1425,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
}
|
||||
|
||||
// 为没有优先级的衣服添加优先级
|
||||
designItemDetailService.setDesignItemDetailPriority(designItemDetails);
|
||||
if (!StringUtil.isNullOrEmpty(design.getSingleOverall()) && design.getSingleOverall().equals("overall")){
|
||||
designItemDetailService.setDesignItemDetailPriority(designItemDetails);
|
||||
}
|
||||
|
||||
// 2、组装返回参数
|
||||
DesignItemDetailVO response = new DesignItemDetailVO();
|
||||
|
||||
@@ -727,22 +727,25 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
deleteSketchByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
// 判断当前使用的模特风格与新的模特风格是否一致
|
||||
SysFile sysFile = sysFileService.getOneBySex(projectDTO.getStyleId(), projectDTO.getWorkspace().getSex(), projectDTO.getWorkspace().getAgeGroup());
|
||||
CollectionElement collectionElement = new CollectionElement();
|
||||
collectionElement.setAccountId(userInfo.getId());
|
||||
collectionElement.setProjectId(projectId);
|
||||
collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MODEL.getRealName());
|
||||
collectionElement.setName(sysFile.getName());
|
||||
collectionElement.setUrl(sysFile.getUrl());
|
||||
collectionElement.setMd5(sysFile.getMd5());
|
||||
collectionElement.setCreateDate(new Date());
|
||||
collectionElement.setHasPin((byte) 0);
|
||||
collectionElementMapper.insert(collectionElement);
|
||||
CollectionElementRelModel collectionElementRelModel = new CollectionElementRelModel();
|
||||
collectionElementRelModel.setCollectionElementId(collectionElement.getId());
|
||||
collectionElementRelModel.setRelationId(sysFile.getId());
|
||||
collectionElementRelModel.setRelationType("System");
|
||||
collectionElementRelModelMapper.insert(collectionElementRelModel);
|
||||
if (!checkIfModelExistsInProject(sysFile.getMd5(), projectId)){
|
||||
CollectionElement collectionElement = new CollectionElement();
|
||||
collectionElement.setAccountId(userInfo.getId());
|
||||
collectionElement.setProjectId(projectId);
|
||||
collectionElement.setLevel1Type(CollectionLevel1TypeEnum.MODEL.getRealName());
|
||||
collectionElement.setName(sysFile.getName());
|
||||
collectionElement.setUrl(sysFile.getUrl());
|
||||
collectionElement.setMd5(sysFile.getMd5());
|
||||
collectionElement.setCreateDate(new Date());
|
||||
collectionElement.setHasPin((byte) 0);
|
||||
collectionElementMapper.insert(collectionElement);
|
||||
CollectionElementRelModel collectionElementRelModel = new CollectionElementRelModel();
|
||||
collectionElementRelModel.setCollectionElementId(collectionElement.getId());
|
||||
collectionElementRelModel.setRelationId(sysFile.getId());
|
||||
collectionElementRelModel.setRelationType("System");
|
||||
collectionElementRelModelMapper.insert(collectionElementRelModel);
|
||||
}
|
||||
}
|
||||
workspaceNew.setId(workspace.getId());
|
||||
workspace.setUpdateTime(LocalDateTime.now());
|
||||
@@ -855,6 +858,17 @@ public class WorkspaceServiceImpl extends ServiceImpl<WorkspaceMapper, Workspace
|
||||
collectionElementMapper.delete(qw);
|
||||
}
|
||||
|
||||
// 由于在数据库中表设计问题,目前只能通过路径来判断项目中是否存在某一个模特
|
||||
public Boolean checkIfModelExistsInProject(String md5, Long projectId){
|
||||
QueryWrapper<CollectionElement> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(CollectionElement::getProjectId, projectId)
|
||||
.eq(CollectionElement::getLevel1Type, CollectionLevel1TypeEnum.MODEL.getRealName())
|
||||
.eq(CollectionElement::getMd5, md5);
|
||||
|
||||
List<CollectionElement> collectionElements = collectionElementMapper.selectList(qw);
|
||||
return collectionElements != null && !collectionElements.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getByProjectId(Long projectId) {
|
||||
QueryWrapper<Workspace> qw = new QueryWrapper<>();
|
||||
|
||||
Reference in New Issue
Block a user