Browse Source

知识库

master
yanyan 3 years ago
parent
commit
b44015674f
  1. 28
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/add.html
  2. 30
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/detail.html
  3. 26
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/edit.html
  4. 44
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/view.html
  5. 121
      lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/KnowledgeLibraryController.java
  6. 1
      lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/impl/KnowledgeLibraryServiceImpl.java

28
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/add.html

@ -21,21 +21,21 @@
<input class="form-control" type="text" name="subTitle" id="subTitle" required> <input class="form-control" type="text" name="subTitle" id="subTitle" required>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-2 control-label is-required">标签:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <select id="flag" class="form-control select2-multiple" multiple>-->
<!-- <option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:disabled="${f.status == '1'}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label is-required">标签:</label> <!-- <label class="col-sm-2 control-label is-required">类型:</label>-->
<div class="col-sm-10"> <!-- <div class="col-sm-4">-->
<select id="flag" class="form-control select2-multiple" multiple> <!-- <select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}">-->
<option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:disabled="${f.status == '1'}"></option> <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
</select> <!-- </select>-->
</div> <!-- </div>-->
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">类型:</label>
<div class="col-sm-4">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
<label class="col-sm-2 control-label is-required">置顶:</label> <label class="col-sm-2 control-label is-required">置顶:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<select name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}"> <select name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}">

30
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/detail.html

@ -28,22 +28,22 @@
<input class="form-control" type="text" name="subTitle" id="subTitle" th:field="*{subTitle}" disabled required> <input class="form-control" type="text" name="subTitle" id="subTitle" th:field="*{subTitle}" disabled required>
</div> </div>
</div> </div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-2 control-label is-required">标签:</label>-->
<!-- <div class="col-sm-10">-->
<!-- <select id="flag" class="form-control select2-multiple" multiple>-->
<!-- <option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:selected="${f.isDefault} eq 'Y'" th:disabled="${f.status == '1'}"></option>-->
<!-- &lt;!&ndash; <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>&ndash;&gt;-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label is-required">标签:</label> <!-- <label class="col-sm-2 control-label is-required">类型:</label>-->
<div class="col-sm-10"> <!-- <div class="col-sm-4">-->
<select id="flag" class="form-control select2-multiple" multiple> <!-- <select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}" disabled>-->
<option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:selected="${f.isDefault} eq 'Y'" th:disabled="${f.status == '1'}"></option> <!-- <option th:field="*{type}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>--> <!-- </select>-->
</select> <!-- </div>-->
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">类型:</label>
<div class="col-sm-4">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}" disabled>
<option th:field="*{type}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
<label class="col-sm-2 control-label is-required">置顶:</label> <label class="col-sm-2 control-label is-required">置顶:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<select id="pinned" name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}" disabled> <select id="pinned" name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}" disabled>

26
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/edit.html

@ -23,21 +23,21 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label is-required">标签:</label> <!-- <label class="col-sm-2 control-label is-required">标签:</label>-->
<div class="col-sm-10"> <!-- <div class="col-sm-10">-->
<select id="flag" class="form-control select2-multiple" multiple> <!-- <select id="flag" class="form-control select2-multiple" multiple>-->
<option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:selected="${f.isDefault} eq 'Y'" th:disabled="${f.status == '1'}"></option> <!-- <option th:each="f:${dicts}" th:value="${f.dictValue}" th:text="${f.dictLabel}" th:selected="${f.isDefault} eq 'Y'" th:disabled="${f.status == '1'}"></option>-->
<!-- <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>--> <!--&lt;!&ndash; <option th:each="post:${posts}" th:value="${post.postId}" th:text="${post.postName}" th:selected="${post.flag}" th:disabled="${post.status == '1'}"></option>&ndash;&gt;-->
</select> <!-- </select>-->
</div> <!-- </div>-->
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label is-required">类型:</label> <!-- <label class="col-sm-2 control-label is-required">类型:</label>-->
<div class="col-sm-4"> <!-- <div class="col-sm-4">-->
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}"> <!-- <select name="type" class="form-control m-b" th:with="type=${@dict.getType('knowledge_type')}">-->
<option th:field="*{type}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <!-- <option th:field="*{type}" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
</select> <!-- </select>-->
</div> <!-- </div>-->
<label class="col-sm-2 control-label is-required">置顶:</label> <label class="col-sm-2 control-label is-required">置顶:</label>
<div class="col-sm-4"> <div class="col-sm-4">
<select id="pinned" name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}"> <select id="pinned" name="pinned" class="form-control m-b" th:with="type=${@dict.getType('is_pinned')}">

