Commit 91415ccd by shuhu.hou@freemud.cn

Merge branch 'hotfix/20200709_支付回调&sessionId校验fixbug' into qa

# Conflicts:
#	assortment-ordercenter-sdk/pom.xml
#	assortment-ordercenter-sdk/readme.md
#	order-application-service/pom.xml
#	ordercenter-sdk/pom.xml
#	ordercenter-sdk/readme.md
#	ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/request/OrderExtInfoDto.java
parents 0a3c5b1b a2256347
......@@ -28,7 +28,7 @@ import java.util.List;
@Data
public class CreateOrderVo {
//@NotEmpty(message = "sessionId 不能为空")
@NotEmpty(message = "sessionId 不能为空")
private String sessionId;
//@NotEmpty(message = "门店ID 不能为空") //本次需要根据业务做校验
......
......@@ -28,6 +28,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Map;
/**
......@@ -157,6 +158,9 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
return gson.toJson(message);
}
QueryOrdersResponseDto.DataBean.OrderBean orderBean = orderBeans.get(OrderBeanType.SAASORDER.getCode());
if (!PayStatus.NOT_PAY.getCode().equals(orderBean.getPayStatus())){
return orderAdapter.sendPaySuccessNoticeMessage();
}
/**
* 围餐处理
*/
......
......@@ -56,7 +56,7 @@ public class PaymentHandle {
public PayRefundResponse refund(OrderManagerRequest request, QueryOrdersResponse.DataBean.OrderBean orderBean){
PayRefundStatus refundStatus=PayRefundStatus.SUCCESS;
OrderRefundRequest orderRefundRequest = paymentSdkAdapter.getOrderRefundRequest(orderBean,getRefundAmount(orderBean));
if (ObjectUtils.equals(orderBean.getAmount(), 0)) {
if (ObjectUtils.equals(orderBean.getAmount(), 0L)) {
return handlePayRefundResponse(refundStatus,orderRefundRequest.getRefundId());
}
BaseResponse<OrderRefundResponse> orderRefundResponse;
......
......@@ -136,6 +136,10 @@ public class OrderExtInfoDto {
* 出场时间
*/
private String outTime;
/**
* 打开小程序的场景值。
*/
private String scene;
/**
* 支付渠道编号(参考支付组payment_platform)
......
......@@ -81,6 +81,8 @@ public enum ResponseResult {
SHOPPING_CART_PRODUCT_NOT_EXIST("44016", "商品不存在"),
SHOPPING_CART_REQUIRED_PRODUCT_NOT_EXIST("44017", "必选商品不存在"),
SHOPPING_CART_GIFTS_PRODUCT_NOT_EXIST("44018", "买赠商品不存在"),
SHOPPING_CART_SHOP_ID_NOT_EMPTY("44019", "门店编号不能为空"),
SHOPPING_CART_COUPON_CAN_NOT_USE_THIS_SHOP("44020", "券不适用于该门店"),
/**
* 订单状态码
......
......@@ -22,7 +22,6 @@ import cn.freemud.constant.ShoppingCartConstant;
import cn.freemud.entities.dto.*;
import cn.freemud.entities.dto.activity.ActivityQueryDto;
import cn.freemud.entities.dto.activity.ActivityQueryResponseDto;
import cn.freemud.entities.dto.activity.ShareDiscountActivityDto;
import cn.freemud.entities.dto.openplatform.WeixinProductRequestDto;
import cn.freemud.entities.dto.openplatform.WeixinProductResponseDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
......@@ -39,7 +38,6 @@ import cn.freemud.utils.ResponseUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerStoreDeliveryConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.log.ErrorLog;
......@@ -51,7 +49,6 @@ import com.freemud.application.sdk.api.paymentcenter.client.request.SVCCardAmoun
import com.freemud.application.sdk.api.paymentcenter.client.response.SVCCardAmountResponse;
import com.freemud.application.sdk.api.paymentcenter.client.service.PaymentNewService;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
import com.freemud.application.sdk.api.promotioncenter.response.ActivityResponse;
import com.freemud.application.sdk.api.storecenter.request.QueryDeliveryRequest;
import com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest;
import com.freemud.application.sdk.api.storecenter.response.QueryDeliverDetailResponse;
......@@ -63,7 +60,6 @@ import com.freemud.sdk.api.assortment.shoppingcart.request.CheckCartRequest;
import com.freemud.sdk.api.assortment.shoppingcart.service.ShoppingCartBaseService;
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl;
import com.google.common.collect.Lists;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
......@@ -213,7 +209,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
@Override
public BaseResponse addGoods(AddShoppingCartGoodsRequestVo addShoppingCartGoodsRequestVo) {
if (StringUtils.isEmpty(addShoppingCartGoodsRequestVo.getShopId())){
throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
ShoppingCartConvertAdapter.convent2SkuId(addShoppingCartGoodsRequestVo);
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
// 获取用户信息
......@@ -329,6 +327,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
@Override
public BaseResponse updateGoodsQty(UpdateShoppingCartGoodsQtyRequestVo updateShoppingCartGoodsQtyRequestVo) {
if (StringUtils.isEmpty(updateShoppingCartGoodsQtyRequestVo.getShopId())){
throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
CustomerInfoVo assortmentCustomerInfoVo = getCustomerInfoVo(updateShoppingCartGoodsQtyRequestVo.getSessionId());
UserLoginInfoDto userLoginInfoDto = convert2UserLoginInfoDto(assortmentCustomerInfoVo);
......@@ -436,6 +437,9 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
@Override
public BaseResponse getGoodsList(ShoppingCartInfoRequestVo shoppingCartInfoRequestVo) {
if (StringUtils.isEmpty(shoppingCartInfoRequestVo.getShopId())){
throw new ServiceException(ResponseResult.SHOPPING_CART_SHOP_ID_NOT_EMPTY);
}
ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo = new ShoppingCartGoodsResponseVo();
// 获取用户信息
CustomerInfoVo assortmentCustomerInfoVo = getCustomerInfoVo(shoppingCartInfoRequestVo.getSessionId());
......@@ -529,12 +533,16 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
*/
@Override
public BaseResponse clear(ShoppingCartClearRequestVo shoppingCartClearRequestVo) {
CustomerInfoVo userLoginInfoDto =getCustomerInfoVo(shoppingCartClearRequestVo.getSessionId());
String appId = shoppingCartClearRequestVo.getAppId();
if (StringUtils.isBlank(appId)) {
return ResponseUtil.error(ResponseResult.PARAMETER_MISSING, "appId不能为空");
}
String userId = userLoginInfoDto.getMemberId();
String userId = shoppingCartClearRequestVo.getUserId();
if (StringUtils.isEmpty(userId)){
CustomerInfoVo userLoginInfoDto =getCustomerInfoVo(shoppingCartClearRequestVo.getSessionId());
userId=userLoginInfoDto.getMemberId();
}
String partnerId = shoppingCartClearRequestVo.getPartnerId();
String storeId = shoppingCartClearRequestVo.getShopId();
shoppingCartNewBaseService.clear(partnerId, storeId, userId);
......@@ -772,7 +780,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (CollectionUtils.isEmpty(calculationDiscountGoodsList)) {
return null;
}
activityCalculationDiscountRequestDto.setGoods(calculationDiscountGoodsList);
activityCalculationDiscountRequestDto.setCoupons(coupons);
activityCalculationDiscountRequestDto.setOrgIds(commonService.getOrgIds(partnerId, storeId));
......@@ -793,6 +800,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
result.setDistributionFee(result.getDistributionFee());
return result;
}
// 支付宝华莱士紧急修改代码,当促销返回103错误码时,需要报券不适用于该门店,且清空购物车
ShoppingCartClearRequestVo shoppingCartClearRequestVo = new ShoppingCartClearRequestVo();
shoppingCartClearRequestVo.setAppId(appId);
shoppingCartClearRequestVo.setPartnerId(partnerId);
shoppingCartClearRequestVo.setUserId(userId);
shoppingCartClearRequestVo.setShopId(storeId);
shoppingCartClearRequestVo.setOperationType(1);
clear(shoppingCartClearRequestVo);
if (activityCalculationDiscountResponseDto != null && StringUtils.equals(activityCalculationDiscountResponseDto.getStatusCode(), "103")){
throw new ServiceException(ResponseResult.SHOPPING_CART_COUPON_CAN_NOT_USE_THIS_SHOP);
}
throw new ServiceException(ResponseResult.OPERATE_TOO_OFTEN);
}
......
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