Commit 46d96f62 by ping.wu

Merge branches 'feature/20211228_微信视频号卖券门店对接_wuping' and 'master' of…

Merge branches 'feature/20211228_微信视频号卖券门店对接_wuping' and 'master' of http://gitlab.freemud.com/order-group-application/order-group
parents 4df9e021 4eb519cd
...@@ -21,7 +21,7 @@ public class SellCouponCreateOrderVo { ...@@ -21,7 +21,7 @@ public class SellCouponCreateOrderVo {
@NotEmpty(message = "sessionId 不能为空") @NotEmpty(message = "sessionId 不能为空")
private String sessionId; private String sessionId;
@NotEmpty(message = "shopId 门店号不能为空") // @NotEmpty(message = "shopId 门店号不能为空")
private String shopId; private String shopId;
//一键买券必传 //一键买券必传
......
package cn.freemud.enums;
public enum AggregationTypeEnum {
//6-会员、7-微商城、8-一键购买 9:积分商城
TYPE_1("1", ""),
TYPE_2("2", ""),
TYPE_3("3", ""),
TYPE_4("4", ""),
TYPE_5("5", ""),
/**
* 会员卡支付门店
*/
TYPE_6("6","会员卡支付门店"),
/**
* 微商城支付门店
*/
TYPE_7("7","微商城支付门店"),
/**
* 微商城一键购买门店
*/
TYPE_8("8","微商城一键购买门店"),
/**
* 积分商城支付门店
*/
TYPE_9("9","积分商城支付门店"),
/**
* 抖音卖券支付门店
*/
TYPE_10("10","抖音卖券支付门店"),
/**
* 虚拟卖券分账支付门店
*/
TYPE_11("11","虚拟卖券分账支付门店"),
TYPE_12("12",""),
/**
* 视频号卖券支付门店
*/
TYPE_13("13","视频号卖券支付门店"),
TYPE_14("14", "");
private String code;
private String desc;
AggregationTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
...@@ -203,7 +203,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService { ...@@ -203,7 +203,7 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
} }
String skuId = createOrderVo.getProducts().get(0).getSkuId(); String skuId = createOrderVo.getProducts().get(0).getSkuId();
//10-抖音卖券门店 //10-抖音卖券门店
AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(wxAppId,"10"); AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(wxAppId,AggregationTypeEnum.TYPE_10.getCode());
if ((wxAppStore == null || wxAppStore.getClientCode() == null)) { if ((wxAppStore == null || wxAppStore.getClientCode() == null)) {
return ResponseUtil.error(ResponseCodeConstant.RESPONSE_ERROR_STR, "支付门店未配置"); return ResponseUtil.error(ResponseCodeConstant.RESPONSE_ERROR_STR, "支付门店未配置");
} }
...@@ -323,6 +323,16 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService { ...@@ -323,6 +323,16 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
if (StringUtils.isNotBlank(requestVo.getCardCode()) && CollectionUtils.isNotEmpty(virtualProductSvcPayPartnerId) && !virtualProductSvcPayPartnerId.contains(partnerId)) { if (StringUtils.isNotBlank(requestVo.getCardCode()) && CollectionUtils.isNotEmpty(virtualProductSvcPayPartnerId) && !virtualProductSvcPayPartnerId.contains(partnerId)) {
return ResponseUtil.error(ResponseResult.PAY_SVC_CONFIG_ERROR); return ResponseUtil.error(ResponseResult.PAY_SVC_CONFIG_ERROR);
} }
AssortmentOpenPlatformIappWxappStore wxAppStore = null;
//微信视频号门店查询后台配置
if(StringUtils.isEmpty(requestVo.getShopId()) && StringUtils.isNotBlank(requestVo.getScene()) && CreateOrderSceneEnum.verifySceneOrder.contains(requestVo.getScene())){
wxAppStore = payService.getIappWxappStoreInfo(userLoginInfoDto.getWxAppId(),AggregationTypeEnum.TYPE_13.getCode());
if (wxAppStore == null) {
return ResponseUtil.error(ResponseCodeConstant.RESPONSE_ERROR_STR, "支付门店未配置");
}
storeId = wxAppStore.getStoreId();
}
// 获取门店信息 // 获取门店信息
StoreMixResponseDto storeMixResponseDto = storeService.getStoreInfoNew(partnerId, storeId, false,false); StoreMixResponseDto storeMixResponseDto = storeService.getStoreInfoNew(partnerId, storeId, false,false);
if (storeMixResponseDto == null || storeMixResponseDto.getStoreInfo() == null) { if (storeMixResponseDto == null || storeMixResponseDto.getStoreInfo() == null) {
...@@ -463,11 +473,11 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService { ...@@ -463,11 +473,11 @@ public class SellCouponOrderServiceImpl implements OrderFactoryService {
//查询虚拟商品卖券支付配置中的分账门店信息 //查询虚拟商品卖券支付配置中的分账门店信息
//如果需要分账查询支付配置中的分账门店信息,否则查询sdk //如果需要分账查询支付配置中的分账门店信息,否则查询sdk
AssortmentOpenPlatformIappWxappStore wxAppStore = new AssortmentOpenPlatformIappWxappStore(); // AssortmentOpenPlatformIappWxappStore wxAppStore = new AssortmentOpenPlatformIappWxappStore();
if(createOrderRequest.getIsSplitAccount() != null && createOrderRequest.getIsSplitAccount() == 1){ if(createOrderRequest.getIsSplitAccount() != null && createOrderRequest.getIsSplitAccount() == 1){
//11-虚拟卖券门店 //11-虚拟卖券门店
wxAppStore = payService.getIappWxappStoreInfo(userLoginInfoDto.getWxAppId(),"11"); wxAppStore = payService.getIappWxappStoreInfo(userLoginInfoDto.getWxAppId(),AggregationTypeEnum.TYPE_11.getCode());
}else { }else if(wxAppStore == null){
wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(userLoginInfoDto.getWxAppId(),storeId); wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(userLoginInfoDto.getWxAppId(),storeId);
} }
if ((wxAppStore == null || wxAppStore.getClientCode() == null)) { if ((wxAppStore == null || wxAppStore.getClientCode() == null)) {
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
*/ */
package cn.freemud.service.thirdparty; package cn.freemud.service.thirdparty;
import cn.freemud.annotations.LogIgnoreFeign;
import cn.freemud.constant.ResponseCodeKeyConstant;
import cn.freemud.entities.dto.store.*; import cn.freemud.entities.dto.store.*;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -26,12 +28,14 @@ public interface StoreClient { ...@@ -26,12 +28,14 @@ public interface StoreClient {
/** /**
* 查询门店信息 * 查询门店信息
*/ */
@LogIgnoreFeign(logMessage="getStoreMix",messageFieldName= ResponseCodeKeyConstant.MSG,statusCodeFieldName=ResponseCodeKeyConstant.STATUS_CODE)
@PostMapping(value = "/api/v2/organization/getStoreMix", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) @PostMapping(value = "/api/v2/organization/getStoreMix", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
StoreBaseResponseDto<StoreMixResponseDto> getStoreInfoNew(@RequestBody StoreInfoRequestDto request); StoreBaseResponseDto<StoreMixResponseDto> getStoreInfoNew(@RequestBody StoreInfoRequestDto request);
/** /**
* 查询门店信息 * 查询门店信息
*/ */
@LogIgnoreFeign(logMessage="getListByCodes",messageFieldName= ResponseCodeKeyConstant.MSG,statusCodeFieldName=ResponseCodeKeyConstant.STATUS_CODE)
@PostMapping(value = "/storecenter/store/v2/getListByCodes", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) @PostMapping(value = "/storecenter/store/v2/getListByCodes", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
StoreBaseResponseDto<StoreListResponse> getListByCodes(@RequestBody GetStoreListbyCodesRequest request); StoreBaseResponseDto<StoreListResponse> getListByCodes(@RequestBody GetStoreListbyCodesRequest request);
} }
...@@ -87,8 +87,9 @@ public class DefaultPromotionService implements IPromotionService { ...@@ -87,8 +87,9 @@ public class DefaultPromotionService implements IPromotionService {
// 需要算上配送券的优惠金额 // 需要算上配送券的优惠金额
Integer discountAmount = 0; Integer discountAmount = 0;
if (CollectionUtils.isNotEmpty(calculationDiscountResult.getCouponDiscounts())) { if (CollectionUtils.isNotEmpty(calculationDiscountResult.getCouponDiscounts())) {
// 过滤出配送券金额 // 过滤出配送券金额 和 满减配送费活动金额
CouponResults couponResults = calculationDiscountResult.getCouponDiscounts().stream().filter(c -> c.getActivityType() != null && c.getActivityType().compareTo(ActivityTypeEnum.TYPE_34.getCode()) == 0).findFirst().orElse(null); CouponResults couponResults = calculationDiscountResult.getCouponDiscounts().stream().filter(c -> c.getActivityType() != null
&& (c.getActivityType().compareTo(ActivityTypeEnum.TYPE_34.getCode()) == 0 || c.getActivityType().compareTo(ActivityTypeEnum.TYPE_14.getCode()) == 0)).findFirst().orElse(null);
if (couponResults != null) { if (couponResults != null) {
discountAmount = couponResults.getDiscountAmount(); discountAmount = couponResults.getDiscountAmount();
} }
......
...@@ -16,10 +16,7 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -16,10 +16,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -220,6 +217,10 @@ public class CalculationSharingEquallyService { ...@@ -220,6 +217,10 @@ public class CalculationSharingEquallyService {
int discountAmount = (discount.getDiscount() == null) ? 0 : discount.getDiscount(); int discountAmount = (discount.getDiscount() == null) ? 0 : discount.getDiscount();
Integer discountType = discount.getType(); Integer discountType = discount.getType();
if (discountType != null && discountAmount >= 0) { if (discountType != null && discountAmount >= 0) {
//加价购金额为0不记录
if(Objects.equals(ActivityTypeEnum.TYPE_81.getCode(),discountType) && discountAmount == 0){
continue;
}
ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto(); ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto();
activityDiscountsDto.setActivityCode(discount.getActivityCode()); activityDiscountsDto.setActivityCode(discount.getActivityCode());
activityDiscountsDto.setActivityName(discount.getActivityName()); activityDiscountsDto.setActivityName(discount.getActivityName());
......
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