基于javaweb+mysql的jsp+servlet家政服务管理系统(java+jsp+javascript+mysql)

基于javaweb+mysql的jsp+servlet家政服务管理系统(java+jsp+javascript+mysql)

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的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

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/login.jsp 登录
 * 日期类DateCalendar
 */

/** 
 * @time Jun 14, 2012 
 * @version V 1.0 
 *  
 * 实现的接口如下: 
 * 1---根据开始时间和间隔天数计算结束时间 Date calculateEndDate(Date sDate, int days) 
 * 2---根据开始时间、结束时间、间隔类型(年、月、日)计算间隔时间 int calInterval(Date sDate, Date eDate, String type) 
 * 3---输出日历实例(当前时间)的各个字段值 void printFields(Calendar cNow) 
 * 4---判定某个年份是否是闰年 boolean isLeapYear(int year) 
 * 5---比较两个日期的大小 int compareDate(Date sDate, Date eDate) 
 */ 
public class calDate {
	/** 
     * 根据起始日期和间隔时间计算结束日期 
     *  
     * @param sDate开始时间 
     *  
     * @param days间隔时间 
     *  
     * @return 结束时间 
     * */  
    public static Date calculateEndDate(Date sDate, int days)  
    {  
        //将开始时间赋给日历实例  
        Calendar sCalendar = Calendar.getInstance();  
        sCalendar.setTime(sDate);  
        //计算结束时间  
        sCalendar.add(Calendar.DATE, days);  
        //返回Date类型结束时间  
        return sCalendar.getTime();  
    } 
    /** 
     * 计算两个日期的时间间隔 
     *  
		try{
			db.executeQuery("set names gbk");
			ResultSet rs = db.executeQuery(sql_result);
			logger.info("执行SQL: "+sql_result);
			if(rs==null){
				logger.info("没有查询到相关信息的阿姨");
			}else{
			    while(rs.next()){
			    UserInfoForm bmInfo = new UserInfoForm();	
				userId = rs.getInt("id");
				surname = rs.getString("surname");
				birthdate = rs.getString("birthdate");
				hometown = rs.getString("hometown");
				uptime = rs.getString("uptime");
				
				logger.info("查询结果:用户编号"+userId);
				logger.info("查询结果:用户姓名"+surname);
//				logger.info("查询结果:用户年龄"+birthdate);
//				logger.info("查询结果:用户籍贯"+hometown);
//				logger.info("查询结果:用户更新时间"+uptime);
				bmInfo.setId(userId);
				bmInfo.setSurname(surname);
				bmInfo.setBirthDate(calAge(birthdate));
				bmInfo.setHometown(hometown);
				bmInfo.setUptime(uptime);
				list.add(bmInfo);
			    }
			    
			    JSONArray bm = JSONArray.fromObject(list);
			    out.print(bm);
			
			out.flush();
			out.close();

//			System.out.println(list.size());
			}	

			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			logger.info(e.getMessage());
			e.printStackTrace();
		}
		JSONArray newsDetail = JSONArray.fromObject(list);
		out.print(newsDetail);
		out.flush();
		out.close();
		db.close();
		return "newsDetail";
	}

}

public class BookBm extends MySuperAction{
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -3005168808853396441L;
	private ConnDB db = new ConnDB();
	private Connection conn = ConnDB.getConnection();
	private static Logger logger = Logger.getLogger(BookBm.class);
	//预约实体
	private BookBmForm bookBm;
	/**
	 * @return the bookBm
	 */
	public BookBmForm getBookBm() {
		return bookBm;
	}

