基于javaweb+mysql的医药进销存系统(java+SSM+JSP+Layui+jQuery+Maven+mysql)

功能介绍
医药进销存系统,主要功能包括:

公告管理:发布公告、公告列表;
生产管理:订单列表、增加生产、订单日志;
分店采购:分店审核、采购;
总店仓库:出库管理、仓库列表、入库管理;
分店管理:分店库存、分店列表、分店财务;
商品管理:原材料、药效、商品列表、药品类型;
总店采购:采购列表、采购审核;
合同管理:合同类型管理、合同列表;
会员管理:会员列表;
质检:质检;
权限管理:人员管理、模块管理、部门管理、角色管理;
审核管理:财务审核、生产审核、采购审核;
分店销售:销售统计图、订单批发审核、订单列表、分店销售;
该项目共有49张表,功能比较复杂;

其他管理:供货商管理,新增、搜索、编辑、删除;

环境需要
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+Layui+jQuery

运行说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

  2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
    若为maven项目,导入成功后请执行maven clean;maven install命令,配置tomcat,然后运行;

  3. 将项目中db.properties和spring.xml配置文件中的数据库配置改为自己的配置;

  4. 运行项目,输入http://localhost:8080/medicine/page/login.jsp 登录请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

            userService.deleteUser(user.getUserAcc());
            ajaxInfo.setMsg("删除成功!");
        } else {
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/registBuyer")
    public AjaxInfo registBuyer(@RequestBody Buyer buyer, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        System.out.println("======"+buyer);
        Buyer buyerByUserId = userService.getBuyerById(buyer.getBuyerId());
        if (session.getAttribute("userName") != null) {
            if (buyerByUserId == null) {
                userService.registBuyer(buyer);
                ajaxInfo.setMsg("注册成功!");
            } else {
                ajaxInfo.setMsg("ID已存在!");
            }
            return ajaxInfo;
        } else {
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/showOutRecord")
    public AjaxInfo queryBuyer(MedicineTable medicineTable,HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        if (session.getAttribute("userName") != null) {
            int page=(medicineTable.getPage()-1)*medicineTable.getLimit();
            medicineTable.setPage(page);
            List<ShowOutRecord> outRecord = queryService.getOutRecord(medicineTable);
            ajaxInfo.setCount(queryService.getOutRecordCount(medicineTable));
            ajaxInfo.setData(factories);
        } else {
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/queryBuyerByName")
    public AjaxInfo queryBuyerByName(MedicineTable medicineTable, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        System.out.println(medicineTable);
        if (session.getAttribute("userName") != null) {
            int page=(medicineTable.getPage()-1)*medicineTable.getLimit();
            medicineTable.setPage(page);
            List<Buyer> buyers = queryService.queryBuyerByName(medicineTable);
            ajaxInfo.setMsg("查询成功");
            ajaxInfo.setCount(queryService.queryBuyerByNameCount(medicineTable));
            int page=(medicineTable.getPage()-1)*medicineTable.getLimit();
            medicineTable.setPage(page);
            List<User> users = queryService.queryUserByName(medicineTable);
            ajaxInfo.setMsg("查询成功");
            ajaxInfo.setCount(queryService.queryUserByNameCount(medicineTable));
            ajaxInfo.setCode(0);
            ajaxInfo.setData(users);
        } else {
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
}
用户登录管理控制层:
@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/login")
    public AjaxInfo login(@RequestBody User user, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        System.out.println(session.getId());
        User user1 = userService.findUser(user);
        if (user1 != null) {
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/queryFactory")
    public AjaxInfo queryFactory(@RequestBody Factory factory, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        if (session.getAttribute("userName") != null) {
            Factory fId = adminService.getFactoryByfactoryId(factory.getFactoryId());
            if (fId == null) {
                ajaxInfo.setMsg("该药厂不存在,请重新输入!");
                ajaxInfo.setCode(-1);
            } else {
                ajaxInfo.setMsg("查询成功!");
                ajaxInfo.setData(fId);
                ajaxInfo.setCode(0);
                System.out.println(fId);
            }
            return ajaxInfo;
            Buyer buyer1 = userService.getBuyerById(buyer.getBuyerId());
            if (buyer1 == null) {
                ajaxInfo.setMsg("该采购员不存在,请重新输入!");
                ajaxInfo.setCode(-1);
            } else {
                ajaxInfo.setMsg("查询成功!");
                ajaxInfo.setData(buyer1);
                ajaxInfo.setCode(0);
            }
        } else {
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        System.out.println("================="+ajaxInfo.getCode());
        return ajaxInfo;
    }
        if (session.getAttribute("userName") != null) {
            adminService.deleteMedicine(medicine.getMedId());
            ajaxInfo.setMsg("删除成功!");
            ajaxInfo.setCode(0);
        } else {
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/insertFactory")
    public AjaxInfo insertFactory(@RequestBody Factory factory, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        if (session.getAttribute("userName") != null) {
            Factory fId = adminService.getFactoryByfactoryId(factory.getFactoryId());
            if (fId == null) {
                adminService.insertFactory(factory);
                ajaxInfo.setMsg("插入信息成功~");
                ajaxInfo.setCode(0);
            } else {
                ajaxInfo.setMsg("该药厂已存在~");
                ajaxInfo.setCode(-1);
            }
            return ajaxInfo;
        } else {
            ajaxInfo.setCode(-2);
        AjaxInfo ajaxInfo = new AjaxInfo();
        if (session.getAttribute("userName") != null) {
            int page=(medicineTable.getPage()-1)*medicineTable.getLimit();
            medicineTable.setPage(page);
            List<ShowOutRecord> outRecord = queryService.getOutRecord(medicineTable);
            ajaxInfo.setCount(queryService.getOutRecordCount(medicineTable));
            ajaxInfo.setCode(0);
            ajaxInfo.setData(outRecord);
        } else {
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/queryMedicineByName")
    public AjaxInfo queryMedicineByName(MedicineTable medicineTable, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        System.out.println(medicineTable);
        if (session.getAttribute("userName") != null) {
            int page=(medicineTable.getPage()-1)*medicineTable.getLimit();
            medicineTable.setPage(page);
        if (session.getAttribute("userName") != null) {
            Factory fId = adminService.getFactoryByfactoryId(factory.getFactoryId());
            if (fId == null) {
                adminService.insertFactory(factory);
                ajaxInfo.setMsg("插入信息成功~");
                ajaxInfo.setCode(0);
            } else {
                ajaxInfo.setMsg("该药厂已存在~");
                ajaxInfo.setCode(-1);
            }
            return ajaxInfo;
        } else {
            ajaxInfo.setCode(-2);
            ajaxInfo.setMsg("权限不足!请先登录~");
        }
        return ajaxInfo;
    }
    @RequestMapping("/queryFactory")
    public AjaxInfo queryFactory(@RequestBody Factory factory, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        if (session.getAttribute("userName") != null) {
            Factory fId = adminService.getFactoryByfactoryId(factory.getFactoryId());
            if (fId == null) {
                ajaxInfo.setMsg("该药厂不存在,请重新输入!");
                ajaxInfo.setCode(-1);
            } else {
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/login")
    public AjaxInfo login(@RequestBody User user, HttpSession session) {
        AjaxInfo ajaxInfo = new AjaxInfo();
        System.out.println(session.getId());
        User user1 = userService.findUser(user);
        if (user1 != null) {
            ajaxInfo.setCode(user1.getUserRight());
            ajaxInfo.setMsg("登陆成功!");
            ajaxInfo.setData(user1.getUserName());
            session.setAttribute("userName", user1.getUserName());
            System.out.println(session.getAttribute("userName"));
        } else {
            ajaxInfo.setCode(-1);
            ajaxInfo.setMsg("账号或密码错误!");

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值