|
@@ -3,10 +3,7 @@ package com.doc.biz.service.impl;
|
|
|
import com.doc.biz.domain.DocFavorite;
|
|
|
import com.doc.biz.domain.DocInfo;
|
|
|
import com.doc.biz.mapper.DocInfoMapper;
|
|
|
-import com.doc.biz.service.IDocFavoriteService;
|
|
|
-import com.doc.biz.service.IDocInfoService;
|
|
|
-import com.doc.biz.service.IDocSpaceService;
|
|
|
-import com.doc.biz.service.IElasticSearchService;
|
|
|
+import com.doc.biz.service.*;
|
|
|
import com.doc.biz.vo.DocumentVO;
|
|
|
import com.doc.common.utils.DateUtils;
|
|
|
import com.doc.common.utils.SecurityUtils;
|
|
@@ -33,6 +30,8 @@ public class DocInfoServiceImpl implements IDocInfoService {
|
|
|
private IDocSpaceService spaceService;
|
|
|
@Resource
|
|
|
private IDocFavoriteService favoriteService;
|
|
|
+ @Resource
|
|
|
+ private IDocDirService dirService;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -43,7 +42,11 @@ public class DocInfoServiceImpl implements IDocInfoService {
|
|
|
*/
|
|
|
@Override
|
|
|
public DocInfo selectDocInfoByDocId(Long docId) {
|
|
|
- return docInfoMapper.selectDocInfoByDocId(docId);
|
|
|
+ DocInfo info = docInfoMapper.selectDocInfoByDocId(docId);
|
|
|
+ String unloading = "l0400";
|
|
|
+ //是否允许转存
|
|
|
+ info.setUnloading(dirService.hasRole(info.getDirId(), unloading));
|
|
|
+ return info;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -137,7 +140,11 @@ public class DocInfoServiceImpl implements IDocInfoService {
|
|
|
checkDuplicateNames(docInfo);
|
|
|
|
|
|
int i = docInfoMapper.insertDocInfo(docInfo);
|
|
|
- elasticSearchService.save(docInfo);
|
|
|
+ String allowSearch = "l0300";
|
|
|
+ if (dirService.hasRole(docInfo.getDirId(), allowSearch)) {
|
|
|
+ //只有允许全文搜索的才会存入ES库,否则不存入
|
|
|
+ elasticSearchService.save(docInfo);
|
|
|
+ }
|
|
|
//改变空间容量
|
|
|
spaceService.updateUsedCap(docInfo.getSpaceId());
|
|
|
return i;
|