基于javaweb的SpringBoot医药进销存管理系统(java+springboot+html+echarts+jquery+maven+mysql)

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

570023112402

580023112402

590023112402

000023122402

010023122402

020023122402

基于javaweb的SpringBoot医药进销存管理系统(java+springboot+html+echarts+jquery+maven+mysql)

功能介绍

医药进销存系统,主要分两种角色:员工、客户。本系统具有进销存系统的通用性,可以修改为其它进销存系统,如家电进销存、手机进销存等;

员工登录后主要功能模块有: 我的面板:个人信息、修改信息、修改密码; 员工管理:员工添加、员工查询; 药品管理:药品类别添加、药品类别查询、药品添加、药品查询; 客户管理:客户查询; 供货商管理:供货商添加、供货商查询; 账单管理:进货添加、进货查询、退货账单、销售账单查询; 客户登录后主要功能模块有: 我的面板:个人信息、修改信息、修改密码;

购买药品:药品展示、已购药品;

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;
4.数据库:MySql 5.7版本;

系统框架

1.后端:SpringBoot

2.前端:HTML+Echarts+JQuery

使用说明

  1. 使用IDEA/Eclipse/MyEclipse导入后端项目源码;
  2. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
  3. 运行项目前,需要配置好MqSQL数据库,在application.properties中修改数据库对应的配置文件;
  4. 运行成功后,在浏览器中访问:http://localhost:8888
  5. 客户和员工对应数据库表t_customers和t_employees表,用户名是手机号,密码也是对应的手机号 客户账号:15133480838 密码:15133480838
    员工账号:15133330551 密码:15133330551

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
	return allDrugStock;
}

/**
* 删除某条数据
*/
@Override
public void deleteDrugStock(String ids,HttpSession session) {
String[] id = ids.split(",");
String username = session.getAttribute("username").toString();
Date now = new Date();
for(int i=0;i<id.length;i++){
System.err.println(Integer.parseInt(id[i]));
Integer upd = updateIsDelete(Integer.parseInt(id[i]),username,now);
if(upd!=1){
throw new InsertException("删除数据时出现未知错误!!");
}
}
}

/**
* 在员工表和供货商表药品表中查询所有存在的id,名字,并且返回出去
*/
@Override
public List<List<Map<Integer, String>>> findDrgEmpSupId() {
List<List<Map<Integer, String>>> UAN = new ArrayList<List<Map<Integer, String>>>();
List<Map<Integer, String>> drgId = new ArrayList<Map<Integer, String>>();
List<Map<Integer, String>> supId = new ArrayList<Map<Integer, String>>();
List<Map<Integer, String>> empId = new ArrayList<Map<Integer, String>>();
Integer count = 1;

List<Drug> drg = findDrgByUidUsername();
for(Drug d : drg){
if(!count.equals(d.getIsDelete())){
Map<Integer, String> drgmap = new HashMap<Integer, String>();
drgmap.put(d.getId(), d.getDrugName());
drgId.add(drgmap);
}
}
UAN.add(drgId);

List<Supplier> sup = findSupByUidUsername();
for(Supplier s : sup){
if(!count.equals(s.getIsDelete())){
Map<Integer, String> supmap = new HashMap<Integer, String>();
supmap.put(s.getUid(), s.getUsername());
supId.add(supmap);
}
}
UAN.add(supId);

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
	empService.changePassword(oldPassword, newPassword, uid);
return new ResponseResult<Void>(SUCCESS);
}

/**
* 查询员工数据,后期改为多条件查询
* @param drugCategory
* @return
*/
@RequestMapping("/selectEmployees")
public ResponseResult<List<Employees>> selectEmp() {
List<Employees> list = empService.getSelectEmployees();
return new ResponseResult<List<Employees>>(SUCCESS,list);
}

/**
* 根据uid查询emp信息
* @param session
* @return
*/
@RequestMapping("/show_EmpInfo")
public ResponseResult<Employees> showEmpInfo(Integer uid){
Employees emp = empService.findEmpInfo(uid);
return new ResponseResult<Employees>(SUCCESS,emp);
}


//************************修改头像***********************************
/**
* 上传员工头像
* @param request
* @param file
* @return MultipartFile file
*/
@RequestMapping("/change_avatar")
public ResponseResult<String> changeAvatar(HttpServletRequest request,@RequestParam("file") MultipartFile file){
if(file.isEmpty()) {
throw new FileEmptyException("上传头像错误!上传文件不能为空!");
}
if(!UPLOAD_CONTENT_TYPE.contains(file.getContentType())) {
throw new FileContentTypeException("上传头像错误!不支持所选的文件类型!");
}
if(file.getSize()>UPLOAD_MAX_SIZE) {
throw new FileSizeException("上传文件过大!请选择小于"+UPLOAD_MAX_SIZE+"的文件!");
}
String parentPath = request.getServletContext().getRealPath(UPLOAD_DIR);
File parent = new File(parentPath);
if(!parent.exists()) {
parent.mkdirs();
}
String originalFilename = file.getOriginalFilename();
//使用系统纳秒值给头像命名
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
		List<DrugStockFindAll> drugStocks = drugStockService.findDrugStock((pageNoStr-1)*pageSizeStr,pageSizeStr,documentNo);
//解决前后端json遍历的时间问题(把vo换成jsonObj)
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor());
JSONArray jsonArr = JSONArray.fromObject(drugStocks, jsonConfig);
return new ResponseResult<JSONArray>(SUCCESS,jsonArr);
}

