基于SSH开发的电子政务网管理系统 JAVA MySQL

10089基于SSH开发的电子政务网管理系统

代码:
鏈-椄:https://pan@baidu@com/s/11qEwMtFAmmwMDLQO_Pbk2Q (把@换成 . 就可正常访问)
趧-紶-碼:6886
f/u枝此段-吶傛打开baidu網盤手机App,caozuo更方便哦

技术
Spring + Struts + Hibernate

工具
eclipse + tomact + mysql + jdk

功能详情

前台功能后台功能
系统首页系统属性
领导信箱基本操作
表格下载网站公告
政务公开政府部门网站
便民电话领导信箱
留言板表格下载
进入后台政务公开
便民电话
新闻动态
地区概况
留言管理
安全退出系统

系统相关截图

● 系统首页

在这里插入图片描述

● 后台首页

在这里插入图片描述

package com.service.impl;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.dao.DepartmentDao;
import com.entity.Department;
import com.entity.PageBean;
import com.service.DepartmentService;
/**

  • 部门管理的业务层实现类
  • @author hope
    */

@Transactional
public class DepartmentServiceImpl implements DepartmentService {
// 注入serviceDao
private DepartmentDao departmentDao;

public void setDepartmentDao(DepartmentDao departmentDao) {
	this.departmentDao = departmentDao;
}

@Override
/**
 * 分页查询部门的方法
 */
public PageBean<Department> findByPage(Integer currPage) {
    PageBean<Department> pageBean = new PageBean<Department>();
    // 封装当前页数
    pageBean.setCurrPage(currPage);
    // 封装每页记录数
    int pageSize = 3;
    pageBean.setPageSize(pageSize);
    // 封装总记录数
    int totalCount = departmentDao.findCount();
    pageBean.setTotalCount(totalCount);
    // 封装页数
    int totalPage;
    if(totalCount%pageSize == 0){
    	totalPage = totalCount/pageSize;
    }else{
    	totalPage = totalCount/pageSize+1; 
    }
    pageBean.setTotalPage(totalPage);
    // 封装当前页记录
    int begin= (currPage - 1)*pageSize;
    List<Department> list = departmentDao.findByPage(begin, pageSize);
    pageBean.setList(list);
	return pageBean;
}

@Override
/**
 * 添加部门的业务层实现
 */
public void save(Department department) {
	// TODO Auto-generated method stub
	departmentDao.save(department);
}

@Override
/**
 * 根据id查询部门的业务层实现
 */
public Department findById(Integer did) {
	// TODO Auto-generated method stub
	return departmentDao.findById(did);
}

@Override
/**
 * 更新部门的业务层实现
 */
public void update(Department department) {
	// TODO Auto-generated method stub
	departmentDao.update(department);
}

@Override
/**
 * 删除部门的业务层实现
 */
public void delete(Department department) {
	// TODO Auto-generated method stub
	departmentDao.delete(department);
}

@Override
/**
 * 业务层查询所有部门
 */
public List<Department> findAll() {
	// TODO Auto-generated method stub
	return departmentDao.findAll();
}

}
package com.service.impl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Transactional;

import com.dao.DepartmentDao;
import com.dao.EmployeeDao;
import com.entity.Department;
import com.entity.Employee;
import com.entity.PageBean;
import com.service.EmployeeService;
@Transactional
public class EmployeeServiceImpl implements EmployeeService {
private EmployeeDao employeeDao;

public void setEmployeeDao(EmployeeDao employeeDao) {
	this.employeeDao = employeeDao;
}

@Override
/**
 * 业务层登录方法
 */
public Employee login(Employee employee) {
	// TODO Auto-generated method stub
	Employee eEmployee = employeeDao.findByUsernameAndPassword(employee);
	return eEmployee;
}

@Override
/**
 * 业务层查询指定页面方法
 */
public PageBean<Employee> findByPage(Integer currPage) {
	// TODO Auto-generated method stub
	  PageBean<Employee> pageBean = new PageBean<Employee>();
        // 封装当前页数
        pageBean.setCurrPage(currPage);
        // 封装每页记录数
        int pageSize = 3;
        pageBean.setPageSize(pageSize);
        // 封装总记录数
        int totalCount = employeeDao.findCount();
        pageBean.setTotalCount(totalCount);
        // 封装页数
        int totalPage;
        if(totalCount%pageSize==0){
        	totalPage = totalCount/pageSize;
        }else{
        	totalPage = totalCount/pageSize + 1; 
        }
        pageBean.setTotalPage(totalPage);
        // 封装当前页记录
        int begin= (currPage - 1)*pageSize;
        List<Employee> list = employeeDao.findByPage(begin, pageSize);
        pageBean.setList(list);
		return pageBean;
}

@Override
/**
 * 业务层添加员工的方法
 */
public void save(Employee employee) {
	// TODO Auto-generated method stub
	employeeDao.save(employee);
	
}

@Override
/**
 * 业务层根据id查询员工的方法
 */
public Employee findById(Integer eid) {
	// TODO Auto-generated method stub
	return employeeDao.findById(eid);
}

@Override
/**
 * 编辑员工的业务层实现方法
 */
public void update(Employee employee) {
	// TODO Auto-generated method stub
	employeeDao.update(employee);		
}

@Override
/**
 * 业务层员工删除
 */
public void delete(Employee employee) {
	// TODO Auto-generated method stub
	employeeDao.delete(employee);
}

}
package com.service;

