博主介绍:从事软件开发10年之余,专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者
文末获取源码联系
精彩专栏推荐订阅 不然下次找不到哟
————————————————
计算机毕业设计《1000套》

目录

1、项目介绍及开发技术

1.1 项目介绍

1.2 开发技术

2、系统功能设计结构图

3、功能截图

3.1 前台功能

3.2 后台功能

4、数据库表结构设计

5、关键代码

5.1 美妆产品Controller模块 

5.2 美妆产品Service模块 

5.3 美妆产品ServiceImpl模块

5.4  美妆产品Dao模块

6、论文目录结构

7、源码获取


1、项目介绍及开发技术

1.1 项目介绍

在当今时代,美妆已成为许多人日常生活中不可或缺的一部分。随着消费者对美妆产品需求的日益增长,市场上涌现出了众多品牌和产品,使得消费者在选择时面临信息过载的挑战。为了帮助消费者更好地了解美妆产品,做出明智的购买决策,并提供一个平台供他们分享使用心得,我们设计并开发了一个美妆产品销售与分享平台。

背景:
美妆行业的快速发展带来了产品多样性和创新性的同时,也使得消费者在选择适合自己的产品时感到困惑。此外,消费者对于美妆产品的了解往往局限于品牌广告和有限的个人经验,缺乏一个全面、可靠的信息来源。因此,建立一个集产品销售、用户分享、资讯提供于一体的平台显得尤为重要。

目的意义:

  • 1. 提供全面信息:平台通过美妆产品展示和美妆资讯发布,为用户提供详尽的产品信息和行业动态,帮助他们做出更明智的选择。
  • 2. 增强用户互动:美妆分享和留言板功能鼓励用户分享使用体验和心得,增强社区互动,提升用户参与度和满意度。
  • 3. 优化购物体验:购物车和在线客服功能为用户提供便捷的购物流程和即时的客户支持,提升购物体验。
  • 4. 提高管理效率:后端管理系统为管理员提供了订单管理、用户资料管理等工具,提高了运营效率和管理水平。
  • 5. 支持决策制定:报表统计功能为平台运营者提供了销售数据和用户行为分析,支持更精准的市场策略和产品推荐。

综上所述,美妆产品销售与分享平台的设计与实现,不仅能够为消费者提供一个集购物、学习、分享于一体的平台,还能够为美妆品牌和销售者提供一个高效的销售和市场分析工具。通过技术手段优化美妆产品的销售和分享流程,该平台有望成为推动美妆行业电子商务发展的重要力量。
 

1.2 开发技术

类别技术名称用途/描述
开发语言Java一种广泛使用的面向对象编程语言。
框架Spring Boot简化Spring应用的初始搭建以及开发过程。
ORM工具MyBatis PlusMyBatis的增强工具,简化CRUD操作。
数据库MySQL流行的关系型数据库管理系统。
构建工具Maven项目管理和理解工具。
开发工具IDEA集成开发环境,用于代码编写和调试。
JDK版本JDK 1.8+Java开发工具包,提供运行Java程序所需的环境。
前端框架Vue用于构建用户界面的渐进式JavaScript框架。
UI框架Element UI基于Vue的桌面端组件库。
前端技术HTML网页内容的标准标记语言。
前端技术CSS描述HTML文档的样式。
前端技术JS网页脚本语言,用于实现网页的动态效果。

2、系统功能设计结构图

功能模块结构图

├── 前端
│   ├── 登录
│   ├── 注册
│   ├── 美妆产品
│   ├── 美妆分享
│   ├── 美妆资讯
│   ├── 留言板
│   ├── 购物车
│   ├── 在线客服
│   └── 个人中心

└── 后端
    ├── 登录
    ├── 首页
    │   └── 报表统计
    ├── 用户管理
    ├── 美妆分类管理
    ├── 美妆产品管理
    ├── 美妆分享管理
    ├── 进货信息管理
    ├── 留言板管理
    ├── 系统管理
    └── 订单管理

