Commit ff681ad2 authored by liqin's avatar liqin 💬

bug fixed

parent afc63bb1
......@@ -52,6 +52,12 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
@Resource
private LearningContentBoardService learningContentBoardService;
@Resource
private LearningContentBoardCatService learningContentBoardCatService;
@Resource
private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
@Override
public Page<Audit> getUserList(Page<Audit> page, TUser user) {
return page.setRecords(auditMapper.getUserList(page, user));
......@@ -240,7 +246,8 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.videoContentService.updateById(videoContent);
break;
case REMOVE:
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getVideoContentId, videoContent.getId());
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().eq(Audit::getRefItemId, videoContentId));
final LambdaQueryWrapper<ExhibitionBoard> queryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getVideoContentId, videoContentId);
queryWrapper.select(ExhibitionBoard::getId);
final List<String> ExhibitionBoardIdList = this.exhibitionBoardService.listObjs(queryWrapper, Object::toString);
this.exhibitionBoardService.removeByIds(ExhibitionBoardIdList);
......@@ -285,7 +292,10 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.exhibitionBoardService.updateById(exhibitionBoard);
break;
case REMOVE:
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().eq(Audit::getRefItemId, exhibitionBoardId));
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getExhibitionBoardId, exhibitionBoard.getId()));
update = this.exhibitionBoardService.removeById(exhibitionBoardId);
break;
case ADD:
......@@ -327,6 +337,10 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
update = this.learningContentService.updateById(learningContent);
break;
case REMOVE:
this.auditMapper.delete(Wrappers.<Audit>lambdaUpdate().eq(Audit::getRefItemId, learningContentId));
this.learningContentBoardService.remove(Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, learningContentId));
this.learningContentBoardCatService.remove(Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, learningContentId));
this.learningContentCopyrightOwnerService.remove(Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, learningContentId));
update = this.learningContentService.removeById(learningContentId);
break;
case ADD:
......
......@@ -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();
......
......@@ -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")
......@@ -312,6 +308,9 @@ public class CopyrightOwnerController extends BaseController {
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));
}
});
......
......@@ -61,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")
......@@ -200,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);
......@@ -211,9 +223,12 @@ public class ExhibitionBoardCatController extends BaseController {
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) -> {
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));
}
});
......
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);
......
......@@ -45,18 +45,24 @@ public class VideoContentCatController extends BaseController {
@Resource
private CopyrightOwnerVideoContentCatService copyrightOwnerVideoContentCatService;
@Resource
private VideoContentCatService videoContentCatService;
@Resource
private VideoContentService videoContentService;
@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;
@PostMapping(value = "/save")
@RequiresAuthentication //@RequiresPermissions("video:content:cat:save")
......@@ -172,18 +178,41 @@ 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 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);
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);
// final LambdaQueryWrapper<CopyrightOwnerVideoContentCat> eq = Wrappers.<CopyrightOwnerVideoContentCat>lambdaQuery().eq(CopyrightOwnerVideoContentCat::getVideoContentCatId, id);
// final List<CopyrightOwnerVideoContentCat> list = this.copyrightOwnerVideoContentCatService.list(eq);
......
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