Commit 69f008f1 authored by 李松's avatar 李松

应急大屏法律法规卡片添加orgCode过滤

parent cb7d17c8
......@@ -104,10 +104,11 @@ public class DocCategoryResource {
@ApiOperation(value = "文档分类树查询-携带文档基本信息(包含根节点信息)")
@RequestMapping(value = "/tree-extra", method = RequestMethod.GET)
public ResponseModel<Collection> docCategoryTreeExtra(@RequestParam(value = "root", required = false) Long root,
@RequestParam(value = "onlyPublish", defaultValue = "true", required = false) Boolean onlyPublish) {
@RequestParam(value = "onlyPublish", defaultValue = "true", required = false) Boolean onlyPublish,
@RequestParam(value = "orgCode",required = false)String orgCode) {
if (ValidationUtil.isEmpty(root)) {
root = DocCategoryService.ROOT;
}
return ResponseHelper.buildResponse(docCategoryService.queryDocCategoryTreeExtra(RequestContext.getAgencyCode(), root, onlyPublish));
return ResponseHelper.buildResponse(docCategoryService.queryDocCategoryTreeExtra(RequestContext.getAgencyCode(), root, onlyPublish,orgCode));
}
}
......@@ -190,10 +190,11 @@ public class DocContentResource {
@RequestParam(value = "auditStatus", required = false) String[] auditStatus,
@RequestParam(value = "docStatus", required = false) String docStatus,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
@RequestParam(value = "createTimeRight", required = false) String createTimeRight,
@RequestParam(value = "orgCode", required = false) String orgCode) {
Map requestMap = request.getParameterMap();
Page page = docLibraryService.queryDocList(offset, end, directoryId, docTitle, auditStatus, docStatus,
requestMap, createTimeLeft, createTimeRight, false, true);
requestMap, createTimeLeft, createTimeRight, false, true, orgCode);
return ResponseHelper.buildResponse(page);
}
......@@ -219,7 +220,7 @@ public class DocContentResource {
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(docContentService.queryLikeOrDis(sequenceNbr));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取简单的预案信息")
@RequestMapping(value = "/getSimpleDetail/{sequenceNbr}", method = RequestMethod.GET)
......
......@@ -63,10 +63,11 @@ public class DocLibraryResource {
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
@RequestParam(value = "createTimeRight", required = false) String createTimeRight,
@RequestParam(value = "orgCode", required = false) String orgCode) {
Map requestMap = request.getParameterMap();
Page page = docLibraryService.queryDocList(offset, end, directoryId, docTitle, null, Constants.DOC_STATUS_PUBLISHED,
requestMap, createTimeLeft, createTimeRight, Boolean.parseBoolean(filterByCollection), false);
requestMap, createTimeLeft, createTimeRight, Boolean.parseBoolean(filterByCollection), false, orgCode);
return ResponseHelper.buildResponse(page);
}
......
......@@ -17,5 +17,5 @@ import java.util.List;
*/
public interface DocCategoryMapper extends BaseMapper<KnowledgeDocCategory> {
List<MultipleNodeModel> queryDocAndCategoryTree(@Param("categoryIds") List<Long> categoryIds, @Param("docStatus") String docStatus);
List<MultipleNodeModel> queryDocAndCategoryTree(@Param("categoryIds") List<Long> categoryIds, @Param("docStatus") String docStatus, @Param("orgCode")String orgCode);
}
\ No newline at end of file
......@@ -190,7 +190,7 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
return this.queryForList("", false, parentId);
}
public Collection queryDocCategoryTreeExtra(String agencyCode, Long root, Boolean onlyPublish) {
public Collection queryDocCategoryTreeExtra(String agencyCode, Long root, Boolean onlyPublish, String orgCode) {
KnowledgeDocCategoryModel rootCategory = null;
if (root != null && !ROOT.equals(root)) {
rootCategory = this.queryBySeq(root);
......@@ -204,7 +204,7 @@ public class DocCategoryService extends BaseService<KnowledgeDocCategoryModel, K
List<KnowledgeDocCategoryModel> allChildren = TreeUtil.getAllChildren(categoryTree);
if (!allChildren.isEmpty()) {
List<Long> directoryIds = BaseUtil.getModelIds(allChildren);
List<MultipleNodeModel> multipleNodeModels = this.baseMapper.queryDocAndCategoryTree(directoryIds, onlyPublish ? Constants.DOC_STATUS_PUBLISHED : null);
List<MultipleNodeModel> multipleNodeModels = this.baseMapper.queryDocAndCategoryTree(directoryIds, onlyPublish ? Constants.DOC_STATUS_PUBLISHED : null, orgCode);
return TreeBuilder.buildByRecursive(multipleNodeModels, null == rootCategory ? root : rootCategory.getParentId());
}
}
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.knowledgebase.face.service;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
......@@ -134,11 +135,14 @@ public class DocLibraryService {
}
public Page queryDocList(int offset, int end, Long directoryId, String docTitle, String[] auditStatus, String docStatus,
Map<String, String[]> requestMap, String createTimeLeft, String createTimeRight, boolean favor, boolean permission) {
Map<String, String[]> requestMap, String createTimeLeft, String createTimeRight, boolean favor, boolean permission, String orgCode) {
Map<String, Object> paramsMap = new HashMap<>();
paramsMap.put("userId", RequestContext.getExeUserId());
paramsMap.put("start", offset);
paramsMap.put("limit", end > offset ? end - offset + 1 : 50);
if (!ObjectUtils.isEmpty(orgCode)) {
paramsMap.put("orgCode", orgCode);
}
// 封装权限过滤条件
if (permission) {
addPermissionFilters(paramsMap);
......
......@@ -10,6 +10,9 @@
FROM
knowledge_doc_content kdc
<where>
<if test="orgCode != null and orgCode != ''">
kdc.ORG_CODE like concat(#{orgCode}, '%')
</if>
<if test="docStatus != null and docStatus.length > 0">
AND DOC_STATUS = #{docStatus}
</if>
......@@ -37,5 +40,5 @@
</if>
</where>
</select>
</mapper>
......@@ -139,6 +139,9 @@
<if test="commonFilters.createTimeRight != null">
AND CREATE_TIME <![CDATA[<=]]> #{commonFilters.createTimeRight}
</if>
<if test="orgCode != null and orgCode != ''">
AND doct.ORG_CODE like concat(#{orgCode}, '%')
</if>
</if>
<if test="collect != null">
AND collect = #{collect}
......@@ -228,6 +231,9 @@
<if test="commonFilters.createTimeRight != null">
AND CREATE_TIME <![CDATA[<=]]> #{commonFilters.createTimeRight}
</if>
<if test="orgCode != null and orgCode != ''">
AND doct.ORG_CODE like concat(#{orgCode}, '%')
</if>
</if>
<if test="collect != null">
AND collect = #{collect}
......
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