基于javaweb+mysql的springboot医院药品管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot医院药品管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
功能描叙: 药品销售管理,药品明晰管理,药片库存管理,登记出入 库信息,问题药品记录,药片保质期检查,销售记录,退 货记录,药品信息,供应商信息等等。
* 转向药品出入库编辑页面
*/
@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 = "/owinfo")
public class OwinfoController {
@Autowired
private IOwinfoService owinfoService;
/**
* 转向药品出入库页面
*/
@RequestMapping
public String owinfo(){
@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);
}
}
@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
public Object supplierAdd(Supplier supplier){
try{
supplier.setCreatetime(new Date());
int i = supplierService.addSupplier(supplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向供应商编辑页面
*/
@RequestMapping(value = "/supplierQueryById")
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);
model.addAttribute("obj",billinfo);
return "/billinfoPage";
}
/**
* 修改一个账单信息
*/
@RequestMapping(value = "/billinfoEdit")
@ResponseBody
public Object billinfoEdit(Billinfo billinfo){
try{
int i = billinfoService.editBillinfo(billinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个账单信息
*/
@RequestMapping(value = "/billinfoDelById")
@ResponseBody
public Object billinfoDelById(Integer id){
try{
int i = billinfoService.delBillinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
@Controller
@RequestMapping(value = "/druginfo")
public class DruginfoController {
@Autowired
private IDruginfoService druginfoService;
/**
* 转向药品页面
*/
@RequestMapping
public String druginfo(){
return "/druginfo";
}
/**
* 分页查询药品列表
*/
@RequestMapping(value = "/druginfoQueryPage")
@ResponseBody
public Object druginfoQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Druginfo> iPage = druginfoService.selectDruginfoPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向药品新增页面
*/
@RequestMapping(value = "/druginfoPage")
public String druginfoPage(){
return "/druginfoPage";
}
/**
* 添加一个药品
*/
@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);
}
/**
* 用户相关的controller
*/
@Controller
public class UserController {
/**
* 转向登录页面
*/
@RequestMapping(value = "/login")
public String login(){
return "/login";
}
/**
* 判断用户登录是否成功
*/
@RequestMapping(value = "/toLogin")
@ResponseBody
public Object toLogin(String username,String password){
if(username==null||password==null){
return ResultMapUtil.getHashMapLogin("用户名密码不能为空","2");
public String saleinfo(){
return "/saleinfo";
}
/**
* 分页查询销售记录列表
*/
@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";
}
/**
* 修改一个销售记录
@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{
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 = "/druginfoPage")
public String druginfoPage(){
return "/druginfoPage";
}
/**
* 添加一个药品
*/
@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 = "/billinfoDelById")
@ResponseBody
public Object billinfoDelById(Integer id){
try{
int i = billinfoService.delBillinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
/**
* 添加一个问题药品
*/
@RequestMapping(value = "/problemAdd")
@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);
}
/**
* 转向收到退货编辑页面
*/
@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 = "/returngoodsEdit")
@ResponseBody
public Object returngoodsEdit(Returngoods returngoods){
try{
int i = returngoodsService.editReturngoods(returngoods);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个收到退货
*/
@RequestMapping(value = "/returngoodsDelById")
@ResponseBody
public Object returngoodsDelById(Integer id){
try{
int i = returngoodsService.delReturngoodsById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
int i = billinfoService.addBillinfo(billinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向账单信息编辑页面
*/
@RequestMapping(value = "/billinfoQueryById")
public String billinfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Billinfo billinfo = billinfoService.queryBillinfoById(id);
model.addAttribute("obj",billinfo);
return "/billinfoPage";
}
/**
* 修改一个账单信息
*/
@RequestMapping(value = "/billinfoEdit")
@ResponseBody
public Object billinfoEdit(Billinfo billinfo){
try{
int i = billinfoService.editBillinfo(billinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个账单信息
*/
@RequestMapping(value = "/billinfoDelById")
@ResponseBody
public Object billinfoDelById(Integer id){
try{
int i = billinfoService.delBillinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
}
/**
* 分页查询收到退货列表
*/
@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){
/**
* 销售记录相关的controller
*/
@Controller
@RequestMapping(value = "/saleinfo")
public class SaleinfoController {
@Autowired
private ISaleinfoService saleinfoService;
/**
* 转向销售记录页面
*/
@RequestMapping
public String saleinfo(){
return "/saleinfo";
}
/**
* 分页查询销售记录列表
*/
@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 = "/problemAdd")
@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);
}
}
/**