Commit 7632bad9 by xiaoer.li@freemud.com
parents ad7eaaf5 d222b4be
...@@ -805,7 +805,6 @@ public class OrderSdkAdapter { ...@@ -805,7 +805,6 @@ public class OrderSdkAdapter {
} }
accountBean.setSequence(orderSettlementResp.getProductSeq()); accountBean.setSequence(orderSettlementResp.getProductSeq());
accountBean.setType(getOldOrderAccountType(orderSettlementResp.getSettlementType())); accountBean.setType(getOldOrderAccountType(orderSettlementResp.getSettlementType()));
// accountBean.setAddInfo("");
accountBean.setAddInfo(orderSettlementResp.getExtInfo()); accountBean.setAddInfo(orderSettlementResp.getExtInfo());
accountBean.setPlatformDiscountAmount(orderSettlementResp.getPlatformDiscountAmount()); accountBean.setPlatformDiscountAmount(orderSettlementResp.getPlatformDiscountAmount());
accountBean.setShopDiscountAmount(orderSettlementResp.getShopDiscountAmount()); accountBean.setShopDiscountAmount(orderSettlementResp.getShopDiscountAmount());
...@@ -930,7 +929,7 @@ public class OrderSdkAdapter { ...@@ -930,7 +929,7 @@ public class OrderSdkAdapter {
productDiscount.setDiscountAmount(orderSettlementResp.getShopDiscountAmount()); productDiscount.setDiscountAmount(orderSettlementResp.getShopDiscountAmount());
//无数据 //无数据
productDiscount.setCustomerCode(""); productDiscount.setCustomerCode("");
productDiscount.setAddInfo(""); productDiscount.setAddInfo(orderSettlementResp.getExtInfo());
productDiscount.setProductId(orderSettlementResp.getProductId()); productDiscount.setProductId(orderSettlementResp.getProductId());
discountList.add(productDiscount); discountList.add(productDiscount);
} }
......
...@@ -18,4 +18,6 @@ public class CommonsConstant { ...@@ -18,4 +18,6 @@ public class CommonsConstant {
public final static Integer WEIGHT_PRODUCT = 1; public final static Integer WEIGHT_PRODUCT = 1;
public final static Integer COUPON_TYPE = 0;
} }
...@@ -32,6 +32,7 @@ import cn.freemud.management.enums.OrderSource; ...@@ -32,6 +32,7 @@ import cn.freemud.management.enums.OrderSource;
import cn.freemud.service.mccafe.CouponClientService; import cn.freemud.service.mccafe.CouponClientService;
import cn.freemud.utils.BeanUtil; import cn.freemud.utils.BeanUtil;
import cn.freemud.utils.LogUtil; import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType; import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.card.sdk.vo.coupon.request.MemberAddCouponVo; import com.freemud.card.sdk.vo.coupon.request.MemberAddCouponVo;
import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType; import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType;
...@@ -671,8 +672,15 @@ public class CouponAdapter { ...@@ -671,8 +672,15 @@ public class CouponAdapter {
} }
MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo(); MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo();
mcCafeProductRedeemVo.setPid(pid); mcCafeProductRedeemVo.setPid(pid);
mcCafeProductRedeemVo.setKeyProductCode(productBean.getCustomerCode()); String extInfo = productDiscount.getAddInfo();
mcCafeProductRedeemVo.setCustomer_code(productBean.getCustomerCode()); Integer extendType = StringUtils.isBlank(extInfo)?null: JSON.parseObject(extInfo).getInteger("extendType");
if(extendType != null && extendType == 4) {
mcCafeProductRedeemVo.setKeyProductCode(JSON.parseObject(extInfo).getString("tenderId"));
mcCafeProductRedeemVo.setCustomer_code(JSON.parseObject(extInfo).getString("tenderId"));
} else {
mcCafeProductRedeemVo.setKeyProductCode(productBean.getCustomerCode());
mcCafeProductRedeemVo.setCustomer_code(productBean.getCustomerCode());
}
mcCafeProductRedeemVo.setConsume_num(productDiscount.getDiscountQty()); mcCafeProductRedeemVo.setConsume_num(productDiscount.getDiscountQty());
mcCafeProductRedeemVo.setSeq(i + 1); mcCafeProductRedeemVo.setSeq(i + 1);
if(null != coupon && CollectionUtils.isNotEmpty(coupon.getCodeInfo().getGroups())) { if(null != coupon && CollectionUtils.isNotEmpty(coupon.getCodeInfo().getGroups())) {
......
...@@ -1207,6 +1207,7 @@ public class OrderAdapter { ...@@ -1207,6 +1207,7 @@ public class OrderAdapter {
Long promotionAmount = 0L; Long promotionAmount = 0L;
Long deliveryAmount = 0L; Long deliveryAmount = 0L;
Long packageAmount = 0L; Long packageAmount = 0L;
Long originalDeliveryAmount = 0L;
//限时特价优惠金额 //限时特价优惠金额
Long discountLimitAmount = 0L; Long discountLimitAmount = 0L;
Long couponAmount = 0L; Long couponAmount = 0L;
...@@ -1233,6 +1234,7 @@ public class OrderAdapter { ...@@ -1233,6 +1234,7 @@ public class OrderAdapter {
if (OrderAccountType.DELIVERY_AMOUNT.getCode().equals(accountBean.getType())) { if (OrderAccountType.DELIVERY_AMOUNT.getCode().equals(accountBean.getType())) {
//deliveryAmount = accountBean.getPrice(); //deliveryAmount = accountBean.getPrice();
deliveryAmount = null != accountBean.getActualCostAmount() ? accountBean.getActualCostAmount() : accountBean.getPrice(); deliveryAmount = null != accountBean.getActualCostAmount() ? accountBean.getActualCostAmount() : accountBean.getPrice();
originalDeliveryAmount = accountBean.getPrice();
} }
if (OrderAccountType.PACK_AMOUNT.getCode().equals(accountBean.getType())) { if (OrderAccountType.PACK_AMOUNT.getCode().equals(accountBean.getType())) {
packageAmount = accountBean.getPrice(); packageAmount = accountBean.getPrice();
...@@ -1255,9 +1257,13 @@ public class OrderAdapter { ...@@ -1255,9 +1257,13 @@ public class OrderAdapter {
customerScorePrompt = decimalFormat.format(customerScoreAmount / 100.0); customerScorePrompt = decimalFormat.format(customerScoreAmount / 100.0);
// customerScorePrompt = "积分抵扣-¥" + customerScoreAmountStr; // customerScorePrompt = "积分抵扣-¥" + customerScoreAmountStr;
} }
if (Integer.valueOf(99).equals(accountBean.getType())) {
responseVo.setFreightCouponName(accountBean.getName());
}
} }
} }
responseVo.setDeliveryAmount(deliveryAmount); responseVo.setDeliveryAmount(deliveryAmount);
responseVo.setOriginalDeliveryAmount(originalDeliveryAmount);
responseVo.setPackageAmount(packageAmount); responseVo.setPackageAmount(packageAmount);
responseVo.setDiscountLimitAmount(discountLimitAmount); responseVo.setDiscountLimitAmount(discountLimitAmount);
responseVo.setFullDiscountAmount(fullDiscountAmount); responseVo.setFullDiscountAmount(fullDiscountAmount);
...@@ -1976,7 +1982,8 @@ public class OrderAdapter { ...@@ -1976,7 +1982,8 @@ public class OrderAdapter {
discountTotalAmount = discountTotalAmount + productDiscount.getDiscountAmount()*productDiscount.getDiscountQty(); discountTotalAmount = discountTotalAmount + productDiscount.getDiscountAmount()*productDiscount.getDiscountQty();
if (OrderAccountType.PRODUCT_COUPON.getCode().equals(productDiscount.getDiscountType())) { if (OrderAccountType.PRODUCT_COUPON.getCode().equals(productDiscount.getDiscountType())) {
hasProductCoupon = true; hasProductCoupon = true;
if("啡常月享卡".equals(productDiscount.getDiscountDesc())) { Integer extendType = StringUtils.isBlank(productDiscount.getAddInfo())?null:JSON.parseObject(productDiscount.getAddInfo()).getInteger("extendType");
if("啡常月享卡".equals(productDiscount.getDiscountDesc()) || (null != extendType && 4 == extendType)) {
productVo.setCouponName(productDiscount.getDiscountDesc()); productVo.setCouponName(productDiscount.getDiscountDesc());
} else { } else {
productVo.setName(productDiscount.getDiscountDesc()); productVo.setName(productDiscount.getDiscountDesc());
......
...@@ -42,6 +42,8 @@ public class ProductVo { ...@@ -42,6 +42,8 @@ public class ProductVo {
* 商品spu名称 * 商品spu名称
*/ */
private String spuName; private String spuName;
private String couponName;
/** /**
* 商品的规格信息加属性信息 * 商品的规格信息加属性信息
*/ */
...@@ -133,11 +135,6 @@ public class ProductVo { ...@@ -133,11 +135,6 @@ public class ProductVo {
private String unit; private String unit;
/** /**
* 优惠券名称
*/
private String couponName;
/**
* 1.5.5版本添加 * 1.5.5版本添加
* 商品参与活动类型(61:买一赠一) * 商品参与活动类型(61:买一赠一)
*/ */
......
...@@ -99,6 +99,14 @@ public class QueryOrderResponseVo { ...@@ -99,6 +99,14 @@ public class QueryOrderResponseVo {
*/ */
private Long deliveryAmount; private Long deliveryAmount;
/** /**
* 配送费原价
*/
private Long originalDeliveryAmount;
/**
* 运费券名称
*/
private String freightCouponName;
/**
* 限时折扣优惠金额 * 限时折扣优惠金额
*/ */
private Long discountLimitAmount; private Long discountLimitAmount;
......
...@@ -1222,9 +1222,9 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1222,9 +1222,9 @@ public class OrderServiceImpl implements Orderservice {
&& queryOrderResponseVo.getRefundStatus() != null && queryOrderResponseVo.getRefundStatus() == 1) { && queryOrderResponseVo.getRefundStatus() != null && queryOrderResponseVo.getRefundStatus() == 1) {
Integer automaticRefund = storeInfo.getBizVO().getStoreConfig().getAutomaticRefund(); Integer automaticRefund = storeInfo.getBizVO().getStoreConfig().getAutomaticRefund();
if(automaticRefund != null && automaticRefund == 1){ if(automaticRefund != null && automaticRefund == 1){
queryOrderResponseVo.setRefundTips("若48小时后商家未处理,自动同意"); queryOrderResponseVo.setRefundTips("若48小时内未成功退款,请联系商家人工处理");
}else { }else {
queryOrderResponseVo.setRefundTips("若48小时后商家未处理,拒绝退款"); queryOrderResponseVo.setRefundTips("若48小时内未成功退款,请联系商家人工处理");
} }
} }
...@@ -1349,9 +1349,9 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1349,9 +1349,9 @@ public class OrderServiceImpl implements Orderservice {
&& queryOrderResponseVo.getRefundStatus() != null && queryOrderResponseVo.getRefundStatus() == 1) { && queryOrderResponseVo.getRefundStatus() != null && queryOrderResponseVo.getRefundStatus() == 1) {
Integer automaticRefund = storeInfo.getBizVO().getStoreConfig().getAutomaticRefund(); Integer automaticRefund = storeInfo.getBizVO().getStoreConfig().getAutomaticRefund();
if(automaticRefund != null && automaticRefund == 1){ if(automaticRefund != null && automaticRefund == 1){
queryOrderResponseVo.setRefundTips("若48小时后商家未处理,自动同意"); queryOrderResponseVo.setRefundTips("若48小时内未成功退款,请联系商家人工处理");
}else { }else {
queryOrderResponseVo.setRefundTips("若48小时后商家未处理,拒绝退款"); queryOrderResponseVo.setRefundTips("若48小时内未成功退款,请联系商家人工处理");
} }
} }
......
...@@ -162,6 +162,8 @@ public class CouponClientServiceImpl implements CouponClientService { ...@@ -162,6 +162,8 @@ public class CouponClientServiceImpl implements CouponClientService {
@Override @Override
public List<CouponRedeemResponse> redeemBatch(QueryOrdersResponseDto.DataBean.OrderBean orderBean) { public List<CouponRedeemResponse> redeemBatch(QueryOrdersResponseDto.DataBean.OrderBean orderBean) {
System.out.println("=======================================================================");
System.out.println(JSON.toJSONString(orderBean));
if (null == orderBean || CollectionUtils.isEmpty(orderBean.getAccountList())) { if (null == orderBean || CollectionUtils.isEmpty(orderBean.getAccountList())) {
return null; return null;
} }
......
...@@ -8,6 +8,7 @@ import cn.freemud.management.enums.CouponReqTypeEnum; ...@@ -8,6 +8,7 @@ import cn.freemud.management.enums.CouponReqTypeEnum;
import cn.freemud.management.enums.MCCafeChannelEnum; import cn.freemud.management.enums.MCCafeChannelEnum;
import cn.freemud.management.enums.OrderSource; import cn.freemud.management.enums.OrderSource;
import cn.freemud.management.thirdparty.CouponOfflineMCCafeClient; import cn.freemud.management.thirdparty.CouponOfflineMCCafeClient;
import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType; import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType; import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType;
import com.freemud.sdk.api.assortment.order.enums.OrderSourceType; import com.freemud.sdk.api.assortment.order.enums.OrderSourceType;
...@@ -90,8 +91,15 @@ public class McCafeCouponAdapter { ...@@ -90,8 +91,15 @@ public class McCafeCouponAdapter {
} }
MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo(); MCCafeProductRedeemVo mcCafeProductRedeemVo = new MCCafeProductRedeemVo();
mcCafeProductRedeemVo.setPid(pid); mcCafeProductRedeemVo.setPid(pid);
mcCafeProductRedeemVo.setKeyProductCode(productBean.getCustomerCode()); String extInfo = productDiscount.getAddInfo();
mcCafeProductRedeemVo.setCustomer_code(productBean.getCustomerCode()); Integer extendType = StringUtils.isBlank(extInfo)?null: JSON.parseObject(extInfo).getInteger("extendType");
if(extendType != null && extendType == 4) {
mcCafeProductRedeemVo.setKeyProductCode(JSON.parseObject(extInfo).getString("tenderId"));
mcCafeProductRedeemVo.setCustomer_code(JSON.parseObject(extInfo).getString("tenderId"));
} else {
mcCafeProductRedeemVo.setKeyProductCode(productBean.getCustomerCode());
mcCafeProductRedeemVo.setCustomer_code(productBean.getCustomerCode());
}
mcCafeProductRedeemVo.setConsume_num(productDiscount.getDiscountQty()); mcCafeProductRedeemVo.setConsume_num(productDiscount.getDiscountQty());
mcCafeProductRedeemVo.setSeq(i + 1); mcCafeProductRedeemVo.setSeq(i + 1);
if(null != coupon && CollectionUtils.isNotEmpty(coupon.getCodeInfo().getGroups())) { if(null != coupon && CollectionUtils.isNotEmpty(coupon.getCodeInfo().getGroups())) {
......
...@@ -22,6 +22,7 @@ public enum GoodsTypeEnum { ...@@ -22,6 +22,7 @@ public enum GoodsTypeEnum {
SKU_GOODS(4, "sku商品"), SKU_GOODS(4, "sku商品"),
SPU_GOODS(5, "spu商品"), SPU_GOODS(5, "spu商品"),
REDUCE_PRICE_GOODS(6,"超值加购商品"), REDUCE_PRICE_GOODS(6,"超值加购商品"),
ALL_COUPON_GOODS(8, "万能券商品"),
MATERIAL(88, "有加料的商品"), MATERIAL(88, "有加料的商品"),
EXCEPTION_GOODS(99, "异常商品:商品菜单变化导致和购物车不商品匹配"); EXCEPTION_GOODS(99, "异常商品:商品菜单变化导致和购物车不商品匹配");
private Integer goodsType; private Integer goodsType;
......
...@@ -867,9 +867,10 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -867,9 +867,10 @@ public class ShoppingCartMCoffeeServiceImpl {
comboxGoods.setName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :"");
comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setSpuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :"");
comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductName()) ? orderItemResp.getProductName() :""); comboxGoods.setSkuName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() :"");
comboxGoods.setSubName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() : ""); comboxGoods.setSubName(StringUtils.isNotEmpty(orderItemResp.getProductSpecName()) ? orderItemResp.getProductSpecName() : "");
comboxGoods.setPic(StringUtils.isNotEmpty(orderItemResp.getProductPicUrl()) ? orderItemResp.getProductPicUrl() :""); comboxGoods.setPic(StringUtils.isNotEmpty(orderItemResp.getProductPicUrl()) ? orderItemResp.getProductPicUrl() :
"");
if (!"".equals(orderItemResp.getProductProperty())) { if (!"".equals(orderItemResp.getProductProperty())) {
List<CartGoods.CartGoodsExtra> extra = new ArrayList<>(); List<CartGoods.CartGoodsExtra> extra = new ArrayList<>();
String[] split = orderItemResp.getProductProperty().split("/"); String[] split = orderItemResp.getProductProperty().split("/");
...@@ -1150,6 +1151,9 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -1150,6 +1151,9 @@ public class ShoppingCartMCoffeeServiceImpl {
} else if (CollectionUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getProductComboList()) || CollectionUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getProductGroupList())) { } else if (CollectionUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getProductComboList()) || CollectionUtils.isNotEmpty(addShoppingCartGoodsRequestVo.getProductGroupList())) {
goodsType = GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType(); goodsType = GoodsTypeEnum.SET_MEAL_GOODS.getGoodsType();
} }
/*else if (CommonsConstant.COUPON_TYPE == addShoppingCartGoodsRequestVo.getCouponType()){
goodsType = GoodsTypeEnum.ALL_COUPON_GOODS.getGoodsType();
}*/
if (addShoppingCartGoodsRequestVo.getOperationType() != null && addShoppingCartGoodsRequestVo.getOperationType() == 2) { if (addShoppingCartGoodsRequestVo.getOperationType() != null && addShoppingCartGoodsRequestVo.getOperationType() == 2) {
goodsType = GoodsTypeEnum.REDUCE_PRICE_GOODS.getGoodsType(); goodsType = GoodsTypeEnum.REDUCE_PRICE_GOODS.getGoodsType();
} }
......
...@@ -119,6 +119,11 @@ public class MCoffeeAddGoodsRequestVo { ...@@ -119,6 +119,11 @@ public class MCoffeeAddGoodsRequestVo {
private Integer operationType; private Integer operationType;
/** /**
* 券类型 0:商品券
*/
private Integer couponType;
/**
* 优惠券号 * 优惠券号
*/ */
private String couponCode; private String couponCode;
......
package cn.freemud.service.thirdparty;
import cn.freemud.entities.dto.CouponCodeResponseDto;
import cn.freemud.entities.dto.CouponCodeVerificationMCCafeDto;
import com.freemud.application.sdk.api.couponcenter.offline.response.CouponRedeemResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
@FeignClient(name = "COUPONMCCafe",url="http://coupon-api-gateway-koderover-dev-coupon.api-ingress.sandload.cn")
public interface CouponOfflineMCCafeClient {
@PostMapping("/mccafe/redeem")
CouponRedeemResponse redeem(CouponCodeVerificationMCCafeDto couponCodeVerificationMCCafeDto);
@PostMapping("/mccafe/cancelRedeem")
CouponRedeemResponse cancelRedeem(CouponCodeVerificationMCCafeDto couponCodeVerificationMCCafeDto);
@PostMapping("/mccafe/query")
CouponRedeemResponse query(CouponCodeVerificationMCCafeDto couponCodeVerificationMCCafeDto);
@PostMapping("/mccafe/lock")
CouponRedeemResponse lock(CouponCodeVerificationMCCafeDto couponCodeVerificationMCCafeDto);
@PostMapping("/mccafe/unlock")
CouponRedeemResponse unlock(CouponCodeVerificationMCCafeDto couponCodeVerificationMCCafeDto);
}
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