	/**
	 * @param bookBm the bookBm to set
	 */
			logger.info("查询供求详细,执行SQL:"+sql_queryInfo);
			if(rs_queryInfo.next()) {
				GQInfoForm gqInfo = new GQInfoForm();
				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 gqDetail = JSONArray.fromObject(list);
		out.print(gqDetail);
		out.flush();
		out.close();
		db.close();
		return "gqDetail";
	}
	/*
	 * 功能:显示前台具体新闻信息
	 */
	public String showNewsDetail() throws IOException {
		newsID = request.getParameter("newsID");
		response.setContentType("application/json;charset=utf-8");
		response.setCharacterEncoding("utf-8");
		PrintWriter out = response.getWriter();
		List<NewsForm> list = new LinkedList<NewsForm>();
		String sql_queryNews = "select id, title, content, issuedate, type from tb_news where id="+newsID;
		try {
			ResultSet rs_queryNews = db.executeQuery(sql_queryNews);
			logger.info("查询新闻详细,执行SQL:"+sql_queryNews);
			if(rs_queryNews.next()) {
				NewsForm news = new NewsForm();
				news.setId(rs_queryNews.getInt("id"));
				news.setTitle(rs_queryNews.getString("title"));
				news.setContent(rs_queryNews.getString("content"));
				news.setIssuedate(rs_queryNews.getString("issuedate"));
				news.setType(rs_queryNews.getString("type"));
				list.add(news);
			}

	public String getAdminPass() {
		return adminPass;
	}

	public void setAdminPass(String adminPass) {
		this.adminPass = adminPass;
	}

	public String getAdminID() {
		return adminID;
	}

	public void setAdminID(String adminID) {
		this.adminID = adminID;
	}
	//控制台info
	private static Logger logger = Logger.getLogger(ManageAction.class);	
	//数据库访问对象
	ConnDB mydb=new ConnDB();
	Connection conn = ConnDB.getConnection();
	ResultSet rs = null;
	PreparedStatement ps =null;
	//登录实体
	private LoginForm user;
	/**
	 * @return the user
	 */
	public LoginForm getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(LoginForm user) {
		this.user = user;
	}
	//新闻实体
	private String newsTitle;
	private String newsContent;
	private String newsType;
            mailInfo.setFromAddress(emailUser);
            mailInfo.setToAddress(toAddress);
            mailInfo.setSubject("取回密码");
            mailInfo.setContent(content);
            SimpleMailSender sms = new SimpleMailSender();

            boolean flag = sms.sendTextMail(mailInfo);

            if (flag) {
                addActionMessage("邮件发送成功,请注意查收!");
                return SUCCESS;
            } else {
                addActionMessage("您当前网络不稳定发送失败,请检查网络连接后重试!");
                return INPUT;
            }
        }
        return INPUT;

    }

    /**
     * 功能 验证用户的输入
     */
    public boolean validateGetPass() {

        if (userType == null || userType.equals("")) {
            addFieldError("userType", "请选择注册的用户类型");
            return false;
        } else if (userName == null || userName.equals("")) {
            addFieldError("userName", "请输入注册的用户名!");
            return false;
        } else if (toAddress == null || toAddress.equals("")) {
            addFieldError("toAddress", "请输入注册的用户邮箱");
            return false;
        } else {
            return true;
        }
    }

}

public class BookBmForm {
       g.fillRect(0, 0, width, height);
       //设置边框颜色
       g.setColor(Color.LIGHT_GRAY);
       //设置字体样式
       g.setFont(new Font("Arial",Font.BOLD,height-2));
       //绘制边框
       g.drawRect(0, 0, width - 1, height - 1);
       //会制噪点
       Random rand = new Random();
       //设置噪点颜色
       g.setColor(Color.LIGHT_GRAY);
       for (int i = 0;i < 30;i++) {
    	   int x = rand.nextInt(width);
    	   int y = rand.nextInt(height);
    	   //绘制1 * 1大小的矩形
    	   g.drawRect(x, y, 1, 1);
       }
       
       //绘制验证码
       g.setFont(font);
       for(int i=0; i<this.text.length(); i++){
           g.setColor(colors[rdm.nextInt(colors.length)]);
           g.drawString(this.text.substring(i, i+1), 8 + i * 8, 15);
       }
       g.dispose();
      
