Commit bc8b34d2 authored by liqin's avatar liqin 💬

bug fixed

parent 97bdfe9a
...@@ -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" "asset_tmp"
}; };
// 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.common.vo; package cn.wisenergy.chnmuseum.party.common.vo;
import cn.wisenergy.chnmuseum.party.model.Asset; import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.AssetTmp;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -37,6 +38,9 @@ public class BatchUploadResVO { ...@@ -37,6 +38,9 @@ public class BatchUploadResVO {
@ApiModelProperty("成功上传的文件集合") @ApiModelProperty("成功上传的文件集合")
private Set<Asset> fileList; private Set<Asset> fileList;
@ApiModelProperty("成功上传的文件集合(修改时使用)")
private Set<AssetTmp> fileTmpList;
@Data @Data
public static class HandleResult { public static class HandleResult {
......
package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.AssetTmp;
/**
* <pre>
* 文件资产临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-18
*/
public interface AssetTmpMapper extends BaseMapper<AssetTmp> {
}
package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardTmp;
/**
* <pre>
* 展板临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface ExhibitionBoardTmpMapper extends BaseMapper<ExhibitionBoardTmp> {
}
package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.LearningContentTmp;
/**
* <pre>
* 学习内容临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface LearningContentTmpMapper extends BaseMapper<LearningContentTmp> {
}
package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.VideoContentTmp;
/**
* <pre>
* 视频内容临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface VideoContentTmpMapper extends BaseMapper<VideoContentTmp> {
}
package cn.wisenergy.chnmuseum.party.model;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 文件资产临时
* </p>
*
* @author Danny Lee
* @since 2021-04-18
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("asset_tmp")
@ApiModel(value = "文件资产临时", description = "文件资产临时")
public class AssetTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("文件资产ID")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "文件资产ID不能为空", groups = {Add.class, Update.class})
private String id;
@ApiModelProperty("所属项ID")
@TableField("ref_item_id")
private String refItemId;
@ApiModelProperty("原始文件名")
@TableField("file_name")
private String fileName;
@ApiModelProperty("加密后文件名")
@TableField("file_name_crypto")
private String fileNameCrypto;
@ApiModelProperty("扩展名")
@TableField("file_ext_name")
private String fileExtName;
@ApiModelProperty("文件类型")
@TableField("file_type")
private String fileType;
@ApiModelProperty("文件分类")
@TableField("file_cat")
private String fileCat;
@ApiModelProperty("文件大小(B)")
@TableField("file_size")
private Long fileSize;
@ApiModelProperty("下载链接")
@TableField("file_url")
private String fileUrl;
@ApiModelProperty("加密链接")
@TableField("file_url_crypto")
private String fileUrlCrypto;
@ApiModelProperty("视频缩略图")
@TableField("thumbnail")
private String thumbnail;
@ApiModelProperty("语言")
@TableField("language")
private String language;
@ApiModelProperty("MD5")
@TableField("md5")
private String md5;
@TableField("crc32")
private Long crc32;
@TableField("video_content_name")
private String videoContentName;
@ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("修改日期")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
}
...@@ -158,10 +158,18 @@ public class ExhibitionBoard implements Serializable { ...@@ -158,10 +158,18 @@ public class ExhibitionBoard implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<Asset> audioList; private List<Asset> audioList;
@ApiModelProperty("展板视频(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> audioTmpList;
@ApiModelProperty("参考资料列表") @ApiModelProperty("参考资料列表")
@TableField(exist = false) @TableField(exist = false)
private List<Asset> datumList; private List<Asset> datumList;
@ApiModelProperty("参考资料列表(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> datumTmpList;
@ApiModelProperty("审核意见记录") @ApiModelProperty("审核意见记录")
@TableField(exist = false) @TableField(exist = false)
private List<Audit> auditHistoryList; private List<Audit> auditHistoryList;
......
package cn.wisenergy.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 展板临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("exhibition_board_tmp")
public class ExhibitionBoardTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
package cn.wisenergy.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 学习内容临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("learning_content_tmp")
public class LearningContentTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
...@@ -93,6 +93,10 @@ public class VideoContent implements Serializable { ...@@ -93,6 +93,10 @@ public class VideoContent implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<Asset> videoFileList; private List<Asset> videoFileList;
@ApiModelProperty("视频文件信息列表(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> videoFileTmpList;
@ApiModelProperty("审核意见记录") @ApiModelProperty("审核意见记录")
@TableField(exist = false) @TableField(exist = false)
private List<Audit> auditHistoryList; private List<Audit> auditHistoryList;
......
package cn.wisenergy.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 视频内容临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("video_content_tmp")
public class VideoContentTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.AssetTmp;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 文件资产临时 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-04-18
*/
public interface AssetTmpService extends IService<AssetTmp> {
}
package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardTmp;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 展板临时 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface ExhibitionBoardTmpService extends IService<ExhibitionBoardTmp> {
}
package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.LearningContentTmp;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 学习内容临时 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface LearningContentTmpService extends IService<LearningContentTmp> {
}
package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.VideoContentTmp;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视频内容临时 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface VideoContentTmpService extends IService<VideoContentTmp> {
}
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.AssetTmpMapper;
import cn.wisenergy.chnmuseum.party.model.AssetTmp;
import cn.wisenergy.chnmuseum.party.service.AssetTmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* <pre>
* 文件资产临时 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-04-18
*/
@Slf4j
@Service
public class AssetTmpServiceImpl extends ServiceImpl<AssetTmpMapper, AssetTmp> implements AssetTmpService {
}
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum; import cn.hutool.core.bean.BeanUtil;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum; import cn.wisenergy.chnmuseum.party.common.enums.*;
import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException; import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.mapper.AuditMapper; import cn.wisenergy.chnmuseum.party.mapper.AuditMapper;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -34,6 +35,12 @@ import java.util.List; ...@@ -34,6 +35,12 @@ import java.util.List;
@Service @Service
public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements AuditService { public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements AuditService {
@Resource
private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@Resource @Resource
private AuditMapper auditMapper; private AuditMapper auditMapper;
...@@ -43,15 +50,30 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -43,15 +50,30 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
@Resource @Resource
private VideoContentService videoContentService; private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
@Resource
private ExhibitionBoardTmpService exhibitionBoardTmpService;
@Resource @Resource
private LearningContentService learningContentService; private LearningContentService learningContentService;
@Resource
private LearningContentTmpService learningContentTmpService;
@Resource @Resource
private LearningContentBoardService learningContentBoardService; private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Override @Override
public Page<Audit> getUserList(Page<Audit> page, TUser user) { public Page<Audit> getUserList(Page<Audit> page, TUser user) {
return page.setRecords(auditMapper.getUserList(page, user)); return page.setRecords(auditMapper.getUserList(page, user));
...@@ -245,15 +267,38 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -245,15 +267,38 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
queryWrapper.select(ExhibitionBoard::getId); queryWrapper.select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString); final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList); this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
this.videoContentTmpService.removeById(videoContentId);
update = this.videoContentService.removeById(videoContentId); update = this.videoContentService.removeById(videoContentId);
break; break;
case ADD: case ADD:
videoContent.setPublished(true); videoContent.setPublished(true);
update = this.videoContentService.updateById(videoContent);; update = this.videoContentService.updateById(videoContent);
break; break;
case EDIT: case EDIT:
videoContent.setPublished(true); final String data = this.videoContentTmpService.getById(videoContentId).getData();
update = this.videoContentService.updateById(videoContent);; final VideoContent one = JSONObject.parseObject(data, VideoContent.class);
final List<String> videoFileIdList = one.getVideoFileIdList();
if (videoFileIdList != null && !videoFileIdList.isEmpty()) {
this.assetService.remove(Wrappers.<Asset>lambdaUpdate().eq(Asset::getRefItemId, videoContentId));
final List<AssetTmp> assetTmpList = this.assetTmpService.list(Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, videoContentId));
for (AssetTmp assetTmp : assetTmpList) {
Asset asset = new Asset();
BeanUtil.copyProperties(assetTmp, asset);
asset.setThumbnail(videoContent.getThumbnail());
asset.setFileType(FileTypeEnum.VIDEO.name());
asset.setFileCat(FileCatEnum.VIDEO_CONTENT.name());
asset.setRefItemId(videoContentId);
this.assetService.save(asset);
if (StringUtils.isBlank(one.getName())) {
videoContent.setName(asset.getVideoContentName());
}
}
}
one.setAuditStatus(audit.getStatus());
one.setPublished(true); //todo
update = this.videoContentService.updateById(one);
this.videoContentTmpService.removeById(videoContentId);
this.assetTmpService.remove(Wrappers.<AssetTmp>lambdaUpdate().eq(AssetTmp::getRefItemId, videoContentId));
break; break;
default: default:
} }
...@@ -287,15 +332,54 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -287,15 +332,54 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
break; break;
case REMOVE: case REMOVE:
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId())); this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId()));
this.exhibitionBoardTmpService.removeById(exhibitionBoardId);
update = this.exhibitionBoardService.removeById(exhibitionBoardId); update = this.exhibitionBoardService.removeById(exhibitionBoardId);
break; break;
case ADD: case ADD:
exhibitionBoard.setPublished(true); exhibitionBoard.setPublished(true);
update = this.exhibitionBoardService.updateById(exhibitionBoard);; update = this.exhibitionBoardService.updateById(exhibitionBoard);
break; break;
case EDIT: case EDIT:
exhibitionBoard.setPublished(true); final String data = this.exhibitionBoardTmpService.getById(exhibitionBoardId).getData();
update = this.exhibitionBoardService.updateById(exhibitionBoard);; final ExhibitionBoard one = JSONObject.parseObject(data, ExhibitionBoard.class);
final List<String> audioIdList = one.getAudioIdList();
if (audioIdList != null && !audioIdList.isEmpty()) {
final LambdaUpdateWrapper<Asset> lambdaUpdateWrapper = Wrappers.<Asset>lambdaUpdate().eq(Asset::getRefItemId, exhibitionBoardId);
lambdaUpdateWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
this.assetService.remove(lambdaUpdateWrapper);
final LambdaQueryWrapper<AssetTmp> assetTmpQueryWrapper = Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, exhibitionBoardId);
assetTmpQueryWrapper.eq(AssetTmp::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
final List<AssetTmp> assetTmpList = this.assetTmpService.list(assetTmpQueryWrapper);
for (AssetTmp assetTmp : assetTmpList) {
Asset asset = new Asset();
BeanUtil.copyProperties(assetTmp, asset);
asset.setFileType(FileTypeEnum.AUDIO.name());
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
asset.setRefItemId(exhibitionBoardId);
this.assetService.save(asset);
}
}
final List<String> datumIdList = one.getDatumIdList();
if (datumIdList != null && !datumIdList.isEmpty()) {
final LambdaUpdateWrapper<Asset> lambdaUpdateWrapper = Wrappers.<Asset>lambdaUpdate().eq(Asset::getRefItemId, exhibitionBoardId);
lambdaUpdateWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
this.assetService.remove(lambdaUpdateWrapper);
final LambdaQueryWrapper<AssetTmp> assetTmpQueryWrapper = Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, exhibitionBoardId);
assetTmpQueryWrapper.eq(AssetTmp::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<AssetTmp> assetTmpList = this.assetTmpService.list(assetTmpQueryWrapper);
for (AssetTmp assetTmp : assetTmpList) {
Asset asset = new Asset();
BeanUtil.copyProperties(assetTmp, asset);
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name());
asset.setRefItemId(exhibitionBoardId);
this.assetService.save(asset);
}
}
one.setAuditStatus(audit.getStatus());
one.setPublished(true); //todo
update = this.exhibitionBoardService.updateById(one);
this.exhibitionBoardTmpService.removeById(exhibitionBoardId);
this.assetTmpService.remove(Wrappers.<AssetTmp>lambdaUpdate().eq(AssetTmp::getRefItemId, exhibitionBoardId));
break; break;
default: default:
} }
...@@ -328,6 +412,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -328,6 +412,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.learningContentService.updateById(learningContent); update = this.learningContentService.updateById(learningContent);
break; break;
case REMOVE: case REMOVE:
this.learningContentTmpService.removeById(learningContentId);
update = this.learningContentService.removeById(learningContentId); update = this.learningContentService.removeById(learningContentId);
break; break;
case ADD: case ADD:
...@@ -335,8 +420,46 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements ...@@ -335,8 +420,46 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.learningContentService.updateById(learningContent); update = this.learningContentService.updateById(learningContent);
break; break;
case EDIT: case EDIT:
learningContent.setPublished(true); final String data = this.learningContentTmpService.getById(learningContentId).getData();
update = this.learningContentService.updateById(learningContent); final LearningContent one = JSONObject.parseObject(data, LearningContent.class);
final List<String> exhibitionBoardCatIdList = one.getExhibitionBoardCatIdList();
if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoardCat> lambdaUpdateWrapper = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, learningContentId);
this.learningContentBoardCatService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardCatId : exhibitionBoardCatIdList) {
LearningContentBoardCat learningContentBoardCat = LearningContentBoardCat.builder().exhibitionBoardCatId(exhibitionBoardCatId).learningContentId(learningContentId).build();
this.learningContentBoardCatService.save(learningContentBoardCat);
}
}
final List<String> copyrightOwnerIdList = one.getCopyrightOwnerIdList();
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentCopyrightOwner> lambdaUpdateWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, learningContentId);
this.learningContentCopyrightOwnerService.remove(lambdaUpdateWrapper);
for (String copyrightOwnerId : copyrightOwnerIdList) {
LearningContentCopyrightOwner contentCopyrightOwner = LearningContentCopyrightOwner.builder().copyrightOwnerId(copyrightOwnerId).learningContentId(learningContentId).build();
this.learningContentCopyrightOwnerService.save(contentCopyrightOwner);
}
}
final List<String> exhibitionBoardIdList = one.getExhibitionBoardIdList();
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoard> lambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, learningContentId);
this.learningContentBoardService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardId : exhibitionBoardIdList) {
LearningContentBoard learningContentBoard = LearningContentBoard.builder()
.learningContentId(learningContentId)
.exhibitionBoardCatId(this.exhibitionBoardService.getById(exhibitionBoardId).getExhibitionBoardCatId())
.exhibitionBoardId(exhibitionBoardId)
.build();
this.learningContentBoardService.save(learningContentBoard);
}
}
one.setAuditStatus(audit.getStatus());
one.setPublished(true); //todo
update = this.learningContentService.updateById(one);
this.learningContentTmpService.removeById(learningContentId);
break; break;
default: default:
} }
......
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.ExhibitionBoardTmpMapper;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoardTmp;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardTmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* <pre>
* 展板临时 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Slf4j
@Service
public class ExhibitionBoardTmpServiceImpl extends ServiceImpl<ExhibitionBoardTmpMapper, ExhibitionBoardTmp> implements ExhibitionBoardTmpService {
}
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.LearningContentTmpMapper;
import cn.wisenergy.chnmuseum.party.model.LearningContentTmp;
import cn.wisenergy.chnmuseum.party.service.LearningContentTmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* <pre>
* 学习内容临时 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Slf4j
@Service
public class LearningContentTmpServiceImpl extends ServiceImpl<LearningContentTmpMapper, LearningContentTmp> implements LearningContentTmpService {
}
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.mapper.VideoContentTmpMapper;
import cn.wisenergy.chnmuseum.party.model.VideoContentTmp;
import cn.wisenergy.chnmuseum.party.service.VideoContentTmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* <pre>
* 视频内容临时 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Slf4j
@Service
public class VideoContentTmpServiceImpl extends ServiceImpl<VideoContentTmpMapper, VideoContentTmp> implements VideoContentTmpService {
}
...@@ -50,6 +50,8 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -50,6 +50,8 @@ public class ExhibitionBoardCatController extends BaseController {
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
@Resource @Resource
private ExhibitionBoardTmpService exhibitionBoardTmpService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService; private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
...@@ -221,6 +223,10 @@ public class ExhibitionBoardCatController extends BaseController { ...@@ -221,6 +223,10 @@ public class ExhibitionBoardCatController extends BaseController {
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id); LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id);
this.learningContentBoardService.remove(deleteWrapper2); this.learningContentBoardService.remove(deleteWrapper2);
final LambdaQueryWrapper<ExhibitionBoard> exhibitionBoardLambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(exhibitionBoardLambdaQueryWrapper, Object::toString);
this.exhibitionBoardTmpService.removeByIds(exhibitionBoardIdList);
// final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id); // final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCopyrightOwnerId, id);
// updateWrapper.set(VideoContent::getDeleted, true); // updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper); // this.videoContentService.update(updateWrapper);
......
...@@ -10,6 +10,7 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; ...@@ -10,6 +10,7 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -46,6 +47,8 @@ public class ExhibitionBoardController extends BaseController { ...@@ -46,6 +47,8 @@ public class ExhibitionBoardController extends BaseController {
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
@Resource @Resource
private ExhibitionBoardTmpService exhibitionBoardTmpService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService; private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
...@@ -55,6 +58,8 @@ public class ExhibitionBoardController extends BaseController { ...@@ -55,6 +58,8 @@ public class ExhibitionBoardController extends BaseController {
private AuditService auditService; private AuditService auditService;
@Resource @Resource
private AssetService assetService; private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@PostMapping("/save") @PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:save") @RequiresAuthentication //@RequiresPermissions("exhibition:board:save")
...@@ -114,49 +119,16 @@ public class ExhibitionBoardController extends BaseController { ...@@ -114,49 +119,16 @@ public class ExhibitionBoardController extends BaseController {
@ApiOperation(value = "修改展板信息", notes = "修改展板信息") @ApiOperation(value = "修改展板信息", notes = "修改展板信息")
@MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.UPDATE) @MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateExhibitionBoard(@Validated(value = {Update.class}) ExhibitionBoard exhibitionBoard) { public Map<String, Object> updateExhibitionBoard(@Validated(value = {Update.class}) ExhibitionBoard exhibitionBoard) {
TUser user = getcurUser(); final boolean flag = this.exhibitionBoardTmpService.save(ExhibitionBoardTmp.builder().id(exhibitionBoard.getId()).data(JSONObject.toJSONString(exhibitionBoard)).build());
final VideoContent videoContent = this.videoContentService.getById(exhibitionBoard.getVideoContentId());
exhibitionBoard.setVideoContentName(videoContent.getName());
exhibitionBoard.setAuditStatus(AuditStatusEnum.TBC.name());
boolean flag = exhibitionBoardService.updateById(exhibitionBoard);
if (flag) { if (flag) {
final List<String> audioIdList = exhibitionBoard.getAudioIdList(); final ExhibitionBoard one = this.exhibitionBoardService.getById(exhibitionBoard.getId());
if (audioIdList != null && !audioIdList.isEmpty()) { one.setAuditStatus(AuditStatusEnum.TBC.name());
final LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId()); this.exhibitionBoardService.updateById(one);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
final List<Asset> assetList = this.assetService.list(assetQueryWrapper);
final Map<String, String> collect = assetList.stream().collect(Collectors.toMap(Asset::getId, Asset::getFileUrl));
for (String audioId : audioIdList) {
final Asset asset = this.assetService.getById(audioId);
asset.setFileType(FileTypeEnum.AUDIO.name());
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
asset.setRefItemId(exhibitionBoard.getId());
this.assetService.updateById(asset);
collect.remove(audioId);
}
collect.forEach((k, v) -> this.assetService.removeById(k));
}
final List<String> datumIdList = exhibitionBoard.getDatumIdList();
if (datumIdList != null && !datumIdList.isEmpty()) {
final LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<Asset> assetList = this.assetService.list(assetQueryWrapper);
final Map<String, String> collect = assetList.stream().collect(Collectors.toMap(Asset::getId, Asset::getFileUrl));
for (String datumId : datumIdList) {
final Asset asset = this.assetService.getById(datumId);
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name());
asset.setRefItemId(exhibitionBoard.getId());
this.assetService.updateById(asset);
collect.remove(datumId);
}
collect.forEach((k, v) -> this.assetService.removeById(k));
}
final Audit audit = Audit.builder() final Audit audit = Audit.builder()
.content(exhibitionBoard.getName()) .content(exhibitionBoard.getName())
.refItemId(exhibitionBoard.getId()) .refItemId(exhibitionBoard.getId())
.userId(user.getId()) .userId(getcurUser().getId())
.type(AuditTypeEnum.EXHIBITION_BOARD.name()) .type(AuditTypeEnum.EXHIBITION_BOARD.name())
.operation(AuditOperationEnum.EDIT.name()) .operation(AuditOperationEnum.EDIT.name())
.status(AuditStatusEnum.TBC.name()) .status(AuditStatusEnum.TBC.name())
...@@ -166,7 +138,7 @@ public class ExhibitionBoardController extends BaseController { ...@@ -166,7 +138,7 @@ public class ExhibitionBoardController extends BaseController {
this.auditService.save(audit); this.auditService.save(audit);
return getSuccessResult(); return getSuccessResult();
} }
return getFailResult(); return getFailResult("提交失败!上次提交的修改申请已经在审核中");
} }
@PostMapping("/getList") @PostMapping("/getList")
...@@ -349,6 +321,55 @@ public class ExhibitionBoardController extends BaseController { ...@@ -349,6 +321,55 @@ public class ExhibitionBoardController extends BaseController {
exhibitionBoard.setDatumList(datumList); exhibitionBoard.setDatumList(datumList);
exhibitionBoard.setDatumIdList(datumList.stream().map(Asset::getId).collect(Collectors.toList())); exhibitionBoard.setDatumIdList(datumList.stream().map(Asset::getId).collect(Collectors.toList()));
final String videoContentId = exhibitionBoard.getVideoContentId();
if (videoContentId != null) {
final VideoContent videoContent = this.videoContentService.getById(videoContentId);
exhibitionBoard.setVideoContentName(videoContent.getName());
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setVideoList(videoList);
}
return getResult(exhibitionBoard);
}
@ApiOperation(value = "获取展板详情(审核详情使用)", notes = "获取展板详情(审核详情使用)")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path", required = true)
})
@GetMapping("/getAudit/{id}")
@RequiresAuthentication //@RequiresPermissions("video:content:get:id")
@MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.SELECT)
public Map<String, Object> getAuditInfoById(@PathVariable("id") String id) {
final ExhibitionBoard exhibitionBoard = JSONObject.parseObject(exhibitionBoardTmpService.getById(id).getData(), ExhibitionBoard.class);
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
if (exhibitionBoardCatId != null) {
exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName());
}
String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId();
if (boardCopyrightOwnerId != null) {
exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName());
}
if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setVideoContentCopyrightOwnerName(name);
}
LambdaQueryWrapper<AssetTmp> assetTmpQueryWrapper = Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, exhibitionBoard.getId());
assetTmpQueryWrapper.eq(AssetTmp::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
final List<AssetTmp> audioTmpList = this.assetTmpService.list(assetTmpQueryWrapper);
exhibitionBoard.setAudioTmpList(audioTmpList);
exhibitionBoard.setAudioIdList(audioTmpList.stream().map(AssetTmp::getId).collect(Collectors.toList()));
assetTmpQueryWrapper.clear();
assetTmpQueryWrapper = Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, exhibitionBoard.getId());
assetTmpQueryWrapper.eq(AssetTmp::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<AssetTmp> datumTmpList = this.assetTmpService.list(assetTmpQueryWrapper);
exhibitionBoard.setDatumTmpList(datumTmpList);
exhibitionBoard.setDatumIdList(datumTmpList.stream().map(AssetTmp::getId).collect(Collectors.toList()));
final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, id); final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, id);
auditQueryWrapper.select(Audit::getContent); auditQueryWrapper.select(Audit::getContent);
auditQueryWrapper.select(Audit::getType); auditQueryWrapper.select(Audit::getType);
...@@ -367,10 +388,9 @@ public class ExhibitionBoardController extends BaseController { ...@@ -367,10 +388,9 @@ public class ExhibitionBoardController extends BaseController {
final VideoContent videoContent = this.videoContentService.getById(videoContentId); final VideoContent videoContent = this.videoContentService.getById(videoContentId);
exhibitionBoard.setVideoContentName(videoContent.getName()); exhibitionBoard.setVideoContentName(videoContent.getName());
assetQueryWrapper.clear(); final LambdaQueryWrapper<Asset> lambdaQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId); lambdaQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name()); final List<Asset> videoList = this.assetService.list(lambdaQueryWrapper);
final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setVideoList(videoList); exhibitionBoard.setVideoList(videoList);
} }
return getResult(exhibitionBoard); return getResult(exhibitionBoard);
......
...@@ -10,7 +10,9 @@ import cn.wisenergy.chnmuseum.party.common.video.VideoEncryptUtil; ...@@ -10,7 +10,9 @@ import cn.wisenergy.chnmuseum.party.common.video.VideoEncryptUtil;
import cn.wisenergy.chnmuseum.party.common.vo.BatchUploadResVO; import cn.wisenergy.chnmuseum.party.common.vo.BatchUploadResVO;
import cn.wisenergy.chnmuseum.party.common.vo.ImageUploadResult; import cn.wisenergy.chnmuseum.party.common.vo.ImageUploadResult;
import cn.wisenergy.chnmuseum.party.model.Asset; import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.AssetTmp;
import cn.wisenergy.chnmuseum.party.service.AssetService; import cn.wisenergy.chnmuseum.party.service.AssetService;
import cn.wisenergy.chnmuseum.party.service.AssetTmpService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.tobato.fastdfs.domain.fdfs.FileInfo; import com.github.tobato.fastdfs.domain.fdfs.FileInfo;
...@@ -64,6 +66,8 @@ public class FileUploadController extends BaseController { ...@@ -64,6 +66,8 @@ public class FileUploadController extends BaseController {
@Resource @Resource
private AssetService assetService; private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@ApiOperation(value = "根据文件ID刪除文件", notes = "根据文件ID刪除文件") @ApiOperation(value = "根据文件ID刪除文件", notes = "根据文件ID刪除文件")
@DeleteMapping(value = "/delete/{id}") @DeleteMapping(value = "/delete/{id}")
...@@ -229,6 +233,149 @@ public class FileUploadController extends BaseController { ...@@ -229,6 +233,149 @@ public class FileUploadController extends BaseController {
return getResult(batchUploadResVO); return getResult(batchUploadResVO);
} }
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "资料", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true)
})
@PostMapping(value = "/datum/edit/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ApiOperation(value = "展板资料上传(修改时使用)", notes = "展板资料上传(修改时使用)")
public Map<String, Object> uploadDatumByEdit(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files == null || files.length == 0) {
return getFailResult("没有文件可供上传");
}
int successCount = 0;
int failureCount = 0;
List<BatchUploadResVO.HandleResult> handleList = new ArrayList<>();
Set<AssetTmp> datumUrlList = new LinkedHashSet<>();
for (MultipartFile file : files) {
// 当前维度表下线结果
BatchUploadResVO.HandleResult handleResult = new BatchUploadResVO.HandleResult();
// 原始文件名
String originalFilename = file.getOriginalFilename();
if (StringUtils.isBlank(originalFilename)) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件名为空");
failureCount++;
handleList.add(handleResult);
continue;
}
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件" + originalFilename + "大小为0");
failureCount++;
handleList.add(handleResult);
continue;
}
String extName = FilenameUtils.getExtension(originalFilename);
String finalExtName = extName;
boolean anyMatch = Arrays.stream(DATUM_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()));
if (anyMatch) {
if ("MPEG".equals(extName.toUpperCase()) || "MOV".equals(extName.toUpperCase())) {
extName = "mp4";
originalFilename = FilenameUtils.getBaseName(originalFilename) + "." + extName;
}
final AssetTmp asset = AssetTmp.builder()
.fileName(originalFilename)
.fileExtName(extName)
.fileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name())
.build();
String fileUrl = null;
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", originalFilename));
if (Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
metaDataSet.add(new MetaData("fileType", FileTypeEnum.VIDEO.name()));
handleResult.setFileType(FileTypeEnum.VIDEO.name());
asset.setFileType(FileTypeEnum.VIDEO.name());
fileUrl = FastDFSUtils.uploadVideo(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
final Set<MetaData> fileMetaData = FastDFSUtils.getFileMetaData(fileUrl);
String md5 = fileMetaData.stream().filter(x -> "MD5".equals(x.getName())).map(MetaData::getValue).findFirst().get();
asset.setMd5(md5);
} else if (Arrays.stream(AUDIO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
metaDataSet.add(new MetaData("fileType", FileTypeEnum.AUDIO.name()));
handleResult.setFileType(FileTypeEnum.AUDIO.name());
asset.setFileType(FileTypeEnum.AUDIO.name());
fileUrl = FastDFSUtils.uploadFile(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
} else if (Arrays.stream(IMAGE_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
metaDataSet.add(new MetaData("fileType", FileTypeEnum.IMAGE.name()));
handleResult.setFileType(FileTypeEnum.IMAGE.name());
asset.setFileType(FileTypeEnum.IMAGE.name());
fileUrl = FastDFSUtils.uploadFile(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
asset.setThumbnail(fileUrl);
} else if (Arrays.stream(DOC_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()))) {
metaDataSet.add(new MetaData("fileType", FileTypeEnum.DOCUMENT.name()));
handleResult.setFileType(FileTypeEnum.DOCUMENT.name());
asset.setFileType(FileTypeEnum.DOCUMENT.name());
fileUrl = FastDFSUtils.uploadFile(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
}
String language = null;
if (originalFilename.contains("汉语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.ZH.name()));
language = LanguageEnum.ZH.name();
} else if (originalFilename.contains("英语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.EN.name()));
language = LanguageEnum.EN.name();
} else if (originalFilename.contains("蒙语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.MN.name()));
language = LanguageEnum.MN.name();
} else if (originalFilename.contains("藏语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.BO.name()));
language = LanguageEnum.BO.name();
} else if (originalFilename.contains("维吾尔语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.UYG.name()));
language = LanguageEnum.UYG.name();
}
final FileInfo fileInfo = FastDFSUtils.getFileInfo(fileUrl);
final int crc32 = fileInfo.getCrc32();
final Asset one = this.assetService.getOne(Wrappers.<Asset>lambdaQuery().eq(Asset::getCrc32, (long) crc32).last(" limit 1"));
final LocalDateTime createTime = TimeUtils.getDateTimeOfTimestamp(fileInfo.getCreateTime() * 1000);
asset.setFileSize(fileInfo.getFileSize());
asset.setFileUrl(fileUrl);
asset.setFileCat(FileCatEnum.EXHIBITION_BOARD_DATUM.name());
asset.setLanguage(language);
asset.setCrc32((long) crc32);
asset.setCreateTime(createTime);
asset.setUpdateTime(createTime);
if (one != null) {
FastDFSUtils.deleteFile(fileUrl);
asset.setFileUrl(one.getFileUrl());
}
this.assetTmpService.save(asset);
datumUrlList.add(asset);
handleResult.setFileUrl(fileUrl);
handleResult.setFileName(originalFilename);
handleResult.setHandleResult(HANDLE_STATUS_ENUM.SUCCESS.getName());
handleResult.setDescription("");
successCount++;
} else {
handleResult.setFileUrl("");
handleResult.setDescription("文件" + originalFilename + "格式不支持");
failureCount++;
}
// 设置处理的业务表信息
handleList.add(handleResult);
}
BatchUploadResVO batchUploadResVO = new BatchUploadResVO();
batchUploadResVO.setFailureCount(failureCount);
batchUploadResVO.setSuccessCount(successCount);
batchUploadResVO.setTotal(files.length);
batchUploadResVO.setHandleList(handleList);
batchUploadResVO.setFileTmpList(datumUrlList);
if (failureCount > 0) {
return getFailResult(batchUploadResVO);
}
return getResult(batchUploadResVO);
}
@PostMapping(value = "/image/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/image/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresAuthentication //@RequiresPermissions("file:image:upload") @RequiresAuthentication //@RequiresPermissions("file:image:upload")
@ApiOperation(value = "单图片上传(封面/缩略图)", notes = "单图片上传(封面/缩略图)") @ApiOperation(value = "单图片上传(封面/缩略图)", notes = "单图片上传(封面/缩略图)")
...@@ -403,6 +550,128 @@ public class FileUploadController extends BaseController { ...@@ -403,6 +550,128 @@ public class FileUploadController extends BaseController {
return getResult(batchUploadResVO); return getResult(batchUploadResVO);
} }
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "音频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true)
})
@PostMapping(value = "/audio/edit/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresAuthentication //@RequiresPermissions("audio:upload")
@ApiOperation(value = "展板多音频上传(修改时使用)", notes = "展板多音频上传(修改时使用)")
public Map<String, Object> uploadAudioByEdit(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files == null || files.length == 0) {
return getFailResult("没有文件可供上传");
}
final boolean existChineseAudio = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语"));
if (!existChineseAudio) {
return getFailResult("必须包含汉语音频");
}
if (files.length > 5) {
return getFailResult("一种语言只能对应一个文件,只能上传包含5种语言的音频");
}
int successCount = 0;
int failureCount = 0;
List<BatchUploadResVO.HandleResult> handleList = new ArrayList<>();
Set<AssetTmp> fileList = new LinkedHashSet<>();
for (MultipartFile file : files) {
// 当前维度表下线结果
BatchUploadResVO.HandleResult handleResult = new BatchUploadResVO.HandleResult();
// 原始文件名
String originalFilename = file.getOriginalFilename();
if (StringUtils.isBlank(originalFilename)) {
handleResult.setFileName("");
handleResult.setFileType(FileTypeEnum.AUDIO.getName());
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件名为空");
failureCount++;
handleList.add(handleResult);
continue;
}
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件" + originalFilename + "大小为0");
failureCount++;
handleList.add(handleResult);
continue;
}
String extName = FilenameUtils.getExtension(originalFilename);
boolean anyMatch = Arrays.stream(AUDIO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
if (anyMatch) {
String language = null;
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", originalFilename));
metaDataSet.add(new MetaData("fileType", FileTypeEnum.AUDIO.name()));
if (originalFilename.contains("汉语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.ZH.name()));
language = LanguageEnum.ZH.name();
} else if (originalFilename.contains("英语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.EN.name()));
language = LanguageEnum.EN.name();
} else if (originalFilename.contains("蒙语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.MN.name()));
language = LanguageEnum.MN.name();
} else if (originalFilename.contains("藏语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.BO.name()));
language = LanguageEnum.BO.name();
} else if (originalFilename.contains("维吾尔语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.UYG.name()));
language = LanguageEnum.UYG.name();
}
String fileUrl = FastDFSUtils.uploadFile(file.getInputStream(), file.getSize(), originalFilename, metaDataSet);
final FileInfo fileInfo = FastDFSUtils.getFileInfo(fileUrl);
final int crc32 = fileInfo.getCrc32();
final Asset one = this.assetService.getOne(Wrappers.<Asset>lambdaQuery().eq(Asset::getCrc32, (long) crc32).last(" limit 1"));
final LocalDateTime createTime = TimeUtils.getDateTimeOfTimestamp(fileInfo.getCreateTime() * 1000);
final long fileSize = fileInfo.getFileSize();
final AssetTmp asset = AssetTmp.builder()
.fileName(originalFilename)
.fileExtName(extName)
.fileType(FileTypeEnum.AUDIO.name())
.fileUrl(fileUrl)
.fileSize(fileSize)
.fileCat(FileCatEnum.EXHIBITION_BOARD_AUDIO.name())
.language(language)
.crc32((long) crc32)
.createTime(createTime)
.updateTime(createTime)
.build();
if (one != null) {
FastDFSUtils.deleteFile(fileUrl);
asset.setFileUrl(one.getFileUrl());
}
this.assetTmpService.save(asset);
fileList.add(asset);
handleResult.setFileUrl(fileUrl);
handleResult.setFileName(originalFilename);
handleResult.setFileType(FileTypeEnum.AUDIO.getName());
handleResult.setHandleResult(HANDLE_STATUS_ENUM.SUCCESS.getName());
handleResult.setDescription("");
successCount++;
} else {
handleResult.setFileUrl("");
handleResult.setFileType(FileTypeEnum.AUDIO.getName());
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件" + originalFilename + "格式不支持");
failureCount++;
}
// 设置处理的业务表信息
handleList.add(handleResult);
}
BatchUploadResVO batchUploadResVO = new BatchUploadResVO();
batchUploadResVO.setFailureCount(failureCount);
batchUploadResVO.setSuccessCount(successCount);
batchUploadResVO.setTotal(files.length);
batchUploadResVO.setHandleList(handleList);
batchUploadResVO.setFileTmpList(fileList);
return getResult(batchUploadResVO);
}
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true, required = true) @ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true, required = true)
}) })
...@@ -590,6 +859,193 @@ public class FileUploadController extends BaseController { ...@@ -590,6 +859,193 @@ public class FileUploadController extends BaseController {
return getResult(batchUploadResVO); return getResult(batchUploadResVO);
} }
@ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true, required = true)
})
@PostMapping(value = "/video/edit/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresAuthentication //@RequiresPermissions("file:video:content:upload")
@ApiOperation(value = "展板视频上传(修改时使用)", notes = "展板视频上传(修改时使用)")
public Map<String, Object> uploadContentVideoByEdit(@RequestPart("file") MultipartFile[] files) throws Exception {
if (files == null || files.length == 0) {
return getFailResult("没有文件可供上传");
}
if (files.length == 1) {
String extName = FilenameUtils.getExtension(files[0].getOriginalFilename());
boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, extName.toUpperCase()));
if (!anyMatch) {
return getFailResult("目前仅支持" + String.join("、", VIDEO_TYPE) + "格式");
}
}
final boolean matchChinese = Arrays.stream(files).anyMatch(s -> Objects.requireNonNull(s.getOriginalFilename()).contains("汉语"));
if (!matchChinese) {
return getFailResult("文件必须包含汉语视频");
}
String videoContentName = null;
String text;
LCSUtil strie = null;
final String[] fileBaseNameArray = Arrays.stream(files).map(x -> FilenameUtils.getBaseName(x.getOriginalFilename())).toArray(String[]::new);
switch (fileBaseNameArray.length) {
case 1:
videoContentName = fileBaseNameArray[0];
break;
case 2:
text = fileBaseNameArray[0] + SPLITTER_CHAR_2[0] + fileBaseNameArray[1] + SPLITTER_CHAR_2[1];
strie = new LCSUtil(text, SPLITTER_CHAR_2);
break;
case 3:
text = fileBaseNameArray[0] + SPLITTER_CHAR_3[0] + fileBaseNameArray[1] + SPLITTER_CHAR_3[1] + fileBaseNameArray[2] + SPLITTER_CHAR_3[2];
strie = new LCSUtil(text, SPLITTER_CHAR_3);
break;
case 4:
text = fileBaseNameArray[0] + SPLITTER_CHAR_4[0] + fileBaseNameArray[1] + SPLITTER_CHAR_4[1] + fileBaseNameArray[2] + SPLITTER_CHAR_4[2] + fileBaseNameArray[3] + SPLITTER_CHAR_4[3];
strie = new LCSUtil(text, SPLITTER_CHAR_4);
break;
case 5:
text = fileBaseNameArray[0] + SPLITTER_CHAR_5[0] + fileBaseNameArray[1] + SPLITTER_CHAR_5[1] + fileBaseNameArray[2] + SPLITTER_CHAR_5[2] + fileBaseNameArray[3] + SPLITTER_CHAR_5[3] + fileBaseNameArray[4] + SPLITTER_CHAR_5[4];
strie = new LCSUtil(text, SPLITTER_CHAR_5);
break;
default:
break;
}
if (strie != null) {
strie.buildSuffixTree();
videoContentName = strie.findLCS();
if (StringUtils.isBlank(videoContentName)) {
return getFailResult("请修改你的文件名并保持前缀一致后再上传");
} else {
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "{");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "[");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "【");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "(");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "(");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "-");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "_");
videoContentName = StringUtils.removeEnd(videoContentName.trim(), "之");
}
}
int successCount = 0;
int failureCount = 0;
List<BatchUploadResVO.HandleResult> handleList = new ArrayList<>();
Set<AssetTmp> fileList = new LinkedHashSet<>();
for (MultipartFile file : files) {
// 当前维度表下线结果
BatchUploadResVO.HandleResult handleResult = new BatchUploadResVO.HandleResult();
// 原始文件名
String originalFilename = file.getOriginalFilename();
if (StringUtils.isBlank(originalFilename)) {
handleResult.setFileName("");
handleResult.setFileType(FileTypeEnum.VIDEO.getName());
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件名为空");
failureCount++;
handleList.add(handleResult);
continue;
}
if (file.getSize() == 0L) {
handleResult.setFileName("");
handleResult.setFileUrl("");
handleResult.setHandleResult(HANDLE_STATUS_ENUM.FAILURE.getName());
handleResult.setDescription("文件" + originalFilename + "大小为0");
failureCount++;
handleList.add(handleResult);
continue;
}
final String baseName = FilenameUtils.getBaseName(originalFilename);
String extName = FilenameUtils.getExtension(originalFilename);
String finalExtName = extName;
boolean anyMatch = Arrays.stream(VIDEO_TYPE).anyMatch(s -> Objects.equals(s, finalExtName.toUpperCase()));
if (anyMatch) {
if ("MPEG".equals(extName.toUpperCase()) || "MOV".equals(extName.toUpperCase())) {
extName = "mp4";
originalFilename = baseName + "." + extName;
}
String language = null;
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", originalFilename));
metaDataSet.add(new MetaData("fileType", FileTypeEnum.VIDEO.name()));
if (originalFilename.contains("汉语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.ZH.name()));
language = LanguageEnum.ZH.name();
} else if (originalFilename.contains("英语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.EN.name()));
language = LanguageEnum.EN.name();
} else if (originalFilename.contains("蒙语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.MN.name()));
language = LanguageEnum.MN.name();
} else if (originalFilename.contains("藏语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.BO.name()));
language = LanguageEnum.BO.name();
} else if (originalFilename.contains("维吾尔语")) {
metaDataSet.add(new MetaData("language", LanguageEnum.UYG.name()));
language = LanguageEnum.UYG.name();
}
final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
IOUtils.copy(file.getInputStream(), byteArrayOutputStream);
final String fileUrl = FastDFSUtils.uploadVideo(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()), file.getSize(), originalFilename, metaDataSet);
metaDataSet.add(new MetaData("fileName", baseName + ".chnmuseum"));
final String fileUrlCrypto = FastDFSUtils.uploadVideo(VideoEncryptUtil.encrypt(new ByteArrayInputStream(byteArrayOutputStream.toByteArray()), VideoEncryptUtil.cipher), file.getSize(), baseName + ".chnmuseum", metaDataSet);
final Set<MetaData> fileMetaData = FastDFSUtils.getFileMetaData(fileUrlCrypto);
String md5 = fileMetaData.stream().filter(x -> "MD5".equals(x.getName())).map(MetaData::getValue).findFirst().get();
final FileInfo fileInfo = FastDFSUtils.getFileInfo(fileUrl);
final int crc32 = fileInfo.getCrc32();
final Asset one = this.assetService.getOne(Wrappers.<Asset>lambdaQuery().eq(Asset::getCrc32, (long) crc32).last(" limit 1"));
final LocalDateTime createTime = TimeUtils.getDateTimeOfTimestamp(fileInfo.getCreateTime() * 1000);
final long fileSize = fileInfo.getFileSize();
final AssetTmp asset = AssetTmp.builder()
.fileName(originalFilename)
.fileNameCrypto(baseName + ".chnmuseum")
.fileExtName(extName)
.fileType(FileTypeEnum.VIDEO.name())
.fileSize(fileSize)
.fileUrl(fileUrl)
.fileUrlCrypto(fileUrlCrypto)
.fileCat(FileCatEnum.VIDEO_CONTENT.name())
.language(language)
.md5(md5)
.crc32((long) crc32)
.videoContentName(videoContentName)
.createTime(createTime)
.updateTime(createTime)
.build();
if (one != null) {
FastDFSUtils.deleteFile(fileUrl);
FastDFSUtils.deleteFile(fileUrlCrypto);
asset.setFileUrl(one.getFileUrl());
asset.setFileUrlCrypto(one.getFileUrl());
}
this.assetTmpService.save(asset);
fileList.add(asset);
handleResult.setFileUrl(fileUrl);
handleResult.setFileName(originalFilename);
handleResult.setFileType(FileTypeEnum.VIDEO.getName());
handleResult.setHandleResult(HANDLE_STATUS_ENUM.SUCCESS.getName());
handleResult.setDescription("");
successCount++;
} else {
handleResult.setFileUrl("");
handleResult.setHandleResult("上传失败");
handleResult.setDescription("文件" + originalFilename + "格式不支持");
failureCount++;
}
// 设置处理的业务表信息
handleList.add(handleResult);
}
BatchUploadResVO batchUploadResVO = new BatchUploadResVO();
batchUploadResVO.setFailureCount(failureCount);
batchUploadResVO.setSuccessCount(successCount);
batchUploadResVO.setTotal(files.length);
batchUploadResVO.setHandleList(handleList);
batchUploadResVO.setFileTmpList(fileList);
return getResult(batchUploadResVO);
}
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true, required = true) @ApiImplicitParam(name = "file", value = "视频文件", paramType = "form", dataType = "__file", collectionFormat = "array", allowMultiple = true, required = true)
}) })
......
...@@ -13,9 +13,9 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; ...@@ -13,9 +13,9 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -49,24 +49,37 @@ public class LearningContentController extends BaseController { ...@@ -49,24 +49,37 @@ public class LearningContentController extends BaseController {
@Resource @Resource
private ExhibitionBoardCatService exhibitionBoardCatService; private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private VideoContentService videoContentService; private VideoContentService videoContentService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource @Resource
private LearningContentService learningContentService; private LearningContentService learningContentService;
@Resource
private LearningContentTmpService learningContentTmpService;
@Resource @Resource
private LearningContentBoardCatService learningContentBoardCatService; private LearningContentBoardCatService learningContentBoardCatService;
@Resource @Resource
private LearningContentBoardService learningContentBoardService; private LearningContentBoardService learningContentBoardService;
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
@Resource @Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService; private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource @Resource
private LearningProjectService learningProjectService; private LearningProjectService learningProjectService;
@Resource @Resource
private AuditService auditService; private AuditService auditService;
@Resource @Resource
private AssetService assetService; private AssetService assetService;
...@@ -148,54 +161,15 @@ public class LearningContentController extends BaseController { ...@@ -148,54 +161,15 @@ public class LearningContentController extends BaseController {
@ApiOperation(value = "修改学习内容信息", notes = "修改学习内容信息") @ApiOperation(value = "修改学习内容信息", notes = "修改学习内容信息")
@MethodLog(operModule = OperModule.LEARNCONTENT, operType = OperType.UPDATE) @MethodLog(operModule = OperModule.LEARNCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateLearningContent(@Validated(value = {Update.class}) LearningContent learningContent) { public Map<String, Object> updateLearningContent(@Validated(value = {Update.class}) LearningContent learningContent) {
TUser user = getcurUser(); final boolean flag = this.learningContentTmpService.save(LearningContentTmp.builder().id(learningContent.getId()).data(JSONObject.toJSONString(learningContent)).build());
learningContent.setAuditStatus(AuditStatusEnum.TBC.name());
learningContent.setPublished(false);
// 保存业务节点信息
final String learningContentId = learningContent.getId();
final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardCatIdList();
if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoardCat> lambdaUpdateWrapper = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, learningContentId);
this.learningContentBoardCatService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardCatId : exhibitionBoardCatIdList) {
LearningContentBoardCat learningContentBoardCat = LearningContentBoardCat.builder().exhibitionBoardCatId(exhibitionBoardCatId).learningContentId(learningContentId).build();
this.learningContentBoardCatService.save(learningContentBoardCat);
}
}
final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList();
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentCopyrightOwner> lambdaUpdateWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, learningContentId);
this.learningContentCopyrightOwnerService.remove(lambdaUpdateWrapper);
for (String copyrightOwnerId : copyrightOwnerIdList) {
LearningContentCopyrightOwner contentCopyrightOwner = LearningContentCopyrightOwner.builder().copyrightOwnerId(copyrightOwnerId).learningContentId(learningContentId).build();
this.learningContentCopyrightOwnerService.save(contentCopyrightOwner);
}
}
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoard> lambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, learningContentId);
this.learningContentBoardService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardId : exhibitionBoardIdList) {
LearningContentBoard learningContentBoard = LearningContentBoard.builder()
.learningContentId(learningContentId)
.exhibitionBoardCatId(this.exhibitionBoardService.getById(exhibitionBoardId).getExhibitionBoardCatId())
.exhibitionBoardId(exhibitionBoardId)
.build();
this.learningContentBoardService.save(learningContentBoard);
}
}
boolean flag = learningContentService.updateById(learningContent);
if (flag) { if (flag) {
final LearningContent one = this.learningContentService.getById(learningContent.getId());
one.setAuditStatus(AuditStatusEnum.TBC.name());
this.learningContentService.updateById(one);
final Audit audit = Audit.builder() final Audit audit = Audit.builder()
.content(learningContent.getName()) .content(learningContent.getName())
.userId(user.getId()) .userId(getcurUser().getId())
.refItemId(learningContent.getId()) .refItemId(learningContent.getId())
.type(AuditTypeEnum.LEARNING_CONTENT.name()) .type(AuditTypeEnum.LEARNING_CONTENT.name())
.operation(AuditOperationEnum.EDIT.name()) .operation(AuditOperationEnum.EDIT.name())
...@@ -204,10 +178,9 @@ public class LearningContentController extends BaseController { ...@@ -204,10 +178,9 @@ public class LearningContentController extends BaseController {
.level(AuditStatusEnum.TBC.name()) .level(AuditStatusEnum.TBC.name())
.build(); .build();
this.auditService.save(audit); this.auditService.save(audit);
return getSuccessResult(); return getSuccessResult();
} }
return getFailResult(); return getFailResult("提交失败!上次提交的修改申请已经在审核中");
} }
@GetMapping("/getList") @GetMapping("/getList")
...@@ -385,6 +358,88 @@ public class LearningContentController extends BaseController { ...@@ -385,6 +358,88 @@ public class LearningContentController extends BaseController {
} }
learningContent.setExhibitionBoardList(exhibitionBoardList); learningContent.setExhibitionBoardList(exhibitionBoardList);
} }
return getResult(learningContent);
}
@ApiOperation(value = "获取学习内容详情(审核详情使用)", notes = "获取学习内容详情(审核详情使用)")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path", required = true)
})
@GetMapping("/getAudit/{id}")
@RequiresAuthentication //@RequiresPermissions("video:content:get:id")
@MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.SELECT)
public Map<String, Object> getAuditInfoById(@PathVariable("id") String id) {
final LearningContent learningContent = JSONObject.parseObject(learningContentTmpService.getById(id).getData(), LearningContent.class);
LearningProject learningProject = this.learningProjectService.getById(learningContent.getLearningProjectId());
if (learningProject != null) {
learningContent.setLearningProjectName(learningProject.getName());
}
final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardIdList();
final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
if (!exhibitionBoardCats.isEmpty()) {
learningContent.setExhibitionBoardCatIdList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList()));
}
final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList();
final List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList);
if (!copyrightOwnerList.isEmpty()) {
learningContent.setCopyrightOwnerIdList(copyrightOwnerList.stream().map(CopyrightOwner::getId).collect(Collectors.toList()));
learningContent.setCopyrightOwnerNameList(copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.toList()));
}
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
if (!exhibitionBoardIdList.isEmpty()) {
final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.listByIds(exhibitionBoardIdList);
if (!exhibitionBoardList.isEmpty()) {
learningContent.setExhibitionBoardIdList(exhibitionBoardList.stream().map(ExhibitionBoard::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardNameList(exhibitionBoardList.stream().map(ExhibitionBoard::getName).collect(Collectors.toList()));
}
for (ExhibitionBoard exhibitionBoard : exhibitionBoardList) {
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
if (exhibitionBoardCatId != null) {
exhibitionBoard.setExhibitionBoardCatName(this.exhibitionBoardCatService.getById(exhibitionBoardCatId).getName());
}
String boardCopyrightOwnerId = exhibitionBoard.getBoardCopyrightOwnerId();
if (boardCopyrightOwnerId != null) {
final CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(boardCopyrightOwnerId);
if (copyrightOwner != null) {
exhibitionBoard.setBoardCopyrightOwnerName(copyrightOwner.getName());
}
}
if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setVideoContentCopyrightOwnerName(name);
}
LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
final List<Asset> audioList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setAudioList(audioList);
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setDatumList(datumList);
String videoContentId = exhibitionBoard.getVideoContentId();
if (videoContentId != null) {
final VideoContent videoContent = this.videoContentService.getOne(Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getId, videoContentId));
if (videoContent != null) {
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setVideoList(videoList);
exhibitionBoard.setVideoContentName(videoContent.getName());
}
}
}
learningContent.setExhibitionBoardList(exhibitionBoardList);
}
final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, id); final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, id);
auditQueryWrapper.select(Audit::getContent); auditQueryWrapper.select(Audit::getContent);
......
...@@ -3,25 +3,26 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -3,25 +3,26 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog; import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule; import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType; import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.model.TAppVersion;
import cn.wisenergy.chnmuseum.party.model.TUser; import cn.wisenergy.chnmuseum.party.model.TUser;
import cn.wisenergy.chnmuseum.party.service.TAppVersionService;
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.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import cn.wisenergy.chnmuseum.party.model.TAppVersion;
import cn.wisenergy.chnmuseum.party.service.TAppVersionService;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
......
...@@ -52,6 +52,9 @@ public class VideoContentCatController extends BaseController { ...@@ -52,6 +52,9 @@ public class VideoContentCatController extends BaseController {
@Resource @Resource
private VideoContentService videoContentService; private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
...@@ -181,6 +184,8 @@ public class VideoContentCatController extends BaseController { ...@@ -181,6 +184,8 @@ public class VideoContentCatController extends BaseController {
final LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, id).select(VideoContent::getId); final LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, id).select(VideoContent::getId);
final List<String> videoContentIdList = this.videoContentService.listObjs(lambdaQueryWrapper, Object::toString); final List<String> videoContentIdList = this.videoContentService.listObjs(lambdaQueryWrapper, Object::toString);
this.videoContentTmpService.removeByIds(videoContentIdList);
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId); final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString); final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList); this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
......
...@@ -10,6 +10,7 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; ...@@ -10,6 +10,7 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -44,14 +45,25 @@ public class VideoContentController extends BaseController { ...@@ -44,14 +45,25 @@ public class VideoContentController extends BaseController {
@Resource @Resource
private ExhibitionBoardService exhibitionBoardService; private ExhibitionBoardService exhibitionBoardService;
@Resource @Resource
private VideoContentService videoContentService; private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource @Resource
private VideoContentCatService videoContentCatService; private VideoContentCatService videoContentCatService;
@Resource @Resource
private AssetService assetService; private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@Resource @Resource
private AuditService auditService; private AuditService auditService;
...@@ -107,36 +119,15 @@ public class VideoContentController extends BaseController { ...@@ -107,36 +119,15 @@ public class VideoContentController extends BaseController {
@ApiOperation(value = "修改视频内容信息", notes = "修改视频内容信息") @ApiOperation(value = "修改视频内容信息", notes = "修改视频内容信息")
@MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.UPDATE) @MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateVideoContent(@Validated(value = {Update.class}) VideoContent videoContent) { public Map<String, Object> updateVideoContent(@Validated(value = {Update.class}) VideoContent videoContent) {
TUser user = getcurUser(); final boolean flag = this.videoContentTmpService.save(VideoContentTmp.builder().id(videoContent.getId()).data(JSONObject.toJSONString(videoContent)).build());
videoContent.setAuditStatus(AuditStatusEnum.TBC.name());
boolean flag = videoContentService.updateById(videoContent);
if (flag) { if (flag) {
final List<String> videoFileIdList = videoContent.getVideoFileIdList(); final VideoContent one = this.videoContentService.getById(videoContent.getId());
if (videoFileIdList != null && !videoFileIdList.isEmpty()) { one.setAuditStatus(AuditStatusEnum.TBC.name());
final LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContent.getId()); this.videoContentService.updateById(one);
final List<Asset> assetList = this.assetService.list(assetQueryWrapper);
final Map<String, String> collect = assetList.stream().collect(Collectors.toMap(Asset::getId, Asset::getFileUrl));
for (String videoFileId : videoFileIdList) {
final Asset asset = this.assetService.getById(videoFileId);
asset.setThumbnail(videoContent.getThumbnail());
asset.setFileType(FileTypeEnum.VIDEO.name());
asset.setFileCat(FileCatEnum.VIDEO_CONTENT.name());
asset.setRefItemId(videoContent.getId());
this.assetService.updateById(asset);
if (StringUtils.isBlank(videoContent.getName())) {
videoContent.setName(asset.getVideoContentName());
this.videoContentService.updateById(videoContent);
}
collect.remove(videoFileId);
}
collect.forEach((k, v) -> this.assetService.removeById(k));
}
final Audit audit = Audit.builder() final Audit audit = Audit.builder()
.content(videoContent.getName()) .content(videoContent.getName())
.userId(user.getId()) .userId(getcurUser().getId())
.refItemId(videoContent.getId()) .refItemId(videoContent.getId())
.type(AuditTypeEnum.VIDEO_CONTENT.name()) .type(AuditTypeEnum.VIDEO_CONTENT.name())
.operation(AuditOperationEnum.EDIT.name()) .operation(AuditOperationEnum.EDIT.name())
...@@ -147,7 +138,7 @@ public class VideoContentController extends BaseController { ...@@ -147,7 +138,7 @@ public class VideoContentController extends BaseController {
this.auditService.save(audit); this.auditService.save(audit);
return getSuccessResult(); return getSuccessResult();
} }
return getFailResult(); return getFailResult("提交失败!上次提交的修改申请已经在审核中");
} }
@GetMapping("/getExhibitionBoardById/{id}") @GetMapping("/getExhibitionBoardById/{id}")
...@@ -299,6 +290,49 @@ public class VideoContentController extends BaseController { ...@@ -299,6 +290,49 @@ public class VideoContentController extends BaseController {
return getResult(videoContent); return getResult(videoContent);
} }
@ApiOperation(value = "获取视频内容详情(审核详情使用)", notes = "获取视频内容详情(审核详情使用)")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path", required = true)
})
@GetMapping("/getAudit/{id}")
@RequiresAuthentication //@RequiresPermissions("video:content:get:id")
@MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.SELECT)
public Map<String, Object> getAuditInfoById(@PathVariable("id") String id) {
final VideoContent videoContent = JSONObject.parseObject(videoContentTmpService.getById(id).getData(), VideoContent.class);
if (videoContent.getVideoContentCatId() != null) {
VideoContentCat videoContentCat = this.videoContentCatService.getById(videoContent.getVideoContentCatId());
if (videoContentCat != null) {
videoContent.setVideoContentCatName(videoContentCat.getName());
}
}
if (videoContent.getVideoContentCopyrightOwnerId() != null) {
CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(videoContent.getVideoContentCopyrightOwnerId());
if (copyrightOwner != null) {
videoContent.setVideoContentCopyrightOwnerName(copyrightOwner.getName());
}
}
final LambdaQueryWrapper<AssetTmp> assetQueryWrapper = Wrappers.<AssetTmp>lambdaQuery().eq(AssetTmp::getRefItemId, id);
assetQueryWrapper.eq(AssetTmp::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<AssetTmp> videoFileList = this.assetTmpService.list(assetQueryWrapper);
videoContent.setVideoFileTmpList(videoFileList);
videoContent.setVideoFileIdList(videoFileList.stream().map(AssetTmp::getId).collect(Collectors.toList()));
final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, id);
auditQueryWrapper.select(Audit::getContent);
auditQueryWrapper.select(Audit::getType);
auditQueryWrapper.select(Audit::getOperation);
auditQueryWrapper.select(Audit::getStatus);
auditQueryWrapper.select(Audit::getFirstTime);
auditQueryWrapper.select(Audit::getFirstRemarks);
auditQueryWrapper.select(Audit::getSecondTime);
auditQueryWrapper.select(Audit::getSecondTime);
auditQueryWrapper.select(Audit::getLevel);
final List<Audit> auditList = this.auditService.list(auditQueryWrapper);
videoContent.setAuditHistoryList(auditList);
return getResult(videoContent);
}
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("video:content:delete") @RequiresAuthentication //@RequiresPermissions("video:content:delete")
@ApiOperation(value = "根据ID删除视频内容", notes = "根据ID删除视频内容") @ApiOperation(value = "根据ID删除视频内容", notes = "根据ID删除视频内容")
......
<?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">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.AssetTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.AssetTmp">
<id column="id" property="id"/>
<result column="ref_item_id" property="refItemId"/>
<result column="file_name" property="fileName"/>
<result column="file_name_crypto" property="fileNameCrypto"/>
<result column="file_ext_name" property="fileExtName"/>
<result column="file_type" property="fileType"/>
<result column="file_cat" property="fileCat"/>
<result column="file_size" property="fileSize"/>
<result column="file_url" property="fileUrl"/>
<result column="file_url_crypto" property="fileUrlCrypto"/>
<result column="thumbnail" property="thumbnail"/>
<result column="language" property="language"/>
<result column="md5" property="md5"/>
<result column="crc32" property="crc32"/>
<result column="video_content_name" property="videoContentName"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, ref_item_id, file_name, file_name_crypto, file_ext_name, file_type, file_cat, file_size, file_url,
file_url_crypto, thumbnail, language, md5, crc32, video_content_name, create_time, update_time
</sql>
</mapper>
<?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">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.ExhibitionBoardTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.ExhibitionBoardTmp">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="serial_no" property="serialNo"/>
<result column="board_copyright_owner_id" property="boardCopyrightOwnerId"/>
<result column="exhibition_board_cat_id" property="exhibitionBoardCatId"/>
<result column="cover" property="cover"/>
<result column="qrcode_url" property="qrcodeUrl"/>
<result column="remarks" property="remarks"/>
<result column="video_content_copyright_owner_id" property="videoContentCopyrightOwnerId"/>
<result column="video_content_cat_id" property="videoContentCatId"/>
<result column="video_content_id" property="videoContentId"/>
<result column="ref_material_dir" property="refMaterialDir"/>
<result column="audit_status" property="auditStatus"/>
<result column="is_published" property="isPublished"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, serial_no, board_copyright_owner_id, exhibition_board_cat_id, cover, qrcode_url, remarks,
video_content_copyright_owner_id, video_content_cat_id, video_content_id, ref_material_dir, audit_status,
is_published, is_deleted, create_time, update_time
</sql>
</mapper>
<?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">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.LearningContentTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.LearningContentTmp">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="cover" property="cover" />
<result column="applicable_scope" property="applicableScope" />
<result column="organ_code" property="organCode" />
<result column="learning_project_id" property="learningProjectId" />
<result column="creator_name" property="creatorName" />
<result column="audit_status" property="auditStatus" />
<result column="is_published" property="isPublished" />
<result column="is_deleted" property="isDeleted" />
<result column="sortorder" property="sortorder" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, cover, applicable_scope, organ_code, learning_project_id, creator_name, audit_status, is_published, is_deleted, sortorder, create_time, update_time
</sql>
</mapper>
<?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">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.VideoContentTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.VideoContentTmp">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="video_content_copyright_owner_id" property="videoContentCopyrightOwnerId" />
<result column="video_content_cat_id" property="videoContentCatId" />
<result column="thumbnail" property="thumbnail" />
<result column="audit_status" property="auditStatus" />
<result column="is_published" property="isPublished" />
<result column="is_deleted" property="isDeleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, video_content_copyright_owner_id, video_content_cat_id, thumbnail, audit_status, is_published, is_deleted, create_time, update_time
</sql>
</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