Java project: hospital management system (java+Springboot+ssm+mysql+maven)

Source code acquisition: download from "resources" on the blog home page!

1, Project brief

Function: the project is a hospital management system written with springboot+layui+shiro. The business of the system is relatively complex. There are 36 tables in the database.

The project is divided into outpatient management, inpatient management, system management, statistical management, data center, shift management, warehouse management and pharmacy management

Mobile phone ID number, gender name, ID card number, registration of the type of doctor, and registration fee will be given. When the time is submitted, the information you input will be correct. If the mobile phone number or ID card number is being processed, The mobile phone number or the ID number is being processed. The registration page will query all the registrations according to the radio buttons, including the registration and pre registration of the day, and can carry out a series of operations for the user according to the registration of the day. For example, if the patient is transferred to the hospital, if the patient has an ongoing project, he cannot be transferred to the hospital. He can only be transferred to the hospital after paying the relevant expenses

Functions of outpatient management: user registration, prescription pricing, project pricing, project payment, project inspection, drug payment and outpatient database

Functions of hospitalization management: admission registration, payment management, drug bookkeeping, project bookkeeping and discharge settlement

System management functions: menu management, role management, user management, icon management and data source monitoring management. The login account and password of the data source are admin/admin

Statistical management: Monthly outpatient statistics, monthly Inpatient Statistics, annual outpatient statistics, annual Inpatient Statistics, doctor statistics, outpatient day statistics data center

Department center management, doctor list management, drug origin management, project category management, registration type management, warehouse management, handler management, supplier management, drug classification management and drug dictionary management

Shift scheduling: Doctor shift scheduling, warehouse management in U: warehouse in document management, inventory query, warehouse out document management, operation record management, etc

Pharmacy management: Pharmacy details management, outpatient drug taking management and inpatient drug taking management

2, Project operation

Environment configuration: jdk1 8 + Tomcat8. 5 + MySQL + Eclispe (IntelliJ idea, Eclispe, myeclispe, STS all support)

Project technology: JSP +Springboot+ SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + Layui+ maven, etc

Address control layer:

@Controller
@RequestMapping("area")
public class AreaController {
    @Autowired
    private AreaService areaService;
    /*
     * Query production address
     * */
    @RequestMapping("findAllArea")
    @ResponseBody
    public Object AreaList(Area Area, Integer page, Integer limit){
        PageHelper.startPage(page, limit);
        List<Area> listAll = areaService.findAllArea(Area);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        tableData.put("code", 0);
        tableData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        tableData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        tableData.put("data", pageInfo.getList());

        return tableData;
    }
    /*
     * Add production address
     * */
    @RequestMapping("addArea")
    @ResponseBody
    public Object addArea(Area Area){
        int count = areaService.count(Area);
        if(count==0){
            int i = areaService.addArea(Area);
            if(i==1){
                return "Added successfully";
            }else{
                return "Add failed";
            }
        }else {
            return Area.getAreaName()+"Already exists";
        }

    }

    /*
     * Delete production address
     * */
    @RequestMapping("deleteArea")
    @ResponseBody
    public Object deleteArea(Integer areaId){
        int i = areaService.deleteArea(areaId);
        if(i==1){
            return "Deleted successfully";
        }else{
            return "Deletion failed";
        }
    }
}

Financial business control layer:

@Controller
@RequestMapping("finance")
public class FinanceController {
    @Autowired
    private FinanceService financeService;
    /*Comparison of monthly outpatient income*/
    @ResponseBody
    @RequestMapping("reportYearFinance")
    public Object reportYearFinance(String year){
        List<Double> doubles = financeService.reportYearFinance(year);
        for (int i = 0; i < doubles.size(); i++) {
            if(null==doubles.get(i)) {
                doubles.set(i, 0.0);
            }
        }
        return doubles;
    }
    /*Comparison of monthly hospitalization income*/
    @ResponseBody
    @RequestMapping("zhuYuanYearFinance")
    public Object zhuYuanYearFinance(String year){
        List<Double> zhuYuan = financeService.zhuYuanYearFinance(year);
        for (int i = 0; i < zhuYuan.size(); i++) {
            if(null==zhuYuan.get(i)) {
                zhuYuan.set(i, 0.0);
            }
        }
        return zhuYuan;
    }
    /*Comparison of annual outpatient income*/
    @ResponseBody
    @RequestMapping("reportYearBingFinance")
    public Object reportYearBingFinance(){
        List<Finance> bingReport = financeService.reportYearBingFinance();
        return bingReport;
    }
    /*Comparison of annual hospitalization income*/
    @ResponseBody
    @RequestMapping("zhuYuanYearBingFinance")
    public Object zhuYuanYearBingFinance(){
        List<Finance> bingZhuYuan = financeService.zhuYuanYearBingFinance();
        return bingZhuYuan;
    }
    /*Statistical comparison of outpatient doctors' income*/
    @ResponseBody
    @RequestMapping("doctorDuibi")
    public Object doctorDuibi( SdoctorDuibi sdoctorDuibi,Integer page, Integer limit){
        PageHelper.startPage(page, limit);
        List<SdoctorDuibi> sdoctorDuibis = financeService.doctorDuibi(sdoctorDuibi);
        PageInfo pageInfo = new PageInfo(sdoctorDuibis);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //This is the format required by layui
        tableData.put("code", 0);
        tableData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        tableData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        tableData.put("data", pageInfo.getList());
        return tableData;
    }
    /*Statistical comparison of resident income*/
    @ResponseBody
    @RequestMapping("zDoctorDuibi")
    public Object zDoctorDuibi(SdoctorDuibi sdoctorDuibi, Integer page, Integer limit){

        PageHelper.startPage(page, limit);
        List<SdoctorDuibi> zDoctorDuibis = financeService.zDoctorDuibi(sdoctorDuibi);
        PageInfo pageInfo = new PageInfo(zDoctorDuibis);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        tableData.put("code", 0);
        tableData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        tableData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        tableData.put("data", pageInfo.getList());
        return tableData;
    }
    /*Outpatient income on the same day*/
    @ResponseBody
    @RequestMapping("currentFinance")
    public Object currentFinance(String current){
        List<currentFinance> currentFinances = financeService.currentFinance(current);
        return currentFinances;
    }
}

