最适合学生最全面的销售管理系统,SSM+VUE的前后端分离的项目,使用IDEA开发的

发布于:2022-12-31 ⋅ 阅读:(259) ⋅ 点赞:(0)

基于SSM+VUE的销售系统

一、系统截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

二、系统架构

系统架构:本系统使用Java作为主要的编程语言编程开发,后台以SSM框架作为主要的技术支撑,数据库采用采用MySQL,前端采用VUE同时配合JavaScript语言,同时引入百度的Ueditor编辑器丰富页面的内容。
开发环境:JDK8+IDEA+MySQL8.0

功能需求:
基于SSM的药品销售管理系统,用于药店的经营管理中,系统分为前台的服务以及后台的管理,前台的服务是用户操作的,后台的管理员是药店的经营者,用户可以查看以及订购药品信息,查看药品资讯,留言,在线问药等,管理员管理用户信息,药品信息,订单信息,回复留言等。
前台服务
首页 查看热门的药品信息,资讯信息
药品信息 查看药品的列表信息,支持按照药品的名称,类型,批次号等进行搜索
药品详情 查看药品的基本信息包括,类型,生产时间,生产厂商,药品的使用事项等。
药品资讯 查看热门的药品新闻资讯信息
登陆与注册 用户可以在网站注册信息后进行登录
留言反馈 用户登陆后可以向管理员留言
收藏评价 登陆后可以对药品进行收藏以及评价
在线问药 登录后可以询问管理员药品的注意事情
个人中心 查看以及修改个人的基本资料信息,密码信息
我的订单 查看管理个人的订单信息,包括未支付,已支付,已发货,已完成,已退款,已取消等
我的地址 对个人的收货地址进行管理
我的收藏 查看我收藏的药品列表

个人后台:
个人中心管理 修改个人的基本信息以及登录信息
留言板管理 管理个人留言的信息
我的收藏管理 管理收藏药品的列表

管理员后台:
个人中心管理 修改管理员的基本信息以及登录信息
用户管理 管理前台用户注册的基本信息,支持修改,删除,分页查询,条件查询
药品信息管理 管理药品的基本信息,支持新增,修改,删除,分夜查询,条件查询
销售登记管理 对每一种药品的销售信息进行登记,包括销售额,成本,利润等信息
留言管理 对用户的留言信息进行查看,支持回复,删除,分页查询,条件查询等
药品资讯管理 管理药品的资讯信息,支持新增,修改,删除,分夜查询,条件查询
在线问药 管理前台用户的咨询信息,及时进行回复
订单管理 对用户的订单订单信息进行管理,订单分为未支付,已支付,已发货,已完成,已退款,已取消,根据管理员的操作进行订单状态的变更。

三、下载链接

点击下载

更多关于项目的描述可以点击基于SSM+VUE的销售管理系统

四、核心代码

controller代码
package com.controller;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;

import com.entity.AddressEntity;
import com.entity.view.AddressView;

import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;


