diff --git a/src/main/java/com/zcloud/controller/filemanager/MfolderController.java b/src/main/java/com/zcloud/controller/filemanager/MfolderController.java index 0d7c1be6..38ea1b0e 100644 --- a/src/main/java/com/zcloud/controller/filemanager/MfolderController.java +++ b/src/main/java/com/zcloud/controller/filemanager/MfolderController.java @@ -1,5 +1,6 @@ package com.zcloud.controller.filemanager; +import cn.hutool.core.io.IoUtil; import net.sf.json.JSONArray; import java.io.Console; @@ -10,6 +11,7 @@ import java.util.Map; import javax.servlet.http.HttpServletResponse; +import org.apache.shiro.crypto.hash.SimpleHash; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; @@ -87,7 +89,8 @@ public class MfolderController extends BaseController { @RequestParam(value="NAME",required=false) String NAME, @RequestParam(value="PARENT_ID",required=false) String PARENT_ID, @RequestParam(value="REMARKS",required=false) String REMARKS, - @RequestParam(value="SHARE",required=false) String SHARE + @RequestParam(value="SHARE",required=false) String SHARE, + @RequestParam(value = "DOCUMENTNUMBER",required = false) String DOCUMENTNUMBER ) throws Exception{ Map map = new HashMap(); String errInfo = "success"; @@ -117,6 +120,7 @@ public class MfolderController extends BaseController { pd.put("SHARE", SHARE); //是否共享 pd.put("MFOLDER_ID", this.get32UUID()); //主键 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 + pd.put("DOCUMENTNUMBER",DOCUMENTNUMBER); //文号 mfolderService.save(pd); //存入数据库表 }else{ errInfo = "fail"; @@ -139,7 +143,8 @@ public class MfolderController extends BaseController { @RequestParam(value = "NAME", required = false) String NAME, @RequestParam(value = "PARENT_ID", required = false) String PARENT_ID, @RequestParam(value = "REMARKS", required = false) String REMARKS, - @RequestParam(value = "SHARE", required = false) String SHARE) throws Exception { + @RequestParam(value = "SHARE", required = false) String SHARE, + @RequestParam(value = "DOCUMENTNUMBER",required = false) String DOCUMENTNUMBER) throws Exception { Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); @@ -181,6 +186,7 @@ public class MfolderController extends BaseController { pd.put("SHARE", SHARE); // 是否共享 pd.put("MFOLDER_ID", this.get32UUID()); // 主键 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 + pd.put("DOCUMENTNUMBER",DOCUMENTNUMBER); //文号 mfolderService.save(pd); // 存入数据库表 } else { errInfo = "fail"; @@ -296,7 +302,9 @@ public class MfolderController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 + if (!Const.ONE.equals(pd.getString("CORPINFO_ID"))){ + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 + } String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); String MFOLDER_ID = null; @@ -390,6 +398,33 @@ public class MfolderController extends BaseController { return map; } + /** + * 显示列表ztree + * @return + */ + @RequestMapping(value="/getSupervisionTree") + @ResponseBody + public Object getSupervisionTree()throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + this.initialize(); + pd = this.getPageData(); + String SHARE = pd.getString("SHARE"); + if(!(Tools.notEmpty(SHARE) && "yes".equals(SHARE))) { + pd.put("USERNAME", "admin".equals(Jurisdiction.getUsername())?"":Jurisdiction.getUsername()); //除admin用户外,只能查看自己的数据 + } + pd.put("parentId", "0"); + pd.put("SHARE", SHARE); + pd.put("CORPINFO_ID", "1"); //企业 + JSONArray arr = JSONArray.fromObject(mfolderService.listTree(pd,SHARE)); + String json = arr.toString(); + json = json.replaceAll("MFOLDER_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "name").replaceAll("subMfolder", "nodes").replaceAll("hasMfolder", "checked").replaceAll("treeurl", "url"); + map.put("zTreeNodes", json); + map.put("result", errInfo); + return map; + } + /**预览txt,java,php,等文本文件 * @return */ diff --git a/src/main/java/com/zcloud/util/Const.java b/src/main/java/com/zcloud/util/Const.java index b7f82567..b777f5a4 100644 --- a/src/main/java/com/zcloud/util/Const.java +++ b/src/main/java/com/zcloud/util/Const.java @@ -63,4 +63,5 @@ public class Const { public static final String USER_CITY_CODE = "SESSION_USER_CITY_CODE"; public static final String USER_CITY_NAME = "SESSION_USER_CITY_NAME"; + public static final String ONE = "1"; } diff --git a/src/main/resources/mybatis/datasource/system/MfolderMapper.xml b/src/main/resources/mybatis/datasource/system/MfolderMapper.xml index f2bef523..e8e28920 100644 --- a/src/main/resources/mybatis/datasource/system/MfolderMapper.xml +++ b/src/main/resources/mybatis/datasource/system/MfolderMapper.xml @@ -6,65 +6,68 @@ - + OA_MFOLDER - + SYS_DICTIONARIES - + - f.FILEPATH, - f.CTIME, - f.UNAME, - f.MASTER, - f.FILESIZE, - f.SHARE, - f.REMARKS, + f.FILEPATH, + f.CTIME, + f.UNAME, + f.MASTER, + f.FILESIZE, + f.SHARE, + f.REMARKS, f.MFOLDER_ID, f.PARENT_ID, f.NAME, - f.CORPINFO_ID + f.CORPINFO_ID, + f.DOCUMENTNUMBER - + - FILEPATH, - CTIME, - UNAME, - MASTER, - FILESIZE, - SHARE, - REMARKS, + FILEPATH, + CTIME, + UNAME, + MASTER, + FILESIZE, + SHARE, + REMARKS, MFOLDER_ID, PARENT_ID, NAME, - CORPINFO_ID + CORPINFO_ID, + DOCUMENTNUMBER - + - #{FILEPATH}, - #{CTIME}, - #{UNAME}, - #{MASTER}, - #{FILESIZE}, - #{SHARE}, - #{REMARKS}, + #{FILEPATH}, + #{CTIME}, + #{UNAME}, + #{MASTER}, + #{FILESIZE}, + #{SHARE}, + #{REMARKS}, #{MFOLDER_ID}, #{PARENT_ID}, #{NAME}, - #{CORPINFO_ID} + #{CORPINFO_ID}, + #{DOCUMENTNUMBER} - + - insert into + insert into ( @@ -72,43 +75,43 @@ ) - + delete from - where + where MFOLDER_ID = #{MFOLDER_ID} - + update - set + set SHARE = #{SHARE}, REMARKS = #{REMARKS}, NAME = #{NAME}, MFOLDER_ID = MFOLDER_ID - where + where MFOLDER_ID = #{MFOLDER_ID} - + - + - select + select - from + from f - where - f.PARENT_ID = #{parentId} + where + f.PARENT_ID = #{parentId} @@ -153,43 +156,43 @@ and f.SHARE = 'yes' --> order by FIELD(f.NAME ,'成立组织机构文件','"双控"机制相关文件','风险分布图','风险告知卡','风险分级管控清单(台账)', - '隐患治理信息台账','应急预案','其他') + '隐患治理信息台账','应急预案','其他') - + update - set + set SHARE = #{SHARE} - where + where MFOLDER_ID in #{item} - + - - + + - + - \ No newline at end of file +