Commit dae93097 authored by jiawei's avatar jiawei

Merge branch 'dev' of http://111.203.232.171:8888/lee/chnmuseum-party

 Conflicts:
	src/main/java/cn/wisenergy/chnmuseum/party/service/impl/AuditServiceImpl.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/CopyrightOwnerController.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardCatController.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/ExhibitionBoardController.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/LearningContentController.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TAppVersionController.java
	src/main/java/cn/wisenergy/chnmuseum/party/web/controller/VideoContentController.java
parents 8dfd02d3 0e99e11c
......@@ -3,10 +3,10 @@ package cn.wisenergy.chnmuseum.party.common.enums;
public enum LanguageEnum {
ZH("Chinese", "汉语"),
EN("English", "英语"),
MN("Mongolian", "蒙语"),
BO("Tibetan", "藏语"),
UYG("Uyghur", "维吾尔语"),
EN("English", "英语");
UYG("Uyghur", "维吾尔语");
// 错误编码
private String code;
......
......@@ -83,10 +83,6 @@ public class Audit implements Serializable {
@TableField(value = "second_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime secondTime;
@ApiModelProperty("0:未删除,1:已删除")
@TableField("is_deleted")
private Boolean deleted;
@ApiModelProperty("初审意见")
@TableField("first_remarks")
private String firstRemarks;
......
......@@ -56,7 +56,7 @@ public class TBoxOperation implements Serializable {
@TableField("public_key")
private String publicKey;
@ApiModelProperty(hidden = true)
@ApiModelProperty("机顶盒密钥")
@TableField("private_key")
private String privateKey;
......
......@@ -2,22 +2,22 @@ package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.util.RSAUtils;
import cn.wisenergy.chnmuseum.party.mapper.TAreaMapper;
import cn.wisenergy.chnmuseum.party.mapper.TUserMapper;
import cn.wisenergy.chnmuseum.party.model.TBoxOperation;
import cn.wisenergy.chnmuseum.party.model.TUser;
import cn.wisenergy.chnmuseum.party.mapper.TUserMapper;
import cn.wisenergy.chnmuseum.party.model.TUserRole;
import cn.wisenergy.chnmuseum.party.service.TUserService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -74,7 +74,7 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
TUser user = tUserMapper.getById(id);
if (user.getAreaId() != null) {
String s = areaMapper.selectParent(user.getAreaId());
if (s!=null) {
if (s != null) {
user.setAreas(Arrays.asList(s.split(",")));
}
}
......@@ -83,15 +83,13 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
@Override
public List<TUser> getUserList(TUser user) {
List<TUser> list = tUserMapper.getUserList(user);
return list;
return tUserMapper.getUserList(user);
}
@Override
public boolean addBox(TUser user) {
boolean ret = false;
ret = save(user);
boolean ret;
save(user);
TBoxOperation tBoxOperation = new TBoxOperation();
tBoxOperation.setOrganId(user.getOrgId());
......@@ -99,6 +97,9 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
tBoxOperation.setStatus(1);
tBoxOperation.setCreateTime(LocalDateTime.now());
tBoxOperation.setUpdateTime(LocalDateTime.now());
final ArrayList<String> rsaKeys = RSAUtils.createRSAKeys();
tBoxOperation.setPublicKey(rsaKeys.get(0));
tBoxOperation.setPrivateKey(rsaKeys.get(1));
ret = boxOperationService.save(tBoxOperation);
TUserRole userRole = new TUserRole();
......
......@@ -143,7 +143,7 @@ public class AssetController extends BaseController {
}
@ApiOperation(value = "导出所有机顶盒的文件加密密钥", notes = "导出所有机顶盒的文件加密密钥")
@PostMapping("/downloadCipher")
@GetMapping("/downloadCipher")
@RequiresAuthentication
@MethodLog(operModule = OperModule.VIDEOREMIT, operType = OperType.VIDEO_EXPORT)
public void downloadCipher(HttpServletResponse response) throws IOException {
......
......@@ -40,10 +40,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
......@@ -330,12 +327,12 @@ public class ChinaMobileRestApiController extends BaseController {
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "boardId", value = "展板内容ID", paramType = "path", dataType = "String", required = true)
@ApiImplicitParam(name = "boardId", value = "展板内容ID", paramType = "query", dataType = "String", required = true)
})
@ApiOperation(value = "查询某个展板语言列表", notes = "查询某个展板语言列表")
@GetMapping(value = "/exhibitionBoard/language/{boardId}")
@GetMapping(value = "/exhibitionBoard/language")
@RequiresAuthentication
public Map<String, Object> getLanguageList(@PathVariable(value = "boardId") String boardId) {
public Map<String, Object> getLanguageList(@RequestParam(value = "boardId") String boardId) {
JSONObject resultMap = new JSONObject();
List<Map<String, String>> list = new ArrayList<>();
try {
......@@ -344,22 +341,24 @@ public class ChinaMobileRestApiController extends BaseController {
final LambdaQueryWrapper<Asset> eq = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
final List<Asset> assetList = this.assetService.list(eq);
final List<String> languageList = assetList.stream().map(Asset::getLanguage).collect(Collectors.toList());
for (String language : languageList) {
Map<String, String> map = new HashMap<>(2);
map.put("code", LanguageEnum.valueOf(language).name());
map.put("name", LanguageEnum.valueOf(language).getName());
for (LanguageEnum languageEnum : LanguageEnum.values()) {
if (languageList.contains(languageEnum.name())) {
Map<String, String> map = new LinkedHashMap<>(1);
map.put("code", languageEnum.name());
map.put("name", languageEnum.getName());
list.add(map);
}
}
resultMap.put("resultCode", "200");
resultMap.put("message", "成功");
resultMap.put("data", list);
return resultMap;
} catch (Exception e) {
resultMap.put("resultCode", "500");
resultMap.put("message", "失败");
resultMap.put("message", "该展板已下架");
resultMap.put("data", "");
}
return getFailResult();
return getFailResult("该展板已下架");
}
@ApiImplicitParams(value = {
......
......@@ -47,30 +47,26 @@ public class CopyrightOwnerController extends BaseController {
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private VideoContentCatService videoContentCatService;
@Resource
private VideoContentService videoContentService;
@Resource
private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource
private CopyrightOwnerBoardCatService copyrightOwnerBoardCatService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private LearningContentService learningContentService;
@Resource
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("copyright:owner:save")
......@@ -308,12 +304,18 @@ public class CopyrightOwnerController extends BaseController {
final LambdaQueryWrapper<LearningContentCopyrightOwner> learningContentCopyrightOwnerLambdaQueryWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaQuery().eq(LearningContentCopyrightOwner::getCopyrightOwnerId, id);
final List<LearningContentCopyrightOwner> learningContentCopyrightOwnerList = this.learningContentCopyrightOwnerService.list(learningContentCopyrightOwnerLambdaQueryWrapper);
if (learningContentCopyrightOwnerList != null && !learningContentCopyrightOwnerList.isEmpty()) {
final Map<String, List<String>> collect = learningContentCopyrightOwnerList.stream().collect(Collectors.groupingBy(LearningContentCopyrightOwner::getLearningContentId, Collectors.mapping(LearningContentCopyrightOwner::getCopyrightOwnerId, Collectors.toList())));
collect.forEach((k , v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
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();
......
......@@ -50,8 +50,6 @@ public class ExhibitionBoardCatController extends BaseController {
@Resource
private ExhibitionBoardService exhibitionBoardService;
@Resource
private ExhibitionBoardTmpService exhibitionBoardTmpService;
@Resource
private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
......@@ -63,6 +61,10 @@ public class ExhibitionBoardCatController extends BaseController {
private LearningContentService learningContentService;
@Resource
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private AuditService auditService;
@PostMapping("/save")
@RequiresAuthentication //@RequiresPermissions("exhibition:board:cat:save")
......@@ -202,9 +204,17 @@ public class ExhibitionBoardCatController extends BaseController {
public Map<String, Object> deleteExhibitionBoardCat(@PathVariable("id") String id) {
this.exhibitionBoardCatService.removeById(id);
final LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getExhibitionBoardCatId, id).select(ExhibitionBoard::getId);
final List<String> exhibitionBoardIdList = this.exhibitionBoardService.listObjs(lambdaQueryWrapper, Object::toString);
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
final LambdaUpdateWrapper<ExhibitionBoard> updateWrapper = Wrappers.<ExhibitionBoard>lambdaUpdate().eq(ExhibitionBoard::getExhibitionBoardCatId, id);
updateWrapper.set(ExhibitionBoard::getDeleted, true);
this.exhibitionBoardService.update(updateWrapper);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, exhibitionBoardIdList));
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper3 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, exhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper3);
}
LambdaUpdateWrapper<CopyrightOwnerBoardCat> deleteWrapper = Wrappers.<CopyrightOwnerBoardCat>lambdaUpdate().eq(CopyrightOwnerBoardCat::getBoardCatId, id);
this.copyrightOwnerBoardCatService.remove(deleteWrapper);
......@@ -212,21 +222,23 @@ public class ExhibitionBoardCatController extends BaseController {
final LambdaQueryWrapper<LearningContentBoardCat> learningContentBoardCatLambdaQueryWrapper = Wrappers.<LearningContentBoardCat>lambdaQuery().eq(LearningContentBoardCat::getExhibitionBoardCatId, id);
final List<LearningContentBoardCat> learningContentBoardCatList = this.learningContentBoardCatService.list(learningContentBoardCatLambdaQueryWrapper);
if (learningContentBoardCatList != null && !learningContentBoardCatList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardCatList.stream().collect(Collectors.groupingBy(LearningContentBoardCat::getLearningContentId, Collectors.mapping(LearningContentBoardCat::getExhibitionBoardCatId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
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);
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);
// updateWrapper.set(VideoContent::getDeleted, true);
// this.videoContentService.update(updateWrapper);
......
......@@ -3,26 +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;
......
package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil;
import cn.wisenergy.chnmuseum.party.common.log.MethodLog;
import cn.wisenergy.chnmuseum.party.common.log.OperModule;
import cn.wisenergy.chnmuseum.party.common.log.OperType;
......@@ -19,7 +18,6 @@ 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.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.*;
......@@ -140,9 +138,6 @@ public class TBoxOperationController extends BaseController {
resultMap.put("message", "此mac地址已绑定账号!");
return resultMap;
}
final ArrayList<String> rsaKeys = RSAUtils.createRSAKeys();
tBoxOperation.setPublicKey(rsaKeys.get(0));
tBoxOperation.setPrivateKey(rsaKeys.get(1));
}
if (3==tBoxOperation.getStatus()) {
tBoxOperation.setMac(null);
......
......@@ -21,7 +21,6 @@ import cn.wisenergy.chnmuseum.party.service.impl.TBoxOperationServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.TOrganServiceImpl;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -30,10 +29,7 @@ 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.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -458,7 +454,6 @@ public class TUserController extends BaseController {
audit.setType(AuditTypeEnum.ACCOUNT.name());
audit.setOperation(AuditOperationEnum.DISABLE.name());
audit.setStatus(AuditStatusEnum.TBC.name());
audit.setDeleted(false);
audit.setLevel(AuditStatusEnum.TBC.name());
audit.setCreateTime(LocalDateTime.now());
auditService.save(audit);
......
......@@ -45,18 +45,27 @@ public class VideoContentCatController extends BaseController {
@Resource
private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource
private VideoContentCatService videoContentCatService;
@Resource
private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Resource
private LearningContentService learningContentService;
@Resource
private AuditService auditService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
......@@ -175,9 +184,38 @@ public class VideoContentCatController extends BaseController {
public Map<String, Object> deleteVideoContentCat(@PathVariable("id") String id) {
this.videoContentCatService.removeById(id);
final LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, id).select(VideoContent::getId);
final List<String> videoContentIdList = this.videoContentService.listObjs(lambdaQueryWrapper, Object::toString);
if (videoContentIdList != null && !videoContentIdList.isEmpty()) {
final LambdaUpdateWrapper<VideoContent> updateWrapper = Wrappers.<VideoContent>lambdaUpdate().eq(VideoContent::getVideoContentCatId, id);
updateWrapper.set(VideoContent::getDeleted, true);
this.videoContentService.update(updateWrapper);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, videoContentIdList));
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().in(ExhibitionBoard::getVideoContentId, videoContentIdList).select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
if (ExhibitionBoardIdList != null && !ExhibitionBoardIdList.isEmpty()) {
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
this.auditService.remove(Wrappers.<Audit>lambdaUpdate().in(Audit::getRefItemId, ExhibitionBoardIdList));
final LambdaQueryWrapper<LearningContentBoard> learningContentBoardLambdaQueryWrapper = Wrappers.<LearningContentBoard>lambdaQuery().in(LearningContentBoard::getExhibitionBoardCatId, ExhibitionBoardIdList);
final List<LearningContentBoard> learningContentBoardList = this.learningContentBoardService.list(learningContentBoardLambdaQueryWrapper);
if (learningContentBoardList != null && !learningContentBoardList.isEmpty()) {
final Map<String, List<String>> collect = learningContentBoardList.stream().collect(Collectors.groupingBy(LearningContentBoard::getLearningContentId, Collectors.mapping(LearningContentBoard::getExhibitionBoardId, Collectors.toList())));
collect.forEach((k, v) -> {
if (v.size() == 1) {
this.learningContentService.removeById(k);
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, k));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, k));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, k));
}
});
LambdaUpdateWrapper<LearningContentBoard> deleteWrapper1 = Wrappers.<LearningContentBoard>lambdaUpdate().in(LearningContentBoard::getExhibitionBoardId, ExhibitionBoardIdList);
this.learningContentBoardService.remove(deleteWrapper1);
}
}
}
final LambdaUpdateWrapper<CopyrightOwnerVideoContentCat> updateWrapper1 = Wrappers.<CopyrightOwnerVideoContentCat>lambdaUpdate().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
this.copyrightOwnerVideoContentCatService.remove(updateWrapper1);
......
......@@ -10,7 +10,6 @@ import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.*;
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;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -45,25 +44,14 @@ public class VideoContentController extends BaseController {
@Resource
private ExhibitionBoardService exhibitionBoardService;
@Resource
private VideoContentService videoContentService;
@Resource
private VideoContentTmpService videoContentTmpService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private VideoContentCatService videoContentCatService;
@Resource
private AssetService assetService;
@Resource
private AssetTmpService assetTmpService;
@Resource
private AuditService auditService;
......@@ -105,7 +93,6 @@ public class VideoContentController extends BaseController {
.type(AuditTypeEnum.VIDEO_CONTENT.name())
.operation(AuditOperationEnum.ADD.name())
.status(AuditStatusEnum.TBC.name())
.deleted(false)
.level(AuditStatusEnum.TBC.name())
.build();
this.auditService.save(audit);
......@@ -119,26 +106,46 @@ public class VideoContentController extends BaseController {
@ApiOperation(value = "修改视频内容信息", notes = "修改视频内容信息")
@MethodLog(operModule = OperModule.VIDEOCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateVideoContent(@Validated(value = {Update.class}) VideoContent videoContent) {
final boolean flag = this.videoContentTmpService.save(VideoContentTmp.builder().id(videoContent.getId()).data(JSONObject.toJSONString(videoContent)).build());
TUser user = getcurUser();
videoContent.setAuditStatus(AuditStatusEnum.TBC.name());
boolean flag = videoContentService.updateById(videoContent);
if (flag) {
final VideoContent one = this.videoContentService.getById(videoContent.getId());
one.setAuditStatus(AuditStatusEnum.TBC.name());
this.videoContentService.updateById(one);
final List<String> videoFileIdList = videoContent.getVideoFileIdList();
if (videoFileIdList != null && !videoFileIdList.isEmpty()) {
final LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContent.getId());
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()
.content(videoContent.getName())
.userId(getcurUser().getId())
.userId(user.getId())
.refItemId(videoContent.getId())
.type(AuditTypeEnum.VIDEO_CONTENT.name())
.operation(AuditOperationEnum.EDIT.name())
.status(AuditStatusEnum.TBC.name())
.deleted(false)
.level(AuditStatusEnum.TBC.name())
.build();
this.auditService.save(audit);
return getSuccessResult();
}
return getFailResult("提交失败!上次提交的修改申请已经在审核中");
return getFailResult();
}
@GetMapping("/getExhibitionBoardById/{id}")
......@@ -290,49 +297,6 @@ public class VideoContentController extends BaseController {
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}")
@RequiresAuthentication //@RequiresPermissions("video:content:delete")
@ApiOperation(value = "根据ID删除视频内容", notes = "根据ID删除视频内容")
......@@ -349,7 +313,6 @@ public class VideoContentController extends BaseController {
.type(AuditTypeEnum.VIDEO_CONTENT.name())
.operation(AuditOperationEnum.REMOVE.name())
.status(AuditStatusEnum.TBC.name())
.deleted(false)
.level(AuditStatusEnum.TBC.name())
.build();
final boolean result = this.auditService.save(audit);
......
......@@ -15,7 +15,6 @@
<result column="create_time" property="createTime"/>
<result column="first_time" property="firstTime"/>
<result column="second_time" property="secondTime"/>
<result column="is_deleted" property="deleted"/>
<result column="first_remarks" property="firstRemarks"/>
<result column="second_remarks" property="secondRemarks"/>
<result column="level" property="level"/>
......@@ -40,7 +39,6 @@
<if test="user.orgCode != null and user.orgCode != ''">
and o.code LIKE concat(#{user.orgCode}, '%')
</if>
and a.is_deleted = false
and a.type = 'ACCOUNT'
and a.operation = 'DISABLE'
order by a.create_time desc
......
......@@ -40,7 +40,7 @@
</select>
<select id="selectBoxPage" resultMap="BaseResultMap">
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name,a.full_name area_name,u.permanent permanent,
select b.id,b.organ_id,b.mac,b.status,b.area_id,b.private_key,b.create_time,b.update_time,u.user_name organ_name,a.full_name area_name,u.permanent permanent,
u.effective_date effective_date,u.exired_date exired_date
from t_box_operation b
left join t_organ o on b.organ_id = o.id
......@@ -63,7 +63,7 @@
</select>
<select id="selectPageList" resultMap="BaseResultMap">
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.create_time,b.update_time,u.user_name organ_name
SELECT b.id,b.organ_id,b.mac,b.status,b.area_id,b.private_key,b.create_time,b.update_time,u.user_name organ_name
FROM t_box_operation b
left join t_organ r on r.id = b.organ_id
left join t_user u on u.org_id = b.organ_id and u.type = '3'
......
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