/**
 * 地址
 * 后端接口
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private AddressService addressService;
    


    /**
     * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,AddressEntity address, 
		HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
    		address.setUserid((Long)request.getSession().getAttribute("userId"));
    	}

        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
		PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
        return R.ok().put("data", page);
    }
    
    /**
     * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,AddressEntity address, 
		HttpServletRequest request){
    	if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
    		address.setUserid((Long)request.getSession().getAttribute("userId"));
    	}

        EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
		PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/lists")
    public R list( AddressEntity address){
       	EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();
      	ew.allEq(MPUtil.allEQMapPre( address, "address")); 
        return R.ok().put("data", addressService.selectListView(ew));
    }

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(AddressEntity address){
        EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();
 		ew.allEq(MPUtil.allEQMapPre( address, "address")); 
		AddressView addressView =  addressService.selectView(ew);
		return R.ok("查询地址成功").put("data", addressView);
    }
	
    /**
     * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }

    /**
     * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        AddressEntity address = addressService.selectById(id);
        return R.ok().put("data", address);
    }
    



    /**
     * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody AddressEntity address, HttpServletRequest request){
    	address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(address);
    	address.setUserid((Long)request.getSession().getAttribute("userId"));
		Long userId = (Long)request.getSession().getAttribute("userId");
    	if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
    	}
    	address.setUserid(userId);

        addressService.insert(address);
        return R.ok();
    }
    
    /**
     * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody AddressEntity address, HttpServletRequest request){
    	address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(address);
    	address.setUserid((Long)request.getSession().getAttribute("userId"));
		Long userId = (Long)request.getSession().getAttribute("userId");
    	if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));
    	}
    	address.setUserid(userId);

        addressService.insert(address);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody AddressEntity address, HttpServletRequest request){
        //ValidatorUtils.validateEntity(address);
        if(address.getIsdefault().equals("是")) {
    		addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));
    	}
        addressService.updateById(address);//全部更新
        return R.ok();
    }
    
    /**
     * 获取默认地址
     */
    @RequestMapping("/default")
    public R defaultAddress(HttpServletRequest request){
    	Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));
        AddressEntity address = addressService.selectOne(wrapper);
        return R.ok().put("data", address);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        addressService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /**
     * 提醒接口
     */
	@RequestMapping("/remind/{columnName}/{type}")
	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
		map.put("column", columnName);
		map.put("type", type);
		
		if(type.equals("2")) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			Calendar c = Calendar.getInstance();
			Date remindStartDate = null;
			Date remindEndDate = null;
			if(map.get("remindstart")!=null) {
				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
				c.setTime(new Date()); 
				c.add(Calendar.DAY_OF_MONTH,remindStart);
				remindStartDate = c.getTime();
				map.put("remindstart", sdf.format(remindStartDate));
			}
			if(map.get("remindend")!=null) {
				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
				c.setTime(new Date());
				c.add(Calendar.DAY_OF_MONTH,remindEnd);
				remindEndDate = c.getTime();
				map.put("remindend", sdf.format(remindEndDate));
			}
		}
		
		Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();
		if(map.get("remindstart")!=null) {
			wrapper.ge(columnName, map.get("remindstart"));
		}
		if(map.get("remindend")!=null) {
			wrapper.le(columnName, map.get("remindend"));
		}
		if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
    		wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
    	}


		int count = addressService.selectCount(wrapper);
		return R.ok().put("count", count);
	}
}

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `address` varchar(200) NOT NULL COMMENT '地址',
  `name` varchar(200) NOT NULL COMMENT '收货人',
  `phone` varchar(200) NOT NULL COMMENT '电话',
  `isdefault` varchar(200) NOT NULL COMMENT '是否默认地址[/]',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='地址';

-- ----------------------------
-- Records of address
-- ----------------------------
INSERT INTO `address` VALUES ('1', '2022-01-27 16:44:50', '1', '宇宙银河系金星1', '金某', '13823888881', '是');
INSERT INTO `address` VALUES ('2', '2022-01-27 16:44:50', '2', '宇宙银河系木星1', '木某', '13823888882', '是');
INSERT INTO `address` VALUES ('3', '2022-01-27 16:44:50', '3', '宇宙银河系水星1', '水某', '13823888883', '是');
INSERT INTO `address` VALUES ('4', '2022-01-27 16:44:50', '4', '宇宙银河系火星1', '火某', '13823888884', '是');
INSERT INTO `address` VALUES ('5', '2022-01-27 16:44:50', '5', '宇宙银河系土星1', '土某', '13823888885', '是');
INSERT INTO `address` VALUES ('6', '2022-01-27 16:44:50', '6', '宇宙银河系月球1', '月某', '13823888886', '是');

-- ----------------------------
-- Table structure for caiwutongji
-- ----------------------------
DROP TABLE IF EXISTS `caiwutongji`;
CREATE TABLE `caiwutongji` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `tongjibianhao` varchar(200) DEFAULT NULL COMMENT '统计编号',
  `jinhuozonge` float DEFAULT NULL COMMENT '进货总额',
  `xiaoshoushouru` float DEFAULT NULL COMMENT '销售收入',
  `chunlirun` varchar(200) DEFAULT NULL COMMENT '纯利润',
  `dengjiriqi` date DEFAULT NULL COMMENT '登记日期',
  `beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`),
  UNIQUE KEY `tongjibianhao` (`tongjibianhao`)
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8 COMMENT='财务统计';

