|
|
|
@ -38,6 +38,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
|
|
|
import org.apache.tomcat.util.http.fileupload.FileItem;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
@ -79,6 +80,10 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
@Autowired
|
|
|
|
|
private DataRoomBizUserDao userDao;
|
|
|
|
|
|
|
|
|
|
@Value("${gc.starter.file.img}")
|
|
|
|
|
private String path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageEntity getByCode(String code) {
|
|
|
|
|
if (code.startsWith(IDataRoomPagePreviewService.PREVIEW_KEY)) {
|
|
|
|
@ -94,7 +99,7 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
|
|
|
|
|
if (!org.springframework.util.StringUtils.hasText(bigScreenPageDTO.getUserId()))
|
|
|
|
|
{
|
|
|
|
|
throw new RuntimeException("userId不能为空!");
|
|
|
|
|
throw new GlobalException("userId不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String code = null;
|
|
|
|
@ -127,6 +132,7 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
BizComponentUser bizComponentUser = new BizComponentUser();
|
|
|
|
|
bizComponentUser.setUserId(bigScreenPageDTO.getUserId());
|
|
|
|
|
bizComponentUser.setCode(code);
|
|
|
|
|
bizComponentUser.setParentCode(bigScreenPageDTO.getParentCode());
|
|
|
|
|
bizComponentUser.setType(bigScreenPageDTO.getType());
|
|
|
|
|
|
|
|
|
|
userDao.insert(bizComponentUser);
|
|
|
|
@ -289,10 +295,12 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public PageVO<PageEntity> getByCategory(DataRoomSearchDTO searchDTO) {
|
|
|
|
|
if (StringUtils.isBlank(searchDTO.getType())) {
|
|
|
|
|
throw new GlobalException("类型不能为空");
|
|
|
|
|
}
|
|
|
|
|
//只查询当前用户的code
|
|
|
|
|
// 使用,分割type
|
|
|
|
|
List<String> types = Lists.newArrayList(searchDTO.getType().split(","));
|
|
|
|
|
LambdaQueryWrapper<PageEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
@ -310,15 +318,13 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
return pageVO;
|
|
|
|
|
}
|
|
|
|
|
List<String> codeList = idEntityList.stream().map(PageEntity::getCode).collect(Collectors.toList());
|
|
|
|
|
List<String> filterByPermission = permissionClient.filterByPermission(codeList,searchDTO.getUserId(),searchDTO.getType());
|
|
|
|
|
List<String> filterByPermission = permissionClient.filterByPermission(codeList,searchDTO.getUserId(),searchDTO.getType(),searchDTO.getParentCode());
|
|
|
|
|
if (filterByPermission == null || filterByPermission.isEmpty()) {
|
|
|
|
|
PageVO<PageEntity> pageVO = new PageVO<>();
|
|
|
|
|
pageVO.setList(Lists.newArrayList());
|
|
|
|
|
return pageVO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<PageEntity> reQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
if (idEntityList.size() == filterByPermission.size()) {
|
|
|
|
|
// 说明没有过滤掉任何一个, 按照原来的条件查询
|
|
|
|
@ -357,13 +363,14 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
}
|
|
|
|
|
PageEntity bigScreenEntity = BeanConvertUtils.convert(bigScreenPageDTO, PageEntity.class);
|
|
|
|
|
bigScreenEntity.setConfig(bigScreenPageDTO);
|
|
|
|
|
AssertUtils.isTrue(!checkNameRepeat(bigScreenEntity), "名称重复");
|
|
|
|
|
AssertUtils.isTrue(!checkNameRepeat(bigScreenEntity), "名称重复");
|
|
|
|
|
AssertUtils.isTrue(!checkCodeRepeat(bigScreenEntity), "编码重复");
|
|
|
|
|
this.updateById(bigScreenEntity);
|
|
|
|
|
PAGE_ENTITY_CACHE.invalidate(bigScreenEntity.getCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public static final String COPY_SUFFIX = "-副本";
|
|
|
|
|
public static final String COPY_SUFFIX = "-副本";
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -429,6 +436,7 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
if (StringUtils.isBlank(copyUrl)) {
|
|
|
|
|
screenEntity.setCoverPicture(null);
|
|
|
|
|
} else {
|
|
|
|
|
//screenEntity.setCoverPicture(path+File.separator+copyUrl);
|
|
|
|
|
screenEntity.setCoverPicture(copyUrl);
|
|
|
|
|
}
|
|
|
|
|
this.save(screenEntity);
|
|
|
|
@ -441,10 +449,30 @@ public class DataRoomPageServiceImpl extends ServiceImpl<DataRoomPageDao, PageEn
|
|
|
|
|
LambdaQueryWrapper<PageEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper.eq(PageEntity::getCode, code);
|
|
|
|
|
this.remove(queryWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<BizComponentUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
//用户ID
|
|
|
|
|
userLambdaQueryWrapper.eq(BizComponentUser::getCode,code);
|
|
|
|
|
userDao.delete(userLambdaQueryWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PAGE_ENTITY_CACHE.invalidate(code);
|
|
|
|
|
// 调用拓展接口
|
|
|
|
|
dataRoomExtendClient.deleteByCode(code);
|
|
|
|
|
// 移除权限拓展
|
|
|
|
|
dataRoomExtendClient.afterDelete(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<PageEntity> selectUserInfoByCode(List<String> collect) {
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<PageEntity> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
queryWrapper.in(PageEntity::getCode,collect);
|
|
|
|
|
List<PageEntity> list = this.list(queryWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|