基于javaweb的SSM+Maven中药药方管理系统(java+ssm+jsp+bootstrap+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

550123012402

560123012402

580123012402

590123012402

000123022402

010123022402

062124133108

基于javaweb的SSM+Maven中药药方管理系统(java+ssm+jsp+bootstrap+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/8.0版本均可; 6.是否Maven项目:是;

技术栈

  1. 后端:Spring+SpringMVC+Mbytes 2. 前端:JSP+css+javascript+bootstrap+jQuery

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中db.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入localhost:8080/ssm_yaofangsys/ 医生账号/密码: doctor/123456 药房人员账号/密码:yaofang/123456 管理员账号/密码:admin/admin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18





/**
* @ClassName:
* @Description:
*/


@Controller
@RequestMapping("/doctor")
public class DoctorController extends BaseController {


/**
* 依赖注入 start dao/service/===
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
	/**
* 删除通过主键
* @return
*/
@RequestMapping(value = "/delete")
public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {
MedicineUser load = medicineUserService.load(id);
load.setIsDelete(1);
medicineUserService.updateById(load);
return "redirect:/medicineUser/findBySql";
}



}
package com.kewen.cms.controller;






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
	model.addAttribute("obj", dzd);
return "dzd/dzdUser";
}


/**
* 跳至添加页面
* @return
*/
@RequestMapping(value = "/add")
public String add() {
return "dzd/add";
}
private static String date ;
private static long orderNum = 0l;
public static synchronized String getOrderNo() {
String str = new SimpleDateFormat("yyyyMMddHHmm").format(new Date());
if(date==null||!date.equals(str)){
date = str;
orderNum = 0l;
}
orderNum ++;
long orderNo = Long.parseLong((date)) * 10000;
orderNo += orderNum;;
return orderNo+"";
}


/**
* 添加执行
* @return
*/
@RequestMapping(value = "/exAdd")
public String exAdd(Dzd dzd, Model model, HttpServletRequest request, HttpServletResponse response) {

Object attribute = request.getSession().getAttribute("userId");

if (attribute == null){
return "redirect:/login/login.action";
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
		prescriptionService.deleteById(id);
return "redirect:/prescription/findBySql";
}



}
package com.kewen.cms.controller;





/**
* @ClassName:
* @Description:
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
52
		model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", prescription);
return "prescription/prescription";
}


@RequestMapping(value = "/findBySqlUser")
public String findBySqlUser(Prescription prescription, Model model, HttpServletRequest request, HttpServletResponse response) {

//分页查询
String sql = "SELECT * FROM prescription WHERE 1=1 ";//and isDelete = 0

if(!isEmpty(prescription.getName())){
sql += " and name like '%"+prescription.getName()+"%'";
}
if(!isEmpty(prescription.getElement())){
sql += " and element like '%"+prescription.getElement()+"%'";
}
if(!isEmpty(prescription.getEffect())){
sql += " and effect like '%"+prescription.getEffect()+"%'";
}
if(!isEmpty(prescription.getSource())){
sql += " and source like '%"+prescription.getSource()+"%'";
}
sql += " ORDER BY ID DESC ";
Pager<Prescription> pagers = prescriptionService.findBySqlRerturnEntity(sql);
model.addAttribute("pagers", pagers);
//存储查询条件
model.addAttribute("obj", prescription);
return "prescription/prescriptionUser";
}




/**
* 跳至添加页面
* @return
*/
@RequestMapping(value = "/add")
public String add() {
return "prescription/add";
}


/**
* 添加执行
* @return
*/
@RequestMapping(value = "/exAdd")
public String exAdd(Prescription prescription, Model model, HttpServletRequest request, HttpServletResponse response) {
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
 * @Description: 
*/


@Controller
@RequestMapping("/medicinalMaterials")
public class MedicinalMaterialsController extends BaseController {


/**
* 依赖注入 start dao/service/===
*/
@Autowired
private MedicinalMaterialsService medicinalMaterialsService;





@RequestMapping(value = "/findBySql")
public String findBySql(MedicinalMaterials medicinalMaterials, Model model, HttpServletRequest request, HttpServletResponse response) {

//分页查询
String sql = "SELECT * FROM medicinal_materials WHERE 1=1 and isDelete = 0 ";//

if(!isEmpty(medicinalMaterials.getCode())){
sql += " and code like '%"+medicinalMaterials.getCode()+"%'";
}
if(!isEmpty(medicinalMaterials.getName())){
sql += " and name like '%"+medicinalMaterials.getName()+"%'";
}
if(!isEmpty(medicinalMaterials.getType())){
sql += " and type like '%"+medicinalMaterials.getType()+"%'";
}
if(!isEmpty(medicinalMaterials.getTaste())){
sql += " and taste like '%"+medicinalMaterials.getTaste()+"%'";
}
if(!isEmpty(medicinalMaterials.getEffect())){
sql += " and effect like '%"+medicinalMaterials.getEffect()+"%'";
}
if(!isEmpty(medicinalMaterials.getUseAmount())){
sql += " and useAmount like '%"+medicinalMaterials.getUseAmount()+"%'";
}
if(!isEmpty(medicinalMaterials.getAlias())){
sql += " and alias like '%"+medicinalMaterials.getAlias()+"%'";
}
if(!isEmpty(medicinalMaterials.getUsages())){
sql += " and usage like '%"+medicinalMaterials.getUsages()+"%'";
}
if(!isEmpty(medicinalMaterials.getIsDelete())){


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