-- ----------------------------
-- Records of caiwutongji
-- ----------------------------
INSERT INTO `caiwutongji` VALUES ('51', '2022-01-27 16:44:50', '统计编号1', '1', '1', '纯利润1', '2021-05-06', '备注1');
INSERT INTO `caiwutongji` VALUES ('52', '2022-01-27 16:44:50', '统计编号2', '2', '2', '纯利润2', '2021-05-06', '备注2');
INSERT INTO `caiwutongji` VALUES ('53', '2022-01-27 16:44:50', '统计编号3', '3', '3', '纯利润3', '2021-05-06', '备注3');
INSERT INTO `caiwutongji` VALUES ('54', '2022-01-27 16:44:50', '统计编号4', '4', '4', '纯利润4', '2021-05-06', '备注4');
INSERT INTO `caiwutongji` VALUES ('55', '2022-01-27 16:44:50', '统计编号5', '5', '5', '纯利润5', '2021-05-06', '备注5');
INSERT INTO `caiwutongji` VALUES ('56', '2022-01-27 16:44:50', '统计编号6', '6', '6', '纯利润6', '2021-05-06', '备注6');

-- ----------------------------
-- Table structure for cart
-- ----------------------------
DROP TABLE IF EXISTS `cart`;
CREATE TABLE `cart` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `tablename` varchar(200) DEFAULT 'yaopinxinxi' COMMENT '商品表名',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `goodid` bigint(20) NOT NULL COMMENT '商品id',
  `goodname` varchar(200) DEFAULT NULL COMMENT '商品名称',
  `picture` varchar(200) DEFAULT NULL COMMENT '图片',
  `buynumber` int(11) NOT NULL COMMENT '购买数量',
  `price` float DEFAULT NULL COMMENT '单价',
  `discountprice` float DEFAULT NULL COMMENT '会员价',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='购物车表';

-- ----------------------------
-- Records of cart
-- ----------------------------

-- ----------------------------
-- Table structure for chat
-- ----------------------------
DROP TABLE IF EXISTS `chat`;
CREATE TABLE `chat` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `adminid` bigint(20) DEFAULT NULL COMMENT '管理员id',
  `ask` longtext COMMENT '提问',
  `reply` longtext COMMENT '回复',
  `isreply` int(11) DEFAULT NULL COMMENT '是否回复',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COMMENT='在线问药';

-- ----------------------------
-- Records of chat
-- ----------------------------
INSERT INTO `chat` VALUES ('61', '2022-01-27 16:44:50', '1', '1', '提问1', '回复1', '1');
INSERT INTO `chat` VALUES ('62', '2022-01-27 16:44:50', '2', '2', '提问2', '回复2', '2');
INSERT INTO `chat` VALUES ('63', '2022-01-27 16:44:50', '3', '3', '提问3', '回复3', '3');
INSERT INTO `chat` VALUES ('64', '2022-01-27 16:44:50', '4', '4', '提问4', '回复4', '4');
INSERT INTO `chat` VALUES ('65', '2022-01-27 16:44:50', '5', '5', '提问5', '回复5', '5');
INSERT INTO `chat` VALUES ('66', '2022-01-27 16:44:50', '6', '6', '提问6', '回复6', '6');

-- ----------------------------
-- Table structure for config
-- ----------------------------
DROP TABLE IF EXISTS `config`;
CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) NOT NULL COMMENT '配置参数名称',
  `value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='配置文件';

-- ----------------------------
-- Records of config
-- ----------------------------
INSERT INTO `config` VALUES ('1', 'picture1', 'http://localhost:8080/ssmx88ld/upload/picture1.jpg');
INSERT INTO `config` VALUES ('2', 'picture2', 'http://localhost:8080/ssmx88ld/upload/picture2.jpg');
INSERT INTO `config` VALUES ('3', 'picture3', 'http://localhost:8080/ssmx88ld/upload/picture3.jpg');
INSERT INTO `config` VALUES ('6', 'homepage', null);

-- ----------------------------
-- Table structure for discussyaopinxinxi
-- ----------------------------
DROP TABLE IF EXISTS `discussyaopinxinxi`;
CREATE TABLE `discussyaopinxinxi` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `refid` bigint(20) NOT NULL COMMENT '关联表id',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
  `content` longtext NOT NULL COMMENT '评论内容',
  `reply` longtext COMMENT '回复内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8 COMMENT='药品信息评论表';

-- ----------------------------
-- Records of discussyaopinxinxi
-- ----------------------------
INSERT INTO `discussyaopinxinxi` VALUES ('131', '2022-01-27 16:44:50', '1', '1', '用户名1', '评论内容1', '回复内容1');
INSERT INTO `discussyaopinxinxi` VALUES ('132', '2022-01-27 16:44:50', '2', '2', '用户名2', '评论内容2', '回复内容2');
INSERT INTO `discussyaopinxinxi` VALUES ('133', '2022-01-27 16:44:50', '3', '3', '用户名3', '评论内容3', '回复内容3');
INSERT INTO `discussyaopinxinxi` VALUES ('134', '2022-01-27 16:44:50', '4', '4', '用户名4', '评论内容4', '回复内容4');
INSERT INTO `discussyaopinxinxi` VALUES ('135', '2022-01-27 16:44:50', '5', '5', '用户名5', '评论内容5', '回复内容5');
INSERT INTO `discussyaopinxinxi` VALUES ('136', '2022-01-27 16:44:50', '6', '6', '用户名6', '评论内容6', '回复内容6');

-- ----------------------------
-- Table structure for messages
-- ----------------------------
DROP TABLE IF EXISTS `messages`;
CREATE TABLE `messages` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `userid` bigint(20) NOT NULL COMMENT '留言人id',
  `username` varchar(200) DEFAULT NULL COMMENT '用户名',
  `content` longtext NOT NULL COMMENT '留言内容',
  `reply` longtext COMMENT '回复内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8 COMMENT='留言板';

-- ----------------------------
-- Records of messages
-- ----------------------------
INSERT INTO `messages` VALUES ('121', '2022-01-27 16:44:50', '1', '用户名1', '留言内容1', '回复内容1');
INSERT INTO `messages` VALUES ('122', '2022-01-27 16:44:50', '2', '用户名2', '留言内容2', '回复内容2');
INSERT INTO `messages` VALUES ('123', '2022-01-27 16:44:50', '3', '用户名3', '留言内容3', '回复内容3');
INSERT INTO `messages` VALUES ('124', '2022-01-27 16:44:50', '4', '用户名4', '留言内容4', '回复内容4');
INSERT INTO `messages` VALUES ('125', '2022-01-27 16:44:50', '5', '用户名5', '留言内容5', '回复内容5');
INSERT INTO `messages` VALUES ('126', '2022-01-27 16:44:50', '6', '用户名6', '留言内容6', '回复内容6');

-- ----------------------------
-- Table structure for news
-- ----------------------------
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `title` varchar(200) NOT NULL COMMENT '标题',
  `introduction` longtext COMMENT '简介',
  `picture` varchar(200) NOT NULL COMMENT '图片',
  `content` longtext NOT NULL COMMENT '内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8 COMMENT='药品资讯';

-- ----------------------------
-- Records of news
-- ----------------------------
INSERT INTO `news` VALUES ('111', '2022-01-27 16:44:50', '标题1', '简介1', 'http://localhost:8080/ssmx88ld/upload/news_picture1.jpg', '内容1');
INSERT INTO `news` VALUES ('112', '2022-01-27 16:44:50', '标题2', '简介2', 'http://localhost:8080/ssmx88ld/upload/news_picture2.jpg', '内容2');
INSERT INTO `news` VALUES ('113', '2022-01-27 16:44:50', '标题3', '简介3', 'http://localhost:8080/ssmx88ld/upload/news_picture3.jpg', '内容3');
INSERT INTO `news` VALUES ('114', '2022-01-27 16:44:50', '标题4', '简介4', 'http://localhost:8080/ssmx88ld/upload/news_picture4.jpg', '内容4');
INSERT INTO `news` VALUES ('115', '2022-01-27 16:44:50', '标题5', '简介5', 'http://localhost:8080/ssmx88ld/upload/news_picture5.jpg', '内容5');
INSERT INTO `news` VALUES ('116', '2022-01-27 16:44:50', '标题6', '简介6', 'http://localhost:8080/ssmx88ld/upload/news_picture6.jpg', '内容6');


网站公告

今日签到

点亮在社区的每一天
去签到