基于javaweb+springboot的医院药品管理系统设计和实现(java+Springboot+ssm+mysql+jsp+maven)
一、项目简述
功能描叙: 药品销售管理,药品明晰管理,药片库存管理,登记出入 库信息,问题药品记录,药片保质期检查,销售记录,退 货记录,药品信息,供应商信息等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Springboot+ SpringMVC + MyBatis + ThymeLeaf + HTML+ JavaScript + JQuery + Ajax + maven等等。
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
* 分页查询账单信息列表
*/
@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);
}
}
int i = billinfoService.delBillinfoById(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";
}
/**
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);
供应商相关控制层:
/**
* 供应商相关的controller
*/
@Controller
@RequestMapping(value = "/supplier")
public class SupplierController {
@Autowired
private ISupplierService supplierService;
/**
* 转向供应商页面
*/
@RequestMapping
public String supplier(){
int i = billinfoService.delBillinfoById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
供应商相关控制层:
/**
* 供应商相关的controller
*/
@Controller
* 转向供应商新增页面
*/
@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")
}
}
/**
* 删除一个账单信息
*/
@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
*/
@Controller
@RequestMapping(value = "/supplier")
public class SupplierController {
@Autowired
private ISupplierService supplierService;
return "/login";
}
/**
* 判断用户登录是否成功
*/
@RequestMapping(value = "/toLogin")
@ResponseBody
public Object toLogin(String username,String password){
if(username==null||password==null){
return ResultMapUtil.getHashMapLogin("用户名密码不能为空","2");
}
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken token = new UsernamePasswordToken(username,password);
try{
subject.login(token);
}catch (UnknownAccountException e){
return ResultMapUtil.getHashMapLogin("用户名不存在","2");
}catch (IncorrectCredentialsException 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);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 删除一个供应商
*/
@RequestMapping(value = "/supplierDelById")
@ResponseBody
* 转向供应商页面
*/
@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){
} 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 = "/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);
}
}
/**
* 转向账单信息新增页面
*/
return ResultMapUtil.getHashMapLogin("用户名不存在","2");
}catch (IncorrectCredentialsException e){
return ResultMapUtil.getHashMapLogin("密码错误","2");
}
return ResultMapUtil.getHashMapLogin("验证成功","1");
}
/**
* 转向后台管理首页
*/
@RequestMapping(value = "/index")
public String index(){
return "/index";
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向账单信息新增页面
*/
@RequestMapping(value = "/billinfoPage")
public String billinfoPage(){
return "/billinfoPage";
}
/**
* 添加一个账单信息
*/
@RequestMapping(value = "/billinfoAdd")
@ResponseBody
public Object billinfoAdd(Billinfo billinfo){
@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")
@ResponseBody
public Object billinfoAdd(Billinfo billinfo){
try{
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";
}
/**
* 修改一个账单信息
@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 = "/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);
}
*/
@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);
try{
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";
}
subject.logout();
return "redirect:/login";
}
}
账单信息相关控制层:
/**
* 账单信息相关的controller
*/
@Controller
@RequestMapping(value = "/billinfo")
public class BillinfoController {
@Autowired
private IBillinfoService billinfoService;
/**
* 转向账单信息页面
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
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);
}
/**
* 转向账单信息新增页面
*/
@RequestMapping(value = "/billinfoPage")
public String billinfoPage(){
return "/billinfoPage";
}
/**
* 添加一个账单信息
*/
@RequestMapping(value = "/billinfoAdd")
@ResponseBody
public Object billinfoAdd(Billinfo billinfo){
try{
int i = billinfoService.addBillinfo(billinfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* 转向账单信息编辑页面
*/
return "/supplierPage";
}
/**
* 修改一个供应商
*/
@RequestMapping(value = "/supplierEdit")
@ResponseBody
public Object supplierEdit(Supplier supplier){
try{
int i = supplierService.editSupplier(supplier);
private IBillinfoService billinfoService;
/**
* 转向账单信息页面
*/
@RequestMapping
public String billinfo(){
return "/billinfo";
}
/**
* 分页查询账单信息列表
*/
*/
@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");
}
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken token = new UsernamePasswordToken(username,password);
try{
subject.login(token);
}catch (UnknownAccountException e){
return ResultMapUtil.getHashMapLogin("用户名不存在","2");
}catch (IncorrectCredentialsException e){
return ResultMapUtil.getHashMapLogin("密码错误","2");
}
return ResultMapUtil.getHashMapLogin("验证成功","1");
}
/**
* 判断用户登录是否成功
*/
@RequestMapping(value = "/toLogin")
@ResponseBody
public Object toLogin(String username,String password){
if(username==null||password==null){
return ResultMapUtil.getHashMapLogin("用户名密码不能为空","2");
}
Subject subject = SecurityUtils.getSubject();
UsernamePasswordToken token = new UsernamePasswordToken(username,password);
try{