基于javaweb+jsp的家政服务管理系统(JavaWeb MySQL JSP Bootstrap Servlet SSM SpringBoot)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
/**
* 增加公告
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("noticeAdd")
public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
Notice vo = new Notice();
//取出页面传进来的参数
vo.setNoticeName(Util.decode(request, "noticeName"));
vo.setNoticeText(Util.decode(request, "noticeText"));
vo.setNoticeType(Util.decode(request, "noticeType"));
vo.setCreateDate(Util.decode(request, "createDate"));
//调用Service层的增加(insert)方法
noticeService.insert(vo);
this.redirectList(request, response);
}
User loginUser = (User) request.getSession().getAttribute("loginUser");
String oldPassword = Util.decode(request, "oldPassword");
if (!loginUser.getPassword().equals(oldPassword)) {
msg = "原密码错误!";
} else {
String newPassword = Util.decode(request, "newPassword");
loginUser.setPassword(newPassword);
this.userService.update(loginUser);
msg = "修改成功!";
}
request.getSession().setAttribute("alert_msg", msg);
request.getRequestDispatcher("reset_password.jsp").forward(request, response);
}
// 返回一个随机颜色(Color对象)
private Color getRandomColor(int minColor, int maxColor) {
Random random = new Random();
vo.setFuwuRen(Util.decode(request, "fuwuRen"));
vo.setFuwuPhone(Util.decode(request, "fuwuPhone"));
vo.setFuwuText(Util.decode(request, "fuwuText"));
//调用Service层的增加(insert)方法
fuwuService.insert(vo);
this.redirectList(request, response);
}
/**
* 删除服务
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("fuwuDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
<tr>
<td width="12%">姓名:</td><td><input class="index-content-table-td-add" type="text" id="realName" name="realName" value="${vo.realName}"/></td>
</tr>
<tr>
<td width="12%">性别:</td>
<td>
<input name="userSex" type="radio" value="男" ${vo.userSex=='男'?'checked':''}/> 男
<input name="userSex" type="radio" value="女" ${vo.userSex=='女'?'checked':''}/> 女
</td>
</tr>
<tr>
<td width="12%">手机:</td><td><input class="index-content-table-td-add" type="text" id="userPhone" name="userPhone" value="${vo.userPhone}"/></td>
</tr>
<tr>
<td width="12%">备注:</td><td><textarea id="userText" name="userText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......">${vo.userText}</textarea></td>
</tr>
<tr>
<td width="12%">类型:</td>
<td>
<input <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> name="userType" type="radio" value="管理员" ${vo.userType=='管理员'?'checked':''}/> 管理员
<input name="userType" type="radio" value="普通用户" ${vo.userType=='普通用户'?'checked':''}/> 普通用户
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
</if>
1=1
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.demo.dao.NoticeMapper">
<resultMap id="BaseResultMap" type="com.demo.vo.Notice" >
<result column="id" property="id" />
<result column="notice_name" property="noticeName" />
<result column="notice_text" property="noticeText" />
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
<table class="index-content-table-add">
<tr>
<td width="12%">服务名称:</td><td><input class="index-content-table-td-add" type="text" id="fuwuName" name="fuwuName" value="${vo.fuwuName}"/></td>
</tr>
<tr>
<td width="12%">价格:</td><td><input class="index-content-table-td-add" type="text" id="fuwuPrice" name="fuwuPrice" value="${vo.fuwuPrice}"/></td>
</tr>
<tr>
<td width="12%">人数:</td><td><input class="index-content-table-td-add" type="text" id="fuwuCount" name="fuwuCount" value="${vo.fuwuCount}"/></td>
</tr>
<tr>
<td width="12%">类型:</td>
<td>
<input name="fuwuType" type="radio" value="保姆" ${vo.fuwuType=='保姆'?'checked':''}/> 保姆
<input name="fuwuType" type="radio" value="月嫂" ${vo.fuwuType=='月嫂'?'checked':''}/> 月嫂
<input name="fuwuType" type="radio" value="钟点工" ${vo.fuwuType=='钟点工'?'checked':''}/> 钟点工
<input name="fuwuType" type="radio" value="育婴师" ${vo.fuwuType=='育婴师'?'checked':''}/> 育婴师
<input name="fuwuType" type="radio" value="其它" ${vo.fuwuType=='其它'?'checked':''}/> 其它
</td>
</tr>
<tr>
<td width="12%">联系人:</td><td><input class="index-content-table-td-add" type="text" id="fuwuRen" name="fuwuRen" value="${vo.fuwuRen}"/></td>
</tr>
<!--新增-->
<insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Notice">
INSERT INTO `t_notice`
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='id != null'>`id`,</if>
<if test ='noticeName != null'>`notice_name`,</if>
<if test ='noticeText != null'>`notice_text`,</if>
<if test ='noticeType != null'>`notice_type`,</if>
<if test ='createDate != null'>`create_date`</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='id != null'>#{id},</if>
<if test ='noticeName != null'>#{noticeName},</if>
<if test ='noticeText != null'>#{noticeText},</if>
<if test ='noticeType != null'>#{noticeType},</if>
<if test ='createDate != null'>#{createDate}</if>
</trim>
</insert>
this.jiaoText = jiaoText;
}
}
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>修改服务</title>
<link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
<div class="index-content-operation">
<a class="info-detail">修改服务</a>
//调用Service层的增加(insert)方法
jiaoService.insert(vo);
this.redirectList(request, response);
}
/**
* 删除交易
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("jiaoDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
jiaoService.delete(Arrays.asList(id));
<result column="notice_type" property="noticeType" />
<result column="create_date" property="createDate" />
</resultMap>
<sql id="Base_Column_List">
`id`,`notice_name`,`notice_text`,`notice_type`,`create_date`
</sql>
<!--新增-->
<insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Notice">
INSERT INTO `t_notice`
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='id != null'>`id`,</if>
<if test ='noticeName != null'>`notice_name`,</if>
<if test ='noticeText != null'>`notice_text`,</if>
<if test ='noticeType != null'>`notice_type`,</if>
<if test ='createDate != null'>`create_date`</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='id != null'>#{id},</if>
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、服务模块、投诉模块、交易模块的增删改查管理