SSM+Mysql实现的共享单车管理系统(功能包含分角色,登录、用户管理、服务点管理、单车管理、分类管理、学生信息管理、单车租赁、信息统计、系统设置等)

news2025/2/28 2:58:26

博客目录

  • SSM+Mysql实现的共享单车管理系统
    • 实现功能截图
    • 系统功能
    • 使用技术
    • 代码
    • 完整源码

SSM+Mysql实现的共享单车管理系统

本系统一个学校共享单车管理的项目,通过线上系统化的管理,可以为后续的运营以及单车的项目运转提供极大的帮助。
(文末查看完整源码)

实现功能截图

用户登录在这里插入图片描述
用户管理‘
在这里插入图片描述
服务点管理
在这里插入图片描述
单车管理
在这里插入图片描述
分类管理
在这里插入图片描述
学生信息管理
在这里插入图片描述
单车租赁
在这里插入图片描述
信息统计汇总
在这里插入图片描述
更改密码
在这里插入图片描述

系统功能

本系统实现了以下功能:
1、登录
2、用户管理
3、服务点管理
4、单车管理
5、单车租赁
6、学生信息管理
7、分类管理
8、信息统计汇总
9、系统设置

使用技术

数据库:mysql
开发工具:Idea(Myeclispe、Eclipse也可以)
知识点:SSM

项目结构
在这里插入图片描述

代码

java端
实体类
Admin.java

package com.webike.pojo;

import java.util.Date;

public class Admin {
    private Integer aid;

    private Integer aPid;

    private Place place;

    private String aUsername;

    private String aPassword;

    private String aRealName;

    private String aPhone;

    private String aRole;

    private String aIcon;

    private Date aLoginTime;

    private Date aCreateTime;

    private Date aUpdateTime;

    private String aComment;

    public Place getPlace() {
        return place;
    }

    public void setPlace(Place place) {
        this.place = place;
    }

    public Integer getAid() {
        return aid;
    }

    public void setAid(Integer aid) {
        this.aid = aid;
    }

    public Integer getaPid() {
        return aPid;
    }

    public void setaPid(Integer aPid) {
        this.aPid = aPid;
    }

    public String getaUsername() {
        return aUsername;
    }

    public void setaUsername(String aUsername) {
        this.aUsername = aUsername == null ? null : aUsername.trim();
    }

    public String getaPassword() {
        return aPassword;
    }

    public void setaPassword(String aPassword) {
        this.aPassword = aPassword == null ? null : aPassword.trim();
    }

    public String getaRealName() {
        return aRealName;
    }

    public void setaRealName(String aRealName) {
        this.aRealName = aRealName == null ? null : aRealName.trim();
    }

    public String getaPhone() {
        return aPhone;
    }

    public void setaPhone(String aPhone) {
        this.aPhone = aPhone == null ? null : aPhone.trim();
    }

    public String getaRole() {
        return aRole;
    }

    public void setaRole(String aRole) {
        this.aRole = aRole == null ? null : aRole.trim();
    }

    public String getaIcon() {
        return aIcon;
    }

    public void setaIcon(String aIcon) {
        this.aIcon = aIcon == null ? null : aIcon.trim();
    }

    public Date getaLoginTime() {
        return aLoginTime;
    }

    public void setaLoginTime(Date aLoginTime) {
        this.aLoginTime = aLoginTime;
    }

    public Date getaCreateTime() {
        return aCreateTime;
    }

    public void setaCreateTime(Date aCreateTime) {
        this.aCreateTime = aCreateTime;
    }

    public Date getaUpdateTime() {
        return aUpdateTime;
    }

    public void setaUpdateTime(Date aUpdateTime) {
        this.aUpdateTime = aUpdateTime;
    }

    public String getaComment() {
        return aComment;
    }

    public void setaComment(String aComment) {
        this.aComment = aComment == null ? null : aComment.trim();
    }

