——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于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
使用说明
- 使用IDEA/Eclipse/MyEclipse导入后端项目源码;
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
- 运行项目前,需要配置好MqSQL数据库,在application.properties中修改数据库对应的配置文件;
- 运行成功后,在浏览器中访问:http://localhost:8888
- 客户和员工对应数据库表t_customers和t_employees表,用户名是手机号,密码也是对应的手机号 客户账号:15133480838 密码:15133480838
员工账号:15133330551 密码:15133330551
——————————CodeStart——————————
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("删除数据时出现未知错误!!"); } } }
@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); }
@RequestMapping("/selectEmployees") public ResponseResult<List<Employees>> selectEmp() { List<Employees> list = empService.getSelectEmployees(); return new ResponseResult<List<Employees>>(SUCCESS,list); }
@RequestMapping("/show_EmpInfo") public ResponseResult<Employees> showEmpInfo(Integer uid){ Employees emp = empService.findEmpInfo(uid); return new ResponseResult<Employees>(SUCCESS,emp); }
@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); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); JSONArray jsonArr = JSONArray.fromObject(drugStocks, jsonConfig); return new ResponseResult<JSONArray>(SUCCESS,jsonArr); }
@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); }
@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
|
@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); }
@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); }
@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;
@GetMapping("/findstockreturn") public ResponseResult<JSONArray> findStockReturn(Integer pageNoStr,Integer pageSizeStr,String documentNo){ List<StockReturn> allStockReturn = stockReturnService.findAll((pageNoStr-1)*pageSizeStr,pageSizeStr,documentNo); JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Date.class, new JsonDateValueProcessor()); JSONArray jsonArr = JSONArray.fromObject(allStockReturn, jsonConfig); return new ResponseResult<JSONArray>(SUCCESS,jsonArr); }
@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;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=171422272105200ap
https://javayms.pages.dev?id=171422272105200ap