소스 검색

公告办公室新增部门和人员选择数据修改

user5 4 년 전
부모
커밋
f17fe4e750

+ 1 - 0
src/main/java/com/jeeplus/modules/oa/web/OaNotifyController.java

@@ -168,6 +168,7 @@ public class OaNotifyController extends BaseController {
         }
 		oaNotify.setContent("");
 		model.addAttribute("oaNotify", oaNotify);
+		model.addAttribute("flagOffice", oaNotify.getFlagOffice());
 		if(StringUtils.isNotBlank(view)&& "view".equals(view)){
 			//查看登陆者访问该公告信息
 			OaNotifyView oaNotifyView = oaNotifyService.getOaNotifyView(oaNotify.getId(), UserUtils.getUser().getId());

+ 9 - 0
src/main/java/com/jeeplus/modules/sys/service/OfficeService.java

@@ -69,6 +69,15 @@ public class OfficeService extends TreeService<OfficeDao, Office> {
 			return UserUtils.getOfficeList();
 		}
 	}
+
+	/**
+	 * 查询所有部门信息
+	 * @return
+	 */
+	public List<Office> findListByOaNotify(){
+		return officeDao.findAllList(new Office());
+	}
+
 	public List<Office> findListIndex(Office office){
 		User user = UserUtils.getUser();
 		if(user.isAdmin()){

+ 8 - 2
src/main/java/com/jeeplus/modules/sys/web/OfficeController.java

@@ -444,9 +444,15 @@ public class OfficeController extends BaseController {
     @ResponseBody
     @RequestMapping(value = "treeData")
     public List<Map<String, Object>> treeData(@RequestParam(required = false) String extId, @RequestParam(required = false) String type,
-                                              @RequestParam(required = false) Long grade, @RequestParam(required = false) Boolean isAll, HttpServletResponse response) {
+                                              @RequestParam(required = false) Long grade, @RequestParam(required = false) Boolean isAll,@RequestParam(required = false) Integer flagOffice, HttpServletResponse response) {
         List<Map<String, Object>> mapList = Lists.newArrayList();
-        List<Office> list = officeService.findList(isAll);
+        List<Office> list = Lists.newArrayList();
+        //判断参数(新增公告时使用,1为办公室新增,能够查询所有部门信息)
+        if(null == flagOffice || 1 != flagOffice){
+            list = officeService.findList(isAll);
+        }else{
+            list = officeService.findListByOaNotify();
+        }
         for (int i = 0; i < list.size(); i++) {
             Office e = list.get(i);
             if ((StringUtils.isBlank(extId) || (extId != null && !extId.equals(e.getId()) && e.getParentIds().indexOf("," + extId + ",") == -1))

+ 1 - 0
src/main/java/com/jeeplus/modules/sys/web/TagController.java

@@ -33,6 +33,7 @@ public class TagController extends BaseController {
 		model.addAttribute("isAll", request.getParameter("isAll")); 	// 是否读取全部数据,不进行权限过滤
 		model.addAttribute("module", request.getParameter("module"));	// 过滤栏目模型(仅针对CMS的Category树)
 		model.addAttribute("branchOffice", request.getParameter("branchOffice"));	// 过滤栏目模型(仅针对CMS的Category树)
+		model.addAttribute("flagOffice", request.getParameter("flagOffice"));	// 过滤栏目模型(仅针对CMS的Category树)
 		return "modules/sys/tagTreeselect";
 	}
 

+ 1 - 1
src/main/webapp/WEB-INF/tags/sys/treeselectoffices.tag

@@ -47,7 +47,7 @@
 		    area: ['300px', '420px'],
 		    title:"选择${title}",
 		    ajaxData:{selectIds: $("#${id}Id").val()},
-		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&selectIds="+selectIds ,
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&flagOffice=${flagOffice}&selectIds="+selectIds ,
 		    btn: ['确定', '关闭']
     	       ,yes: function(index, layero){ //或者使用btn1
 						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();

+ 1 - 1
src/main/webapp/WEB-INF/tags/sys/treeselectusers.tag

@@ -43,7 +43,7 @@
 		    area: ['300px', '420px'],
 		    title:"选择${title}",
 		    ajaxData:{selectIds: $("#${id}Id").val()},
-		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&selectIds="+selectIds ,
+		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&flagOffice=${flagOffice}&selectIds="+selectIds ,
 		    btn: ['确定', '关闭']
     	       ,yes: function(index, layero){ //或者使用btn1
 						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();

+ 1 - 1
src/main/webapp/webpage/modules/sys/tagTreeselect.jsp

@@ -48,7 +48,7 @@
 		}
 		$(document).ready(function(){
 			$.get("${ctx}${url}${fn:indexOf(url,'?')==-1?'?':'&'}&extId=${extId}&isAll=${isAll}&module=${module}&t="
-					+ new Date().getTime()+"&branchOffice=${branchOffice}", function(zNodes){
+					+ new Date().getTime()+"&flagOffice=${flagOffice}"+"&branchOffice=${branchOffice}", function(zNodes){
 				// 初始化树结构
 				tree = $.fn.zTree.init($("#tree"), setting, zNodes);