基于javaweb的SSM+Maven医院心理咨询问诊系统(java+spring+maven+mybatis+vue+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8、Node.js≥14

开发工具

后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可

❗没学过node.js的不要搞前后端分离项目

适用

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

功能说明

480123062402

490123062402

500123062402

510123062402

520123062402

基于javaweb的SSM+Maven医院心理咨询问诊系统(java+spring+maven+mybatis+vue+mysql)

一、项目运行 环境配置:

Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:

Spring + SpringMvc + mybatis + Maven + Vue 等等组成,B/S模式 + Maven管理等等。  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
}

@RequestMapping("/getAdminList")
//获取所有管理员列表 带分页
public Result getAdminList(Integer page, Integer limit) {
// Tomcat Localhost Log 会输出错误信息 如果下面的sql语句有问题
return adminService.getAdminList(page, limit);
}

//更新管理员
@RequestMapping("/updateAdmin")
public Result updateAdmin(Admin admin) {
int flag = adminService.updAdmin(admin);
if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.FAIL);
}

//修改密码
@RequestMapping("/changeAdminPassword")
public Result changeAdminPassword(String password, String newPassword, String username) {

Admin admin = adminService.getAdminByUsername(username);
if (admin != null) {
if (admin.getPassword().equals(EncryptUtil.encrypt(password))) {
admin.setPassword(EncryptUtil.encrypt(newPassword));
int flag = adminService.updAdmin(admin);
if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
} else {
return new Result(ResultCode.USERNAMEPASSWORDERROR);
}
}
return new Result(ResultCode.FAIL);
}

//删除一个管理员
@RequestMapping("/delAdminById/{id}")
public Result delAdminById(@PathVariable("id") Long id) {
if (id == 1) {
return new Result(ResultCode.FAIL);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    session.setAttribute("mind_user_id",user_id);
session.setAttribute("archives_id",archives_id);

return new Result(ResultCode.SUCCESS,user);
}

@RequestMapping("/addMind")
public Result addMind(Mind mind, HttpSession session) throws ParseException {

Integer user_id= (Integer) session.getAttribute("mind_user_id");
Integer doctor_id= (Integer) session.getAttribute("doctor_id");
Integer archives_id= (Integer) session.getAttribute("archives_id");

mind.setDoctor_id(doctor_id);
mind.setUser_id(user_id);

Date date=new Date();
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowDate=simpleDateFormat.format(date);
Date create_time=simpleDateFormat.parse(nowDate);

mind.setCreate_time(create_time);

int flag = mindService.addMind(mind);

if (flag > 0) {
Archives archives = archivesService.getArchivesById(archives_id);
//咨询完成
archives.setStatus(3);
int flag2 = archivesService.updateArchives(archives);

if (flag2 > 0) {
return new Result(ResultCode.SUCCESS);
}
}
return new Result(ResultCode.SERVER_ERROR);
}

@RequestMapping("/getMindList")
public Result getMindList(Integer page, Integer limit,HttpSession session) {

Map map = new HashMap();
Integer doctor_id= (Integer) session.getAttribute("doctor_id");
Integer user_id = (Integer) session.getAttribute("user_id");

map.put("doctor_id",doctor_id);
map.put("user_id",user_id);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowTime=simpleDateFormat.format(date);
Date create_time=simpleDateFormat.parse(nowTime);
note.setCreate_time(create_time);
note.setDoctor_id(doctor_id);
note.setUser_id(user_id);

int flag = noteService.insNote(note);
if (flag > 0) {

Reservation reservation=reservationService.getResByResId(res_id);
reservation.setStatus(3); //此预约已经是接诊状态
reservationService.updateRes(reservation);
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.SERVER_ERROR);
}

@RequestMapping("/getNoteList")
public Result getNoteList(Integer page, Integer limit,HttpSession session) {

Map map = new HashMap();
Integer doctor_id= (Integer) session.getAttribute("doctor_id");
Integer user_id = (Integer) session.getAttribute("user_id");

map.put("doctor_id",doctor_id);
map.put("user_id",user_id);
return noteService.getNoteList(page,limit,map);
}

@RequestMapping("/editNote/{note_id}")
public Result editNote(@PathVariable("note_id")int note_id, HttpSession session) {
Note note=noteService.getNoteById(note_id);
session.setAttribute("note",note);
return new Result(ResultCode.SUCCESS,note);
}

@RequestMapping("/updateNote")
public Result updateNote(Note note){
int flag = noteService.updateNote(note);

if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.FAIL);
}

@RequestMapping("/deleteNoteById/{note_id}")
public Result deleteNoteById(@PathVariable("note_id") Integer note_id){
int flag = noteService.deleteNoteById(note_id);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    public Result acceptArchives(@PathVariable("archives_id") Integer archives_id) {

Archives archives = archivesService.getArchivesById(archives_id);

//接受咨询
archives.setStatus(2);

int flag = archivesService.updateArchives(archives);
if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.FAIL);

}

@RequestMapping("/judgeArc")
public Result judgeArc(Archives archives,HttpSession session) {
Integer user_id = (Integer) session.getAttribute("user_id");

archives.setArc_user_id(user_id);
return archivesService.getArcByTime(archives);
}

}

package com.study.controller;



/**
* @program: college-health
*/
@RestController
@RequestMapping("/reservation")
public class ReservationController {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
            //咨询完成
archives.setStatus(3);
int flag2 = archivesService.updateArchives(archives);

if (flag2 > 0) {
return new Result(ResultCode.SUCCESS);
}
}
return new Result(ResultCode.SERVER_ERROR);
}

@RequestMapping("/getMindList")
public Result getMindList(Integer page, Integer limit,HttpSession session) {

Map map = new HashMap();
Integer doctor_id= (Integer) session.getAttribute("doctor_id");
Integer user_id = (Integer) session.getAttribute("user_id");

map.put("doctor_id",doctor_id);
map.put("user_id",user_id);

return mindService.getMindList(page,limit,map);
}

@RequestMapping("/updateMind")
public Result updateMind(Mind mind) {

int flag = mindService.updateMind(mind);

if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.FAIL);
}

@RequestMapping("/deleteMind/{mind_id}")
public Result deleteMind(@PathVariable("mind_id") Integer mind_id) {

int flag = mindService.deleteMind(mind_id);

if (flag > 0) {
return new Result(ResultCode.SUCCESS);
}
return new Result(ResultCode.FAIL);
}
}
package com.study.utils.interceptor;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
            e.printStackTrace();
return new Result(ResultCode.FAIL);
}
}

}
package com.study.controller;



/**
* @program: college-health
*/
@RestController
@RequestMapping("/promotion")
public class PromotionController {

private PromotionService promotionService;

@Autowired
public void setPromotionService(PromotionService promotionService) {
this.promotionService = promotionService;
}

@RequestMapping("/getPromotionList")
public Result getPromotionList(Integer page, Integer limit) {
return promotionService.getPromotionList(page,limit);
}

@RequestMapping("/insPromotion")
public Result insPromotion(Promotion promotion) {
try {
Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowTime = simpleDateFormat.format(date);


项目链接:
https://javayms.github.io?id=511222052008200vs
https://javayms.pages.dev?id=511222052008200vs