当前位置:文档之家› 组织机构权限设计和伪代码v0.8

组织机构权限设计和伪代码v0.8

组织机构权限设计和伪代码v0.8
组织机构权限设计和伪代码v0.8

一、登录与权限

1.1 login.jsp 页面提供登录功能,填入用户名密码进入数据库进行登录验证,登录成功跳转到fameset.jsp ,登录失败跳转到错误页面,给出”登录失败”提示信息。

某某系统

用户名

密码 登录 https://www.doczj.com/doc/883764332.html,ername user.password Attributes @userAction https://www.doczj.com/doc/883764332.html,ername user.password

Interface

@userService

Public User login(String username,String password); //us @userDao

Public List login(String username,String password);//ud

Implements @userDaoImpl

from User where username=? and password=? and activity = 1; @userServiceImpl userList = ud.login; If (userList.size>0)

Return userList[0]; Else

Return null; @userAction user = us.login; If(!user){

session.put(user);

Redirect(frameset.jsp);//=>1.2

}Else{

Redirect(message,error.jsp);// =>1.6 }

loginUser.action

loginUser.action 激活 activity.jsp(1.5)?https://www.doczj.com/doc/883764332.html,e rname

1.2 frameset.jsp 这是一个框架页面,它包含上下左右四个页面。

1.3 head.jsp 这是头页面,在系统永远保持显示在最上方。

1.4 left.jsp 这是左侧导航页面,为右侧操作页面做连接跳转导航。 XX 系统 王二,您好! head.jsp (1.3) left.jsp(1.4)

mail.jsp

buttom.jsp

XX 系统 ${https://www.doczj.com/doc/883764332.html,},您好!

导航模块1 子模块1 子模块2 子模块3 导航模块2 导航模块3 导航模块1 导航模块2 子模块4 子模块5 子模块6 导航模块3

Json 对象[{id : ””,name:””, fid : ””,isleaf : ””, url : ””}],构成table 层,table 层js 处理如下。

xx 公司 2013 showModule.action

1.5 activity.jsp 激活页面,用户名从登录页传过来,输入身份证,通过用户名和身份证对该人员身份进行验证,如果验证正确则设置该人员密码,如果验证失败则跳转到error.jsp ,给出“身份验证错误”的提示。

Attributes @moduleAction Interface @moduleService Public List getModulesByUser(int userId); //ms @roleService Public List getRolesByUser(int userId);//rs @userRoleDao Public List getRolesByUser(int userId);//rd @roleModuleDao Public List getModulesByRoles(List roleList);//rmd Implements @userRoleDaoImpl from UserRole,Role where userid=? @roleModuleDaoImpl distinct(Module) from RoleModule,Module where roleid=? and *(roleid=?) @roleServiceImpl Return rd.getRolesByUser; @moduleServiceImpl roleList = rs.getRolesByUser; Return rmd.getModulesByRoles; @moduleAction userId = https://www.doczj.com/doc/883764332.html,er.id; moduleList = ms.getModulesByUser; json =JsonUtil.parse(moduleList); Dispatcher(json,left.jsp);//=>1.4 showModule.action user.idcode user.password surepassword 确定 返回

身份证 设置密码 确认密码

activityUser.action

login.jsp (1.1) https://www.doczj.com/doc/883764332.html,ername:${https://www.doczj.com/doc/883764332.html,ername} 用户名 readonly

Attributes

activityUser.action

@userAction

https://www.doczj.com/doc/883764332.html,ername

user.idcode

user.password

surepassword

Interface

@userService

Public user updateUserForActivity(String username,String idcode,String password, String surepassword); //us

@userDao

Public user getUserByUsernameAndIdcode(String username,String idcode);//ud Implements

@userDaoImpl

From User where username=? and idcode=? and activity = 0;

@userServiceImpl

If(username!=surepassword)

Return null;

user =ud.getUserByUsernameAndIdcode;

If(!user)

Return null;

user.password = password;

user.activity = 1;

ud.update(user);

Return user;

@userAction

user = us.updateUserForActivity;

If(!user){

session.put(user);

Redirect(frameset.jsp);//=>1.2

}Else{

Redirect(message,error.jsp);// =>1.6

}

1.6 error.jsp 这是错误页面,作用是弹出传过来的消息,并返回前一页面。

1.7 authFilter 权限过滤器,真对ContextPath 目录下命名空间为source 的所有资源进行权限验证,那么所有的action 要在source 下,所有的jsp 也要放在source 下。login.jsp,error.jsp,activity.jsp 这样的网页放在ContextPath 下。

Interface

@operatorService

Public List getOperatorsByUser(int userId);//os @roleService

Public List getRolesByUser(int userId);//rs @userRoleDao

Public List getRolesByUser(int userId);//rd @roleOperatorDao

Public List getOperatorsByRoles(List roleList);//od

Implements

@userRoleDaoImpl

from UserRole,Role where userid=? @roleOperatorDaoImpl

distinct(Operator) from RoleOperator,Operator where roleid=? and *(roleid=?) @roleServiceImpl

Return rd.getRolesByUser; @operatorServiceImpl

roleList = rs.getRolesByUser; Return od.getOperatorsByRoles; @authFilter

url = request.getRequsetURl; user = https://www.doczj.com/doc/883764332.html,er; If(!user)

Redirect(login.jsp)//=>1.1 userId=user.id;

operatorList = os.getOperatorsByUser; If(!operatorList.contain(url))

dispatcher(message,error.jsp);//=>1.6 doFilter;

authFilter

过滤器要由spring 接管,解决方案如下。

二、基础信息管理

2.1 Page 分页,基础信息均为简单的增删改查,或外键增删改查。查询涉及到分页。

2.2 车站基础信息维护

map.html/map.swf, 发布一个中国地图服务,含有省必须要素,flex 加载地图、

发布要素服务Transportation (point )

实现功能为在某个省份增加车站点,修改车站点,删除车站点、

2.3 车辆和司机维护

在map.html/map.swf 中,点击一个车站,,flex 传入一个sde_tran_id ,open 一个jsp 页面,通过一个get{1}ListByTran.action,转发到{1}.jsp 页面。车辆维护有指派司机功能。

web.xml

authFilter

org.springframework.web.filter.DelegatingFilterProxy

targetFilterLifecycle true

authFilter /source/* 分页显示实现通过json 对象,对显示的行数,列数可配置。点击表格头可以按照表格头排序,上一页,下一页,首页,尾页的跳转功能。具体实现如下。 新建 标题1 标题2 标题3 操作 xxx xxx xxx 修改 删除 (指派司机)

xxx xxx xxx 修改 删除 (指派司机) xxx xxx xxx 修改 删除 (指派司机)

返回

add{1}.jsp delete{1}.action get{1}ForUpdate.action

update{1}.jsp

getDriversByTran.action updatedrivervechle.jsp

点击保存,跳向保存修改删除的action 后,跳转回get{1}ListByTran.action,转发到{1}.jsp 。 adddriver.jsp/updatedriver.jsp addvechile.jsp/updatevechilejsp

Interface add{1}.action/update{1}.action/delete{1}.action @{1}Serivce Public void add{1}(Object obj); Public void update{1}(Object obj); Public void delete{1}(int id); Public Object get{1}ById(int id);

Public List get{1}ListByTran(int tran_id);

Implements

简单的增删改查,删除时特别注意关系表中的级联删除。 姓名

年龄

电话号 保存 取消

{https://www.doczj.com/doc/883764332.html,} {driver.age} {driver.mpnum} 车牌号

车类型 保存 取消 {vechile.code} {vechile.type} Attributes

tran_id vechile_id Interface @driverService Public List getDriversByVechile(int driverid); //ds Public List getDriversByTran(int tranid ) ; @vechileDriverDao

//查询所有驾驶当前车辆的司机

Public List getDriversByVechile(int driverid);

@driverDao

//查询当前车站所有的司机

Public List getDriversByTran(int tranid ) ;

Implements

@driverAction

返回一个当前车辆所有司机的集合,这些司机有驾驶当前车辆的,

给其加以标示,在页面可以展现区别。

getDriversByTran.action

updatedrivervechle.jsp

2.4 用户基数信息管理

{2}.jsp 包括user 、role 、operator 。通过一个get{2}List.action,转发到{2}.jsp 页面。

当前车辆:{vechile.code } 提交 取消

□ 司机名 电话

? 司机名 电话

□ 司机名 电话

? 司机名 电话

? 司机名 电话

? 司机名 电话

? 司机名 电话

iframe 带滚动条

updateDriverVechile.action Attributes vechileId driverIds[] Interface @vechileService //保存车辆与司机的关系信息 Public void updateDriverVechile(int vechileId,int[] dirverIds); Implements 先删除该车辆的所有关系,再增加新的关系。增加新关系可用循环逐个save ,也可用saveAll. 新建 标题1 标题2 标题3 操作 xxx xxx xxx 修改 删除 xxx xxx xxx 修改 删除 xxx xxx xxx 修改 删除 返回 add{2}.jsp delete{2}.action get{2}ForUpdate.action update{2}.jsp

updateDriverVechile.action

点击保存,跳向保存修改删除的action 后,跳转回get{2}List.action,转发到{2}.jsp 。

2.5 父子模块

getFatherModules.action--->fathermodule.jsp

Interface add{2}.action/update{2}.action/delete{2}.action @{2}Serivce Public void add{2}(Object obj); Public void update{2}(Object obj); Public void delete{2}(int id); Public Object get{2}ById(int id); Public List get{2}List(int id); 新建 模块名 描述 空闲子模块 模块名 操作 xxx 修改及设置子模块 删除 xxx 修改及设置子模块 删除 xxx 修改及设置子模块 删除 返回 getchildModules.action

deleteFatherModules.action Attributes fatherId

Interface

@moduleService

Public List getChildrenModules(int fatherId);

Implements

根据fid 属性查询数据

childModules.action freechildModules.action

Interface

@moduleService

Public List getFatherModules(); @moduleDao

Public List getFatherModules(); Implements

查询fid 为null 的数据

getFatherModules.action

childrenModules.action

freechildrenmodules.jsp addFatherModlue .action

freechildrenmodules.jsp/childerenmodules.jsp :

父模块名: 描述: 新建 返回 模块名 模块地址 描述 操作 xxx xxxxx.action 修改 删除 转移 xxx xxxxx.action 修改 删除 转移

xxx xxxxx.action 修改 删除 转移

返回

Attributes

fatherId

Interface @moduleService Public void deleteFatherModules(int fatherId); deleteFatherModules.action

Interface @moduleService Public List getFreeChildModules();//ms @moduleDao Public List getFreeChildModules(List list); Public Implements @moduleServiceImpl List list = ms.getFatherModules; List list2 = md.getFreeChildModules(list); Return list2; @moduleDaoImpl From Modules where fid not in(list.id,*?); freechildModules.action getModulesForUpdateFid.action deleteChildModule.action

getChildModuleForUpdate.action selectfathermodules.jsp updateChildModule.jsp

Selectfathermodules.jsp

Attributes

id

Interface @moduleService Public void deleteChildModule(int id); deleteChildModule.action Interface @moduleService Public List getFatherModules(); getModulesForUpdateFid.action 选择父模块 ${fmList} 确定 取消 updateChildModule.jsp 模块名 描述

确定 取消

Attributes module.*

Interface

@moduleService

Public void updateModule(Module module);

updateChildModule.action updateChildModule.action

2.6角色与操作/角色与模块配置(roleOperator/roleModule)

getrole{3}List.action ----> role{3}.jsp

updateroleoperators.jsp

角色 描述 操作 xxx xxxxx 配置操作/模块权限 xxx xxxxx 配置操作/模块权限 xxx xxxxx 配置操作/模块权限 返回 角色

确定

get{3}sByRole.action

□ 操作 ? 操作 □ 操作 ? 操作 ? 操作 ? 操作 ? 操作 ? 操作

? 操作

updaterole{3}s.jsp

Attributes roleid Interface @{3}Service Public List get{3}sByRole(int roleid); //ds Public List get{3}s() ; @role{3}Dao //查询所有驾驶当前车辆的司机 Public List get{3}sByRole(int roleid); @driverDao //查询当前车站所有的司机 Public List get{3}() ; Implements @driverAction 查询所有的操作,通过该角色所关联的操作,对所有操作对象进行标识,在页面可以根据表示进行判断。 get{3}sByRole.action updateRole{3}s.action

updaterolemodules.jsp

这里只要实现简单的两级目录关系即可,遵循一下原则,点击父模块是针对子模块进行全选和全消除。只要子模块有一个选中,父模块就变为选中,子模块全为取消,父模块变为取消。保存关系时,只需获取子模块id 。

三、业务功能管理

派车:选择两个车站,第一个为起始点,第二个为目的地。弹出一个表单,填入此次任务的具体信息,包括时间。分为两种情况,出车,返车。

出车:起始地为车辆所属车站,且在起始地的车辆;起始地为司机所属车站,且在起始地的司机。

角色 确定 ? 父模块 ? 子模块 ? 子模块 □ 子模块 ? 子模块 □ 父模块 □ 子模块 □ 子模块 □ 子模块 □ 子模块 □ 子模块 Attributes

roleId {3}Ids[] Interface @{3}Service //保存车辆与司机的关系信息 Public void updateRole{3}(int roleId,int[] {3}Ids); Implements 先删除该角色的所有模块/操作关系,再增加新的关系。增加新关系可用循环逐个save ,也可用saveAll. updateRole{3}s.action

updateRole{3}s.action

返车:目的地为车辆所属车辆,且在起始地的车辆;目的地为司机所属车站,且在起始地的司机。

查询

1.某一车站下所属该车站的所有车辆,当前在车站的所有车辆,当前在车站且属于该车站的车辆。

2.某一车站下所属该车站的所有司机,当前在车站的所有司机,当前在车站切属于该车站的司机。

3.某车站一段时间历史出车情况(列表),当前车辆分部情况(flex)。

4.某车出车一段时间历史出车情况(列表),该车现在情况(flex)。

5.某司机一段事件历史出车情况(列表),该车司机现在情况(flex)。

四、表结构

T_driver

T_module

T_operator

SDE_province

T_role

T_role_module

T_transportation

T_user

T_user_role

T_vechile

T_role_operator

T_order

相关主题