Commit 975cb72b by zhiheng.zhang

Merge branch 'feature/2020/09/11-1.9.39-混合支付-张志恒' into qa

# Conflicts:
#	order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
#	shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/ShoppingCartGoodsResponseVo.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
parents c17b6646 30f80495
...@@ -3344,7 +3344,7 @@ public class OrderAdapter { ...@@ -3344,7 +3344,7 @@ public class OrderAdapter {
payChannel ="10102"; payChannel ="10102";
break; break;
case 3: case 3:
payChannel = "支付宝"; payChannel = "10300";
break; break;
case 4: case 4:
payChannel = "10212"; payChannel = "10212";
...@@ -3377,6 +3377,29 @@ public class OrderAdapter { ...@@ -3377,6 +3377,29 @@ public class OrderAdapter {
return ebCode; return ebCode;
} }
/**
* @nots 基础支付
* @param payChannelType
* @return
*/
public String getPayChannelName(Integer payChannelType) {
String payChannelName = "" ;
switch (payChannelType) {
case 1:
payChannelName = "微信";
break;
case 2:
payChannelName = "svc卡支付";
break;
case 3:
payChannelName = "支付宝";
break;
case 4:
payChannelName = "混合支付";
break;
}
return payChannelName;
}
public List<AssortmentOpenPlatformPartnerWxappConfig> cacheSelectDefaultPage(String wxAppId, String type) { public List<AssortmentOpenPlatformPartnerWxappConfig> cacheSelectDefaultPage(String wxAppId, String type) {
if (!StringUtils.isEmpty(wxAppId) && !StringUtils.isEmpty(type)) { if (!StringUtils.isEmpty(wxAppId) && !StringUtils.isEmpty(type)) {
String hashKey = "ecology:kgd:wxappconfig:open_platform_partner_wxapp_config:appkey_" + wxAppId; String hashKey = "ecology:kgd:wxappconfig:open_platform_partner_wxapp_config:appkey_" + wxAppId;
......
...@@ -15,6 +15,7 @@ package cn.freemud.entities.vo; ...@@ -15,6 +15,7 @@ package cn.freemud.entities.vo;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Data @Data
...@@ -124,6 +125,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV ...@@ -124,6 +125,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
* 配送费为零的原因:0:正常,1:超出配送范围 * 配送费为零的原因:0:正常,1:超出配送范围
*/ */
private Integer deliveryFeeZeroReason; private Integer deliveryFeeZeroReason;
/**
* svc卡支付金额
*/
private BigDecimal svcPayAmount;
private Integer version; private Integer version;
/** /**
......
...@@ -1576,23 +1576,26 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -1576,23 +1576,26 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (response.getData() == null || response.getData().getData() == null || response.getData().getData().getCardSimpleInfos().size() > 1) { if (response.getData() == null || response.getData().getData() == null || response.getData().getData().getCardSimpleInfos().size() > 1) {
throw new ServiceException(ResponseResult.USER_SVC_CARD_ERROR); throw new ServiceException(ResponseResult.USER_SVC_CARD_ERROR);
} }
//获取实际配送费 //获取实际配送费,配送费不
Integer deliveryAmount = 0;
if (StringUtils.isNotBlank(receiveId) && shoppingCartGoodsResponseVo.getDiscountDeliveryAmount() != null) { if (StringUtils.isNotBlank(receiveId) && shoppingCartGoodsResponseVo.getDiscountDeliveryAmount() != null) {
// Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId); // Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId);
Integer deliveryAmount = shoppingCartGoodsResponseVo.getDiscountDeliveryAmount().intValue(); deliveryAmount = shoppingCartGoodsResponseVo.getDiscountDeliveryAmount().intValue();
orderAmount += deliveryAmount; orderAmount += deliveryAmount;
} }
//混合支付无需校验svc卡余额 //混合支付无需校验svc卡余额,但是配送和包装费不计算在svc卡支付
Integer amount1 = response.getData().getData().getCardSimpleInfos().get(0).getAmount(); Integer amount1 = response.getData().getData().getCardSimpleInfos().get(0).getAmount();
Integer vamount = response.getData().getData().getCardSimpleInfos().get(0).getVamount(); Integer vamount = response.getData().getData().getCardSimpleInfos().get(0).getVamount();
BigDecimal svcPayAmount = BigDecimal.ZERO;
if (orderAmount > amount1 + vamount) { if (orderAmount > amount1 + vamount) {
throw new ServiceException(ResponseResult.USER_SVC_CARD_AMOUNT_DEFICIENCY); svcPayAmount = new BigDecimal(amount1 + vamount).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
shoppingCartGoodsResponseVo.setTotalAmount(orderAmount - svcPayAmount.multiply(new BigDecimal(100)).longValue());
}else{
svcPayAmount = new BigDecimal(orderAmount - deliveryAmount).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
shoppingCartGoodsResponseVo.setTotalAmount(deliveryAmount.longValue());
} }
BigDecimal bigDecimal = new BigDecimal(orderAmount); shoppingCartGoodsResponseVo.setSvcPayAmount(svcPayAmount);
String amountStr = bigDecimal.divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).toString(); shoppingCartGoodsResponseVo.setSvcDiscountDesc("储值卡支付¥" + svcPayAmount);
shoppingCartGoodsResponseVo.setTotalAmount(0L);
shoppingCartGoodsResponseVo.setSvcDiscountDesc("储值卡支付¥" + amountStr);
} }
/** /**
......
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