Commit 6c8ba60d authored by liqin's avatar liqin 💬

bug fixed

parent dc74d79a
......@@ -22,7 +22,6 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.tobato.fastdfs.domain.fdfs.MetaData;
import io.swagger.annotations.Api;
......@@ -191,10 +190,25 @@ public class AssetController extends BaseController {
@RequiresPermissions("asset:list")
@ApiOperation(value = "获取视频全部列表(无分页)", notes = "获取视频全部列表(无分页)")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String")
@ApiImplicitParam(name = "auditStatus", value = "审核状态", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "assetTypeId", value = "视频分类ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "assetCopyrightOwnerId", value = "视频版权方ID", paramType = "query", dataType = "String")
})
public Map<String, Object> getAssetList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED_FINAL", required = false) AuditStatusEnum auditStatus) {
List<Asset> assetList = assetService.list(Wrappers.<Asset>lambdaQuery().eq(Asset::getAuditStatus, auditStatus.name()).eq(Asset::getPublished, true));
public Map<String, Object> getAssetList(@RequestParam(value = "auditStatus", required = false) AuditStatusEnum auditStatus,
@RequestParam(value = "assetTypeId", required = false) String assetTypeId,
@RequestParam(value = "assetCopyrightOwnerId", required = false) String assetCopyrightOwnerId) {
final LambdaQueryWrapper<Asset> lambdaQueryWrapper = new LambdaQueryWrapper<>();
//lambdaQueryWrapper.eq(Asset::getPublished, true);
if (auditStatus != null) {
lambdaQueryWrapper.eq(Asset::getAuditStatus, auditStatus.name());
}
if (StringUtils.isNotBlank(assetTypeId)) {
lambdaQueryWrapper.eq(Asset::getAssetTypeId, assetTypeId);
}
if (StringUtils.isNotBlank(assetCopyrightOwnerId)) {
lambdaQueryWrapper.eq(Asset::getAssetCopyrightOwnerId, assetCopyrightOwnerId);
}
List<Asset> assetList = assetService.list(lambdaQueryWrapper);
return getResult(assetList);
}
......@@ -277,7 +291,8 @@ public class AssetController extends BaseController {
}
final String videoUrl = asset.getVideoUrl();
final List<VideoVo> videoVoList = JSONObject.parseObject(videoUrl, new TypeReference<List<VideoVo>>() {}, Feature.OrderedField);
final List<VideoVo> videoVoList = JSONObject.parseObject(videoUrl, new TypeReference<List<VideoVo>>() {
}, Feature.OrderedField);
asset.setVideoUrlList(videoVoList.stream().map(VideoVo::getFileUrl).collect(Collectors.toList()));
return getResult(asset);
}
......
......@@ -475,7 +475,6 @@ public class ChinaMobileRestApiController extends BaseController {
@RequiresPermissions("t:board:statistic:statisticBoardInfo")
@ApiOperation(value = "播放记录信息反馈", notes = "播放记录信息反馈")
public Map<String, Object> boardStatisticInfo(@Validated(value = {Add.class}) TBoardStatistic tBoardStatistic) {
// 展板信息统计
try {
Object result = tBoardStatisticService.boardStatisticInfo(tBoardStatistic, false);
......@@ -485,12 +484,50 @@ public class ChinaMobileRestApiController extends BaseController {
}
} catch (Exception e) {
e.printStackTrace();
}
// 保存失败
return getFailResult();
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
})
@PostMapping("/learningContent/getPage")
@RequiresPermissions("learning:content:page")
@ApiOperation(value = "获取学习内容分页列表", notes = "获取学习内容分页列表")
public Map<String, Object> getLearningContentPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<LearningContent> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(LearningContent::getName, genericPageParam.getNameOrCode());
}
// 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(LearningContent::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.le(LearningContent::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
}
// 设置排序规则
queryWrapper.orderByDesc(LearningContent::getCreateTime);
// 设置查询内容
queryWrapper.select(
LearningContent::getId,
LearningContent::getName,
LearningContent::getAuditStatus,
LearningContent::getCreateTime,
LearningContent::getUpdateTime);
Page<LearningContent> page = this.learningContentService.page(getPage(), queryWrapper);
for (LearningContent learningContent : page.getRecords()) {
LambdaQueryWrapper<LearningContentBoard> lambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, learningContent.getId());
int exhibitionBoardCount = this.learningContentBoardService.count(lambdaQueryWrapper);
learningContent.setExhibitionBoardCount(exhibitionBoardCount);
}
return getResult(page);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
......@@ -534,43 +571,4 @@ public class ChinaMobileRestApiController extends BaseController {
return getResult(page);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
})
@PostMapping("/learningContent/getPageList")
@RequiresPermissions("learning:content:page")
@ApiOperation(value = "获取学习内容分页列表", notes = "获取学习内容分页列表")
public Map<String, Object> getLearningContentPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<LearningContent> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(LearningContent::getName, genericPageParam.getNameOrCode());
}
// 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(LearningContent::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.le(LearningContent::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
}
// 设置排序规则
queryWrapper.orderByDesc(LearningContent::getCreateTime);
// 设置查询内容
queryWrapper.select(
LearningContent::getId,
LearningContent::getName,
LearningContent::getAuditStatus,
LearningContent::getCreateTime,
LearningContent::getUpdateTime);
Page<LearningContent> page = this.learningContentService.page(getPage(), queryWrapper);
for (LearningContent learningContent : page.getRecords()) {
LambdaQueryWrapper<LearningContentBoard> lambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().eq(LearningContentBoard::getLearningContentId, learningContent.getId());
int exhibitionBoardCount = this.learningContentBoardService.count(lambdaQueryWrapper);
learningContent.setExhibitionBoardCount(exhibitionBoardCount);
}
return getResult(page);
}
}
......@@ -86,7 +86,7 @@ public class ExhibitionBoardCatController extends BaseController {
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
})
public Map<String, Object> updateStatus(@NotNull(message = "展板分类ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
public Map<String, Object> updateStatus(@NotNull(message = "展板分类ID不能为空") @PathVariable("id") String id, @RequestParam("auditStatus") AuditStatusEnum status) {
UpdateWrapper<ExhibitionBoardCat> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
updateWrapper.eq("audit_status", status.name());
......@@ -110,7 +110,7 @@ public class ExhibitionBoardCatController extends BaseController {
@GetMapping("/getList")
@RequiresPermissions("exhibition:board:cat:list")
@ApiOperation(value = "获取展板分类全部列表(无分页)", notes = "获取展板分类全部列表(无分页)")
public Map<String, Object> getExhibitionBoardCatList(@RequestParam(value = "auditStatus", defaultValue = "APPROVED", required = false) AuditStatusEnum auditStatus) {
public Map<String, Object> getExhibitionBoardCatList(@RequestParam(value = "auditStatus", required = false) AuditStatusEnum auditStatus) {
List<ExhibitionBoardCat> exhibitionBoardCatList = exhibitionBoardCatService.list();
return getResult(exhibitionBoardCatList);
}
......
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