5/16完成:
1.眼界甄选帖子评论点踩表创建; 2.眼界甄选帖子评论点踩实体类及实现类等创建; 3.眼界甄选帖子评论点踩及取消点踩具体实现; 4.我发布的帖子列表接口实现; 5.我喜欢的帖子列表接口实现; 6.医疗机构特色技术表创建;实体类及实现类创建; 7.医疗机构列表接口实现; 8.医疗机构详情页具体实现;
This commit is contained in:
+1
@@ -12,6 +12,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
+4
-2
@@ -131,11 +131,13 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap
|
||||
.antMatchers(buildAppApi("/**")).permitAll()
|
||||
.antMatchers("/common/**").permitAll()
|
||||
|
||||
|
||||
// 忽略宝享购全部
|
||||
.antMatchers("/bxgApp/**").permitAll()
|
||||
|
||||
.antMatchers(HttpMethod.OPTIONS).permitAll()
|
||||
.and().httpBasic().and().csrf().disable()
|
||||
// ②:每个项目的自定义规则
|
||||
.and().authorizeRequests(registry -> // 下面,循环设置自定义规则
|
||||
.authorizeRequests(registry -> // 下面,循环设置自定义规则
|
||||
authorizeRequestsCustomizers.forEach(customizer -> customizer.customize(registry)))
|
||||
// ③:兜底规则,必须认证
|
||||
.authorizeRequests()
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ public class MenuDO extends BaseDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Boolean hidden;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
# 自定义数据库
|
||||
mysql:
|
||||
url: 192.168.10.250
|
||||
#url: 192.168.10.250
|
||||
url: 127.0.0.1
|
||||
port: 3306
|
||||
vue-username: vue_pro
|
||||
vue-password: CrnPu&g8HqbBikrA&DH-llRgtvpIrG#-
|
||||
bxg_username: vue_pro_bxg
|
||||
bxg_password: CrnPu&g8HqbBikrA&DH-llRgtvpIrG#-
|
||||
#vue-username: vue_pro
|
||||
vue-username: root
|
||||
#vue-password: CrnPu&g8HqbBikrA&DH-llRgtvpIrG#-
|
||||
vue-password: admin
|
||||
#bxg_username: vue_pro_bxg
|
||||
bxg_username: root
|
||||
# bxg_password: CrnPu&g8HqbBikrA&DH-llRgtvpIrG#-
|
||||
bxg_password: admin
|
||||
server:
|
||||
port: 48080
|
||||
|
||||
@@ -70,8 +75,8 @@ spring:
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
host: 192.168.10.250 # 地址
|
||||
# host: 127.0.0.1 # 地址
|
||||
#host: 192.168.10.250 # 地址
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
|
||||
@@ -171,7 +176,7 @@ logging:
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
|
||||
--- #################### 微信公众号相关配置 ####################
|
||||
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
||||
mp:
|
||||
@@ -244,8 +249,9 @@ dubbo:
|
||||
|
||||
bxg:
|
||||
shop:
|
||||
# API_URL: http://192.168.10.113:48080/bxgApp
|
||||
API_URL: http://yudao.test.yixinhuixiang.com
|
||||
API_URL: http://192.168.10.113:48080/bxgApp
|
||||
#API_URL: http://127.0.0.1:48080/bxgApp
|
||||
#API_URL: http://yudao.test.yixinhuixiang.com
|
||||
SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
package co.yixiang.app.modules.order.rest;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
@@ -14,8 +16,10 @@ import co.yixiang.app.modules.order.param.ExpressParam;
|
||||
import co.yixiang.app.modules.services.CreatShareProductService;
|
||||
import co.yixiang.app.modules.services.OrderSupplyService;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.enums.*;
|
||||
import co.yixiang.logging.aop.log.AppLog;
|
||||
import co.yixiang.logging.aop.log.Log;
|
||||
import co.yixiang.modules.mp.domain.YxWechatTemplate;
|
||||
import co.yixiang.modules.mp.service.WeixinPayService;
|
||||
import co.yixiang.modules.mp.service.YxWechatTemplateService;
|
||||
@@ -26,6 +30,7 @@ import co.yixiang.modules.order.param.*;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderCartInfoService;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderStatusService;
|
||||
import co.yixiang.modules.order.service.dto.YxStoreOrderDto;
|
||||
import co.yixiang.modules.order.vo.ComputeVo;
|
||||
import co.yixiang.modules.order.vo.ConfirmOrderVo;
|
||||
import co.yixiang.modules.order.vo.OrderCartInfoVo;
|
||||
@@ -42,6 +47,9 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -76,6 +84,8 @@ public class AppStoreOrderController {
|
||||
|
||||
private final YxStoreOrderCartInfoService storeOrderCartInfoService;
|
||||
private final WeixinPayService weixinPayService;
|
||||
private final IGenerator generator;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -493,8 +503,26 @@ public class AppStoreOrderController {
|
||||
.eq(YxWechatTemplate::getType, "subscribe")
|
||||
.eq(YxWechatTemplate::getStatus, ShopCommonEnum.IS_STATUS_1.getValue()).list();
|
||||
List<String> temId = yxWechatTemplate.stream().map(tem -> tem.getTempid()).collect(Collectors.toList());
|
||||
|
||||
return ApiResult.ok(temId);
|
||||
}
|
||||
|
||||
|
||||
@Log("修改订单地址")
|
||||
@ApiOperation(value = "修改订单地址")
|
||||
@PostMapping(value = "/order/editAddress")
|
||||
public ApiResult editOrderAddress(@RequestBody YxStoreOrder resources) {
|
||||
if (ObjectUtil.isNull(resources.getUserAddress())) {
|
||||
throw new ShopException("订单地址不能为空");
|
||||
}
|
||||
if (!resources.getStatus().equals(ShopCommonEnum.ORDER_STATUS_0.getValue())){
|
||||
throw new ShopException("只支持待发货订单修改地址");
|
||||
}
|
||||
storeOrderService.saveOrUpdate(resources);
|
||||
orderStatusService.create(resources.getId(), OrderLogEnum.ORDER_EDIT_ADDRESS.getValue(),
|
||||
"修改订单地址为:" + resources.getUserAddress());
|
||||
return ApiResult.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+34
@@ -32,7 +32,10 @@ import co.yixiang.modules.product.vo.YxStoreProductReplyQueryVo;
|
||||
import co.yixiang.modules.shop.service.YxSystemAttachmentService;
|
||||
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
||||
import co.yixiang.modules.user.domain.YxUser;
|
||||
import co.yixiang.modules.user.domain.YxUserAddress;
|
||||
import co.yixiang.modules.user.service.YxUserAddressService;
|
||||
import co.yixiang.utils.QrCodeutil;
|
||||
import com.alipay.api.domain.QueryGroup;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -46,6 +49,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.awt.FontFormatException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -70,6 +74,7 @@ public class AppStoreProductController {
|
||||
private final YxSystemConfigService systemConfigService;
|
||||
private final YxSystemAttachmentService systemAttachmentService;
|
||||
private final CreatShareProductService creatShareProductService;
|
||||
private final YxUserAddressService addressService;
|
||||
private final QrCodeutil qrCodeutil;
|
||||
private String path = "";
|
||||
|
||||
@@ -110,6 +115,19 @@ public class AppStoreProductController {
|
||||
return ApiResult.ok(storeProductService.getGoodsList(productQueryParam));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据筛选获取产品列表
|
||||
* @param productQueryParam 筛选条件
|
||||
* @return 返回产品列表
|
||||
*/
|
||||
@PostMapping("/siftProducts")
|
||||
@ApiOperation(value = "筛选商品列表",notes = "筛选商品列表")
|
||||
public ApiResult<List<YxStoreProductQueryVo>> siftProductsList(@RequestBody YxStoreProductQueryParam productQueryParam){
|
||||
return ApiResult.ok(storeProductService.getSiftProductsList(productQueryParam));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 为你推荐
|
||||
*/
|
||||
@@ -191,6 +209,22 @@ public class AppStoreProductController {
|
||||
long uid = LocalUser.getUidByToken();
|
||||
storeProductService.incBrowseNum(id);
|
||||
ProductVo productDTO = storeProductService.goodsDetail(id,uid,latitude,longitude);
|
||||
if (addressService.getUserDefaultAddress(uid) == null) {
|
||||
List<YxUserAddress> yxUserAddresses = addressService.selectList(uid);
|
||||
productDTO.setAddress(yxUserAddresses);
|
||||
}else {
|
||||
YxUserAddress userDefaultAddress = addressService.getUserDefaultAddress(uid);
|
||||
List<YxUserAddress> addresses = new ArrayList<>();
|
||||
addresses.add(userDefaultAddress);
|
||||
productDTO.setAddress(addresses);
|
||||
}
|
||||
//相关推荐(分类)
|
||||
YxStoreProductQueryParam productQueryParam = new YxStoreProductQueryParam();
|
||||
YxStoreProductQueryVo product = storeProductService.getStoreProductById(id);
|
||||
productQueryParam.setSid(product.getCateId());
|
||||
List<YxStoreProductQueryVo> siftProductsList = storeProductService.getSiftProductsList(productQueryParam);
|
||||
productDTO.setRecProducts(siftProductsList);
|
||||
productDTO.setSid(product.getCateId());
|
||||
return ApiResult.ok(productDTO);
|
||||
}
|
||||
|
||||
|
||||
+84
-7
@@ -4,6 +4,7 @@ package co.yixiang.app.modules.user.rest;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
|
||||
import co.yixiang.app.common.aop.NoRepeatSubmit;
|
||||
import co.yixiang.app.common.bean.LocalUser;
|
||||
@@ -12,33 +13,46 @@ import co.yixiang.app.modules.user.param.UserEditParam;
|
||||
import co.yixiang.logging.aop.log.AppLog;
|
||||
import co.yixiang.constant.ShopConstants;
|
||||
import co.yixiang.enums.BillInfoEnum;
|
||||
import co.yixiang.modules.bbs.service.YxBbsService;
|
||||
import co.yixiang.modules.evaluation.service.YxEvaluationRelationService;
|
||||
import co.yixiang.modules.evaluation.vo.YxStoreEvaluationRelationQueryVo;
|
||||
import co.yixiang.modules.order.service.YxStoreOrderService;
|
||||
import co.yixiang.modules.order.vo.UserOrderCountVo;
|
||||
import co.yixiang.modules.order.vo.YxStoreOrderQueryVo;
|
||||
import co.yixiang.modules.product.domain.YxStoreProductReply;
|
||||
import co.yixiang.modules.product.service.YxStoreProductRelationService;
|
||||
import co.yixiang.modules.product.service.YxStoreProductReplyService;
|
||||
import co.yixiang.modules.product.service.dto.YxStoreProductReplyDto;
|
||||
import co.yixiang.modules.product.service.dto.YxStoreProductReplyQueryCriteria;
|
||||
import co.yixiang.modules.product.vo.YxStoreProductRelationQueryVo;
|
||||
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
||||
import co.yixiang.modules.shop.service.YxSystemGroupDataService;
|
||||
import co.yixiang.modules.user.domain.YxUser;
|
||||
import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.service.YxUserSignService;
|
||||
import co.yixiang.modules.user.domain.YxUserVTask;
|
||||
import co.yixiang.modules.user.domain.YxUserVTaskCompleted;
|
||||
import co.yixiang.modules.user.param.YxUserVTaskParam;
|
||||
import co.yixiang.modules.user.service.*;
|
||||
import co.yixiang.modules.user.vo.SignVo;
|
||||
import co.yixiang.modules.user.vo.YxUserQueryVo;
|
||||
import co.yixiang.modules.user.vo.YxUserSignConfigQueryVo;
|
||||
import co.yixiang.utils.DateUtils;
|
||||
import co.yixiang.utils.StringUtils;
|
||||
import co.yixiang.utils.YshopConstant;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import javafx.beans.binding.ObjectBinding;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.util.*;
|
||||
|
||||
import static co.yixiang.constant.SystemConfigConstants.YSHOP_SHOW_RECHARGE;
|
||||
@@ -65,6 +79,12 @@ public class LetterAppUserController {
|
||||
private final YxUserSignService userSignService;
|
||||
private final YxUserBillService userBillService;
|
||||
private final YxSystemConfigService systemConfigService;
|
||||
private final YxStoreProductReplyService storeProductReplyService;
|
||||
private final YxStoreOrderService storeOrderService;
|
||||
private final YxUserVTaskService userVTaskService;
|
||||
private final YxUserVTaskCompletedService userVTaskCompletedService;
|
||||
private final YxBbsService bbsService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -93,7 +113,7 @@ public class LetterAppUserController {
|
||||
* 获取各类轮播图
|
||||
*/
|
||||
@GetMapping("/menu/banner/{type}")
|
||||
@ApiOperation(value = "获取各种轮播图(0:首页 1:品牌馆 2:优惠券 3:活动专区 4:榜单列表)",notes = "获取轮播图")
|
||||
@ApiOperation(value = "获取各种轮播图(0:首页 1:眼部好物 2:线下门店 3:眼界生活 4:甄选评测 5:服务管家)",notes = "获取轮播图")
|
||||
public ApiResult<Map<String,Object>> bannerMenu(@PathVariable Integer type){
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
// map.put("banner",systemGroupDataService.getDatas(ShopConstants.ZSW_HOME_BANNER));
|
||||
@@ -161,7 +181,6 @@ public class LetterAppUserController {
|
||||
return ApiResult.ok(relationService.userCollectProduct(page,limit,uid,type));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取收藏评测
|
||||
*/
|
||||
@@ -181,6 +200,8 @@ public class LetterAppUserController {
|
||||
// return ApiResult.ok(evaluationRelationService.userCollectEvaluation(page,limit,uid,type));
|
||||
return ApiResult.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户资金统计
|
||||
*/
|
||||
@@ -218,7 +239,14 @@ public class LetterAppUserController {
|
||||
@GetMapping("/sign/config")
|
||||
@ApiOperation(value = "签到配置",notes = "签到配置")
|
||||
public ApiResult<Object> signConfig(){
|
||||
return ApiResult.ok(systemGroupDataService.getDatas(ShopConstants.ZSW_SIGN_DAY_NUM));
|
||||
List<JSONObject> datas = systemGroupDataService.getDatas(ShopConstants.ZSW_SIGN_DAY_NUM);
|
||||
ArrayList<String> futureDaysList = DateUtils.getFutureDaysList(6);
|
||||
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
JSONObject jsonObject = datas.get(i);
|
||||
jsonObject.put("dateNum",futureDaysList.get(i));
|
||||
}
|
||||
return ApiResult.ok(datas);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,7 +269,6 @@ public class LetterAppUserController {
|
||||
/**
|
||||
* 签到列表(年月)
|
||||
*/
|
||||
|
||||
@AuthCheck
|
||||
@GetMapping("/sign/month")
|
||||
@ApiImplicitParams({
|
||||
@@ -293,7 +320,57 @@ public class LetterAppUserController {
|
||||
}
|
||||
|
||||
|
||||
@AuthCheck
|
||||
@GetMapping("/user/myComment")
|
||||
@ApiOperation(value = "个人中心:我的评价",notes = "获取用户评价")
|
||||
public ApiResult<List<YxStoreProductReply>> myComment(@RequestParam(value = "page",defaultValue = "1")int page,
|
||||
@RequestParam(value = "limit",defaultValue = "10")int limit,
|
||||
YxStoreProductReplyQueryCriteria criteria){
|
||||
//通过用户id查询用户评论
|
||||
return ApiResult.ok(storeProductReplyService.queryAll(criteria));
|
||||
}
|
||||
|
||||
|
||||
@AuthCheck
|
||||
@GetMapping("/user/CommonList")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "页码,默认为1", paramType = "query", dataType = "int",dataTypeClass = Integer.class),
|
||||
@ApiImplicitParam(name = "limit", value = "页大小,默认为10", paramType = "query", dataType = "int",dataTypeClass = Integer.class)
|
||||
})
|
||||
@ApiOperation(value = "个人中心:常用清单",notes = "获取用户常用清单")
|
||||
public ApiResult<Object> CommonList(@RequestParam(value = "page", defaultValue = "1") int page,
|
||||
@RequestParam(value = "limit", defaultValue = "10") int limit){
|
||||
Long uid = LocalUser.getUser().getUid();
|
||||
Map<String, Object> map = storeOrderService.orderList(uid,-1, page, limit);
|
||||
Long total = (Long) map.get("total");
|
||||
Long totalPage = (Long) map.get("totalPage");
|
||||
List<YxStoreOrderQueryVo> list = (List<YxStoreOrderQueryVo>) map.get("list");
|
||||
BigDecimal totalSave = storeOrderService.totalSave(list); //用户累计节省金额
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("data",map.get("list"));
|
||||
map1.put("totalSave",totalSave);
|
||||
return ApiResult.resultPage(total.intValue(), totalPage.intValue(), map1);
|
||||
}
|
||||
|
||||
|
||||
@AuthCheck
|
||||
@GetMapping("/sign/task")
|
||||
@ApiOperation(value = "签到v豆任务",notes = "签到v豆任务")
|
||||
public ApiResult<YxUserVTaskParam> tasks(){
|
||||
YxUser user = LocalUser.getUser();
|
||||
YxUserVTaskParam param = userVTaskService.selectTask(user);
|
||||
return ApiResult.ok(param);
|
||||
}
|
||||
|
||||
@AuthCheck
|
||||
@GetMapping("/sign/getIp")
|
||||
@ApiOperation(value = "获取ip",notes = "获取ip")
|
||||
public ApiResult ip(){
|
||||
String clientIP = ServletUtils.getClientIP();//获取ip
|
||||
String ipUrl = YshopConstant.Url.IP_URL;//获取ip归属地的接口
|
||||
String cityInfo = StringUtils.getCityInfo(clientIP);//根据ip获取详细地址
|
||||
return ApiResult.ok(cityInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,17 @@ import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
import cn.iocoder.yudao.framework.common.exception.ShopException;
|
||||
import co.yixiang.app.common.bean.LocalUser;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.AuthCheck;
|
||||
import co.yixiang.modules.shop.domain.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.domain.YxUser;
|
||||
import co.yixiang.modules.user.domain.YxUserLevelBenefit;
|
||||
import co.yixiang.modules.user.param.YxUserLevelBenefitParam;
|
||||
import co.yixiang.modules.user.param.YxUserLevelParam;
|
||||
import co.yixiang.modules.user.service.YxSystemUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxSystemUserTaskService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelBenefitService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.service.dto.UserLevelDto;
|
||||
import co.yixiang.modules.user.vo.YxSystemUserLevelQueryVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -20,6 +28,9 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户等级 前端控制器
|
||||
@@ -37,6 +48,7 @@ public class UserLevelController {
|
||||
private final YxUserLevelService userLevelService;
|
||||
private final YxSystemUserLevelService systemUserLevelService;
|
||||
private final YxSystemUserTaskService systemUserTaskService;
|
||||
private final YxUserLevelBenefitService userLevelBenefitService;
|
||||
|
||||
/**
|
||||
* 会员等级列表
|
||||
@@ -45,8 +57,15 @@ public class UserLevelController {
|
||||
@GetMapping("/user/level/grade")
|
||||
@ApiOperation(value = "会员等级列表",notes = "会员等级列表")
|
||||
public ApiResult<Object> getLevelInfo(){
|
||||
List<YxUserLevelBenefitParam> list = new ArrayList<>();
|
||||
Long uid = LocalUser.getUser().getUid();
|
||||
return ApiResult.ok(systemUserLevelService.getLevelInfo(uid));
|
||||
UserLevelDto levelInfo = systemUserLevelService.getLevelInfo(uid);
|
||||
List<YxSystemUserLevelQueryVo> levelQueryVos = levelInfo.getList();
|
||||
for (YxSystemUserLevelQueryVo yxSystemUserLevelQueryVo : levelQueryVos) {
|
||||
List<YxUserLevelBenefit> benefits = userLevelBenefitService.selectByLevelGrade(yxSystemUserLevelQueryVo.getGrade());
|
||||
yxSystemUserLevelQueryVo.setBenefits(benefits);
|
||||
}
|
||||
return ApiResult.ok(levelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +99,30 @@ public class UserLevelController {
|
||||
|
||||
}
|
||||
|
||||
//会员中心:会员成长体系数据(当前等级对应权益;下一会员等级;距离下一级所需成长值)
|
||||
@AuthCheck
|
||||
@GetMapping("/user/level/benefitList")
|
||||
@ApiOperation(value = "用户当前会员等级对应权益列表",notes = "用户当前会员等级对应权益列表")
|
||||
public ApiResult<YxUserLevelParam> benefitList(){
|
||||
YxUser user = LocalUser.getUser();
|
||||
YxSystemUserLevel systemUserLevel = systemUserLevelService.getByGrade(user.getLevel());
|
||||
//List benefit = systemUserLevelService.getBenefit(systemUserLevel.getId());
|
||||
List<YxUserLevelBenefit> benefits = userLevelBenefitService.selectByLevelGrade(user.getLevel());
|
||||
YxUserLevelParam param = new YxUserLevelParam();
|
||||
param.setUserLevel(systemUserLevel);
|
||||
param.setBenefitList(benefits);
|
||||
int nextLevelId = systemUserLevelService.getNextLevelId(systemUserLevel.getId());
|
||||
YxSystemUserLevel nextLevel = systemUserLevelService.getOne(nextLevelId);
|
||||
param.setNextLevel(nextLevel);
|
||||
//根据下一级的会员所需成长值减去当前成长值,得到距离升级所需的成长值
|
||||
Integer nextLevelGrowthValue = nextLevel.getGrowthValue();
|
||||
Integer growth = user.getGrowth();
|
||||
Integer needGrowth = nextLevelGrowthValue-growth;
|
||||
param.setNeedGrowth(needGrowth);
|
||||
|
||||
UserLevelDto levelInfo = systemUserLevelService.getLevelInfo(user.getUid());
|
||||
|
||||
return ApiResult.ok(param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,8 @@ public interface ShopConstants {
|
||||
|
||||
int ZSW_ONE_NUM = 1;
|
||||
|
||||
int ZSW_ZERO_NUM = 0;
|
||||
|
||||
String ZSW_ORDER_CACHE_KEY = "zsw:order";
|
||||
|
||||
long ZSW_ORDER_CACHE_TIME = 600L;
|
||||
|
||||
@@ -27,6 +27,7 @@ public enum OrderLogEnum {
|
||||
CREATE_ORDER("yshop_create_order","订单生成"),
|
||||
NONE_ORDER("NONE","订单OK"),
|
||||
DELIVERY_GOODS("delivery_goods", "订单发货"),
|
||||
ORDER_EDIT_ADDRESS("order_edit_address","订单地址修改"),
|
||||
EXTEND_ORDER("EXTEND_ORDER","订单已生成");
|
||||
|
||||
|
||||
|
||||
@@ -15,18 +15,36 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum RedisKeyEnum {
|
||||
|
||||
WXAPP_APPID("wxapp_appId","微信小程序id"),
|
||||
WXAPP_SECRET("wxapp_secret","微信小程序秘钥"),
|
||||
WX_NATIVE_APP_APPID("wx_native_app_appId","支付appId"),
|
||||
WXPAY_MCHID("wxpay_mchId","商户号"),
|
||||
WXPAY_MCHKEY("wxpay_mchKey","商户秘钥"),
|
||||
WXPAY_KEYPATH("wxpay_keyPath","商户证书路径"),
|
||||
WECHAT_APPID("wechat_appid","微信公众号id"),
|
||||
WECHAT_APPSECRET("wechat_appsecret","微信公众号secret"),
|
||||
WECHAT_TOKEN("wechat_token","微信公众号验证token"),
|
||||
WECHAT_ENCODINGAESKEY("wechat_encodingaeskey","EncodingAESKey"),
|
||||
TENGXUN_MAP_KEY("tengxun_map_key","腾讯mapkey");
|
||||
WXAPP_APPID("wxapp_appId","微信小程序id",-1L),
|
||||
WXAPP_SECRET("wxapp_secret","微信小程序秘钥",-1L),
|
||||
WX_NATIVE_APP_APPID("wx_native_app_appId","支付appId",-1L),
|
||||
WXPAY_MCHID("wxpay_mchId","商户号",-1L),
|
||||
WXPAY_MCHKEY("wxpay_mchKey","商户秘钥",-1L),
|
||||
WXPAY_KEYPATH("wxpay_keyPath","商户证书路径",-1L),
|
||||
WECHAT_APPID("wechat_appid","微信公众号id",-1L),
|
||||
WECHAT_APPSECRET("wechat_appsecret","微信公众号secret",-1L),
|
||||
WECHAT_TOKEN("wechat_token","微信公众号验证token",-1L),
|
||||
WECHAT_ENCODINGAESKEY("wechat_encodingaeskey","EncodingAESKey",-1L),
|
||||
TENGXUN_MAP_KEY("tengxun_map_key","腾讯mapkey",-1L),
|
||||
|
||||
USER_BBS_COMMENT_LIKE("user_bbs_comment_like","用户眼界生活评论点赞",-1L);
|
||||
|
||||
private String value;
|
||||
private String desc;
|
||||
private Long time;//-1L表示没有设置有效时间
|
||||
|
||||
private RedisKeyEnum(String value,Long time){
|
||||
this.value = value;
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
//拼接完整redis key的方法
|
||||
public String join(String... values){
|
||||
StringBuilder sb = new StringBuilder(80);
|
||||
sb.append(this.value);
|
||||
for (String v : values) {
|
||||
sb.append(":").append(v);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,8 +62,24 @@ public enum ShopCommonEnum {
|
||||
SHOW_0(0,"不显示"),
|
||||
SHOW_1(1,"显示"),
|
||||
|
||||
IS_HOT_0(0,"不是热门"),
|
||||
IS_HOT_1(1,"是热门"),
|
||||
|
||||
IS_SECKILL_0(0,"不是秒杀状态"),
|
||||
IS_SECKILL_1(1,"是秒杀状态"),
|
||||
|
||||
DEFAULT_0(0,"不是默认"),
|
||||
DEFAULT_1(1,"默认");
|
||||
DEFAULT_1(1,"默认"),
|
||||
|
||||
PAY_STATUS_0(0,"未支付"),
|
||||
PAY_STATUS_1(1,"已支付"),
|
||||
|
||||
ORDER_STATUS_0(0,"待发货"),
|
||||
ORDER_STATUS_1(1,"待收货"),
|
||||
ORDER_STATUS_2(2,"已收货"),
|
||||
ORDER_STATUS_3(3,"已完成")
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -321,4 +321,10 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
|
||||
*/
|
||||
List<YxStoreOrder> listTimeoutOrders(Integer day);
|
||||
|
||||
/**
|
||||
* 获取用户累计已省
|
||||
* @param map 用户累计订单
|
||||
* @return 累计已省金额
|
||||
*/
|
||||
BigDecimal totalSave(List<YxStoreOrderQueryVo> list);
|
||||
}
|
||||
|
||||
+30
@@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ShopException;
|
||||
import co.yixiang.app.common.bean.LocalUser;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.constant.ShopConstants;
|
||||
@@ -63,10 +64,12 @@ import co.yixiang.modules.template.service.YxShippingTemplatesRegionService;
|
||||
import co.yixiang.modules.template.service.YxShippingTemplatesService;
|
||||
import co.yixiang.modules.user.domain.YxUser;
|
||||
import co.yixiang.modules.user.domain.YxUserAddress;
|
||||
import co.yixiang.modules.user.domain.YxUserLevel;
|
||||
import co.yixiang.modules.user.service.YxUserAddressService;
|
||||
import co.yixiang.modules.user.service.YxUserBillService;
|
||||
import co.yixiang.modules.user.service.YxUserLevelService;
|
||||
import co.yixiang.modules.user.service.YxUserService;
|
||||
import co.yixiang.modules.user.service.dto.UserLevelInfoDto;
|
||||
import co.yixiang.modules.user.service.dto.YxUserDto;
|
||||
import co.yixiang.modules.user.service.mapper.BxgUserMapper;
|
||||
import co.yixiang.modules.user.vo.YxUserQueryVo;
|
||||
@@ -97,6 +100,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -3078,4 +3082,30 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
||||
public List<YxStoreOrder> listTimeoutOrders(Integer day) {
|
||||
return storeOrderMapper.listTimeoutOrders(day);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal totalSave(List<YxStoreOrderQueryVo> list){
|
||||
//用户省了多少钱 市场价ot_price-价格price*会员折扣1 ot_price-price*1
|
||||
BigDecimal totalPrice = new BigDecimal(BigInteger.ZERO); //市场价总价
|
||||
BigDecimal totalPayPrice = new BigDecimal(BigInteger.ZERO); //实际商品价总价
|
||||
for (YxStoreOrderQueryVo yxStoreOrderQueryVo : list) { //遍历订单列表
|
||||
List<YxStoreCartQueryVo> cartInfo = yxStoreOrderQueryVo.getCartInfo();
|
||||
for (YxStoreCartQueryVo vo : cartInfo){
|
||||
BigDecimal otPrice = vo.getProductInfo().getOtPrice();
|
||||
totalPrice = totalPrice.add(otPrice);
|
||||
BigDecimal price = vo.getProductInfo().getPrice();
|
||||
totalPayPrice = totalPayPrice.add(price);
|
||||
}
|
||||
}
|
||||
Long uid = LocalUser.getUser().getUid(); //获取用户id
|
||||
//step 1:通过用户id查询会员等级表
|
||||
//YxUserLevel userLevel = userLevelService.getUserLevel(user.getUid(), user.);
|
||||
//step 2:通过会员表对象获取会员折扣
|
||||
//Integer discount = userLevel.getDiscount();
|
||||
//step 3:通过会员折扣除以100得到折扣
|
||||
//BigDecimal disCount = new BigDecimal(Integer.parseInt(discount.toString()));
|
||||
//BigDecimal realDisCount = disCount.divide(new BigDecimal(Integer.parseInt("100")));
|
||||
|
||||
return totalPrice.subtract(totalPayPrice.multiply(BigDecimal.ONE)); //返回 总原价-总实际支付价*1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package co.yixiang.modules.product.param;
|
||||
|
||||
import co.yixiang.common.web.param.QueryParam;
|
||||
import com.alipay.api.domain.QueryGroup;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表 查询参数对象
|
||||
@@ -41,6 +45,30 @@ public class YxStoreProductQueryParam extends QueryParam {
|
||||
@ApiModelProperty(value = "销量排序")
|
||||
private String salesOrder;
|
||||
|
||||
@ApiModelProperty(value = "折扣排序")
|
||||
private String discountOrder;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "是否热门")
|
||||
private String hots;
|
||||
|
||||
@ApiModelProperty(value = "是否限时抢购")
|
||||
private String secKills;
|
||||
|
||||
@ApiModelProperty(value = "最小价格")
|
||||
private BigDecimal minPrice;
|
||||
|
||||
@ApiModelProperty(value = "最大价格")
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
@ApiModelProperty(value = "是否会员礼包")
|
||||
private String vips;
|
||||
|
||||
@ApiModelProperty(value = "是否超级划算 0否 1是")
|
||||
private String isDiscount;
|
||||
|
||||
@ApiModelProperty(value = "是否自营 0不是 1是")
|
||||
private String isSelfSupport;
|
||||
}
|
||||
|
||||
+6
@@ -82,4 +82,10 @@ public interface YxStoreProductReplyService extends BaseService<YxStoreProductR
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxStoreProductReplyDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户评价
|
||||
*
|
||||
*/
|
||||
List<YxStoreProductReplyQueryVo> getByUserId(Long userId,int type,int page,int limit);
|
||||
}
|
||||
|
||||
@@ -141,4 +141,7 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
|
||||
* @param id
|
||||
*/
|
||||
void deleteForwardImg(Long id);
|
||||
|
||||
List<YxStoreProductQueryVo> getSiftProductsList(YxStoreProductQueryParam productQueryParam);
|
||||
|
||||
}
|
||||
|
||||
+18
@@ -270,4 +270,22 @@ public class YxStoreProductReplyServiceImpl extends BaseServiceImpl<StoreProduct
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @param type 0-全部
|
||||
* @param page page
|
||||
* @param limit limit
|
||||
* @return list
|
||||
*/
|
||||
@Override
|
||||
public List<YxStoreProductReplyQueryVo> getByUserId(Long userId, int type, int page, int limit) {
|
||||
List<YxStoreProductReplyQueryVo> newList = new ArrayList<>();
|
||||
Page<YxStoreProductReply> pageModel = new Page<>(page,limit);
|
||||
//List<YxStoreProductReplyQueryVo> list = this.baseMapper.selectByUserId(pageModel,userId,type);//TODO 自定条件根据用户id查询评价
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+115
@@ -44,6 +44,7 @@ import co.yixiang.utils.ShopKeyUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -1031,4 +1032,118 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
baseMapper.deleteForwardImg(id, "_product_detail_wap");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxStoreProductQueryVo> getSiftProductsList(YxStoreProductQueryParam productQueryParam) {
|
||||
LambdaQueryWrapper<YxStoreProduct> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(YxStoreProduct::getIsShow,CommonEnum.SHOW_STATUS_1.getValue());//商品是上架状态
|
||||
wrapper.eq(YxStoreProduct::getIsDel,CommonEnum.DEL_STATUS_0.getValue());//商品是未删除状态
|
||||
|
||||
//商品分类搜索
|
||||
if (StrUtil.isNotBlank(productQueryParam.getSid()) &&
|
||||
!ShopConstants.ZSW_ZERO.equals(productQueryParam.getSid())) {
|
||||
wrapper.eq(YxStoreProduct::getCateId, productQueryParam.getSid());
|
||||
}
|
||||
//是否新品筛选
|
||||
if(StrUtil.isNotBlank(productQueryParam.getNews()) && !ShopConstants.ZSW_ZERO.equals(productQueryParam.getNews())){
|
||||
wrapper.eq(YxStoreProduct::getIsNew,ShopCommonEnum.IS_NEW_1.getValue());
|
||||
}
|
||||
//价格排序
|
||||
if (SortEnum.DESC.getValue().equals(productQueryParam.getPriceOrder())) {
|
||||
wrapper.orderByDesc(YxStoreProduct::getPrice);
|
||||
} else if (SortEnum.ASC.getValue().equals(productQueryParam.getPriceOrder())) {
|
||||
wrapper.orderByAsc(YxStoreProduct::getPrice);
|
||||
}
|
||||
//销量排序
|
||||
if (SortEnum.DESC.getValue().equals(productQueryParam.getSalesOrder())) {
|
||||
wrapper.orderByDesc(YxStoreProduct::getSales);
|
||||
} else if (SortEnum.ASC.getValue().equals(productQueryParam.getSalesOrder())) {
|
||||
wrapper.orderByAsc(YxStoreProduct::getSales);
|
||||
}
|
||||
//关键字搜索
|
||||
if (StrUtil.isNotEmpty(productQueryParam.getKeyword())) {
|
||||
wrapper.and(wrapper1 -> {
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreName, productQueryParam.getKeyword());
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreInfo, productQueryParam.getKeyword());
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getKeyword, productQueryParam.getKeyword());
|
||||
});
|
||||
}
|
||||
//是否是热门筛选
|
||||
if(StrUtil.isNotBlank(productQueryParam.getHots()) && !ShopConstants.ZSW_ZERO.equals(productQueryParam.getHots())){
|
||||
wrapper.eq(YxStoreProduct::getIsHot,ShopCommonEnum.IS_HOT_1.getValue());
|
||||
}
|
||||
//是否超级划算筛选
|
||||
wrapper.lt(StrUtil.isNotBlank(productQueryParam.getIsDiscount()),YxStoreProduct::getPrice,BigDecimal.TEN);
|
||||
//价格区间筛选
|
||||
if (productQueryParam.getMinPrice() !=null && productQueryParam.getMaxPrice() !=null){
|
||||
wrapper.ge(YxStoreProduct::getPrice,productQueryParam.getMinPrice()).lt(YxStoreProduct::getPrice,productQueryParam.getMaxPrice());
|
||||
}
|
||||
if (productQueryParam.getMinPrice() !=null && productQueryParam.getMaxPrice() ==null){
|
||||
wrapper.ge(YxStoreProduct::getPrice,productQueryParam.getMinPrice());
|
||||
}
|
||||
//是否限时抢购筛选
|
||||
if(StrUtil.isNotBlank(productQueryParam.getSecKills()) && !ShopConstants.ZSW_ZERO.equals(productQueryParam.getSecKills())){
|
||||
wrapper.eq(YxStoreProduct::getIsSeckill,ShopCommonEnum.IS_SECKILL_1.getValue());
|
||||
}
|
||||
//是否会员礼包筛选(表中没有是否礼包条件,可以直接取巧通过关键字查询礼包)
|
||||
if (StrUtil.isNotEmpty(productQueryParam.getVips())&& !productQueryParam.getVips().equals(ShopConstants.ZSW_ZERO)){
|
||||
wrapper.and(wrapper1 ->{
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreName,"礼盒");
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreName,"礼包");
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreInfo,"礼盒");
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getStoreInfo,"礼包");
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getKeyword,"礼盒");
|
||||
wrapper1.or();
|
||||
wrapper1.like(YxStoreProduct::getKeyword,"礼包");
|
||||
});
|
||||
}
|
||||
Page<YxStoreProduct> pageModel = new Page<>(productQueryParam.getPage(),
|
||||
productQueryParam.getLimit());
|
||||
|
||||
Page<YxStoreProduct> pageList = this.baseMapper.selectPage(pageModel, wrapper);
|
||||
|
||||
List<YxStoreProductQueryVo> list = generator.convert(pageList.getRecords(), YxStoreProductQueryVo.class);
|
||||
List<YxStoreProductQueryVo> selfSupportList =new ArrayList<>();
|
||||
List<YxStoreProductQueryVo> noSelfSupportList =new ArrayList<>();
|
||||
// 折扣排序
|
||||
if (StrUtil.isNotBlank(productQueryParam.getDiscountOrder())&& !productQueryParam.getDiscountOrder().equals(ShopConstants.ZSW_ZERO)){
|
||||
list = list.parallelStream().filter(item -> item.getOtPrice().compareTo(BigDecimal.ZERO)!=0)
|
||||
.filter(item -> item.getPrice().compareTo(BigDecimal.ZERO)!=0)
|
||||
.sorted(Comparator.comparing(o -> o.getPrice().divide(o.getOtPrice(), BigDecimal.ROUND_CEILING)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
//放入品牌信息
|
||||
list.forEach(item->{
|
||||
//是否自营品牌:自营包括:回眸一笑的产品系列、moo产品系列、公司代理的其他品牌类
|
||||
//是否甄选品牌:甄选品牌是所有第三方品牌
|
||||
YxStoreBrand yxStoreBrand=yxStoreBrandMapper.selectById(item.getBrandId());
|
||||
if (yxStoreBrand!=null) {
|
||||
item.setBrandName(yxStoreBrand.getBrandName());
|
||||
item.setPic(yxStoreBrand.getPic());
|
||||
}else {
|
||||
item.setBrandName("暂无品牌");
|
||||
item.setPic("");
|
||||
}
|
||||
if (item.getBrandName().equals("回眸一笑")) {
|
||||
selfSupportList.add(item);
|
||||
}else{
|
||||
noSelfSupportList.add(item);
|
||||
}
|
||||
});
|
||||
if (productQueryParam.getIsSelfSupport()!=null && productQueryParam.getIsSelfSupport().equals(ShopConstants.ZSW_ZERO)) {
|
||||
return noSelfSupportList;
|
||||
}else if (productQueryParam.getIsSelfSupport()!=null && !productQueryParam.getIsSelfSupport().equals(ShopConstants.ZSW_ZERO)){
|
||||
return selfSupportList;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface YxStoreProductRelationMapper extends CoreMapper<YxStoreProductRelation> {
|
||||
|
||||
@Select("select B.id pid,A.type as category,B.store_name as storeName,B.price,B.integral,B.is_integral as isIntegral,A.id id," +
|
||||
@Select("select B.id pid,A.type as category,B.store_name as storeName,B.price,B.integral,B.is_integral as isIntegral,A.id id,B.cate_id as sid," +
|
||||
"B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow" +
|
||||
" from yx_store_product_relation A left join yx_store_product B " +
|
||||
"on A.product_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
|
||||
|
||||
@@ -3,6 +3,7 @@ package co.yixiang.modules.product.vo;
|
||||
import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
|
||||
import co.yixiang.modules.store.domain.YxStoreBrand;
|
||||
import co.yixiang.modules.store.vo.YxStoreBrandVo;
|
||||
import co.yixiang.modules.user.domain.YxUserAddress;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -64,4 +65,13 @@ public class ProductVo{
|
||||
@ApiModelProperty(value = "模版名称")
|
||||
private String tempName;
|
||||
|
||||
@ApiModelProperty(value = "用户地址")
|
||||
private List<YxUserAddress> address;
|
||||
|
||||
@ApiModelProperty(value = "商品详情相关推荐")
|
||||
private List<YxStoreProductQueryVo> recProducts;
|
||||
|
||||
@ApiModelProperty(value = "商品分类id")
|
||||
private String sid;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ public class YxStoreProductRelationQueryVo implements Serializable {
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty(value = "商品分类id")
|
||||
private Long sid;
|
||||
|
||||
@ApiModelProperty(value = "类型(收藏(collect)、点赞(like))")
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package co.yixiang.modules.user.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.shop.domain.YxSystemUserLevel;
|
||||
import co.yixiang.modules.user.service.dto.UserLevelDto;
|
||||
@@ -29,6 +30,8 @@ public interface YxSystemUserLevelService extends BaseService<YxSystemUserLevel
|
||||
|
||||
//boolean getClear(int levelId);
|
||||
|
||||
YxSystemUserLevel getOne(int levelId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员等级列表及其任务列表
|
||||
@@ -58,4 +61,13 @@ public interface YxSystemUserLevelService extends BaseService<YxSystemUserLevel
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<YxSystemUserLevelDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 通过id获取对应会员等级的权益
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List getBenefit(int id);
|
||||
|
||||
YxSystemUserLevel getByGrade(Integer level);
|
||||
}
|
||||
|
||||
@@ -56,4 +56,6 @@ public interface YxUserAddressService extends BaseService<YxUserAddress> {
|
||||
*/
|
||||
YxUserAddress getUserDefaultAddress(Long uid);
|
||||
|
||||
List<YxUserAddress> selectList(Long uid);
|
||||
|
||||
}
|
||||
|
||||
+25
-5
@@ -3,6 +3,7 @@ package co.yixiang.modules.user.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ShopException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.ApiResult;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
@@ -19,6 +20,7 @@ import co.yixiang.modules.user.service.dto.YxSystemUserLevelQueryCriteria;
|
||||
import co.yixiang.modules.user.service.mapper.SystemUserLevelMapper;
|
||||
import co.yixiang.modules.user.vo.YxSystemUserLevelQueryVo;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -28,11 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@@ -84,6 +82,12 @@ public class YxSystemUserLevelServiceImpl extends BaseServiceImpl<SystemUserLeve
|
||||
return userLevel.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxSystemUserLevel getOne(int levelId) {
|
||||
YxSystemUserLevel yxSystemUserLevel = yxSystemUserLevelMapper.selectById(levelId);
|
||||
return yxSystemUserLevel;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean getClear(int levelId) {
|
||||
// List<YxSystemUserLevelQueryVo> systemUserLevelQueryVos = this.getLevelListAndGrade(levelId);
|
||||
@@ -196,4 +200,20 @@ public class YxSystemUserLevelServiceImpl extends BaseServiceImpl<SystemUserLeve
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getBenefit(int id) {
|
||||
YxSystemUserLevel yxSystemUserLevel = yxSystemUserLevelMapper.selectById(id);
|
||||
String[] split = yxSystemUserLevel.getBenefit().split(",");
|
||||
List list = new ArrayList();
|
||||
Collections.addAll(list, split);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public YxSystemUserLevel getByGrade(Integer level) {
|
||||
LambdaQueryWrapper<YxSystemUserLevel> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(YxSystemUserLevel::getGrade,level);
|
||||
return yxSystemUserLevelMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -134,6 +134,13 @@ public class YxUserAddressServiceImpl extends BaseServiceImpl<YxUserAddressMappe
|
||||
return getOne(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<YxUserAddress> selectList(Long uid) {
|
||||
LambdaQueryWrapper<YxUserAddress> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(YxUserAddress::getUid,uid);
|
||||
List<YxUserAddress> yxUserAddresses = yxUserAddressMapper.selectList(wrapper);
|
||||
return yxUserAddresses;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -28,9 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@@ -164,6 +163,7 @@ public class YxUserSignServiceImpl extends BaseServiceImpl<YxUserSignMapper, YxU
|
||||
if(!isDaySign && !isYesterDaySign) {
|
||||
userQueryVo.setSignNum(0);
|
||||
}
|
||||
|
||||
return userQueryVo;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package co.yixiang.modules.user.vo;
|
||||
|
||||
|
||||
import co.yixiang.modules.user.domain.YxUserLevelBenefit;
|
||||
import co.yixiang.modules.user.service.dto.TaskDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -8,6 +9,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -56,7 +58,7 @@ public class YxSystemUserLevelQueryVo implements Serializable {
|
||||
private String explain;
|
||||
|
||||
@ApiModelProperty(value = "会员权益说明")
|
||||
private String benefit;
|
||||
private List<YxUserLevelBenefit> benefits;
|
||||
|
||||
@ApiModelProperty(value = "添加时间")
|
||||
private Integer addTime;
|
||||
|
||||
@@ -9,6 +9,8 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -151,4 +152,23 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
String dateString = format.format(date);
|
||||
return dateString;
|
||||
}
|
||||
|
||||
//获取未来几天的方法
|
||||
public static ArrayList<String> getFutureDaysList(int num){
|
||||
ArrayList<String> futureDaysList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
futureDaysList.add(getFutureDay(i));
|
||||
}
|
||||
return futureDaysList;
|
||||
}
|
||||
|
||||
//获取未来某天的方法
|
||||
public static String getFutureDay(int past){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.DAY_OF_YEAR,calendar.get(Calendar.DAY_OF_YEAR)+past);
|
||||
Date today = calendar.getTime();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd");
|
||||
String result = dateFormat.format(today);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user