Merge branch 'liushuai'
解决积分商品购买问题,部分参数校验问题,等各种问题优化 # Conflicts: # framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java
This commit is contained in:
commit
76fcf84043
2
DB/version4.2.2to4.2.3.sql
Normal file
2
DB/version4.2.2to4.2.3.sql
Normal file
@ -0,0 +1,2 @@
|
||||
/** 新增会员获的总积分 **/
|
||||
ALTER TABLE li_store ADD merchant_euid varchar(255) COMMENT '客服标识';
|
@ -66,11 +66,6 @@ public class MemberAddressBuyerController {
|
||||
@ApiOperation(value = "修改会员收件地址")
|
||||
@PutMapping
|
||||
public ResultMessage<MemberAddress> editShippingAddress(@Valid MemberAddress shippingAddress) {
|
||||
//修改会员地址
|
||||
shippingAddress.setMemberId(UserContext.getCurrentUser().getId());
|
||||
if(shippingAddress.getIsDefault()==null){
|
||||
shippingAddress.setIsDefault(false);
|
||||
}
|
||||
return ResultUtil.data(memberAddressService.updateMemberAddress(shippingAddress));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,49 @@
|
||||
package cn.lili.controller.common;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
import cn.lili.modules.system.entity.dto.ImSetting;
|
||||
import cn.lili.modules.system.entity.enums.SettingEnum;
|
||||
import cn.lili.modules.system.service.SettingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* IM控制器
|
||||
*
|
||||
* @author Chopper
|
||||
* @version v1.0
|
||||
* 2021-09-16 15:32
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/IM")
|
||||
@Api(tags = "IM 中心")
|
||||
public class IMController {
|
||||
|
||||
@Autowired
|
||||
private SettingService settingService;
|
||||
|
||||
@ApiOperation(value = "获取店铺列表分页")
|
||||
@GetMapping
|
||||
public ResultMessage<String> getUrl() {
|
||||
String imUrl;
|
||||
try {
|
||||
Setting imSettingVal = settingService.get(SettingEnum.IM_SETTING.name());
|
||||
ImSetting imSetting = JSONUtil.toBean(imSettingVal.getSettingValue(), ImSetting.class);
|
||||
imUrl = imSetting.getHttpUrl() + "?tenant_id=" + imSetting.getTenantId()+"&merchant_euid=";
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(ResultCode.PLATFORM_NOT_SUPPORTED_IM);
|
||||
}
|
||||
return ResultUtil.data(imUrl);
|
||||
}
|
||||
|
||||
}
|
@ -17,6 +17,7 @@ import cn.lili.modules.order.order.entity.dos.Order;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderPromotionTypeEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.OrderStatusEnum;
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import cn.lili.modules.order.trade.entity.enums.AfterSaleStatusEnum;
|
||||
import cn.lili.modules.system.entity.dos.Setting;
|
||||
@ -62,7 +63,7 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
//获取积分设置
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(Long.valueOf(pointSetting.getRegister().longValue()), PointTypeEnum.INCREASE.name(), member.getId(), "会员注册,赠送积分" + pointSetting.getRegister() + "分");
|
||||
memberService.updateMemberPoint(pointSetting.getRegister().longValue(), PointTypeEnum.INCREASE.name(), member.getId(), "会员注册,赠送积分" + pointSetting.getRegister() + "分");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -75,7 +76,7 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
//获取积分设置
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(Long.valueOf(pointSetting.getComment().longValue()), PointTypeEnum.INCREASE.name(), memberEvaluation.getMemberId(), "会员评价,赠送积分" + pointSetting.getComment() + "分");
|
||||
memberService.updateMemberPoint(pointSetting.getComment().longValue(), PointTypeEnum.INCREASE.name(), memberEvaluation.getMemberId(), "会员评价,赠送积分" + pointSetting.getComment() + "分");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,30 +87,43 @@ public class MemberPointExecute implements MemberRegisterEvent, GoodsCommentComp
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
|
||||
if (orderMessage.getNewStatus().equals(OrderStatusEnum.COMPLETED)) {
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
//根据订单编号获取订单数据,如果订单促销类型不为空,并且订单促销类型为积分订单 则直接返回
|
||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) && order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||
return;
|
||||
switch (orderMessage.getNewStatus()) {
|
||||
case CANCELLED: {
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
Long point = order.getPriceDetailDTO().getPayPoint();
|
||||
if (point <= 0) {
|
||||
return;
|
||||
}
|
||||
//如果未付款,则不去要退回相关代码执行
|
||||
if (order.getPayStatus().equals(PayStatusEnum.UNPAID.name())) {
|
||||
return;
|
||||
}
|
||||
String content = "订单取消,积分返还:" + point + "分";
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point, PointTypeEnum.INCREASE.name(), order.getMemberId(), content);
|
||||
break;
|
||||
}
|
||||
//获取积分设置
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//计算赠送积分数量
|
||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), order.getFlowPrice(), 0);
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point.longValue(), PointTypeEnum.INCREASE.name(), order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
||||
//取消订单恢复积分
|
||||
} else if (orderMessage.getNewStatus().equals(OrderStatusEnum.CANCELLED)) {
|
||||
//根据订单编号获取订单数据,如果为积分订单则跳回
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
//增加对积分订单的判定,如果积分支付,取消订单则退还用户积分
|
||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) &&
|
||||
order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name()) && order.getPriceDetailDTO().getPayPoint() != null) {
|
||||
memberService.updateMemberPoint(Convert.toLong(order.getPriceDetailDTO().getPayPoint()), PointTypeEnum.INCREASE.name(), order.getMemberId(), "订单取消,恢复积分:" + order.getPriceDetailDTO().getPayPoint() + "分");
|
||||
case COMPLETED: {
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
//根据订单编号获取订单数据,如果订单促销类型不为空,并且订单促销类型为积分订单 则直接返回
|
||||
if (StringUtils.isNotEmpty(order.getOrderPromotionType()) && order.getOrderPromotionType().equals(OrderPromotionTypeEnum.POINTS.name())) {
|
||||
return;
|
||||
}
|
||||
//获取积分设置
|
||||
PointSetting pointSetting = getPointSetting();
|
||||
//计算赠送积分数量
|
||||
Double point = CurrencyUtil.mul(pointSetting.getMoney(), order.getFlowPrice(), 0);
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point.longValue(), PointTypeEnum.INCREASE.name(), order.getMemberId(), "会员下单,赠送积分" + point + "分");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提交售后后扣除积分
|
||||
*
|
||||
|
@ -1,57 +0,0 @@
|
||||
package cn.lili.event.impl;
|
||||
|
||||
import cn.lili.event.OrderStatusChangeEvent;
|
||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import cn.lili.modules.order.order.entity.dos.Order;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderMessage;
|
||||
import cn.lili.modules.order.order.entity.enums.PayStatusEnum;
|
||||
import cn.lili.modules.order.order.service.OrderService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2021-03-13 16:58
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PointExecute implements OrderStatusChangeEvent {
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@Override
|
||||
public void orderChange(OrderMessage orderMessage) {
|
||||
|
||||
switch (orderMessage.getNewStatus()) {
|
||||
case CANCELLED:
|
||||
Order order = orderService.getBySn(orderMessage.getOrderSn());
|
||||
Long point = order.getPriceDetailDTO().getPayPoint();
|
||||
if (point <= 0) {
|
||||
return;
|
||||
}
|
||||
//如果未付款,则不去要退回相关代码执行
|
||||
if (order.getPayStatus().equals(PayStatusEnum.UNPAID.name())) {
|
||||
return;
|
||||
}
|
||||
//如果他不处于连续赠送阶段,则只赠送签到积分数
|
||||
String content = "订单取消,积分返还:" + point + "分";
|
||||
//赠送会员积分
|
||||
memberService.updateMemberPoint(point, PointTypeEnum.INCREASE.name(), order.getMemberId(), content);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -37,6 +37,8 @@ public enum ResultCode {
|
||||
LIMIT_ERROR(1003, "访问过于频繁,请稍后再试"),
|
||||
ILLEGAL_REQUEST_ERROR(1004, "非法请求,请重新刷新页面操作"),
|
||||
IMAGE_FILE_EXT_ERROR(1005, "不支持图片格式"),
|
||||
PLATFORM_NOT_SUPPORTED_IM(1006, "平台未开启IM"),
|
||||
STORE_NOT_SUPPORTED_IM(1007, "店铺未开启IM"),
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
@ -334,7 +336,8 @@ public enum ResultCode {
|
||||
* 其他促销
|
||||
*/
|
||||
MEMBER_SIGN_REPEAT(47001, "请勿重复签到"),
|
||||
POINT_GOODS_ACTIVE_STOCK_ERROR(47002, "最低金额不能高于商品金额"),
|
||||
POINT_GOODS_ACTIVE_STOCK_ERROR(47002, "活动库存数量不能高于商品库存"),
|
||||
POINT_GOODS_ACTIVE_STOCK_INSUFFICIENT(47003, "积分商品库存不足"),
|
||||
|
||||
/**
|
||||
* 砍价活动
|
||||
|
@ -31,7 +31,7 @@ public class DistributionGoodsSearchParams extends PageVO {
|
||||
|
||||
public <T> QueryWrapper<T> distributionQueryWrapper() {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(goodsName), "dg.goods_name", goodsName);
|
||||
queryWrapper.like(StringUtils.isNotEmpty(goodsName), "dg.goods_name", goodsName);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,10 @@ public class DraftGoods extends BaseEntity {
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Length(max = 30, message = "商品规格编号太长,不能超过30个字符")
|
||||
@ApiModelProperty(value = "商品编号")
|
||||
private String sn;
|
||||
@Max(value = 99999999, message = "价格不能超过99999999")
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private Double price;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "品牌id")
|
||||
private String brandId;
|
||||
@ -51,9 +52,6 @@ public class DraftGoods extends BaseEntity {
|
||||
@ApiModelProperty(value = "卖点")
|
||||
private String sellingPoint;
|
||||
|
||||
@ApiModelProperty(value = "重量")
|
||||
@Max(value = 99999999, message = "重量不能超过99999999")
|
||||
private Double weight;
|
||||
/**
|
||||
* @see GoodsStatusEnum
|
||||
*/
|
||||
@ -67,14 +65,6 @@ public class DraftGoods extends BaseEntity {
|
||||
@ApiModelProperty(value = "商品移动端详情")
|
||||
private String mobileIntro;
|
||||
|
||||
@Max(value = 99999999, message = "价格不能超过99999999")
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private Double price;
|
||||
|
||||
@Max(value = 99999999, message = "成本价格99999999")
|
||||
@ApiModelProperty(value = "成本价格")
|
||||
private Double cost;
|
||||
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private Integer buyCount;
|
||||
|
||||
|
@ -20,6 +20,9 @@ import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -35,17 +38,17 @@ import java.util.Map;
|
||||
public class Goods extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 370683495251252601L;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
@Length(max = 100, message = "商品名称提案仓,不能超过100个字符")
|
||||
private String goodsName;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@Length(max = 30, message = "商品规格编号太长,不能超过30个字符")
|
||||
@ApiModelProperty(value = "商品编号")
|
||||
private String sn;
|
||||
|
||||
@ApiModelProperty(value = "商品价格", required = true)
|
||||
@NotNull(message = "商品价格不能为空")
|
||||
@Min(value = 0, message = "商品价格不能为负数")
|
||||
@Max(value = 99999999, message = "商品价格不能超过99999999")
|
||||
private Double price;
|
||||
|
||||
@ApiModelProperty(value = "品牌id")
|
||||
private String brandId;
|
||||
@ -56,129 +59,69 @@ public class Goods extends BaseEntity {
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
private String goodsUnit;
|
||||
|
||||
/**
|
||||
* 卖点
|
||||
*/
|
||||
|
||||
@Length(max = 60, message = "商品卖点太长,不能超过60个字符")
|
||||
@ApiModelProperty(value = "卖点")
|
||||
private String sellingPoint;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
@ApiModelProperty(value = "重量")
|
||||
@Max(value = 99999999, message = "重量不能超过99999999")
|
||||
private Double weight;
|
||||
/**
|
||||
* 上架状态
|
||||
*
|
||||
* @see GoodsStatusEnum
|
||||
*/
|
||||
@ApiModelProperty(value = "上架状态")
|
||||
private String marketEnable;
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "详情")
|
||||
private String intro;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
@Max(value = 99999999, message = "价格不能超过99999999")
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
private Double price;
|
||||
/**
|
||||
* 成本价格
|
||||
*/
|
||||
@Max(value = 99999999, message = "成本价格99999999")
|
||||
@ApiModelProperty(value = "成本价格")
|
||||
private Double cost;
|
||||
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private Integer buyCount;
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
|
||||
@Max(value = 99999999, message = "库存不能超过99999999")
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 商品好评率
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "商品好评率")
|
||||
private Double grade;
|
||||
/**
|
||||
* 缩略图路径
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "缩略图路径")
|
||||
private String thumbnail;
|
||||
/**
|
||||
* 小图路径
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "小图路径")
|
||||
private String small;
|
||||
/**
|
||||
* 原图路径
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "原图路径")
|
||||
private String original;
|
||||
/**
|
||||
* 店铺分类id
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "店铺分类id")
|
||||
private String storeCategoryPath;
|
||||
/**
|
||||
* 评论数量
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "评论数量")
|
||||
private Integer commentNum;
|
||||
/**
|
||||
* 卖家id
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "卖家id")
|
||||
private String storeId;
|
||||
/**
|
||||
* 卖家名字
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "卖家名字")
|
||||
private String storeName;
|
||||
/**
|
||||
* 运费模板id
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "运费模板id")
|
||||
private String templateId;
|
||||
/**
|
||||
* 审核状态
|
||||
*
|
||||
* @see GoodsAuthEnum
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "审核状态")
|
||||
private String isAuth;
|
||||
/**
|
||||
* 审核信息
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "审核信息")
|
||||
private String authMessage;
|
||||
/**
|
||||
* 下架原因
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "下架原因")
|
||||
private String underMessage;
|
||||
/**
|
||||
* 是否自营
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "是否自营")
|
||||
private Boolean selfOperated;
|
||||
/**
|
||||
* 商品移动端详情
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "商品移动端详情")
|
||||
private String mobileIntro;
|
||||
/**
|
||||
* 商品视频
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "商品视频")
|
||||
private String goodsVideo;
|
||||
|
||||
@ -209,9 +152,6 @@ public class Goods extends BaseEntity {
|
||||
this.categoryPath = goodsOperationDTO.getCategoryPath();
|
||||
this.storeCategoryPath = goodsOperationDTO.getStoreCategoryPath();
|
||||
this.brandId = goodsOperationDTO.getBrandId();
|
||||
this.sn = goodsOperationDTO.getSn();
|
||||
this.price = goodsOperationDTO.getPrice();
|
||||
this.weight = goodsOperationDTO.getWeight();
|
||||
this.templateId = goodsOperationDTO.getTemplateId();
|
||||
this.recommend = goodsOperationDTO.getRecommend();
|
||||
this.sellingPoint = goodsOperationDTO.getSellingPoint();
|
||||
@ -219,8 +159,8 @@ public class Goods extends BaseEntity {
|
||||
this.goodsUnit = goodsOperationDTO.getGoodsUnit();
|
||||
this.intro = goodsOperationDTO.getIntro();
|
||||
this.mobileIntro = goodsOperationDTO.getMobileIntro();
|
||||
this.cost = goodsOperationDTO.getCost();
|
||||
this.goodsVideo = goodsOperationDTO.getGoodsVideo();
|
||||
this.price = goodsOperationDTO.getPrice();
|
||||
if (goodsOperationDTO.getGoodsParamsDTOList() != null && goodsOperationDTO.getGoodsParamsDTOList().isEmpty()) {
|
||||
this.params = JSONUtil.toJsonStr(goodsOperationDTO.getGoodsParamsDTOList());
|
||||
}
|
||||
|
@ -30,6 +30,12 @@ public class GoodsOperationDTO implements Serializable {
|
||||
@ApiModelProperty(hidden = true)
|
||||
private String goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品价格", required = true)
|
||||
@NotNull(message = "商品价格不能为空")
|
||||
@Min(value = 0, message = "商品价格不能为负数")
|
||||
@Max(value = 99999999, message = "商品价格不能超过99999999")
|
||||
private Double price;
|
||||
|
||||
@ApiModelProperty(value = "分类path")
|
||||
private String categoryPath;
|
||||
|
||||
@ -47,28 +53,6 @@ public class GoodsOperationDTO implements Serializable {
|
||||
@Length(max = 50, message = "商品名称不能超过50个字符")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品编号", required = true)
|
||||
@Length(max = 30, message = "商品编号太长,不能超过30个字符")
|
||||
private String sn;
|
||||
|
||||
@ApiModelProperty(value = "商品价格", required = true)
|
||||
@NotNull(message = "商品价格不能为空")
|
||||
@Min(value = 0, message = "商品价格不能为负数")
|
||||
@Max(value = 99999999, message = "商品价格不能超过99999999")
|
||||
private Double price;
|
||||
|
||||
@ApiModelProperty(value = "市场价格", required = true)
|
||||
@NotNull(message = "市场价格不能为空")
|
||||
@Min(value = 0, message = "市场价格不能为负数")
|
||||
@Max(value = 99999999, message = "市场价格不能超过99999999")
|
||||
private Double cost;
|
||||
|
||||
@ApiModelProperty(value = "重量", required = true)
|
||||
@NotNull(message = "商品重量不能为空")
|
||||
@Min(value = 0, message = "商品重量不能为负数")
|
||||
@Max(value = 99999999, message = "商品重量不能超过99999999")
|
||||
private Double weight;
|
||||
|
||||
@ApiModelProperty(value = "详情")
|
||||
private String intro;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class GoodsSearchParams extends PageVO {
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品编号")
|
||||
private String sn;
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "商家ID")
|
||||
private String storeId;
|
||||
@ -78,8 +78,8 @@ public class GoodsSearchParams extends PageVO {
|
||||
if (StringUtils.isNotEmpty(goodsName)) {
|
||||
queryWrapper.like("goods_name", goodsName);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sn)) {
|
||||
queryWrapper.eq("sn", sn);
|
||||
if (StringUtils.isNotEmpty(id)) {
|
||||
queryWrapper.eq("id", id);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(storeId)) {
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
|
@ -3,6 +3,7 @@ package cn.lili.modules.member.serviceimpl;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.modules.member.entity.enums.PointTypeEnum;
|
||||
import cn.lili.modules.system.entity.dto.PointSettingItem;
|
||||
import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
|
||||
import cn.lili.rocketmq.tags.MemberTagsEnum;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
@ -118,24 +119,19 @@ public class MemberSignServiceImpl extends ServiceImpl<MemberSignMapper, MemberS
|
||||
if (setting != null) {
|
||||
PointSetting pointSetting = new Gson().fromJson(setting.getSettingValue(), PointSetting.class);
|
||||
String content = "";
|
||||
Long point = -1L;
|
||||
//将对象转换成map 方便签到天数和签到积分数获取,方便扩展
|
||||
Map map = StringUtils.objectToMap(pointSetting);
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
//连续签到数
|
||||
Object dayObj = map.get("signIn" + i);
|
||||
//连续签到赠送积分
|
||||
Object pointObj = map.get("signIn" + i + "Point");
|
||||
if (dayObj != null && pointObj != null) {
|
||||
//如果当前连续赠送天数等于设置连续赠送天数 则记录赠送积分数
|
||||
if (dayObj == day) {
|
||||
point = Long.valueOf(map.get("signIn" + i + "Point").toString());
|
||||
//赠送积分
|
||||
Long point = null;
|
||||
List<PointSettingItem> pointSettingItems = pointSetting.getPointSettingItems();
|
||||
if (!pointSettingItems.isEmpty()) {
|
||||
for (PointSettingItem item : pointSettingItems) {
|
||||
if (item.getDay().equals(day)) {
|
||||
point = item.getPoint().longValue();
|
||||
content = "会员连续签到" + day + "天,赠送积分" + point + "分";
|
||||
}
|
||||
}
|
||||
}
|
||||
//如果他不处于连续赠送阶段,则只赠送签到积分数
|
||||
if (point == -1 && pointSetting.getSignIn() != null) {
|
||||
if (point == null && pointSetting.getSignIn() != null) {
|
||||
point = Long.valueOf(pointSetting.getSignIn().toString());
|
||||
content = "会员签到第" + day + "天,赠送积分" + point + "分";
|
||||
}
|
||||
|
@ -744,6 +744,10 @@ public class CartServiceImpl implements CartService {
|
||||
PointsGoodsVO pointsGoodsVO = pointsGoodsService.getPointsGoodsVOByMongo(cartSkuVO.getGoodsSku().getId());
|
||||
|
||||
if (pointsGoodsVO != null) {
|
||||
|
||||
if (pointsGoodsVO.getActiveStock() < 1) {
|
||||
throw new ServiceException(ResultCode.POINT_GOODS_ACTIVE_STOCK_INSUFFICIENT);
|
||||
}
|
||||
cartSkuVO.setPoint(pointsGoodsVO.getPoints());
|
||||
cartSkuVO.setPurchasePrice(0D);
|
||||
cartSkuVO.setPointsId(pointsGoodsVO.getId());
|
||||
|
File diff suppressed because one or more lines are too long
@ -185,7 +185,7 @@ public class KanjiaActivityGoodsServiceImpl extends ServiceImpl<KanJiaActivityGo
|
||||
}
|
||||
//校验活动库存是否超出此sku的库存
|
||||
if (goodsSku.getQuantity() < kanJiaActivityGoodsDTO.getStock()) {
|
||||
throw new ServiceException(ResultCode.POINT_GOODS_ACTIVE_STOCK_ERROR);
|
||||
throw new ServiceException(ResultCode.KANJIA_GOODS_ACTIVE_STOCK_ERROR);
|
||||
}
|
||||
//校验最低购买金额不能高于商品金额
|
||||
if (goodsSku.getPrice() < kanJiaActivityGoodsDTO.getPurchasePrice()) {
|
||||
|
@ -56,7 +56,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
@Override
|
||||
public MemberAddress saveMemberAddress(MemberAddress memberAddress) {
|
||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||
updateDefaultShippingAddress(memberAddress);
|
||||
removeDefaultAddress(memberAddress);
|
||||
//添加会员地址
|
||||
this.save(memberAddress);
|
||||
|
||||
@ -65,8 +65,18 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
|
||||
@Override
|
||||
public MemberAddress updateMemberAddress(MemberAddress memberAddress) {
|
||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||
updateDefaultShippingAddress(memberAddress);
|
||||
MemberAddress originalMemberAddress = this.getMemberAddress(memberAddress.getId());
|
||||
if (originalMemberAddress != null &&
|
||||
originalMemberAddress.getMemberId().equals(UserContext.getCurrentUser().getId())) {
|
||||
|
||||
if (memberAddress.getIsDefault() == null) {
|
||||
memberAddress.setIsDefault(false);
|
||||
}
|
||||
//判断当前地址是否为默认地址,如果为默认需要将其他的地址修改为非默认
|
||||
removeDefaultAddress(memberAddress);
|
||||
this.saveOrUpdate(memberAddress);
|
||||
}
|
||||
|
||||
return memberAddress;
|
||||
}
|
||||
|
||||
@ -81,7 +91,7 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
*
|
||||
* @param memberAddress 收件地址
|
||||
*/
|
||||
private void updateDefaultShippingAddress(MemberAddress memberAddress) {
|
||||
private void removeDefaultAddress(MemberAddress memberAddress) {
|
||||
//如果不是默认地址不需要处理
|
||||
if (memberAddress.getIsDefault()) {
|
||||
//将会员的地址修改为非默认地址
|
||||
@ -89,11 +99,6 @@ public class MemberAddressServiceImpl extends ServiceImpl<MemberAddressMapper, M
|
||||
lambdaUpdateWrapper.set(MemberAddress::getIsDefault, false);
|
||||
lambdaUpdateWrapper.eq(MemberAddress::getMemberId, memberAddress.getMemberId());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
|
||||
//修改会员地址
|
||||
this.update(memberAddress,
|
||||
new QueryWrapper<MemberAddress>()
|
||||
.eq("id", memberAddress.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,6 +97,11 @@ public class Store extends BaseEntity {
|
||||
@ApiModelProperty(value = "腾讯云智服小程序唯一标识")
|
||||
private String yzfMpSign;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "udesk IM标识")
|
||||
private String merchantEuid;
|
||||
|
||||
|
||||
public Store(Member member) {
|
||||
this.memberId = member.getId();
|
||||
this.memberName = member.getUsername();
|
||||
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
@ -27,15 +29,17 @@ public class StoreGoodsLabel extends BaseEntity {
|
||||
private String storeId;
|
||||
|
||||
@NotEmpty(message = "店铺商品分类名称不能为空")
|
||||
@Length(max = 20,message = "店铺商品分类名称太长")
|
||||
@ApiModelProperty("店铺商品分类名称")
|
||||
private String labelName;
|
||||
|
||||
|
||||
@NotNull(message = "店铺商品分类排序不能为空")
|
||||
@Max(value = 99999,message = "排序值太大")
|
||||
@ApiModelProperty("店铺商品分类排序")
|
||||
private BigDecimal sortOrder;
|
||||
|
||||
@NotNull(message = "父节点不能为空,需设定根节点或者某节点的子节点")
|
||||
@NotEmpty(message = "父节点不能为空,需设定根节点或者某节点的子节点")
|
||||
@ApiModelProperty(value = "父id, 根节点为0")
|
||||
private String parentId;
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
package cn.lili.modules.system.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* IM设置
|
||||
*
|
||||
* @author Bulbasaur
|
||||
* @since 2021/5/16 11:10 下午
|
||||
*/
|
||||
@Data
|
||||
public class ImSetting implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "平台地址")
|
||||
private String httpUrl;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "平台ID")
|
||||
private Integer tenantId;
|
||||
|
||||
|
||||
}
|
@ -31,6 +31,8 @@ public enum SettingEnum {
|
||||
EXPERIENCE_SETTING,
|
||||
//秒杀活动设置
|
||||
SECKILL_SETTING,
|
||||
//IM 配置
|
||||
IM_SETTING,
|
||||
|
||||
//微信 联合登陆设置
|
||||
WECHAT_CONNECT,
|
||||
|
@ -46,7 +46,7 @@ public class SettingManagerController {
|
||||
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
|
||||
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING")
|
||||
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING,IM")
|
||||
public ResultMessage saveConfig(@PathVariable String key, @RequestBody String configValue) {
|
||||
SettingEnum settingEnum = SettingEnum.valueOf(key);
|
||||
//获取系统配置
|
||||
@ -63,6 +63,23 @@ public class SettingManagerController {
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
@DemoSite
|
||||
@ApiOperation(value = "查看配置")
|
||||
@GetMapping(value = "/get/{key}")
|
||||
@ApiImplicitParam(name = "key", value = "配置key", paramType = "path"
|
||||
, allowableValues = "BASE_SETTING,EMAIL_SETTING,GOODS_SETTING,KUAIDI_SETTING,ORDER_SETTING,OSS_SETTING,POINT_SETTING," +
|
||||
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
|
||||
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING,IM"
|
||||
)
|
||||
public ResultMessage settingGet(@PathVariable String key) {
|
||||
return createSetting(key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 对配置进行过滤
|
||||
*
|
||||
@ -83,21 +100,6 @@ public class SettingManagerController {
|
||||
return configValue;
|
||||
}
|
||||
|
||||
|
||||
@DemoSite
|
||||
@ApiOperation(value = "查看配置")
|
||||
@GetMapping(value = "/get/{key}")
|
||||
@ApiImplicitParam(name = "key", value = "配置key", paramType = "path"
|
||||
, allowableValues = "BASE_SETTING,EMAIL_SETTING,GOODS_SETTING,KUAIDI_SETTING,ORDER_SETTING,OSS_SETTING,POINT_SETTING," +
|
||||
"WECHAT_PC_CONNECT,WECHAT_WAP_CONNECT,WECHAT_APP_CONNECT,WECHAT_MP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT," +
|
||||
"QQ_WEB_CONNECT,QQ_APP_CONNECT,WEIBO_CONNECT,ALIPAY_CONNECT," +
|
||||
"PAYMENT_SUPPORT,ALIPAY_PAYMENT,WECHAT_PAYMENT,SECKILL_SETTING,EXPERIENCE_SETTING"
|
||||
)
|
||||
public ResultMessage settingGet(@PathVariable String key) {
|
||||
return createSetting(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取表单
|
||||
* 这里主要包含一个配置对象为空,导致转换异常问题的处理,解决配置项增加减少,带来的系统异常,无法直接配置
|
||||
@ -179,6 +181,10 @@ public class SettingManagerController {
|
||||
return setting == null ?
|
||||
ResultUtil.data(new ExperienceSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ExperienceSetting.class));
|
||||
case IM_SETTING:
|
||||
return setting == null ?
|
||||
ResultUtil.data(new ImSetting()) :
|
||||
ResultUtil.data(JSONUtil.toBean(setting.getSettingValue(), ImSetting.class));
|
||||
default:
|
||||
throw new ServiceException(ResultCode.SETTING_NOT_TO_SET);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user