基于javaweb的SSM+Maven医药信息管理系统(java+ssm+maven+html+easyui+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

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

适用

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

功能说明

520023542402

530023542402

540023542402

550023542402

560023542402

570023542402

580023542402

基于javaweb的SSM+Maven医药信息管理系统(java+ssm+maven+html+easyui+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版本; 6.是否Maven项目:是;

技术栈

  1. 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+easyui

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录 管理员账号:admir 密码:1234 用户账号:test 密码:1201

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
53
54
	Medicine medicine = medicineService.queryMedicineByMno(mno);
return medicine;
}

/*
* // 多条件药品信息保存session
*
* @RequestMapping("QueryMultiMedicine")
*
* @ResponseBody public String queryMultiMedicine(Medicine
* medicine,HttpSession session) { return
* medicineService.queryMultiMedicine(medicine,session);
*
* } // 多条件药品查询url
*
* @RequestMapping("GetMultiMedicine")
*
* @ResponseBody public EasyUIResult getMultiMedicine(@RequestParam(value =
* "page", defaultValue = "1") Integer page,
*
* @RequestParam(value = "rows", defaultValue = "5") Integer rows,
* HttpSession session) { return medicineService.getMultiMedicine(page,
* rows,session);
*
* }
*/
/*
* // 通过mno删除药品信息
*
* @RequestMapping(value = "DeleteMedicine", produces =
* "text/html;charset=UTF-8")
*
* @ResponseBody public String deleteMedicineByMno(String mno) { return
* medicineService.deleteMedicineByMno(mno); }
*/
// 批量删除
@RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
@ResponseBody
public String deleteMedicineByRows(@RequestParam(value = "array[]") String[] array) {
try {

return medicineService.deleteMedicineByRows(array);

} catch (Exception e) {
// TODO: handle exception
return "操作异常,可能某些药品被顾客购买过," + "无法删该药品,请重新选择";
}
}

// 保存药品信息
@RequestMapping(value = "SaveMedicine", produces = "text/html;charset=UTF-8")
@ResponseBody
public String saveMedicine(Medicine medicine) {
return medicineService.saveMedicine(medicine);
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
		}

}

// 修改经办人信息
@RequestMapping(value = "ModifyAgency", produces = "text/html;charset=UTF-8")
@ResponseBody
public String modifyAgency(Agency agency) {
return agencyService.modifyAgency(agency);
}

// easyui数据表格返回全部经办人json
@RequestMapping("GetMessage")
@ResponseBody
public EasyUIResult queryAllAgency(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
return this.agencyService.queryAllAgency(page, rows);
}

// 保存经办人信息
@RequestMapping(value = "SaveAgency", produces = "text/html;charset=UTF-8")
@ResponseBody
public String saveAgency(Agency agency) {
return agencyService.saveAgency(agency);
}

// 返回所有经办人
@RequestMapping("GetAllAgency")
@ResponseBody
public java.util.List<Agency> getAllAgency() {
java.util.List<Agency> allAgency = agencyService.getAllAgency();
return allAgency;
}
}
package mms.controller;






@RequestMapping("Client")
@Controller
public class ClientController {
// 顾客controller
@Autowired
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
	return agency;
}

@RequestMapping(value = "DeleteAgency", produces = "text/html;charset=UTF-8")
@ResponseBody
// 按编号删除
public String deleteAgencyByAno(String ano) {
return agencyService.deleteAgencyByAno(ano);
}

// 批量删除
@RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
@ResponseBody
public String deleteAgencyByRows(@RequestParam(value = "array[]") String[] array) {
try {
return agencyService.deleteAgencyByRows(array);
} catch (Exception e) {
// TODO: handle exception
// 捕获异常,spring进行事务回滚
return "操作异常,,某些经办人处理过顾客信息,无法删除该经办人,请重新选择";
}

}

// 修改经办人信息
@RequestMapping(value = "ModifyAgency", produces = "text/html;charset=UTF-8")
@ResponseBody
public String modifyAgency(Agency agency) {
return agencyService.modifyAgency(agency);
}

// easyui数据表格返回全部经办人json
@RequestMapping("GetMessage")
@ResponseBody
public EasyUIResult queryAllAgency(@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
return this.agencyService.queryAllAgency(page, rows);
}

// 保存经办人信息
@RequestMapping(value = "SaveAgency", produces = "text/html;charset=UTF-8")
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
		// TODO: handle exception
return "删除失败,可能是有客户购买此药," + "无法删除此药品";
}
return "删除成功";
}

public String modifyMedicine(Medicine medicine) {
// TODO Auto-generated method stub
Medicine queryMedicineByMno = queryMedicineByMno(medicine.getMno());
if (queryMedicineByMno != null) {
if (queryMedicineByMno.getMid() != medicine.getMid())
return "这个药品编号已经存在,不能修改为这个编号";
}
try {
medicineMapper.modifyMedicine(medicine);
} catch (Exception e) {
// TODO: handle exception
return "修改失败,可能是有客户购买此药," + "无法修改编号";
}
return "修改成功";
}

public List<Medicine> getAllMedicine() {
// TODO Auto-generated method stub
List<Medicine> queryAllMedicine = medicineMapper.queryAllMedicine();
return queryAllMedicine;
}

public String deleteMedicineByRows(String[] array) {
// TODO Auto-generated method stub
try {
for (String mno : array) {
medicineMapper.deleteMedicineByMno(mno);
}
} catch (Exception e) {
// TODO: handle exception
// 抛出异常让spring捕获,进行事务回滚
throw new RuntimeException();

}
return "删除成功";
}

public String queryMultiMedicine(Medicine medicine, HttpSession session) {
// TODO Auto-generated method stub
try {
List<Medicine> medicines = medicineMapper.queryMultiMedicine(medicine);
session.setAttribute("medicines", medicines);
System.out.println(medicines);
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




@Service
@Transactional
public class MedicineService {
@Autowired
private MedicineMapper medicineMapper;

public Medicine queryMedicineByMno(String mno) {
// TODO Auto-generated method stub
Medicine medicine = medicineMapper.queryMedicineByMno(mno);
return medicine;

}

public EasyUIResult queryAllMedicine(Integer page, Integer rows) {
// TODO Auto-generated method stub
PageHelper.startPage(page, rows);
List<Medicine> medicines = medicineMapper.queryAllMedicine();
PageInfo<Medicine> pageInfo = new PageInfo<Medicine>(medicines);
return new EasyUIResult(pageInfo.getTotal(), medicines);
}

public String saveMedicine(Medicine medicine) {
// TODO Auto-generated method stub
if (queryMedicineByMno(medicine.getMno()) != null) {
return "药品编号已经存在,请重新输入编号";
}
medicineMapper.saveMedicine(medicine);
return "保存成功";
}


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