Commit df1004a5 by caowenda

添加登陆之后的页面 修改样式

parent 1e3c13c4
......@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
......@@ -31,6 +32,31 @@ public class userController {
* @Param:
* @return
**/
@RequestMapping(value = "toIndex")
public String toIndex(){
return "bpm/index";
}
/**
* @Author:cwd
* @Description:进入组织管理
* @Date: 2019/03/04 22:53
* @Param:
* @return
**/
@RequestMapping(value = "welcome")
public String welcome(){
return "bpm/welcome";
}
/**
* @Author:cwd
* @Description:进入组织管理
* @Date: 2019/03/04 22:53
* @Param:
* @return
**/
@RequestMapping(value = "toOrganization")
public String toOrganization(){
return "user/organizationList";
......@@ -136,7 +162,9 @@ public class userController {
/**
* @Author:cwd
* 删除组织及下级
* @Date: 2019/03/04 22:53
* @param id
* @param pId
* @return
......@@ -160,5 +188,20 @@ public class userController {
}
/**
* @Author:cwd
* 获取左侧树
* @Date: 2019.3.7
* @return
*/
@RequestMapping(value = "/menuList",method = RequestMethod.GET)
@ResponseBody
public Result menuList(){
Result result= userInfoService.getMenuList();
return result;
}
}
......@@ -5,6 +5,7 @@ import com.bbd.bpm.base.BaseMapper;
import com.bbd.bpm.domain.BpmCompany;
import com.bbd.bpm.domain.BpmEmployee;
import com.bbd.bpm.vo.BpmCompanyVo;
import com.bbd.bpm.vo.MenuVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
......@@ -23,4 +24,6 @@ public interface MemberMapper extends BaseMapper<BpmEmployee>{
List<BpmCompanyVo> getAllMemberList(@Param("id") Integer id, @Param("name") String name);
List<Map<String,Object>> getAreaAll(@Param("id") Integer id);
List<MenuVO> selectMenuList();
}
......@@ -62,4 +62,16 @@
parent_id=#{id}
</select>
<select id="selectMenuList" resultType="com.bbd.bpm.vo.MenuVO">
SELECT
u.id,
u.menu_name AS menuName,
u.menu_url AS menuUrl,
u.parent_id AS parentId
FROM
bpm_menu u
ORDER BY
u.sequence ASC
</select>
</mapper>
\ No newline at end of file
package com.bbd.bpm.domain;
import com.bbd.bpm.base.BaseEntity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Table;
/**
* Created by cwd on 2019/03/07.
* 菜单表
* @Copyright 2018 BaiBangDa All rights reserved.
*/
@Data
@Table(name="bpm_menu")
public class Menu extends BaseEntity {
/**
*菜单名称
*/
@Column(name = "menu_name")
private String menuName;
/**
* 菜单地址
*/
@Column(name = "menu_url")
private String menuUrl;
/**
* 菜单父id
*/
@Column(name = "parent_id")
private Long parentId;
/**
* 菜单顺序
*/
@Column(name = "sequence")
private Long sequence;
}
......@@ -66,4 +66,12 @@ public interface UserInfoService {
* @return
*/
Result getAreaAll(Integer id);
/**
* @Author:cwd
* 获取左侧树
* @Date: 2019.3.7
* @return
*/
Result getMenuList();
}
......@@ -10,8 +10,10 @@ import com.bbd.bpm.result.Result;
import com.bbd.bpm.result.ResultUtil;
import com.bbd.bpm.service.UserInfoService;
import com.bbd.bpm.vo.BpmCompanyVo;
import com.bbd.bpm.vo.MenuVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.activiti.editor.language.json.converter.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -251,4 +253,55 @@ public class UserInfoServiceImpl implements UserInfoService{
return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR);
}
}
/**
* @Author:cwd
* 获取左侧树
* @Date: 2019.3.7
* @return
*/
@Override
public Result getMenuList() {
try {
List<MenuVO> list = memberMapper.selectMenuList();
return ResultUtil.returnSuccess("菜单返回成功",getMenuTree(list));
}catch (Exception e){
e.printStackTrace();
return ResultUtil.getResult(RespCode.Code.INTERNAL_SERVER_ERROR);
}
}
/**
* 获取菜单树
* @param menuVos
* @return
*/
public static List<MenuVO> getMenuTree(List<MenuVO> menuVos) {
List<MenuVO> treeList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(menuVos)) {
for (MenuVO vo : menuVos) {
if (null != vo.getParentId() && Long.valueOf(0).equals(vo.getParentId())) {
vo = getChildMenu(vo,menuVos);
treeList.add(vo);
}
}
}
return treeList;
}
private static MenuVO getChildMenu(MenuVO parent, List<MenuVO> menuVos) {
List<MenuVO> child = null;
for (MenuVO vo : menuVos) {
if (parent.getId().equals(vo.getParentId())) {
vo = getChildMenu(vo, menuVos);
if (child == null) {
child = new ArrayList<>();
}
child.add(vo);
}
}
parent.setChild(child);
return parent;
}
}
package com.bbd.bpm.vo;
import lombok.Data;
import javax.persistence.Column;
import java.util.List;
/**
* Created by cwd on 2019/3/7
* @Copyright 2018 BaiBangDa All rights reserved.
*/
@Data
public class MenuVO {
private Long id;
/**
*菜单名称
*/
@Column(name = "menu_name")
private String menuName;
/**
* 菜单地址
*/
@Column(name = "menu_url")
private String menuUrl;
/**
* 菜单父id
*/
@Column(name = "parent_id")
private Long parentId;
/**
* 菜单顺序
*/
@Column(name = "sequence")
private Long sequence;
/**
* 子菜单
*/
private List<MenuVO> child;
}
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>BPM后台管理系统</title>
<link rel="stylesheet" type="text/css" th:href="@{/css/common/models.css}">
</head>
<body>
<div class="MainContent">
<div class="current">当前位置:<span>管理首页</span></div>
<div class="MainCont MainWel">
<div class="welcon">欢迎使用BPM后台管理系统</div>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment