This commit is contained in:
parent
c5550d1b3a
commit
dcce4eed4b
|
|
@ -66,7 +66,7 @@ public class DocumentController extends BaseController {
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('tb:document:update')")
|
||||
@PostMapping("/updateDocument")
|
||||
@Log(title = "新增文件夹", businessType = BusinessType.INSERT)
|
||||
@Log(title = "修改文件夹", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult updateDocument(@RequestBody TbDocumentFolder vo) {
|
||||
return service.updateDocument(vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,4 +88,10 @@ public interface DocumentScreenMapper {
|
|||
* @param vo
|
||||
*/
|
||||
void updateDocumentParentId(TbFolderFileVo vo);
|
||||
|
||||
/**
|
||||
* 删除节点数据
|
||||
* @param vo
|
||||
*/
|
||||
void deleteDocumentParentId(TbFolderFileVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -264,7 +264,38 @@ public class DocumentScreenImpl implements DocumentScreenService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult delete(TbFolderFileVo vo) {
|
||||
return null;
|
||||
try{
|
||||
//父节点更新
|
||||
vo.setParentIds(vo.getParentIds().replace(","+vo.getParentId()+",",","+vo.getNewParentId()+","));
|
||||
String userId=SecurityUtils.getUserId().toString();
|
||||
vo.setUserId(userId);
|
||||
if("1".equals(vo.getType())){
|
||||
return AjaxResult.success("当前文件夹不允许删除");
|
||||
}else{
|
||||
//
|
||||
vo.setId(vo.getId().split("_")[2]);
|
||||
//如果是初始化节点
|
||||
if ("0".equals(vo.getParentId())) {
|
||||
TbFolderFileVo data=mapper.getDocumentRealData(vo);
|
||||
if("1".equals(data.getDataType())){
|
||||
return AjaxResult.success("共享及分享的文件夹不允许删除");
|
||||
}
|
||||
mapper.deleteDocumentReal(data);
|
||||
// TbDocumentFolder documentFolder = getTbDocumentFolder(vo, data);
|
||||
// mapper.addDocumentRealUser(documentFolder);
|
||||
}else{
|
||||
/**
|
||||
* 更新夫节点id
|
||||
*/
|
||||
mapper.deleteDocumentParentId(vo);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("删除成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
||||
return AjaxResult.error("删除失败");
|
||||
}
|
||||
|
||||
private TbDocumentFolder getTbDocumentFolder(TbFolderFileVo vo, TbFolderFileVo data) {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="deleteDocumentReal">
|
||||
delete from tb_public_real_user where public_folder_id=#{parentId} and user_id=#{userId} and user_folder_id=#{id}
|
||||
</delete>
|
||||
<delete id="deleteDocumentParentId">
|
||||
update tb_user_document_folder set from del_flag=1 where id=#{id}
|
||||
</delete>
|
||||
<insert id="addDocumnetLables">
|
||||
insert into tb_document_files_label( file_id, label_id, label_name)values (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
|
|
|
|||
Loading…
Reference in New Issue