Commit 7134b154 by ping.wu

积分商城扣减积分调整

parent ae4093a8
...@@ -224,6 +224,15 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService { ...@@ -224,6 +224,15 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, pointMallListProductInfoResponse.getStatusCode())) { if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, pointMallListProductInfoResponse.getStatusCode())) {
return ResponseUtil.error(pointMallListProductInfoResponse.getStatusCode().toString(), "扣减库存失败"); return ResponseUtil.error(pointMallListProductInfoResponse.getStatusCode().toString(), "扣减库存失败");
} }
//扣减积分 (失败:失败冲正活动库存)
if (points != null && points > 0) {
UseScoreRequest userScoreRequest = pointsMallOrderAdapter.convent2UseScoreRequest(partnerId, memberId, appId, orderCode, points);
CustomerPropertyBaseResponse baseResponse = customerPropertyClient.useScore(userScoreRequest);
if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, baseResponse.getCode())) {
createOrderFail(true, false, partnerId, memberId, orderCode, skuId, points, appId);
return ResponseUtil.error(baseResponse.getCode(), "扣减积分失败");
}
}
//全积分支付商品,订单完成 //全积分支付商品,订单完成
if (ExchangeTypeEnum.TYPE_1.getCode().equals(exchangeType)) { if (ExchangeTypeEnum.TYPE_1.getCode().equals(exchangeType)) {
BaseResponse response1 = orderPaySuccess(createOrderResponseDto.getResult(), points, false); BaseResponse response1 = orderPaySuccess(createOrderResponseDto.getResult(), points, false);
...@@ -537,15 +546,15 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService { ...@@ -537,15 +546,15 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
boolean isCoupon = orderInfo.getOrderItemList().get(0).getProductType() == 1; boolean isCoupon = orderInfo.getOrderItemList().get(0).getProductType() == 1;
String appId = orderInfo.getAppId(); String appId = orderInfo.getAppId();
//扣减积分 (失败:失败冲正活动库存) // //扣减积分 (失败:失败冲正活动库存)
if (!isCash && points != null && points > 0) { // if (!isCash && points != null && points > 0) {
UseScoreRequest userScoreRequest = pointsMallOrderAdapter.convent2UseScoreRequest(partnerId, memberId, appId, orderCode, points); // UseScoreRequest userScoreRequest = pointsMallOrderAdapter.convent2UseScoreRequest(partnerId, memberId, appId, orderCode, points);
CustomerPropertyBaseResponse baseResponse = customerPropertyClient.useScore(userScoreRequest); // CustomerPropertyBaseResponse baseResponse = customerPropertyClient.useScore(userScoreRequest);
if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, baseResponse.getCode())) { // if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, baseResponse.getCode())) {
createOrderFail(true, false, partnerId, memberId, orderCode, skuId, points, appId); // createOrderFail(true, false, partnerId, memberId, orderCode, skuId, points, appId);
return ResponseUtil.error(baseResponse.getCode(), "扣减积分失败"); // return ResponseUtil.error(baseResponse.getCode(), "扣减积分失败");
} // }
} // }
//订单完成 (失败:失败冲正活动库存) //订单完成 (失败:失败冲正活动库存)
OrderBaseResp updateOrderStateResp = null; OrderBaseResp updateOrderStateResp = null;
...@@ -569,19 +578,19 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService { ...@@ -569,19 +578,19 @@ public class PointsMallOrderServiceImpl implements PointsMallOrderService {
createOrderFail(false, true, partnerId, memberId, orderCode, skuId, points, appId); createOrderFail(false, true, partnerId, memberId, orderCode, skuId, points, appId);
return ResponseUtil.error(updateOrderStateResp.getCode(), "更新订单异常"); return ResponseUtil.error(updateOrderStateResp.getCode(), "更新订单异常");
} }
//有现金支付,扣减积分 // //有现金支付,扣减积分
if (isCash && CollectionUtils.isNotEmpty(orderInfo.getOrderPayItemCreateReqList())) { // if (isCash && CollectionUtils.isNotEmpty(orderInfo.getOrderPayItemCreateReqList())) {
List<OrderPayItemResp> collect = orderInfo.getOrderPayItemCreateReqList().stream().filter(orderPayItemResp -> // List<OrderPayItemResp> collect = orderInfo.getOrderPayItemCreateReqList().stream().filter(orderPayItemResp ->
orderPayItemResp.getPayChannelType().equals(PayChannelType.POINTS.getIndex().intValue())).collect(Collectors.toList()); // orderPayItemResp.getPayChannelType().equals(PayChannelType.POINTS.getIndex().intValue())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) { // if (CollectionUtils.isNotEmpty(collect)) {
points = collect.get(0).getPayAmount().intValue(); // points = collect.get(0).getPayAmount().intValue();
UseScoreRequest userScoreRequest = pointsMallOrderAdapter.convent2UseScoreRequest(partnerId, memberId, appId, orderCode, points); // UseScoreRequest userScoreRequest = pointsMallOrderAdapter.convent2UseScoreRequest(partnerId, memberId, appId, orderCode, points);
CustomerPropertyBaseResponse baseResponse = customerPropertyClient.useScore(userScoreRequest); // CustomerPropertyBaseResponse baseResponse = customerPropertyClient.useScore(userScoreRequest);
if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, baseResponse.getCode())) { // if (!Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_STR, baseResponse.getCode())) {
return ResponseUtil.error(baseResponse.getCode(), "扣减积分失败"); // return ResponseUtil.error(baseResponse.getCode(), "扣减积分失败");
} // }
} // }
} // }
return ResponseUtil.success(); return ResponseUtil.success();
} }
......
...@@ -99,4 +99,5 @@ ...@@ -99,4 +99,5 @@
| 1.3.65.RELEASE | 聚合层sdk异常,版本引不到,解决代码报错 | 王航航 | 2021-07-20 | | 1.3.65.RELEASE | 聚合层sdk异常,版本引不到,解决代码报错 | 王航航 | 2021-07-20 |
| 1.3.66.RELEASE | 基础订单sdk版本升级 | 伍平 | 2021-08-10 | | 1.3.66.RELEASE | 基础订单sdk版本升级 | 伍平 | 2021-08-10 |
| 1.3.67.RELEASE | 新增爱马哥需求代码改动 | 周晓航 | 2021-08-23 | | 1.3.67.RELEASE | 新增爱马哥需求代码改动 | 周晓航 | 2021-08-23 |
| 1.3.68.RELEASE | 新增维护商品类型同步商品服务 | 周晓航 | 2021-09-03 | | 1.3.68.RELEASE | 新增维护商品类型同步商品服务 | 周晓航 | 2021-09-03 |
\ No newline at end of file | 1.3.69.RELEASE | 升级sdk | 伍平 | 2021-09-16 |
\ No newline at end of file
package com.freemud.application.sdk.api.ordercenter.enums.orderv1;
public enum RefundStatusV1 {
APPLY_REFUND(1, "申请退款"),
AGREE_REFUND(2, "同意退款"),
ALREADY_REFUND(3, "已退货"),
COMPLETE_REFUND(4, "退款完成"),
REFUSE_REFUND(5, "拒绝退款");
private Integer code;
private String desc;
RefundStatusV1(Integer code, String desc) {
this.code = code;
this.desc = desc;
}
public static RefundStatusV1 getByCode(Integer code) {
for (RefundStatusV1 status : values()) {
if (status.getCode().equals(code)) {
return status;
}
}
return null;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
//package com.freemud.application.sdk.api.ordercenter.response; package com.freemud.application.sdk.api.ordercenter.response;
//
//import lombok.Data; import lombok.Data;
//
//@Data @Data
//public class OrderManagerResponse { public class OrderManagerResponse {
// /** /**
// * 预订单打印时间{1:提醒时打印;2:接单时打印} 默认为1 * 预订单打印时间{1:提醒时打印;2:接单时打印} 默认为1
// */ */
// private String orderPrintConfig; private String orderPrintConfig;
// /** /**
// * 订单预约时间 * 订单预约时间
// */ */
// private Long gmtExpect; private Long gmtExpect;
// /** /**
// * 订单状态 * 订单状态
// * 1=下单,2=待支付,3=接单,4=配送中,5=完成,6=取消,7=拒单,31=制作完成 * 1=下单,2=待支付,3=接单,4=配送中,5=完成,6=取消,7=拒单,31=制作完成
// */ */
// private Integer status; private Integer status;
// /** /**
// * 订单退款状态 * 订单退款状态
// * 1 申请退款 2 同意退款 3 已退货 4 退款完成 5 拒绝退款 * 1 申请退款 2 同意退款 3 已退货 4 退款完成 5 拒绝退款
// */ */
// private Integer refundStatus; private Integer refundStatus;
//} }
package com.freemud.application.sdk.api.ordercenter.service;
import com.freemud.application.sdk.api.ordercenter.adapter.OrderCenterSdkAdapter;
import com.freemud.application.sdk.api.ordercenter.entities.v1.OrderBeanV1;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.QueryByCodeResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OrderServiceV1 {
@Autowired
private OrderSdkService orderSdkService;
@Autowired
private OrderCenterSdkAdapter orderCenterSdkAdapter;
/**
* 根据订单编号查询订单信息
* 返回 V1版本订单数据结构
*/
public OrderBeanV1 queryOrderById(String orderClient, String orderCode, String thirdOrderCode, Integer withOperationHistory, String trackingNo){
QueryByCodeResponse orderInfo = orderSdkService.getOrderInfo(orderClient, orderCode, thirdOrderCode, withOperationHistory, trackingNo);
if(orderInfo == null){
return null;
}
return orderCenterSdkAdapter.convent2NEWOrderInfo(orderInfo.getResult());
}
}
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