Role information control layer:

@Controller
@RequestMapping("role")
public class RoleController {
    @Autowired
    private RoleService roleService;

    @RequestMapping("loadAllRole")
    @ResponseBody
    public Object loadAllRole(Role role, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Role> roles = roleService.loadAllRole(role);
        PageInfo pageInfo = new PageInfo(roles);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        tableData.put("code", 0);
        tableData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        tableData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        tableData.put("data", pageInfo.getList());
        return tableData;
    }

    @RequestMapping("insertRole")
    @ResponseBody
    public String insertRole(Role role) {
        int i = roleService.insertRole(role);
        if (i == 1) {
            return "Added successfully";
        } else {
            return "Add failed";
        }
    }

    @RequestMapping("updateRole")
    @ResponseBody
    public String updateRole(Role role) {
        int i = roleService.updateRole(role);
        if (i == 1) {
            return "Modified successfully";
        } else {
            return "Modification failed";
        }
    }

    @RequestMapping("deleteRole")
    @ResponseBody
    public String deleteRole(Integer roleid) {
        roleService.deleteRoleId(roleid);
        roleService.deleteRoleUserId(roleid);
        roleService.deleteRoleMenuId(roleid);
        return "Deleted successfully";

    }
    //Load role management assignment menu
    @RequestMapping("initRoleMenuTreeJson")
    @ResponseBody
    public DataGridView initRoleMenuTreeJson(Integer roleid) {
        return roleService.initRoleMenuTreeJson(roleid);
    }
    //Save the relationship between roles and menus
    @RequestMapping("saveRoleMenu")
    @ResponseBody
    public Object saveRoleMenu(RoleMenu roleMenu){

        roleService.saveRoleMenu(roleMenu);
        return "Allocation succeeded";
    }
}

Drug warehouse control layer:

@Controller
@RequestMapping("seldrugstore")
public class StoreController {
    @Autowired
    private StoreService storeService;
    @Autowired
    private PutinService putinService;
    @Autowired
    private RecordService rs;
//Query drug warehouse
    @RequestMapping("selectdrugstore")
    @ResponseBody
    public Object seldrugstore(Drugstore drugstore, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Drugstore> drugstores = storeService.selStore(drugstore);
        PageInfo pageInfo = new PageInfo(drugstores);
        Map<String, Object> drugstoresData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        drugstoresData.put("code", 0);
        drugstoresData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        drugstoresData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        drugstoresData.put("data", pageInfo.getList());
        return drugstoresData;
    }
    //Query drug type
    @RequestMapping("seltype")
    @ResponseBody
    public Object seltype(Type type) {
        List<Type> seltype = storeService.seltype(type);
        return seltype;
    }
    //Query UOM
    @RequestMapping("selunit")
    @ResponseBody
    public Object selunit(Unit unit) {
        List<Unit> selunit = storeService.selunit(unit);
        return selunit;
    }
    //Query origin
    @RequestMapping("selarea")
    @ResponseBody
    public Object selarea(Area area) {
        List<Area> selarea = storeService.selarea(area);
        return selarea;
    }
    //Query handler
    @RequestMapping("selskull")
    @ResponseBody
    public Object selskull(Skull skull) {

        List<Skull> selskull = storeService.selskull(skull);

        return selskull;
    }
//Query supplier
    @RequestMapping("selupplier")
    @ResponseBody
    public Object selupplier(Upplier upplier, Model model) {
        List<Upplier> selupplier = storeService.selupplier(upplier);
        return selupplier;
    }

