基于javaweb+mysql的ssm+maven学生综合素质评价系统(java+ssm+thymeleaf+html+layui+mysql)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM+Maven学生综合素质评价系统(java+ssm+thymeleaf+html+layui+mysql)
项目介绍
基于SSM的学生综合素质评价系统设计与实现,系统共分三种角色,包括管理员、教师、学生; 管理员主要功能包括: 权限中心:用户组权限控制、用户组信息管理; 系统设置:菜单管理、系统日志、成绩比例修改; 信息管理:教师信息管理、学生信息管理、课程信息管理、班级信息管理、学期信息管理、状态信息管理、用户账号管理; 教师主要功能包括: 活动管理:活动记录管理; 信息维护:个人信息修改、学生信息管理; 综合评测:综合成绩管理、学生异议处理、学生成绩分析; 成绩管理:学生成绩管理; 学生主要功能包括: 学生个人信息:个人信息修改; 信息查询:活动记录查询、成绩查询、综合成绩查询; 异议申报:学生异议申报;
环境需要
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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 6.数据库:MySql 5.7版本;
技术栈
- 后端:SSM(Spring SpringMVC MyBatis) 2. 前端:thymeleaf和layui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置 4. 运行项目,在浏览器中输入http://localhost:8080/ 登录; 注意项目路径必须配置为/,否则会出错;
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了教师列表数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查询教师工号*/
@RequestMapping("/selectjslast")
public JSONObject selectjslast(HttpServletRequest httpServletRequest) {
Teacher teacher = teacherService.getteacherlast();
List<Map<String, Object>> list = new ArrayList<>();
int idcard = teacher.getTcard();
Map map = new HashMap();
map.put("idcard", idcard+1);
list.add(map);
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了最后一条教师数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查看系统日志*/
@RequestMapping("/selectxtrzgl")
public Map<String, Object> selectxtrzgl(HttpServletRequest httpServletRequest, @RequestParam(value = "page") int page,@RequestParam(value = "limit") int limit) {
page = page-1;
int start = page*limit;
int end = (page+1)*limit-1;
List<Log> logs = logService.getlogList();
int datacount = logs.size();
int i = 0;
List<Map<String, Object>> list = new ArrayList<>();
if (logs != null) {
for (Log log : logs) {
message = "解析数据出错,请检查数据。";
}
if (spjList == null || spjList.size() == 0) {
message = "没有解析到数据,导入0条数据。";
}
// 更新数据
if (spjList != null && spjList.size() > 0) {
int count = 0;
String errorXh = "";
beanList = parseListCJ(spjList);
List list = new ArrayList();
for (int i = 0; i < beanList.size(); i++) {
Map beanMap = (Map) beanList.get(i);
int errCnt = (int)beanMap.get("err");
if (errCnt != 1) {
list.add(beanMap);
count++;
} else if ("".equals(errorXh)) {
errorXh = errorXh + (i + 1);
} else {
errorXh = errorXh + "," + (i + 1);
}
if (count == beanList.size()) {
message = "导入成功,导入" + count + "条数据。";
} else {
message = "导入失败,请检查第" + errorXh + "条数据。";
}
}
if ("".equals(errorXh)) {
//保存需求上报数据
for (int m = 0; m < list.size(); m++) {
Map bean_tmp = (Map) list.get(m);
int sskid = (int)Double.parseDouble((String) bean_tmp.get("sskid"));
int sssid = (int)Double.parseDouble((String) bean_tmp.get("sssid"));
int st = (int)Double.parseDouble((String) bean_tmp.get("st"));
double gradeduo = Double.parseDouble((String) bean_tmp.get("grade"));
Kecheng kecheng = kechengService.getKechengById(sskid);
if (kecheng==null)
continue;
int xf = kecheng.getXf();
String xfjd;
if(gradeduo>=60)
xfjd = String.valueOf((gradeduo-50)/10);
else xfjd=String.valueOf(0);
map.put("username", usernamestr);
map.put("groupstr", groupstr);
map.put("regtime", regtime);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了用户信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*管理员查询学生信息*/
@RequestMapping("/selectxsxxgl")
public JSONObject selectxsxxgl(@RequestParam(required = false)String sname,@RequestParam(required = false) String idcard, HttpServletRequest httpServletRequest) {
Map requestparamMap = new HashMap();
if (sname!=null&&!sname.equals(""))
requestparamMap.put("sname","%"+sname+"%");
if (idcard!=null&&!idcard.equals(""))
requestparamMap.put("idcard","%"+idcard+"%");
List<Student> students = studentService.getStudentList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
if (students != null) {
for (Student student : students) {
int id = student.getId();
String snamestr = student.getSname();
int xuehao = student.getXuehao();
String ssex = student.getSsex();
Date date = student.getScsny();
String scsny = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";
int bid = student.getSscid();
Classes classes = classesService.getClassesById(bid);
String ssbj = classes.getBj();
String sszy = classes.getZy();
String sphone = student.getSphone();
Map map = new HashMap();
map.put("id", id);
map.put("sname", snamestr);
String sszy = classes.getZy();
String sphone = student.getSphone();
Map map = new HashMap();
map.put("id", id);
map.put("sname", snamestr);
map.put("xuehao", xuehao);
map.put("ssex", ssex);
map.put("sszy", sszy);
map.put("ssbj", ssbj);
map.put("scsny", scsny);
map.put("sphone", sphone);
list.add(map);
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了"+sid+"学生信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*学生成绩管理*/
@RequestMapping("/selectxscjgl")
public JSONObject selectxscjgl(HttpServletRequest httpServletRequest,@RequestParam(required = false) String idcard,@RequestParam(required = false) Integer kid,@RequestParam(required = false) Integer sid) {
HttpSession session = httpServletRequest.getSession();
Users users = (Users) session.getAttribute("islogin");
int isnull = 0;
Map requestparamMap = new HashMap();
if (idcard != null && !idcard.equals("")) {
Student studentpa = studentService.getStudentByIdcard(Integer.parseInt(idcard));
if (studentpa!=null){
requestparamMap.put("st",studentpa.getId());
}
else {
isnull=1;
}
}
requestparamMap.put("sskid",kid);
requestparamMap.put("sssid",sid);
List<Map<String, Object>> list = new ArrayList<>();
if (users!=null&&isnull!=1){
if (users.getGroupid()==2){
String tusername = users.getUsername();
Teacher teacher = teacherService.getTeacherBytcard(Integer.parseInt(tusername));
if (teacher!=null){
int tid = teacher.getId();
Map cmap = new HashMap();
cmap.put("tid",tid);
List<Classes> classess = classesService.getClassesList(cmap);
if (classess!=null){
for (Classes classes :classess ){
List<Integer> cid = new ArrayList<>();
int cidtemp = classes.getId();
cid.add(cidtemp);
if (cid.size()>0){
Map smap = new HashMap();
smap.put("list",cid);
List<Student> students = studentService.getStudentList(smap);
if (students!=null){
for (Student student : students){
int sid = student.getId();
sids.add(sid);
}
}
}
}
}
}
}
if (sids.size()>0){
Map requestparamMap = new HashMap();
requestparamMap.put("list2",sids);
List<Student> students = studentService.getStudentList(requestparamMap);
if (students != null) {
for (Student student : students) {
int id = student.getId();
String sname = student.getSname();
int xuehao = student.getXuehao();
Map map = new HashMap();
map.put("id", id);
map.put("sname", sname);
map.put("xuehao", xuehao);
list.add(map);
}
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了学生列表数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查看教师*/
@RequestMapping("/selectjs")
public JSONObject selectjs(HttpServletRequest httpServletRequest) {
Map requestparamMap = new HashMap();
@Autowired
private TeacherService teacherService;
@Autowired
private UsersService usersService;
@Autowired
private StudentService studentService;
@Autowired
private KechengService kechengService;
@Autowired
private ClassesService classesService;
@Autowired
private SemesterService semesterService;
@Autowired
private ZhuangtaiService zhuangtaiService;
@Autowired
private ActivityService activityService;
@Autowired
private GradeService gradeService;
@Autowired
private ZhcjService zhcjService;
@Autowired
private KcblService kcblService;
/*添加用户组信息*/
@RequestMapping("Insertyhzxxgl")
public boolean Insertyhzxxgl(@RequestParam(value = "title") String title,
HttpServletRequest httpServletRequest) {
Groupinfo groupinfo = new Groupinfo();
groupinfo.setGroupname(title);
if (groupinfoService.insertGroupinfo(groupinfo) != 0) {
setLog.setlod(httpServletRequest, "添加名字为" + title + "的用户组", logService);
return true;
} else
return false;
}
/*添加学生并创建该学生的登录账户*/
@RequestMapping("Insertxsxxgl")
public boolean Insertxsxxgl(@RequestParam String sname,
@RequestParam String birth,
@RequestParam String cid,
@RequestParam String tel,
@RequestParam String idcard,
@RequestParam String xb,
HttpServletRequest httpServletRequest) throws ParseException {
//判断数据库中是否存在该学号学生
if (studentService.getStudentByIdcard(Integer.parseInt(idcard)) != null)
return false;
Student student = new Student();
map.put("sssid", sssid);
map.put("grade", gradestr);
map.put("xf", xf);
map.put("zxs", zxs);
map.put("khfs", khfs);
map.put("ksxz", ksxz);
map.put("xfjd", df.format(Double.parseDouble(xfjd)));
list.add(map);
}
}
}
}
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了学生成绩数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*学生查询成绩*/
@RequestMapping("/selectcjcx")
public JSONObject selectcjcx(HttpServletRequest httpServletRequest) {
HttpSession session = httpServletRequest.getSession();
Users users = (Users) session.getAttribute("islogin");
Student student = studentService.getStudentByIdcard(Integer.parseInt(users.getUsername()));
Map requestparamMap = new HashMap();
requestparamMap.put("st", student.getId());
List<Grade> grades = gradeService.getGradeList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
if (grades != null) {
for (Grade grade : grades) {
int id = grade.getId();
int sid = grade.getSt();
String st = studentService.getStudentById(sid).getSname();
int kid = grade.getSskid();
@RequestMapping("Insertyhzxxgl")
public boolean Insertyhzxxgl(@RequestParam(value = "title") String title,
HttpServletRequest httpServletRequest) {
Groupinfo groupinfo = new Groupinfo();
groupinfo.setGroupname(title);
if (groupinfoService.insertGroupinfo(groupinfo) != 0) {
setLog.setlod(httpServletRequest, "添加名字为" + title + "的用户组", logService);
return true;
} else
return false;
}
/*添加学生并创建该学生的登录账户*/
@RequestMapping("Insertxsxxgl")
public boolean Insertxsxxgl(@RequestParam String sname,
@RequestParam String birth,
@RequestParam String cid,
@RequestParam String tel,
@RequestParam String idcard,
@RequestParam String xb,
HttpServletRequest httpServletRequest) throws ParseException {
//判断数据库中是否存在该学号学生
if (studentService.getStudentByIdcard(Integer.parseInt(idcard)) != null)
return false;
Student student = new Student();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date birthtime = sdf.parse(birth);
student.setSname(sname);
student.setScsny(birthtime);
student.setSscid(Integer.parseInt(cid));
student.setSphone(tel);
student.setXuehao(Integer.parseInt(idcard));
student.setSsex(xb);
//添加学生
if (studentService.insertStudent(student) != 0) {
Users users = new Users();
users.setUsername(idcard);
users.setGroupid(3);
users.setRegtime(new Date(new Date().getTime()));
users.setUpassword(UtilPacket.Md5MD5String("123456"));
//创建学生账号
if (usersService.insertSelective(users) != 0)
setLog.setlod(httpServletRequest, "成功为学号" + idcard + "创建账户", logService);
setLog.setlod(httpServletRequest, "添加学号为" + idcard + "的学生", logService);
return true;
} else
return false;
}
/*添加教师信息*/
if (logs != null) {
for (Log log : logs) {
if (i>=start&&i<=end){
int id = log.getId();
String cz = log.getCz();
int czr = log.getCzr();
Date date = log.getTime();
String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());
String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());
String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());
String timestr = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;
String czrstr=usersService.selectByPrimaryKey(czr).getUsername();
Map map = new HashMap();
map.put("id", id);
map.put("cz", cz);
map.put("czr", czrstr);
map.put("time", timestr);
list.add(map);
}
i++;
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", datacount);
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了全部系统日志信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查询父菜单*/
@RequestMapping("/selectfcd2")
public JSONObject selectfcd2(HttpServletRequest httpServletRequest) {
List<Menu> menus = menuService.getfdmmenuList();
List<Map<String, Object>> list = new ArrayList<>();
if (menus != null) {
for (Menu menu : menus) {
int id = menu.getId();
String menuname = menu.getMenuname();
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了父菜单信息数据",logService);
return map1;
}
/*管理员查看教师信息*/
@RequestMapping("/selectjsxxgl")
public JSONObject selectjsxxgl(@RequestParam(required = false)String tname,@RequestParam(required = false) String tcard, HttpServletRequest httpServletRequest) {
Map requestparamMap = new HashMap();
if (tname!=null&&!tname.equals(""))
requestparamMap.put("tname","%"+tname+"%");
if (tcard!=null&&!tcard.equals(""))
requestparamMap.put("tcard","%"+tcard+"%");
List<Teacher> teachers = teacherService.getTeacherList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
if (teachers != null) {
for (Teacher teacher : teachers) {
int id = teacher.getId();
String tnamestr = teacher.getTname();
String tsex = teacher.getTsex();
Date date = teacher.getTbirth();
String tbirth = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";
int tcardstr = teacher.getTcard();
String tphone = teacher.getTphone();
String tzc = teacher.getTzc();
Map map = new HashMap();
map.put("id", id);
map.put("tname", tnamestr);
map.put("tsex", tsex);
map.put("tbirth", tbirth);
map.put("tcard", tcardstr);
map.put("tphone", tphone);
map.put("tzc", tzc);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了教师信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查询活动信息*/
@RequestMapping("/selecthdjlgl")
public JSONObject selecthdjlgl(@RequestParam(required = false)String aname, HttpServletRequest httpServletRequest,@RequestParam int limit,@RequestParam int page) {
if (kecheng!=null) {
knamestr = kecheng.getKname();
dkxf = kecheng.getXf();
if (knamestr.equals("素拓")){
stcj = Double.parseDouble(grade2.getGrade());
}
else if (knamestr.equals("德育")){
dycj = Double.parseDouble(grade2.getGrade());
}
else if (knamestr.equals("体育")){
tycj = Double.parseDouble(grade2.getGrade());
}
else if (knamestr.equals("已删除该课程")){
continue;
}
else {
zcj=zcj+Double.parseDouble(grade2.getGrade())*dkxf;//总成绩
zxf=zxf+dkxf;//总学分
}
}
}
}
double zxfjd=0.0;
if (zxf!=0)
zxfjd=zcj/zxf;//总学分绩点
zhcj.setZhcj(df.format(zxfjd*zhbl+dycj*dybl+tycj*tybl+stcj*stbl));
zhcj.setYscj(df.format(zxfjd*zhbl+dycj*dybl+tycj*tybl));
zhcj.setZxfjd(df.format(zxfjd));
}
if (zhcjService.upZhcj(zhcj) != 0)
setLog.setlod(httpServletRequest, "学生" + st + "的综合成绩已更新", logService);
}
//如果没有此学生则创建综合成绩
else {
Zhcj newzhcj = new Zhcj();
newzhcj.setSssid(sssid);
newzhcj.setSsuid(st);
newzhcj.setSszid(1);
if (kname.equals("素拓"))
newzhcj.setZhcj(String.valueOf(Double.parseDouble(grade) * stbl));
else if (kname.equals("德育")) {
newzhcj.setZhcj(String.valueOf(Double.parseDouble(grade) * dybl));
newzhcj.setYscj(String.valueOf(Double.parseDouble(grade) * dybl));
} else if (kname.equals("体育")) {
newzhcj.setZhcj(String.valueOf(Double.parseDouble(grade) * tybl));
newzhcj.setYscj(String.valueOf(Double.parseDouble(grade) * tybl));
} else {//计算其它课程总学分,总成绩
double stcj=0;
double dycj=0;
double tycj=0;
List<Map<String, Object>> list = new ArrayList<>();
if (student != null) {
int id = student.getId();
String snamestr = student.getSname();
int xuehao = student.getXuehao();
String ssex = student.getSsex();
Date date = student.getScsny();
String scsny = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";
int bid = student.getSscid();
Classes classes = classesService.getClassesById(bid);
String ssbj = classes.getBj();
String sszy = classes.getZy();
String sphone = student.getSphone();
Map map = new HashMap();
map.put("id", id);
map.put("sname", snamestr);
map.put("xuehao", xuehao);
map.put("ssex", ssex);
map.put("sszy", sszy);
map.put("ssbj", ssbj);
map.put("scsny", scsny);
map.put("sphone", sphone);
list.add(map);
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了"+sid+"学生信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*学生成绩管理*/
@RequestMapping("/selectxscjgl")
public JSONObject selectxscjgl(HttpServletRequest httpServletRequest,@RequestParam(required = false) String idcard,@RequestParam(required = false) Integer kid,@RequestParam(required = false) Integer sid) {
HttpSession session = httpServletRequest.getSession();
Users users = (Users) session.getAttribute("islogin");
int isnull = 0;
Map requestparamMap = new HashMap();
if (idcard != null && !idcard.equals("")) {
Student studentpa = studentService.getStudentByIdcard(Integer.parseInt(idcard));
if (studentpa!=null){
requestparamMap.put("st",studentpa.getId());
}
else {
isnull=1;
}
else if (knamestr.equals("已删除该课程")){
continue;
}
else {
zcj=zcj+Double.parseDouble(grade2.getGrade())*dkxf;
zxf=zxf+dkxf;
}
}
}
}
double zxfjd=0;
if (zxf!=0)
zxfjd=zcj/zxf;
newzhcj.setZhcj(df.format(zxfjd*zhbl+dycj*dybl+tycj*tybl+stcj*stbl));
newzhcj.setYscj(df.format(zxfjd*zhbl+dycj*dybl+tycj*tybl));
newzhcj.setZxfjd(df.format(zxfjd));
}
if (zhcjService.insertZhcj(newzhcj)!=0)
setLog.setlod(httpServletRequest, "学生" + st + "的综合成绩已创建", logService);
}
return true;
} else
return false;
}
/*添加菜单*/
@RequestMapping("Insertcdgl")
public boolean Insertcdgl(@RequestParam(value = "menuname") String menuname,
@RequestParam(value = "menulink") String menulink,
@RequestParam(value = "fdm") String fdm,
HttpServletRequest httpServletRequest) {
Menu menu = new Menu();
if (menuname != "")
menu.setMenulink(menulink);
menu.setMenuname(menuname);
if (fdm != "")
menu.setFdm(fdm);
if (menuService.insertSelective(menu) != 0) {
setLog.setlod(httpServletRequest, "添加名字为" + menuname + "的菜单", logService);
return true;
} else
return false;
}
List<Map<String, Object>> list = new ArrayList<>();
if (zhuangtais != null) {
for (Zhuangtai zhuangtai : zhuangtais) {
int id = zhuangtai.getId();
String ztnamestr = zhuangtai.getZtname();
Map map = new HashMap();
map.put("id", id);
map.put("ztname", ztnamestr);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了状态信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查询用户账号*/
@RequestMapping("/selectyhzhgl")
public JSONObject selectyhzhgl(@RequestParam(required = false)String username,HttpServletRequest httpServletRequest) {
Map requestparamMap = new HashMap();
if (username!=null&&!username.equals(""))
requestparamMap.put("username","%"+username+"%");
List<Users> userss = usersService.getuserList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
if (userss != null) {
for (Users users : userss) {
int id = users.getId();
String usernamestr = users.getUsername();
int gid = users.getGroupid();
String groupstr = groupinfoService.getGroupinfoById(gid).getGroupname();
Date date = users.getRegtime();
String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());
String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());
String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());
String regtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;
Map map = new HashMap();
map.put("id", id);
map.put("username", usernamestr);
map.put("groupstr", groupstr);
map.put("regtime", regtime);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
@RequestMapping("/upztxxgl")
public boolean upztxxgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Zhuangtai zhuangtai = zhuangtaiService.getZhuangtaiById(id);
if (zhuangtai != null) {
zhuangtai.setZtname(updateValue);
if (zhuangtaiService.upZhuangtai(zhuangtai) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的状态" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/*修改课程信息*/
@RequestMapping("/upkcxxgl")
public boolean upkcxxgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Kecheng kecheng = kechengService.getKechengById(id);
if (kecheng != null) {
if (field.equals("kname"))
kecheng.setKname(updateValue);
if (field.equals("zxs"))
kecheng.setZxs(Integer.parseInt(updateValue));
if (field.equals("xf"))
kecheng.setXf(Integer.parseInt(updateValue));
if (kechengService.upKecheng(kecheng) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的课程" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/*重置用户密码*/
@RequestMapping("/inituser")
public boolean inituser(@RequestParam int id, HttpServletRequest httpServletRequest) {
Users users = usersService.selectByPrimaryKey(id);
if (users != null) {
users.setUpassword(UtilPacket.Md5MD5String("123456"));
if (usersService.updateByPrimaryKeySelective(users) != 0) {
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了全部用户组信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查询菜单*/
@RequestMapping("/selectcdgl")
public JSONObject selectcdgl(HttpServletRequest httpServletRequest) {
List<Menu> menus = menuService.getmenuList();
List<Map<String, Object>> list = new ArrayList<>();
if (menus != null) {
for (Menu menu : menus) {
int id = menu.getId();
String fdm = null;
if(menu.getFdm()!=null&&menu.getFdm()!="") {
fdm = menuService.selectByPrimaryKey(Integer.parseInt(menu.getFdm())).getMenuname();
}
String menulink = menu.getMenulink();
String menuname = menu.getMenuname();
Map map = new HashMap();
map.put("id", id);
map.put("fdm", fdm);
map.put("menulink", menulink);
map.put("menuname", menuname);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了全部菜单信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
}
Map requestparamMap = new HashMap();
requestparamMap.put("list2",sids);
List<Student> students = studentService.getStudentList(requestparamMap);
if (students != null) {
for (Student student : students) {
int id = student.getId();
String sname = student.getSname();
int xuehao = student.getXuehao();
Map map = new HashMap();
map.put("id", id);
map.put("sname", sname);
map.put("xuehao", xuehao);
list.add(map);
}
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了学生列表数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/*查看教师*/
@RequestMapping("/selectjs")
public JSONObject selectjs(HttpServletRequest httpServletRequest) {
Map requestparamMap = new HashMap();
List<Teacher> teachers = teacherService.getTeacherList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
if (teachers != null) {
for (Teacher teacher : teachers) {
int id = teacher.getId();
String tname = teacher.getTname();
Map map = new HashMap();
map.put("id", id);
map.put("tname", tname);
list.add(map);
}
}
Map<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");