栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

JavaWeb开发基于ssm的校园服务系统(实例详解)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

JavaWeb开发基于ssm的校园服务系统(实例详解)

利用Javaweb开发的一个校园服务系统,通过发布自己的任务并设置悬赏金额,有些类似于赏金猎人,在这里分享给大家,有需要可以联系我:2186527424:




 
 
 
 
 
 
 
 
 
 
 
 
 stuid, studentid, password, schoolid, sex, name, registertime, money, state
 
 
 select 
 
 from user
 where stuid = #{stuid,jdbcType=INTEGER}
 
 
 delete from user
 where stuid = #{stuid,jdbcType=INTEGER}
 
 
 insert into user (stuid, studentid, password, 
  schoolid, sex, name, 
  registertime, money, state
  )
 values (#{stuid,jdbcType=INTEGER}, #{studentid,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
  #{schoolid,jdbcType=INTEGER}, #{sex,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
  #{registertime,jdbcType=TIMESTAMP}, #{money,jdbcType=DOUBLE}, #{state,jdbcType=INTEGER}
  )
 
 
 insert into user
 
  
  stuid,
  
  
  studentid,
  
  
  password,
  
  
  schoolid,
  
  
  sex,
  
  
  name,
  
  
  registertime,
  
  
  money,
  
  
  state,
  
 
 
  
  #{stuid,jdbcType=INTEGER},
  
  
  #{studentid,jdbcType=VARCHAR},
  
  
  #{password,jdbcType=VARCHAR},
  
  
  #{schoolid,jdbcType=INTEGER},
  
  
  #{sex,jdbcType=INTEGER},
  
  
  #{name,jdbcType=VARCHAR},
  
  
  #{registertime,jdbcType=TIMESTAMP},
  
  
  #{money,jdbcType=DOUBLE},
  
  
  #{state,jdbcType=INTEGER},
  
 
 
 
 update user
 
  
  studentid = #{studentid,jdbcType=VARCHAR},
  
  
  password = #{password,jdbcType=VARCHAR},
  
  
  schoolid = #{schoolid,jdbcType=INTEGER},
  
  
  sex = #{sex,jdbcType=INTEGER},
  
  
  name = #{name,jdbcType=VARCHAR},
  
  
  registertime = #{registertime,jdbcType=TIMESTAMP},
  
  
  money = #{money,jdbcType=DOUBLE},
  
  
  state = #{state,jdbcType=INTEGER},
  
 
 where stuid = #{stuid,jdbcType=INTEGER}
 
 
 update user
 set studentid = #{studentid,jdbcType=VARCHAR},
  password = #{password,jdbcType=VARCHAR},
  schoolid = #{schoolid,jdbcType=INTEGER},
  sex = #{sex,jdbcType=INTEGER},
  name = #{name,jdbcType=VARCHAR},
  registertime = #{registertime,jdbcType=TIMESTAMP},
  money = #{money,jdbcType=DOUBLE},
  state = #{state,jdbcType=INTEGER}
 where stuid = #{stuid,jdbcType=INTEGER}
 
 
 
 SELECT COUNT(*) FROM `user` WHERe studentid = #{account,jdbcType=VARCHAR};
 
 
 

注销登录界面

package com.ssm.controller;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.SessionAttributes;
import com.ssm.util.JsonUtil;
import com.ssm.po.School;
import com.ssm.po.User;
import com.ssm.service.SchoolService;
import com.ssm.service.UserService;

@Controller
@SessionAttributes({ "nowuser","nowadmin"})
@RequestMapping(value = "common/")
public class CommonController {
 @Resource(name = "schoolService")
 public SchoolService schoolService;
 
 @Resource(name = "userService")
 public UserService userService;
 
 // 注销
 @RequestMapping("logout.do")
 public String logout(HttpServletRequest request, Model model) {
 model.addAttribute("msg", "已退出");
 request.getSession(false).removeAttribute("nowuser");
 request.getSession(false).removeAttribute("nowadmin");
 return "login";
 }
 
 @RequestMapping("getallschools.do")
 public void getallschools(HttpServletResponse response) throws IOException{
 System.out.println("000000000000000000000000000000000");
 List list = schoolService.getAllSchoolsNoState();
 response.setCharacterEncoding("UTF-8");
 response.setContentType("text/html");
 String list_String = JsonUtil.list2json(list);
 PrintWriter out = response.getWriter();
 out.println(list_String);
 out.flush();
 out.close();
 }
 
 @RequestMapping("getuser.do")
 public String getuser(String stuidstr,HttpServletRequest request,Model model) {
 int stuid = 0;
 try {
 stuid = Integer.parseInt(stuidstr);
 } catch (Exception e) {
 model.addAttribute("msg", "出现错误");
 return "userInfo";
 }
 if (stuid==0) {
 model.addAttribute("msg", "出现错误");
 return "userInfo";
 }
 User user = userService.getByUid(stuid);
 model.addAttribute("theuser", user);
 return "userInfo";
 }
}

用户界面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
 + path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>




个人中心







 



 
 
 校园即时服务平台
 
 
  • 任务中心
  • 个人中心
  • ${nowuser.name }
    个人信息
    资料修改
    安全设置
  • 退了
  • 校园即时服务平台
  • 任务管理
    已发布任务
    已接受任务
    发布新任务
  • 个人中心
    个人信息
    资料修改
    安全设置
个人信息
 
信息
   
用户编号 ${nowuser.stuid }
用户学号 ${nowuser.studentid }
用户姓名 ${nowuser.name }
学校编号 ${nowuser.schoolid }
用户性别
注册时间
用户余额 ${nowuser.money }
用户状态 正常 被限制
  © - 校园即时服务平台办公电话:6666666

总结

以上所述是小编给大家介绍的JavaWeb开发基于ssm的校园服务系统,希望对大家有所帮助!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/135338.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号