Commit f7229779 authored by nie'hong's avatar nie'hong

修改-新建展板除名称外可为空

parent 181cd6fc
...@@ -75,12 +75,12 @@ public class ExhibitionBoard implements Serializable { ...@@ -75,12 +75,12 @@ public class ExhibitionBoard implements Serializable {
@ApiModelProperty("展板内容图片URL") @ApiModelProperty("展板内容图片URL")
@TableField("cover") @TableField("cover")
@NotBlank(message = "展板图片URL不能为空", groups = {Add.class, Update.class}) // @NotBlank(message = "展板图片URL不能为空", groups = {Add.class, Update.class})
private String cover; private String cover;
@ApiModelProperty("展板内容二维码URL") @ApiModelProperty("展板内容二维码URL")
@TableField("qrcode_url") @TableField("qrcode_url")
@NotBlank(message = "展板二维码URL不能为空", groups = {Add.class, Update.class}) // @NotBlank(message = "展板二维码URL不能为空", groups = {Add.class, Update.class})
private String qrcodeUrl; private String qrcodeUrl;
@ApiModelProperty("展板内容简介") @ApiModelProperty("展板内容简介")
......
...@@ -145,7 +145,7 @@ public class AssetController extends BaseController { ...@@ -145,7 +145,7 @@ public class AssetController extends BaseController {
for (Asset asset : assetList) { for (Asset asset : assetList) {
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(); ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
FastDFSUtils.downloadFile(asset.getFileUrlCrypto(), byteOutputStream); FastDFSUtils.downloadFile(asset.getFileUrlCrypto(), byteOutputStream);
map.put(asset.getId(), new ByteArrayInputStream(byteOutputStream.toByteArray())); map.put(asset.getFileNameCrypto(), new ByteArrayInputStream(byteOutputStream.toByteArray()));
} }
ZipUtil.zip(response.getOutputStream(), map.keySet().toArray(new String[0]), map.values().toArray(new InputStream[0])); ZipUtil.zip(response.getOutputStream(), map.keySet().toArray(new String[0]), map.values().toArray(new InputStream[0]));
} }
......
...@@ -520,11 +520,11 @@ public class LearningContentController extends BaseController { ...@@ -520,11 +520,11 @@ public class LearningContentController extends BaseController {
for (ExhibitionBoard exhibitionBoard : exhibitionBoardList) { for (ExhibitionBoard exhibitionBoard : exhibitionBoardList) {
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId(); String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
if (exhibitionBoardCatId != null) { if (StringUtils.isNotEmpty(exhibitionBoardCatId)) {
exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName()); exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName());
} }
String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId(); String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId();
if (boardCopyrightOwnerId != null) { if (StringUtils.isNotEmpty(boardCopyrightOwnerId)) {
final CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(boardCopyrightOwnerId); final CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(boardCopyrightOwnerId);
if (copyrightOwner != null) { if (copyrightOwner != null) {
exhibitionBoard.setBoardCopyrightOwnerName(copyrightOwner.getName()); exhibitionBoard.setBoardCopyrightOwnerName(copyrightOwner.getName());
...@@ -592,6 +592,7 @@ public class LearningContentController extends BaseController { ...@@ -592,6 +592,7 @@ public class LearningContentController extends BaseController {
learningContent.setLearningProjectName(learningProject.getName()); learningContent.setLearningProjectName(learningProject.getName());
} }
// 学习内容的展板版权方
final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList(); final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList();
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) { if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
final List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList); final List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList);
...@@ -599,6 +600,7 @@ public class LearningContentController extends BaseController { ...@@ -599,6 +600,7 @@ public class LearningContentController extends BaseController {
learningContent.setCopyrightOwnerNameList(copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.toList())); learningContent.setCopyrightOwnerNameList(copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.toList()));
} }
// 学习内容的展板分类
final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardCatIdList(); final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardCatIdList();
if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) { if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) {
final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList); final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
...@@ -606,6 +608,7 @@ public class LearningContentController extends BaseController { ...@@ -606,6 +608,7 @@ public class LearningContentController extends BaseController {
learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList())); learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList()));
} }
// 学习内容的展板列表
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList(); final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) { if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.listByIds(exhibitionBoardIdList); final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.listByIds(exhibitionBoardIdList);
...@@ -620,13 +623,13 @@ public class LearningContentController extends BaseController { ...@@ -620,13 +623,13 @@ public class LearningContentController extends BaseController {
exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName()); exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName());
} }
String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId(); String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId();
if (boardCopyrightOwnerId != null) { if (StringUtils.isNotEmpty(boardCopyrightOwnerId )) {
final CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(boardCopyrightOwnerId); final CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(boardCopyrightOwnerId);
if (copyrightOwner != null) { if (copyrightOwner != null) {
exhibitionBoard.setBoardCopyrightOwnerName(copyrightOwner.getName()); exhibitionBoard.setBoardCopyrightOwnerName(copyrightOwner.getName());
} }
} }
if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) { if (StringUtils.isNotEmpty(exhibitionBoard.getVideoContentCopyrightOwnerId() )) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName(); String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setVideoContentCopyrightOwnerName(name); exhibitionBoard.setVideoContentCopyrightOwnerName(name);
} }
...@@ -645,7 +648,7 @@ public class LearningContentController extends BaseController { ...@@ -645,7 +648,7 @@ public class LearningContentController extends BaseController {
exhibitionBoard.setDatumList(datumList); exhibitionBoard.setDatumList(datumList);
String videoContentId = exhibitionBoard.getVideoContentId(); String videoContentId = exhibitionBoard.getVideoContentId();
if (videoContentId != null) { if (StringUtils.isNotEmpty(videoContentId)) {
final VideoContent videoContent = this.videoContentService.getOne(Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getId, videoContentId)); final VideoContent videoContent = this.videoContentService.getOne(Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getId, videoContentId));
if (videoContent != null) { if (videoContent != null) {
assetQueryWrapper.clear(); assetQueryWrapper.clear();
......
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