岗位排序修正
This commit is contained in:
@@ -19,7 +19,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
|||||||
@Column(name="post_name", attrName="postName", label="岗位名称"),
|
@Column(name="post_name", attrName="postName", label="岗位名称"),
|
||||||
@Column(name="post_type", attrName="postType", label="岗位分类", comment="岗位分类(高管、中层、基层)"),
|
@Column(name="post_type", attrName="postType", label="岗位分类", comment="岗位分类(高管、中层、基层)"),
|
||||||
@Column(name="post_sort", attrName="postSort", label="岗位排序", comment="岗位排序(升序)"),
|
@Column(name="post_sort", attrName="postSort", label="岗位排序", comment="岗位排序(升序)"),
|
||||||
}, orderBy="a.update_date DESC"
|
}, orderBy="a.post_sort ASC"
|
||||||
)
|
)
|
||||||
public class Post extends DataEntity<Post> {
|
public class Post extends DataEntity<Post> {
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.jeesite.modules.sys.web;
|
package com.jeesite.modules.sys.web;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@@ -17,8 +20,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.jeesite.common.collect.ListUtils;
|
||||||
|
import com.jeesite.common.collect.MapUtils;
|
||||||
import com.jeesite.common.config.Global;
|
import com.jeesite.common.config.Global;
|
||||||
import com.jeesite.common.entity.Page;
|
import com.jeesite.common.entity.Page;
|
||||||
|
import com.jeesite.common.lang.StringUtils;
|
||||||
import com.jeesite.common.web.BaseController;
|
import com.jeesite.common.web.BaseController;
|
||||||
import com.jeesite.modules.sys.entity.Post;
|
import com.jeesite.modules.sys.entity.Post;
|
||||||
import com.jeesite.modules.sys.service.PostService;
|
import com.jeesite.modules.sys.service.PostService;
|
||||||
@@ -123,4 +129,28 @@ public class PostController extends BaseController {
|
|||||||
return Global.FALSE;
|
return Global.FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取岗位树结构数据
|
||||||
|
* @param isAll 是否显示所有机构(true:不进行权限过滤)
|
||||||
|
* @param isShowCode 是否显示编码(true or 1:显示在左侧;2:显示在右侧;false or null:不显示)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("user")
|
||||||
|
@RequestMapping(value = "treeData")
|
||||||
|
@ResponseBody
|
||||||
|
public List<Map<String, Object>> treeData(String userType, String isShowCode, String ctrlPermi) {
|
||||||
|
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||||
|
Post where = new Post();
|
||||||
|
where.setStatus(Post.STATUS_NORMAL);
|
||||||
|
List<Post> list = postService.findList(where);
|
||||||
|
list.forEach(e -> {
|
||||||
|
Map<String, Object> map = MapUtils.newHashMap();
|
||||||
|
map.put("id", e.getId());
|
||||||
|
map.put("pId", "0");
|
||||||
|
map.put("name", StringUtils.getTreeNodeName(isShowCode, e.getPostCode(), e.getPostName()));
|
||||||
|
mapList.add(map);
|
||||||
|
});
|
||||||
|
return mapList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
1072
web/db/test.erm
1072
web/db/test.erm
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user