Commit 0a8d9a38 authored by liqin's avatar liqin 💬

bug fixed

parent 346e6661
...@@ -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" "copyright_owner_board_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.CopyrightOwnerBoardType;
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.CopyrightOwnerBoardCat;
/** /**
* <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-12
*/ */
@Repository public interface CopyrightOwnerBoardCatMapper extends BaseMapper<CopyrightOwnerBoardCat> {
public interface CopyrightOwnerBoardTypeMapper extends BaseMapper<CopyrightOwnerBoardType> {
} }
...@@ -89,4 +89,16 @@ public class CopyrightOwner implements Serializable { ...@@ -89,4 +89,16 @@ public class CopyrightOwner implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String videoContentCatNames; private String videoContentCatNames;
@ApiModelProperty("展板分类ID集合(详情使用)")
@TableField(exist = false)
private List<String> boardCatIdList;
@ApiModelProperty("展板分类类名称集合(详情使用)")
@TableField(exist = false)
private List<String> boardCatNameList;
@ApiModelProperty("展板分类名称(列表使用)")
@TableField(exist = false)
private String boardCatNames;
} }
...@@ -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-18 * @since 2021-04-12
*/ */
@Data @Data
@Builder @Builder
...@@ -29,14 +29,14 @@ import java.io.Serializable; ...@@ -29,14 +29,14 @@ import java.io.Serializable;
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("copyright_owner_board_type") @TableName("copyright_owner_board_cat")
@ApiModel(value = "版权方展板分类", description = "版权方展板分类") @ApiModel(value = "版权方展板分类", description = "版权方展板分类")
public class CopyrightOwnerBoardType implements Serializable { public class CopyrightOwnerBoardCat implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "ID不能为空", groups = {Update.class}) @NotNull(message = "不能为空", groups = {Update.class})
private String id; private String id;
@ApiModelProperty("版权方ID") @ApiModelProperty("版权方ID")
...@@ -45,8 +45,8 @@ public class CopyrightOwnerBoardType implements Serializable { ...@@ -45,8 +45,8 @@ public class CopyrightOwnerBoardType implements Serializable {
private String copyrightOwnerId; private String copyrightOwnerId;
@ApiModelProperty("展板分类ID") @ApiModelProperty("展板分类ID")
@TableField("board_type_id") @TableField("board_cat_id")
@NotBlank(message = "展板分类ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "展板分类ID不能为空", groups = {Add.class, Update.class})
private String boardTypeId; private String boardCatId;
} }
package cn.wisenergy.chnmuseum.party.service; package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardType; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat;
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-12
*/ */
public interface CopyrightOwnerBoardTypeService extends IService<CopyrightOwnerBoardType> { public interface CopyrightOwnerBoardCatService extends IService<CopyrightOwnerBoardCat> {
} }
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerBoardTypeMapper; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardType; import cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerBoardCatMapper;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoardTypeService; import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoardCatService;
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;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
/** /**
* <pre> * <pre>
...@@ -13,10 +16,13 @@ import org.springframework.stereotype.Service; ...@@ -13,10 +16,13 @@ import org.springframework.stereotype.Service;
* </pre> * </pre>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-18 * @since 2021-04-12
*/ */
@Slf4j @Slf4j
@Service @Service
public class CopyrightOwnerBoardTypeServiceImpl extends ServiceImpl<CopyrightOwnerBoardTypeMapper, CopyrightOwnerBoardType> implements CopyrightOwnerBoardTypeService { public class CopyrightOwnerBoardCatServiceImpl extends ServiceImpl<CopyrightOwnerBoardCatMapper, CopyrightOwnerBoardCat> implements CopyrightOwnerBoardCatService {
@Autowired
private CopyrightOwnerBoardCatMapper copyrightOwnerBoardCatMapper;
} }
...@@ -26,7 +26,6 @@ import javax.annotation.Resource; ...@@ -26,7 +26,6 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -55,6 +54,12 @@ public class CopyrightOwnerController extends BaseController { ...@@ -55,6 +54,12 @@ public class CopyrightOwnerController extends BaseController {
@Resource @Resource
private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService; private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
...@@ -77,6 +82,18 @@ public class CopyrightOwnerController extends BaseController { ...@@ -77,6 +82,18 @@ public class CopyrightOwnerController extends BaseController {
this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList); this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList);
} }
final List<String> boardCatIdList = copyrightOwner.getBoardCatIdList();
if (boardCatIdList != null && !boardCatIdList.isEmpty()) {
List<CopyrightOwnerBoardCat> copyrightOwnerBoardCatList = new ArrayList<>();
for (String boardCatId : boardCatIdList) {
copyrightOwnerBoardCatList.add(CopyrightOwnerBoardCat.builder()
.boardCatId(boardCatId)
.copyrightOwnerId(copyrightOwner.getId())
.build());
}
this.copyrightOwnerBoardCatService.saveBatch(copyrightOwnerBoardCatList);
}
// 返回操作结果 // 返回操作结果
if (result) { if (result) {
return getSuccessResult(); return getSuccessResult();
...@@ -106,6 +123,22 @@ public class CopyrightOwnerController extends BaseController { ...@@ -106,6 +123,22 @@ public class CopyrightOwnerController extends BaseController {
} }
this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList); this.copyrightOwnerVideoContentCatService.saveBatch(copyrightOwnerVideoContentCatList);
} }
final List<String> boardCatIdList = copyrightOwner.getBoardCatIdList();
if (boardCatIdList != null && !boardCatIdList.isEmpty()) {
LambdaUpdateWrapper<CopyrightOwnerBoardCat> updateWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, copyrightOwner.getId());
this.copyrightOwnerBoardCatService.remove(updateWrapper);
List<CopyrightOwnerBoardCat> copyrightOwnerBoardCatList = new ArrayList<>();
for (String boardCatId : boardCatIdList) {
copyrightOwnerBoardCatList.add(CopyrightOwnerBoardCat.builder()
.boardCatId(boardCatId)
.copyrightOwnerId(copyrightOwner.getId())
.build());
}
this.copyrightOwnerBoardCatService.saveBatch(copyrightOwnerBoardCatList);
}
if (flag) { if (flag) {
return getSuccessResult(); return getSuccessResult();
} }
...@@ -120,9 +153,7 @@ public class CopyrightOwnerController extends BaseController { ...@@ -120,9 +153,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation(value = "获取版权方全部列表(无分页)", notes = "获取版权方全部列表(无分页)") @ApiOperation(value = "获取版权方全部列表(无分页)", notes = "获取版权方全部列表(无分页)")
public Map<String, Object> getCopyrightOwnerList(@RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum) { public Map<String, Object> getCopyrightOwnerList(@RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum) {
LambdaQueryWrapper<CopyrightOwner> lambdaQueryWrapper = Wrappers.<CopyrightOwner>lambdaQuery().eq(CopyrightOwner::getOwnerType, copyrightOwnerTypeEnum.name()); LambdaQueryWrapper<CopyrightOwner> lambdaQueryWrapper = Wrappers.<CopyrightOwner>lambdaQuery().eq(CopyrightOwner::getOwnerType, copyrightOwnerTypeEnum.name());
lambdaQueryWrapper.eq(CopyrightOwner::getDeleted, false); lambdaQueryWrapper.le(CopyrightOwner::getExpireDateStart, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis())).ge(CopyrightOwner::getExpireDateEnd, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis()));
lambdaQueryWrapper.le(CopyrightOwner::getExpireDateStart, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis()))
.ge(CopyrightOwner::getExpireDateEnd, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis()));
lambdaQueryWrapper.orderByDesc(CopyrightOwner::getCreateTime); lambdaQueryWrapper.orderByDesc(CopyrightOwner::getCreateTime);
List<CopyrightOwner> copyrightOwnerList = copyrightOwnerService.list(lambdaQueryWrapper); List<CopyrightOwner> copyrightOwnerList = copyrightOwnerService.list(lambdaQueryWrapper);
return getResult(copyrightOwnerList); return getResult(copyrightOwnerList);
...@@ -148,8 +179,8 @@ public class CopyrightOwnerController extends BaseController { ...@@ -148,8 +179,8 @@ public class CopyrightOwnerController extends BaseController {
} }
// 根据创建时间区间检索 // 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) { if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(CopyrightOwner::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0)) queryWrapper.ge(CopyrightOwner::getExpireDateEnd, genericPageParam.getEndDate().atTime(23, 59, 59))
.le(CopyrightOwner::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59)); .le(CopyrightOwner::getExpireDateStart, genericPageParam.getStartDate().atTime(0, 0, 0));
} }
// 设置排序规则 // 设置排序规则
queryWrapper.orderByDesc(CopyrightOwner::getCreateTime); queryWrapper.orderByDesc(CopyrightOwner::getCreateTime);
...@@ -168,19 +199,18 @@ public class CopyrightOwnerController extends BaseController { ...@@ -168,19 +199,18 @@ public class CopyrightOwnerController extends BaseController {
if (CopyrightOwnerTypeEnum.VIDEO_CONTENT.name().equals(genericPageParam.getOwnerType())) { if (CopyrightOwnerTypeEnum.VIDEO_CONTENT.name().equals(genericPageParam.getOwnerType())) {
List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = this.copyrightOwnerVideoContentCatService.list(Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, copyrightOwner.getId())); List<CopyrightOwnerVideoContentCat> copyrightOwnerVideoContentCatList = this.copyrightOwnerVideoContentCatService.list(Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, copyrightOwner.getId()));
if (!copyrightOwnerVideoContentCatList.isEmpty()) { if (!copyrightOwnerVideoContentCatList.isEmpty()) {
Set<String> idList = copyrightOwnerVideoContentCatList.stream().map(CopyrightOwnerVideoContentCat::getVideoContentCatId).collect(Collectors.toSet()); final List<String> idList = copyrightOwnerVideoContentCatList.stream().map(CopyrightOwnerVideoContentCat::getVideoContentCatId).distinct().collect(Collectors.toList());
List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(idList); List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(idList);
String videoContentCatNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、")); String videoContentCatNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、"));
copyrightOwner.setVideoContentCatNames(videoContentCatNames); 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()); final List<CopyrightOwnerBoardCat> copyrightOwnerBoardCatList = this.copyrightOwnerBoardCatService.list(Wrappers.<CopyrightOwnerBoardCat>lambdaQuery().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, copyrightOwner.getId()));
List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper); if (!copyrightOwnerBoardCatList.isEmpty()) {
if (!exhibitionBoardList.isEmpty()) { List<String> idList = copyrightOwnerBoardCatList.stream().map(CopyrightOwnerBoardCat::getBoardCatId).distinct().collect(Collectors.toList());
Set<String> videoContentCatIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getVideoContentCatId).collect(Collectors.toSet()); final List<ExhibitionBoardCat> exhibitionBoardCatList = this.exhibitionBoardCatService.listByIds(idList);
List<VideoContentCat> videoContentCatList = this.videoContentCatService.listByIds(videoContentCatIdList); final String exhibitionBoardCatNames = exhibitionBoardCatList.stream().map(ExhibitionBoardCat::getName).collect(Collectors.joining("、"));
String videoContentCatNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、")); copyrightOwner.setBoardCatNames(exhibitionBoardCatNames);
copyrightOwner.setVideoContentCatNames(videoContentCatNames);
} }
} }
} }
...@@ -209,6 +239,18 @@ public class CopyrightOwnerController extends BaseController { ...@@ -209,6 +239,18 @@ public class CopyrightOwnerController extends BaseController {
} }
} }
} }
if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(ownerType)) {
final List<CopyrightOwnerBoardCat> copyrightOwnerBoardCatList = this.copyrightOwnerBoardCatService.list(Wrappers.<CopyrightOwnerBoardCat>lambdaQuery().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, id));
if (!copyrightOwnerBoardCatList.isEmpty()) {
final List<String> boardCatIdList = copyrightOwnerBoardCatList.stream().map(CopyrightOwnerBoardCat::getBoardCatId).distinct().collect(Collectors.toList());
copyrightOwner.setBoardCatIdList(boardCatIdList);
final List<ExhibitionBoardCat> exhibitionBoardCatList = this.exhibitionBoardCatService.listByIds(boardCatIdList);
if (!exhibitionBoardCatList.isEmpty()) {
final List<String> exhibitionBoardCatNameList = exhibitionBoardCatList.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList());
copyrightOwner.setBoardCatNameList(exhibitionBoardCatNameList);
}
}
}
return getResult(copyrightOwner); return getResult(copyrightOwner);
} }
...@@ -230,6 +272,8 @@ public class CopyrightOwnerController extends BaseController { ...@@ -230,6 +272,8 @@ public class CopyrightOwnerController extends BaseController {
updateWrapper1.set(ExhibitionBoard::getDeleted, true); updateWrapper1.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper1); this.exhibitionBoardService.update(updateWrapper1);
//todo 删除版权方关联表
return getSuccessResult(); return getSuccessResult();
} }
......
...@@ -5,8 +5,10 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; ...@@ -5,8 +5,10 @@ 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.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardCat; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerBoardCatService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService; import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardCatService; import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardCatService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService; import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
...@@ -30,6 +32,7 @@ import javax.annotation.Resource; ...@@ -30,6 +32,7 @@ import javax.annotation.Resource;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -53,6 +56,8 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -53,6 +56,8 @@ public class ExhibitionBoardCatController extends BaseController {
private ExhibitionBoardCatService exhibitionBoardCatService; private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@PostMapping("/save") @PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save") @RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
...@@ -111,14 +116,27 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -111,14 +116,27 @@ public class ExhibitionBoardCatController extends BaseController {
updateWrapper.set(ExhibitionBoard::getDeleted, true); updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper); this.exhibitionBoardService.update(updateWrapper);
//todo 删除中间关联表
return getSuccessResult(); return getSuccessResult();
} }
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "copyrightOwnerId", value = "展板内容版权方ID", paramType = "query", dataType = "String")
})
@GetMapping("/getList") @GetMapping("/getList")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:list") @RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:list")
@ApiOperation(value = "获取展板分类全部列表(无分页)", notes = "获取展板分类全部列表(无分页)") @ApiOperation(value = "获取展板分类全部列表(无分页)", notes = "获取展板分类全部列表(无分页)")
public Map<String, Object> getExhibitionBoardCatList() { public Map<String, Object> getExhibitionBoardCatList(@RequestParam(value = "copyrightOwnerId", required = false) String copyrightOwnerId) {
List<ExhibitionBoardCat> exhibitionBoardCatList = exhibitionBoardCatService.list(Wrappers.<ExhibitionBoardCat>lambdaQuery().eq(ExhibitionBoardCat::getDeleted,false).orderByDesc(ExhibitionBoardCat::getCreateTime)); final LambdaQueryWrapper<ExhibitionBoardCat> exhibitionBoardCatLambdaQueryWrapper = Wrappers.<ExhibitionBoardCat>lambdaQuery().orderByDesc(ExhibitionBoardCat::getCreateTime);
if (StringUtils.isNotBlank(copyrightOwnerId)) {
final LambdaQueryWrapper<CopyrightOwnerBoardCat> queryWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaQuery().eq(CopyrightOwnerBoardCat::getCopyrightOwnerId, copyrightOwnerId);
queryWrapper.select(CopyrightOwnerBoardCat::getBoardCatId);
final List<String> boardCatIdList = this.copyrightOwnerBoardCatService.listObjs(queryWrapper, Objects::toString);
exhibitionBoardCatLambdaQueryWrapper.in(ExhibitionBoardCat::getId, boardCatIdList);
}
List<ExhibitionBoardCat> exhibitionBoardCatList = exhibitionBoardCatService.list(exhibitionBoardCatLambdaQueryWrapper);
return getResult(exhibitionBoardCatList); return getResult(exhibitionBoardCatList);
} }
......
...@@ -3,9 +3,11 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -3,9 +3,11 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
import cn.wisenergy.chnmuseum.party.model.VideoContent; import cn.wisenergy.chnmuseum.party.model.VideoContent;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat; import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService; import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentCatService; import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentService; import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
...@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -43,6 +46,9 @@ import java.util.stream.Collectors; ...@@ -43,6 +46,9 @@ import java.util.stream.Collectors;
@Api(tags = {"视频内容分类接口"}) @Api(tags = {"视频内容分类接口"})
public class VideoContentCatController extends BaseController { public class VideoContentCatController extends BaseController {
@Resource
private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource @Resource
private VideoContentCatService videoContentCatService; private VideoContentCatService videoContentCatService;
...@@ -77,11 +83,22 @@ public class VideoContentCatController extends BaseController { ...@@ -77,11 +83,22 @@ public class VideoContentCatController extends BaseController {
return getFailResult(); return getFailResult();
} }
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "copyrightOwnerId", value = "视频内容版权方ID", paramType = "query", dataType = "String")
})
@GetMapping("/getList") @GetMapping("/getList")
@RequiresAuthentication //@RequiresPermissions("video:content:cat:list") @RequiresAuthentication //@RequiresPermissions("video:content:cat:list")
@ApiOperation(value = "获取视频内容分类全部列表(无分页)", notes = "获取视频内容分类全部列表(无分页)") @ApiOperation(value = "获取视频内容分类全部列表(无分页)", notes = "获取视频内容分类全部列表(无分页)")
public Map<String, Object> getVideoContentCatList() { public Map<String, Object> getVideoContentCatList(@RequestParam(value = "copyrightOwnerId", required = false) String copyrightOwnerId) {
List<VideoContentCat> videoContentCatList = videoContentCatService.list(Wrappers.<VideoContentCat>lambdaQuery().eq(VideoContentCat::getDeleted,false).orderByDesc(VideoContentCat::getCreateTime)); final LambdaQueryWrapper<VideoContentCat> videoContentCatLambdaQueryWrapper = Wrappers.<VideoContentCat>lambdaQuery().orderByDesc(VideoContentCat::getCreateTime);
if (StringUtils.isNotBlank(copyrightOwnerId)) {
final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> queryWrapper = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, copyrightOwnerId);
queryWrapper.select(CopyrightOwnerVideoContentCat::getVideoContentCatId);
final List<String> videoContentCatIdList = this.copyrightOwnerVideoContentCatService.listObjs(queryWrapper, Objects::toString);
videoContentCatLambdaQueryWrapper.in(VideoContentCat::getId, videoContentCatIdList);
}
List<VideoContentCat> videoContentCatList = videoContentCatService.list(videoContentCatLambdaQueryWrapper);
return getResult(videoContentCatList); return getResult(videoContentCatList);
} }
...@@ -153,6 +170,8 @@ public class VideoContentCatController extends BaseController { ...@@ -153,6 +170,8 @@ public class VideoContentCatController extends BaseController {
updateWrapper.set(VideoContent::getDeleted, true); updateWrapper.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper); this.videoContentService.update(updateWrapper);
//todo 删除中间关联表
return getSuccessResult(); return getSuccessResult();
} }
......
<?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.CopyrightOwnerBoardTypeMapper"> <mapper namespace="cn.wisenergy.chnmuseum.party.mapper.CopyrightOwnerBoardCatMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardType"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.CopyrightOwnerBoardCat">
<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="board_type_id" property="boardTypeId" /> <result column="board_cat_id" property="boardCatId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, copyright_owner_id, board_type_id id, copyright_owner_id, board_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