    //Modify the basic information of drugs in the warehouse
    @RequestMapping("updrug")
    @ResponseBody
    public Object updrugstore(Drugstore drugstore) {
        int add = storeService.updrugstore(drugstore);
        if (add == 1) {
            return "Modified successfully";
        } else {
            return "Modification failed";
        }
    }
//supplier
    @RequestMapping("bpisselupplier")
    public Object bpisselupplier(Upplier upplier, Model model) {

        List<Upplier> selupplier = storeService.selupplier(upplier);
        return "drugstore/c_beputinstorage";
    }
//Query drug list
    @RequestMapping("selectdgty")
    @ResponseBody
    public Object selectdgty(Drugdictionary drugdictionary, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Drugdictionary> drugdictiona = putinService.seldcy(drugdictionary);
        PageInfo pageInfo = new PageInfo(drugdictiona);
        Map<String, Object> drugstoresData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        drugstoresData.put("code", 0);
        drugstoresData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        drugstoresData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        drugstoresData.put("data", pageInfo.getList());

        return drugstoresData;
    }


//Add a drug warehousing
    @RequestMapping("adddrugs")
    @ResponseBody
    public Integer adddrugs(Drugstore drugstore,Record record) {
        System.out.print("Query method");
        Integer updrugnumber=0;
        Integer adddrugstore=0;
        int seldrugname = putinService.seldrugname(drugstore);
        System.out.println(seldrugname+"yyyyyyyyyyyyyyyyyyyyyyyy");
        if(seldrugname==1){
            System.out.print("Enter the modification method");
            updrugnumber = putinService.updrugnumber(drugstore);
            System.out.print("Add record table 0");
            int addjilu = rs.addjilu(record);//Add a record

        }
        if (seldrugname!=1){
            System.out.print("Enter add method");
            adddrugstore = putinService.adddrugstore(drugstore);
            System.out.print("Add record table 1");
            int addjilu = rs.addjilu(record);//Add a record

        }
        return adddrugstore+updrugnumber;
    }
    //Query the inventory quantity of the selected drugs
    @RequestMapping("selnumber")
    @ResponseBody
    public int selnumber(Drugstore drugstore) {
        System.out.print("Query quantity method");
      int selnumber = putinService.selnumber(drugstore);
        System.out.println(selnumber);
       return selnumber;
    }
    //Query the insufficient quantity of drugs in the warehouse
    @RequestMapping("selectlackdrug")
    @ResponseBody
    public Object selectlackdrug(Drugstore drugstore, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Drugstore> drugstores = storeService.selectlackdrug(drugstore);//Inquire about drugs with insufficient quantity
        PageInfo pageInfo = new PageInfo(drugstores);
        Map<String, Object> drugstoresData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        drugstoresData.put("code", 0);
        drugstoresData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        drugstoresData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        drugstoresData.put("data", pageInfo.getList());
        return drugstoresData;
    }
    //Query purchase order
    @RequestMapping("selcaigou")
    @ResponseBody
    public Object selcaigou(Caigou caigou, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Caigou> caigous = storeService.selcaigou(caigou);//Query and traverse purchase table
        PageInfo pageInfo = new PageInfo(caigous);
        Map<String, Object> drugstoresData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        drugstoresData.put("code", 0);
        drugstoresData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        drugstoresData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        drugstoresData.put("data", pageInfo.getList());
        return drugstoresData;
    }

    //Add a drug purchase order
    @RequestMapping("addcaigou")
    @ResponseBody
    public Integer addcaigou(Caigou caigou) {
        int selcaigouname = storeService.selcaigouname(caigou);//Query whether this data already exists in the purchase order
        if(selcaigouname==0){
            int seldrugname =storeService.addcaigou(caigou);//add to
            return seldrugname;

        }else {
            int upcaigounumber = storeService.upcaigounumber(caigou);//modify
            return upcaigounumber;
        }

    }
    //Delete a drug purchase order
    @RequestMapping("delcaigou")
    @ResponseBody
    public Integer delcaigou(Integer caigouid) {
        int seldrugname =storeService.delcaigou(caigouid);//Delete this purchase data
        return seldrugname;
    }
    //What are the expired drugs
    @RequestMapping("seldrugDateguoqi")
    @ResponseBody
    public Object seldrugDateguoqi(Drugstore drugstore, Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Drugstore> drugstores = storeService.seldrugDate(drugstore);
        PageInfo pageInfo = new PageInfo(drugstores);
        Map<String, Object> drugstoresData = new HashMap<String, Object>();
        //This is the json data format that layui requires to return
        drugstoresData.put("code", 0);
        drugstoresData.put("msg", "");
        //Send the number of all data to the foreground as count (how many in total)
        drugstoresData.put("count", pageInfo.getTotal());
        //Return the paged data (data to be displayed on each page)
        drugstoresData.put("data", pageInfo.getList());
        return drugstoresData;
    }
    //Delete expired drugs
    @RequestMapping("delguoqidurg")
    @ResponseBody
    public Integer delguoqidurg(Integer rugstoreId,Record record) {
        System.out.print("Enter delete");
        int delguoqidurg = storeService.delguoqidurg(rugstoreId);//Delete this data
        if(delguoqidurg==1){//If you delete this entry, it will be added to the record table

            System.out.print("Add record table");
            int addjilu = rs.addjilu(record);
        }
        return delguoqidurg;
    }

}

Source code acquisition: download from "resources" on the blog home page!

Keywords: Java MySQL Maven Spring Boot SSM

Added by Seraskier on Fri, 11 Feb 2022 17:35:27 +0200