系统MVC框架,请求流程展示:

3、功能截图

3.1 前台功能

3.2 后台功能

 

4、数据库表结构设计

--
-- Table structure for table `config`
--

DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `name` varchar(100) NOT NULL COMMENT '配置参数名称',
  `value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
  `url` varchar(500) DEFAULT NULL COMMENT 'url',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `discussmeizhuangfenxiang`
--

DROP TABLE IF EXISTS `discussmeizhuangfenxiang`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `discussmeizhuangfenxiang` (
  `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',
  `avatarurl` longtext COMMENT '头像',
  `nickname` varchar(200) DEFAULT NULL COMMENT '用户名',
  `content` longtext NOT NULL COMMENT '评论内容',
  `reply` longtext COMMENT '回复内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='美妆分享评论表';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `jinhuoxinxi`
--

DROP TABLE IF EXISTS `jinhuoxinxi`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jinhuoxinxi` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `mingcheng` varchar(200) DEFAULT NULL COMMENT '名称',
  `meizhuangfenlei` varchar(200) DEFAULT NULL COMMENT '美妆分类',
  `alllimittimes` int(11) NOT NULL COMMENT '进货数量',
  `jinhuoshijian` datetime DEFAULT NULL COMMENT '进货时间',
  `gongyingshang` varchar(200) NOT NULL COMMENT '供应商',
  `jinhuoneirong` longtext COMMENT '进货内容',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8 COMMENT='进货信息';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `meizhuangfenlei`
--

DROP TABLE IF EXISTS `meizhuangfenlei`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `meizhuangfenlei` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `meizhuangfenlei` varchar(200) NOT NULL COMMENT '美妆分类',
  `image` longtext COMMENT '图片',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='美妆分类';
/*!40101 SET character_set_client = @saved_cs_client */;



--
-- Table structure for table `messages`
--

DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
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 '用户名',
  `avatarurl` longtext COMMENT '头像',
  `content` longtext NOT NULL COMMENT '留言内容',
  `cpicture` longtext COMMENT '留言图片',
  `reply` longtext COMMENT '回复内容',
  `rpicture` longtext COMMENT '回复图片',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=149 DEFAULT CHARSET=utf8 COMMENT='留言板';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `orders`
--

DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `orders` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `orderid` varchar(200) NOT NULL COMMENT '订单编号',
  `tablename` varchar(200) DEFAULT 'meizhuangchanpin' COMMENT '商品表名',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `goodid` bigint(20) NOT NULL COMMENT '商品id',
  `goodname` varchar(200) DEFAULT NULL COMMENT '商品名称',
  `picture` longtext COMMENT '商品图片',
  `buynumber` int(11) NOT NULL COMMENT '购买数量',
  `price` double NOT NULL DEFAULT '0' COMMENT '价格',
  `total` double NOT NULL DEFAULT '0' COMMENT '总价格',
  `type` int(11) DEFAULT '1' COMMENT '支付类型',
  `status` varchar(200) DEFAULT NULL COMMENT '状态',
  `address` varchar(200) DEFAULT NULL COMMENT '地址',
  `tel` varchar(200) DEFAULT NULL COMMENT '电话',
  `consignee` varchar(200) DEFAULT NULL COMMENT '收货人',
  `logistics` longtext COMMENT '物流',
  `remark` varchar(200) DEFAULT NULL COMMENT '备注',
  `sfsh` varchar(200) DEFAULT '' COMMENT '是否审核',
  `shhf` longtext COMMENT '审核回复',
  `role` varchar(200) DEFAULT NULL COMMENT '用户角色',
  PRIMARY KEY (`id`),
  UNIQUE KEY `orderid` (`orderid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `storeup`
--

