为你推荐2.0
This commit is contained in:
parent
cdaf518401
commit
333857d199
@ -7,7 +7,7 @@ crmeb:
|
||||
wechat-js-api-beta: true #微信js api是否是beta版本
|
||||
asyncConfig: false #是否同步config表数据到redis
|
||||
asyncWeChatProgramTempList: false #是否同步小程序公共模板库
|
||||
imagePath: /当前项目更根目录的素材文件(绝对路径)/crmebimage/ # 服务器图片路径配置 斜杠结尾
|
||||
imagePath: /workspace/pro/Crmeb/crmeb/crmebimage/ # 服务器图片路径配置 斜杠结尾
|
||||
database: mysql
|
||||
|
||||
# 配置端口
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
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;
|
||||
@ -13,6 +12,7 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品表
|
||||
@ -132,8 +132,7 @@ public class StoreProduct implements Serializable {
|
||||
@ApiModelProperty(value = "砍价状态 0未开启 1开启")
|
||||
private Boolean isBargain;
|
||||
|
||||
//为你推荐使用该字段
|
||||
@ApiModelProperty(value = "是否优品推荐 0false不推荐 1true推荐")
|
||||
@ApiModelProperty(value = "是否优品推荐")
|
||||
private Boolean isGood;
|
||||
|
||||
@ApiModelProperty(value = "是否单独分佣")
|
||||
@ -172,10 +171,10 @@ public class StoreProduct implements Serializable {
|
||||
|
||||
//新增字段
|
||||
@ApiModelProperty(value = "开始售卖时间")
|
||||
private DateTime beginTime;
|
||||
private Date beginTime;
|
||||
|
||||
@ApiModelProperty(value = "结束售卖时间")
|
||||
private DateTime endTime;
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "搜索状态:0=售卖中,1=上新预告,2=团购结束")
|
||||
private String searchStatus;
|
||||
@ -186,5 +185,8 @@ public class StoreProduct implements Serializable {
|
||||
@ApiModelProperty(value = "水果尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty(value = "是否推荐 0=推荐,1=未推荐")
|
||||
private String isSuggest;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package com.zbkj.common.token;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.zbkj.common.constants.Constants;
|
||||
import com.zbkj.common.exception.CrmebException;
|
||||
import com.zbkj.common.model.user.User;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.common.utils.RequestUtil;
|
||||
@ -175,6 +174,7 @@ public class FrontTokenComponent {
|
||||
"api/front/index/get/version",
|
||||
"api/front/image/domain",
|
||||
"api/front/product/leaderboard"
|
||||
|
||||
};
|
||||
|
||||
return ArrayUtils.contains(routerList, uri);
|
||||
|
||||
@ -68,6 +68,7 @@ public class WebConfig implements WebMvcConfigurer {
|
||||
excludePathPatterns("/api/front/article/**").
|
||||
excludePathPatterns("/api/front/city/**").
|
||||
excludePathPatterns("/api/front/product/hot").
|
||||
excludePathPatterns("/api/front/pagelist/suggest").
|
||||
excludePathPatterns("/api/front/product/good").
|
||||
excludePathPatterns("/api/front/products/**").
|
||||
excludePathPatterns("/api/front/reply/**").
|
||||
|
||||
@ -47,7 +47,7 @@ public class ProductController {
|
||||
* 参数暂定分页对象
|
||||
*/
|
||||
@ApiOperation(value = "为你推荐")
|
||||
@RequestMapping(value = "/pageList/suggest", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/pagelist/suggest", method = RequestMethod.GET)
|
||||
public CommonResult<Object> getProductSuggestionList(ProductSuggestPage param) {
|
||||
IPage<StoreProduct> list = productService.getProductSuggestionList(param);
|
||||
return CommonResult.success(list,"查询成功!");
|
||||
|
||||
@ -28,7 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
public interface ProductService extends IService<StoreProduct> {
|
||||
|
||||
/*
|
||||
/**
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
|
||||
@ -9,7 +9,6 @@ import com.zbkj.common.request.LoginMobileRequest;
|
||||
import com.zbkj.common.request.LoginRequest;
|
||||
import com.zbkj.common.response.LoginResponse;
|
||||
import com.zbkj.common.token.FrontTokenComponent;
|
||||
import com.zbkj.common.utils.CrmebUtil;
|
||||
import com.zbkj.common.utils.DateUtil;
|
||||
import com.zbkj.common.utils.RedisUtil;
|
||||
import com.zbkj.front.service.LoginService;
|
||||
@ -68,7 +67,8 @@ public class LoginServiceImpl implements LoginService {
|
||||
}
|
||||
|
||||
// 校验密码
|
||||
String password = CrmebUtil.encryptPassword(loginRequest.getPassword(), loginRequest.getPhone());
|
||||
//String password = CrmebUtil.encryptPassword(loginRequest.getPassword(), loginRequest.getPhone());
|
||||
String password = loginRequest.getPassword();
|
||||
if (!user.getPwd().equals(password)) {
|
||||
throw new CrmebException("密码错误");
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ 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;
|
||||
@ -31,7 +30,6 @@ 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;
|
||||
@ -105,13 +103,11 @@ public class ProductServiceImpl extends ServiceImpl<StoreProductDao,StoreProduct
|
||||
//分页查询
|
||||
IPage<StoreProduct> page = new Page<>(param.getCurrentPage(), param.getPageSize());
|
||||
//构造查询条件
|
||||
QueryWrapper<StoreProduct> query = new QueryWrapper<>();
|
||||
/*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 this.baseMapper.getProductSuggestionList(page,param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -4,7 +4,7 @@ crmeb:
|
||||
|
||||
# 配置端口
|
||||
server:
|
||||
port: 8081
|
||||
port: 8084
|
||||
servlet:
|
||||
context-path: / # 访问path
|
||||
tomcat:
|
||||
|
||||
@ -18,12 +18,13 @@ import org.apache.ibatis.annotations.Param;
|
||||
* | Author: CRMEB Team <admin@crmeb.com>
|
||||
* +----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
public interface StoreProductDao extends BaseMapper<StoreProduct> {
|
||||
/*
|
||||
* 为你推荐
|
||||
* @return List
|
||||
*/
|
||||
//为你推荐
|
||||
IPage<StoreProduct> getProductSuggestionList(IPage<StoreProduct> page,@Param("parm") ProductSuggestPage param);
|
||||
IPage<StoreProduct> getProductSuggestionList(IPage<StoreProduct> page, @Param("param") ProductSuggestPage param);
|
||||
|
||||
}
|
||||
|
||||
@ -2,12 +2,14 @@
|
||||
<!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},'%')
|
||||
SELECT p.*
|
||||
FROM crmeb.eb_store_product as p
|
||||
<where>
|
||||
<if test="param.storeName != null and param.storeName != ''">
|
||||
p.store_name LIKE CONCAT('%',#{param.storeName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user