PowerDesigner是Sybase公司的一款软件,使用它可以方便地对系统进行分析设计,他几乎包括了数据库模型设计的全过程。利用PowerDesigner可以制作数据流程图、概念数据模型、物理数据模型、面向对象模型。在项目设计阶段通常会使用PowerDesigner进行数据库设计。使用PowerDesigner可以更加直观的表现出数据库中表之间的关系,并且可以直接导出相应的建表语句。
以最简单的角色表为例,生成t_role表
(1)创建数据模型PDM
(2)选择数据库类型
(3)选择区域->右键new->table->指定表名
(4)创建字段
(5)设置某个字段属性,在字段上右键(如主键,外键)
效果如下
可以通过PowerDesigner设计的PDM模型导出为SQL脚本,如下:选择Database中的Generate Database
选择放置位置和文件名称,如下所示。
文件打开如下:
根据以上步骤可以生成项目所需要的所有的数据库表格。效果如下:
表格展示:
官网网址:https://element.eleme.cn/#/zh-CN
ElementUI是一套基于VUE2.0的桌面端组件库,ElementUI提供了丰富的组件帮助开发人员快速构建功能强大、风格统一的页面。
在页面上引入 js 和 css 文件即可开始使用,如下 :
Title
标题
菜单
功能区域
底部
Title
下拉菜单
退出系统
修改密码
联系管理员
Title
导航一
选项1
选项2
选项3
导航二
选项1
选项2
选项3
用于展示多条结构类似的数据,可对数据进行排序、筛选、对比或其他自定义操作。
示例:
Title
编辑
删除
Title
编辑
删除
Title
编辑
删除
Title
基础的、简洁的标签页
用户管理
配置管理
角色管理
定时任务补偿
选项卡样式的标签页
用户管理
配置管理
角色管理
定时任务补偿
卡片化的标签页
用户管理
配置管理
角色管理
定时任务补偿
由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据。在 Form 组件中,每一个表单域由一个 Form-Item 组件构成,表单域中可以放置各种类型的表单控件,包括 Input、Select、Checkbox、Radio、Switch、DatePicker、TimePicker。
示例:
Title
-
立即创建
导入项目所需模块数据表,该数据表由PowerDesigner设计生成。导入到数据库中如下图所示:
将POJO实体类复制到health_pojo工程中
public class User implements Serializable{
private Integer id; // 主键
private Date birthday; // 生日
private String gender; // 性别
private String username; // 用户名,唯一
private String password; // 密码
private String remark; // 备注
private String station; // 状态
private String telephone; // 联系电话
private Set roles = new HashSet(0);//对应角色集合
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getStation() {
return station;
}
public void setStation(String station) {
this.station = station;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public Set getRoles() {
return roles;
}
public void setRoles(Set roles) {
this.roles = roles;
}
}
public class Role implements Serializable {
private Integer id;
private String name; // 角色名称
private String keyword; // 角色关键字,用于权限控制
private String description; // 描述
private Set users = new HashSet(0);
private Set permissions = new HashSet(0);
private LinkedHashSet
public class Permission implements Serializable{
private Integer id;
private String name; // 权限名称
private String keyword; // 权限关键字,用于权限控制
private String description; // 描述
private Set roles = new HashSet(0);
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Set getRoles() {
return roles;
}
public void setRoles(Set roles) {
this.roles = roles;
}
}
public class Setmeal implements Serializable {
private Integer id;
private String name;
private String code;
private String helpCode;
private String sex;//套餐适用性别:0不限 1男 2女
private String age;//套餐适用年龄
private Float price;//套餐价格
private String remark;
private String attention;
private String img;//套餐对应图片存储路径
private List checkGroups;//体检套餐对应的检查组,多对多关系
public List getCheckGroups() {
return checkGroups;
}
public void setCheckGroups(List checkGroups) {
this.checkGroups = checkGroups;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getHelpCode() {
return helpCode;
}
public void setHelpCode(String helpCode) {
this.helpCode = helpCode;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAttention() {
return attention;
}
public void setAttention(String attention) {
this.attention = attention;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
}
public class OrderSetting implements Serializable{
private Integer id ;
private Date orderDate;//预约设置日期
private int number;//可预约人数
private int reservations ;//已预约人数
public OrderSetting() {
}
public OrderSetting(Date orderDate, int number) {
this.orderDate = orderDate;
this.number = number;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getOrderDate() {
return orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public int getReservations() {
return reservations;
}
public void setReservations(int reservations) {
this.reservations = reservations;
}
}
public class Order implements Serializable{
public static final String ORDERTYPE_TELEPHONE = "电话预约";
public static final String ORDERTYPE_WEIXIN = "微信预约";
public static final String ORDERSTATUS_YES = "已到诊";
public static final String ORDERSTATUS_NO = "未到诊";
private Integer id;
private Integer memberId;//会员id
private Date orderDate;//预约日期
private String orderType;//预约类型 电话预约/微信预约
private String orderStatus;//预约状态(是否到诊)
private Integer setmealId;//体检套餐id
public Order() {
}
public Order(Integer id) {
this.id = id;
}
public Order(Integer memberId, Date orderDate, String orderType, String orderStatus, Integer setmealId) {
this.memberId = memberId;
this.orderDate = orderDate;
this.orderType = orderType;
this.orderStatus = orderStatus;
this.setmealId = setmealId;
}
public Order(Integer id, Integer memberId, Date orderDate, String orderType, String orderStatus, Integer setmealId) {
this.id = id;
this.memberId = memberId;
this.orderDate = orderDate;
this.orderType = orderType;
this.orderStatus = orderStatus;
this.setmealId = setmealId;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getMemberId() {
return memberId;
}
public void setMemberId(Integer memberId) {
this.memberId = memberId;
}
public Date getOrderDate() {
return orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
public String getOrderType() {
return orderType;
}
public void setOrderType(String orderType) {
this.orderType = orderType;
}
public String getOrderStatus() {
return orderStatus;
}
public void setOrderStatus(String orderStatus) {
this.orderStatus = orderStatus;
}
public Integer getSetmealId() {
return setmealId;
}
public void setSetmealId(Integer setmealId) {
this.setmealId = setmealId;
}
}
public class Menu implements Serializable{
private Integer id;
private String name; // 菜单名称
private String linkUrl; // 访问路径
private String path;//菜单项所对应的路由路径
private Integer priority; // 优先级(用于排序)
private String description; // 描述
private String icon;//图标
private Set roles = new HashSet(0);//角色集合
private List children = new ArrayList<>();//子菜单集合
private Integer parentMenuId;//父菜单id
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLinkUrl() {
return linkUrl;
}
public void setLinkUrl(String linkUrl) {
this.linkUrl = linkUrl;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public Integer getPriority() {
return priority;
}
public void setPriority(Integer priority) {
this.priority = priority;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Set getRoles() {
return roles;
}
public void setRoles(Set roles) {
this.roles = roles;
}
public List getChildren() {
return children;
}
public void setChildren(List children) {
this.children = children;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Integer getParentMenuId() {
return parentMenuId;
}
public void setParentMenuId(Integer parentMenuId) {
this.parentMenuId = parentMenuId;
}
}
public class Member implements Serializable{
private Integer id;//主键
private String fileNumber;//档案号
private String name;//姓名
private String sex;//性别
private String idCard;//身份证号
private String phoneNumber;//手机号
private Date regTime;//注册时间
private String password;//登录密码
private String email;//邮箱
private Date birthday;//出生日期
private String remark;//备注
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFileNumber() {
return fileNumber;
}
public void setFileNumber(String fileNumber) {
this.fileNumber = fileNumber;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regtime) {
this.regTime = regtime;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
public class CheckItem implements Serializable {
private Integer id;//主键
private String code;//项目编码
private String name;//项目名称
private String sex;//适用性别
private String age;//适用年龄(范围),例如:20-50
private Float price;//价格
private String type;//检查项类型,分为检查和检验两种类型
private String remark;//项目说明
private String attention;//注意事项
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAttention() {
return attention;
}
public void setAttention(String attention) {
this.attention = attention;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
public class CheckGroup implements Serializable {
private Integer id;//主键
private String code;//编码
private String name;//名称
private String helpCode;//助记
private String sex;//适用性别
private String remark;//介绍
private String attention;//注意事项
private List checkItems;//一个检查组合包含多个检查项
public List getCheckItems() {
return checkItems;
}
public void setCheckItems(List checkItems) {
this.checkItems = checkItems;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getHelpCode() {
return helpCode;
}
public void setHelpCode(String helpCode) {
this.helpCode = helpCode;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getAttention() {
return attention;
}
public void setAttention(String attention) {
this.attention = attention;
}
}
项目开发过程中一般会提供一些公共资源,供多个模块或者系统来使用。放到health_common工程中
public class MessageConstant {
public static final String DELETE_CHECKITEM_FAIL = "删除检查项失败";
public static final String DELETE_CHECKITEM_SUCCESS = "删除检查项成功";
public static final String ADD_CHECKITEM_SUCCESS = "新增检查项成功";
public static final String ADD_CHECKITEM_FAIL = "新增检查项失败";
public static final String EDIT_CHECKITEM_FAIL = "编辑检查项失败";
public static final String EDIT_CHECKITEM_SUCCESS = "编辑检查项成功";
public static final String QUERY_CHECKITEM_SUCCESS = "查询检查项成功";
public static final String QUERY_CHECKITEM_FAIL = "查询检查项失败";
public static final String UPLOAD_SUCCESS = "上传成功";
public static final String ADD_CHECKGROUP_FAIL = "新增检查组失败";
public static final String ADD_CHECKGROUP_SUCCESS = "新增检查组成功";
public static final String DELETE_CHECKGROUP_FAIL = "删除检查组失败";
public static final String DELETE_CHECKGROUP_SUCCESS = "删除检查组成功";
public static final String QUERY_CHECKGROUP_SUCCESS = "查询检查组成功";
public static final String QUERY_CHECKGROUP_FAIL = "查询检查组失败";
public static final String EDIT_CHECKGROUP_FAIL = "编辑检查组失败";
public static final String EDIT_CHECKGROUP_SUCCESS = "编辑检查组成功";
public static final String PIC_UPLOAD_SUCCESS = "图片上传成功";
public static final String PIC_UPLOAD_FAIL = "图片上传失败";
public static final String ADD_SETMEAL_FAIL = "新增套餐失败";
public static final String ADD_SETMEAL_SUCCESS = "新增套餐成功";
public static final String IMPORT_ORDERSETTING_FAIL = "批量导入预约设置数据失败";
public static final String IMPORT_ORDERSETTING_SUCCESS = "批量导入预约设置数据成功";
public static final String GET_ORDERSETTING_SUCCESS = "获取预约设置数据成功";
public static final String GET_ORDERSETTING_FAIL = "获取预约设置数据失败";
public static final String ORDERSETTING_SUCCESS = "预约设置成功";
public static final String ORDERSETTING_FAIL = "预约设置失败";
public static final String ADD_MEMBER_FAIL = "新增会员失败";
public static final String ADD_MEMBER_SUCCESS = "新增会员成功";
public static final String DELETE_MEMBER_FAIL = "删除会员失败";
public static final String DELETE_MEMBER_SUCCESS = "删除会员成功";
public static final String EDIT_MEMBER_FAIL = "编辑会员失败";
public static final String EDIT_MEMBER_SUCCESS = "编辑会员成功";
public static final String TELEPHONE_VALIDATECODE_NOTNULL = "手机号和验证码都不能为空";
public static final String LOGIN_SUCCESS = "登录成功";
public static final String VALIDATECODE_ERROR = "验证码输入错误";
public static final String QUERY_ORDER_SUCCESS = "查询预约信息成功";
public static final String QUERY_ORDER_FAIL = "查询预约信息失败";
public static final String QUERY_SETMEALLIST_SUCCESS = "查询套餐列表数据成功";
public static final String QUERY_SETMEALLIST_FAIL = "查询套餐列表数据失败";
public static final String QUERY_SETMEAL_SUCCESS = "查询套餐数据成功";
public static final String QUERY_SETMEAL_FAIL = "查询套餐数据失败";
public static final String SEND_VALIDATECODE_FAIL = "验证码发送失败";
public static final String SEND_VALIDATECODE_SUCCESS = "验证码发送成功";
public static final String SELECTED_DATE_CANNOT_ORDER = "所选日期不能进行体检预约";
public static final String ORDER_FULL = "预约已满";
public static final String HAS_ORDERED = "已经完成预约,不能重复预约";
public static final String ORDER_SUCCESS = "预约成功";
public static final String GET_USERNAME_SUCCESS = "获取当前登录用户名称成功";
public static final String GET_USERNAME_FAIL = "获取当前登录用户名称失败";
public static final String GET_MENU_SUCCESS = "获取当前登录用户菜单成功";
public static final String GET_MENU_FAIL = "获取当前登录用户菜单失败";
public static final String GET_MEMBER_NUMBER_REPORT_SUCCESS = "获取会员统计数据成功";
public static final String GET_MEMBER_NUMBER_REPORT_FAIL = "获取会员统计数据失败";
public static final String GET_SETMEAL_COUNT_REPORT_SUCCESS = "获取套餐统计数据成功";
public static final String GET_SETMEAL_COUNT_REPORT_FAIL = "获取套餐统计数据失败";
public static final String GET_BUSINESS_REPORT_SUCCESS = "获取运营统计数据成功";
public static final String GET_BUSINESS_REPORT_FAIL = "获取运营统计数据失败";
public static final String GET_SETMEAL_LIST_SUCCESS = "查询套餐列表数据成功";
public static final String GET_SETMEAL_LIST_FAIL = "查询套餐列表数据失败";
}
封装返回结果Result和返回结果分页PageResult类,放到health_pojo工程中
public class Result implements Serializable{
private boolean flag;//执行结果,true为执行成功 false为执行失败
private String message;//返回结果信息
private Object data;//返回数据
public Result(boolean flag, String message) { // 保存、修改保存
super();
this.flag = flag;
this.message = message;
}
public Result(boolean flag, String message, Object data) {// 查询回显
this.flag = flag;
this.message = message;
this.data = data;
}
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
public class PageResult implements Serializable{
private Long total;//总记录数
private List rows;//当前页结果
public PageResult(Long total, List rows) {
super();
this.total = total;
this.rows = rows;
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public List getRows() {
return rows;
}
public void setRows(List rows) {
this.rows = rows;
}
}
封装查询条件的QueryPageBean类,放到health_pojo工程中,用于封装查询条件。
public class QueryPageBean implements Serializable{
private Integer currentPage;//页码
private Integer pageSize;//每页记录数
private String queryString;//查询条件
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public String getQueryString() {
return queryString;
}
public void setQueryString(String queryString) {
this.queryString = queryString;
}
}
html、js、css、图片等静态资源,放到health_web工程中