DROP TABLE IF EXISTS `storeup`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `storeup` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `userid` bigint(20) NOT NULL COMMENT '用户id',
  `refid` bigint(20) DEFAULT NULL COMMENT '商品id',
  `tablename` varchar(200) DEFAULT NULL COMMENT '表名',
  `name` varchar(200) NOT NULL COMMENT '名称',
  `picture` longtext COMMENT '图片',
  `type` varchar(200) DEFAULT '1' COMMENT '类型',
  `inteltype` varchar(200) DEFAULT NULL COMMENT '推荐类型',
  `remark` varchar(200) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='收藏表';
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `username` varchar(100) NOT NULL COMMENT '用户名',
  `password` varchar(100) NOT NULL COMMENT '密码',
  `image` varchar(200) DEFAULT NULL COMMENT '头像',
  `role` varchar(100) DEFAULT '管理员' COMMENT '角色',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='用户表';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `yonghu`
--

DROP TABLE IF EXISTS `yonghu`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `yonghu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `zhanghao` varchar(200) NOT NULL COMMENT '账号',
  `mima` varchar(200) NOT NULL COMMENT '密码',
  `nicheng` varchar(200) NOT NULL COMMENT '昵称',
  `xingbie` varchar(200) DEFAULT NULL COMMENT '性别',
  `nianling` int(11) DEFAULT NULL COMMENT '年龄',
  `shoujihaoma` varchar(200) DEFAULT NULL COMMENT '手机号码',
  `touxiang` longtext COMMENT '头像',
  `money` double DEFAULT '0' COMMENT '余额',
  PRIMARY KEY (`id`),
  UNIQUE KEY `zhanghao` (`zhanghao`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='用户';
/*!40101 SET character_set_client = @saved_cs_client */;

5、关键代码

5.1 美妆产品Controller模块 


package com.controller;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.text.ParseException;
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.transaction.annotation.Transactional;
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.OrdersEntity;
import com.service.OrdersService;
import com.utils.UserBasedCollaborativeFiltering;

import com.entity.MeizhuangchanpinEntity;
import com.entity.view.MeizhuangchanpinView;

import com.service.MeizhuangchanpinService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MPUtil;
import com.utils.MapUtils;
import com.utils.CommonUtil;
import java.io.IOException;
import com.service.StoreupService;
import com.entity.StoreupEntity;

/**
 * 美妆产品
 * 后端接口
 * @author 
 * @email 
 */
@RestController
@RequestMapping("/meizhuangchanpin")
public class MeizhuangchanpinController {
    @Autowired
    private MeizhuangchanpinService meizhuangchanpinService;

    @Autowired
    private StoreupService storeupService;

    @Autowired
    private OrdersService ordersService;


    



    /**
     * 后台列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin,
                @RequestParam(required = false) Double pricestart,
                @RequestParam(required = false) Double priceend,
		HttpServletRequest request){
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
                if(pricestart!=null) ew.ge("price", pricestart);
                if(priceend!=null) ew.le("price", priceend);

		PageUtils page = meizhuangchanpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));

        return R.ok().put("data", page);
    }
    
    /**
     * 前台列表
     */
	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin, 
                @RequestParam(required = false) Double pricestart,
                @RequestParam(required = false) Double priceend,
		HttpServletRequest request){
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
                if(pricestart!=null) ew.ge("price", pricestart);
                if(priceend!=null) ew.le("price", priceend);

		PageUtils page = meizhuangchanpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));
        return R.ok().put("data", page);
    }



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

	 /**
     * 查询
     */
    @RequestMapping("/query")
    public R query(MeizhuangchanpinEntity meizhuangchanpin){
        EntityWrapper< MeizhuangchanpinEntity> ew = new EntityWrapper< MeizhuangchanpinEntity>();
 		ew.allEq(MPUtil.allEQMapPre( meizhuangchanpin, "meizhuangchanpin")); 
		MeizhuangchanpinView meizhuangchanpinView =  meizhuangchanpinService.selectView(ew);
		return R.ok("查询美妆产品成功").put("data", meizhuangchanpinView);
    }
	
    /**
     * 后台详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
		meizhuangchanpin.setClicknum(meizhuangchanpin.getClicknum()+1);
		meizhuangchanpinService.updateById(meizhuangchanpin);
        meizhuangchanpin = meizhuangchanpinService.selectView(new EntityWrapper<MeizhuangchanpinEntity>().eq("id", id));
        return R.ok().put("data", meizhuangchanpin);
    }

    /**
     * 前台详情
     */
	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
		meizhuangchanpin.setClicknum(meizhuangchanpin.getClicknum()+1);
		meizhuangchanpinService.updateById(meizhuangchanpin);
        meizhuangchanpin = meizhuangchanpinService.selectView(new EntityWrapper<MeizhuangchanpinEntity>().eq("id", id));
        return R.ok().put("data", meizhuangchanpin);
    }
    


    /**
     * 赞或踩
     */
    @RequestMapping("/thumbsup/{id}")
    public R vote(@PathVariable("id") String id,String type){
        MeizhuangchanpinEntity meizhuangchanpin = meizhuangchanpinService.selectById(id);
        if(type.equals("1")) {
        	meizhuangchanpin.setThumbsupnum(meizhuangchanpin.getThumbsupnum()+1);
        } else {
        	meizhuangchanpin.setCrazilynum(meizhuangchanpin.getCrazilynum()+1);
        }
        meizhuangchanpinService.updateById(meizhuangchanpin);
        return R.ok("投票成功");
    }

    /**
     * 后台保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(meizhuangchanpin);
        meizhuangchanpinService.insert(meizhuangchanpin);
        return R.ok();
    }
    
    /**
     * 前台保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
    	//ValidatorUtils.validateEntity(meizhuangchanpin);
        meizhuangchanpinService.insert(meizhuangchanpin);
        return R.ok();
    }





    /**
     * 修改
     */
    @RequestMapping("/update")
    @Transactional
    public R update(@RequestBody MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
        //ValidatorUtils.validateEntity(meizhuangchanpin);
        meizhuangchanpinService.updateById(meizhuangchanpin);//全部更新
        return R.ok();
    }



    

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        meizhuangchanpinService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
	
	/**
     * 前台智能排序
     */
	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request,String pre){
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
		while (it.hasNext()) {
			Map.Entry<String, Object> entry = it.next();
			String key = entry.getKey();
			String newKey = entry.getKey();
			if (pre.endsWith(".")) {
				newMap.put(pre + newKey, entry.getValue());
			} else if (StringUtils.isEmpty(pre)) {
				newMap.put(newKey, entry.getValue());
			} else {
				newMap.put(pre + "." + newKey, entry.getValue());
			}
		}
		params.put("sort", "clicknum");
        params.put("order", "desc");
		PageUtils page = meizhuangchanpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));
        return R.ok().put("data", page);
    }


    /**
     * 协同算法(基于用户的协同算法)
     */
    @RequestMapping("/autoSort2")
    public R autoSort2(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
        String userId = request.getSession().getAttribute("userId").toString();
        Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
        List<OrdersEntity> orders = ordersService.selectList(new EntityWrapper<OrdersEntity>());
        Map<String, Map<String, Double>> ratings = new HashMap<>();
        if(orders!=null && orders.size()>0) {
            for(OrdersEntity o : orders) {
                Map<String, Double> userRatings = null;
                if(ratings.containsKey(o.getUserid().toString())) {
                    userRatings = ratings.get(o.getUserid().toString());
                } else {
                    userRatings = new HashMap<>();
                    ratings.put(o.getUserid().toString(), userRatings);
                }
                if(userRatings.containsKey(o.getGoodid().toString())) {
                    userRatings.put(o.getGoodid().toString(), userRatings.get(o.getGoodid().toString())+1.0);
                } else {
                    userRatings.put(o.getGoodid().toString(), 1.0);
                }

            }
        }
        // 创建协同过滤对象
        UserBasedCollaborativeFiltering filter = new UserBasedCollaborativeFiltering(ratings);

        // 为指定用户推荐物品
        String targetUser = userId;
        int numRecommendations = limit;
        List<String> recommendations = filter.recommendItems(targetUser, numRecommendations);

        // 输出推荐结果
        System.out.println("Recommendations for " + targetUser + ":");
        for (String item : recommendations) {
            System.out.println(item);
        }

        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        ew.in("id", recommendations);
        if(recommendations!=null && recommendations.size()>0) {
            ew.last("order by FIELD(id, "+String.join(",", recommendations)+")");
        }

        PageUtils page = meizhuangchanpinService.queryPage(params, ew);
        List<MeizhuangchanpinEntity> pageList = (List<MeizhuangchanpinEntity>)page.getList();
        if(pageList.size()<limit) {
            int toAddNum = limit-pageList.size();
            ew = new EntityWrapper<MeizhuangchanpinEntity>();
            ew.notIn("id", recommendations);
            ew.orderBy("id", false);
            ew.last("limit "+toAddNum);
            pageList.addAll(meizhuangchanpinService.selectList(ew));
        } else if(pageList.size()>limit) {
            pageList = pageList.subList(0, limit);
        }
        page.setList(pageList);

        return R.ok().put("data", page);
    }




    /**
     * (按值统计)
     */
    @RequestMapping("/value/{xColumnName}/{yColumnName}")
    public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("yColumn", yColumnName);
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        List<Map<String, Object>> result = meizhuangchanpinService.selectValue(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }

    /**
     * (按值统计(多))
     */
    @RequestMapping("/valueMul/{xColumnName}")
    public R valueMul(@PathVariable("xColumnName") String xColumnName,@RequestParam String yColumnNameMul, HttpServletRequest request) {
        String[] yColumnNames = yColumnNameMul.split(",");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        for(int i=0;i<yColumnNames.length;i++) {
            params.put("yColumn", yColumnNames[i]);
            List<Map<String, Object>> result = meizhuangchanpinService.selectValue(params, ew);
            for(Map<String, Object> m : result) {
                for(String k : m.keySet()) {
                    if(m.get(k) instanceof Date) {
                        m.put(k, sdf.format((Date)m.get(k)));
                    }
                }
            }
            result2.add(result);
        }
        return R.ok().put("data", result2);
    }

    /**
     * (按值统计)时间统计类型
     */
    @RequestMapping("/value/{xColumnName}/{yColumnName}/{timeStatType}")
    public R valueDay(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("yColumn", yColumnName);
        params.put("timeStatType", timeStatType);
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        List<Map<String, Object>> result = meizhuangchanpinService.selectTimeStatValue(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }

    /**
     * (按值统计)时间统计类型(多)
     */
    @RequestMapping("/valueMul/{xColumnName}/{timeStatType}")
    public R valueMulDay(@PathVariable("xColumnName") String xColumnName, @PathVariable("timeStatType") String timeStatType,@RequestParam String yColumnNameMul,HttpServletRequest request) {
        String[] yColumnNames = yColumnNameMul.split(",");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("xColumn", xColumnName);
        params.put("timeStatType", timeStatType);
        List<List<Map<String, Object>>> result2 = new ArrayList<List<Map<String,Object>>>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        for(int i=0;i<yColumnNames.length;i++) {
            params.put("yColumn", yColumnNames[i]);
            List<Map<String, Object>> result = meizhuangchanpinService.selectTimeStatValue(params, ew);
            for(Map<String, Object> m : result) {
                for(String k : m.keySet()) {
                    if(m.get(k) instanceof Date) {
                        m.put(k, sdf.format((Date)m.get(k)));
                    }
                }
            }
            result2.add(result);
        }
        return R.ok().put("data", result2);
    }

    /**
     * 分组统计
     */
    @RequestMapping("/group/{columnName}")
    public R group(@PathVariable("columnName") String columnName,HttpServletRequest request) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("column", columnName);
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        List<Map<String, Object>> result = meizhuangchanpinService.selectGroup(params, ew);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        for(Map<String, Object> m : result) {
            for(String k : m.keySet()) {
                if(m.get(k) instanceof Date) {
                    m.put(k, sdf.format((Date)m.get(k)));
                }
            }
        }
        return R.ok().put("data", result);
    }




    /**
     * 总数量
     */
    @RequestMapping("/count")
    public R count(@RequestParam Map<String, Object> params,MeizhuangchanpinEntity meizhuangchanpin, HttpServletRequest request){
        EntityWrapper<MeizhuangchanpinEntity> ew = new EntityWrapper<MeizhuangchanpinEntity>();
        int count = meizhuangchanpinService.selectCount(MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, meizhuangchanpin), params), params));
        return R.ok().put("data", count);
    }



}

5.2 美妆产品Service模块 

 package com.service;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.IService;
import com.utils.PageUtils;
import com.entity.MeizhuangchanpinEntity;
import java.util.List;
import java.util.Map;
import com.entity.vo.MeizhuangchanpinVO;
import org.apache.ibatis.annotations.Param;
import com.entity.view.MeizhuangchanpinView;


/**
 * 美妆产品
 *
 * @author 
 * @email 
 */
public interface MeizhuangchanpinService extends IService<MeizhuangchanpinEntity> {

    PageUtils queryPage(Map<String, Object> params);
    
   	List<MeizhuangchanpinVO> selectListVO(Wrapper<MeizhuangchanpinEntity> wrapper);
   	
   	MeizhuangchanpinVO selectVO(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);
   	
   	List<MeizhuangchanpinView> selectListView(Wrapper<MeizhuangchanpinEntity> wrapper);
   	
   	MeizhuangchanpinView selectView(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);
   	
   	PageUtils queryPage(Map<String, Object> params,Wrapper<MeizhuangchanpinEntity> wrapper);

   	

    List<Map<String, Object>> selectValue(Map<String, Object> params,Wrapper<MeizhuangchanpinEntity> wrapper);

    List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params,Wrapper<MeizhuangchanpinEntity> wrapper);

    List<Map<String, Object>> selectGroup(Map<String, Object> params,Wrapper<MeizhuangchanpinEntity> wrapper);



}

5.3 美妆产品ServiceImpl模块


package com.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;


import com.dao.MeizhuangchanpinDao;
import com.entity.MeizhuangchanpinEntity;
import com.service.MeizhuangchanpinService;
import com.entity.vo.MeizhuangchanpinVO;
import com.entity.view.MeizhuangchanpinView;

@Service("meizhuangchanpinService")
public class MeizhuangchanpinServiceImpl extends ServiceImpl<MeizhuangchanpinDao, MeizhuangchanpinEntity> implements MeizhuangchanpinService {
	
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<MeizhuangchanpinEntity> page = this.selectPage(
                new Query<MeizhuangchanpinEntity>(params).getPage(),
                new EntityWrapper<MeizhuangchanpinEntity>()
        );
        return new PageUtils(page);
    }
    
    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<MeizhuangchanpinEntity> wrapper) {
		  Page<MeizhuangchanpinView> page =new Query<MeizhuangchanpinView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}

    
    @Override
	public List<MeizhuangchanpinVO> selectListVO(Wrapper<MeizhuangchanpinEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}
	
	@Override
	public MeizhuangchanpinVO selectVO(Wrapper<MeizhuangchanpinEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}
	
	@Override
	public List<MeizhuangchanpinView> selectListView(Wrapper<MeizhuangchanpinEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public MeizhuangchanpinView selectView(Wrapper<MeizhuangchanpinEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}

    @Override
    public List<Map<String, Object>> selectValue(Map<String, Object> params, Wrapper<MeizhuangchanpinEntity> wrapper) {
        return baseMapper.selectValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectTimeStatValue(Map<String, Object> params, Wrapper<MeizhuangchanpinEntity> wrapper) {
        return baseMapper.selectTimeStatValue(params, wrapper);
    }

    @Override
    public List<Map<String, Object>> selectGroup(Map<String, Object> params, Wrapper<MeizhuangchanpinEntity> wrapper) {
        return baseMapper.selectGroup(params, wrapper);
    }




}

5.4  美妆产品Dao模块


package com.dao;

import com.entity.MeizhuangchanpinEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import org.apache.ibatis.annotations.Param;
import com.entity.vo.MeizhuangchanpinVO;
import com.entity.view.MeizhuangchanpinView;


/**
 * 美妆产品
 * 
 * @author 
 * @email 
 */
public interface MeizhuangchanpinDao extends BaseMapper<MeizhuangchanpinEntity> {
	
	List<MeizhuangchanpinVO> selectListVO(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);
	
	MeizhuangchanpinVO selectVO(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);
	
	List<MeizhuangchanpinView> selectListView(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);

	List<MeizhuangchanpinView> selectListView(Pagination page,@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);

	
	MeizhuangchanpinView selectView(@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);
	

    List<Map<String, Object>> selectValue(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);

    List<Map<String, Object>> selectTimeStatValue(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);

    List<Map<String, Object>> selectGroup(@Param("params") Map<String, Object> params,@Param("ew") Wrapper<MeizhuangchanpinEntity> wrapper);



}

6、论文目录结构

摘要... I

Abstract... II

1 绪论... 1
   1.1 项目简介... 1
   1.2 调查研究... 1
       1.2.1 研究背景及意义... 1
       1.2.2 国内外研究现状... 2
       1.2.3 研究主要内容... 2
   1.3 论文的章节安排... 3

2 系统相关技术介绍... 4
   2.1 Java语言... 4
   2.2 SpringBoot框架... 4
   2.3 Vue框架... 4
   2.4 MySQL数据库... 4

3 系统需求分析... 6
   3.1 可行性分析... 6
       3.1.1 技术可行性... 6
       3.1.2 经济可行性... 6
       3.1.3 操作可行性... 6
   3.2 系统功能需求... 6
       3.2.1 用户端功能需求... 6
       3.2.2 XX端功能需求... 6
       3.2.3 管理员端功能需求... 6
   3.3 系统性能需求... 6

4 系统总体设计... 7
   4.1 系统总体架构设计... 7
   4.2 系统的功能设计... 7
   4.3 数据库设计... 7
       4.3.1 概念设计E-R图... 7
       4.3.2 逻辑设计关系模式... 7
       4.3.3 数据库物理设计... 7

5 系统详细实现... 14
   5.1 系统实现环境... 14
   5.2 用户端... 14
       5.2.1 登录页面... 14
       5.2.2 注册页面... 14
       5.2.3 XXXX页面... 14
       5.2.4 XXXX页面... 14
       5.2.5 XXXX页面... 14
   5.3 XXXX端... 15
       5.3.1 XXXX页面... 15
       5.3.2 XXXX页面... 15
       5.3.3 XXXX页面... 15
       5.3.4 XXXX页面... 15
   5.4 管理端... 15
       5.4.1 用户管理页面... 15
       5.4.2 XXXX页面... 15
       5.4.3 XXXX页面... 16
       5.4.4 XXXX页面... 16

6 系统测试... 16
   6.1 测试目的... 16
   6.2 测试方法... 16
   6.3 测试用例... 16
       6.3.1 XXXX测试... 16
       6.3.2 XXXX测试... 16
   6.4 测试结果... 16

结论... 17

参考文献... 18

致谢... 19

更多源码:

计算机毕业设计选题1000套等你来!!!

7、源码获取

感谢大家的阅读,如有不懂的问题可以评论区交流或私聊!

喜欢文章可以点赞、收藏、关注、评论

下方联系方式获取源码

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部