44
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/smallProgram/library/view.html

@ -111,21 +111,21 @@
field: 'title', field: 'title',
title: '标题' title: '标题'
}, },
{ // {
field: 'flag', // field: 'flag',
title: '标签', // title: '标签',
align: 'center', // align: 'center',
formatter: function (value, row, index) { // formatter: function (value, row, index) {
var tmp = ""; // var tmp = "";
for(var i=0; i<knowledgeFlags.length; i++) { // for(var i=0; i<knowledgeFlags.length; i++) {
if(value.indexOf(knowledgeFlags[i].dictValue) > -1) { // if(value.indexOf(knowledgeFlags[i].dictValue) > -1) {
tmp += knowledgeFlags[i].dictLabel+","; // tmp += knowledgeFlags[i].dictLabel+",";
} // }
} // }
return tmp.slice(0, tmp.length-1); // return tmp.slice(0, tmp.length-1);
// return $.table.selectDictLabel(knowledgeFlags, value); // // return $.table.selectDictLabel(knowledgeFlags, value);
} // }
}, // },
{ {
field : 'status', field : 'status',
title : '状态', title : '状态',
@ -134,13 +134,13 @@
return $.table.selectDictLabel(statuss, value); return $.table.selectDictLabel(statuss, value);
} }
}, },
{ // {
field : 'type', // field : 'type',
title : '类型', // title : '类型',
formatter : function (value, row, index) { // formatter : function (value, row, index) {
return $.table.selectDictLabel(types, value); // return $.table.selectDictLabel(types, value);
} // }
}, // },
{ {
field : 'pinned', field : 'pinned',
title : '置顶', title : '置顶',

121
lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/controller/KnowledgeLibraryController.java

@ -1,16 +1,10 @@
package com.zdxt.knowledge.controller; package com.zdxt.knowledge.controller;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.zdxt.auth.dto.DictDataBean; import com.zdxt.auth.dto.DictDataBean;
import com.zdxt.auth.feign.DictDataApi; import com.zdxt.auth.feign.DictDataApi;
import com.zdxt.common.ZDResponse; import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController; import com.zdxt.common.controller.BaseController;
import com.zdxt.common.util.TableDataInfo; import com.zdxt.common.util.TableDataInfo;
import com.zdxt.flow.util.DateUtil;
import com.zdxt.knowledge.domain.KnowledgeLibrary;
import com.zdxt.knowledge.domain.KnowledgeLibrary; import com.zdxt.knowledge.domain.KnowledgeLibrary;
import com.zdxt.knowledge.service.IKnowledgeLibraryService; import com.zdxt.knowledge.service.IKnowledgeLibraryService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -21,25 +15,29 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/** /**
* 知识库Controller * 知识库Controller
* *
* @author ruoyi * @author ruoyi
* @date 2023-12-25 * @date 2023-12-25
*/ */
@Controller @Controller
@RequestMapping("/small/library") @RequestMapping("/small/library")
public class KnowledgeLibraryController extends BaseController public class KnowledgeLibraryController extends BaseController {
{
private String prefix = "project/smallProgram/library"; private String prefix = "project/smallProgram/library";
@Autowired private IKnowledgeLibraryService knowledgeLibraryService; @Autowired
@Autowired private DictDataApi dictDataApi; private IKnowledgeLibraryService knowledgeLibraryService;
@Autowired
private DictDataApi dictDataApi;
@RequiresPermissions("small:library:view") @RequiresPermissions("small:library:view")
@GetMapping() @GetMapping()
public String library() public String library() {
{
return prefix + "/view"; return prefix + "/view";
} }
@ -49,19 +47,39 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("small:library:view") @RequiresPermissions("small:library:view")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(KnowledgeLibrary knowledgeLibrary) public TableDataInfo list(KnowledgeLibrary knowledgeLibrary) {
{ startPage();
List<KnowledgeLibrary> list = knowledgeLibraryService.selectKnowledgeLibraryList(knowledgeLibrary);
return getDataTable(list);
}
/**
* 查询小程序
*/
@PostMapping("/listApp")
@ResponseBody
public TableDataInfo listApp(@RequestBody KnowledgeLibrary knowledgeLibrary) {
startPage(); startPage();
knowledgeLibrary.setPublishstate(1);
List<KnowledgeLibrary> list = knowledgeLibraryService.selectKnowledgeLibraryList(knowledgeLibrary); List<KnowledgeLibrary> list = knowledgeLibraryService.selectKnowledgeLibraryList(knowledgeLibrary);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询
*/
@PostMapping("/getById")
@ResponseBody
public ZDResponse getById(@RequestBody KnowledgeLibrary knowledgeLibrary) {
KnowledgeLibrary library = knowledgeLibraryService.selectKnowledgeLibraryById(knowledgeLibrary.getGuid());
return ZDResponse.success("成功", library);
}
/** /**
* 新增知识库 * 新增知识库
*/ */
@GetMapping("/add") @GetMapping("/add")
public String add(ModelMap mmap) public String add(ModelMap mmap) {
{
DictDataBean dictBean = new DictDataBean(); DictDataBean dictBean = new DictDataBean();
dictBean.setDictType("knowledge_flag"); dictBean.setDictType("knowledge_flag");
mmap.put("dicts", dictDataApi.getDictData(dictBean)); mmap.put("dicts", dictDataApi.getDictData(dictBean));
@ -74,18 +92,16 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("small:library:add") @RequiresPermissions("small:library:add")
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
public ZDResponse addSave(@RequestParam("file") MultipartFile[] files, @Validated KnowledgeLibrary knowledgeLibrary) public ZDResponse addSave(@RequestParam("file") MultipartFile[] files, @Validated KnowledgeLibrary knowledgeLibrary) {
{
int resNum = knowledgeLibraryService.insertKnowledgeLibrary(knowledgeLibrary, files); int resNum = knowledgeLibraryService.insertKnowledgeLibrary(knowledgeLibrary, files);
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
* 修改知识库 * 修改知识库
*/ */
@GetMapping("/edit/{guid}") @GetMapping("/edit/{guid}")
public String edit(@PathVariable("guid") String guid, ModelMap mmap) public String edit(@PathVariable("guid") String guid, ModelMap mmap) {
{
KnowledgeLibrary knowledgeLibrary = knowledgeLibraryService.selectKnowledgeLibraryById(guid); KnowledgeLibrary knowledgeLibrary = knowledgeLibraryService.selectKnowledgeLibraryById(guid);
mmap.put("knowledgeLibrary", knowledgeLibrary); mmap.put("knowledgeLibrary", knowledgeLibrary);
@ -93,7 +109,7 @@ public class KnowledgeLibraryController extends BaseController
dictBean.setDictType("knowledge_flag"); dictBean.setDictType("knowledge_flag");
List<DictDataBean> dictDataBeans = dictDataApi.getDictData(dictBean); List<DictDataBean> dictDataBeans = dictDataApi.getDictData(dictBean);
for (DictDataBean dictb : dictDataBeans) { for (DictDataBean dictb : dictDataBeans) {
if (knowledgeLibrary.getFlag().indexOf(dictb.getDictValue())>-1) { if (knowledgeLibrary.getFlag().indexOf(dictb.getDictValue()) > -1) {
dictb.setIsDefault("Y"); dictb.setIsDefault("Y");
} else { } else {
dictb.setIsDefault("N"); dictb.setIsDefault("N");
@ -109,18 +125,16 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("small:library:edit") @RequiresPermissions("small:library:edit")
@PostMapping("/edit") @PostMapping("/edit")
@ResponseBody @ResponseBody
public ZDResponse editSave(@RequestParam("file") MultipartFile[] files, KnowledgeLibrary knowledgeLibrary) public ZDResponse editSave(@RequestParam("file") MultipartFile[] files, KnowledgeLibrary knowledgeLibrary) {
{
int resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledgeLibrary, files); int resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledgeLibrary, files);
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
* 知识库详情 * 知识库详情
*/ */
@GetMapping("/detail/{guid}") @GetMapping("/detail/{guid}")
public String detail(@PathVariable("guid") String guid, ModelMap mmap) public String detail(@PathVariable("guid") String guid, ModelMap mmap) {
{
KnowledgeLibrary knowledgeLibrary = knowledgeLibraryService.selectKnowledgeLibraryById(guid); KnowledgeLibrary knowledgeLibrary = knowledgeLibraryService.selectKnowledgeLibraryById(guid);
mmap.put("knowledgeLibrary", knowledgeLibrary); mmap.put("knowledgeLibrary", knowledgeLibrary);
@ -128,7 +142,7 @@ public class KnowledgeLibraryController extends BaseController
dictBean.setDictType("knowledge_flag"); dictBean.setDictType("knowledge_flag");
List<DictDataBean> dictDataBeans = dictDataApi.getDictData(dictBean); List<DictDataBean> dictDataBeans = dictDataApi.getDictData(dictBean);
for (DictDataBean dictb : dictDataBeans) { for (DictDataBean dictb : dictDataBeans) {
if (knowledgeLibrary.getFlag().indexOf(dictb.getDictValue())>-1) { if (knowledgeLibrary.getFlag().indexOf(dictb.getDictValue()) > -1) {
dictb.setIsDefault("Y"); dictb.setIsDefault("Y");
} else { } else {
dictb.setIsDefault("N"); dictb.setIsDefault("N");
@ -142,12 +156,11 @@ public class KnowledgeLibraryController extends BaseController
* 删除知识库 * 删除知识库
*/ */
@RequiresPermissions("small:library:remove") @RequiresPermissions("small:library:remove")
@PostMapping( "/remove") @PostMapping("/remove")
@ResponseBody @ResponseBody
public ZDResponse remove(String ids) public ZDResponse remove(String ids) {
{
int resNum = knowledgeLibraryService.deleteKnowledgeLibraryByIds(ids); int resNum = knowledgeLibraryService.deleteKnowledgeLibraryByIds(ids);
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
@ -156,10 +169,9 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("small:library:edit") @RequiresPermissions("small:library:edit")
@PostMapping("/toPublishState") @PostMapping("/toPublishState")
@ResponseBody @ResponseBody
public ZDResponse toPublishState(String ids, String state) public ZDResponse toPublishState(String ids, String state) {
{
int resNum = knowledgeLibraryService.updatePublishState(ids, state); int resNum = knowledgeLibraryService.updatePublishState(ids, state);
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
@ -168,14 +180,13 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("custom:image:edit") @RequiresPermissions("custom:image:edit")
@PostMapping("/changeUp") @PostMapping("/changeUp")
@ResponseBody @ResponseBody
public ZDResponse changeUp(KnowledgeLibrary knowledge) public ZDResponse changeUp(KnowledgeLibrary knowledge) {
{ int resNum = knowledgeLibraryService.updateSrot(knowledge.getSrot(), knowledge.getSrot() + 1);
int resNum = knowledgeLibraryService.updateSrot(knowledge.getSrot(), knowledge.getSrot()+1);
if (resNum > 0) { if (resNum > 0) {
knowledge.setSrot(knowledge.getSrot()+1); knowledge.setSrot(knowledge.getSrot() + 1);
resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledge); resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledge);
} }
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
@ -184,44 +195,46 @@ public class KnowledgeLibraryController extends BaseController
@RequiresPermissions("custom:image:edit") @RequiresPermissions("custom:image:edit")
@PostMapping("/changeUnder") @PostMapping("/changeUnder")
@ResponseBody @ResponseBody
public ZDResponse changeUnder(KnowledgeLibrary knowledge) public ZDResponse changeUnder(KnowledgeLibrary knowledge) {
{ int resNum = knowledgeLibraryService.updateSrot(knowledge.getSrot(), knowledge.getSrot() - 1);
int resNum = knowledgeLibraryService.updateSrot(knowledge.getSrot(), knowledge.getSrot()-1);
if (resNum > 0) { if (resNum > 0) {
knowledge.setSrot(knowledge.getSrot()-1); knowledge.setSrot(knowledge.getSrot() - 1);
resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledge); resNum = knowledgeLibraryService.updateKnowledgeLibrary(knowledge);
} }
return resNum>0?ZDResponse.success("操作成功", resNum):ZDResponse.error("操作失败", resNum); return resNum > 0 ? ZDResponse.success("操作成功", resNum) : ZDResponse.error("操作失败", resNum);
} }
/** /**
* 查询附件信息 * 查询附件信息
*
* @param key * @param key
* @return * @return
*/ */
@GetMapping( "/queryFiles/{key}") @GetMapping("/queryFiles/{key}")
@ResponseBody @ResponseBody
public ZDResponse queryFiles(@PathVariable String key){ public ZDResponse queryFiles(@PathVariable String key) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("filePreview", knowledgeLibraryService.queryFiles(key)); map.put("filePreview", knowledgeLibraryService.queryFiles(key));
return ZDResponse.success("获取成功",map); return ZDResponse.success("获取成功", map);
} }
/** /**
* 查询附件信息 * 查询附件信息
*
* @param key * @param key
* @return * @return
*/ */
@PostMapping( "/queryFilesPost") @PostMapping("/queryFilesPost")
@ResponseBody @ResponseBody
public ZDResponse queryFilesPost(String key){ public ZDResponse queryFilesPost(String key) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("filePreview", knowledgeLibraryService.queryFiles(key)); map.put("filePreview", knowledgeLibraryService.queryFiles(key));
return ZDResponse.success("获取成功",map); return ZDResponse.success("获取成功", map);
} }
/** /**
* 删除案例要素附件 * 删除案例要素附件
*
* @param key * @param key
* @return * @return
*/ */
@ -252,8 +265,8 @@ public class KnowledgeLibraryController extends BaseController
@GetMapping("/getFlowEP") @GetMapping("/getFlowEP")
@ResponseBody @ResponseBody
public ZDResponse getFlowEV(String id){ public ZDResponse getFlowEV(String id) {
KnowledgeLibrary library = knowledgeLibraryService.selectKnowledgeLibraryById(id); KnowledgeLibrary library = knowledgeLibraryService.selectKnowledgeLibraryById(id);
return ZDResponse.success("",library); return ZDResponse.success("", library);
} }
} }

1
lib/EmergencyService/zdxtEmergencyKnowledgeService/src/main/java/com/zdxt/knowledge/service/impl/KnowledgeLibraryServiceImpl.java

@ -77,7 +77,6 @@ public class KnowledgeLibraryServiceImpl implements IKnowledgeLibraryService
// 上传文件,并在附件表中添加记录 // 上传文件,并在附件表中添加记录
if (resNum > 0 && ObjectUtil.isNotEmpty(files)) { if (resNum > 0 && ObjectUtil.isNotEmpty(files)) {
for (MultipartFile file : files) { for (MultipartFile file : files) {
// todo 将原有关联附件删除在重新上传比较好
zdxtFileCommonApi.insertZdxtFile(file, knowledgeLibrary.getGuid(), fileUploadApi.upload(file)); zdxtFileCommonApi.insertZdxtFile(file, knowledgeLibrary.getGuid(), fileUploadApi.upload(file));
} }
} }

Loading…
Cancel
Save