BUGFIX: design generate处理;
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.ai.da.mapper.entity;
|
||||
package com.ai.da.mapper;
|
||||
|
||||
import com.ai.da.common.config.mybatis.plus.CommonMapper;
|
||||
import com.ai.da.mapper.entity.ChatRobot;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -9,43 +9,32 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("directory")
|
||||
public class Directory implements Serializable {
|
||||
@TableName("classification")
|
||||
public class Classification implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "分类名称")
|
||||
private String directoryName;
|
||||
private String classificationName;
|
||||
@ApiModelProperty(value = "分类类型")
|
||||
private String type;
|
||||
@ApiModelProperty(value = "父菜单id")
|
||||
@ApiModelProperty(value = "父菜单ID")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateDate;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
@ApiModelProperty(value = "是否删除1:是0:否")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -5,20 +5,17 @@ package com.ai.da.service.impl;
|
||||
|
||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import com.ai.da.common.config.exception.BusinessException;
|
||||
import com.ai.da.common.context.UserContext;
|
||||
import com.ai.da.common.enums.CollectionLevel2TypeEnum;
|
||||
import com.ai.da.common.enums.LibraryLevel1TypeEnum;
|
||||
import com.ai.da.common.utils.CopyUtil;
|
||||
import com.ai.da.common.utils.MD5Utils;
|
||||
import com.ai.da.common.utils.MinioUtil;
|
||||
import com.ai.da.mapper.LibraryMapper;
|
||||
import com.ai.da.mapper.entity.ChatRobot;
|
||||
import com.ai.da.mapper.entity.ChatRobotMapper;
|
||||
import com.ai.da.mapper.ChatRobotMapper;
|
||||
import com.ai.da.mapper.entity.Library;
|
||||
import com.ai.da.model.dto.ChatFlushDTO;
|
||||
import com.ai.da.model.dto.ChatRobotLibraryDTO;
|
||||
import com.ai.da.model.dto.ChatSendDTO;
|
||||
import com.ai.da.model.vo.AuthPrincipalVo;
|
||||
import com.ai.da.model.vo.ChatRobotLibraryVO;
|
||||
import com.ai.da.model.vo.ChatRobotVO;
|
||||
import com.ai.da.service.ChatRobotService;
|
||||
@@ -35,19 +32,12 @@ import okhttp3.*;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
@@ -67,7 +67,8 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
private LibraryService libraryService;
|
||||
@Resource
|
||||
private SysFileService sysFileService;
|
||||
|
||||
@Resource
|
||||
private GenerateService generateService;
|
||||
@Resource
|
||||
private GenerateDetailMapper generateDetailMapper;
|
||||
@Resource
|
||||
@@ -584,6 +585,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
|
||||
private List<CollectionElement> covertGeneratesToCollections(List<GenerateDetail> generateDetailList, Map<Long, CollectionSketchDTO> idToMap) {
|
||||
return CopyUtil.copyList(generateDetailList, CollectionElement.class, (o, d) -> {
|
||||
Generate byId = generateService.getById(o.getGenerateId());
|
||||
d.setAccountId(byId.getAccountId());
|
||||
d.setLevel1Type(byId.getLevel1Type());
|
||||
if (null != idToMap) {
|
||||
CollectionSketchDTO sketchDTO = idToMap.get(o.getId());
|
||||
d.setLevel2Type(sketchDTO.getLevel2Type());
|
||||
@@ -603,6 +607,9 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
|
||||
|
||||
private List<CollectionElement> covertGeneratesToPrintCollections(List<GenerateDetail> generateDetailList, Map<Long, DesignCollectionPrintElementDTO> idToMap) {
|
||||
return CopyUtil.copyList(generateDetailList, CollectionElement.class, (o, d) -> {
|
||||
Generate byId = generateService.getById(o.getGenerateId());
|
||||
d.setAccountId(byId.getAccountId());
|
||||
d.setLevel1Type(byId.getLevel1Type());
|
||||
if (null != idToMap) {
|
||||
DesignCollectionPrintElementDTO printDTO = idToMap.get(o.getId());
|
||||
d.setHasPin(printDTO.getIsPin());
|
||||
|
||||
@@ -224,6 +224,9 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> impleme
|
||||
.filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.MOOD_BOARD.getRealName()))
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(newMoodboard)) {
|
||||
if (CollectionUtils.isEmpty(elementVO.getMoodBoardElements())) {
|
||||
elementVO.setMoodBoardElements(new ArrayList<>());
|
||||
}
|
||||
elementVO.getMoodBoardElements().addAll(newMoodboard);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user