Commit aa364006 authored by liqin's avatar liqin 💬

bug fixed

parent 084dc60f
......@@ -5,10 +5,10 @@ package cn.wisenergy.chnmuseum.party.common.enums;
*/
public enum AuditTypeEnum {
ASSET(1, "新增"),
EXHIBITION_BOARD(2, "修改"),
LEARNING_CONTENT(3, "下架"),
ACCOUNT(4, "禁用");
ASSET(1, "视频内容"),
EXHIBITION_BOARD(2, "展板内容"),
LEARNING_CONTENT(3, "学习内容"),
ACCOUNT(4, "账户");
// 错误编码
private Integer code;
......
......@@ -7,13 +7,13 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.TBoardStatisticService;
import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.service.impl.*;
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.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -39,6 +39,7 @@ import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Slf4j
@RestController()
......@@ -75,6 +76,21 @@ public class ChinaMobileRestApiController extends BaseController {
@Resource
private TBoardStatisticService tBoardStatisticService;
@Resource
private LearningProjectService learningProjectService;
@Resource
private LearningContentService learningContentService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private LearningContentBoardService learningContentBoardService;
private static final String SHIRO_JWT_TOKEN = "shiro:jwt:token:";
//用户登录次数计数 redisKey 前缀
private static final String SHIRO_LOGIN_COUNT = "shiro_login_count_";
......@@ -211,12 +227,12 @@ public class ChinaMobileRestApiController extends BaseController {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
TBoxOperation operation = boxOperationService.getOne(new UpdateWrapper<TBoxOperation>().eq("organ_id", user.getOrgId()));
if (operation==null||"".equals(operation.getMac())){
if (operation == null || "".equals(operation.getMac())) {
resultMap.put("status", 500);
resultMap.put("message", "用户未激活!");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
if (!mac.equals(operation.getMac())){
if (!mac.equals(operation.getMac())) {
resultMap.put("status", 500);
resultMap.put("message", "mac地址不正确!");
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
......@@ -371,12 +387,14 @@ public class ChinaMobileRestApiController extends BaseController {
@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 = "copyrightOwner", value = "版权方", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
})
@PostMapping("/exhibitionBoard/getPage")
@PostMapping("/getPageList")
@RequiresPermissions("exhibition:board:page")
@ApiOperation(value = "获取展板分页列表", notes = "获取展板分页列表")
public ResponseEntity<JSONObject> getExhibitionBoardPageList(GenericPageParam genericPageParam) {
public Map<String, Object> getExhibitionBoardPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<ExhibitionBoard> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
......@@ -384,7 +402,7 @@ public class ChinaMobileRestApiController extends BaseController {
}
// 对版权方模糊查询
if (StringUtils.isNotBlank(genericPageParam.getBoardCopyrightOwnerId())) {
queryWrapper.like(ExhibitionBoard::getBoardCopyrightOwnerId, genericPageParam.getBoardCopyrightOwnerId());
queryWrapper.like(ExhibitionBoard::getAssetCopyrightOwnerId, genericPageParam.getBoardCopyrightOwnerId());
}
// 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
......@@ -397,17 +415,24 @@ public class ChinaMobileRestApiController extends BaseController {
queryWrapper.select(
ExhibitionBoard::getId,
ExhibitionBoard::getName,
ExhibitionBoard::getAuditStatus,
ExhibitionBoard::getPublished,
ExhibitionBoard::getAssetCopyrightOwnerId,
ExhibitionBoard::getExhibitionBoardCatId,
ExhibitionBoard::getCreateTime,
ExhibitionBoard::getUpdateTime);
Page<ExhibitionBoard> page = this.exhibitionBoardService.page(getPage(), queryWrapper);
for (ExhibitionBoard exhibitionBoard : page.getRecords()) {
if (exhibitionBoard.getAssetCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getAssetCopyrightOwnerId()).getName();
exhibitionBoard.setBoardCopyrightOwnerName(name);
}
if (exhibitionBoard.getExhibitionBoardCatId() != null) {
String name = this.exhibitionBoardCatService.getById(exhibitionBoard.getExhibitionBoardCatId()).getName();
exhibitionBoard.setExhibitionBoardCatName(name);
}
}
JSONObject resultMap = new JSONObject();
resultMap.put("resultCode", 200);
resultMap.put("message", "成功");
resultMap.put("data", page);
return ResponseEntity.ok(resultMap);
return getResult(page);
}
@ApiOperation(value = "获取展板详情", notes = "获取展板详情")
......@@ -425,21 +450,19 @@ public class ChinaMobileRestApiController extends BaseController {
return resultMap;
}
@PostMapping("/equitment/playLog")
@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);
try {
Object result = tBoardStatisticService.boardStatisticInfo(tBoardStatistic, false);
// 返回操作结果
if (result != null && (boolean)result) {
if (result != null && (boolean) result) {
return getSuccessResult();
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
......@@ -447,4 +470,86 @@ public class ChinaMobileRestApiController extends BaseController {
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("/getPageList")
@RequiresPermissions("learning:project:page")
@ApiOperation(value = "获取学习项目分页列表", notes = "获取学习项目分页列表")
public Map<String, Object> getLearningProjectPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<LearningProject> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(LearningProject::getName, genericPageParam.getNameOrCode());
}
// 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(LearningProject::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.le(LearningProject::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
}
// 设置排序规则
queryWrapper.orderByDesc(LearningProject::getCreateTime);
// 设置查询内容
queryWrapper.select(
LearningProject::getId,
LearningProject::getName,
LearningProject::getRemarks,
LearningProject::getCreateTime,
LearningProject::getUpdateTime);
Page<LearningProject> page = this.learningProjectService.page(getPage(), queryWrapper);
for (LearningProject learningProject : page.getRecords()) {
LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery()
.eq(LearningContent::getLearningProjectId, learningProject.getId())
.eq(LearningContent::getIsPublished, true);
lambdaQueryWrapper.select(LearningContent::getName);
List<LearningContent> learningContentList = this.learningContentService.list(lambdaQueryWrapper);
String learningContentNames = learningContentList.stream().map(LearningContent::getName).collect(Collectors.joining("、"));
learningProject.setLearningContentNames(learningContentNames);
}
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("/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);
}
}
......@@ -9,12 +9,10 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.AudioVo;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.Audit;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
import cn.wisenergy.chnmuseum.party.service.AuditService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardCatService;
import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -60,6 +58,8 @@ public class ExhibitionBoardController extends BaseController {
private CopyrightOwnerService copyrightOwnerService;
@Resource
private AuditService auditService;
@Resource
private AssetService assetService;
@PostMapping("/save")
@RequiresPermissions("exhibition:board:save")
......@@ -311,6 +311,14 @@ public class ExhibitionBoardController extends BaseController {
if (boardCopyrightOwnerId != null) {
exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName());
}
final String assetId = exhibitionBoard.getAssetId();
final Asset asset = this.assetService.getById(assetId);
final String videoUrl = asset.getVideoUrl();
return getResult(exhibitionBoard);
}
......
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