    @Override
    public String toString() {
        return "Admin{" +
                "aid=" + aid +
                ", aPid=" + aPid +
                ", place=" + place +
                ", aUsername='" + aUsername + '\'' +
                ", aPassword='" + aPassword + '\'' +
                ", aRealName='" + aRealName + '\'' +
                ", aPhone='" + aPhone + '\'' +
                ", aRole='" + aRole + '\'' +
                ", aIcon='" + aIcon + '\'' +
                ", aLoginTime=" + aLoginTime +
                ", aCreateTime=" + aCreateTime +
                ", aUpdateTime=" + aUpdateTime +
                ", aComment='" + aComment + '\'' +
                '}';
    }
}

Bike,java

package com.webike.pojo;

import java.util.Date;

public class Bike {
    private Integer bid;

    private String bName;

    private String bIcon;

    private Integer bCid;

    private String bInTime;

    private String bState;

    private Date bCreateTime;

    private Date bUpdateTime;

    private String bComment;

    public Integer getBid() {
        return bid;
    }

    public void setBid(Integer bid) {
        this.bid = bid;
    }

    public String getbName() {
        return bName;
    }

    public void setbName(String bName) {
        this.bName = bName == null ? null : bName.trim();
    }

    public String getbIcon() {
        return bIcon;
    }

    public void setbIcon(String bIcon) {
        this.bIcon = bIcon == null ? null : bIcon.trim();
    }

    public Integer getbCid() {
        return bCid;
    }

    public void setbCid(Integer bCid) {
        this.bCid = bCid;
    }

    public String getbInTime() {
        return bInTime;
    }

    public void setbInTime(String bInTime) {
        this.bInTime = bInTime == null ? null : bInTime.trim();
    }

    public String getbState() {
        return bState;
    }

    public void setbState(String bState) {
        this.bState = bState == null ? null : bState.trim();
    }

    public Date getbCreateTime() {
        return bCreateTime;
    }

    public void setbCreateTime(Date bCreateTime) {
        this.bCreateTime = bCreateTime;
    }

    public Date getbUpdateTime() {
        return bUpdateTime;
    }

    public void setbUpdateTime(Date bUpdateTime) {
        this.bUpdateTime = bUpdateTime;
    }

    public String getbComment() {
        return bComment;
    }

    public void setbComment(String bComment) {
        this.bComment = bComment == null ? null : bComment.trim();
    }
}

service层
AdminServiceImpl.java

package com.webike.service.impl;

import com.webike.dao.AdminMapper;
import com.webike.dao.PlaceMapper;
import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.enums.ResultEnum;
import com.webike.enums.RoleEnum;
import com.webike.pojo.*;
import com.webike.service.AdminService;
import com.webike.utils.FileUtil;
import com.webike.utils.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.Date;
import java.util.List;

/**
 * Created by Ming on 2018/2/9.
 */
