Compare commits
No commits in common. "cdaf518401550f1a4b891546ec4fb52b5f222b84" and "f3bcd3aa0cb6b792698253d58941717855285550" have entirely different histories.
cdaf518401
...
f3bcd3aa0c
@ -39,13 +39,13 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: zack
|
||||
password: zack0430
|
||||
username: crmeb
|
||||
password: 111111
|
||||
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: hat123
|
||||
password: 111111
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 15 #默认数据库
|
||||
jedis:
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
package com.zbkj.common.model.product;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
* +----------------------------------------------------------------------
|
||||
@ -132,8 +130,7 @@ public class StoreProduct implements Serializable {
|
||||
@ApiModelProperty(value = "砍价状态 0未开启 1开启")
|
||||
private Boolean isBargain;
|
||||
|
||||
//为你推荐使用该字段
|
||||
@ApiModelProperty(value = "是否优品推荐 0false不推荐 1true推荐")
|
||||
@ApiModelProperty(value = "是否优品推荐")
|
||||
private Boolean isGood;
|
||||
|
||||
@ApiModelProperty(value = "是否单独分佣")
|
||||
@ -169,22 +166,4 @@ public class StoreProduct implements Serializable {
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
@TableField(exist = false)
|
||||
private String content;
|
||||
|
||||
//新增字段
|
||||
@ApiModelProperty(value = "开始售卖时间")
|
||||
private DateTime beginTime;
|
||||
|
||||
@ApiModelProperty(value = "结束售卖时间")
|
||||
private DateTime endTime;
|
||||
|
||||
@ApiModelProperty(value = "搜索状态:0=售卖中,1=上新预告,2=团购结束")
|
||||
private String searchStatus;
|
||||
|
||||
@ApiModelProperty(value = "水果规格")
|
||||
private String size;
|
||||
|
||||
@ApiModelProperty(value = "水果尺寸")
|
||||
private String dimensions;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
package com.zbkj.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 为你推荐分页查询
|
||||
* @Author Administrator
|
||||
* @Date 2025/4/28 11:35
|
||||
*/
|
||||
@Data
|
||||
public class ProductSuggestPage {
|
||||
//当前页
|
||||
private Long currentPage;
|
||||
//页容
|
||||
private Long pageSize;
|
||||
//搜索词商品名
|
||||
private String storeName;
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
package com.zbkj.front.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
@ -9,7 +8,6 @@ import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -44,13 +42,11 @@ public class ProductController {
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
* 参数暂定分页对象
|
||||
*/
|
||||
@ApiOperation(value = "为你推荐")
|
||||
@ApiOperation(value = "热门商品推荐")
|
||||
@RequestMapping(value = "/pageList/suggest", method = RequestMethod.GET)
|
||||
public CommonResult<Object> getProductSuggestionList(ProductSuggestPage param) {
|
||||
IPage<StoreProduct> list = productService.getProductSuggestionList(param);
|
||||
return CommonResult.success(list,"查询成功!");
|
||||
public CommonResult<CommonPage<IndexProductResponse>> getProductSuggestionList(@RequestParam String searchWord) {
|
||||
return CommonResult.success(productService.getProductSuggestionList(searchWord));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,16 +1,13 @@
|
||||
package com.zbkj.front.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.page.CommonPage;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.ProductListRequest;
|
||||
import com.zbkj.common.request.ProductRequest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -26,14 +23,7 @@ import java.util.List;
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
public interface ProductService extends IService<StoreProduct> {
|
||||
|
||||
/*
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
//为你推荐
|
||||
IPage<StoreProduct> getProductSuggestionList(ProductSuggestPage param);
|
||||
public interface ProductService {
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
@ -114,5 +104,10 @@ public interface ProductService extends IService<StoreProduct> {
|
||||
*/
|
||||
List<StoreProduct> getLeaderboard();
|
||||
|
||||
|
||||
/**
|
||||
* !!!wby cc!!!
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
CommonPage<IndexProductResponse> getProductSuggestionList(String searchWord);
|
||||
}
|
||||
|
||||
@ -3,13 +3,11 @@ package com.zbkj.front.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.zbkj.common.constants.CategoryConstants;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.constants.RedisConstatns;
|
||||
import com.zbkj.common.constants.SysConfigConstants;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.model.product.StoreProductAttr;
|
||||
@ -26,12 +24,9 @@ import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.common.vo.CategoryTreeVo;
|
||||
import com.zbkj.common.vo.MyRecord;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import com.zbkj.front.service.ProductService;
|
||||
import com.zbkj.service.dao.StoreProductDao;
|
||||
import com.zbkj.service.delete.ProductUtils;
|
||||
import com.zbkj.service.service.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -55,7 +50,7 @@ import java.util.List;
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
@Service
|
||||
public class ProductServiceImpl extends ServiceImpl<StoreProductDao,StoreProduct> implements ProductService {
|
||||
public class ProductServiceImpl implements ProductService {
|
||||
|
||||
@Autowired
|
||||
private StoreProductService storeProductService;
|
||||
@ -96,24 +91,6 @@ public class ProductServiceImpl extends ServiceImpl<StoreProductDao,StoreProduct
|
||||
@Autowired
|
||||
private UserVisitRecordService userVisitRecordService;
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
public IPage<StoreProduct> getProductSuggestionList(ProductSuggestPage param) {
|
||||
//分页查询
|
||||
IPage<StoreProduct> page = new Page<>(param.getCurrentPage(), param.getPageSize());
|
||||
//构造查询条件
|
||||
QueryWrapper<StoreProduct> query = new QueryWrapper<>();
|
||||
if(StringUtils.isNotEmpty(param.getStoreName())){
|
||||
query.lambda().like(StoreProduct::getStoreName, param.getStoreName());
|
||||
}
|
||||
//按照上架时间降序排列
|
||||
query.lambda().orderByDesc(StoreProduct::getBeginTime);
|
||||
return this.baseMapper.selectPage(page, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类
|
||||
* @return List<CategoryTreeVo>
|
||||
@ -561,8 +538,5 @@ public class ProductServiceImpl extends ServiceImpl<StoreProductDao,StoreProduct
|
||||
return storeProductService.getLeaderboard();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -34,12 +34,12 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/crmeb?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
|
||||
username: zack
|
||||
password: zack0430
|
||||
username: crmeb
|
||||
password: 111111
|
||||
redis:
|
||||
host: 127.0.0.1 #地址
|
||||
port: 6379 #端口
|
||||
password: hat123
|
||||
password: 111111
|
||||
timeout: 30000 # 连接超时时间(毫秒)
|
||||
database: 3 #默认数据库
|
||||
jedis:
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
package com.zbkj.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zbkj.common.model.product.StoreProduct;
|
||||
import com.zbkj.common.vo.ProductSuggestPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 商品表 Mapper 接口
|
||||
@ -19,11 +16,5 @@ import org.apache.ibatis.annotations.Param;
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
public interface StoreProductDao extends BaseMapper<StoreProduct> {
|
||||
/*
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
//为你推荐
|
||||
IPage<StoreProduct> getProductSuggestionList(IPage<StoreProduct> page,@Param("parm") ProductSuggestPage param);
|
||||
|
||||
}
|
||||
|
||||
@ -2,12 +2,4 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zbkj.service.dao.StoreProductDao">
|
||||
|
||||
<!--为你推荐-->
|
||||
<select id="getProductSuggestionList" resultType="com.zbkj.common.model.product.StoreProduct">
|
||||
select p.* from crmeb.eb_store_product as p
|
||||
where is_good = true and search_status = '0' and stock > 0
|
||||
<if test="param.storeName != '' and param.storeName != null">
|
||||
and p.store_name like CONCAT('%',#{param.storeName},'%')
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user