Commit 849abb9c authored by liqin's avatar liqin 💬

bug fixed

parent f7d53dcb
......@@ -3,7 +3,7 @@ package cn.chnmuseum.party.common.mybatis;
public class MysqlGenerator {
private static final String[] tableNames = new String[]{
"t_audit"
"asset_tmp"
};
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private static final String projectPath = "/opt/ss";
......
package cn.chnmuseum.party.common.vo;
import cn.chnmuseum.party.model.Asset;
import cn.chnmuseum.party.model.AssetTmp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -38,9 +37,6 @@ public class BatchUploadResVO {
@ApiModelProperty("成功上传的文件集合")
private Set<Asset> fileList;
@ApiModelProperty("成功上传的文件集合(修改时使用)")
private Set<AssetTmp> fileTmpList;
@Data
public static class HandleResult {
......
......@@ -23,6 +23,7 @@ public interface AssetMapper extends BaseMapper<Asset> {
"FROM asset a, video_content vc, copyright_owner co, video_content_cat vcc " +
"where a.ref_item_id = vc.id " +
"and vc.video_content_cat_id = vcc.id " +
"and a.is_published = 1 " +
"and vc.video_content_copyright_owner_id = co.id " +
"and vc.is_published = 1 and vc.is_deleted = 0 " +
"<![CDATA[and co.expire_date_start <= DATE_FORMAT(now(), '%Y-%m-%d') ]]>" +
......
package cn.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.chnmuseum.party.model.AssetTmp;
/**
* <pre>
* 文件资产临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-18
*/
public interface AssetTmpMapper extends BaseMapper<AssetTmp> {
}
package cn.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.chnmuseum.party.model.ExhibitionBoardTmp;
/**
* <pre>
* 展板临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface ExhibitionBoardTmpMapper extends BaseMapper<ExhibitionBoardTmp> {
}
......@@ -47,6 +47,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and eb.video_content_id = vc.id "
+ "and vc.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 and vc.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN' "
+ "and lc.organ_code = #{organCode} "
......@@ -56,6 +57,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and lcb.exhibition_board_id = eb.id "
+ "and eb.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_cat = 'EXHIBITION_BOARD_DATUM' "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN' "
......@@ -70,6 +72,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and eb.video_content_id = vc.id "
+ "and vc.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 and vc.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN_SUB'"
+ "and lc.organ_code like CONCAT(#{organCode},'%') "
......@@ -79,6 +82,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and lcb.exhibition_board_id = eb.id "
+ "and eb.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_cat = 'EXHIBITION_BOARD_DATUM' "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN_SUB' "
......@@ -92,6 +96,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and eb.video_content_id = vc.id "
+ "and vc.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 and vc.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'ALL_PLAT'"
+ "UNION "
......@@ -101,6 +106,7 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and lcb.exhibition_board_id = eb.id "
+ "and eb.id = a.ref_item_id "
+ "and lc.is_published = 1 and eb.is_published = 1 and eb.is_deleted = 0 "
+ "and a.is_published = 1 "
+ "and a.file_cat = 'EXHIBITION_BOARD_DATUM' "
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'ALL_PLAT'" +
......
package cn.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.chnmuseum.party.model.LearningContentTmp;
/**
* <pre>
* 学习内容临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface LearningContentTmpMapper extends BaseMapper<LearningContentTmp> {
}
package cn.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.chnmuseum.party.model.VideoContentTmp;
/**
* <pre>
* 视频内容临时 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-17
*/
public interface VideoContentTmpMapper extends BaseMapper<VideoContentTmp> {
}
......@@ -85,6 +85,10 @@ public class Asset implements Serializable {
@TableField("crc32")
private Long crc32;
@ApiModelProperty("是否上架")
@TableField("is_published")
private Boolean published;
@ApiModelProperty(hidden = true)
@TableField("video_content_name")
private String videoContentName;
......
......@@ -22,7 +22,7 @@ public class EmployeeRole extends Model<EmployeeRole> {
private static final long serialVersionUID = 1L;
@TableId(value = "id",type = IdType.UUID)
@TableId(value = "id",type = IdType.ASSIGN_UUID)
private String id;
@TableField("employee_id")
private String employeeId;
......
......@@ -93,10 +93,6 @@ public class VideoContent implements Serializable {
@TableField(exist = false)
private List<Asset> videoFileList;
@ApiModelProperty("视频文件信息列表(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> videoFileTmpList;
@ApiModelProperty("审核意见记录")
@TableField(exist = false)
private List<Audit> auditHistoryList;
......
package cn.chnmuseum.party.service;
import cn.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.chnmuseum.party.service;
import cn.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.chnmuseum.party.service;
import cn.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.chnmuseum.party.service;
import cn.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.chnmuseum.party.service.impl;
import cn.chnmuseum.party.mapper.AssetTmpMapper;
import cn.chnmuseum.party.model.AssetTmp;
import cn.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.chnmuseum.party.service.impl;
import cn.chnmuseum.party.mapper.ExhibitionBoardTmpMapper;
import cn.chnmuseum.party.model.ExhibitionBoardTmp;
import cn.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.chnmuseum.party.service.impl;
import cn.chnmuseum.party.mapper.LearningContentTmpMapper;
import cn.chnmuseum.party.model.LearningContentTmp;
import cn.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.chnmuseum.party.service.impl;
import cn.chnmuseum.party.mapper.VideoContentTmpMapper;
import cn.chnmuseum.party.model.VideoContentTmp;
import cn.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 {
}
......@@ -440,11 +440,14 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiOperation(value = "展板详情查询", notes = "展板详情查询")
@ApiImplicitParams({
@ApiImplicitParam(name = "boardId", value = "展板ID", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "language", value = "语言", dataType = "String", paramType = "query")
@ApiImplicitParam(name = "videoLanguage", value = "语言", dataType = "String", paramType = "query"),
@ApiImplicitParam(name = "audioLanguage", value = "语言", dataType = "String", paramType = "query")
})
@GetMapping("/exhibitionBoard/getBoardInfo")
@RequiresAuthentication
public Map<String, Object> getById(@RequestParam(value = "boardId") String id, @RequestParam(value = "language", required = false) LanguageEnum language) {
public Map<String, Object> getById(@RequestParam(value = "boardId") String id,
@RequestParam(value = "videoLanguage", required = false) LanguageEnum videoLanguage,
@RequestParam(value = "audioLanguage", required = false) LanguageEnum audioLanguage) {
ExhibitionBoard exhibitionBoard = exhibitionBoardService.getById(id);
String exhibitionBoardCatId = exhibitionBoard.getExhibitionBoardCatId();
if (exhibitionBoardCatId != null) {
......@@ -463,21 +466,18 @@ public class ChinaMobileRestApiController extends BaseController {
exhibitionBoard.setBoardVideoContentThumbnail(thumbnail);
}
LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, id);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
if (language != null) {
assetQueryWrapper.eq(Asset::getLanguage, language.name());
if (audioLanguage != null) {
assetQueryWrapper.eq(Asset::getLanguage, audioLanguage.name());
}
final List<Asset> audioList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setAudioList(audioList);
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, id);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
if (language != null) {
datumList.removeIf(x -> FileTypeEnum.VIDEO.name().equals(x.getFileType()) && !language.name().equals(x.getLanguage()));
}
exhibitionBoard.setDatumList(datumList);
final String videoContentId = exhibitionBoard.getVideoContentId();
......@@ -488,8 +488,8 @@ public class ChinaMobileRestApiController extends BaseController {
assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
if (language != null) {
assetQueryWrapper.eq(Asset::getLanguage, language.name());
if (videoLanguage != null) {
assetQueryWrapper.eq(Asset::getLanguage, videoLanguage.name());
}
final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setVideoList(videoList);
......
......@@ -121,6 +121,13 @@ public class ExhibitionBoardController extends BaseController {
@ApiOperation(value = "修改展板信息", notes = "修改展板信息")
@MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateExhibitionBoard(@Validated(value = {Update.class}) ExhibitionBoard exhibitionBoard) {
final LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getName, exhibitionBoard.getName().trim());
lambdaQueryWrapper.ne(ExhibitionBoard::getId, exhibitionBoard.getId());
final int count = this.exhibitionBoardService.count(lambdaQueryWrapper);
if (count > 0) {
return getFailResult("400", "名称已存在,请修改名称");
}
final ExhibitionBoard one = this.exhibitionBoardService.getById(exhibitionBoard.getId());
one.setAuditStatus(AuditStatusEnum.TBC.name());
this.exhibitionBoardService.updateById(one);
......@@ -319,6 +326,19 @@ public class ExhibitionBoardController extends BaseController {
exhibitionBoard.setDatumList(datumList);
exhibitionBoard.setDatumIdList(datumList.stream().map(Asset::getId).collect(Collectors.toList()));
final LambdaQueryWrapper<Audit> auditQueryWrapper = Wrappers.<Audit>lambdaQuery().eq(Audit::getRefItemId, exhibitionBoard.getId());
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);
exhibitionBoard.setAuditHistoryList(auditList);
final String videoContentId = exhibitionBoard.getVideoContentId();
if (videoContentId != null) {
final VideoContent videoContent = this.videoContentService.getById(videoContentId);
......
......@@ -12,7 +12,6 @@ import cn.chnmuseum.party.common.vo.BatchUploadResVO;
import cn.chnmuseum.party.common.vo.ImageUploadResult;
import cn.chnmuseum.party.model.Asset;
import cn.chnmuseum.party.service.AssetService;
import cn.chnmuseum.party.service.AssetTmpService;
import cn.chnmuseum.party.web.controller.base.BaseController;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -66,8 +65,6 @@ public class FileUploadController extends BaseController {
@Resource
private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@ApiOperation(value = "根据文件ID刪除文件", notes = "根据文件ID刪除文件")
@DeleteMapping(value = "/delete/{id}")
......
......@@ -13,6 +13,7 @@ import cn.chnmuseum.party.common.vo.GenericPageParam;
import cn.chnmuseum.party.model.*;
import cn.chnmuseum.party.service.*;
import cn.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.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -153,6 +154,13 @@ public class LearningContentController extends BaseController {
@ApiOperation(value = "修改学习内容信息", notes = "修改学习内容信息")
@MethodLog(operModule = OperModule.LEARNCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateLearningContent(@Validated(value = {Update.class}) LearningContent learningContent) {
final LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery().eq(LearningContent::getName, learningContent.getName().trim());
lambdaQueryWrapper.ne(LearningContent::getId, learningContent.getId());
final int count = this.learningContentService.count(lambdaQueryWrapper);
if (count > 0) {
return getFailResult("400", "名称已存在,请修改名称");
}
final LearningContent one = this.learningContentService.getById(learningContent.getId());
one.setAuditStatus(AuditStatusEnum.TBC.name());
this.learningContentService.updateById(one);
......@@ -166,6 +174,7 @@ public class LearningContentController extends BaseController {
.operation(AuditOperationEnum.EDIT.name())
.status(AuditStatusEnum.TBC.name())
.level(AuditStatusEnum.TBC.name())
.modelData(JSONObject.toJSONString(learningContent))
.build();
this.auditService.save(audit);
return getSuccessResult();
......@@ -363,6 +372,109 @@ public class LearningContentController extends BaseController {
return getResult(learningContent);
}
@ApiOperation(value = "获取学习内容详情(审核详情使用)", notes = "获取学习内容详情(审核详情使用)")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "审核ID", dataType = "String", paramType = "path")
})
@GetMapping("/getAudit/{id}")
@RequiresAuthentication //@RequiresPermissions("learning:content:get:id")
@MethodLog(operModule = OperModule.LEARNCONTENT, operType = OperType.SELECT)
public Map<String, Object> getAuditInfoById(@PathVariable("auditId") String auditId) {
final LearningContent learningContent = JSONObject.parseObject(this.auditService.getById(auditId).getModelData(), LearningContent.class);
String id = learningContent.getId();
LearningProject learningProject = this.learningProjectService.getById(learningContent.getLearningProjectId());
if (learningProject != null) {
learningContent.setLearningProjectName(learningProject.getName());
}
final LambdaQueryWrapper<LearningContentBoardCat> queryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getLearningContentId, id);
queryWrapper.select(LearningContentBoardCat::getExhibitionBoardCatId);
final List<String> exhibitionBoardCatIdList = this.learningContentBoardCatService.listObjs(queryWrapper, Object::toString);
if (!exhibitionBoardCatIdList.isEmpty()) {
final List<ExhibitionBoardCat> exhibitionBoardCats = this.exhibitionBoardCatService.listByIds(exhibitionBoardCatIdList);
learningContent.setExhibitionBoardCatIdList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getId).collect(Collectors.toList()));
learningContent.setExhibitionBoardCatNameList(exhibitionBoardCats.stream().map(ExhibitionBoardCat::getName).collect(Collectors.toList()));
}
final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getLearningContentId, id);
learningContentCopyrightOwnerLambdaQueryWrapper.select(LearningContentCopyrightOwner::getCopyrightOwnerId);
final List<String> copyrightOwnerIdList = this.learningContentCopyrightOwnerService.listObjs(learningContentCopyrightOwnerLambdaQueryWrapper, Object::toString);
if (!copyrightOwnerIdList.isEmpty()) {
final List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(copyrightOwnerIdList);
learningContent.setCopyrightOwnerIdList(copyrightOwnerList.stream().map(CopyrightOwner::getId).collect(Collectors.toList()));
learningContent.setCopyrightOwnerNameList(copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.toList()));
}
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, id);
learningContentBoardLambdaQueryWrapper.select(LearningContentBoard::getExhibitionBoardId);
final List<String> exhibitionBoardIdList = this.learningContentBoardService.listObjs(learningContentBoardLambdaQueryWrapper, Object::toString);
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);
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);
learningContent.setAuditHistoryList(auditList);
return getResult(learningContent);
}
/**
* 通用排序方法(拖拽排序/所有排序完成后点击保存)
*
......
<?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.chnmuseum.party.mapper.AssetTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.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.chnmuseum.party.mapper.ExhibitionBoardTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.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.chnmuseum.party.mapper.LearningContentTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.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.chnmuseum.party.mapper.VideoContentTmpMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.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