Commit d5a2a3da by 周晓航

【紧急】【盛香亭】储值卡增加营销规则同享配置(对内5.23,对外5.26)

parent cedddf18
package cn.freemud.entities.dto.pay.svc;
import lombok.Data;
import java.util.List;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/5/10 17:52
* @description :
*/
@Data
public class BatchSvcInfoRequest {
/**
* 卡档案id
*/
private Integer applyId;
/**
* 商户编号
*/
private String partnerId;
/**
* 接口版本
*/
private String ver;
/**
* 门店id(需要校验的门店)
*/
private String storeId;
/**
* 需要校验的组织渠道Id集合
*/
private List<String> orgIds;
}
package cn.freemud.entities.dto.pay.svc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/5/10 18:00
* @description :
*/
@Data
public class CardApplyRes {
@ApiModelProperty("卡档案Id")
private Integer id;
@ApiModelProperty(value = "卡档案名")
private String name;
@ApiModelProperty(value = "卡面信息,卡面配图链接")
private String mark;
@ApiModelProperty(value = "规则说明")
private String ruleRemark;
@ApiModelProperty(value = "卡档案编号")
private String thirdNo;
@ApiModelProperty(value = "创建人")
private String createUser;
@ApiModelProperty(value = "最后操作人")
private String updateUser;
@ApiModelProperty(value = "创建时间str")
private String createDate;
@ApiModelProperty(value = "最后更新时间Str")
private String updateDate;
@ApiModelProperty(value = "在售状态,默认上线,1上架,0下架")
private Integer onShelf;
@ApiModelProperty(value = "启充状态,默认启用,1-启用,0-停用")
private Integer enableRecharge;
@ApiModelProperty(value = "推荐状态, 默认未设置,1-推荐,0-未设置")
private Integer enablePromote;
// /**
// * 门店列表
// */
// @ApiModelProperty("门店列表")
// private List<CardApplyStoreVo> stores;
//
// /**
// * 渠道分组列表
// */
// @ApiModelProperty("渠道分组列表")
// private List<CardApplyOrgVo> orgs;
//
// /**
// * 渠道分组列表
// */
// @ApiModelProperty("推荐地区列表")
// private List<CardApplyRegionRecommendVo> regions;
@ApiModelProperty(value = "适用门店:1-部分门店 2-渠道分组 3-全部门店")
private Byte whiteChoiceMode;
@ApiModelProperty(value = "不适用门店:1-部分门店 2-渠道分组 3-无")
private Byte blackChoiceMode;
@ApiModelProperty(value = "推荐模式:1-全部 2-部分渠道")
private Byte recommendMode;
@ApiModelProperty(value = "不推荐模式:1-全部 2-部分渠道")
private Byte notRecommendMode;
@ApiModelProperty(value = "适用范围,全门店通用或仅限上海地区门店使用等")
private String applyScope;
@ApiModelProperty(value = "0:线上卡档案, 1:线下卡档案")
private Integer cardApplyType;
@ApiModelProperty(value = "储值卡活动标签图片地址")
private String promotionLabelImg;
@ApiModelProperty(value = "储值卡活动标签宣传语")
private String promotionLabelDesc;
/**
*/
@ApiModelProperty("是否开启线下充值(设为仅线下充值后,用户只能到门店充值,在小程序无法充值) 1-是 0-否,默认为0")
private Byte enableOfflineRecharge;
@ApiModelProperty("有效期")
private Integer effectDuration;
/**
* 复用card表中的cardType字段
*/
@ApiModelProperty("卡类型:0礼品卡,3储值卡")
private Integer applyType;
@ApiModelProperty("有效期类型 0|永久有效 1|固定时长 2|固定日期")
private Integer effectType;
@ApiModelProperty("固定时长有效期时间单位 6|年 5|月 4|日 3|时 2|分 1|秒")
private Integer timeUnit;
@ApiModelProperty(value = "同步到哪个三方:1:银商,null默认不同步")
private Integer syncThirdParty;
@ApiModelProperty("渠道和门店黑白名单校验,true通过,false未通过")
private Boolean whiteBlackVerify;
@ApiModelProperty(value = "是否设置获取成长值 1-是 0-否")
private Integer enableGrowth;
@ApiModelProperty(value = "是否设置获取积分配置 1-是 0-否")
private Integer enableScore;
@ApiModelProperty(value = "卡档案子类型 1:普通, 2:抖音")
private Integer cardApplySubType;
@ApiModelProperty(value = "是否开启转赠 1-开启 0-关闭")
private Integer enableTransfer;
@ApiModelProperty(value = "单人当天冲值次数限制")
private Integer dayChargeTimes;
@ApiModelProperty(value = "单人最大冲值次数限制")
private Integer maxChargeTimes;
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing;
}
......@@ -325,4 +325,7 @@ public class CreateOrderVo {
*/
private String contactsName;
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing = 1;
}
......@@ -12,6 +12,7 @@
*/
package cn.freemud.entities.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -26,6 +27,10 @@ import java.util.List;
@Data
@Builder
public class ShoppingCartInfoRequestVo {
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing = 1;
/**
* 链路号
*/
......
package cn.freemud.entities.vo.order;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
......@@ -13,6 +14,10 @@ public class CreateOrderPremiumExchangeActivityVo {
private String activityCode;
@NotNull(message = "activityName 不能为空")
private String activityName;
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing = 1;
/**
* 加价购sku商品信息
*/
......
......@@ -26,6 +26,8 @@ import cn.freemud.entities.dto.order.UnifiedPayResponseDto;
import cn.freemud.entities.dto.pay.PayOrderDto;
import cn.freemud.entities.dto.pay.PayProductDto;
import cn.freemud.entities.dto.pay.UnifiedOrderRequestDto;
import cn.freemud.entities.dto.pay.svc.BatchSvcInfoRequest;
import cn.freemud.entities.dto.pay.svc.CardApplyRes;
import cn.freemud.entities.dto.shoppingCart.GetShoppingCartGoodsApportionDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.dto.store.*;
......@@ -41,6 +43,7 @@ import cn.freemud.service.adapter.OrderCheckAdapter;
import cn.freemud.service.thirdparty.CustomerPropertyClient;
import cn.freemud.service.thirdparty.ShoppingCartClient;
import cn.freemud.service.thirdparty.StoreBaseApiClient;
import cn.freemud.service.thirdparty.SvcAppClient;
import cn.freemud.utils.AppLogUtil;
import cn.freemud.utils.DateUtils;
import cn.freemud.utils.ResponseUtil;
......@@ -116,6 +119,9 @@ public class CheckOrder {
@Autowired
private StoreBaseApiClient storeBaseApiClient;
@Autowired
private SvcAppClient svcAppClient;
// 【华莱士】【订单C端记录不分账的卡面编号】不让走分账,卡面编号--11840,11845,11846,11853,11854,11855,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11906
@Value("${card.pay.unDistribution.applyId:}")
private List<Integer> unDistributions;
......@@ -197,11 +203,51 @@ public class CheckOrder {
// createOrderVo.setUnDistribution(1);
// }
// }
// 获取储值卡是否配置了优惠同享等
createOrderVo.setEnableSharing(this.commonCheckSVCEnableSharing(memberCardCode,cardCodes,createOrderVo.getPartnerId()));
createOrderVo.setUserId(userLoginInfoDto.getMemberId());
return userLoginInfoDto;
}
public void checkMemberSvcCard(String partnerId, String memberId, SellCouponCreateOrderVo requestVo) {
/**
*
* @param memberCardCode
* @param cardCodes
* @param partnerId
* @return 是否与营销活动共享 1-是 0-否
*/
public Integer commonCheckSVCEnableSharing(List<GetSvcInfoByMemberIdResponseVo> memberCardCode, Set<String> cardCodes, String partnerId){
Integer enableSharing = 1;
if (CollectionUtils.isNotEmpty(memberCardCode) && CollectionUtils.isNotEmpty(cardCodes)) {
List<BatchSvcInfoRequest> requestList = new ArrayList<>();
memberCardCode.stream().filter(c -> cardCodes.contains(c.getCardCode())).forEach(cardInfo -> {
BatchSvcInfoRequest request = new BatchSvcInfoRequest();
request.setApplyId(cardInfo.getApplyId());
request.setPartnerId(partnerId);
request.setVer("1");
requestList.add(request);
});
cn.freemud.base.entity.BaseResponse<List<CardApplyRes>> response = svcAppClient.multiInfo(requestList);
if (response != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(response.getCode())) {
if (CollectionUtils.isNotEmpty(response.getResult())) {
CardApplyRes cardApplyRes1 = response.getResult().stream().filter(cardApplyRes -> cardApplyRes.getEnableSharing().compareTo(0) == 0).findFirst().orElse(null);
if (Objects.nonNull(cardApplyRes1)) {
enableSharing = cardApplyRes1.getEnableSharing();
}
}
}
}
return enableSharing;
}
/**
*
* @param partnerId
* @param memberId
* @param requestVo
* @return 是否与营销活动共享 1-是 0-否
*/
public Integer checkMemberSvcCard(String partnerId, String memberId, SellCouponCreateOrderVo requestVo) {
if (StringUtils.isNotBlank(requestVo.getCardCode())) {
//校验会员svc卡信息
List<GetSvcInfoByMemberIdResponseVo> memberCardCode = checkCardCode(partnerId, memberId, Sets.newHashSet(requestVo.getCardCode()));
......@@ -212,7 +258,9 @@ public class CheckOrder {
// requestVo.setUnDistribution(1);
// }
// }
return this.commonCheckSVCEnableSharing(memberCardCode, Collections.singleton(requestVo.getCardCode()), partnerId);
}
return 1;
}
......@@ -705,6 +753,7 @@ public class CheckOrder {
.bizType(createOrderVo.getBizType())
.build();
shoppingCartInfoRequestVo.setTrackingNo(LogThreadLocal.getTrackingNo());
shoppingCartInfoRequestVo.setEnableSharing(createOrderVo.getEnableSharing());
// 如果使用优惠券或者商品券,校验 couponCode
// if (StringUtils.isNotBlank(createOrderVo.getCouponCode())) {
// // 校验couponCode
......
......@@ -311,7 +311,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
// 查询用户信息
AssortmentCustomerInfoVo userLoginInfoDto = checkOrder.checkOrderByMemberNew(requestVo.getSessionId());
// 如果用户适用SVC 卡支付,则校验svc卡,
checkOrder.checkMemberSvcCard(userLoginInfoDto.getPartnerId(), userLoginInfoDto.getMemberId(), requestVo);
Integer enableSharing = checkOrder.checkMemberSvcCard(userLoginInfoDto.getPartnerId(), userLoginInfoDto.getMemberId(), requestVo);
String trackingNo = LogThreadLocal.getTrackingNo();
String partnerId = userLoginInfoDto.getPartnerId();
String storeId = requestVo.getShopId();
......@@ -376,6 +376,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
}
CreateOrderRequest createOrderRequest = (CreateOrderRequest) createOrderRequestResponse.getResult();
createOrderRequest.setEnableSharing(enableSharing);
//标准化平台虚拟商品特价活动计算,不包含蜜雪APP买虚拟商品
List<SubtractStockVO> stockBeanDtos = calculationDiscount(partnerId, storeId, userLoginInfoDto.getMemberId(), productInfosDto.getData().getProducts().get(0), createOrderRequest);
......
......@@ -2,13 +2,18 @@ package cn.freemud.service.thirdparty;
import cn.freemud.annotations.LogIgnoreFeign;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.dto.pay.svc.BatchSvcInfoRequest;
import cn.freemud.entities.dto.pay.svc.CardApplyRes;
import cn.freemud.entities.dto.pay.svc.SVCCardAmountRequestDto;
import cn.freemud.entities.dto.pay.svc.SVCCardAmountResponseDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@FeignClient(name="fm-svc-app", url = "${saas.svc.app.feign.url:}")
import java.util.List;
@FeignClient(name = "fm-svc-app", url = "${saas.svc.app.feign.url:}")
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public interface SvcAppClient {
......@@ -17,4 +22,10 @@ public interface SvcAppClient {
@LogIgnoreFeign(logMessage = "batchQueryCardAmount")
BaseResponse<SVCCardAmountResponseDto> batchQueryCardAmount(SVCCardAmountRequestDto svcComPayRequestDto);
//批量查询卡配置规则
@PostMapping(value = "/svc/cardapply/multi-info")
@LogIgnoreFeign(logMessage = "/svc/cardapply/multi-info")
BaseResponse<List<CardApplyRes>> multiInfo(@RequestBody List<BatchSvcInfoRequest> requestList);
}
......@@ -15,6 +15,7 @@ package com.freemud.application.sdk.api.ordercenter.request.create;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.application.sdk.api.ordercenter.request.BaseRequest;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
......@@ -23,6 +24,12 @@ import java.util.List;
@Data
public class CreateOrderRequest extends BaseRequest {
/**
* 该字段内部查询得出结果, 不可由前端传递
*/
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing;
//订单编号
private String orderCode;
......
......@@ -24,5 +24,5 @@ public class DiscountSharingDto {
* 储值卡需求: 使用的储值卡是否与 促销活动同享
*/
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing = 0;
private Integer enableSharing = 1;
}
......@@ -160,7 +160,7 @@ public class ShoppingCartInfoRequestVo extends BaseRequestVo {
* 储值卡需求: 使用的储值卡是否与 促销活动同享
*/
@ApiModelProperty(value = "是否与营销活动共享 1-是 0-否")
private Integer enableSharing = 0;
private Integer enableSharing = 1;
@Data
public final static class SendGoods {
......
......@@ -1704,7 +1704,7 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
activityCalculationDiscountRequestDto.setProductChannel(BusinessTypeEnum.SAAS_DELIVERY.getCode());
}
if (Objects.nonNull(discountSharingDto)) {
if (Objects.nonNull(discountSharingDto.getEnableSharing()) && discountSharingDto.getEnableSharing().compareTo(1) == 0) {
if (Objects.nonNull(discountSharingDto.getEnableSharing()) && discountSharingDto.getEnableSharing().compareTo(0) == 0) {
// 储值卡算计, 剔除互斥活动 只能参加活动类型为29
activityCalculationDiscountRequestDto.setActivityTypes(Collections.singletonList(ActivityTypeEnum.TYPE_29.getCode()));
}
......
......@@ -231,7 +231,7 @@ public class CalculationSharingDiscountService {
activeService.buildChooseGoodsService(calculationSharingDiscountRequestDto, shoppingCartInfoRequestVo == null ? null : shoppingCartInfoRequestVo.getChooseGoods());
if(sharingDto != null){
calculationSharingDiscountRequestDto.setAutoCoupon(sharingDto.getAutoCoupon());
if (Objects.nonNull(sharingDto.getEnableSharing()) && sharingDto.getEnableSharing().compareTo(1) == 0) {
if (Objects.nonNull(sharingDto.getEnableSharing()) && sharingDto.getEnableSharing().compareTo(0) == 0) {
// 储值卡算计, 剔除互斥活动 只能参加活动类型为29
calculationSharingDiscountRequestDto.setActivityTypes(Collections.singletonList(ActivityTypeEnum.TYPE_29.getCode()));
}
......
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