Commit 97bdfe9a authored by liqin's avatar liqin 💬

bug fixed

parent 30c210e7
......@@ -222,13 +222,7 @@ public class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog>
sysLog.setOperationType(OperType.DISABLE.getMsg());
}
} else if (methodLog.operModule().getCode().equals(OperModule.DISPLAYCONTENT.getCode()) && methodLog.operType().getCode().equals(OperType.UPDATE.getCode())) {
Boolean o = (Boolean) method_param[1];
if (o) {
sysLog.setOperationType(OperType.UPDATE.getMsg());
} else {
sysLog.setOperationType(OperType.LOWER.getMsg());
}
sysLog.setOperationType(OperType.UPDATE.getMsg());
} else if (methodLog.operModule().getCode().equals(OperModule.VIDEOCOPYRIGHT.getCode())) {
GenericPageParam g = (GenericPageParam) method_param[0];
if (VIDEO_CONTENT.name().equals(g.getOwnerType())) {
......@@ -236,7 +230,6 @@ public class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog>
} else {
sysLog.setOperationObject(OperModule.DISPLAYCOPYRIGHT.getMsg());
}
} else if (methodLog.operModule().getCode().equals(OperModule.DISPLAYCOPYRIGHT.getCode())) {
CopyrightOwner c;
String type = null;
......@@ -261,7 +254,6 @@ public class SystemOperationLogService extends ServiceImpl<SysLogMapper, SysLog>
break;
}
}
}
/**
......
......@@ -60,7 +60,9 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN' "
+ "and lc.organ_code = #{organCode} "
+ "UNION "
+ "SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover "
+ "FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a "
+ "WHERE lcb.learning_content_id = lc.id "
......@@ -81,7 +83,9 @@ public interface LearningContentBoardMapper extends BaseMapper<LearningContentBo
+ "and a.file_type = 'VIDEO' "
+ "and lc.applicable_scope = 'THIS_ORGAN_SUB' "
+ "and lc.organ_code = #{organCode} "
+ "UNION "
+ "SELECT a.*, eb.id exhibition_board_id, eb.name exhibition_board_name, eb.cover exhibition_board_cover FROM learning_content_board lcb, learning_content lc, exhibition_board eb, video_content vc, asset a "
+ "WHERE lcb.learning_content_id = lc.id "
+ "and lcb.exhibition_board_id = eb.id "
......
......@@ -59,11 +59,6 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 分页查询
*
* @param name
* @param status
* @param type
* @return
*/
@Override
public Page<Audit> pageList(String name, AuditStatusEnum status, AuditStatusEnum auditStatusLevel, AuditTypeEnum type, Page<Object> page) {
......@@ -84,17 +79,11 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
if (status != null) {
ew.eq(status != null, "a.status", status.name());
}
Page<Audit> pageList = pageByType(ew, name, type, auditPage);
return pageList;
return pageByType(ew, name, type, auditPage);
}
/**
* 分别查询
*
* @param name
* @param type
* @param auditPage
* @return
*/
private Page<Audit> pageByType(QueryWrapper<Audit> ew, String name,
AuditTypeEnum type, Page<Audit> auditPage) {
......@@ -121,9 +110,6 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 根据id更新审核信息
*
* @param audit
* @return
*/
@Override
public boolean updateAuditAllById(Audit audit) {
......@@ -157,8 +143,6 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 初审级别的修改情况
*
* @return
*/
private boolean updateOnTBC(Audit audit) {
audit.setFirstTime(LocalDateTime.now());
......@@ -184,8 +168,6 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 复审级别的修改情况
*
* @return
*/
private boolean updateOnTBCA(Audit audit) {
audit.setSecondTime(LocalDateTime.now());
......@@ -235,13 +217,11 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 根据审核操作 填充VideoContent属性用于更改
*
* @param audit
* @return
*/
public boolean fillVideoContentByAudit(Audit audit) {
final String videoContentId = audit.getRefItemId();
VideoContent videoContent = new VideoContent();
videoContent.setId(audit.getRefItemId());
videoContent.setId(videoContentId);
videoContent.setAuditStatus(audit.getStatus());
//当审核级别为复审,审核状态为通过是,会修改审核项其它表中的 发布与删除字段,不是此情况下是直接修改审核状态
boolean continueFill = AuditStatusEnum.APPROVED_FINAL.name().equals(audit.getStatus()) && AuditStatusEnum.TBCA.name().equals(audit.getLevel());
......@@ -265,7 +245,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
queryWrapper.select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
update = this.videoContentService.removeById(videoContent);
update = this.videoContentService.removeById(videoContentId);
break;
case ADD:
videoContent.setPublished(true);
......@@ -282,13 +262,11 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 根据审核操作 填充ExhibitionBoard属性用于更改
*
* @param audit
* @return
*/
public boolean fillExhibitionBoardByAudit(Audit audit) {
final String exhibitionBoardId = audit.getRefItemId();
ExhibitionBoard exhibitionBoard = new ExhibitionBoard();
exhibitionBoard.setId(audit.getRefItemId());
exhibitionBoard.setId(exhibitionBoardId);
exhibitionBoard.setAuditStatus(audit.getStatus());
//当审核级别为复审,审核状态为通过是,会修改审核项其它表中的 发布与删除字段,不是此情况下是直接修改审核状态
boolean continueFill = AuditStatusEnum.APPROVED_FINAL.name().equals(audit.getStatus()) && AuditStatusEnum.TBCA.name().equals(audit.getLevel());
......@@ -309,7 +287,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
break;
case REMOVE:
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId()));
update = this.exhibitionBoardService.removeById(exhibitionBoard);
update = this.exhibitionBoardService.removeById(exhibitionBoardId);
break;
case ADD:
exhibitionBoard.setPublished(true);
......@@ -326,14 +304,12 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
/**
* 根据审核操作 填充LearningContent属性用于更改
*
* @param audit
* @return
*/
public boolean fillLearningContentByAudit(Audit audit) {
final String learningContentId = audit.getRefItemId();
LearningContent learningContent = new LearningContent();
learningContent.setAuditStatus(audit.getStatus());
learningContent.setId(audit.getRefItemId());
learningContent.setId(learningContentId);
//当审核级别为复审,审核状态为通过是,会修改审核项其它表中的 发布与删除字段,不是此情况下是直接修改审核状态
boolean continueFill = AuditStatusEnum.APPROVED_FINAL.name().equals(audit.getStatus()) && AuditStatusEnum.TBCA.name().equals(audit.getLevel());
if (!continueFill) {
......@@ -352,7 +328,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.learningContentService.updateById(learningContent);
break;
case REMOVE:
update = this.learningContentService.removeById(learningContent);
update = this.learningContentService.removeById(learningContentId);
break;
case ADD:
learningContent.setPublished(true);
......@@ -374,7 +350,6 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
* @param content 审核内容
* @param typeEnum 审核类型
* @param operationEnum 操作类型
* @return
*/
@Override
public boolean saveByRefItemInfo(String refItemId, String content, AuditTypeEnum typeEnum, AuditOperationEnum operationEnum) {
......
......@@ -69,6 +69,9 @@ public class CopyrightOwnerController extends BaseController {
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private LearningContentService learningContentService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("copyright:owner:save")
@ApiOperation(value = "添加版权方", notes = "添加版权方")
......@@ -302,8 +305,16 @@ public class CopyrightOwnerController extends BaseController {
LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> deleteWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getCopyrightOwnerId, id);
this.copyrightOwnerVideoContentCatService.remove(deleteWrapper1);
LambdaUpdateWrapper<LearningContentCopyrightOwner> deleteWrapper2 = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(deleteWrapper2);
final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
final List<LearningContentCopyrightOwner> learningContentCopyrightOwnerList = this.learningContentCopyrightOwnerService.list(learningContentCopyrightOwnerLambdaQueryWrapper);
if (learningContentCopyrightOwnerList != null && !learningContentCopyrightOwnerList.isEmpty()) {
LambdaUpdateWrapper<LearningContentCopyrightOwner> deleteWrapper2 = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
this.learningContentCopyrightOwnerService.remove(deleteWrapper2);
if (learningContentCopyrightOwnerList.size() == 1) {
this.learningContentService.removeById(learningContentCopyrightOwnerList.get(0).getLearningContentId());
}
}
return getSuccessResult();
}
......
......@@ -58,6 +58,8 @@ public class ExhibitionBoardCatController extends BaseController {
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentService learningContentService;
@Resource
private LearningContentBoardService learningContentBoardService;
@PostMapping("/save")
......@@ -205,8 +207,16 @@ public class ExhibitionBoardCatController extends BaseController {
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1);
final LambdaQueryWrapper<LearningContentBoardCat> learningContentBoardCatLambdaQueryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
final List<LearningContentBoardCat> learningContentBoardCatList = this.learningContentBoardCatService.list(learningContentBoardCatLambdaQueryWrapper);
if (learningContentBoardCatList != null && !learningContentBoardCatList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoardCat> deleteWrapper1 = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
this.learningContentBoardCatService.remove(deleteWrapper1);
if (learningContentBoardCatList.size() == 1) {
this.learningContentService.removeById(learningContentBoardCatList.get(0).getLearningContentId());
}
}
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper2 = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardCatId, id);
this.learningContentBoardService.remove(deleteWrapper2);
......
......@@ -118,7 +118,6 @@ public class ExhibitionBoardController extends BaseController {
final VideoContent videoContent = this.videoContentService.getById(exhibitionBoard.getVideoContentId());
exhibitionBoard.setVideoContentName(videoContent.getName());
exhibitionBoard.setAuditStatus(AuditStatusEnum.TBC.name());
exhibitionBoard.setPublished(false);
boolean flag = exhibitionBoardService.updateById(exhibitionBoard);
if (flag) {
final List<String> audioIdList = exhibitionBoard.getAudioIdList();
......
......@@ -72,8 +72,10 @@ public class FileUploadController extends BaseController {
final Asset asset = assetService.getById(id);
if (asset != null) {
final String fileUrl = asset.getFileUrl();
final String fileUrlCrypto = asset.getFileUrlCrypto();
try {
FastDFSUtils.deleteFile(fileUrl);
FastDFSUtils.deleteFile(fileUrlCrypto);
} catch (FdfsServerException e) {
this.assetService.removeById(id);
return getResult("文件被已删除");
......@@ -89,7 +91,7 @@ public class FileUploadController extends BaseController {
})
@PostMapping(value = "/datum/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@ApiOperation(value = "展板资料上传", notes = "展板资料上传")
public Map<String, Object> uploadFile(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
public Map<String, Object> uploadDatum(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files == null || files.length == 0) {
return getFailResult("没有文件可供上传");
}
......@@ -284,7 +286,7 @@ public class FileUploadController extends BaseController {
})
@PostMapping(value = "/audio/upload", headers = "content-type=multipart/form-data", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@RequiresAuthentication //@RequiresPermissions("audio:upload")
@ApiOperation(value = "多音频上传", notes = "多音频上传")
@ApiOperation(value = "展板多音频上传", notes = "展板多音频上传")
public Map<String, Object> uploadAudio(@RequestPart(value = "file", required = false) MultipartFile[] files) throws IOException {
if (files == null || files.length == 0) {
return getFailResult("没有文件可供上传");
......@@ -422,9 +424,6 @@ public class FileUploadController extends BaseController {
if (!matchChinese) {
return getFailResult("文件必须包含汉语视频");
}
if (files.length > 5) {
return getFailResult("一种语言只能对应一个文件,只能上传包含5种语言的视频");
}
String videoContentName = null;
String text;
LCSUtil strie = null;
......@@ -559,7 +558,9 @@ public class FileUploadController extends BaseController {
.build();
if (one != null) {
FastDFSUtils.deleteFile(fileUrl);
FastDFSUtils.deleteFile(fileUrlCrypto);
asset.setFileUrl(one.getFileUrl());
asset.setFileUrlCrypto(one.getFileUrl());
}
this.assetService.save(asset);
fileList.add(asset);
......
......@@ -140,12 +140,13 @@ public class LearningProjectController extends BaseController {
@DeleteMapping("/delete/{id}")
@RequiresAuthentication //@RequiresPermissions("learning:project:delete")
@ApiOperation(value = "根据ID下架学习项目", notes = "根据ID下架学习项目")
@ApiOperation(value = "根据ID删除学习项目", notes = "根据ID删除学习项目")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String", required = true)
})
@MethodLog(operModule = OperModule.LEARNPROJECT, operType = OperType.DELETE)
public Map<String, Object> deleteLearningProject(@PathVariable("id") String id) {
this.learningContentService.remove(Wrappers.<LearningContent>lambdaUpdate().eq(LearningContent::getLearningProjectId, id));
this.learningProjectService.removeById(id);
return getSuccessResult();
}
......
......@@ -3,25 +3,25 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
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.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.QueryWrapper;
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.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;
......@@ -64,10 +64,13 @@ public class TAppVersionController extends BaseController {
@ApiOperation(value = "添加", notes = "添加")
@MethodLog(operModule = OperModule.APPVERSION, operType = OperType.ADD)
public Map<String, Object> saveTAppVersion(@Validated(value = {Add.class}) TAppVersion tAppVersion) {
// 默认不为当前版本
TUser user = getcurUser();
// 默认不为当前版本
if (tAppVersion.getIsCurrent() == null){
tAppVersion.setIsCurrent(0);
}
tAppVersion.setUserId(user.getId());
tAppVersion.setUserName(user.getUserName());
// 如果有其他版本是当前版本状态,将其当前版本状态取消
QueryWrapper<TAppVersion> qw = new QueryWrapper<>();
qw.eq("is_current",1);
......
......@@ -5,14 +5,8 @@ import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerVideoContentCat;
import cn.wisenergy.chnmuseum.party.model.VideoContent;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerVideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
......@@ -61,6 +55,9 @@ public class VideoContentCatController extends BaseController {
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
@PostMapping(value = "/save")
@RequiresAuthentication //@RequiresPermissions("video:content:cat:save")
@ApiOperation(value = "添加视频内容分类", notes = "添加视频内容分类")
......@@ -182,6 +179,12 @@ public class VideoContentCatController extends BaseController {
final LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
this.copyrightOwnerVideoContentCatService.remove(updateWrapper1);
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 LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
// final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> eq = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
// final List<CopyrightOwnerVideoContentCat> list = this.copyrightOwnerVideoContentCatService.list(eq);
// final List<String> collect = list.stream().map(CopyrightOwnerVideoContentCat::getCopyrightOwnerId).distinct().collect(Collectors.toList());
......
......@@ -109,8 +109,6 @@ public class VideoContentController extends BaseController {
public Map<String, Object> updateVideoContent(@Validated(value = {Update.class}) VideoContent videoContent) {
TUser user = getcurUser();
videoContent.setAuditStatus(AuditStatusEnum.TBC.name());
videoContent.setPublished(false);
videoContent.setDeleted(false);
boolean flag = videoContentService.updateById(videoContent);
if (flag) {
final List<String> videoFileIdList = videoContent.getVideoFileIdList();
......@@ -147,7 +145,6 @@ public class VideoContentController extends BaseController {
.level(AuditStatusEnum.TBC.name())
.build();
this.auditService.save(audit);
return getSuccessResult();
}
return getFailResult();
......
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