@Service
    public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Autowired
    private PlaceMapper placeMapper;
    @Override
    public String checkUserPwd(Admin admin) {
//        String password = MD5Util.getMD5(admin.getaPassword());
        String password = admin.getaPassword();
        Admin realAdmin = findByUsername(admin.getaUsername());
        if(realAdmin != null ){
            if(password.equals(realAdmin.getaPassword())){
                return "成功";
            }
            return "密码错误~";
        }
        return "没有此账号~";
    }

    @Override
    public boolean upDate(Admin admin) {
        AdminExample adminExample = new AdminExample();
        adminExample.createCriteria().andAUsernameEqualTo(admin.getaUsername());
        int i = adminMapper.updateByExampleSelective(admin, adminExample);
        return i > 0 ? true : false;
    }

    @Override
    public Admin findByUsername(String username) {
        AdminExample adminExample = new AdminExample();
        adminExample.createCriteria().andAUsernameEqualTo(username);
        List<Admin> admins = adminMapper.selectByExample(adminExample);
        if(admins != null && admins.size() > 0){
            Admin admin = admins.get(0);
            //pid不为空设置站点对象
            if(admin.getaPid() != null) {
                admin.setPlace(placeMapper.selectByPrimaryKey(admin.getaPid()));
            }
            return admin;
        }
        return null;
    }

    @Override
    public Page<Admin> findAllToPage(Integer page, Integer rows) {

        Page<Admin> aPage = new Page<>();
        List<Admin> lists = adminMapper.findToPage((page-1)*rows,rows);
        aPage.setRows(lists);
        aPage.setTotal(adminMapper.countByExample(new AdminExample()));
        return aPage;
    }

    @Override
    public JsonResult deleteById(Integer aid) {
        if (aid == null) return new JsonResult(false, ResultEnum.SYSTEM_ERROR);
        int i = adminMapper.deleteByPrimaryKey(aid);
        return i > 0 ? new JsonResult(true, ResultEnum.DELETE_SUCCESS)
                : new JsonResult(false, ResultEnum.DELETE_FAIL);
    }

    @Override
    public List<Place> loadPlace() {
        List<Place> places = placeMapper.selectByExample(new PlaceExample());
        return places;
    }

    @Override
    public JsonResult add(MultipartFile adminIcon, Admin admin, HttpServletRequest request) {
        if(!adminIcon.isEmpty()){
            String path = FileUtil.uploadImage(adminIcon, "adminIcon", request);
            if(path == null) return new JsonResult(false, ResultEnum.UPLOAD_TYPE_ERROR);
            admin.setaIcon(path);
        }
        if(admin.getaRole() == null) admin.setaRole(RoleEnum.MANAGER.getMassage());
        admin.setaPassword(MD5Util.getMD5(admin.getaPassword()));
        admin.setaCreateTime(new Date());
        admin.setaUpdateTime(new Date());
        try{
            int  row = adminMapper.insertSelective(admin);
            return row > 0 ? new JsonResult(true, ResultEnum.ADD_SUCCESS)
                    : new JsonResult(false, ResultEnum.ADD_FAIL);
        }catch (Exception e){
            e.printStackTrace();
            return new JsonResult(false, ResultEnum.REPEAT_ERROR);
        }
    }

    @Override
    public JsonResult update(MultipartFile adminIcon, Admin admin, HttpServletRequest request) {
        try{
            if(!adminIcon.isEmpty()){
                //更新首先要先删除原来的文件
                if(admin.getaIcon() != null){
                    File file = new File(request.getServletContext().getRealPath("/" + admin.getaIcon()));
                    if(file != null) file.delete();
                }
                String path = FileUtil.uploadImage(adminIcon, "adminIcon", request);
                if(path == null) return new JsonResult(false, ResultEnum.UPLOAD_TYPE_ERROR);
                admin.setaIcon(path);
            }
            admin.setaUpdateTime(new Date());
            int i = adminMapper.updateByPrimaryKeySelective(admin);
            return i > 0 ? new JsonResult(false, ResultEnum.UPDATE_SUCCESS)
                    : new JsonResult(false, ResultEnum.UPDATE_FAIL);
        }catch (Exception e){
            e.printStackTrace();
            return new JsonResult(false, ResultEnum.SYSTEM_ERROR);
        }
    }


}

BikeControllerImpl.java

package com.webike.service.impl;

import com.webike.dao.BikeMapper;
import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.enums.BikeStateEnum;
import com.webike.enums.ResultEnum;
import com.webike.pojo.Bike;
import com.webike.pojo.BikeExample;
import com.webike.service.BikeService;
import com.webike.service.CategoryService;
import com.webike.utils.ArithmeticUtil;
import com.webike.utils.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.*;

/**
 * Created by Ming on 2018/2/10.
 */
@Service
public class BikeControllerImpl implements BikeService {
    @Autowired
    private BikeMapper bikeMapper;

    @Autowired
    private CategoryService categoryService;

    //事务控制 该单车分类剩余量+1
    @Transactional
    @Override
    public JsonResult add(MultipartFile bikeIcon, Bike bike, HttpServletRequest request,Integer bCount) {
        if(!bikeIcon.isEmpty()){
            String path = FileUtil.uploadImage(bikeIcon, "bikeIcon", request);
            if(path == null) return new JsonResult(false, ResultEnum.UPLOAD_TYPE_ERROR);
            bike.setbIcon(path);
        }
        bike.setbState(BikeStateEnum.AVAILABLE.getState());
        bike.setbCreateTime(new Date());
        bike.setbUpdateTime(new Date());
        try{
            int row = 0;
            for (int i = 0; i < bCount; i++) {
                row += bikeMapper.insertSelective(bike);
            }
            if(row == bCount){
                return categoryService.updateRemainById(bike.getbCid(),bCount) ?
                        new JsonResult(true, ResultEnum.ADD_SUCCESS):new JsonResult(false, ResultEnum.ADD_FAIL);
            }else{
                throw new RuntimeException();
            }
        }catch (Exception e){
            e.printStackTrace();
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return new JsonResult(false,ResultEnum.SYSTEM_ERROR);
        }

    }

