岗位排序修正

This commit is contained in:
thinkgem
2019-03-13 18:35:47 +08:00
parent fb12bde120
commit d5f42ee183
3 changed files with 567 additions and 537 deletions

View File

@@ -19,7 +19,7 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
@Column(name="post_name", attrName="postName", label="岗位名称"),
@Column(name="post_type", attrName="postType", 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> {

View File

@@ -3,6 +3,9 @@
*/
package com.jeesite.modules.sys.web;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
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.ResponseBody;
import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.collect.MapUtils;
import com.jeesite.common.config.Global;
import com.jeesite.common.entity.Page;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.sys.entity.Post;
import com.jeesite.modules.sys.service.PostService;
@@ -122,5 +128,29 @@ public class PostController extends BaseController {
}
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;
}
}

File diff suppressed because it is too large Load Diff