Commit 7d9b2e91 authored by liqin's avatar liqin 💬

bug fixed

parent 93db1527
...@@ -8,8 +8,8 @@ import java.util.stream.Collectors; ...@@ -8,8 +8,8 @@ import java.util.stream.Collectors;
*/ */
public enum CopyrightOwnerTypeEnum { public enum CopyrightOwnerTypeEnum {
ASSET(1, "视频"), VIDEO_CONTENT(1, "视频内容"),
EXHIBITION_BOARD(2, "展板"); EXHIBITION_BOARD(2, "展板内容");
public String name; public String name;
public static String names; public static String names;
......
...@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis; ...@@ -3,7 +3,7 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public class MysqlGenerator { public class MysqlGenerator {
private static final String[] tableNames = new String[]{ private static final String[] tableNames = new String[]{
"asset", "video_content", "video_content_cat" "copyright_owner_video_content_cat"
}; };
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party"; // private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private static final String projectPath = "/opt/ss"; private static final String projectPath = "/opt/ss";
......
package cn.wisenergy.chnmuseum.party.mapper; package cn.wisenergy.chnmuseum.party.mapper;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
/** /**
* <pre> * <pre>
...@@ -10,9 +9,8 @@ import org.springframework.stereotype.Repository; ...@@ -10,9 +9,8 @@ import org.springframework.stereotype.Repository;
* </pre> * </pre>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-18 * @since 2021-04-02
*/ */
@Repository public interface CopyrightOwnerVideoContentCatMapper extends BaseMapper<CopyrightOwnerVideoContentCat> {
public interface CopyrightOwnerAssetTypeMapper extends BaseMapper<CopyrightOwnerAssetType> {
} }
...@@ -45,7 +45,7 @@ public class CopyrightOwner implements Serializable { ...@@ -45,7 +45,7 @@ public class CopyrightOwner implements Serializable {
@NotBlank(message = "版权方名称不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "版权方名称不能为空", groups = {Add.class, Update.class})
private String name; private String name;
@ApiModelProperty(value = "版权方类型", allowableValues = "ASSET, EXHIBITION_BOARD") @ApiModelProperty(value = "版权方类型", allowableValues = "VIDEO_CONTENT, EXHIBITION_BOARD")
@TableField("owner_type") @TableField("owner_type")
@NotBlank(message = "版权方类型不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "版权方类型不能为空", groups = {Add.class, Update.class})
private String ownerType; private String ownerType;
...@@ -72,16 +72,16 @@ public class CopyrightOwner implements Serializable { ...@@ -72,16 +72,16 @@ public class CopyrightOwner implements Serializable {
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("视频分类ID集合(详情使用)") @ApiModelProperty("视频内容分类ID集合(详情使用)")
@TableField(exist = false) @TableField(exist = false)
private List<String> assetTypeIdList; private List<String> videoContentCatIdList;
@ApiModelProperty("视频分类名称集合(详情使用)") @ApiModelProperty("视频内容分类名称集合(详情使用)")
@TableField(exist = false) @TableField(exist = false)
private List<String> assetTypeNameList; private List<String> videoContentCatNameList;
@ApiModelProperty("视频分类名称(列表使用)") @ApiModelProperty("视频内容分类名称(列表使用)")
@TableField(exist = false) @TableField(exist = false)
private String assetTypeNames; private String videoContentCatNames;
} }
...@@ -21,7 +21,7 @@ import java.io.Serializable; ...@@ -21,7 +21,7 @@ import java.io.Serializable;
* </p> * </p>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-23 * @since 2021-04-02
*/ */
@Data @Data
@Builder @Builder
...@@ -29,9 +29,9 @@ import java.io.Serializable; ...@@ -29,9 +29,9 @@ import java.io.Serializable;
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("copyright_owner_asset_type") @TableName("copyright_owner_video_content_cat")
@ApiModel(value = "版权方视频分类", description = "版权方视频分类") @ApiModel(value = "版权方视频分类", description = "版权方视频分类")
public class CopyrightOwnerAssetType implements Serializable { public class CopyrightOwnerVideoContentCat implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -40,14 +40,17 @@ public class CopyrightOwnerAssetType implements Serializable { ...@@ -40,14 +40,17 @@ public class CopyrightOwnerAssetType implements Serializable {
@NotNull(message = "标识ID不能为空", groups = {Update.class}) @NotNull(message = "标识ID不能为空", groups = {Update.class})
private String id; private String id;
@ApiModelProperty("视频版权方ID") @ApiModelProperty("视频内容版权方ID")
@TableField("copyright_owner_id") @TableField("copyright_owner_id")
@NotBlank(message = "视频版权方ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "视频内容版权方ID不能为空", groups = {Add.class, Update.class})
private String copyrightOwnerId; private String copyrightOwnerId;
@ApiModelProperty("视频内容分类ID")
@TableField("video_content_cat_id")
@NotBlank(message = "视频内容分类ID不能为空", groups = {Add.class, Update.class})
private String videoContentCatId;
@ApiModelProperty("视频分类ID")
@TableField("asset_type_id")
@NotBlank(message = "视频分类ID不能为空", groups = {Add.class, Update.class})
private String assetTypeId;
} }
package cn.wisenergy.chnmuseum.party.service; package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
...@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -9,8 +9,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* </p> * </p>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-18 * @since 2021-04-02
*/ */
public interface CopyrightOwnerAssetTypeService extends IService<CopyrightOwnerAssetType> { public interface CopyrightOwnerVideoContentCatService extends IService<CopyrightOwnerVideoContentCat> {
} }
...@@ -103,7 +103,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -103,7 +103,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
break; break;
case ACCOUNT: case ACCOUNT:
break; break;
case ASSET: case VIDEO_CONTENT:
selectPage = auditMapper.getAssetPage(auditPage, ew); selectPage = auditMapper.getAssetPage(auditPage, ew);
default: default:
} }
......
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerAssetTypeMapper; import cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerVideoContentCatMapper;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerAssetTypeService; import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,11 +13,10 @@ import org.springframework.stereotype.Service; ...@@ -13,11 +13,10 @@ import org.springframework.stereotype.Service;
* </pre> * </pre>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-18 * @since 2021-04-02
*/ */
@Slf4j @Slf4j
@Service @Service
public class CopyrightOwnerAssetTypeServiceImpl extends ServiceImpl<CopyrightOwnerAssetTypeMapper, CopyrightOwnerAssetType> implements CopyrightOwnerAssetTypeService { public class CopyrightOwnerVideoContentCatServiceImpl extends ServiceImpl<CopyrightOwnerVideoContentCatMapper, CopyrightOwnerVideoContentCat> implements CopyrightOwnerVideoContentCatService {
} }
...@@ -5,11 +5,14 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils; ...@@ -5,11 +5,14 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -50,13 +53,10 @@ public class CopyrightOwnerController extends BaseController { ...@@ -50,13 +53,10 @@ public class CopyrightOwnerController extends BaseController {
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource @Resource
private AssetService assetService; private VideoContentCatService videoContentCatService;
@Resource
private AssetTypeService assetTypeService;
@Resource @Resource
private CopyrightOwnerAssetTypeService copyrightOwnerAssetTypeService; private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
...@@ -64,23 +64,20 @@ public class CopyrightOwnerController extends BaseController { ...@@ -64,23 +64,20 @@ public class CopyrightOwnerController extends BaseController {
@PostMapping("/save") @PostMapping("/save")
@RequiresPermissions("copyright:owner:save") @RequiresPermissions("copyright:owner:save")
@ApiOperation(value = "添加版权方", notes = "添加版权方") @ApiOperation(value = "添加版权方", notes = "添加版权方")
public Map<String, Object> saveCopyrightOwner(@Validated(value = {Add.class}) CopyrightOwner copyrightOwner public Map<String, Object> saveCopyrightOwner(@Validated(value = {Add.class}) CopyrightOwner copyrightOwner) {
//, @RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum
) {
//copyrightOwner.setOwnerType(copyrightOwnerTypeEnum.name());
// 保存业务节点信息 // 保存业务节点信息
boolean result = copyrightOwnerService.save(copyrightOwner); boolean result = copyrightOwnerService.save(copyrightOwner);
List<String> assetTypeIdList = copyrightOwner.getAssetTypeIdList(); final List<String> videoContentCatIdList = copyrightOwner.getVideoContentCatIdList();
if (assetTypeIdList != null && !assetTypeIdList.isEmpty()) { if (videoContentCatIdList != null && !videoContentCatIdList.isEmpty()) {
List<CopyrightOwnerAssetType> copyrightOwnerAssetTypeList = new ArrayList<>(); List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = new ArrayList<>();
for (String assetTypeId : assetTypeIdList) { for (String videoContentCatId : videoContentCatIdList) {
copyrightOwnerAssetTypeList.add(CopyrightOwnerAssetType.builder() copyrightOwnerVideoContentCatList.add(CopyrightOwnerVideoContentCat.builder()
.assetTypeId(assetTypeId) .videoContentCatId(videoContentCatId)
.copyrightOwnerId(copyrightOwner.getId()) .copyrightOwnerId(copyrightOwner.getId())
.build()); .build());
} }
this.copyrightOwnerAssetTypeService.saveBatch(copyrightOwnerAssetTypeList); this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList);
} }
// 返回操作结果 // 返回操作结果
...@@ -98,19 +95,19 @@ public class CopyrightOwnerController extends BaseController { ...@@ -98,19 +95,19 @@ public class CopyrightOwnerController extends BaseController {
public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner) { public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner) {
boolean flag = copyrightOwnerService.updateById(copyrightOwner); boolean flag = copyrightOwnerService.updateById(copyrightOwner);
List<String> assetTypeIdList = copyrightOwner.getAssetTypeIdList(); final List<String> videoContentCatIdList = copyrightOwner.getVideoContentCatIdList();
if (assetTypeIdList != null && !assetTypeIdList.isEmpty()) { if (videoContentCatIdList != null && !videoContentCatIdList.isEmpty()) {
LambdaUpdateWrapper<CopyrightOwnerAssetType> updateWrapper = Wrappers.<CopyrightOwnerAssetType>lambdaUpdate().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, copyrightOwner.getId()); LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, copyrightOwner.getId());
this.copyrightOwnerAssetTypeService.remove(updateWrapper); this.copyrightOwnerVideoContentCatService.remove(updateWrapper);
List<CopyrightOwnerAssetType> copyrightOwnerAssetTypeList = new ArrayList<>(); List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = new ArrayList<>();
for (String assetTypeId : assetTypeIdList) { for (String videoContentCatId : videoContentCatIdList) {
copyrightOwnerAssetTypeList.add(CopyrightOwnerAssetType.builder() copyrightOwnerVideoContentCatList.add(CopyrightOwnerVideoContentCat.builder()
.assetTypeId(assetTypeId) .videoContentCatId(videoContentCatId)
.copyrightOwnerId(copyrightOwner.getId()) .copyrightOwnerId(copyrightOwner.getId())
.build()); .build());
} }
this.copyrightOwnerAssetTypeService.saveBatch(copyrightOwnerAssetTypeList); this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList);
} }
if (flag) { if (flag) {
return getSuccessResult(); return getSuccessResult();
...@@ -118,16 +115,6 @@ public class CopyrightOwnerController extends BaseController { ...@@ -118,16 +115,6 @@ public class CopyrightOwnerController extends BaseController {
return getFailResult(); return getFailResult();
} }
@DeleteMapping("/delete/{id}")
@RequiresPermissions("copyright:owner:delete")
@ApiOperation(value = "根据ID删除版权方", notes = "根据ID删除版权方")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
public Map<String, Object> deleteCopyrightOwner(@PathVariable("id") String id) {
return getSuccessResult();
}
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "copyrightOwnerType", value = "版权方类型", paramType = "query", dataType = "String", required = true) @ApiImplicitParam(name = "copyrightOwnerType", value = "版权方类型", paramType = "query", dataType = "String", required = true)
}) })
...@@ -145,7 +132,7 @@ public class CopyrightOwnerController extends BaseController { ...@@ -145,7 +132,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"), @ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "ownerType", value = "版权方类型", paramType = "query", dataType = "String", required = true, allowableValues = "ASSET, EXHIBITION_BOARD"), @ApiImplicitParam(name = "ownerType", value = "版权方类型", paramType = "query", dataType = "String", required = true, allowableValues = "VIDEO_CONTENT, EXHIBITION_BOARD"),
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String") @ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
...@@ -171,6 +158,7 @@ public class CopyrightOwnerController extends BaseController { ...@@ -171,6 +158,7 @@ public class CopyrightOwnerController extends BaseController {
queryWrapper.select( queryWrapper.select(
CopyrightOwner::getId, CopyrightOwner::getId,
CopyrightOwner::getName, CopyrightOwner::getName,
CopyrightOwner::getOwnerType,
CopyrightOwner::getExpireDateStart, CopyrightOwner::getExpireDateStart,
CopyrightOwner::getExpireDateEnd, CopyrightOwner::getExpireDateEnd,
CopyrightOwner::getRemarks, CopyrightOwner::getRemarks,
...@@ -178,22 +166,22 @@ public class CopyrightOwnerController extends BaseController { ...@@ -178,22 +166,22 @@ public class CopyrightOwnerController extends BaseController {
CopyrightOwner::getUpdateTime); CopyrightOwner::getUpdateTime);
Page<CopyrightOwner> page = this.copyrightOwnerService.page(getPage(), queryWrapper); Page<CopyrightOwner> page = this.copyrightOwnerService.page(getPage(), queryWrapper);
for (CopyrightOwner copyrightOwner : page.getRecords()) { for (CopyrightOwner copyrightOwner : page.getRecords()) {
if (CopyrightOwnerTypeEnum.ASSET.name().equals(genericPageParam.getOwnerType())) { if (CopyrightOwnerTypeEnum.VIDEO_CONTENT.name().equals(genericPageParam.getOwnerType())) {
List<CopyrightOwnerAssetType> CopyrightOwnerAssetTypeList = this.copyrightOwnerAssetTypeService.list(Wrappers.<CopyrightOwnerAssetType>lambdaQuery().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, copyrightOwner.getId())); List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = this.copyrightOwnerVideoContentCatService.list(Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, copyrightOwner.getId()));
if (!CopyrightOwnerAssetTypeList.isEmpty()) { if (!copyrightOwnerVideoContentCatList.isEmpty()) {
Set<String> idList = CopyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).collect(Collectors.toSet()); Set<String> idList = copyrightOwnerVideoContentCatList.stream().map(CopyrightOwnerVideoContentCat::getVideoContentCatId).collect(Collectors.toSet());
List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(idList); List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(idList);
String assetTypeNameList = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、")); String videoContentCatNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNameList); copyrightOwner.setVideoContentCatNames(videoContentCatNames);
} }
} else if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(genericPageParam.getOwnerType())) { } else if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(genericPageParam.getOwnerType())) {
LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getBoardCopyrightOwnerId, copyrightOwner.getId()); LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getBoardCopyrightOwnerId, copyrightOwner.getId());
List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper); List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper);
if (!exhibitionBoardList.isEmpty()) { if (!exhibitionBoardList.isEmpty()) {
Set<String> assetTypeIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getAssetTypeId).collect(Collectors.toSet()); Set<String> videoContentCatIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getVideoContentCatId).collect(Collectors.toSet());
List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(assetTypeIdList); List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(videoContentCatIdList);
String assetTypeNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、")); String videoContentCatNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNames); copyrightOwner.setVideoContentCatNames(videoContentCatNames);
} }
} }
} }
...@@ -209,16 +197,16 @@ public class CopyrightOwnerController extends BaseController { ...@@ -209,16 +197,16 @@ public class CopyrightOwnerController extends BaseController {
public Map<String, Object> getById(@PathVariable("id") String id) { public Map<String, Object> getById(@PathVariable("id") String id) {
CopyrightOwner copyrightOwner = copyrightOwnerService.getById(id); CopyrightOwner copyrightOwner = copyrightOwnerService.getById(id);
String ownerType = copyrightOwner.getOwnerType(); String ownerType = copyrightOwner.getOwnerType();
if (CopyrightOwnerTypeEnum.ASSET.name().equals(ownerType)) { if (CopyrightOwnerTypeEnum.VIDEO_CONTENT.name().equals(ownerType)) {
LambdaQueryWrapper<CopyrightOwnerAssetType> lambdaQueryWrapper = Wrappers.<CopyrightOwnerAssetType>lambdaQuery().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, id); LambdaQueryWrapper<CopyrightOwnerVideoContentCat> lambdaQueryWrapper = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
List<CopyrightOwnerAssetType> copyrightOwnerAssetTypeList = this.copyrightOwnerAssetTypeService.list(lambdaQueryWrapper); final List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = this.copyrightOwnerVideoContentCatService.list(lambdaQueryWrapper);
if (!copyrightOwnerAssetTypeList.isEmpty()) { if (!copyrightOwnerVideoContentCatList.isEmpty()) {
List<String> assetTypeIdArrayList = copyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).distinct().collect(Collectors.toList()); List<String> videoContentCatIdList = copyrightOwnerVideoContentCatList.stream().map(CopyrightOwnerVideoContentCat::getVideoContentCatId).distinct().collect(Collectors.toList());
copyrightOwner.setAssetTypeIdList(assetTypeIdArrayList); copyrightOwner.setVideoContentCatIdList(videoContentCatIdList);
final List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(assetTypeIdArrayList); final List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(videoContentCatIdList);
if (!videoContentCatList.isEmpty()) { if (!videoContentCatList.isEmpty()) {
final List<String> assetTypeNameList = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.toList()); final List<String> videoContentCatNameList = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.toList());
copyrightOwner.setAssetTypeNameList(assetTypeNameList); copyrightOwner.setVideoContentCatNameList(videoContentCatNameList);
} }
} }
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerAssetTypeMapper"> <mapper namespace="cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerVideoContentCatMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="copyright_owner_id" property="copyrightOwnerId" /> <result column="copyright_owner_id" property="copyrightOwnerId"/>
<result column="asset_type_id" property="assetTypeId" /> <result column="video_content_cat_id" property="videoContentCatId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, copyright_owner_id, asset_type_id id, copyright_owner_id, video_content_cat_id
</sql> </sql>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment