Commit d229222d by 周晓航

新增逻辑, 黑名单用户 不可使用 积分抵扣/支付

parent 7562a4fb
......@@ -20,6 +20,14 @@ public class BlacklistDto {
*/
private String memberId;
/**
* 是否使用用户积分
* 1=不显示积分
* 2=显示积分但不扣减
* 3=显示积分且扣减
* 消费黑名单用户 不管是否满足 都不能使用积分消费
*/
private Integer useCustomerScore;
/**
* 当前这一笔订单需要消费的金额
......
package cn.freemud.handler;
import cn.freemud.constant.CustomerScoreConstant;
import cn.freemud.entities.dto.blacklist.BlacklistDto;
import cn.freemud.entities.dto.blacklist.OrderBlacklistResp;
import cn.freemud.entities.dto.blacklist.Result;
import cn.freemud.entities.dto.blacklist.req.BlackListQueryByClient;
import cn.freemud.entities.dto.blacklist.resp.MemberBlacklistVO;
......@@ -9,6 +9,8 @@ import cn.freemud.service.thirdparty.DataCenterClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
......@@ -41,6 +43,12 @@ public class MemberBlacklistHandler {
if (!result.isExist()) {
return null;
}
StringBuilder sb = new StringBuilder();
// 消费黑名单用户 不可使用积分支付
if (Objects.nonNull(blacklistDto.getUseCustomerScore()) && blacklistDto.getUseCustomerScore().compareTo(CustomerScoreConstant.SUBSTRACT.getValue()) == 0) {
sb.append("加入消费黑名单的用户不可使用积分");
return sb.toString();
}
//step2 存在校验剩余余额
Long limitAmount = result.getLimitAmount();
Long shoppingTotalAmount = result.getShoppingTotalAmount();
......@@ -56,7 +64,6 @@ public class MemberBlacklistHandler {
// orderBlacklistResp.setSurplusAmount(surplusAmount < 0 ? 0L : surplusAmount);
// return orderBlacklistResp;
// 您的消费额度还有3元,暂无法支付,如有疑问,详询客服热线4008899096
StringBuilder sb = new StringBuilder();
long amount = surplusAmount < 0L ? 0L : surplusAmount * 100;
sb.append("您的消费额度还有")
.append(amount)
......
......@@ -299,6 +299,7 @@ public class MallOrderServiceImpl implements MallOrderService {
blacklistDto.setAmount(baseCreateOrderRequest.getAmount());
blacklistDto.setPartnerId(createOrderVo.getPartnerId());
blacklistDto.setMemberId(createOrderVo.getUserId());
blacklistDto.setUseCustomerScore(createOrderVo.getUseCustomerScore());
String touchStr = memberBlacklistHandler.checkisTrueBlacklist(blacklistDto);
if (StringUtils.isNotEmpty(touchStr)) {
CreateOrderResponse baseOrderResponse = new CreateOrderResponse();
......
......@@ -2502,6 +2502,7 @@ public class OrderServiceImpl implements Orderservice {
blacklistDto.setAmount(amount);
blacklistDto.setPartnerId(createOrderVo.getPartnerId());
blacklistDto.setMemberId(createOrderVo.getUserId());
blacklistDto.setUseCustomerScore(createOrderVo.getUseCustomerScore());
String touchStr = memberBlacklistHandler.checkisTrueBlacklist(blacklistDto);
if (StringUtils.isNotEmpty(touchStr)) {
return ResponseUtil.error(ResponseResult.TOUCH_SHOPPING_BLACK_LIST.getCode(), touchStr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment