基于javaweb+mysql的springboot医院药品管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot医院药品管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
功能描叙: 药品销售管理,药品明晰管理,药片库存管理,登记出入 库信息,问题药品记录,药片保质期检查,销售记录,退 货记录,药品信息,供应商信息等等。
/**
* 账单信息相关的controller
*/
@Controller
@RequestMapping(value = "/billinfo")
public class BillinfoController {
@Autowired
private IBillinfoService billinfoService;
/**
* 转向账单信息页面
*/
@RequestMapping
public String billinfo(){
return "/billinfo";
}
/**
* 分页查询账单信息列表
*/
@RequestMapping(value = "/billinfoQueryPage")
@ResponseBody
public Object billinfoQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Billinfo> iPage = billinfoService.selectBillinfoPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向账单信息新增页面
*/
@RequestMapping(value = "/billinfoPage")
public String billinfoPage(){
return "/billinfoPage";
}
}
}
/**
* 账单信息相关的controller
*/
@Controller
@RequestMapping(value = "/billinfo")
public class BillinfoController {
@Autowired
private IBillinfoService billinfoService;
@ResponseBody
public Object problemAdd(Problem problem){
try{
problem.setCreatetime(new Date());
int i = problemService.addProblem(problem);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向问题药品编辑页面
*/
@RequestMapping(value = "/problemQueryById")
public String problemQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Problem problem = problemService.queryProblemById(id);
model.addAttribute("obj",problem);
return "/problemPage";
}
/**
* 修改一个问题药品
*/
@RequestMapping(value = "/problemEdit")
@ResponseBody
public Object problemEdit(Problem problem){
try{
int i = problemService.editProblem(problem);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个问题药品
*/
@RequestMapping(value = "/problemDelById")
@ResponseBody
public Object problemDelById(Integer id){
try{
int i = problemService.delProblemById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
}
}
}
/**
* 销售记录相关的controller
*/
@Controller
@RequestMapping(value = "/saleinfo")
public class SaleinfoController {
public String supplierQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Supplier supplier = supplierService.querySupplierById(id);
model.addAttribute("obj",supplier);
return "/supplierPage";
}
/**
* 修改一个供应商
*/
@RequestMapping(value = "/supplierEdit")
@ResponseBody
public Object supplierEdit(Supplier supplier){
try{
int i = supplierService.editSupplier(supplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个供应商
*/
@RequestMapping(value = "/supplierDelById")
@ResponseBody
public Object supplierDelById(Integer id){
try{
int i = supplierService.delSupplierById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 获取所有供应商
*/
@RequestMapping(value = "/supplierList")
@ResponseBody
public Object supplierList(){
List<Supplier> supplierList = supplierService.querySupplierList();
return ResultMapUtil.getHashMapList(supplierList);
}
}
}
}
/**
* 账单信息相关的controller
*/
@Controller
*/
@Controller
@RequestMapping(value = "/supplier")
public class SupplierController {
@Autowired
private ISupplierService supplierService;
/**
* 转向供应商页面
*/
@RequestMapping
public String supplier(){
return "/supplier";
}
/**
* 分页查询供应商列表
*/
@RequestMapping(value = "/supplierQueryPage")
@ResponseBody
public Object supplierQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Supplier> iPage = supplierService.selectSupplierPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向供应商新增页面
*/
@RequestMapping(value = "/supplierPage")
public String supplierPage(){
return "/supplierPage";
}
/**
* 添加一个供应商
*/
@RequestMapping(value = "/supplierAdd")
public Object owinfoAdd(Owinfo owinfo){
try{
owinfo.setCreatetime(new Date());
int i = owinfoService.addOwinfo(owinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向药品出入库编辑页面
*/
@RequestMapping(value = "/owinfoQueryById")
public String owinfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Owinfo owinfo = owinfoService.queryOwinfoById(id);
model.addAttribute("obj",owinfo);
return "/owinfoPage";
}
/**
* 修改一个药品出入库
*/
@RequestMapping(value = "/owinfoEdit")
@ResponseBody
public Object owinfoEdit(Owinfo owinfo){
try{
int i = owinfoService.editOwinfo(owinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个药品出入库
*/
@RequestMapping(value = "/owinfoDelById")
@ResponseBody
public Object owinfoDelById(Integer id){
try{
int i = owinfoService.delOwinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
/**
* 收到退货相关的controller
*/
@Controller
@RequestMapping(value = "/returngoods")
public class ReturngoodsController {
@Autowired
private IReturngoodsService returngoodsService;
/**
* 转向收到退货页面
*/
@RequestMapping
public String returngoods(){
return "/returngoods";
}
/**
* 分页查询收到退货列表
*/
@RequestMapping(value = "/returngoodsQueryPage")
@ResponseBody
public Object returngoodsQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
return "/returnsupplierPage";
}
/**
* 添加一个退货给供应商
*/
@RequestMapping(value = "/returnsupplierAdd")
@ResponseBody
public Object returnsupplierAdd(Returnsupplier returnsupplier){
try{
int i = returnsupplierService.addReturnsupplier(returnsupplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向退货给供应商编辑页面
*/
@RequestMapping(value = "/returnsupplierQueryById")
public String returnsupplierQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Returnsupplier returnsupplier = returnsupplierService.queryReturnsupplierById(id);
model.addAttribute("obj",returnsupplier);
return "/returnsupplierPage";
}
/**
* 修改一个退货给供应商
*/
@RequestMapping(value = "/returnsupplierEdit")
@ResponseBody
public Object returnsupplierEdit(Returnsupplier returnsupplier){
try{
int i = returnsupplierService.editReturnsupplier(returnsupplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个退货给供应商
*/
@RequestMapping(value = "/returnsupplierDelById")
@ResponseBody
public Object returnsupplierDelById(Integer id){
try{
int i = returnsupplierService.delReturnsupplierById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
* 添加一个药品
*/
@RequestMapping(value = "/druginfoAdd")
@ResponseBody
public Object druginfoAdd(Druginfo druginfo){
try{
int i = druginfoService.addDruginfo(druginfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向药品编辑页面
*/
@RequestMapping(value = "/druginfoQueryById")
public String druginfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Druginfo druginfo = druginfoService.queryDruginfoById(id);
model.addAttribute("obj",druginfo);
return "/druginfoPage";
}
/**
* 修改一个药品
*/
@RequestMapping(value = "/druginfoEdit")
@ResponseBody
public Object druginfoEdit(Druginfo druginfo){
try{
int i = druginfoService.editDruginfo(druginfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个药品
*/
@RequestMapping(value = "/druginfoDelById")
@ResponseBody
public Object druginfoDelById(Integer id){
try{
int i = druginfoService.delDruginfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 获取所有药品
*/
/**
* 供应商相关的controller
*/
@Controller
@RequestMapping(value = "/supplier")
public class SupplierController {
@Autowired
private ISupplierService supplierService;
/**
* 转向供应商页面
*/
@RequestMapping
public String supplier(){
return "/supplier";
}
/**
* 分页查询供应商列表
*/
@RequestMapping(value = "/supplierQueryPage")
@ResponseBody
public Object supplierQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Supplier> iPage = supplierService.selectSupplierPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向供应商新增页面
*/
@RequestMapping(value = "/supplierPage")
public String supplierPage(){
return "/supplierPage";
}
/**
* 添加一个供应商
*/
@RequestMapping(value = "/supplierAdd")
@ResponseBody
* 分页查询销售记录列表
*/
@RequestMapping(value = "/saleinfoQueryPage")
@ResponseBody
public Object saleinfoQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Saleinfo> iPage = saleinfoService.selectSaleinfoPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向销售记录新增页面
*/
@RequestMapping(value = "/saleinfoPage")
public String saleinfoPage(){
return "/saleinfoPage";
}
/**
* 添加一个销售记录
*/
@RequestMapping(value = "/saleinfoAdd")
@ResponseBody
public Object saleinfoAdd(Saleinfo saleinfo){
try{
int i = saleinfoService.addSaleinfo(saleinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向销售记录编辑页面
*/
@RequestMapping(value = "/saleinfoQueryById")
public String saleinfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Saleinfo saleinfo = saleinfoService.querySaleinfoById(id);
model.addAttribute("obj",saleinfo);
return "/saleinfoPage";
}
/**
* 修改一个销售记录
*/
@RequestMapping(value = "/saleinfoEdit")
@ResponseBody
public Object saleinfoEdit(Saleinfo saleinfo){
* 分页查询收到退货列表
*/
@RequestMapping(value = "/returngoodsQueryPage")
@ResponseBody
public Object returngoodsQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Returngoods> iPage = returngoodsService.selectReturngoodsPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向收到退货新增页面
*/
@RequestMapping(value = "/returngoodsPage")
public String returngoodsPage(){
return "/returngoodsPage";
}
/**
* 添加一个收到退货
*/
@RequestMapping(value = "/returngoodsAdd")
@ResponseBody
public Object returngoodsAdd(Returngoods returngoods){
try{
int i = returngoodsService.addReturngoods(returngoods);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向收到退货编辑页面
*/
@RequestMapping(value = "/returngoodsQueryById")
public String returngoodsQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Returngoods returngoods = returngoodsService.queryReturngoodsById(id);
model.addAttribute("obj",returngoods);
return "/returngoodsPage";
/**
* 修改一个药品出入库
*/
@RequestMapping(value = "/owinfoEdit")
@ResponseBody
public Object owinfoEdit(Owinfo owinfo){
try{
int i = owinfoService.editOwinfo(owinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个药品出入库
*/
@RequestMapping(value = "/owinfoDelById")
@ResponseBody
public Object owinfoDelById(Integer id){
try{
int i = owinfoService.delOwinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
}
/**
* 修改一个药品出入库
*/
@RequestMapping(value = "/owinfoEdit")
@ResponseBody
public Object owinfoEdit(Owinfo owinfo){
try{
int i = owinfoService.editOwinfo(owinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个药品出入库
*/
@RequestMapping(value = "/owinfoDelById")
@ResponseBody
public Object owinfoDelById(Integer id){
try{
int i = owinfoService.delOwinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
return ResultMapUtil.getHashMapException(e);
}
}
}
/**
* 用户相关的controller
*/
@Controller
public class UserController {
/**
* 转向登录页面
*/
@RequestMapping(value = "/login")
public String login(){