IDEA + java+spring+hibernate+jquery+mysql后台管理系统
- 一、系统介绍
- 1.环境配置
- 二、系统展示
- 1. 管理员登录
- 2.修改密码
- 3.我的内容
- 4.我的操作日志
- 5. 我的登陆日志
- 6. 我的登陆授权
- 7. 内容管理
- 8.标签管理
- 9. 搜索词管理
- 10.分类管理
- 11.分类类型
- 12.标签分类
- 13.用户管理
- 14.部门管理
- 15.角色管理
- 16.用户登录授权
- 三、部分代码
- SysUserDao.java
- IndexController.java
- SysUser.java
- 四、其他
- 获取源码
一、系统介绍
本系统实现了后台管理系统,管理端实现了管理员登录、 修改密码、 我的内容、 我的操作日志、 我的登陆日志、 我的登陆授权、 内容管理、 标签管理、 搜索词管理、分类管理、分类类型、 标签分类、 用户管理、 部门管理、 角色管理、 用户登录授权
1.环境配置
JDK版本:1.8
Mysql:5.7
二、系统展示
1. 管理员登录
登录用户名密码:admin admin
2.修改密码
3.我的内容
4.我的操作日志
5. 我的登陆日志
6. 我的登陆授权
7. 内容管理
8.标签管理
9. 搜索词管理
10.分类管理
11.分类类型
12.标签分类
13.用户管理
14.部门管理
15.角色管理
16.用户登录授权
三、部分代码
SysUserDao.java
package com.logic.dao.sys;import java.util.Date;import org.springframework.stereotype.Repository;import com.entities.sys.SysUser;
import com.sanluan.common.base.BaseDao;
import com.sanluan.common.handler.PageHandler;
import com.sanluan.common.handler.QueryHandler;@Repository
public class SysUserDao extends BaseDao<SysUser> {public PageHandler getPage(Integer siteId, Integer deptId, Date startRegisteredDate, Date endRegisteredDate,Date startLastLoginDate, Date endLastLoginDate, Boolean superuserAccess, Boolean emailChecked, Boolean disabled,String name, String orderField, String orderType, Integer pageIndex, Integer pageSize) {QueryHandler queryHandler = getQueryHandler("from SysUser bean");if (notEmpty(siteId)) {queryHandler.condition("bean.siteId = :siteId").setParameter("siteId", siteId);}if (notEmpty(deptId)) {queryHandler.condition("bean.deptId = :deptId").setParameter("deptId", deptId);}if (notEmpty(startRegisteredDate)) {queryHandler.condition("bean.registeredDate > :startRegisteredDate").setParameter("startRegisteredDate",startRegisteredDate);}if (notEmpty(endRegisteredDate)) {queryHandler.condition("bean.registeredDate <= :endRegisteredDate").setParameter("endRegisteredDate",tomorrow(endRegisteredDate));}if (notEmpty(startLastLoginDate)) {queryHandler.condition("bean.lastLoginDate > :startLastLoginDate").setParameter("startLastLoginDate",startLastLoginDate);}if (notEmpty(endLastLoginDate)) {queryHandler.condition("bean.lastLoginDate <= :endLastLoginDate").setParameter("endLastLoginDate",tomorrow(endLastLoginDate));}if (notEmpty(superuserAccess)) {queryHandler.condition("bean.superuserAccess = :superuserAccess").setParameter("superuserAccess", superuserAccess);}if (notEmpty(emailChecked)) {queryHandler.condition("bean.emailChecked = :emailChecked").setParameter("emailChecked", emailChecked);}if (notEmpty(disabled)) {queryHandler.condition("bean.disabled = :disabled").setParameter("disabled", disabled);}if (notEmpty(name)) {queryHandler.condition("(bean.name like :name or bean.nickName like :name or bean.email like :name)").setParameter("name", like(name));}if ("asc".equalsIgnoreCase(orderType)) {orderType = "asc";} else {orderType = "desc";}if (null == orderField) {orderField = BLANK;}switch (orderField) {case "lastLoginDate":queryHandler.order("bean.lastLoginDate " + orderType);break;case "loginCount":queryHandler.order("bean.loginCount " + orderType);break;case "registeredDate":queryHandler.order("bean.registeredDate " + orderType);break;default:queryHandler.order("bean.id " + orderType);}return getPage(queryHandler, pageIndex, pageSize);}public SysUser findByName(int siteId, String name) {QueryHandler queryHandler = getQueryHandler("from SysUser bean");queryHandler.condition("bean.siteId = :siteId").setParameter("siteId", siteId);queryHandler.condition("bean.name = :name").setParameter("name", name);return getEntity(queryHandler);}public SysUser findByNickName(int siteId, String nickname) {QueryHandler queryHandler = getQueryHandler("from SysUser bean");queryHandler.condition("bean.siteId = :siteId").setParameter("siteId", siteId);queryHandler.condition("bean.nickName = :nickname").setParameter("nickname", nickname);return getEntity(queryHandler);}public SysUser findByEmail(int siteId, String email) {QueryHandler queryHandler = getQueryHandler("from SysUser bean");queryHandler.condition("bean.siteId = :siteId").setParameter("siteId", siteId);queryHandler.condition("bean.email = :email and bean.emailChecked = :emailChecked").setParameter("email", email).setParameter("emailChecked", true);return getEntity(queryHandler);}@Overrideprotected SysUser init(SysUser entity) {if (empty(entity.getRegisteredDate())) {entity.setRegisteredDate(getDate());}return entity;}
}
IndexController.java
package com.views.controller.web;import static com.logic.component.config.LoginConfigComponent.CONFIG_CODE;
import static com.logic.component.config.LoginConfigComponent.CONFIG_LOGIN_PATH;
import static com.sanluan.common.tools.RequestUtils.getEncodePath;
import static org.apache.commons.lang3.ArrayUtils.isNotEmpty;
import static org.apache.commons.lang3.StringUtils.split;import java.util.Map;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.util.UrlPathHelper;import com.common.base.AbstractController;
import com.entities.sys.SysDomain;
import com.entities.sys.SysSite;
import com.logic.component.ConfigComponent;
import com.logic.component.MetadataComponent;
import com.logic.component.TemplateCacheComponent;
import com.views.pojo.CmsPageMetadata;
import com.sanluan.common.servlet.PageNotFoundException;/*** * IndexController 统一分发Controller**/
@Controller
public class IndexController extends AbstractController {@Autowiredprivate MetadataComponent metadataComponent;@Autowiredprivate TemplateCacheComponent templateCacheComponent;@Autowiredprivate ConfigComponent configComponent;private UrlPathHelper urlPathHelper = new UrlPathHelper();/*** 页面请求统一分发* * @param request* @param response* @param model* @return* @throws Exception*/@RequestMapping({ SEPARATOR, "/**" })public String page(HttpServletRequest request, HttpSession session, ModelMap model) throws PageNotFoundException {String requestPath = urlPathHelper.getLookupPathForRequest(request);if (SEPARATOR.equals(requestPath) || requestPath.endsWith(SEPARATOR)) {requestPath += "index.html";}SysDomain domain = getDomain(request);SysSite site = getSite(request);String realRequestPath = siteComponent.getViewNamePreffix(site, domain) + requestPath;String templatePath = siteComponent.getWebTemplateFilePath()+ realRequestPath;CmsPageMetadata metadata = metadataComponent.getTemplateMetadata(templatePath);if (metadata.isUseDynamic()) {if (metadata.isNeedLogin() && notEmpty(domain.getId()) && empty(getUserFromSession(session))) {Map<String, String> config = configComponent.getConfigData(site.getId(), CONFIG_CODE, domain.getId().toString());String loginPath = config.get(CONFIG_LOGIN_PATH);if (notEmpty(loginPath)) {return REDIRECT + loginPath + "?returnUrl=" + getEncodePath(requestPath, request.getQueryString());} else {return REDIRECT + site.getSitePath();}}model.put("metadata", metadata);if (notEmpty(metadata.getAcceptParamters())) {billingRequestParamtersToModel(request, metadata.getAcceptParamters(), model);}if (notEmpty(metadata.getCacheTime()) && 10 <= metadata.getCacheTime()) {return templateCacheComponent.getCachedPath(requestPath, realRequestPath, metadata.getCacheTime() * 1000,metadata.getAcceptParamters(), site, request, model);}} else {throw new PageNotFoundException(requestPath);}return requestPath;}private void billingRequestParamtersToModel(HttpServletRequest request, String acceptParamters, ModelMap model) {for (String paramterName : split(acceptParamters, COMMA_DELIMITED)) {String[] values = request.getParameterValues(paramterName);if (isNotEmpty(values)) {if (1 < values.length) {model.put(paramterName, values);} else {model.put(paramterName, values[0]);}}}}
}
SysUser.java
package com.entities.sys;import static javax.persistence.GenerationType.IDENTITY;import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;import com.sanluan.common.source.entity.MyColumn;/*** SystemUser generated by hbm2java*/
@Entity
@Table(name = "sys_user", uniqueConstraints = { @UniqueConstraint(columnNames = { "name", "site_id" }),@UniqueConstraint(columnNames = { "nick_name", "site_id" }) })
public class SysUser implements java.io.Serializable {/*** */private static final long serialVersionUID = 1L;@MyColumn(title = "ID")private Long id;@MyColumn(title = "站点", condition = true)private int siteId;@MyColumn(title = "用户名", condition = true, like = true, or = true, name = "name")private String name;@MyColumn(title = "密码")private String password;@MyColumn(title = "用户昵称", condition = true, like = true, or = true, name = "name")private String nickName;@MyColumn(title = "部门", condition = true)private Integer deptId;@MyColumn(title = "角色")private String roles;@MyColumn(title = "邮箱", condition = true, like = true, or = true, name = "name")private String email;@MyColumn(title = "已验证邮箱", condition = true)private boolean emailChecked;@MyColumn(title = "是否管理员", condition = true)private boolean superuserAccess;@MyColumn(title = "已禁用", condition = true)private boolean disabled;@MyColumn(title = "上次登录日期", condition = true, order = true)private Date lastLoginDate;@MyColumn(title = "上次登录IP")private String lastLoginIp;@MyColumn(title = "登录次数", order = true)private int loginCount;@MyColumn(title = "注册日期", condition = true, order = true)private Date registeredDate;public SysUser() {}public SysUser(int siteId, String name, String password, String nickName, boolean emailChecked, boolean superuserAccess,boolean disabled, int loginCount) {this.siteId = siteId;this.name = name;this.password = password;this.nickName = nickName;this.emailChecked = emailChecked;this.superuserAccess = superuserAccess;this.disabled = disabled;this.loginCount = loginCount;}public SysUser(int siteId, String name, String password, String nickName, Integer deptId, String roles, String email,boolean emailChecked, boolean superuserAccess, boolean disabled, Date lastLoginDate, String lastLoginIp,int loginCount, Date registeredDate) {this.siteId = siteId;this.name = name;this.password = password;this.nickName = nickName;this.deptId = deptId;this.roles = roles;this.email = email;this.emailChecked = emailChecked;this.superuserAccess = superuserAccess;this.disabled = disabled;this.lastLoginDate = lastLoginDate;this.lastLoginIp = lastLoginIp;this.loginCount = loginCount;this.registeredDate = registeredDate;}@Id@GeneratedValue(strategy = IDENTITY)@Column(name = "id", unique = true, nullable = false)public Long getId() {return this.id;}public void setId(Long id) {this.id = id;}@Column(name = "site_id", nullable = false)public int getSiteId() {return this.siteId;}public void setSiteId(int siteId) {this.siteId = siteId;}@Column(name = "name", nullable = false, length = 50)public String getName() {return this.name;}public void setName(String name) {this.name = name;}@Column(name = "password", nullable = false, length = 32)public String getPassword() {return this.password;}public void setPassword(String password) {this.password = password;}@Column(name = "nick_name", nullable = false, length = 45)public String getNickName() {return this.nickName;}public void setNickName(String nickName) {this.nickName = nickName;}@Column(name = "dept_id")public Integer getDeptId() {return this.deptId;}public void setDeptId(Integer deptId) {this.deptId = deptId;}@Column(name = "roles", length = 65535)public String getRoles() {return this.roles;}public void setRoles(String roles) {this.roles = roles;}@Column(name = "email", length = 100)public String getEmail() {return this.email;}public void setEmail(String email) {this.email = email;}@Column(name = "email_checked", nullable = false)public boolean isEmailChecked() {return this.emailChecked;}public void setEmailChecked(boolean emailChecked) {this.emailChecked = emailChecked;}@Column(name = "superuser_access", nullable = false)public boolean isSuperuserAccess() {return this.superuserAccess;}public void setSuperuserAccess(boolean superuserAccess) {this.superuserAccess = superuserAccess;}@Column(name = "disabled", nullable = false)public boolean isDisabled() {return this.disabled;}public void setDisabled(boolean disabled) {this.disabled = disabled;}@Temporal(TemporalType.TIMESTAMP)@Column(name = "last_login_date", length = 19)public Date getLastLoginDate() {return this.lastLoginDate;}public void setLastLoginDate(Date lastLoginDate) {this.lastLoginDate = lastLoginDate;}@Column(name = "last_login_ip", length = 20)public String getLastLoginIp() {return this.lastLoginIp;}public void setLastLoginIp(String lastLoginIp) {this.lastLoginIp = lastLoginIp;}@Column(name = "login_count", nullable = false)public int getLoginCount() {return this.loginCount;}public void setLoginCount(int loginCount) {this.loginCount = loginCount;}@Temporal(TemporalType.TIMESTAMP)@Column(name = "registered_date", length = 19)public Date getRegisteredDate() {return this.registeredDate;}public void setRegisteredDate(Date registeredDate) {this.registeredDate = registeredDate;}}
四、其他
获取源码
点击以下链接获取源码。
IDEA+java+spring+hibernate+jquery+mysql后台管理系统
IDEA + Spring Boot + Security + MyBatis Plus+Mysql低代码快速开发平台
IDEA+spring boot+activiti+shiro++layui+Mysql权限管理系统源码
IDEA+SpringBoot + Mybatis + Shiro+Bootstrap+Mysql智慧仓库WMS源码
IDEA+springboot+ssm+layui+mysql高校宿舍管理系统源码
IDEA+springboot + ssm +shiro+ easyui +mysql实现的进销存系统
IDEA+springboot+mybatis+shiro+bootstrap+Mysql网上书店管理系统
IDEA+springboot+mybatis+shiro+bootstrap+Mysql WMS仓库管理系统
IDEA+spring+spring mvc+mybatis+bootstrap+jquery+Mysql运动会管理系统源码
IDEA+SpringBoot+mybatis+bootstrap+jquery+Mysql车险理赔管理系统源码
IDEA+Spring Boot + MyBatis + Layui+Mysql垃圾回收管理系统源码
IDEA+SpringBoot+mybatis+SSM+layui+Mysql学生就业信息管理系统源码
IDEA+springboot+jpa+Layui+Mysql销售考评系统源码
IDEA+Spring + Spring MVC + MyBatis+Bootstrap+Mysql酒店管理系统源码
IDEA+spring boot+mybatis+spring mvc+bootstrap+Mysql停车位管理系统源码
Java+Swing+Mysql实现学生宿舍管理系统
Java+Swing+Txt实现自助款机系统
Java+Swing+Mysql自助存取款机系统
Java+Swing+mysql5实现学生成绩管理系统(带分页)
Java+Swing+Mysql实现超市商品管理系统源码
Java+Swing+Mysql实现通讯录管理系统源码
Java+Swing+Mysql实现图书管理系统源码