    @Override
    public JsonResult update(MultipartFile bikeIcon, Bike bike, HttpServletRequest request) {
        try{
            if(!bikeIcon.isEmpty()){
                //更新首先要先删除原来的文件
                if(bike.getbIcon() != null){
                    File file = new File(request.getServletContext().getRealPath("/" + bike.getbIcon()));
                    if(file != null) file.delete();
                }
                String path = FileUtil.uploadImage(bikeIcon, "bikeIcon", request);
                if(path == null) return new JsonResult(false, ResultEnum.UPLOAD_TYPE_ERROR);
                bike.setbIcon(path);
            }
            bike.setbUpdateTime(new Date());
            int i = bikeMapper.updateByPrimaryKeySelective(bike);
            return i > 0 ? new JsonResult(false, ResultEnum.UPDATE_SUCCESS)
                    : new JsonResult(false, ResultEnum.UPDATE_FAIL);
        }catch (Exception e){
            e.printStackTrace();
            return new JsonResult(false, ResultEnum.SYSTEM_ERROR);
        }
    }

    @Override
    public Page<Bike> findAllToPage(Integer page, Integer rows) {
        Page<Bike> bPage = new Page<>();
        List<Bike> lists = bikeMapper.findToPage((page-1)*rows,rows);
        bPage.setRows(lists);
        bPage.setTotal(bikeMapper.countByExample(new BikeExample()));
        return bPage;
    }
    //事务控制 该单车的分类剩余量减size
    @Transactional
    @Override
    public JsonResult deleteById(String bids,String cids) {
        try{
            String[] bidList = bids.split(",");
            String[] cidList = cids.split(",");

            int row = 0;
            for (int i = 0; i < bidList.length; i++) {
                row += bikeMapper.deleteByPrimaryKey(Integer.parseInt(bidList[i]));
            }
            if(row == bidList.length){ //更新分类表的剩余数量
                HashMap<String, Integer> cidMap = ArithmeticUtil.getElementForTimes(cidList);
                Set<Map.Entry<String, Integer>> entries = cidMap.entrySet();
                for (Map.Entry<String, Integer> entry : entries) {
                    boolean isSuccess = categoryService.updateRemainById(Integer.parseInt(entry.getKey()), - entry.getValue());
                    if(!isSuccess) throw new RuntimeException();
                }
                return new JsonResult(true, ResultEnum.DELETE_SUCCESS);
            }else{
                throw new RuntimeException();
            }
        }catch (Exception e){
            e.printStackTrace();
//            throw new RuntimeException(e);
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            return new JsonResult(false,ResultEnum.SYSTEM_ERROR);
        }
    }

    @Override
    public Bike findById(Integer bid) {
        return bikeMapper.selectByPrimaryKey(bid);
    }



}

controller层
AdminController.java

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.enums.ResultEnum;
import com.webike.pojo.Admin;
import com.webike.pojo.Place;
import com.webike.service.AdminService;
import com.webike.utils.MD5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Date;
import java.util.List;

/**管理员controller
 * Created by Ming on 2018/2/8.
 */
@Controller
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    //跳转到首页
    @RequestMapping("/index")
    public String index(){
        return "index";
    }


    //验证登陆
    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public String login(Admin admin, Model model, HttpSession session){
        String message = adminService.checkUserPwd(admin);
        if("成功".equals(message)) {
            //注入Session
            Admin realAdmin = adminService.findByUsername(admin.getaUsername());

            session.setAttribute("admin",realAdmin);
            //更新登陆的时间
            admin.setaLoginTime(new Date());
            admin.setaUpdateTime(new Date());
            admin.setaPassword(null);
            adminService.upDate(admin);
            return "redirect:index";
        }

        model.addAttribute("msg",message);
        return "forward:/login.jsp";
    }
    //退出登陆
    @RequestMapping("/logout")
    public String logout(HttpSession session){
        session.invalidate();
        return "redirect:/login.jsp";
    }

    //跳转到修改密码的页面
    @RequestMapping("/rePassword")
    public String rePassword(){
        return "rePassword";
    }
    //修改提交的密码
    @RequestMapping("/submitResetPwd")
    @ResponseBody
    public JsonResult submitResetPwd(String password, String newPassword,HttpSession httpSession){
        Admin admin = (Admin) httpSession.getAttribute("admin");
        if(!admin.getaPassword().equals(password))
            return new JsonResult(false,ResultEnum.OLD_PASSWORD_ERROR);
        admin.setaPassword(MD5Util.getMD5(newPassword));
        admin.setaUpdateTime(new Date());
        boolean isSuccess = adminService.upDate(admin);
        if(isSuccess) return new JsonResult(isSuccess, ResultEnum.UPDATE_SUCCESS);
        return new JsonResult(isSuccess, ResultEnum.UPDATE_FAIL);
    }

    //跳转到用户管理页面

    @RequestMapping("/adminManage")
    public String adminMange(){
        return "admin";
    }


    //显示用户页面
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Admin> showAll(Integer page, Integer rows){
        return adminService.findAllToPage(page,rows);
    }

    //删除用户
    @RequestMapping("/remove")
    @ResponseBody
    public JsonResult remove(Integer aid){
        return adminService.deleteById(aid);
    }

    // 加载服务点到表单下拉框 loadPlace
    @RequestMapping("/loadPlace")
    @ResponseBody
    public List<Place> loadPlace(){
        return adminService.loadPlace();
    }


    //回显用户表单
    @RequestMapping("/loadForm")
    @ResponseBody
    public Admin loadForm(String username){
        Admin admin = adminService.findByUsername(username);
        return admin;
    }


    //addOrUpdate
    @RequestMapping("/addOrUpdate")
    @ResponseBody
    public JsonResult addOrUpdate(MultipartFile adminIcon, Admin admin, HttpServletRequest request){
        if(admin.getAid() == null) return adminService.add(adminIcon,admin,request);
        return adminService.update(adminIcon,admin,request);

    }
















}

BikeController.java

package com.webike.web;

import com.webike.dto.JsonResult;
import com.webike.dto.Page;
import com.webike.pojo.Bike;
import com.webike.pojo.Category;
import com.webike.pojo.Student;
import com.webike.service.BikeService;
import com.webike.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.*;

/**
 * Created by Ming on 2018/2/10.
 */
@Controller
@RequestMapping("/bike")
    public class BikeController {

    @Autowired
    private BikeService bikeService;

    @Autowired
    private CategoryService categoryService;



    //跳转到 bike管理页面
    @RequestMapping("/bikeManage")
    public String bikeManage(){
        return "bike";
    }

    //添加或更新bike
    @RequestMapping(value = "/addOrUpdate",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult addOrUpdate(MultipartFile bikeIcon, Bike bike, HttpServletRequest request,Integer bCount){
        if(bCount != null) return bikeService.add(bikeIcon,bike,request,bCount);
            return bikeService.update(bikeIcon,bike,request);
    }

    //showAll bike
    @RequestMapping("/showAll")
    @ResponseBody
    public Page<Bike> show(Integer page, Integer rows){
        return bikeService.findAllToPage(page,rows);
    }

    //删除单车和更新单车的分类
    @RequestMapping(value = "/remove",method = RequestMethod.POST)
    @ResponseBody
    public JsonResult remove(String bids,String cids){
        return bikeService.deleteById(bids,cids);
    }
    //点击修改回显bike弹出表单
    @RequestMapping("/loadForm")
    @ResponseBody
    public Bike loadForm(Integer bid){
        return bikeService.findById(bid);
    }

    //回显bike分类
    @RequestMapping(value = "/loadCategory",method = RequestMethod.POST)
    @ResponseBody
    public List<Category> loadCategory(){
        return categoryService.findAll();
    }



}

完整源码

觉得有用,记得一键三连哦!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/39915.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【计算机视觉(CV)】基于图像分类网络VGG实现中草药识别(二)

【计算机视觉&#xff08;CV&#xff09;】基于图像分类网络VGG实现中草药识别&#xff08;二&#xff09; 作者简介&#xff1a;在校大学生一枚&#xff0c;华为云享专家&#xff0c;阿里云专家博主&#xff0c;腾云先锋&#xff08;TDP&#xff09;成员&#xff0c;云曦智划项…

Graph (discrete mathematics)

In mathematics, and more specifically in graph theory, a graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense “related”. The objects correspond to mathematical abstractions called vertices (also called n…

餐厅食材采购信息管理系统的设计与实现

摘 要 网络的广泛应用给生活带来了十分的便利。所以把餐厅食材采购信息管理与现在网络相结合&#xff0c;利用JSP技术建设餐厅食材采购信息管理系统&#xff0c;实现餐厅食材采购的信息化。则对于进一步提高餐厅食材采购信息管理发展&#xff0c;丰富餐厅食材采购信息管理经验…

SpringBoot SpringBoot 原理篇 3 核心原理 3.5 启动流程【4】【5】【6】

SpringBoot 【黑马程序员SpringBoot2全套视频教程&#xff0c;springboot零基础到项目实战&#xff08;spring boot2完整版&#xff09;】 SpringBoot 原理篇 文章目录SpringBootSpringBoot 原理篇3 核心原理3.5 启动流程【4】【5】【6】3.5.1 看源码咯3.5.2 总结3 核心原理 …

剑指 Offer 10- I. 斐波那契数列

一、题目描述 写一个函数&#xff0c;输入 n &#xff0c;求斐波那契&#xff08;Fibonacci&#xff09;数列的第 n 项&#xff08;即 F(N)&#xff09;。斐波那契数列的定义如下&#xff1a; F(0) 0, F(1) 1 F(N) F(N - 1) F(N - 2), 其中 N > 1. 斐波那契数列由 0 和…

leetcode:6248. 统计中位数为 K 的子数组【问题转化 + 排序二分】

目录题目截图题目分析ac code总结题目截图 题目分析 找到k的位置然后一步步往左走&#xff0c;一步步往右走统计左边和右边的比当前k小的和比k大的lst [[small, big]]&#xff0c;分为left和right两部分可以先一侧的单独看small和big&#xff0c;找到big - small 0或者1的即…

NETCONF、RESTCONF和YANG

目录 一、NETCONF、RESTCONF和YANG是之间什么关系&#xff1f; 二、Netconf简介 2.1、一般使用工具&#xff1a;MG-Soft 简介 三、Netconf YANG 原理与实践 3.1、NETCONF协议 3.2、YANG建模语言 3.3、RESTCONF协议 网管协议&#xff1a; SNMP&#xff08;基于UDP&#…

C++员工考勤管理系统

目录 1 考勤管理系统的设计 1 1.1 需求分析 1 1.2 功能模块构成 1 1.3 数据库结构设计 2 2 考勤管理系统的实现 4 2.1 系统登陆功能的实现 4 2.2 基本信息管理模块 5 4.2.1 节假日信息管理 5 4.2.2 部门信息管理 6 4.2.3 员工信息管理 8 2.3 考勤管理模块 10 4.3.1 出勤信息管理…

怎么才能学会Python?

前言 新手小白学Python在还没有人带的情况下很容易半途而废&#xff0c;首先给大家总结一下我这两年Python的学习、开发经验遇到一些问题&#xff0c;大家首先得正视这些问题&#xff0c;因为超90%的人在初学Python时都会也遇到。 ①自学网上资料多&#xff0c;但质量参差不齐…

[报错解决](Error Creating bean with name ‘xxx‘)类问题解决思路

遇到Error Creating bean with name ’ 这类问题的解决思路 错误日志关键部分&#xff1a; org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name productHandler: Unsatisfied dependency expressed through field productMap…

【vue】实现打印功能

文章目录一、vue-print-nb【1】安装【2】引用【3】API【4】示例代码【5】vue-print-nb插件的一些优化【6】注意事项&#xff1a;二、print.js &#xff1a;解决了无法打印本地图片的问题【1】安装【2】使用【3】注意点&#xff1a;三、lodop打印功能&#xff08;可以指定打印机…

困于二手电商打转,转转拿什么“拯救世界”?

“双碳”战略下&#xff0c;转转集团也加入了&#xff0c;从数据上来看做得还可以。 都知道&#xff0c;近期转转集团试图向市场讲新故事。11月7日&#xff0c;转转集团在北京举办了品牌升级发布会&#xff0c;会上宣布其不再是一家互联网电商公司&#xff0c;而是定位在一家循…

爱心动画效果,教你如何更改颜色背景的爱心

如何运行该代码&#xff1f; 方法一&#xff1a; 1.创建一个.txt文件 2.把代码复制粘贴cv进去&#xff0c;并将其保存下来ctrls 3.改后缀名&#xff0c;将.txt改为.html 此时图标变了 4.此时点击&#xff0c;即可看见爱心效果 方法二&#xff1a; vscode dddd&#x1…

《数据结构》八大排序(详细图文分析讲解)

目录 排序 排序的应用 排序简介 排序的分类 排序算法的好坏评判 冒泡排序法 思路分析 代码实现 选择排序法 思路分析 代码实现 插入排序 思路分析 代码实现 希尔排序 思路分析 代码演示 归并排序法 思路分析 代码演示 快速排序 思路分析 代…

剑指Offer07.重建二叉树_解题思路代码实现

一、题目描述 输入某二叉树的前序遍历和中序遍历的结果&#xff0c;请构建该二叉树并返回其根节点。 假设输入的前序遍历和中序遍历的结果中都不含重复的数字。 二、示例输入输出 示例1&#xff1a; Input: preorder [3,9,20,15,7], inorder [9,3,15,20,7] Output: [3,9…

LeetCode 1752. 检查数组是否经排序和轮转得到

思路&#xff1a;两段单调性均为递增 最多出现一次前大后小 代码&#xff1a; class Solution { public:bool check(vector<int>& nums) {int res 0;for (int i 0; i < nums.size(); i) if (nums[i] > nums[(i 1) % nums.size()]) res ;return res < 1…

Java中next()和nextLine()的区别(为什么nextLine()输入回车没显示)

一、问题描述&#xff1a; 前几天遇到了一个小问题&#xff1a;为了简化&#xff0c;我手打了一段简单的代码&#xff0c;如下&#xff1a; import java.util.Scanner;public class Test01 {public static void main(String[] args) {Scanner sc new Scanner(System.in);Sys…

kafka使用场景与设计原理

目录 1 kafka的介绍 2 架构 2.1 工作流程 2.2 副本原理 2.3 分区和主题的关系 2.4 生产者 2.4.1 为什么分区-可以水平扩展 2.4.2 分区策略 2.5 消费者 2.5.1 消费方式 2.5.2 分区分配策略 2.6 数据可靠性保证 2.6.1 副本数据同步策略 2.6.2 ACK 应答机制 2.6.3 …

MATPOWER下载安装教程

MATPOWER安装包官网下载链接&#xff1a; https://matpower.org/download/ 一、从官网下载后解压 点开解压后的文件&#xff0c;可以看到MATPOWER的安装包实际为一个程序包&#xff1a; 二、将MATPOWER放在bin目录下 将MATPOWER文件复制在C:\Program Files (x86)\MATLAB\R2…

植树节种树-第12届蓝桥杯Scratch选拔赛真题精选

[导读]&#xff1a;超平老师计划推出Scratch蓝桥杯真题解析100讲&#xff0c;这是超平老师解读Scratch蓝桥真题系列的第87讲。 蓝桥杯选拔赛每一届都要举行4~5次&#xff0c;和省赛、国赛相比&#xff0c;题目要简单不少&#xff0c;再加上篇幅有限&#xff0c;因此我精挑细选…