import java.util.List;

import com.entity.Department;
import com.entity.PageBean;
/**

  • 部门管理的业务层接口实现类

  • @author hope
    */
    public interface DepartmentService {

    PageBean findByPage(Integer currPage);

    void save(Department department);

    void update(Department department);

    Department findById(Integer did);

    void delete(Department department);

    List findAll();

}
package com.service;

import com.entity.Department;
import com.entity.Employee;
import com.entity.PageBean;

public interface EmployeeService {

Employee login(Employee employee);

PageBean<Employee> findByPage(Integer currPage);

void save(Employee employee);

void update(Employee employee);

Employee findById(Integer eid);

void delete(Employee employee);

}

<?xml version="1.0"?> package com.entity;

import java.util.HashSet;
import java.util.Set;

/**

  • Department entity. @hope Eclipse Tools
    */

public class Department implements java.io.Serializable {

private static final long serialVersionUID = 1L;
private Integer did;
private String dname;
private String ddesc;
private Set<Employee> employees = new HashSet<Employee>();

// Constructors

/** default constructor */
public Department() {
}

/** full constructor */
public Department(String dname, String ddesc, Set employees) {
	this.dname = dname;
	this.ddesc = ddesc;
	this.employees = employees;
}

// Property accessors

public Integer getDid() {
	return this.did;
}

public void setDid(Integer did) {
	this.did = did;
}

public String getDname() {
	return this.dname;
}

public void setDname(String dname) {
	this.dname = dname;
}

public String getDdesc() {
	return this.ddesc;
}

public void setDdesc(String ddesc) {
	this.ddesc = ddesc;
}

public Set getEmployees() {
	return this.employees;
}

public void setEmployees(Set employees) {
	this.employees = employees;
}

}package com.entity;

import java.util.List;
/**

  • 封装页面显示所需要的数据
  • @author hope
  • @param
    */
    public class PageBean {
    // 当前页数
    private int currPage;
    // 每页显示数量
    private int pageSize;
    // 总页数
    private int totalPage;
    // 总记录数
    private int totalCount;
    // 每页显示的数据
    private List list;
    // 当前页数,每页记录数,总记录数,总页数,每页显示数据

public int getCurrPage() {
return currPage;
}
public void setCurrPage(int currPage) {
this.currPage = currPage;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}

}
package com.entity;

import java.util.Date;

/**

  • Employee entity. @hope Eclipse Tools
    */

public class Employee implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
// 员工id
private Integer eid;
// 员工部门
private Department department;
// 员工name
private String ename;
// 员工sex
private String sex;
// 生日
private Date birthday;
// 加入时间
private Date joinDate;
// 员工编号
private String eno;
private String username;
private String password;

// Constructors

/** default constructor */
public Employee() {
}

/** full constructor */
public Employee(Department department, String ename, String sex,
		Date birthday, Date joinDate, String eno, String username,
		String password) {
	this.department = department;
	this.ename = ename;
	this.sex = sex;
	this.birthday = birthday;
	this.joinDate = joinDate;
	this.eno = eno;
	this.username = username;
	this.password = password;
}

// Property accessors

public Integer getEid() {
	return this.eid;
}

public void setEid(Integer eid) {
	this.eid = eid;
}

public Department getDepartment() {
	return this.department;
}

public void setDepartment(Department department) {
	this.department = department;
}

public String getEname() {
	return this.ename;
}

public void setEname(String ename) {
	this.ename = ename;
}

public String getSex() {
	return this.sex;
}

public void setSex(String sex) {
	this.sex = sex;
}

public Date getBirthday() {
	return this.birthday;
}

public void setBirthday(Date birthday) {
	this.birthday = birthday;
}

public Date getJoinDate() {
	return this.joinDate;
}

public void setJoinDate(Date joinDate) {
	this.joinDate = joinDate;
}

public String getEno() {
	return this.eno;
}

public void setEno(String eno) {
	this.eno = eno;
}

public String getUsername() {
	return this.username;
}

public void setUsername(String username) {
	this.username = username;
}

public String getPassword() {
	return this.password;
}

public void setPassword(String password) {
	this.password = password;
}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值