/**
* 删除数据
* @param Id 需要删除的id
* @param session 获取绑定数据
* @return 返回结果
*/
@PostMapping("/deletebyid")
public ResponseResult<Void> deleteDrugStock(String Id,HttpSession session){
drugStockService.deleteDrugStock(Id,session);
return new ResponseResult<Void>(SUCCESS);
}

}
package cn.tedu.drug.controller;




@RestController
@RequestMapping("/excel")
public class ExcelDrugController extends BaseController {

@Autowired //自动装配
private IDrugService drugService;

@RequestMapping("/excelDrug")
public ResponseResult<Void> ExcelDrug(
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
	map.put("beginNo", beginNo);
map.put("pageSize", pageSize);
map.put("username", username);
map.put("gender", gender);
map.put("address", address);
PaginationVO<Customer> vo = customerService.getSelectCustomer(map);
return new ResponseResult<PaginationVO<Customer>>(SUCCESS,vo);
}

/**
* 删除客户数据
* @param uid
* @param session
* @return
*/
@RequestMapping("/deleteCustomer")
public ResponseResult<Void> deleteCustomer(Integer uid,HttpSession session){
String username = (String) session.getAttribute("username");
customerService.getdeleteId(uid, username);
return new ResponseResult<Void>(SUCCESS);
}

/**
* 修改客户数据
*/
@RequestMapping("/updateCustomer")
public ResponseResult<Void> updateCustomer(Customer customer,HttpSession session){
String username = (String) session.getAttribute("username");
customerService.getupdateCustomer(customer, username);
return new ResponseResult<Void>(SUCCESS);
}

/**
* 展示个人信息
*/
@RequestMapping("/getfindByUid")
public ResponseResult<Customer> getfindByUid(Integer uid){
Customer customer = customerService.getfindByUid(uid);
return new ResponseResult<Customer>(SUCCESS,customer);
}

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

/**
* 添加员工信息
* @param emp
* @param session
* @return
*/
@RequestMapping("/addEmp")
public ResponseResult<Void> addEmp(Employees emp,HttpSession session) {
String username = session.getAttribute("username").toString();
empService.addEmp(emp, username );
return new ResponseResult<Void>(SUCCESS);
}

/**
* 员工手机号登录
* @param phone
* @param password
* @param permissions
* @return
*/
@RequestMapping("/login")
public ResponseResult<Employees> loginEmp(String phone,String password,HttpSession session){
Employees emp = empService.loginEmp(phone,password);
session.setAttribute( "uid", emp.getUid());
session.setAttribute( "user", emp );
session.setAttribute( "username", emp.getUsername() );
return new ResponseResult<Employees>(SUCCESS,emp);
}

@RequestMapping("/changePassword")
public ResponseResult<Void> changePassword(Integer uid,String oldPassword,String newPassword,HttpSession session){
empService.changePassword(oldPassword, newPassword, uid);
return new ResponseResult<Void>(SUCCESS);
}

/**
* 查询员工数据,后期改为多条件查询
* @param drugCategory
* @return
*/
@RequestMapping("/selectEmployees")
public ResponseResult<List<Employees>> selectEmp() {
List<Employees> list = empService.getSelectEmployees();
return new ResponseResult<List<Employees>>(SUCCESS,list);
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
	IStockReturnService stockReturnService;

/**
* 查询所有退货信息
* @param pageNoStr 分页查询
* @param pageSizeStr 分页查询
* @param documentNo 查询条件
* @return 返回查询结果(经过处理:处理里面的时间让用户看的更明白)
*/
@GetMapping("/findstockreturn")
public ResponseResult<JSONArray> findStockReturn(Integer pageNoStr,Integer pageSizeStr,String documentNo){
List<StockReturn> allStockReturn = stockReturnService.findAll((pageNoStr-1)*pageSizeStr,pageSizeStr,documentNo);
//解决前后端json遍历的时间问题(把vo换成jsonObj)
JsonConfig jsonConfig = new JsonConfig();
jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor());
JSONArray jsonArr = JSONArray.fromObject(allStockReturn, jsonConfig);
return new ResponseResult<JSONArray>(SUCCESS,jsonArr);
}

/**
* 添加退货信息
* @param stockReturn 退货信息
* @param session 获取登录的用户名
* @return 返回成功与否
*/
@PostMapping("/addstockreturn")
public ResponseResult<Void> addStockReturn(StockReturn stockReturn,HttpSession session){
System.err.println(stockReturn);
stockReturnService.addStockReturn(stockReturn, session.getAttribute("username").toString());
return new ResponseResult<>(SUCCESS);
}
}
package cn.tedu.drug.service;


/**
* 进货业务层接口
*
*/


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