aidaV1.2
update the code until 25 May 2023
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:733b54301e6c0675d6a6cffb381c3fd559936921505584e6d4797d687b65d43f
|
||||
size 10488
|
||||
oid sha256:132811c996f35e8d1a97c3018e8cb9c3e04477c8819d9032c957d05833a265e6
|
||||
size 11057
|
||||
|
||||
@@ -188,6 +188,34 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
* 将文件名解析成文件的上传路径
|
||||
*/
|
||||
public static File upload(MultipartFile file, String filePath) {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmssS");
|
||||
String suffix = getExtensionName(file.getOriginalFilename());
|
||||
String nowStr = format.format(date)+"-" ;
|
||||
try {
|
||||
String fileName = file.getOriginalFilename();
|
||||
String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
|
||||
String path = filePath + fileSuffix;
|
||||
// getCanonicalFile 可解析正确各种路径
|
||||
File dest = new File(path).getCanonicalFile();
|
||||
// 检测是否存在目录
|
||||
if (!dest.getParentFile().exists()) {
|
||||
if (!dest.getParentFile().mkdirs()) {
|
||||
System.out.println("was not successful.");
|
||||
}
|
||||
}
|
||||
// 文件写入
|
||||
file.transferTo(dest);
|
||||
return dest;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 将文件名解析成文件的上传路径
|
||||
*/
|
||||
public static File upload2(MultipartFile file, String filePath) {
|
||||
Date date = new Date();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddhhmmssS");
|
||||
String suffix = getExtensionName(file.getOriginalFilename());
|
||||
@@ -211,6 +239,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
|
||||
@@ -50,8 +50,8 @@ public final class LocalCacheUtils {
|
||||
private static LoadingCache<String, String> emailCache = CacheBuilder.newBuilder()
|
||||
//设置并发级别为5,并发级别是指可以同时写缓存的线程数
|
||||
.concurrencyLevel(10)
|
||||
//设置写缓存后3分钟过期
|
||||
.expireAfterWrite(60*3, TimeUnit.SECONDS)
|
||||
//设置写缓存后10分钟过期,防止跨洲发送慢失效问题
|
||||
.expireAfterWrite(60*30, TimeUnit.SECONDS)
|
||||
//刷新机制 每隔一定时间刷新缓存loader 只有调用get具体的操作才生效(懒加载) 不设置则不刷新
|
||||
// .refreshAfterWrite(60, TimeUnit.SECONDS)
|
||||
//设置缓存容器的初始容量为100
|
||||
|
||||
@@ -95,5 +95,11 @@ public class ElementController {
|
||||
public Response<List<PantoneVO>> getRgbByHsvBatch(@RequestBody @Valid List<GetRgbByHsvBatchDTO> rgbByHsvBatch) {
|
||||
return Response.success(panToneService.getRgbByHsvBatch(rgbByHsvBatch));
|
||||
}
|
||||
@ApiOperation(value = "刷新历史数据")
|
||||
@PostMapping("/refreshHistoryData")
|
||||
public Response<Boolean> refreshHistoryData() {
|
||||
collectionElementService.refreshHistoryData();
|
||||
return Response.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ai.da.mapper;
|
||||
|
||||
import com.ai.da.common.config.mybatis.plus.CommonMapper;
|
||||
import com.ai.da.mapper.entity.TCollectionElementRelation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* collection和element的关联表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yanglei
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Mapper
|
||||
public interface TCollectionElementRelationMapper extends CommonMapper<TCollectionElementRelation> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.ai.da.mapper.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* collection和element的关联表
|
||||
* </p>
|
||||
*
|
||||
* @author yanglei
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("t_collection_element_relation")
|
||||
@ApiModel(value = "TCollectionElementRelation对象", description = "collection和element的关联表")
|
||||
public class TCollectionElementRelation implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("element ID")
|
||||
private Long elementId;
|
||||
|
||||
@ApiModelProperty("colletion ID class类型为COLLECTION 存 其他默认是0")
|
||||
private Long collectionId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
private Date createDate;
|
||||
|
||||
|
||||
}
|
||||
@@ -134,7 +134,7 @@ public class PythonService {
|
||||
PythonToJavaApiOperationTypeEnum operationType = PythonToJavaApiOperationTypeEnum.uploadOf(operateType);
|
||||
Assert.notNull(operationType, "unknown operateType " + operateType + "!");
|
||||
String path = calculateFileUrl(operationType);
|
||||
File generateFile = FileUtil.upload(file, path);
|
||||
File generateFile = FileUtil.upload2(file, path);
|
||||
|
||||
String linuxDomain = fileProperties.getLinuxDomain();
|
||||
if (!StringUtils.isEmpty(linuxDomain)) {
|
||||
@@ -1274,6 +1274,9 @@ public class PythonService {
|
||||
return null;
|
||||
}
|
||||
DesignPythonItemPrint print = CopyUtil.copyObject(printObject, DesignPythonItemPrint.class);
|
||||
if(StringUtils.isEmpty(printObject.getPath())){
|
||||
print.setPath("none");
|
||||
}
|
||||
if (StringUtils.isEmpty(clothesPath)
|
||||
|| "none".equals(clothesPath)
|
||||
|| CollectionUtils.isEmpty(printObject.getLocation())) {
|
||||
@@ -1286,6 +1289,7 @@ public class PythonService {
|
||||
location.set(0, location.get(0) * fileVO.getWidth());
|
||||
location.set(1, location.get(1) * fileVO.getHigh());
|
||||
});
|
||||
|
||||
log.info("本次print打点locations###{}###fileVO{}", locations, JSON.toJSONString(fileVO));
|
||||
return print;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ public interface CollectionElementService extends IService<CollectionElement> {
|
||||
*/
|
||||
List<CollectionElementVO> saveColorBoard(List<CollectionColorDTO> colorBoards, Long collectionId, String timeZone);
|
||||
|
||||
|
||||
/**
|
||||
* 根据collection查询
|
||||
*
|
||||
@@ -105,6 +106,13 @@ public interface CollectionElementService extends IService<CollectionElement> {
|
||||
*/
|
||||
List<CollectionElement> getByCollectionId(Long collectionId);
|
||||
|
||||
List<CollectionElement> getByOnlyCollectionId(Long collectionId);
|
||||
|
||||
DesignLibraryModelPointVO calculateTemplatePoint(LibraryModelPoint modelPoint, Integer high, Integer width, String templateUrl);
|
||||
|
||||
/**
|
||||
* 刷新历史数据
|
||||
*/
|
||||
void refreshHistoryData() ;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ai.da.service;
|
||||
|
||||
import com.ai.da.mapper.entity.TCollectionElementRelation;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* collection和element的关联表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author yanglei
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
public interface TCollectionElementRelationService extends IService<TCollectionElementRelation> {
|
||||
void deleteByCollectionId(Long collectionId);
|
||||
List<Long> getByCollectionId(Long collectionId);
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import com.ai.da.model.vo.AccountPreLoginVO;
|
||||
import com.ai.da.model.vo.AuthPrincipalVo;
|
||||
import com.ai.da.service.AccountLoginLogService;
|
||||
import com.ai.da.service.AccountService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -61,6 +62,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
|
||||
@Override
|
||||
public AccountPreLoginVO preLogin(AccountPreLoginDTO accountDTO) {
|
||||
log.info("aida预先登入accountDTO###{}", JSON.toJSONString(accountDTO));
|
||||
Account account = getOneByUserName(accountDTO.getUserName());
|
||||
Assert.isTrue(Objects.nonNull(account),"User does not exist!");
|
||||
//用户有效期校验
|
||||
@@ -77,9 +79,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
@Transactional
|
||||
@Override
|
||||
public AccountLoginVO login(AccountLoginDTO accountLoginDTO, HttpServletRequest request) {
|
||||
Account accountExist = getOneByUserId(accountLoginDTO.getUserId());
|
||||
log.info("aida确认登入###accountLoginDTO###{}", JSON.toJSONString(accountLoginDTO));
|
||||
Account accountExist = getOneByEmail(accountLoginDTO.getEmail().trim());
|
||||
Assert.notNull(accountExist,"User does not exist!");
|
||||
Assert.isTrue(accountLoginDTO.getEmail().equals(accountExist.getUserEmail()),"Email not registered!");
|
||||
|
||||
LoginTypeEnum accountType = LoginTypeEnum.of(accountLoginDTO.getLoginType());
|
||||
if (Objects.isNull(accountType)|| accountType.equals(LoginTypeEnum.PASSWORD)) {
|
||||
@@ -101,7 +103,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
case EMAIL:
|
||||
Assert.isTrue(StringUtils.isNotBlank(accountLoginDTO.getEmail()), "Please input a email !");
|
||||
Assert.isTrue(StringUtils.isNotBlank(accountLoginDTO.getEmailVerifyCode()), "Please input the email verification code !");
|
||||
account = getOneByEmail(accountLoginDTO.getEmail());
|
||||
account = getOneByEmail(accountLoginDTO.getEmail().trim());
|
||||
if (Objects.isNull(account)) {
|
||||
throw new BusinessException("Email not registered!");
|
||||
}
|
||||
|
||||
@@ -5,25 +5,23 @@ import com.ai.da.common.config.FileProperties;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.*;
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.common.utils.DateUtil;
|
||||
import com.ai.da.common.utils.FileUtil;
|
||||
import com.ai.da.common.utils.MD5Utils;
|
||||
import com.ai.da.mapper.CollectionElementMapper;
|
||||
import com.ai.da.mapper.entity.*;
|
||||
import com.ai.da.mapper.entity.Collection;
|
||||
import com.ai.da.mapper.entity.CollectionElement;
|
||||
import com.ai.da.mapper.entity.Library;
|
||||
import com.ai.da.mapper.entity.LibraryModelPoint;
|
||||
import com.ai.da.model.dto.*;
|
||||
import com.ai.da.model.vo.*;
|
||||
import com.ai.da.python.PythonService;
|
||||
import com.ai.da.python.vo.DesignPythonItem;
|
||||
import com.ai.da.service.CollectionElementService;
|
||||
import com.ai.da.service.LibraryModelPointService;
|
||||
import com.ai.da.service.LibraryService;
|
||||
import com.ai.da.service.PanToneService;
|
||||
import com.ai.da.service.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import javafx.scene.chart.ValueAxis;
|
||||
@@ -32,6 +30,7 @@ import org.bouncycastle.LICENSE;
|
||||
import org.bouncycastle.cms.CMSAuthenticatedGenerator;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.reactive.AbstractReactiveTransactionManager;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -65,6 +64,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
private LibraryService libraryService;
|
||||
@Resource
|
||||
private LibraryModelPointService libraryModelPointService;
|
||||
@Resource
|
||||
private TCollectionElementRelationService tCollectionElementRelationService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
@@ -477,6 +478,36 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
}
|
||||
return CopyUtil.copyList(colorElements, CollectionElementVO.class);
|
||||
}
|
||||
@Override
|
||||
public void refreshHistoryData() {
|
||||
//幂等
|
||||
if(!CollectionUtils.isEmpty(tCollectionElementRelationService.getByCollectionId(1083L))){
|
||||
return;
|
||||
}
|
||||
// 分页数据
|
||||
QueryWrapper<CollectionElement> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc("id");
|
||||
PageQueryBaseVo pageQuery = new PageQueryBaseVo();
|
||||
pageQuery.setPage(1);
|
||||
pageQuery.setSize(200);
|
||||
while(true){
|
||||
IPage<CollectionElement> page = getBaseMapper().selectPage(
|
||||
new Page<>(pageQuery.getPage(), pageQuery.getSize()), queryWrapper);
|
||||
List<CollectionElement> list = page.getRecords();
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
break;
|
||||
}
|
||||
|
||||
//保存
|
||||
List<TCollectionElementRelation> relations = list.stream().map(element->
|
||||
TCollectionElementRelation.builder().elementId(element.getId())
|
||||
.collectionId(element.getCollectionId()).createDate(new Date()).build())
|
||||
.collect(Collectors.toList());
|
||||
tCollectionElementRelationService.saveBatch(relations);
|
||||
pageQuery.setPage(pageQuery.getPage()+1);
|
||||
log.info("refreshHistoryData###process###page###"+pageQuery.getPage());
|
||||
}
|
||||
}
|
||||
|
||||
private List<CollectionElement> resolveColorData(List<CollectionColorDTO> colorBoards, AuthPrincipalVo userInfo, Long collectionId, String timeZone) {
|
||||
List<CollectionElement> elements = Lists.newArrayList();
|
||||
@@ -505,6 +536,16 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
|
||||
@Override
|
||||
public List<CollectionElement> getByCollectionId(Long collectionId) {
|
||||
List<Long> elementIds = tCollectionElementRelationService.getByCollectionId(collectionId);
|
||||
if (CollectionUtils.isEmpty(elementIds)){
|
||||
return null;
|
||||
}
|
||||
QueryWrapper<CollectionElement> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("id", elementIds);
|
||||
return collectionElementMapper.selectList(queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<CollectionElement> getByOnlyCollectionId(Long collectionId) {
|
||||
QueryWrapper<CollectionElement> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("collection_id", collectionId);
|
||||
return collectionElementMapper.selectList(queryWrapper);
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.toolkit.Assert;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -118,7 +119,7 @@ public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collect
|
||||
}else {
|
||||
String[] idName = name.split("_");
|
||||
if (idName.length >1){
|
||||
d.setId(Integer.valueOf(idName[0]));
|
||||
d.setId(StringUtil.isNullOrEmpty(idName[0]) ? null : Integer.valueOf(idName[0]));
|
||||
d.setName(idName[1]);
|
||||
d.setTcx(idName[2]);
|
||||
}
|
||||
|
||||
@@ -72,6 +72,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
private UserLikeService userLikeService;
|
||||
@Resource
|
||||
private SysFileService sysFileService;
|
||||
@Resource
|
||||
private TCollectionElementRelationService tCollectionElementRelationService;
|
||||
|
||||
// @Transactional
|
||||
@Override
|
||||
@@ -167,7 +169,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
//library转化为collection(生成)
|
||||
saveCollectionElemntsByLibrarys(elementVO,collectionId);
|
||||
//保存颜色版
|
||||
collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone());
|
||||
List<CollectionElementVO> colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone());
|
||||
//保存design
|
||||
Long designId = saveOne(designDTO,collectionId,userInfo.getId());
|
||||
//计算library
|
||||
@@ -181,9 +183,30 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
pythonService.design(pythonObjects);
|
||||
//生成library
|
||||
generateLibrary(elementVO,designDTO.getTimeZone());
|
||||
//处理关联关系,修复element覆盖得情况
|
||||
List<CollectionElement> reLationelements =collectionElementService.getByOnlyCollectionId(collectionId);
|
||||
List<Long> reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList());
|
||||
handleCollectionElementRelation(collectionId,(null == collectionIdParam) ? false :true,reLationelementIds);
|
||||
//保存designItem 和detail
|
||||
return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone());
|
||||
}
|
||||
private void handleCollectionElementRelation(Long collectionId ,Boolean isEdit,List<Long> elementIds ){
|
||||
if (CollectionUtils.isEmpty(elementIds) || collectionId == null){
|
||||
return;
|
||||
}
|
||||
if(isEdit){
|
||||
//删除
|
||||
tCollectionElementRelationService.deleteByCollectionId(collectionId);
|
||||
}
|
||||
//新增
|
||||
tCollectionElementRelationService.saveBatch(elementIds.stream().map(elementId ->
|
||||
TCollectionElementRelation.builder()
|
||||
.collectionId(collectionId)
|
||||
.elementId(elementId)
|
||||
.createDate(new Date())
|
||||
.build()
|
||||
).collect(Collectors.toList()));
|
||||
}
|
||||
private void generateLibrary(ValidateElementVO elementVO,String timeZone){
|
||||
List<CollectionElement> elements = Lists.newArrayList();
|
||||
if(!CollectionUtils.isEmpty(elementVO.getMoodBoardElements())){
|
||||
@@ -382,6 +405,8 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
List<Long> newElementIds = validateMergeElement(oldElements,designItemDetails);
|
||||
//合并,关联新的element到collection
|
||||
collectionElementService.relationCollection(newElementIds,userLikeGroup.getCollectionId());
|
||||
//处理关联关系,修复element覆盖得情况
|
||||
handleCollectionElementRelation(userLikeGroup.getCollectionId(),false,newElementIds);
|
||||
UserLike userLike = resolveUserLike(designLikeDTO.getUserGroupId(), designItem.getDesignId(),
|
||||
designLikeDTO.getDesignItemId(),designItem.getDesignUrl(),designLikeDTO.getTimeZone());
|
||||
userLikeService.save(userLike);
|
||||
@@ -398,6 +423,7 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
designItemService.updateLikeStatus(designLikeDTO.getDesignItemId(),(byte)1);
|
||||
return new DesignLikeVO(userGroupId,groupDetailId);
|
||||
}
|
||||
|
||||
private List<Long> validateMergeElement(List<CollectionElement> oldElements,List<DesignItemDetail> designItemDetails){
|
||||
List<DesignItemDetail> hasCollections = designItemDetails.stream()
|
||||
.filter(f->Objects.nonNull(f.getCollectionElementId()))
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ai.da.service.impl;
|
||||
|
||||
import com.ai.da.mapper.TCollectionElementRelationMapper;
|
||||
import com.ai.da.mapper.UserLikeMapper;
|
||||
import com.ai.da.mapper.entity.TCollectionElementRelation;
|
||||
import com.ai.da.mapper.entity.UserLike;
|
||||
import com.ai.da.service.TCollectionElementRelationService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* collection和element的关联表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yanglei
|
||||
* @since 2023-05-07
|
||||
*/
|
||||
@Service
|
||||
public class TCollectionElementRelationServiceImpl extends ServiceImpl<TCollectionElementRelationMapper, TCollectionElementRelation> implements TCollectionElementRelationService {
|
||||
@Resource
|
||||
private TCollectionElementRelationMapper tCollectionElementRelationMapper;
|
||||
|
||||
public void deleteByCollectionId(Long collectionId) {
|
||||
QueryWrapper<TCollectionElementRelation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("collection_id", collectionId);
|
||||
tCollectionElementRelationMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
public List<Long> getByCollectionId(Long collectionId) {
|
||||
QueryWrapper<TCollectionElementRelation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("collection_id", collectionId);
|
||||
List<TCollectionElementRelation> tCollectionElementRelations = tCollectionElementRelationMapper.selectList(queryWrapper);
|
||||
return CollectionUtils.isEmpty(tCollectionElementRelations) ? null :
|
||||
tCollectionElementRelations.stream().map(TCollectionElementRelation::getElementId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -123,6 +123,7 @@ com\ai\da\model\dto\GenerateHighDesignDTO.class
|
||||
com\ai\da\python\vo\DesignPythonObjects.class
|
||||
com\ai\da\python\PythonService$1.class
|
||||
com\ai\da\common\utils\CopyUtil.class
|
||||
com\ai\da\service\impl\TCollectionElementRelationServiceImpl.class
|
||||
com\ai\da\model\vo\LibraryUpdateVo.class
|
||||
com\ai\da\service\impl\AccountServiceImpl.class
|
||||
com\ai\da\model\dto\AccountLoginDTO.class
|
||||
@@ -134,6 +135,7 @@ com\ai\da\common\config\mybatis\plus\MybatisPlusConfig.class
|
||||
com\ai\da\model\vo\QueryLibraryPageVO.class
|
||||
com\ai\da\service\SysFileService.class
|
||||
com\ai\da\common\utils\LocalCacheUtils$5.class
|
||||
com\ai\da\service\TCollectionElementRelationService.class
|
||||
com\ai\da\mapper\entity\SysFile.class
|
||||
com\ai\da\common\utils\RandomsUtil.class
|
||||
com\ai\da\common\utils\LocalCacheUtils.class
|
||||
@@ -159,6 +161,7 @@ com\ai\da\mapper\LibraryModelPointMapper.class
|
||||
com\ai\da\common\response\PageBaseResponse.class
|
||||
com\ai\da\model\vo\UserLikeChooseVO.class
|
||||
com\ai\da\mapper\entity\UserLikeGroup.class
|
||||
com\ai\da\mapper\TCollectionElementRelationMapper.class
|
||||
com\ai\da\model\vo\PageQueryBaseVo.class
|
||||
com\ai\da\common\enums\CurrentDesignPrintPictureTypeEnum.class
|
||||
com\ai\da\common\response\ResultEnum.class
|
||||
@@ -194,7 +197,9 @@ com\ai\da\model\vo\ValidateElementVO.class
|
||||
com\ai\da\mapper\entity\Collection.class
|
||||
com\ai\da\common\config\exception\BusinessException.class
|
||||
com\ai\da\common\response\Response.class
|
||||
com\ai\da\mapper\entity\TCollectionElementRelation.class
|
||||
com\ai\da\controller\DesignDetailController.class
|
||||
com\ai\da\mapper\entity\TCollectionElementRelation$TCollectionElementRelationBuilder.class
|
||||
com\ai\da\mapper\AccountLoginLogMapper.class
|
||||
com\ai\da\mapper\entity\PanTone.class
|
||||
com\ai\da\common\enums\OperationTypeEnum.class
|
||||
|
||||
@@ -5,6 +5,7 @@ D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\enums\SysFileLevel2
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\dto\GenerateHighDesignDTO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\security\filter\AuthenticationFilter.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\mapper\entity\Design.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\mapper\TCollectionElementRelationMapper.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\controller\DesignController.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\controller\ElementController.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\service\impl\LibraryModelPointServiceImpl.java
|
||||
@@ -38,6 +39,7 @@ D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\config\FileProperti
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\DesignCollectionItemVO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\dto\DesignLikeDTO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\service\CollectionService.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\service\TCollectionElementRelationService.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\mapper\entity\DesignHistory.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\SysFileVO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\config\swagger\AidaConfiguration.java
|
||||
@@ -88,10 +90,12 @@ D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\ValidateElementVO
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\controller\DesignDetailController.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\dto\LibraryDeleteDTO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\dto\EmailSendDTO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\service\impl\TCollectionElementRelationServiceImpl.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\CollectionColorVO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\service\PanToneService.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\mapper\entity\Collection.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\AccountLoginVO.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\mapper\entity\TCollectionElementRelation.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\httpdata\token\TokenApis.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\common\security\config\SecurityConfig.java
|
||||
D:\codeManager\code\AIDA\aida\src\main\java\com\ai\da\model\vo\UserLikeChooseVO.java
|
||||
|
||||
Reference in New Issue
Block a user