作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
项目介绍
ssm医疗药品采购系统。主要功能有:
用户管理:管理员列表;
采购管理:采购列表;
药品出库:药品出库;
库存管理:库存统计;
数据维护:药品列表、仓库列表、供应商列表;
环境需要
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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目
6.数据库:MySql 5.7版本;
技术栈
1. 后端:Spring SpringMVC MyBatis
2. 前端:JSP+jQuery+h-ui
使用说明
1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 将项目中settings.properties配置文件中的数据库配置改为自己的配置
3. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;
4. 运行项目,输入localhost:8080/xxx 登录
运行截图
相关代码
订单管理控制器
@Controller
@RequestMapping("purchaseorder")
public class PurchaseOrderController {
private static Logger logger = Logger.getLogger(PurchaseOrderController.class);
@Autowired
private PurchaseOrderService purchaseOrderService;
@Autowired
private SupplierService supplierService;
@Autowired
private RepertoryService repertoryService;
@Autowired
private DrugService drugService;
@RequestMapping("/list")
public String list(Model model) {
return "purchaseorder/list";
}
@SuppressWarnings("rawtypes")
@RequestMapping("/findByPage")
public String findByPage(PurchaseOrder purchaseOrder, Model model) {
PaginationVO paginationVO = purchaseOrderService.getPurchaseOrderListWithPage(purchaseOrder);
model.addAttribute("list", paginationVO.getList());
model.addAttribute("total", paginationVO.getTotal());
model.addAttribute("pageNo", paginationVO.getPageNo());
model.addAttribute("totalPageSize", paginationVO.getTotalPageSize());
return "purchaseorder/page";
}
@RequestMapping("/add")
public String add(Model model) {
model.addAttribute("drugs", drugService.getDrugList());
model.addAttribute("suppliers", supplierService.getSupplierList());
model.addAttribute("repertorys", repertoryService.getRepertoryList());
return "purchaseorder/add";
}
@ResponseBody
@RequestMapping("/save")
public String save(PurchaseOrder purchaseOrder) {
try {
purchaseOrderService.savePurchaseOrder(purchaseOrder);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
@RequestMapping("edit")
public String edit(Integer id, Model model) {
PurchaseOrder purchaseOrder = purchaseOrderService.getPurchaseOrderById(id);
model.addAttribute("obj", purchaseOrder);
model.addAttribute("drugs", drugService.getDrugList());
model.addAttribute("suppliers", supplierService.getSupplierList());
model.addAttribute("repertorys", repertoryService.getRepertoryList());
return "purchaseorder/edit";
}
@ResponseBody
@RequestMapping("/update")
public String update(PurchaseOrder purchaseOrder) {
try {
purchaseOrderService.updatePurchaseOrder(purchaseOrder);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
@ResponseBody
@RequestMapping("/delete")
public String delete(Integer id) {
try {
purchaseOrderService.deletePurchaseOrderById(id);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
}
员工管理控制器
@Controller
@RequestMapping("repo")
public class RepoController {
@Autowired
private PurchaseOrderService purchaseOrderService;
@RequestMapping("/list")
public String list() {
return "repo/list";
}
@SuppressWarnings("rawtypes")
@RequestMapping("/findByPage")
public String findByPage(PurchaseOrder purchaseOrder, Model model) {
PaginationVO paginationVO = purchaseOrderService.getPurchaseOrderListWithPage(purchaseOrder);
model.addAttribute("list", paginationVO.getList());
model.addAttribute("total", paginationVO.getTotal());
model.addAttribute("pageNo", paginationVO.getPageNo());
model.addAttribute("totalPageSize", paginationVO.getTotalPageSize());
return "repo/page";
}
}
管理控制器
@Controller
@RequestMapping("supplier")
public class SupplierController {
private static Logger logger = Logger.getLogger(SupplierController.class);
@Autowired
private SupplierService supplierService;
@RequestMapping("/list")
public String list(Model model) {
model.addAttribute("list", supplierService.getSupplierList());
return "supplier/list";
}
@RequestMapping("/add")
public String add() {
return "supplier/add";
}
@ResponseBody
@RequestMapping("/save")
public String save(Supplier supplier) {
try {
supplierService.saveSupplier(supplier);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
@RequestMapping("edit")
public String edit(Integer id, Model model) {
Supplier supplier = supplierService.getSupplierById(id);
model.addAttribute("supplier", supplier);
return "supplier/edit";
}
@ResponseBody
@RequestMapping("/update")
public String update(Supplier supplier) {
try {
supplierService.updateSupplier(supplier);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
@ResponseBody
@RequestMapping("/delete")
public String delete(Integer id) {
try {
supplierService.deleteSupplierById(id);
} catch (Exception e) {
logger.error(e.getMessage(), e);
return "0";
}
return "1";
}
}
如果也想学习本系统,下面领取。关注并回复:057ssm