Commit 8f4527aa by ping.wu

Merge branches 'develop' and 'feature/20200221_储值卡查询购物车开关_wuping' of…

Merge branches 'develop' and 'feature/20200221_储值卡查询购物车开关_wuping' of http://gitlab.freemud.com/order-group-application/order-group into develop

# Conflicts:
#	order-application-service/src/main/java/cn/freemud/controller/OrderController.java
parents d007f4c7 b9f9bcda
......@@ -26,7 +26,7 @@
<dependency>
<artifactId>couponcenter-sdk</artifactId>
<groupId>com.freemud.application.service.sdk</groupId>
<version>1.8.3-SNAPSHOT</version>
<version>1.8.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
......
......@@ -282,4 +282,14 @@ public interface OrderCenterSdkService {
* @return
*/
QueryOrderByIdResponse queryOrderByCodeES(String orderCode, String partnerId, String trackNo);
/**
* 根据用户ID 查询30分钟内未支付并且有券的 订单
*
* @param userId 用户ID
* @param trackingNo 交易号
* @return
*/
QueryOrdersResponse queryOrderWithCoupon(String userId, String trackingNo);
}
......@@ -1299,4 +1299,12 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
QueryOrderByIdResponse orderByIdResponse = orderSdkAdapter.convent2QueryOrderByIdResponse(orderInfo);
return orderByIdResponse;
}
@Override
public QueryOrdersResponse queryOrderWithCoupon(String userId, String trackingNo) {
com.freemud.application.sdk.api.ordercenter.response.BaseResponse response
= orderSdkService.queryOrderWithCoupon(userId, trackingNo);
return orderSdkAdapter.convent2QueryOrdersResponse(response);
}
}
......@@ -48,7 +48,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>couponcenter-sdk</artifactId>
<version>1.1.RELEASE</version>
<version>1.8.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
......
......@@ -35,7 +35,7 @@
<dependency>
<artifactId>couponcenter-sdk</artifactId>
<groupId>com.freemud.application.service.sdk</groupId>
<version>1.8.3-SNAPSHOT</version>
<version>1.8.RELEASE</version>
</dependency>
<dependency>
<groupId>cn.freemud</groupId>
......
......@@ -23,6 +23,7 @@ import cn.freemud.service.OrderAdapterService;
import cn.freemud.service.Orderservice;
import cn.freemud.service.impl.MallOrderServiceImpl;
import cn.freemud.utils.ResponseUtil;
import cn.freemud.utils.ResponseUtil;
import com.freemud.application.sdk.api.log.ApiAnnotation;
import com.freemud.application.sdk.api.log.LogParams;
import io.swagger.annotations.ApiOperation;
......@@ -202,6 +203,16 @@ public class OrderController {
}
/**
* 查询30分钟未支付的优惠券订单
*/
@ApiAnnotation(logMessage = "queryOrderWithCoupon")
@ApiOperation(value = "查询30分钟未支付的优惠券订单", notes = "查询30分钟未支付的优惠券订单", produces = "application/json")
@PostMapping("/queryOrderWithCoupon")
public BaseResponse queryOrderWithCoupon(@LogParams @RequestBody QueryOrderWithCouponVo orderWithCouponVo) {
return ResponseUtil.success();
}
/**
* 订单确认完成
*/
@ApiAnnotation(logMessage = "affirm")
......
......@@ -131,7 +131,7 @@ public class CouponActivityServiceImpl implements CouponActivityService {
try {
//移除卡包失败,邮件报警
com.freemud.application.sdk.api.base.BaseResponse baseResponse = offlineCouponSdkService.callbackNotify(couponCode, orderCode, partnerId,"");
if (!Objects.equals(baseResponse.getStatusCode(), ResponseResult.SUCCESS.getCode())) {
if (!Objects.equals(baseResponse.getCode(), ResponseResult.SUCCESS.getCode())) {
emailAlertService.sendEmailAlert("券码移除卡包失败", String.format("request:%s \r\nresponse:%s","券码号:"+couponCode+"订单号:"+orderCode, JSONObject.toJSONString(baseResponse)));
return ResponseUtil.error(ResponseResult.COUPON_CALLBACK_FAIL);
}
......
......@@ -151,4 +151,9 @@ public class InterfaceAddressConstant {
* 根据订单号查询订单详情
*/
public static final String QUERY_ORDER_BY_CODE = "order/v2/queryOrderByCode";
/**
* 根据用户ID 查询30分钟内未支付并且有券的 订单
*/
public static final String QUERY_ORDER_WITH_COUPON="order/v2/queryOrderWithCoupon";
}
......@@ -679,4 +679,19 @@ public class OrderSdkService {
return responseHandle(responseDTO);
}
/**
* 根据用户ID 查询30分钟内未支付并且有券的 订单
*
* @param userId 用户ID
* @param trackingNo 交易号
* @return
*/
public BaseResponse<QueryOrderForUserResp> queryOrderWithCoupon(String userId, String trackingNo) {
String url = InterfaceAddressConstant.QUERY_ORDER_WITH_COUPON + "?userId=" + userId;
OrderBaseResp<QueryOrderForUserResp> responseDTO = RequestThirdPartyUtils.httpJsonReqComplexNew(restTemplate, url,
createBaseRequest(null, trackingNo), new ParameterizedTypeReference<OrderBaseResp<QueryOrderForUserResp>>() {
});
return responseHandle(responseDTO);
}
}
......@@ -40,7 +40,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>couponcenter-sdk</artifactId>
<version>1.1.RELEASE</version>
<version>1.8.RELEASE</version>
</dependency>
<dependency>
<groupId>cn.freemud</groupId>
......
......@@ -69,6 +69,11 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
private String svcDiscountDesc;
/**
* svc卡开关标识
*/
private boolean svcSwitch;
/**
* 可用优惠券列表
*/
private ActivityClassifyCouponBean availableCoupon;
......
......@@ -1252,10 +1252,12 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
* 储值卡支付余额校验
* 校验订单商品金额与外卖配送费
*/
private void SVCCardPay(String cardCode, String receiveId, String partnerId, String storeId,
private boolean SVCCardPay(String cardCode, String receiveId, String partnerId, String storeId,
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo) {
//svc储值卡开关
boolean svcSwitch=false;
if (StringUtils.isBlank(cardCode)) {
return;
return false;
}
Integer orderAmount = shoppingCartGoodsResponseVo.getTotalAmount().intValue();
String trackingNo = LogThreadLocal.getTrackingNo();
......@@ -1277,12 +1279,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
Integer amount1 = response.getData().getData().getCardSimpleInfos().get(0).getAmount();
Integer vamount = response.getData().getData().getCardSimpleInfos().get(0).getVamount();
if (orderAmount > amount1 + vamount) {
throw new ServiceException(ResponseResult.USER_SVC_CARD_AMOUNT_DEFICIENCY);
//throw new ServiceException(ResponseResult.USER_SVC_CARD_AMOUNT_DEFICIENCY);
shoppingCartGoodsResponseVo.setSvcSwitch(svcSwitch);
return false;
}
svcSwitch=true;
BigDecimal bigDecimal = new BigDecimal(orderAmount);
String amountStr = bigDecimal.divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
shoppingCartGoodsResponseVo.setTotalAmount(0L);
shoppingCartGoodsResponseVo.setSvcDiscountDesc("储值卡支付¥" + amountStr);
shoppingCartGoodsResponseVo.setSvcSwitch(svcSwitch);
return true;
}
/**
......
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