基
于javaweb+mysql的jsp+servlet家政服务管理系统(java+jsp+javascript+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的JSP+Servlet家政服务管理系统(java+jsp+javascript+mysql)
项目介绍
雇主用户角色包含以下功能: 首页,注册账号,雇主登录,查询家政阿姨,查看供求信息,查看家政公司,阿姨预约,查看我的预约,发布需求信息等功能。
管理员角色包含以下功能: 登录,添加新闻,家政合同管理,家政阿姨管理,审核供应信息,企业用户管理,雇主管理等功能。
家政阿姨角色包含以下功能: 登陆页面,发布供应信息,管理我的预约等功能。
家政公司角色包含以下功能: 登录,发布家政名片等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本;
技术栈
HTML+CSS+JavaScript+jsp+mysql
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/login.jsp 登录
}
else if(repass==null||repass.equals("")){
addFieldError("user.repwd","请再次输入密码");
return false;
}
else if(securityCode==null||securityCode.equals("")){
addFieldError("user.securityCode","请输入验证码!");
return false;
}
else {
return true;
}
}
/**
* 验证用户的输入是否有效
* @return boolean
*/
public boolean isValid() {
String type=user.getType();
String name=user.getName();
String email=user.getEmail();
String password=user.getPwd();
String repass=user.getRepwd();
String securityCode=user.getSecurityCode().toUpperCase();
String userType = "tb_"+type;
OpDB myOp = new OpDB();
//接收客户端传来的验证码
String serverCode = (String)session.get("SESSION_SECURITY_CODE");
if(!serverCode.equals(securityCode)) {
addActionMessage("验证码不正确,请仔细看看再填入!");
return false;
}
else if(myOp.CheckUser(name, userType)) {
addActionMessage("用户名已存在!");
return false;
}
else return true;
}
ps4.setInt(8, result_flavor[7]);
ps4.setInt(9, result_flavor[8]);
ps4.setInt(10, result_flavor[9]);
ps4.setInt(11, userId);
ps4.executeUpdate();
ps4.close();
logger.info("执行SQL:"+sql_flavor);
//更新用户姓名
ps.setString(1, surname);
//更新用户籍贯
ps.setString(2, hometown);
//更新用户性别
ps.setInt(3, sex);
//更新用户出生年月
ps.setString(4, birthdate);
//更新用户联系方式
ps.setString(5, phone);
//更新用户婚姻状况
ps.setInt(6, marriage);
//更新用户学历
ps.setInt(7, education);
//更新用户居住地址
ps.setString(8, address);
//更新用户个人简介
ps.setString(9, profile);
//更新更新时间
ps.setString(10, uptime);
//更新用户头像
ps.setBinaryStream(11, fis,length);
ps.setBinaryStream(11, fis, fis.available());
//当前用户Id为查询对象
ps.setInt(12, userId);
ps.executeUpdate();
ps.close();
logger.info("执行SQL:"+sql_employee);
fis.close();
rs.close();
conn.close();
addActionMessage("信息更新成功!");
logger.info("用户"+user+"更新信息成功!");
return SUCCESS;
} catch (SQLException e) {
e.printStackTrace();
addActionMessage("更新信息出现错误,请检查您当前网络连接!");
logger.info(e.getMessage());
return ERROR;
}
}
}
/*
* 管理员审核需求信息
*/
public String reviewXQInfo() throws IOException {
PrintWriter out = response.getWriter();
xqInfoID = request.getParameter("xqInfoID");
String sql = "update tb_info set isLock = '1' where type = '2' and user_id="+xqInfoID;
int num = mydb.executeUpdate(sql);
if(num>0) {
logger.info("审核需求信息,执行SQL:"+sql);
out.print("1");
}
out.close();
mydb.close();
return SUCCESS;
}
/*
* 管理员删除企业用户
*/
public String deleQy() throws IOException {
PrintWriter out = response.getWriter();
qyID = request.getParameter("qyID");
String sql = "delete from tb_company where id="+qyID;
int num = mydb.executeUpdate(sql);
if(num>0) {
logger.info("管理员删除企业用户表tb_compamy,执行SQL:"+sql);
out.print("1");
}
out.close();
mydb.close();
return SUCCESS;
}
/*
* 添加管理员
*/
public String addAdmin() throws IOException {
PrintWriter out = response.getWriter();
adminAccount = request.getParameter("adminAccount");
adminPass = request.getParameter("adminPass");
String sql = "insert into tb_manager (name, password, type) values (?,?,?)";
try {
ps = conn.prepareStatement(sql);
ps.setString(1, adminAccount);
ps.setString(2, adminPass);
ps.setString(3, "0");
int num = ps.executeUpdate();
if(num>0) {
logger.info("添加管理员,执行SQL:"+sql);
out.print("1");
ul#menu li a {
background: #333;
color: #fff;
padding: 0.5em;
}
ul#menu li a:hover {
background: #000;
}
ul#menu li ul li a {
background: #ccc;
color: #000;
padding-left: 20px;
}
ul#menu li ul li a:hover {
background: #aaa;
border-left: 5px #000 solid;
padding-left: 15px;
}
#content {
float: left;
padding: 10px;
margin: 5px 40px;
border: 1px solid silver;
width: 1050px;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("#menu ul a").click(function(){
$("#content").load($(this).attr("id"));
});
});
</script>
</head>
<body>
<div class="adminTop">
return false;
}
else if(name==null||name.equals("")){
addFieldError("user.name","请输入用户名");
return false;
}
else if(email==null||email.equals("")){
addFieldError("user.email","请输入邮箱");
return false;
}
else if(password==null||password.equals("")){
addFieldError("user.pwd","请输入密码!");
return false;
}
else if(repass==null||repass.equals("")){
addFieldError("user.repwd","请再次输入密码");
return false;
}
else if(securityCode==null||securityCode.equals("")){
addFieldError("user.securityCode","请输入验证码!");
return false;
}
else {
return true;
}
}
/**
* 验证用户的输入是否有效
* @return boolean
*/
public boolean isValid() {
String type=user.getType();
String name=user.getName();
String email=user.getEmail();
String password=user.getPwd();
String repass=user.getRepwd();
String securityCode=user.getSecurityCode().toUpperCase();
String userType = "tb_"+type;
OpDB myOp = new OpDB();
//接收客户端传来的验证码
String serverCode = (String)session.get("SESSION_SECURITY_CODE");
if(!serverCode.equals(securityCode)) {
addActionMessage("验证码不正确,请仔细看看再填入!");
return false;
ps.close();
logger.info("管理员添加新闻,执行SQL:"+sql);
addActionMessage("添加新闻成功!");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return SUCCESS;
}
/*
* 管理员删除新闻
*/
public String deleNews() {
newsID = request.getParameter("newsID");
String sql = "delete from tb_news where id ="+newsID;
mydb.executeUpdate(sql);
logger.info("删除新闻,执行SQL:"+sql);
mydb.close();
return SUCCESS;
}
/*
*管理员进行员工评价考核
*/
public String rateBm() {
String bmID = request.getParameter("bmID");
String bmRank = request.getParameter("bmRank");
String sql = "update tb_employee set rank =" +bmRank+ " where id ="+bmID;
mydb.executeUpdate(sql);
logger.info("更新家政员评级结果,执行SQL:"+sql);
mydb.close();
return SUCCESS;
}
/*
* 管理员签署合同
*/
public String confirmCont() throws IOException {
PrintWriter out = response.getWriter();
contID = request.getParameter("contID");
confirmDate = request.getParameter("confirmDate");
String sql = "update tb_contract set sigDate ='" +confirmDate+ "' where id="+contID;
int num = mydb.executeUpdate(sql);
if(num>0) {
logger.info("管理员签署合同,执行SQL:"+sql);
out.print("1");
}
*/
public String getBmSignature() {
return bmSignature;
}
/**
* @param bmSignature the bmSignature to set
*/
public void setBmSignature(String bmSignature) {
this.bmSignature = bmSignature;
}
/**
* @return the bmSigDate
*/
public String getBmSigDate() {
return bmSigDate;
}
/**
* @param bmSigDate the bmSigDate to set
*/
public void setBmSigDate(String bmSigDate) {
this.bmSigDate = bmSigDate;
}
/**
* @return the sigDate
*/
public String getSigDate() {
return sigDate;
}
/**
* @param sigDate the sigDate to set
*/
public void setSigDate(String sigDate) {
this.sigDate = sigDate;
}
}
/*
* 评价实体
*/
public class AssessForm {
logger.info(e.getMessage());
e.printStackTrace();
return false;
}
return true;
}
/** 功能:初始化注册用户信息
* @throws IOException */
public boolean IniEmployeeInfo(String username, String userType) throws IOException {
Connection conn = ConnDB.getConnection();
if(userType.equals("employee")) {
int userId=0;
String sql_queryID = "select id from tb_employee where name= ?";
String sql_insertCert = "insert into tb_cert (user_id,cert_jiankang,cert_yuesao,cert_hushi,cert_yingyangshi,cert_zaojiao,cert_jiashi,cert_chushi) values (?,?,?,?,?,?,?,?)";
String sql_insertSkills = "insert into tb_skills (user_id,skill_computer,skill_ironing,skill_handwork,skill_waiyu,skill_driving,skill_nutriology) values (?,?,?,?,?,?,?)";
String sql_insertLang = "insert into tb_lang (user_id,lang_local,lang_normal,lang_sichuan,lang_dongbei,lang_guangdong,lang_kejia,lang_minnan) values (?,?,?,?,?,?,?,?)";
String sql_insertFlavor = "insert into tb_flavor (user_id,flavor_local,flavor_xican,flavor_chuancai,flavor_yuecai,flavor_lucai,flavor_sucai,flavor_zhecai,flavor_xiangcai,flavor_mincai,flavor_huicai) values (?,?,?,?,?,?,?,?,?,?,?)";
String sql_insertSupply = "insert into tb_info (user_id,worktime,accomm,workType,type) values (?,?,?,?,?)";
try {
PreparedStatement ps =conn.prepareStatement(sql_queryID);
PreparedStatement ps1 =conn.prepareStatement(sql_insertCert);
PreparedStatement ps2 =conn.prepareStatement(sql_insertSkills);
PreparedStatement ps3 =conn.prepareStatement(sql_insertLang);
PreparedStatement ps4 =conn.prepareStatement(sql_insertFlavor);
PreparedStatement ps5 =conn.prepareStatement(sql_insertSupply);
ps.setString(1, username);
ResultSet rs = ps.executeQuery();
if(rs.next()) {
userId = rs.getInt("id");
}
rs.close();
ps.close();
logger.info("初始化注册用户ID,执行SQL:"+sql_queryID);
ps1.setInt(1, userId);
ps1.setInt(2, 0);
ps1.setInt(3, 0);
ps1.setInt(4, 0);
ps1.setInt(5, 0);
ps1.setInt(6, 0);
ps1.setInt(7, 0);
ps1.setInt(8, 0);
ps1.executeUpdate();
ps1.close();
logger.info("初始化注册用户的证书表,执行SQL:"+sql_insertCert);
ps2.setInt(1, userId);
ps2.setInt(2, 0);
ps2.setInt(3, 0);
ps2.setInt(4, 0);
ps2.setInt(5, 0);
ps2.setInt(6, 0);
//家政阿姨的状态
String status = null;
//预约节点
String node = null;
//家政阿姨是否选择
String isSuccess = null;
//根据保姆ID查询保姆状态
String sql_queryBmStatus = "select status from tb_employee where id=" + bmId;
//在预约表中查询雇主是否能够预约
String sql_isBooked = "select node, isSuccess from tb_book where gzId =" + gzId + " and isOutdated ='0'";
ResultSet rs1 = db.executeQuery(sql_queryBmStatus);
logger.info("执行SQL: "+sql_queryBmStatus);
ResultSet rs2 = db.executeQuery(sql_isBooked);
logger.info("执行SQL: "+sql_isBooked);
try {
if(rs1.next()) {
status = rs1.getString("status");
}
rs1.close();
if(status.equals("2")) {
addActionMessage("家政阿姨已在岗,请您重新预约其他阿姨,对此造成不便我们深表歉意!");
flag = false;
} else {
while(rs2.next()) {
node = rs2.getString("node");
isSuccess = rs2.getString("isSuccess");
if(node.equals("gz")) {
addActionMessage("亲,您已经预约过了,我们正在火速处理中!!");
flag = false;
break;
} else if(isSuccess.equals("1")) {
addActionMessage("您已预约了家政阿姨,一个账号只能预约一位家政阿姨!");
flag = false;
break;
} else {
flag = true;
}
}
if((node==null&&isSuccess==null)) {
flag = true;
}
}
rs2.close();
} catch (SQLException e) {
e.printStackTrace();
logger.info(e.getMessage());
} finally {
db.close();
}
return flag;
}
/*
while (rs_queryInfo.next()) {
GQInfoForm gqInfo = new GQInfoForm();
gqInfo.setUserId(rs_queryInfo.getInt("user_id"));
gqInfo.setWorkTime(rs_queryInfo.getInt("worktime"));
gqInfo.setWorkType(rs_queryInfo.getInt("workType"));
gqInfo.setIsAccomm(rs_queryInfo.getInt("accomm"));
gqInfo.setHeadLine(rs_queryInfo.getString("headline"));
gqInfo.setContent(rs_queryInfo.getString("content"));
gqInfo.setPostTime(rs_queryInfo.getString("posttime"));
gqInfo.setPay(rs_queryInfo.getString("pay"));
gqInfo.setPhone(rs_queryInfo.getString("phone"));
gqInfo.setType(rs_queryInfo.getString("type"));
list.add(gqInfo);
}
} catch(SQLException e) {
e.printStackTrace();
logger.info(e.getMessage());
}
JSONArray gqInfo = JSONArray.fromObject(list);
out.print(gqInfo);
out.flush();
out.close();
db.close();
return "gqInfo";
}
/*
* 功能:显示供求信息详细内容
*/
public String showGQDetail() throws IOException {
type = request.getParameter("type");
infoID = request.getParameter("infoID");
response.setContentType("application/json;charset=utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
List<GQInfoForm> list = new LinkedList<GQInfoForm>();
String sql_queryInfo = "select worktime, accomm, workType, headline, content, posttime, pay, phone, type from tb_info where user_id ="+infoID+" and type ="+type;
try {
ResultSet rs_queryInfo = db.executeQuery(sql_queryInfo);
logger.info("查询供求详细,执行SQL:"+sql_queryInfo);
if(rs_queryInfo.next()) {
GQInfoForm gqInfo = new GQInfoForm();
gqInfo.setWorkTime(rs_queryInfo.getInt("worktime"));
System.out.println("秒钟:" + cNow.get(Calendar.SECOND));
//本年的第几天,在计算时间间隔的时候有用
System.out.println("一年中的天数:" + cNow.get(Calendar.DAY_OF_YEAR));
System.out.println("一年中的周数:" + cNow.get(Calendar.WEEK_OF_YEAR));
//即本月的第几周
System.out.println("一月中的周数:" + cNow.get(Calendar.WEEK_OF_MONTH));
//即一周中的第几天(这里是以周日为第一天的)
System.out.println("一周中的天数:" + cNow.get(Calendar.DAY_OF_WEEK));
}
/**
* 判定某个年份是否是闰年
*
* @param year待判定的年份
*
* @return 判定结果
* */
public static boolean isLeapYear(int year)
{
return (year%400 == 0 || (year%4 == 0 && year%100 != 0));
}
/**
*
* 字符串去除两头空格,如果为空,则返回"",如果不空,则返回该字符串去掉前后空格
*
* @param tStr输入字符串
*
* @return 如果为空,则返回"",如果不空,则返回该字符串去掉前后空格
*
*/
public static String cTrim(String tStr)
{
String ttStr = "";
if (tStr == null)
{}
else
{
ttStr = tStr.trim();
}
return ttStr;
}
/**
* 比较两个Date类型的日期大小
*
* @param sDate开始时间
*
* @param eDate结束时间
*
* @return result返回结果(0--相同 1--前者大 2--后者大)
* */
public static int compareDate(Date sDate, Date eDate)
{
int result = 0;
//将开始时间赋给日历实例
addActionMessage("信息更新成功!");
logger.info("用户"+user+"更新信息成功!");
return SUCCESS;
} catch (SQLException e) {
e.printStackTrace();
addActionMessage("更新信息出现错误,请检查您当前网络连接!");
logger.info(e.getMessage());
return ERROR;
}
}
/*
* 功能:保姆发布供应信息
*/
public String addInfo() {
//获取保姆选择的工作类型
int workType = userInfo.getWorktype();
//获取保姆选择的工时
int workTime = userInfo.getWorktime();
//获取保姆选择的食宿要求
int accomm = userInfo.getAccomm();
//获取保姆输入的供应信息标题
String title = userInfo.getHeadLine();
//获取保姆输入的供应信息内容
String content = userInfo.getContent();
//获取保姆发布供应信息时间
String postTime = userInfo.getPostTime();
//获取保姆联系方式
String phone = userInfo.getPhone();
//获取保姆薪资
String pay = userInfo.getPay();
//执行数据库更新操作
try {
//查询当前用户Id
String user = null;
user = (String)session.get("username");
int userId = 0 ;
String sql = "select id from tb_employee where name = "+"'"+user+"'";
rs = mydb.executeQuery(sql);
if(rs.next()) {
userId = rs.getInt("id");
}
String sql_supply = "update tb_info set worktime =?, accomm =?, workType =?, headline =?, content =?, pay=?, phone=?, posttime =? where user_id =? and type=?";
PreparedStatement ps_supply = conn.prepareStatement(sql_supply);
ps_supply.setInt(1, workTime);
ps_supply.setInt(2, accomm);
ps_supply.setInt(3, workType);
ps_supply.setString(4, title);
ps_supply.setString(5, content);
ps_supply.setString(6, pay);
ps_supply.setString(7, phone);
ps_supply.setString(8, postTime);
ps_supply.setInt(9, userId);
*/
public String getPostTime() {
return postTime;
}
/**
* @param postTime the postTime to set
*/
public void setPostTime(String postTime) {
this.postTime = postTime;
}
/**
* @return the pay
*/
public String getPay() {
return pay;
}
/**
* @param pay the pay to set
*/
public void setPay(String pay) {
this.pay = pay;
}
}
/**
* 简单邮件(不带附件的邮件)发送器
*/
public class SimpleMailSender {
/**
* 以文本格式发送邮件
* @param mailInfo 待发送的邮件的信息
*/
public boolean sendTextMail(MailSendInfo mailInfo) {
// this.bmInfo = bmInfo;
//}
private static final long serialVersionUID = 1L;
int userId;
String surname;
String birthdate;
String hometown;
String uptime;
/*
* 0:未选择,默认查询所有
* 1:终点计时
* 2:半天
* 3:全天
*/
private String workTime;
/*
* 0:未选择,默认查询所有
* 1:包吃/包住
* 2:包吃/不包住
* 3:不包吃/包住
* 4:不包吃/不包住
*/
private String accomm;
/*
* 0:未选择,默认查询所有
* 1:做饭保洁
* 2:育儿嫂
* 3:育婴师
* 4:月嫂母婴
* 5:家教幼教
* 6:管家司机
*/
private String workType;
/*
* 0:未选择,默认查询所有
* cert_jiankang:健康证
* cert_yuesao:月嫂证
* cert_hushi:护士证
* cert_yingyangshi:营养师证
* cert_zaojiao:早教证
* cert_jiashi:驾驶证
* cert_chushi:厨师证
addActionMessage("用户名已存在!");
return false;
}
else return true;
}
/**
* 用户注册
* @return String
* @throws IOException
*/
public boolean Register() throws IOException {
String type=user.getType();
String name=user.getName();
String email=user.getEmail();
String password=user.getPwd();
String userType = "tb_"+type;
Connection conn = ConnDB.getConnection();
//注册用户插入数据库
try {
String sql = "insert into " + userType + " (name,email,password) values (?,?,?)";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, name);
ps.setString(2, email);
ps.setString(3, password);
ps.executeUpdate();
ps.close();
logger.info("插入注册用户信息,执行SQL:"+sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
logger.info(e.getMessage());
e.printStackTrace();
return false;
}
return true;
}
/** 功能:初始化注册用户信息
* @throws IOException */
public boolean IniEmployeeInfo(String username, String userType) throws IOException {
Connection conn = ConnDB.getConnection();
if(userType.equals("employee")) {
int userId=0;
String sql_queryID = "select id from tb_employee where name= ?";
String sql_insertCert = "insert into tb_cert (user_id,cert_jiankang,cert_yuesao,cert_hushi,cert_yingyangshi,cert_zaojiao,cert_jiashi,cert_chushi) values (?,?,?,?,?,?,?,?)";
String sql_insertSkills = "insert into tb_skills (user_id,skill_computer,skill_ironing,skill_handwork,skill_waiyu,skill_driving,skill_nutriology) values (?,?,?,?,?,?,?)";
String sql_insertLang = "insert into tb_lang (user_id,lang_local,lang_normal,lang_sichuan,lang_dongbei,lang_guangdong,lang_kejia,lang_minnan) values (?,?,?,?,?,?,?,?)";
String sql_insertFlavor = "insert into tb_flavor (user_id,flavor_local,flavor_xican,flavor_chuancai,flavor_yuecai,flavor_lucai,flavor_sucai,flavor_zhecai,flavor_xiangcai,flavor_mincai,flavor_huicai) values (?,?,?,?,?,?,?,?,?,?,?)";
String sql_insertSupply = "insert into tb_info (user_id,worktime,accomm,workType,type) values (?,?,?,?,?)";
try {
PreparedStatement ps =conn.prepareStatement(sql_queryID);
PreparedStatement ps1 =conn.prepareStatement(sql_insertCert);
PreparedStatement ps2 =conn.prepareStatement(sql_insertSkills);
<a href="#">管理员管理</a>
<ul>
<li><a href="#" id="addAdmin.jsp">添加管理员</a></li>
<li><a href="#" id="deleAdmin.jsp">删除管理员</a></li>
</ul>
</li>
</ul>
<div id="content"></div>
<%
}else {
%>
<script type="text/javascript">
$(document).ready(function() {
$(function () {
alert("本站后台禁止非法登录!");
location.href = "login.jsp"
});
});
</script>
<!-- <div class="error"> -->
<!-- <p>本站禁止非法登陆后台!</p> -->
<!-- </div> -->
<input type="hidden" value="<%=user%>" />
</body>
</html>
<% }%>
<!DOCTYPE html>
<!--
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Samples</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
CKEditor Samples
</h1>
<div class="twoColumns">
<div class="twoColumnsLeft">
<h2 class="samples">
Basic Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="replacebyclass.html">Replace textarea elements by class name</a></dt>
<dd>Automatic replacement of all textarea elements of a given class with a CKEditor instance.</dd>
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.info(e.getMessage());
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.info(e.getMessage());
}
}
//雇主消息提醒
if(type!=null&&type.equals("employer")){
BookBm bookBm = new BookBm();
int gzID = bookBm.queryID(user, "tb_employer");
try {
String sql_contract = "select gzSigDate, endDate from tb_contract where isOutdated = '0' and gzID="+gzID;
ResultSet rs_contract = mydb.executeQuery(sql_contract);
if(rs_contract.next()) {
String gzSigDate = rs_contract.getString("gzSigDate");
if(gzSigDate==null||gzSigDate.equals("")) {
MessageForm message = new MessageForm();
message.setMessageForm("您已成功完成预约流程,请尽快到【服务协议】中确认信息并签署服务协议!");
list.add(message);
}
String endDate = rs_contract.getString("endDate");
Date sDate = dt.parse(dt.format(new Date()));
Date eDate = dt.parse(endDate);
int interval = calDate.calInterval(sDate,eDate,"D");
MessageForm message = new MessageForm();
message.setMessageForm("您的合同还有"+interval+"天到期,请您注意!");
list.add(message);
//更新过期信息标识
// if(interval<=0) {
// String sqlBook = "update tb_book set isOutdated = '1' where gzID ="+gzID;
// mydb.executeUpdate(sqlBook);
// logger.info("预约表过期,执行SQL:"+sqlBook);
// String sqlContract = "update tb_contract set isOutdated = '1' where gzID ="+gzID;
// mydb.executeUpdate(sqlContract);
// logger.info("合同表过期,执行SQL:"+sqlContract);
// String sqlAssess = "update tb_assess set isOutdated = '1' where gzID ="+gzID;
// mydb.executeUpdate(sqlAssess);
// logger.info("评价表过期,执行SQL:"+sqlAssess);
// }
}
String sql_assess = "select svDate from tb_assess where isOutdated = '0' and gzID ="+gzID;
ResultSet rs_assess = mydb.executeQuery(sql_assess);
if(rs_assess.next()) {
String svDate = rs_assess.getString("svDate");
if(svDate==null||svDate.equals("")) {
MessageForm message = new MessageForm();
message.setMessageForm("您有尚未完成的服务评价,请及时到【服务评价】中查看并完成!");