       return image;
    }
   
    /**
     * 根据图片创建字节数组
     * @param image 用于创建字节数组的图片
     */
    private void generatorImageBytes(BufferedImage image){
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       try{
           javax.imageio.ImageIO.write(image, "jpg", bos);
           this.bytes = bos.toByteArray();
       }catch(Exception ex){
       }finally{
           try{
		int length = 0;
		FileInputStream fis = null;		
		fis = new FileInputStream(avatar);
		//获取用户输入的个人简介,如果为空则使用默认信息	
		String profile = userInfo.getProfile();
		profile = (profile==null||profile.equals("")) ? "这个人很懒,什么也没留下!" : profile;
		//获取用户上传信息的时间		
		String uptime = userInfo.getUptime();		
		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_employee = "update tb_employee set surname =?,hometown=?,sex=?,birthdate=?,phone=?,marriage=?,education=?,address=?,profile=?,uptime=?,avatar=? where id =?";
	    String sql_cert = "update tb_cert set cert_jiankang=?,cert_yuesao=?,cert_hushi=?,cert_yingyangshi=?,cert_zaojiao=?,cert_jiashi=?,cert_chushi=? where user_id=?";
	    String sql_skills = "update tb_skills set skill_computer=?,skill_ironing=?,skill_handwork=?,skill_waiyu=?,skill_driving=?,skill_nutriology=? where user_id=?";
	    String sql_lang = "update tb_lang set lang_local=?,lang_normal=?,lang_sichuan=?,lang_dongbei=?,lang_guangdong=?,lang_kejia=?,lang_minnan=? where user_id=?";
	    String sql_flavor = "update tb_flavor set flavor_local=?,flavor_xican=?,flavor_chuancai=?,flavor_yuecai=?,flavor_lucai=?,flavor_sucai=?,flavor_zhecai=?,flavor_xiangcai=?,flavor_mincai=?,flavor_huicai=? where user_id=?";
	    PreparedStatement ps =conn.prepareStatement(sql_employee);
	    PreparedStatement ps1 = conn.prepareStatement(sql_cert);
	    PreparedStatement ps2 = conn.prepareStatement(sql_skills);
	    PreparedStatement ps3 = conn.prepareStatement(sql_lang);
	    PreparedStatement ps4 = conn.prepareStatement(sql_flavor);
	    //更新用户证书表
	    ps1.setInt(1,result_cert[0]);
	    ps1.setInt(2,result_cert[1]);
	    ps1.setInt(3,result_cert[2]);
	    ps1.setInt(4,result_cert[3]);
	    ps1.setInt(5,result_cert[4]);
	    ps1.setInt(6,result_cert[5]);
	    ps1.setInt(7,result_cert[6]);
	    ps1.setInt(8,userId);
	    ps1.executeUpdate();
	    ps1.close();
	    logger.info("执行SQL:"+sql_cert);
		g.setFont(new Font("Arial",Font.BOLD,height-2));
		//绘制边框
		g.drawRect(0, 0, width - 1, height - 1);
		
		//绘制噪点
		Random rand = new Random();
		
		//设置噪点颜色
		g.setColor(Color.LIGHT_GRAY);
		for(int i = 0;i < codeLength * 6;i++) {
			int x = rand.nextInt(width);
			int y = rand.nextInt(height);
			//绘制1*1大小的矩形
			g.drawRect(x, y, 1, 1);
		}
		
		//绘制验证码
		int codeY = height - 10;
		//设置字体颜色和样式
		g.setColor(new Color(19,148,246));
		g.setFont(new Font("Georgia", Font.BOLD, fSize));
		for(int i = 0;i < codeLength;i++) {
			g.drawString(String.valueOf(securityCode.charAt(i)),i * 16 + 5, codeY);
		}
		//关闭资源
		g.dispose();
		
		return image;
	}
	
	/**
	 * 返回验证码图片的流格式
	 * @paramsecurityCode 验证码
	 * @return ByteArrayInputStream 图片流
	 */
	public static ByteArrayInputStream getImageAsInputStream(String securityCode) {
		BufferedImage image = createImage(securityCode);
		return convertImageToStream(image);
	}
	
	/**
	 * 将BufferedImage转换成ByteArrayInputStream
	 * @param image 图片
	 * @return ByteArrayInputStream 流
	 */
	
	public static ByteArrayInputStream convertImageToStream(BufferedImage image){
	    ByteArrayOutputStream os = new ByteArrayOutputStream();
	    try {
	        ImageIO.write(image, "png", os);
	        ByteArrayInputStream input = new ByteArrayInputStream(os.toByteArray());
	        return input;
	    } catch (IOException e) {
	    }
	    ps3.executeUpdate();
	    ps3.close();
	    logger.info("执行SQL:"+sql_lang);
	    //更新用户口味表
	    ps4.setInt(1, result_flavor[0]);
	    ps4.setInt(2, result_flavor[1]);
	    ps4.setInt(3, result_flavor[2]);
	    ps4.setInt(4, result_flavor[3]);
	    ps4.setInt(5, result_flavor[4]);
	    ps4.setInt(6, result_flavor[5]);
	    ps4.setInt(7, result_flavor[6]);
	    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) {
	PreparedStatement ps =null;
	//登录实体
	private LoginForm user;
	/**
	 * @return the user
	 */
	public LoginForm getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(LoginForm user) {
		this.user = user;
	}
	//新闻实体
	private String newsTitle;
	private String newsContent;
	private String newsType;
	private String newsIssuedate;
	public String getNewsTitle() {
		return newsTitle;
	}

	public void setNewsTitle(String newsTitle) {
		this.newsTitle = newsTitle;
	}

	public String getNewsContent() {
		return newsContent;
	}

	public void setNewsContent(String newsContent) {
		this.newsContent = newsContent;
	}

	public String getNewsType() {
		return newsType;
	}

       Graphics g = image.getGraphics();
       //设置背景色
       g.setColor(Color.WHITE);
       //填充背景
       g.fillRect(0, 0, width, height);
       //设置边框颜色
       g.setColor(Color.LIGHT_GRAY);
       //设置字体样式
       g.setFont(new Font("Arial",Font.BOLD,height-2));
       //绘制边框
       g.drawRect(0, 0, width - 1, height - 1);
       //会制噪点
       Random rand = new Random();
       //设置噪点颜色
       g.setColor(Color.LIGHT_GRAY);
       for (int i = 0;i < 30;i++) {
    	   int x = rand.nextInt(width);
    	   int y = rand.nextInt(height);
    	   //绘制1 * 1大小的矩形
    	   g.drawRect(x, y, 1, 1);
       }
       
       //绘制验证码
       g.setFont(font);
       for(int i=0; i<this.text.length(); i++){
           g.setColor(colors[rdm.nextInt(colors.length)]);
           g.drawString(this.text.substring(i, i+1), 8 + i * 8, 15);
       }
       g.dispose();
      
       return image;
    }
   
    /**
     * 根据图片创建字节数组
     * @param image 用于创建字节数组的图片
     */
    private void generatorImageBytes(BufferedImage image){
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       try{
           javax.imageio.ImageIO.write(image, "jpg", bos);
           this.bytes = bos.toByteArray();
       }catch(Exception ex){
       }finally{
           try{
              bos.close();
	/**
	 * @param birthDate
	 */
	public void setBirthDate(String birthDate) {
		this.birthDate = birthDate;
	}
	/**
	 * @return phone
	 */
	public String getPhone() {
		return phone;
	}
	/**
	 * @param phone
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}
	/**
	 * @return marriage
	 */
	public int getMarriage() {
		return marriage;
	}
	/**
	 * @param marriage
	 */
	public void setMarriage(int marriage) {
		this.marriage = marriage;
	}
	/**
	 * @return education
	 */
	public int getEducation() {
		return education;
	}
	/**
	 * @param education
	 */
	public void setEducation(int education) {
		this.education = education;
	}
	/**
	 * @return address
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * @param address
	 */
		}

	</style>
	<script>

		CKEDITOR.on( 'instanceReady', function( evt ) {
			var editor = evt.editor;
			editor.setData( 'This editor has it\'s tabIndex set to <strong>' + editor.tabIndex + '</strong>' );

			// Apply focus class name.
			editor.on( 'focus', function() {
				editor.container.addClass( 'cke_focused' );
			});
			editor.on( 'blur', function() {
				editor.container.removeClass( 'cke_focused' );
			});

			// Put startup focus on the first editor in tab order.
			if ( editor.tabIndex == 1 )
				editor.focus();
		});

	</script>
</head>
<body>
	<h1 class="samples">
		<a href="index.html">CKEditor Samples</a> &raquo; TAB Key-Based Navigation
	</h1>
	<div class="description">
		<p>
			This sample shows how tab key navigation among editor instances is
			affected by the <code>tabIndex</code> attribute from
			the original page element. Use TAB key to move between the editors.
		</p>
	</div>
	<p>
		<textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1"></textarea>
	</p>
	<div class="ckeditor" contenteditable="true" id="editor1" tabindex="4"></div>
	<p>
		<textarea class="ckeditor" cols="80" id="editor2" rows="10" tabindex="2"></textarea>
	</p>
	<p>
		<textarea class="ckeditor" cols="80" id="editor3" rows="10" tabindex="3"></textarea>
	</p>
	<div id="footer">
		<hr>
	}
	/**
	 * @return the svRecommend
	 */
	public int getSvRecommend() {
		return svRecommend;
	}
	/**
	 * @param svRecommend the svRecommend to set
	 */
	public void setSvRecommend(int svRecommend) {
		this.svRecommend = svRecommend;
	}
	/**
	 * @return the svContent
	 */
	public String getSvContent() {
		return svContent;
	}
	/**
	 * @param svContent the svContent to set
	 */
	public void setSvContent(String svContent) {
		this.svContent = svContent;
	}
	/**
	 * @return the svPoint
	 */
	public int getSvPoint() {
		return svPoint;
	}
	/**
	 * @param svPoint the svPoint to set
	 */
	public void setSvPoint(int svPoint) {
		this.svPoint = svPoint;
	}
	/**
	 * @return the svDate
	 */
	public String getSvDate() {
		return svDate;
	}
	/**
	 * @param svDate the svDate to set
	 */
	public void setSvDate(String svDate) {
		this.svDate = svDate;
	}
	/**
				if(rs_contract.next()) {
					String bmSigDate = rs_contract.getString("bmSigDate");
					if(bmSigDate==null||bmSigDate.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 bmID="+bmID;
						mydb.executeUpdate(sqlBook);
						logger.info("预约表过期,执行SQL:"+sqlBook);
						String sqlContract = "update tb_contract set isOutdated = '1' where bmID="+bmID;
						mydb.executeUpdate(sqlContract);
						logger.info("合同表过期,执行SQL:"+sqlContract);
						String sqlAssess = "update tb_assess set isOutdated = '1' where bmID="+bmID;
						mydb.executeUpdate(sqlAssess);
						logger.info("评价表过期,执行SQL:"+sqlAssess);
						String sqlEmployee = "update tb_employee set status = '0' where id ="+bmID;
						mydb.executeUpdate(sqlEmployee);
						logger.info("更新阿姨状态'在岗',执行SQL:"+sqlEmployee);
					}
				}
			} 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;
			logger.info("查询新闻信息,执行SQL:"+sql_queryNews);
			while (rs_queryNews.next()) {
				NewsForm news = new NewsForm();
				news.setId(rs_queryNews.getInt("id"));
				news.setTitle(rs_queryNews.getString("title"));
				news.setContent(rs_queryNews.getString("content"));
				news.setIssuedate(rs_queryNews.getString("issuedate"));
				news.setType(rs_queryNews.getString("type"));
				list.add(news);
			}
		} catch (SQLException e) {
			e.printStackTrace();
			logger.info(e.getMessage());
		}
		JSONArray news = JSONArray.fromObject(list);
		out.print(news);
		out.flush();
		out.close();
		db.close();
		return "news";
	}
	/*
	 * 显示前台供求信息
	 */
	public String showGQInfo() throws IOException {
		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 user_id, worktime, accomm, workType, headline, content, posttime, pay, phone, type from tb_info where isLock='1' order by posttime desc";
		try {
			ResultSet rs_queryInfo = db.executeQuery(sql_queryInfo);
			logger.info("查询供求信息,执行SQL:"+sql_queryInfo);
			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);
//					surname = rs.getString("surname");
//					birthdate = rs.getString("birthdate");
//					hometown = rs.getString("hometown");
//					uptime = rs.getString("uptime");
//					
//					bmInfo.setId(userId);
//					bmInfo.setSurname(surname);
//					bmInfo.setBirthDate(birthdate);
//					bmInfo.setHometown(hometown);
//					bmInfo.setUptime(uptime);
//					bmList.add(bmInfo);
//					System.out.println(bmInfo.getSurname());
//				}
//				JSONArray all = JSONArray.fromObject(bmList);
//			    out.print("hello");
//			    out.flush();
//			} catch(SQLException e){
//				logger.info(e.getMessage());
//				e.printStackTrace();
//			}  finally {
//				db.close();
//				out.close();
//			}
			out.write("hello");
			out.flush();
			return "ready";
	       }
	/*
	 * 显示保姆的详细信息
	 */
	@SuppressWarnings({ })
	public String detail() throws IOException {
		List<UserInfoForm> list1 = new LinkedList<UserInfoForm>();
		response.setContentType("application/json;charset=utf-8");
	    response.setCharacterEncoding("utf-8");
	    PrintWriter ot1 =  response.getWriter();
		String bmId = request.getParameter("id");
		logger.info("获取保姆ID:"+bmId);
		//根据ID查询保姆基本信息
		String sql_employee = "select status, id, surname, hometown, sex, birthdate, phone, marriage, education, address, profile, uptime from tb_employee where id="+bmId;
		ResultSet rs_employee = db.executeQuery(sql_employee);
		logger.info("执行SQL:"+sql_employee);
		//根据ID查询证书
		String sql_cert = "select * from tb_cert where user_id="+bmId;
		ResultSet rs_cert = db.executeQuery(sql_cert);

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 基于servlet+jsp+mysql开发的JavaWeb学生成绩管理系统,可以实现对学生信息、课程信息和成绩信息的管理。系统的主要功能包括学生信息的添加、修改、删除和查询,课程信息的添加、修改、删除和查询,成绩信息的录入、修改、删除和查询等。同时,系统还可以生成各种报表,如学生信息报表、课程信息报表、成绩信息报表等,方便管理员进行数据分析和决策。系统的开发需要掌握JavaWeb开发技术、ServletJSP的使用、MySQL数据库的操作等知识。 ### 回答2: JavaWeb学生成绩管理系统是一项基于servletjspmysql开发的管理信息系统,旨在为教育管理部门和教师提供一个便利的平台,帮助他们轻松地管理和分析学生成绩和课程信息。 该系统涵盖了学生信息管理、课程信息管理、成绩管理、教师信息管理、管理员信息管理五个模块。在学生信息管理模块,管理员可以添加、修改及删除学生信息,同时可对学生信息进行查询和导出等操作;在课程信息管理模块,管理员可以添加、修改及删除课程信息,同时可对课程信息进行查询和导出等操作。 在成绩管理模块,管理员可以将学生从课程中添加进去,对学生的成绩进行管理、修改及删除等操作。同时,该模块内置了成绩分析和统计功能,使得教师可以使用统计图表看到平均分、最高分、最低成绩等信息,以更好地了解学生的学习情况。 在教师信息管理模块,管理员可以添加、修改及删除教师信息,同时可对教师信息进行查询和导出等操作。教师可以使用该模块对自己授课的课程进行成绩管理并进行统计分析。 在管理员信息管理模块,管理员可以对自己的账号信息进行管理,包括修改密码、添加、删除及修改管理员信息等操作。 总体来说,JavaWeb学生成绩管理系统通过servletjspmysql等技术的应用,实现了对学生成绩、课程等信息进行全方位管理,并且使得数据的统计、排序、查询等功能更加的便捷和高效,为教育管理和学习提供了极大的便利。 ### 回答3: 基于servlet jsp mysql开发javaweb学生成绩管理系统是一种非常实用的系统,可以帮助管理者和学生更好地进行成绩管理。通过该系统,管理者可以随时查看学生的成绩情况,对学生进行动态管理,帮助学生更好地提高成绩。同时,学生也可以随时了解自己在课程中的成绩和提升方向,方便自我调整和完善。 该系统采用了servlet jsp mysql技术进行开发,具有以下优点: 1. 通过servlet技术,可以实现后台数据传输和处理,确保系统的稳定性和安全性; 2. 通过jsp技术,可以实现动态网页的生成和展示,提供更好的用户体验;同时,jsp还可以方便地进行数据查询和修改操作; 3. 通过mysql作为数据库,可以实现数据的存储和管理,确保数据的完整性和可靠性;同时,mysql还具有较高的性能和扩展性,可以满足系统的快速增长。 在实现该系统时,需要进行以下步骤: 1. 分析需求,确定系统的功能和界面设计; 2. 设计数据库结构,确定数据表和字段; 3. 编写servletjsp代码,实现数据的查询、修改和展示功能; 4. 联调测试,确保系统的稳定性和可用性; 5. 部署上线,让用户可以随时使用系统。 总之,基于servlet jsp mysql技术开发javaweb学生成绩管理系统,可以有效提高学生的成绩和帮助管理者更好地管理学生成绩,是一种非常实用和有用的系统。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值