Commit 6a8ebe5d by ping.wu

商品券校验接口修改

parent 4a8cd32c
...@@ -40,9 +40,12 @@ import cn.freemud.service.ItemService; ...@@ -40,9 +40,12 @@ import cn.freemud.service.ItemService;
import cn.freemud.service.UserService; import cn.freemud.service.UserService;
import cn.freemud.service.impl.mcoffee.entity.CouponCodeVo; import cn.freemud.service.impl.mcoffee.entity.CouponCodeVo;
import cn.freemud.service.impl.mcoffee.entity.MCCafeCouponRequest; import cn.freemud.service.impl.mcoffee.entity.MCCafeCouponRequest;
import cn.freemud.service.impl.mcoffee.entity.MCCodeInfoVO;
import cn.freemud.service.impl.mcoffee.entity.MccofeBaseResponse;
import cn.freemud.service.thirdparty.*; import cn.freemud.service.thirdparty.*;
import cn.freemud.utils.*; import cn.freemud.utils.*;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.couponcenter.offline.domain.CodeInfoVO;
import com.freemud.application.sdk.api.couponcenter.offline.response.CouponQueryResponse; import com.freemud.application.sdk.api.couponcenter.offline.response.CouponQueryResponse;
import com.freemud.card.sdk.comm.Finals; import com.freemud.card.sdk.comm.Finals;
import com.freemud.card.sdk.comm.SignUtil; import com.freemud.card.sdk.comm.SignUtil;
...@@ -675,14 +678,18 @@ public class CouponServiceImpl implements CouponService { ...@@ -675,14 +678,18 @@ public class CouponServiceImpl implements CouponService {
List<CouponCodeVo> couponCodeVos = Arrays.asList(new CouponCodeVo(couponCode)); List<CouponCodeVo> couponCodeVos = Arrays.asList(new CouponCodeVo(couponCode));
mcCafeCouponRequest.setCouponlist(couponCodeVos); mcCafeCouponRequest.setCouponlist(couponCodeVos);
mcCafeCouponRequest.setSign("skip"); mcCafeCouponRequest.setSign("skip");
CouponQueryResponse response = mCoffeeCouponClient.query(mcCafeCouponRequest); MccofeBaseResponse response = mCoffeeCouponClient.batchQuery(mcCafeCouponRequest);
LogUtil.info("mCoffeeCouponClient.query", gson.toJson(mcCafeCouponRequest), gson.toJson(response)); LogUtil.info("mCoffeeCouponClient.query", gson.toJson(mcCafeCouponRequest), gson.toJson(response));
if (response == null || !ResponseCodeConstant.RESPONSE_SUCCESS.equals(response.getStatusCode()) if (response == null || !ResponseCodeConstant.RESPONSE_SUCCESS.equals(response.getStatusCode())
|| response.getCodeInfo() == null || CollectionUtils.isEmpty(response.getCodeInfo().getProducts())) { || CollectionUtils.isEmpty(response.getCouponlist())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_CAN_NOT_USE); throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_CAN_NOT_USE);
} }
String skuId = response.getCodeInfo().getMcd_productCode(); MCCodeInfoVO codeInfoVO = response.getCouponlist().get(0).getCodeInfo();
if (CollectionUtils.isEmpty(codeInfoVO.getProducts())) {
throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_CAN_NOT_USE);
}
String skuId = codeInfoVO.getProducts().get(0).getMcd_productCode();
//券返回的商品id //券返回的商品id
List<String> skuIds = Lists.newArrayList(); List<String> skuIds = Lists.newArrayList();
...@@ -695,9 +702,9 @@ public class CouponServiceImpl implements CouponService { ...@@ -695,9 +702,9 @@ public class CouponServiceImpl implements CouponService {
} }
CheckSpqInfoResponseDto dto = new CheckSpqInfoResponseDto(); CheckSpqInfoResponseDto dto = new CheckSpqInfoResponseDto();
dto.setCouponCode(couponCode); dto.setCouponCode(couponCode);
dto.setActiveCode(response.getCodeInfo().getAct_id()); dto.setActiveCode(codeInfoVO.getAct_id());
dto.setCouponName(response.getCodeInfo().getAct_name()); dto.setCouponName(codeInfoVO.getAct_name());
dto.setActivityName(response.getCodeInfo().getAct_name()); dto.setActivityName(codeInfoVO.getAct_name());
dto.setPrice(productsVo.getFinalPrice()); dto.setPrice(productsVo.getFinalPrice());
dto.setSpuId(productsVo.getSpuId()); dto.setSpuId(productsVo.getSpuId());
dto.setSpuName(productsVo.getSkuName()); dto.setSpuName(productsVo.getSkuName());
......
package cn.freemud.service.impl.mcoffee.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.freemud.application.sdk.api.couponcenter.offline.domain.GroupsVO;
import com.freemud.application.sdk.api.couponcenter.offline.domain.ProductsVO;
import lombok.Data;
import java.util.List;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: MCCodeInfoVO
* @Package cn.freemud.service.impl.mcoffee.entity
* @Description:
* @author: ping1.wu
* @date: 2020/9/10 21:06
* @Copyright: 2020 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public class MCCodeInfoVO {
private Integer code_state;
private String act_id;
private String act_name;
private String vdata;
private String code;
private String ebcode;
private String ebname;
private Integer amount;
private Integer salePrice;
private Integer originalPrice;
private Integer paid;
private String promotion_type;
private String platformitemid;
private List<MCProductsVO> products;
private String act_desc;
private String mcd_productCode;
private String mcd_tenderCode;
private String menuItemId;
private String discountNo;
}
package cn.freemud.service.impl.mcoffee.entity;
import com.freemud.application.sdk.api.couponcenter.offline.domain.PaymentVO;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: MCProductsVO
* @Package cn.freemud.service.impl.mcoffee.entity
* @Description:
* @author: ping1.wu
* @date: 2020/9/10 21:06
* @Copyright: 2020 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public class MCProductsVO {
private String pid;
private String name;
private Integer number;
private Integer price_act;
private PaymentVO payment;
private Integer price_original;
private String act_desc;
private BigDecimal merchantdiscountprice;
private BigDecimal platformdiscountprice;
private BigDecimal otherdiscountprice;
private String mcd_productCode;
private String mcd_tendercode;
private BigDecimal pricediscount;
}
package cn.freemud.service.impl.mcoffee.entity; package cn.freemud.service.impl.mcoffee.entity;
import com.freemud.application.sdk.api.couponcenter.offline.domain.CodeInfoVO;
import lombok.Data;
import java.util.List;
/** /**
* All rights Reserved, Designed By www.freemud.cn * All rights Reserved, Designed By www.freemud.cn
* *
...@@ -12,11 +17,12 @@ package cn.freemud.service.impl.mcoffee.entity; ...@@ -12,11 +17,12 @@ package cn.freemud.service.impl.mcoffee.entity;
* @Copyright: 2020 www.freemud.cn Inc. All rights reserved. * @Copyright: 2020 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目 * 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/ */
@Data
public class MccofeBaseResponse { public class MccofeBaseResponse {
public Integer statusCode; public Integer statusCode;
public String msg; public String msg;
public String act_id; public List<McdNetBatchQueryResponse> couponlist;
public Integer ver = 1; public Integer ver = 1;
} }
package cn.freemud.service.impl.mcoffee.entity; package cn.freemud.service.impl.mcoffee.entity;
import com.freemud.application.sdk.api.couponcenter.offline.domain.CodeInfoVO;
import lombok.Data;
/** /**
* All rights Reserved, Designed By www.freemud.cn * All rights Reserved, Designed By www.freemud.cn
* *
...@@ -12,19 +15,16 @@ package cn.freemud.service.impl.mcoffee.entity; ...@@ -12,19 +15,16 @@ package cn.freemud.service.impl.mcoffee.entity;
* @Copyright: 2020 www.freemud.cn Inc. All rights reserved. * @Copyright: 2020 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目 * 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/ */
@Data
public class McdNetBatchQueryResponse { public class McdNetBatchQueryResponse {
// private List<Coupon> couponList; private MCCodeInfoVO codeInfo;
// /** /**
// * 响应描述 * 响应描述
// */ */
// private String content; private String content;
// private Integer statusCode;
// private String msg;
// private Integer statusCode; private Integer couponType;
// private String msg; private String code;
// private Integer couponType;
// private String code;
// private McdNetCouponInfoRespDto codeInfo;
} }
...@@ -16,6 +16,7 @@ import cn.freemud.entities.dto.*; ...@@ -16,6 +16,7 @@ import cn.freemud.entities.dto.*;
import cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq; import cn.freemud.service.impl.mcoffee.entity.CouponAvailableReq;
import cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp; import cn.freemud.service.impl.mcoffee.entity.CouponAvailableResp;
import cn.freemud.service.impl.mcoffee.entity.MCCafeCouponRequest; import cn.freemud.service.impl.mcoffee.entity.MCCafeCouponRequest;
import cn.freemud.service.impl.mcoffee.entity.MccofeBaseResponse;
import com.freemud.application.sdk.api.couponcenter.offline.response.CouponQueryResponse; import com.freemud.application.sdk.api.couponcenter.offline.response.CouponQueryResponse;
import org.springframework.cloud.netflix.feign.FeignClient; import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -67,6 +68,6 @@ public interface CouponClient { ...@@ -67,6 +68,6 @@ public interface CouponClient {
* 麦咖啡校验券 * 麦咖啡校验券
*/ */
@PostMapping("/mccafe/batchQuery") @PostMapping("/mccafe/batchQuery")
CouponQueryResponse query(MCCafeCouponRequest mcCafeCouponRequest); MccofeBaseResponse batchQuery(MCCafeCouponRequest mcCafeCouponRequest);
} }
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