Commit ea25c9d4 by 周晓航

Merge branch 'master-spock' into feature/zxh/套餐商品库存新模式-20221018

# Conflicts:
#	order-application-service/src/test/spock/cn/freemud/service/impl/OrderAdapterServiceImplTest.groovy
parents 6714ea37 cafe8572
......@@ -122,4 +122,13 @@ public class ExposureOrderController {
return ResponseUtil.success(exposureOrderService.getVirtualStore(req.getAppId(), req.getType()));
}
/**
* 查询支付配置paycode
*/
@ApiAnnotation(logMessage = "查询支付配置paycode")
@PostMapping("/getPayCode")
public BaseResponse<String> getPayCode(@Validated @LogParams @RequestBody GetPayCodeVo req) {
return ResponseUtil.success(exposureOrderService.getPayCode(req));
}
}
package cn.freemud.entities.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GetPayCodeVo {
@NotBlank(message = "商户号不能为空")
private String partnerId;
@NotBlank(message = "门店id不能为空")
private String storeId;
@NotBlank(message = "小程序id不能为空")
private String appId;
private String channel;
}
......@@ -27,13 +27,12 @@ import cn.freemud.entities.dto.shoppingCart.GetShoppingCartGoodsApportionDto;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.dto.store.StoreMixResponseDto;
import cn.freemud.entities.vo.CreateOrderBaseVo;
import cn.freemud.entities.vo.CreateOrderVo;
import cn.freemud.entities.vo.GetProductsVo;
import cn.freemud.entities.vo.ShoppingCartInfoRequestVo;
import cn.freemud.enums.*;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.adapter.OrderCheckAdapter;
import cn.freemud.service.impl.ItemServiceImpl;
import cn.freemud.service.impl.OrderItemServiceImpl;
import cn.freemud.service.impl.StoreServiceImpl;
import cn.freemud.service.order.OrderRelationFactory;
import cn.freemud.service.order.OrderRelationService;
......@@ -102,7 +101,7 @@ public abstract class CheckOrderUniversal {
@Autowired
private StoreServiceImpl storeService;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
// 配送费逻辑是否使用旧的
@Value("${store.delivery.use.old}")
......
......@@ -3,6 +3,8 @@ package cn.freemud.service;
import cn.freemud.entities.vo.GetMallPayConfigVo;
import cn.freemud.entities.vo.GetPayConfigVo;
import cn.freemud.entities.vo.GetPaySuccessDataRequest;
import cn.freemud.base.entity.BaseResponse;
import cn.freemud.entities.vo.*;
import cn.freemud.entities.vo.order.PayConfigVo;
import cn.freemud.entities.vo.order.PaySuccessDataVo;
import cn.freemud.enums.AggregationTypeEnum;
......@@ -84,4 +86,11 @@ public class ExposureOrderService {
AssortmentOpenPlatformIappWxappStore wxAppStore = payService.getIappWxappStoreInfo(appId, type);
return wxAppStore == null ? "" : wxAppStore.getStoreId();
}
/**
* 查询支付配置paycode
*/
public String getPayCode(GetPayCodeVo req) {
return payService.getPayCode(req.getAppId(), req.getStoreId(), req.getChannel());
}
}
......@@ -51,7 +51,6 @@ import com.freemud.application.sdk.api.membercenter.service.MemberPropertyServic
import com.freemud.application.sdk.api.ordercenter.constant.ResponseConstant;
import com.freemud.application.sdk.api.ordercenter.enums.ProductTypeEnum;
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;
import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.application.sdk.api.storecenter.service.StoreCenterService;
......@@ -97,7 +96,7 @@ public class CheckMCCafeOrder {
// @Autowired
// private StockClient stockClient;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
@Autowired
private CouponService couponService;
@Autowired
......
......@@ -192,7 +192,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
@Autowired
private CustomerApplicationClient customerApplicationClient;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
@Autowired
private BuriedPointService buriedPointService;
@Autowired
......
......@@ -115,7 +115,7 @@ public class MallOrderServiceImpl implements MallOrderService {
@Autowired
private OrderAdapter orderAdapter;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
@Autowired
private ShoppingCartClient shoppingCartClient;
@Autowired
......
......@@ -44,7 +44,7 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
@Service
public class CouponServiceImpl implements CouponService {
public class OrderCouponServiceImpl implements CouponService {
@Autowired
private CouponOnlineClient couponOnlineClient;
......
......@@ -33,7 +33,7 @@ import java.util.*;
import java.util.stream.Collectors;
@Service
public class ItemServiceImpl implements ItemService{
public class OrderItemServiceImpl implements ItemService{
private static Gson gson = new Gson();
......
......@@ -105,6 +105,7 @@ import com.freemud.application.sdk.api.ordercenter.entities.v1.RefundBeanV1;
import com.freemud.application.sdk.api.ordercenter.enums.*;
import com.freemud.application.sdk.api.ordercenter.enums.orderv1.*;
import com.freemud.application.sdk.api.ordercenter.enums.orderv1.OrderStatusV1;
import com.freemud.application.sdk.api.ordercenter.enums.orderv1.OrderStatusV1;
import com.freemud.application.sdk.api.ordercenter.enums.orderv1.OrderTypeV1;
import com.freemud.application.sdk.api.ordercenter.request.*;
import com.freemud.application.sdk.api.ordercenter.request.carpark.ParkingOrderCreateReq;
......@@ -202,7 +203,7 @@ public class OrderServiceImpl implements Orderservice {
@Autowired
private CustomerApplicationClient customerApplicationClient;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
@Autowired
private CouponActivityService couponActivityService;
@Autowired
......
......@@ -1711,4 +1711,16 @@ public class PayServiceImpl {
return payTypeCode;
}
public String getPayCode(String wxAppid, String storeId, String channel) {
PayChannelType byIndex = PayChannelType.getByIndex(Byte.parseByte(channel));
if (byIndex.getEbcode() == null) return "";
AssortmentOpenPlatformIappWxappStore wxAppStore = assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(wxAppid
, storeId
, byIndex.getEbcode());
if (wxAppStore != null && StringUtils.isNotBlank(wxAppStore.getPayCode())) {
return wxAppStore.getPayCode();
}
return "9";
}
}
......@@ -22,7 +22,7 @@ import cn.freemud.enums.ResponseResult;
import cn.freemud.enums.*;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.MallOrderService;
import cn.freemud.service.impl.ItemServiceImpl;
import cn.freemud.service.impl.OrderItemServiceImpl;
import cn.freemud.service.universal.UniversalOrderService;
import cn.freemud.utils.AppLogUtil;
import cn.freemud.utils.ResponseUtil;
......@@ -83,7 +83,7 @@ public class SaasMallOrderService extends UniversalOrderService {
private OrderAdapter orderAdapter;
@Autowired
private ItemServiceImpl itemService;
private OrderItemServiceImpl itemService;
@Autowired
private OrderSdkAdapter orderSdkAdapter;
......
package cn.freemud.service.impl
import cn.freemud.management.adapter.PaymentSdkAdapter
import cn.freemud.management.controller.OrderManagerController
import cn.freemud.management.entities.dto.request.order.OrderManagerRequest
import cn.freemud.management.entities.dto.response.pay.PayRefundData
import cn.freemud.management.entities.dto.response.pay.PaymentQueryOrderResponseDto
import cn.freemud.management.service.OrderBaseService
import cn.freemud.management.service.adapter.OrderBeanFactory
import cn.freemud.management.service.adapter.OrderManagerAdapter
import cn.freemud.management.service.handle.DeliveryHandle
import cn.freemud.management.service.handle.OrderVerifyHandle
import cn.freemud.management.service.handle.PaymentHandle
import cn.freemud.management.service.impl.SaasOrderMangerServiceImpl
import cn.freemud.management.thirdparty.MulitiPaymentClient
import cn.freemud.management.thirdparty.OMSPaymentClient
import cn.freemud.redis.RedisCache
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformIappWxappStore
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIappWxappStoreManager
import com.freemud.application.sdk.api.base.BaseResponse
import com.freemud.application.sdk.api.ordercenter.adapter.OrderCenterSdkAdapter
import com.freemud.application.sdk.api.ordercenter.response.OrderBaseResp
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs
import com.freemud.application.sdk.api.ordercenter.service.OrderSdkService
import com.freemud.application.sdk.api.ordercenter.util.LogUtil
import com.freemud.sdk.api.assortment.order.response.order.MultiOrderRefundResponse
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/7/12 10:13
* @description :
*/
class OMSServiceSpock extends Specification {
def orderManagerAdapter = new OrderManagerAdapter()
def orderBaseService = Mock(OrderBaseService)
def orderVerifyHandle = new OrderVerifyHandle()
def redisCache = Mock(RedisCache)
def orderBeanFactory = Mock(OrderBeanFactory)
def saasOrderManagerServiceImpl = new SaasOrderMangerServiceImpl()
def deliveryHandle = Mock(DeliveryHandle)
def paymentHandle = new PaymentHandle()
def orderSdkService = Mock(OrderSdkService)
def paymentSdkAdapter = new PaymentSdkAdapter()
def orderCenterSdkAdapter = new OrderCenterSdkAdapter()
def paymentNewClient = Mock(OMSPaymentClient)
def assortmentOpenPlatformIappWxappStoreManager = Mock(AssortmentOpenPlatformIappWxappStoreManager)
def logUtil = Mock(LogUtil)
def mulitiPaymentClient = Mock(MulitiPaymentClient)
def orderManagerController = new OrderManagerController()
void setup() {
orderManagerController.orderManagerAdapter = orderManagerAdapter
orderManagerAdapter.orderBaseService = orderBaseService
orderManagerAdapter.orderVerifyHandle = orderVerifyHandle
orderVerifyHandle.redisCache = redisCache
orderManagerAdapter.orderBeanFactory = orderBeanFactory
saasOrderManagerServiceImpl.deliveryHandle = deliveryHandle
saasOrderManagerServiceImpl.paymentHandle = paymentHandle
paymentHandle.paymentSdkAdapter = paymentSdkAdapter
paymentHandle.orderSdkService = orderSdkService
paymentHandle.paymentNewClient = paymentNewClient
paymentHandle.assortmentOpenPlatformIappWxappStoreManager = assortmentOpenPlatformIappWxappStoreManager
paymentHandle.logUtil = logUtil
paymentHandle.mulitiPaymentClient = mulitiPaymentClient
}
def "orderAgreeRefund to SaasOrder"() {
given: "参数设置"
def requestVo = JSON.parseObject("{\"brandVerifyAfterSales\":false,\"horseman\":false,\"operateType\":\"orderAgreeRefund\",\"operationClient\":0,\"operator\":\"admin\",\"orderId\":\"25057059417364153500004\",\"partnerId\":\"2581\"}",
new TypeReference<OrderManagerRequest>() {})
def orderInfo = JSON.parseObject("{\"abnormalDesc\":\"\",\"abnormalState\":0,\"acceptTime\":1659004361000,\"actualPayAmount\":1080.0,\"afterSalesOrderList\":[{\"actualAmount\":3790.0,\"actualScoreAmount\":0,\"adultRemark\":\"\",\"afterSalesApplyClient\":0,\"afterSalesCode\":\"25057073866525960500004\",\"afterSalesImages\":[],\"afterSalesOptHistoryList\":[{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"id\":250570738679939678,\"operationClient\":0,\"operationCode\":1,\"operationDesc\":\"发起售后申请\",\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"partnerId\":\"2581\",\"targetAfterSalesState\":1,\"timeout\":0,\"updateTime\":1659004477000},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004492000,\"id\":250570754282785835,\"operationClient\":1,\"operationCode\":4,\"operationDesc\":\"退货完成\",\"operator\":\"pos\",\"orderCode\":\"25057059417364153500004\",\"partnerId\":\"2581\",\"targetAfterSalesState\":4,\"timeout\":0,\"updateTime\":1659004492000}],\"afterSalesOrderItems\":[{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"353ee7b7-98ac-4a06-942b-11995eb401fe\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"021503897\\\"}\",\"id\":250570738667356758,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594194613059,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"226650306125091606\",\"productName\":\"六个香辣小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639359965618.png\",\"productPrice\":1190.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":2,\"productSpec\":\"226650306125091606\",\"productSpecName\":\"六个香辣小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj021503897\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"010300040\\\"}\",\"id\":250570738669453911,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594188321601,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"205873819584334365\",\"productName\":\"韩式炸鸡桶\",\"productPicUrl\":\"https://picture.sandload.cn/1623721168081.jpg\",\"productPrice\":500.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSpec\":\"205873819584334365\",\"productSpecName\":\"韩式炸鸡桶\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010300040\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200118\\\"}\",\"id\":250570738670502488,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594200904517,\"parentProductId\":\"226650306125091606_2\",\"partnerId\":\"2581\",\"productId\":\"226650195045241630\",\"productName\":\"小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639010644221.png\",\"productPrice\":198.0,\"productProperty\":\"\",\"productQuantity\":6,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"226650195045241630\",\"productSpecName\":\"小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010200118\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"f6279826-d598-4e3e-ae19-5c9f7522aedb\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805123\\\"}\",\"id\":250570738671551065,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594207195975,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"229893933386351900\",\"productName\":\"鸡米花2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642047071104.jpg\",\"productPrice\":900.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":3,\"productSpec\":\"229893933386351900\",\"productSpecName\":\"鸡米花2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj020805123\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010100001\\\"}\",\"id\":250570738672599642,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594228167501,\"parentProductId\":\"229924916440378431_4\",\"partnerId\":\"2581\",\"productId\":\"205061623490055194\",\"productName\":\"香辣鸡腿堡\",\"productPicUrl\":\"https://picture.sandload.cn/1618365464768.jpg\",\"productPrice\":600.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"205061623490055194\",\"productSpecName\":\"香辣鸡腿堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010100001\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200001\\\"}\",\"id\":250570738673648219,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594213487433,\"parentProductId\":\"229893933386351900_3\",\"partnerId\":\"2581\",\"productId\":\"205116588443264314\",\"productName\":\"鸡米花\",\"productPicUrl\":\"https://picture.sandload.cn/1618387408140.jpg\",\"productPrice\":450.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"205116588443264314\",\"productSpecName\":\"鸡米花\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010200001\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11dea04f-9dbc-4f7e-b277-5e6cf387f5cc\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805079\\\"}\",\"id\":250570738674696796,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594219778891,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"229924916440378431\",\"productName\":\"香辣鸡腿堡2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642076939042.jpg\",\"productPrice\":1200.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":4,\"productSpec\":\"229924916440378431\",\"productSpecName\":\"香辣鸡腿堡2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj020805079\",\"updateTime\":1659004477000,\"weight\":0.00}],\"afterSalesReason\":\"下错单\",\"afterSalesStatus\":4,\"afterSalesType\":2,\"createTime\":1659004477000,\"deliveryAmount\":0.0,\"deliveryContactInfo\":[],\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"extInfo\":\"{\\\"lastOrderStatus\\\": 3}\",\"hasCargo\":false,\"isAllItemAfterSales\":true,\"operator\":\"pos\",\"orderCode\":\"25057059417364153500004\",\"originalShippingFee\":0.0,\"partnerId\":\"2581\",\"partnerRefundCode\":\"\",\"refundFailReason\":\"\",\"refundState\":2,\"reqAmount\":3790.0,\"reqRemark\":\"Hh \",\"reqScoreAmount\":0,\"settlementShippingFee\":0.0,\"thirdRefundCode\":\"\",\"updateTime\":1659004492000,\"weight\":0.00}],\"afterSalesState\":4,\"appId\":\"2021002109662866\",\"barCounter\":\"\",\"bizType\":1,\"businessDay\":1658937600000,\"canRefund\":true,\"cancelReason\":\"下错单\",\"companySelfCode\":\"\",\"createTime\":1659004340000,\"daySeq\":32,\"deliveryContactInfoList\":[{\"addressDetail\":\"天津市北辰区果园北道与商业局东路交口\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"{}\",\"infoType\":1,\"latitude\":0E-7,\"longitude\":0E-7,\"mobile\":\"15222622053\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":1,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\",\"tripDist\":0}],\"deliveryPromise\":0,\"deliveryState\":-2,\"dinersNumber\":0,\"downstreamPosCode\":\"0\",\"downstreamThirdOrderCode\":\"0\",\"evaluationState\":0,\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"expressType\":0,\"extInfo\":\"{\\\"fmId\\\": \\\"8802581250570594402293008\\\", \\\"appid\\\": \\\"2021002109662866\\\", \\\"formId\\\": \\\"MjA4ODgxMjUxMzc2MTU1NF8xNjU5MDA0MzM5NjQ5XzA1OQ==\\\", \\\"openid\\\": \\\"2088812513761554\\\", \\\"payDate\\\": \\\"2022-07-28 18:32:28\\\", \\\"version\\\": \\\"2.0.651\\\", \\\"prepayId\\\": \\\"2022072822001461551417120994\\\", \\\"fromAppId\\\": \\\"2021002109662866\\\", \\\"sessionId\\\": \\\"02268690d5cf6efa2a3f9a1dc08c569a359c45f2\\\", \\\"endTransId\\\": \\\"10024066479262207281832206428006\\\", \\\"paidMember\\\": false, \\\"payTransId\\\": \\\"8802581250570594402293008\\\", \\\"sessionKey\\\": \\\"\\\", \\\"totalScore\\\": 0, \\\"memberLevel\\\": \\\"\\\", \\\"serviceTime\\\": 50, \\\"dispatchType\\\": \\\"0\\\", \\\"pushOrderTime\\\": 0, \\\"dispatchTimeout\\\": 0, \\\"deliveryHoursDayEnd\\\": \\\"\\\", \\\"deliveryHoursDayStart\\\": \\\"\\\", \\\"packageAmountCollectType\\\": 1}\",\"immediately\":true,\"isParent\":false,\"localTableKey\":\"\",\"logisticsAccessChannel\":0,\"logisticsList\":[],\"marketingCode\":\"\",\"marketingType\":0,\"needInvoice\":false,\"note\":\"\",\"operator\":\"\",\"orderArea\":\"0\",\"orderClient\":3,\"orderCode\":\"25057059417364153500004\",\"orderCostDetailList\":[],\"orderExtended\":{\"agentPayerId\":\"\",\"agentPayerName\":\"\",\"createTime\":1659004340000,\"id\":250570594173641535,\"isDeleted\":false,\"orderClientGroup\":\"督导林爽\",\"orderClientGroupCode\":\"210204\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"partnerId\":\"2581\",\"sendWord\":\"\",\"spellGroupCode\":\"\",\"storeId\":\"999999_01056\",\"storeNameEn\":\"\",\"updateTime\":1659004340000,\"userPhone\":\"\",\"version\":0},\"orderInvoice\":{\"address\":\"\",\"bankCardNo\":\"\",\"content\":\"\",\"invoiceBank\":\"\",\"invoiceNo\":\"\",\"invoiceUrl\":\"\",\"itemId\":\"\",\"partnerId\":\"\",\"phoneNo\":\"\",\"pickUpNo\":\"\",\"taxNo\":\"\",\"title\":\"\",\"userId\":\"\"},\"orderItemList\":[{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"010300040\\\"}\",\"id\":250570594188321601,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"010300040\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205873819584334365\",\"productName\":\"韩式炸鸡桶\",\"productPicUrl\":\"https://picture.sandload.cn/1623721168081.jpg\",\"productPrice\":1500.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSharePrice\":1000.0,\"productSpec\":\"205873819584334365\",\"productSpecName\":\"韩式炸鸡桶\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":500.0,\"saleScorePrice\":0,\"settlementPrice\":500.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010300040\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"353ee7b7-98ac-4a06-942b-11995eb401fe\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"021503897\\\"}\",\"id\":250570594194613059,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"021503897\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"226650306125091606\",\"productName\":\"六个香辣小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639359965618.png\",\"productPrice\":2400.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":2,\"productSharePrice\":1210.0,\"productSpec\":\"226650306125091606\",\"productSpecName\":\"六个香辣小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1190.0,\"saleScorePrice\":0,\"settlementPrice\":1190.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj021503897\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200118\\\"}\",\"id\":250570594200904517,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"226650306125091606_2\",\"photoUrl\":\"\",\"productCode\":\"010200118\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"226650195045241630\",\"productName\":\"小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639010644221.png\",\"productPrice\":400.0,\"productProperty\":\"\",\"productQuantity\":6,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":201.0,\"productSpec\":\"226650195045241630\",\"productSpecName\":\"小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":198.0,\"saleScorePrice\":0,\"settlementPrice\":1190.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010200118\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"f6279826-d598-4e3e-ae19-5c9f7522aedb\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805123\\\"}\",\"id\":250570594207195975,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"020805123\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"229893933386351900\",\"productName\":\"鸡米花2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642047071104.jpg\",\"productPrice\":1600.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":3,\"productSharePrice\":700.0,\"productSpec\":\"229893933386351900\",\"productSpecName\":\"鸡米花2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":900.0,\"saleScorePrice\":0,\"settlementPrice\":900.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj020805123\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200001\\\"}\",\"id\":250570594213487433,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"229893933386351900_3\",\"photoUrl\":\"\",\"productCode\":\"010200001\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205116588443264314\",\"productName\":\"鸡米花\",\"productPicUrl\":\"https://picture.sandload.cn/1618387408140.jpg\",\"productPrice\":800.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":350.0,\"productSpec\":\"205116588443264314\",\"productSpecName\":\"鸡米花\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":450.0,\"saleScorePrice\":0,\"settlementPrice\":900.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010200001\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11dea04f-9dbc-4f7e-b277-5e6cf387f5cc\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805079\\\"}\",\"id\":250570594219778891,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"020805079\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"229924916440378431\",\"productName\":\"香辣鸡腿堡2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642076939042.jpg\",\"productPrice\":2200.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":4,\"productSharePrice\":1000.0,\"productSpec\":\"229924916440378431\",\"productSpecName\":\"香辣鸡腿堡2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1200.0,\"saleScorePrice\":0,\"settlementPrice\":1200.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj020805079\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010100001\\\"}\",\"id\":250570594228167501,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"229924916440378431_4\",\"photoUrl\":\"\",\"productCode\":\"010100001\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205061623490055194\",\"productName\":\"香辣鸡腿堡\",\"productPicUrl\":\"https://picture.sandload.cn/1618365464768.jpg\",\"productPrice\":1100.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":500.0,\"productSpec\":\"205061623490055194\",\"productSpecName\":\"香辣鸡腿堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":600.0,\"saleScorePrice\":0,\"settlementPrice\":1200.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010100001\",\"userId\":\"\",\"weight\":0.00}],\"orderPayItemCreateReqList\":[{\"cardCode\":\"\",\"fmTradeNo\":\"8802581250570594402293008\",\"id\":250570594891893814,\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"outOrderNo\":\"\",\"partnerId\":\"2581\",\"payAmount\":1080.0,\"payChannelName\":\"支付宝\",\"payChannelType\":\"2\",\"payState\":3,\"storeId\":\"999999_01056\",\"transId\":\"461599682057850883\"},{\"cardCode\":\"\",\"fmTradeNo\":\"\",\"id\":250570594892942391,\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"outOrderNo\":\"\",\"partnerId\":\"2581\",\"payAmount\":2710.0,\"payChannelName\":\"储值卡\",\"payChannelType\":\"3\",\"payState\":3,\"storeId\":\"999999_01056\",\"transId\":\"461599682057850881\"}],\"orderSendCouponRespList\":[],\"orderSettlementDetailList\":[{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"MEHG2022062014460062935\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"加价购\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":-1000.0,\"settlementType\":46,\"shopAmount\":0.0,\"shopDiscountAmount\":-1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"MEHG2022062014460062935\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"加价购\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205873819584334365\",\"productSeq\":1,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":46,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":-2910.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":-2910.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650306125091606\",\"productSeq\":2,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229893933386351900\",\"productSeq\":3,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229924916440378431\",\"productSeq\":4,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205873819584334365\",\"productSeq\":1,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650306125091606\",\"productSeq\":2,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":6,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650195045241630\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229893933386351900\",\"productSeq\":3,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":2,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205116588443264314\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229924916440378431\",\"productSeq\":4,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":2,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205061623490055194\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"优惠总金额\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":0,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":3790.0,\"settlementType\":205,\"shopAmount\":0.0,\"shopDiscountAmount\":3910.0}],\"orderState\":3,\"orderSubState\":0,\"orderType\":5,\"orderVersion\":1,\"originalAmount\":7700.0,\"originalScoreAmount\":0,\"parentCode\":\"0\",\"partnerId\":\"2581\",\"partnerName\":\"\",\"payChannel\":\"10212\",\"payChannelName\":\"混合支付\",\"payChannelType\":4,\"payRequestNo\":\"8802581250570594402293008\",\"payState\":2,\"payTime\":1659004349000,\"payType\":1,\"physicalGoodsFlag\":0,\"pickUpGoodsNo\":\"5772\",\"posCode\":\"\",\"posTableKey\":\"\",\"printNum\":0,\"settlementAmount\":3790.0,\"settlementScoreAmount\":0,\"sourceType\":0,\"storeId\":\"999999_01056\",\"storeName\":\"华莱士(果园北道店)\",\"storeUnifyId\":\"0\",\"suspendDesc\":\"售中取消挂起\",\"suspendState\":3,\"thirdOrderCode\":\"25057059417364153500004\",\"thirdStoreId\":\"999999_01056\",\"toStoreId\":\"0\",\"updateTime\":1659004492000,\"userId\":\"3624007194908712536\",\"userMobile\":\"\",\"userName\":\"\",\"weight\":0.00}",
new TypeReference<OrderInfoReqs>() {})
def orderBean = orderCenterSdkAdapter.convent2NEWOrderInfo(orderInfo)
def listBaseResponse = JSON.parseObject("{\"code\":\"100\",\"message\":\"成功\",\"result\":[{\"actualAmount\":3790.0,\"actualScoreAmount\":0,\"adultRemark\":\"\",\"afterSalesApplyClient\":0,\"afterSalesCode\":\"25057073866525960500004\",\"afterSalesImages\":[],\"afterSalesOptHistoryList\":[{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"id\":250570738679939678,\"operationClient\":0,\"operationCode\":1,\"operationDesc\":\"发起售后申请\",\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"partnerId\":\"2581\",\"targetAfterSalesState\":1,\"timeout\":0,\"updateTime\":1659004477000},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004492000,\"id\":250570754282785835,\"operationClient\":1,\"operationCode\":4,\"operationDesc\":\"退货完成\",\"operator\":\"pos\",\"orderCode\":\"25057059417364153500004\",\"partnerId\":\"2581\",\"targetAfterSalesState\":4,\"timeout\":0,\"updateTime\":1659004492000}],\"afterSalesOrderItems\":[{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"353ee7b7-98ac-4a06-942b-11995eb401fe\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"021503897\\\"}\",\"id\":250570738667356758,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594194613059,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"226650306125091606\",\"productName\":\"六个香辣小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639359965618.png\",\"productPrice\":1190.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":2,\"productSpec\":\"226650306125091606\",\"productSpecName\":\"六个香辣小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj021503897\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"010300040\\\"}\",\"id\":250570738669453911,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594188321601,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"205873819584334365\",\"productName\":\"韩式炸鸡桶\",\"productPicUrl\":\"https://picture.sandload.cn/1623721168081.jpg\",\"productPrice\":500.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSpec\":\"205873819584334365\",\"productSpecName\":\"韩式炸鸡桶\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010300040\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200118\\\"}\",\"id\":250570738670502488,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594200904517,\"parentProductId\":\"226650306125091606_2\",\"partnerId\":\"2581\",\"productId\":\"226650195045241630\",\"productName\":\"小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639010644221.png\",\"productPrice\":198.0,\"productProperty\":\"\",\"productQuantity\":6,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"226650195045241630\",\"productSpecName\":\"小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010200118\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"f6279826-d598-4e3e-ae19-5c9f7522aedb\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805123\\\"}\",\"id\":250570738671551065,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594207195975,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"229893933386351900\",\"productName\":\"鸡米花2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642047071104.jpg\",\"productPrice\":900.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":3,\"productSpec\":\"229893933386351900\",\"productSpecName\":\"鸡米花2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj020805123\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010100001\\\"}\",\"id\":250570738672599642,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594228167501,\"parentProductId\":\"229924916440378431_4\",\"partnerId\":\"2581\",\"productId\":\"205061623490055194\",\"productName\":\"香辣鸡腿堡\",\"productPicUrl\":\"https://picture.sandload.cn/1618365464768.jpg\",\"productPrice\":600.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"205061623490055194\",\"productSpecName\":\"香辣鸡腿堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010100001\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200001\\\"}\",\"id\":250570738673648219,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594213487433,\"parentProductId\":\"229893933386351900_3\",\"partnerId\":\"2581\",\"productId\":\"205116588443264314\",\"productName\":\"鸡米花\",\"productPicUrl\":\"https://picture.sandload.cn/1618387408140.jpg\",\"productPrice\":450.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"205116588443264314\",\"productSpecName\":\"鸡米花\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj010200001\",\"updateTime\":1659004477000,\"weight\":0.00},{\"afterSalesCode\":\"25057073866525960500004\",\"createTime\":1659004477000,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11dea04f-9dbc-4f7e-b277-5e6cf387f5cc\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805079\\\"}\",\"id\":250570738674696796,\"orderCode\":\"25057059417364153500004\",\"orderItemId\":250570594219778891,\"parentProductId\":\"0\",\"partnerId\":\"2581\",\"productId\":\"229924916440378431\",\"productName\":\"香辣鸡腿堡2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642076939042.jpg\",\"productPrice\":1200.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":4,\"productSpec\":\"229924916440378431\",\"productSpecName\":\"香辣鸡腿堡2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"tj020805079\",\"updateTime\":1659004477000,\"weight\":0.00}],\"afterSalesReason\":\"下错单\",\"afterSalesStatus\":4,\"afterSalesType\":2,\"createTime\":1659004477000,\"deliveryAmount\":0.0,\"deliveryContactInfo\":[],\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"extInfo\":\"{\\\"lastOrderStatus\\\": 3}\",\"hasCargo\":false,\"isAllItemAfterSales\":true,\"operator\":\"pos\",\"orderCode\":\"25057059417364153500004\",\"orderInfo\":{\"abnormalDesc\":\"\",\"abnormalState\":0,\"acceptTime\":1659004361000,\"actualPayAmount\":1080.0,\"appId\":\"2021002109662866\",\"barCounter\":\"\",\"bizType\":1,\"businessDay\":1658937600000,\"canRefund\":true,\"cancelReason\":\"下错单\",\"companySelfCode\":\"\",\"createTime\":1659004340000,\"daySeq\":32,\"deliveryContactInfoList\":[{\"addressDetail\":\"天津市北辰区果园北道与商业局东路交口\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"{}\",\"infoType\":1,\"latitude\":0E-7,\"longitude\":0E-7,\"mobile\":\"15222622053\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":1,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\",\"tripDist\":0}],\"deliveryPromise\":0,\"deliveryState\":-2,\"dinersNumber\":0,\"downstreamPosCode\":\"0\",\"downstreamThirdOrderCode\":\"0\",\"evaluationState\":0,\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"expressType\":0,\"extInfo\":\"{\\\"fmId\\\": \\\"8802581250570594402293008\\\", \\\"appid\\\": \\\"2021002109662866\\\", \\\"formId\\\": \\\"MjA4ODgxMjUxMzc2MTU1NF8xNjU5MDA0MzM5NjQ5XzA1OQ==\\\", \\\"openid\\\": \\\"2088812513761554\\\", \\\"payDate\\\": \\\"2022-07-28 18:32:28\\\", \\\"version\\\": \\\"2.0.651\\\", \\\"prepayId\\\": \\\"2022072822001461551417120994\\\", \\\"fromAppId\\\": \\\"2021002109662866\\\", \\\"sessionId\\\": \\\"02268690d5cf6efa2a3f9a1dc08c569a359c45f2\\\", \\\"endTransId\\\": \\\"10024066479262207281832206428006\\\", \\\"paidMember\\\": false, \\\"payTransId\\\": \\\"8802581250570594402293008\\\", \\\"sessionKey\\\": \\\"\\\", \\\"totalScore\\\": 0, \\\"memberLevel\\\": \\\"\\\", \\\"serviceTime\\\": 50, \\\"dispatchType\\\": \\\"0\\\", \\\"pushOrderTime\\\": 0, \\\"dispatchTimeout\\\": 0, \\\"deliveryHoursDayEnd\\\": \\\"\\\", \\\"deliveryHoursDayStart\\\": \\\"\\\", \\\"packageAmountCollectType\\\": 1}\",\"immediately\":true,\"isParent\":false,\"localTableKey\":\"\",\"logisticsAccessChannel\":0,\"logisticsList\":[],\"marketingCode\":\"\",\"marketingType\":0,\"needInvoice\":false,\"note\":\"\",\"operator\":\"\",\"orderArea\":\"0\",\"orderClient\":3,\"orderCode\":\"25057059417364153500004\",\"orderCostDetailList\":[],\"orderExtended\":{\"agentPayerId\":\"\",\"agentPayerName\":\"\",\"createTime\":1659004340000,\"id\":250570594173641535,\"isDeleted\":false,\"orderClientGroup\":\"督导林爽\",\"orderClientGroupCode\":\"210204\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"partnerId\":\"2581\",\"sendWord\":\"\",\"spellGroupCode\":\"\",\"storeId\":\"999999_01056\",\"storeNameEn\":\"\",\"updateTime\":1659004340000,\"userPhone\":\"\",\"version\":0},\"orderInvoice\":{\"address\":\"\",\"bankCardNo\":\"\",\"content\":\"\",\"invoiceBank\":\"\",\"invoiceNo\":\"\",\"invoiceUrl\":\"\",\"itemId\":\"\",\"partnerId\":\"\",\"phoneNo\":\"\",\"pickUpNo\":\"\",\"taxNo\":\"\",\"title\":\"\",\"userId\":\"\"},\"orderItemList\":[{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"010300040\\\"}\",\"id\":250570594188321601,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"010300040\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205873819584334365\",\"productName\":\"韩式炸鸡桶\",\"productPicUrl\":\"https://picture.sandload.cn/1623721168081.jpg\",\"productPrice\":1500.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSharePrice\":1000.0,\"productSpec\":\"205873819584334365\",\"productSpecName\":\"韩式炸鸡桶\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":500.0,\"saleScorePrice\":0,\"settlementPrice\":500.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010300040\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"353ee7b7-98ac-4a06-942b-11995eb401fe\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"021503897\\\"}\",\"id\":250570594194613059,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"021503897\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"226650306125091606\",\"productName\":\"六个香辣小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639359965618.png\",\"productPrice\":2400.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":2,\"productSharePrice\":1210.0,\"productSpec\":\"226650306125091606\",\"productSpecName\":\"六个香辣小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1190.0,\"saleScorePrice\":0,\"settlementPrice\":1190.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj021503897\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200118\\\"}\",\"id\":250570594200904517,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"226650306125091606_2\",\"photoUrl\":\"\",\"productCode\":\"010200118\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"226650195045241630\",\"productName\":\"小鸡腿\",\"productPicUrl\":\"https://picture.sandload.cn/1639010644221.png\",\"productPrice\":400.0,\"productProperty\":\"\",\"productQuantity\":6,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":201.0,\"productSpec\":\"226650195045241630\",\"productSpecName\":\"小鸡腿\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":198.0,\"saleScorePrice\":0,\"settlementPrice\":1190.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010200118\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"f6279826-d598-4e3e-ae19-5c9f7522aedb\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805123\\\"}\",\"id\":250570594207195975,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"020805123\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"229893933386351900\",\"productName\":\"鸡米花2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642047071104.jpg\",\"productPrice\":1600.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":3,\"productSharePrice\":700.0,\"productSpec\":\"229893933386351900\",\"productSpecName\":\"鸡米花2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":900.0,\"saleScorePrice\":0,\"settlementPrice\":900.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj020805123\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010200001\\\"}\",\"id\":250570594213487433,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"229893933386351900_3\",\"photoUrl\":\"\",\"productCode\":\"010200001\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205116588443264314\",\"productName\":\"鸡米花\",\"productPicUrl\":\"https://picture.sandload.cn/1618387408140.jpg\",\"productPrice\":800.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":350.0,\"productSpec\":\"205116588443264314\",\"productSpecName\":\"鸡米花\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":450.0,\"saleScorePrice\":0,\"settlementPrice\":900.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010200001\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11dea04f-9dbc-4f7e-b277-5e6cf387f5cc\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"020805079\\\"}\",\"id\":250570594219778891,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"020805079\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"229924916440378431\",\"productName\":\"香辣鸡腿堡2份\",\"productPicUrl\":\"https://picture.sandload.cn/1642076939042.jpg\",\"productPrice\":2200.0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":4,\"productSharePrice\":1000.0,\"productSpec\":\"229924916440378431\",\"productSpecName\":\"香辣鸡腿堡2份\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1200.0,\"saleScorePrice\":0,\"settlementPrice\":1200.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj020805079\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"010100001\\\"}\",\"id\":250570594228167501,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"229924916440378431_4\",\"photoUrl\":\"\",\"productCode\":\"010100001\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"205061623490055194\",\"productName\":\"香辣鸡腿堡\",\"productPicUrl\":\"https://picture.sandload.cn/1618365464768.jpg\",\"productPrice\":1100.0,\"productProperty\":\"\",\"productQuantity\":2,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":500.0,\"productSpec\":\"205061623490055194\",\"productSpecName\":\"香辣鸡腿堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":600.0,\"saleScorePrice\":0,\"settlementPrice\":1200.0,\"settlementScorePrice\":0,\"thirdProductId\":\"tj010100001\",\"userId\":\"\",\"weight\":0.00}],\"orderPayItemCreateReqList\":[{\"cardCode\":\"\",\"fmTradeNo\":\"8802581250570594402293008\",\"id\":250570594891893814,\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"outOrderNo\":\"\",\"partnerId\":\"2581\",\"payAmount\":1080.0,\"payChannelName\":\"支付宝\",\"payChannelType\":\"2\",\"payState\":3,\"storeId\":\"999999_01056\",\"transId\":\"461599682057850883\"},{\"cardCode\":\"\",\"fmTradeNo\":\"\",\"id\":250570594892942391,\"operator\":\"\",\"orderCode\":\"25057059417364153500004\",\"orderId\":250570594173641535,\"outOrderNo\":\"\",\"partnerId\":\"2581\",\"payAmount\":2710.0,\"payChannelName\":\"储值卡\",\"payChannelType\":\"3\",\"payState\":3,\"storeId\":\"999999_01056\",\"transId\":\"461599682057850881\"}],\"orderSendCouponRespList\":[],\"orderSettlementDetailList\":[{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"MEHG2022062014460062935\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"加价购\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":-1000.0,\"settlementType\":46,\"shopAmount\":0.0,\"shopDiscountAmount\":-1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"MEHG2022062014460062935\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"加价购\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205873819584334365\",\"productSeq\":1,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":46,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":-2910.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":-2910.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650306125091606\",\"productSeq\":2,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229893933386351900\",\"productSeq\":3,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229924916440378431\",\"productSeq\":4,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":211,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205873819584334365\",\"productSeq\":1,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650306125091606\",\"productSeq\":2,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":6,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"226650195045241630\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":1210.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1210.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229893933386351900\",\"productSeq\":3,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":2,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205116588443264314\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":700.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":700.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"229924916440378431\",\"productSeq\":4,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":2,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"205061623490055194\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":1000.0,\"settlementType\":0,\"shopAmount\":0.0,\"shopDiscountAmount\":1000.0},{\"agentDiscountAmount\":0.0,\"carrierDiscountAmount\":0.0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"优惠总金额\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":0,\"platformDiscountAmount\":0.0,\"platformServiceAmount\":0.0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":3790.0,\"settlementType\":205,\"shopAmount\":0.0,\"shopDiscountAmount\":3910.0}],\"orderState\":3,\"orderSubState\":0,\"orderType\":5,\"orderVersion\":1,\"originalAmount\":7700.0,\"originalScoreAmount\":0,\"parentCode\":\"0\",\"partnerId\":\"2581\",\"partnerName\":\"\",\"payChannel\":\"10212\",\"payChannelName\":\"混合支付\",\"payChannelType\":4,\"payRequestNo\":\"8802581250570594402293008\",\"payState\":2,\"payTime\":1659004349000,\"payType\":1,\"physicalGoodsFlag\":0,\"pickUpGoodsNo\":\"5772\",\"posCode\":\"\",\"posTableKey\":\"\",\"printNum\":0,\"settlementAmount\":3790.0,\"settlementScoreAmount\":0,\"sourceType\":0,\"storeId\":\"999999_01056\",\"storeName\":\"华莱士(果园北道店)\",\"storeUnifyId\":\"0\",\"suspendDesc\":\"售中取消挂起\",\"suspendState\":3,\"thirdOrderCode\":\"25057059417364153500004\",\"thirdStoreId\":\"999999_01056\",\"toStoreId\":\"0\",\"updateTime\":1659004492000,\"userId\":\"3624007194908712536\",\"userMobile\":\"\",\"userName\":\"\",\"weight\":0.00},\"originalShippingFee\":0.0,\"partnerId\":\"2581\",\"partnerRefundCode\":\"\",\"refundFailReason\":\"\",\"refundState\":2,\"reqAmount\":3790.0,\"reqRemark\":\"Hh \",\"reqScoreAmount\":0,\"settlementShippingFee\":0.0,\"thirdRefundCode\":\"\",\"updateTime\":1659004492000,\"weight\":0.00}],\"ver\":\"1\"}",
new TypeReference<OrderBaseResp<List<AfterSalesOrderResp>>>() {})
def payQueryOrderResponse = JSON.parseObject("{\"code\":\"8200309\",\"message\":\"query order exception, order does not exist\"}",
new TypeReference<BaseResponse<PaymentQueryOrderResponseDto>>() {})
def wxAppStore = new AssortmentOpenPlatformIappWxappStore()
def refundNewResponse = JSON.parseObject("{\"code\":10030,\"msg\":\"退款失败\"}",
new TypeReference<BaseResponse<PayRefundData>>() {})
/**
* 混合支付
*/
def multiOrderRefundResponse = JSON.parseObject("{\"code\":10030,\"msg\":\"退款失败\"}",
new TypeReference<MultiOrderRefundResponse>() {})
and: "调三方反馈参数 为自己的参数对象 "
orderBaseService.getByOrderCode(_) >> orderBean
redisCache.hashGet(_, _) >> ""
orderBeanFactory.getOrderManagerService(_) >> saasOrderManagerServiceImpl
paymentNewClient.payQueryOrder(_) >> payQueryOrderResponse
assortmentOpenPlatformIappWxappStoreManager.selectWxappStoreByWxAppIdAndStoreId(_, _, _) >> wxAppStore
paymentNewClient.payRefund(_) >> refundNewResponse
orderSdkService.queryAfterSaleByOrderCode(_, _) >> listBaseResponse
mulitiPaymentClient.paymentApplicationRefund(_, _) >> multiOrderRefundResponse
when: "调用方法逻辑"
orderManagerController.statusOperate(requestVo)
then: "验证 返回结果"
}
}
......@@ -2,11 +2,14 @@ package cn.freemud.service.impl
import cn.freemud.adapter.OrderAdapter
import cn.freemud.entities.bo.CreateOrderBONew
import cn.freemud.entities.dto.blacklist.Result
import cn.freemud.entities.dto.blacklist.resp.MemberBlacklistVO
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto
import cn.freemud.entities.dto.store.StoreMixResponseDto
import cn.freemud.entities.vo.CreateOrderVo
import cn.freemud.handler.MemberBlacklistHandler
import cn.freemud.service.business.impl.OrderBusinessServiceImpl
import cn.freemud.service.thirdparty.DataCenterClient
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
......@@ -30,20 +33,23 @@ class OrderAdapterServiceImplTest extends Specification {
def orderAdapter = new OrderAdapter(mcCafePartnerId: ["9999"], cocoPartnerId: ["9999"])
def itemService = Mock(ItemServiceImpl.class)
def itemService = Mock(OrderItemServiceImpl.class)
def orderSdkService = Mock(OrderSdkService.class)
def dataCenterClient = Mock(DataCenterClient)
def orderBusinessService = new OrderBusinessServiceImpl()
def orderSdkAdapter = new OrderSdkAdapter()
def orderCenterSdkAdapter = new OrderCenterSdkAdapter()
def memberBlacklistHandler = Mock(MemberBlacklistHandler.class)
def memberBlacklistHandler = new MemberBlacklistHandler()
void setup() {
orderServiceImpl.orderAdapter = orderAdapter
orderServiceImpl.itemService = itemService
orderServiceImpl.memberBlacklistHandler = memberBlacklistHandler
memberBlacklistHandler.dataCenterClient = dataCenterClient
orderBusinessService.orderSdkAdapter = orderSdkAdapter
orderServiceImpl.orderBusinessService = orderBusinessService
orderServiceImpl.memberBlacklistHandler = memberBlacklistHandler
......
package cn.freemud.service.impl;
import cn.freemud.adapter.OrderAdapter;
import com.alibaba.fastjson.JSON;
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.OrderInfoReqs;
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/7/5 10:52
* @description :
*/
public class OrderInfo2OrderBeanV1 {
public static void main(String[] args) {
//正常单
String str = "{\"abnormalDesc\":\"\",\"abnormalState\":0,\"acceptTime\":1656927690000,\"actualPayAmount\":2,\"afterSalesOrderList\":[{\"actualAmount\":2,\"actualScoreAmount\":0,\"adultRemark\":\"\",\"afterSalesApplyClient\":0,\"afterSalesCode\":\"24839353836098846300001\",\"afterSalesImages\":[],\"afterSalesOptHistoryList\":[{\"afterSalesCode\":\"24839353836098846300001\",\"createTime\":1656928137000,\"id\":248393538461651780,\"operationClient\":0,\"operationCode\":1,\"operationDesc\":\"发起售后申请\",\"operator\":\"雪玉\",\"orderCode\":\"24839305965039294900001\",\"partnerId\":\"2690\",\"targetAfterSalesState\":1,\"timeout\":0,\"updateTime\":1656928137000},{\"afterSalesCode\":\"24839353836098846300001\",\"createTime\":1656944702000,\"id\":248410907311493980,\"operationClient\":0,\"operationCode\":3,\"operationDesc\":\"拒绝售后申请\",\"operator\":\"自动任务\",\"orderCode\":\"24839305965039294900001\",\"partnerId\":\"2690\",\"targetAfterSalesState\":3,\"timeout\":0,\"updateTime\":1656944702000}],\"afterSalesOrderItems\":[{\"afterSalesCode\":\"24839353836098846300001\",\"createTime\":1656928137000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"202109\\\", \\\"thirdProductPropertyId\\\": \\\"245072444162927120,H00305,H00106\\\"}\",\"id\":248393538368328500,\"orderCode\":\"24839305965039294900001\",\"orderItemId\":248393059718550400,\"parentProductId\":\"215806877139834888_1\",\"partnerId\":\"2690\",\"productId\":\"219187474445045306\",\"productName\":\"汉堡\",\"productPicUrl\":\"https://picture.sandload.cn/1631788957908.jpg\",\"productPrice\":1,\"productProperty\":\"变态辣/少冰/无糖\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"219187474445045306\",\"productSpecName\":\"汉堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"20210916\",\"updateTime\":1656928137000,\"weight\":0},{\"afterSalesCode\":\"24839353836098846300001\",\"createTime\":1656928137000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"787\\\"}\",\"id\":248393538411320130,\"orderCode\":\"24839305965039294900001\",\"orderItemId\":248393059701773200,\"parentProductId\":\"215806877139834888_1\",\"partnerId\":\"2690\",\"productId\":\"219068580477539339\",\"productName\":\"可乐\",\"productPicUrl\":\"https://picture.sandload.cn/1631702492012.gif\",\"productPrice\":200,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"219068580477539339\",\"productSpecName\":\"可乐\",\"productType\":6,\"productUnit\":\"杯\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"weishangcheng\",\"updateTime\":1656928137000,\"weight\":2},{\"afterSalesCode\":\"24839353836098846300001\",\"createTime\":1656928137000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11bf94c7-b190-4111-b4cc-9eebd8978e48\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"354352plo\\\"}\",\"id\":248393538415514430,\"orderCode\":\"24839305965039294900001\",\"orderItemId\":248393059668218750,\"parentProductId\":\"0\",\"partnerId\":\"2690\",\"productId\":\"215806877139834888\",\"productName\":\"抖音套餐A\",\"productPicUrl\":\"https://picture.sandload.cn/1628583925334.jpg\",\"productPrice\":2,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSpec\":\"215806877139834888\",\"productSpecName\":\"抖音套餐A\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"hbtc\",\"updateTime\":1656928137000,\"weight\":0}],\"afterSalesReason\":\"下错单\",\"afterSalesStatus\":3,\"afterSalesType\":2,\"createTime\":1656928137000,\"deliveryAmount\":0,\"deliveryContactInfo\":[],\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"extInfo\":\"{\\\"lastOrderStatus\\\": 3}\",\"hasCargo\":false,\"isAllItemAfterSales\":true,\"operator\":\"自动任务\",\"orderCode\":\"24839305965039294900001\",\"originalShippingFee\":0,\"partnerId\":\"2690\",\"partnerRefundCode\":\"\",\"refundFailReason\":\"\",\"refundState\":1,\"reqAmount\":2,\"reqRemark\":\" 去\",\"reqScoreAmount\":0,\"settlementShippingFee\":0,\"thirdRefundCode\":\"\",\"updateTime\":1656944702000,\"weight\":0}],\"afterSalesState\":3,\"appId\":\"wxa1f272347828dae8\",\"barCounter\":\"\",\"bizType\":1,\"businessDay\":1656864000000,\"canRefund\":true,\"cancelReason\":\"下错单\",\"companySelfCode\":\"\",\"createTime\":1656927681000,\"daySeq\":6,\"deliveryContactInfoList\":[{\"addressDetail\":\"南翔\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"{}\",\"infoType\":1,\"latitude\":0,\"longitude\":0,\"mobile\":\"13673451997\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":1,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\",\"tripDist\":0}],\"deliveryPromise\":0,\"deliveryState\":-2,\"dinersNumber\":0,\"downstreamPosCode\":\"0\",\"downstreamThirdOrderCode\":\"0\",\"evaluationState\":0,\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"expressType\":0,\"extInfo\":\"{\\\"fmId\\\": \\\"7702690248393059997440005\\\", \\\"appid\\\": \\\"wxa1f272347828dae8\\\", \\\"openid\\\": \\\"o0wG94khi0lKFhJgkOzD-H9EhhQ8\\\", \\\"payDate\\\": \\\"2022-07-04 17:41:30\\\", \\\"version\\\": \\\"3.0.7.4\\\", \\\"prepayId\\\": \\\"wx041741223689417f3aa88c37ac63920000\\\", \\\"fromAppId\\\": \\\"wxa1f272347828dae8\\\", \\\"sessionId\\\": \\\"6badc263ab44d618b66a716baa6491597cfc8350\\\", \\\"endTransId\\\": \\\"181675386421622070417412135262\\\", \\\"paidMember\\\": false, \\\"payTransId\\\": \\\"7702690248393059997440005\\\", \\\"sessionKey\\\": \\\"AlZSbkfdXruSN652PMJDmg==\\\", \\\"memberLevel\\\": \\\"青铜\\\", \\\"serviceTime\\\": 50, \\\"dispatchType\\\": \\\"0\\\", \\\"pushOrderTime\\\": 0, \\\"dispatchTimeout\\\": 0, \\\"deliveryHoursDayEnd\\\": \\\"\\\", \\\"deliveryHoursDayStart\\\": \\\"2022-07-04 00:05:00\\\", \\\"packageAmountCollectType\\\": 1}\",\"immediately\":true,\"isParent\":false,\"localTableKey\":\"\",\"logisticsAccessChannel\":0,\"logisticsList\":[],\"marketingCode\":\"\",\"marketingType\":0,\"needInvoice\":false,\"note\":\"\",\"operator\":\"\",\"orderArea\":\"0\",\"orderClient\":2,\"orderCode\":\"24839305965039294900001\",\"orderCostDetailList\":[],\"orderExtended\":{\"agentPayerId\":\"\",\"agentPayerName\":\"\",\"createTime\":1656927681000,\"id\":248393059650392960,\"isDeleted\":false,\"orderClientGroup\":\"南翔翔\",\"orderClientGroupCode\":\"104\",\"orderCode\":\"24839305965039294900001\",\"orderId\":248393059650392960,\"partnerId\":\"2690\",\"sendWord\":\"\",\"spellGroupCode\":\"\",\"storeId\":\"1001\",\"storeNameEn\":\"\",\"updateTime\":1656927681000,\"userPhone\":\"\",\"version\":0},\"orderInvoice\":{\"address\":\"\",\"bankCardNo\":\"\",\"content\":\"\",\"invoiceBank\":\"\",\"invoiceNo\":\"\",\"invoiceUrl\":\"\",\"itemId\":\"\",\"partnerId\":\"\",\"phoneNo\":\"\",\"pickUpNo\":\"\",\"taxNo\":\"\",\"title\":\"\",\"userId\":\"\"},\"orderItemList\":[{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"11bf94c7-b190-4111-b4cc-9eebd8978e48\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"354352plo\\\"}\",\"id\":248393059668218750,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"354352plo\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"215806877139834888\",\"productName\":\"抖音套餐A\",\"productPicUrl\":\"https://picture.sandload.cn/1628583925334.jpg\",\"productPrice\":2,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSharePrice\":0,\"productSpec\":\"215806877139834888\",\"productSpecName\":\"抖音套餐A\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":2,\"saleScorePrice\":0,\"settlementPrice\":2,\"settlementScorePrice\":0,\"thirdProductId\":\"hbtc\",\"userId\":\"\",\"weight\":0},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"787\\\"}\",\"id\":248393059701773200,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"215806877139834888_1\",\"photoUrl\":\"\",\"productCode\":\"787\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"219068580477539339\",\"productName\":\"可乐\",\"productPicUrl\":\"https://picture.sandload.cn/1631702492012.gif\",\"productPrice\":200,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":0,\"productSpec\":\"219068580477539339\",\"productSpecName\":\"可乐\",\"productType\":6,\"productUnit\":\"杯\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":200,\"saleScorePrice\":0,\"settlementPrice\":200,\"settlementScorePrice\":0,\"thirdProductId\":\"weishangcheng\",\"userId\":\"\",\"weight\":2},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"202109\\\", \\\"thirdProductPropertyId\\\": \\\"245072444162927120,H00305,H00106\\\"}\",\"id\":248393059718550400,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"215806877139834888_1\",\"photoUrl\":\"\",\"productCode\":\"202109\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"219187474445045306\",\"productName\":\"汉堡\",\"productPicUrl\":\"https://picture.sandload.cn/1631788957908.jpg\",\"productPrice\":1,\"productProperty\":\"变态辣/少冰/无糖\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":0,\"productSpec\":\"219187474445045306\",\"productSpecName\":\"汉堡\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1,\"saleScorePrice\":0,\"settlementPrice\":1,\"settlementScorePrice\":0,\"thirdProductId\":\"20210916\",\"userId\":\"\",\"weight\":0}],\"orderSendCouponRespList\":[],\"orderSettlementDetailList\":[],\"orderState\":6,\"orderSubState\":0,\"orderType\":5,\"orderVersion\":1,\"originalAmount\":2,\"originalScoreAmount\":0,\"parentCode\":\"0\",\"partnerId\":\"2690\",\"partnerName\":\"\",\"payChannel\":\"10211\",\"payChannelName\":\"微信\",\"payChannelType\":1,\"payRequestNo\":\"7702690248393059997440005\",\"payState\":2,\"payTime\":1656927690000,\"payType\":1,\"physicalGoodsFlag\":0,\"pickUpGoodsNo\":\"1363\",\"pickUpTime\":1656944702000,\"posCode\":\"\",\"posTableKey\":\"\",\"printNum\":0,\"receiveTime\":1656948302000,\"settlementAmount\":2,\"settlementScoreAmount\":0,\"sourceType\":0,\"storeId\":\"1001\",\"storeName\":\"雪玉南翔店\",\"storeUnifyId\":\"0\",\"suspendDesc\":\"正常\",\"suspendState\":0,\"thirdOrderCode\":\"24839305965039294900001\",\"thirdStoreId\":\"075513\",\"toStoreId\":\"0\",\"updateTime\":1656948302000,\"userId\":\"3653057325186672276\",\"userMobile\":\"\",\"userName\":\"雪玉\",\"weight\":2}";
// 异常单
// String str = "{\"abnormalDesc\":\"\",\"abnormalState\":0,\"acceptTime\":1656927303000,\"actualPayAmount\":0,\"afterSalesOrderList\":[{\"actualAmount\":0,\"actualScoreAmount\":0,\"adultRemark\":\"\",\"afterSalesApplyClient\":0,\"afterSalesCode\":\"24839349080387253700003\",\"afterSalesImages\":[],\"afterSalesOptHistoryList\":[{\"afterSalesCode\":\"24839349080387253700003\",\"createTime\":1656928092000,\"id\":248393490967450400,\"operationClient\":0,\"operationCode\":5,\"operationDesc\":\"退款完成\",\"operator\":\"assistant-admin\",\"orderCode\":\"24839239712652168800003\",\"partnerId\":\"2690\",\"targetAfterSalesState\":5,\"timeout\":0,\"updateTime\":1656928092000}],\"afterSalesOrderItems\":[{\"afterSalesCode\":\"24839349080387253700003\",\"createTime\":1656928092000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248393490850009900,\"orderCode\":\"24839239712652168800003\",\"orderItemId\":248392397161124700,\"parentProductId\":\"0\",\"partnerId\":\"2690\",\"productId\":\"215806877139834888\",\"productName\":\"抖音套餐A\",\"productPicUrl\":\"https://picture.sandload.cn/1628583925334.jpg\",\"productPrice\":0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSpec\":\"215806877139834888\",\"productSpecName\":\"抖音套餐A\",\"productType\":7,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"hbtc\",\"updateTime\":1656928092000,\"weight\":0},{\"afterSalesCode\":\"24839349080387253700003\",\"createTime\":1656928092000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248393490912924450,\"orderCode\":\"24839239712652168800003\",\"orderItemId\":248392397292196700,\"parentProductId\":\"215806877139834888_1\",\"partnerId\":\"2690\",\"productId\":\"219187474445045306\",\"productName\":\"汉堡\",\"productPicUrl\":\"https://picture.sandload.cn/1631788957908.jpg\",\"productPrice\":0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"219187474445045306\",\"productSpecName\":\"汉堡\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"20210916\",\"updateTime\":1656928092000,\"weight\":0},{\"afterSalesCode\":\"24839349080387253700003\",\"createTime\":1656928092000,\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248393490916070180,\"orderCode\":\"24839239712652168800003\",\"orderItemId\":248392397285905250,\"parentProductId\":\"215806877139834888_1\",\"partnerId\":\"2690\",\"productId\":\"219068580477539339\",\"productName\":\"可乐\",\"productPicUrl\":\"https://picture.sandload.cn/1631702492012.gif\",\"productPrice\":0,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSpec\":\"219068580477539339\",\"productSpecName\":\"可乐\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"thirdProductId\":\"weishangcheng\",\"updateTime\":1656928092000,\"weight\":0}],\"afterSalesReason\":\"用户撤销核销\",\"afterSalesStatus\":5,\"afterSalesType\":2,\"createTime\":1656928092000,\"deliveryAmount\":0,\"deliveryContactInfo\":[],\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"extInfo\":\"{\\\"lastOrderStatus\\\": 3}\",\"hasCargo\":false,\"isAllItemAfterSales\":true,\"operator\":\"assistant-admin\",\"orderCode\":\"24839239712652168800003\",\"originalShippingFee\":0,\"partnerId\":\"2690\",\"partnerRefundCode\":\"\",\"refundFailReason\":\"\",\"refundState\":4,\"reqAmount\":0,\"reqRemark\":\"\",\"reqScoreAmount\":0,\"settlementShippingFee\":0,\"thirdRefundCode\":\"\",\"updateTime\":1656928092000,\"weight\":0}],\"afterSalesState\":5,\"appId\":\"assistantGwarrnTx0AP\",\"barCounter\":\"\",\"bizType\":1,\"businessDay\":1656864000000,\"canRefund\":true,\"cancelReason\":\"用户撤销核销\",\"companySelfCode\":\"\",\"createTime\":1656927050000,\"daySeq\":5,\"deliveryContactInfoList\":[{\"addressDetail\":\"雪玉南翔店\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"{}\",\"infoType\":1,\"latitude\":0,\"longitude\":0,\"mobile\":\"19108460055\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":1,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\",\"tripDist\":0}],\"deliveryPromise\":0,\"deliveryState\":-2,\"dinersNumber\":0,\"downstreamPosCode\":\"0\",\"downstreamThirdOrderCode\":\"0\",\"evaluationState\":0,\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"expressType\":0,\"extInfo\":\"{\\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"payDate\\\": \\\"2022-07-04 17:30:50\\\", \\\"paidMember\\\": false, \\\"payTransId\\\": \\\"SPAY1656927048865CYqRm\\\", \\\"serviceTime\\\": 0, \\\"dispatchType\\\": \\\"0\\\", \\\"dispatchTimeout\\\": 0}\",\"immediately\":true,\"isParent\":false,\"localTableKey\":\"\",\"logisticsAccessChannel\":0,\"logisticsList\":[],\"marketingCode\":\"\",\"marketingType\":11,\"needInvoice\":false,\"note\":\"\",\"operator\":\"\",\"orderArea\":\"0\",\"orderClient\":29,\"orderCode\":\"24839239712652168800003\",\"orderCostDetailList\":[],\"orderExtended\":{\"agentPayerId\":\"\",\"agentPayerName\":\"\",\"createTime\":1656927050000,\"id\":248392397126521700,\"isDeleted\":false,\"orderClientGroup\":\"\",\"orderClientGroupCode\":\"\",\"orderCode\":\"24839239712652168800003\",\"orderId\":248392397126521700,\"partnerId\":\"2690\",\"sendWord\":\"\",\"spellGroupCode\":\"\",\"storeId\":\"1001\",\"storeNameEn\":\"\",\"updateTime\":1656927049000,\"userPhone\":\"\",\"version\":0},\"orderInvoice\":{\"address\":\"\",\"bankCardNo\":\"\",\"content\":\"\",\"invoiceBank\":\"\",\"invoiceNo\":\"\",\"invoiceUrl\":\"\",\"itemId\":\"\",\"partnerId\":\"\",\"phoneNo\":\"\",\"pickUpNo\":\"\",\"taxNo\":\"\",\"title\":\"\",\"userId\":\"\"},\"orderItemList\":[{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248392397161124700,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":7,\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"354352plo\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"215806877139834888\",\"productName\":\"抖音套餐A\",\"productPicUrl\":\"https://picture.sandload.cn/1628583925334.jpg\",\"productPrice\":2,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":1,\"productSharePrice\":2,\"productSpec\":\"215806877139834888\",\"productSpecName\":\"抖音套餐A\",\"productType\":7,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":0,\"saleScorePrice\":0,\"settlementPrice\":0,\"settlementScorePrice\":0,\"thirdProductId\":\"hbtc\",\"userId\":\"\",\"weight\":0},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248392397285905250,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"215806877139834888_1\",\"photoUrl\":\"\",\"productCode\":\"787\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"219068580477539339\",\"productName\":\"可乐\",\"productPicUrl\":\"https://picture.sandload.cn/1631702492012.gif\",\"productPrice\":200,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":200,\"productSpec\":\"219068580477539339\",\"productSpecName\":\"可乐\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":0,\"saleScorePrice\":0,\"settlementPrice\":0,\"settlementScorePrice\":0,\"thirdProductId\":\"weishangcheng\",\"userId\":\"\",\"weight\":0},{\"canRefund\":true,\"categoryId\":\"0\",\"categoryName\":\"0\",\"extInfo\":\"{\\\"tax\\\": 0, \\\"appid\\\": \\\"assistantGwarrnTx0AP\\\", \\\"fromAppId\\\": \\\"assistantGwarrnTx0AP\\\", \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"isB3S1Coupon\\\": 0}\",\"id\":248392397292196700,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"originalProductType\":1,\"parentProductId\":\"215806877139834888_1\",\"photoUrl\":\"\",\"productCode\":\"202109\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"219187474445045306\",\"productName\":\"汉堡\",\"productPicUrl\":\"https://picture.sandload.cn/1631788957908.jpg\",\"productPrice\":1,\"productProperty\":\"\",\"productQuantity\":1,\"productScorePrice\":0,\"productSeq\":0,\"productSharePrice\":1,\"productSpec\":\"219187474445045306\",\"productSpecName\":\"汉堡\",\"productType\":1,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":0,\"saleScorePrice\":0,\"settlementPrice\":0,\"settlementScorePrice\":0,\"thirdProductId\":\"20210916\",\"userId\":\"\",\"weight\":0}],\"orderSendCouponRespList\":[],\"orderSettlementDetailList\":[{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"88709684113191527822\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"抖音套餐A\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"215806877139834888\",\"productSeq\":1,\"prospectiveAmount\":0,\"settlementAmount\":2,\"settlementType\":118,\"shopAmount\":0,\"shopDiscountAmount\":2},{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"88709684113191527822\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"抖音套餐A\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0,\"settlementAmount\":-2,\"settlementType\":118,\"shopAmount\":0,\"shopDiscountAmount\":-2},{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"优惠总金额\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":0,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0,\"settlementAmount\":0,\"settlementType\":205,\"shopAmount\":0,\"shopDiscountAmount\":2}],\"orderState\":7,\"orderSubState\":0,\"orderType\":1,\"orderVersion\":1,\"originalAmount\":2,\"originalScoreAmount\":0,\"parentCode\":\"0\",\"partnerId\":\"2690\",\"partnerName\":\"\",\"payChannel\":\"100000\",\"payChannelName\":\"0元支付\",\"payChannelType\":6,\"payRequestNo\":\"SPAY1656927048865CYqRm\",\"payState\":3,\"payTime\":1656927051000,\"payType\":1,\"physicalGoodsFlag\":0,\"pickUpGoodsNo\":\"1362\",\"posCode\":\"\",\"posTableKey\":\"\",\"printNum\":0,\"settlementAmount\":0,\"settlementScoreAmount\":0,\"sourceType\":0,\"storeId\":\"1001\",\"storeName\":\"雪玉南翔店\",\"storeUnifyId\":\"0\",\"suspendDesc\":\"\",\"suspendState\":0,\"thirdOrderCode\":\"24839239712652168800003\",\"thirdStoreId\":\"1001\",\"toStoreId\":\"0\",\"updateTime\":1656928092000,\"userId\":\"3647844591259227907\",\"userMobile\":\"\",\"userName\":\"虚拟会员001\",\"weight\":0}";
OrderInfoReqs orderInfoReqs = JSON.parseObject(str, OrderInfoReqs.class);
OrderBeanV1 orderBeanV1 = new OrderCenterSdkAdapter().convent2NEWOrderInfo(orderInfoReqs);
new OrderAdapter().convert2OrderPrintDto(orderBeanV1);
}
}
......@@ -12,11 +12,48 @@
<properties>
<jacoco.version>0.7.5.201505241946</jacoco.version>
<junit.version>4.12</junit.version>
<spock.version>1.3-groovy-2.5</spock.version>
<powermock.version>2.0.4</powermock.version>
</properties>
<artifactId>shopping-cart-application-service</artifactId>
<dependencies>
<!--引入spock 核心包-->
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>${spock.version}</version>
<scope>test</scope>
</dependency>
<!--引入spock 与 spring 集成包-->
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-spring</artifactId>
<version>${spock.version}</version>
<scope>test</scope>
</dependency>
<!-- power mock -->
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>paymentcenter-sdk</artifactId>
......
......@@ -1408,11 +1408,13 @@ public class ShoppingCartConvertAdapter {
if (isComboxGoods) {
productComboType = parentProductBean.getProductComboList().stream().filter(p -> ObjectUtils.equals(comboxGoods.getGoodsId(), p.getProductId())).findFirst().orElse(new ProductComboType());
comboxGoods.setLinkedId(productComboType.getLinkedId());
comboxGoods.setStockLimit(Objects.equals(1,productComboType.getStockLimit()));
} else {
Map<String, GroupDetailType> map = new HashMap<>();
parentProductBean.getProductGroupList().stream().map(t -> t.getGroupDetail()).forEach(group -> group.forEach(detailType -> map.put(detailType.getProductId(), detailType)));
groupDetailType = map.get(comboxGoods.getGoodsId());
comboxGoods.setLinkedId(groupDetailType.getLinkedId());
comboxGoods.setStockLimit(Objects.equals(1,groupDetailType.getStockLimit()));
}
// 若是固定商品则取商品详情的FinalPrice,若是可选商品则取MarkUpPrice
......
......@@ -25,4 +25,5 @@ public class ProductComboType {
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/
private String linkedId ;
private Integer stockLimit;
}
......@@ -391,6 +391,12 @@ public class CartGoods {
@Data
public final static class ComboxGoods {
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
* 2022年10月19日11:20:11 tapd 新增套餐商品 可选搭配是否扣除库存 不走套餐主商品配置
*/
private boolean isStockLimit;
/**
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/
private String linkedId ;
......
......@@ -624,7 +624,7 @@ public class CalculationCommonService {
com.setProductType(comb.isWeightType() ? ProductType.WEIGHT_PRODUCT.getCode() : ProductType.SETMEAL.getCode());
com.setParentProductId(cartGoods.getGoodsId());
com.setIsFixedProduct(isFixed);
com.setStockLimit(cartGoods.isStockLimit());
com.setStockLimit(comb.isStockLimit());
com.setCustomerCode(comb.getCustomerCode());
com.setWeight(comb.getWeight());
com.setUnit(comb.getUnit());
......
package cn.freemud.adapter
import cn.freemud.adapter.ActivityAdapter
import cn.freemud.entities.vo.GetShoppingCartGoodsApportionRequestVo
import cn.freemud.service.impl.ShoppingCartNewServiceImpl
import com.alibaba.fastjson.JSON
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import org.spockframework.runtime.Sputnik
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/7 9:35
* @description :
*/
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Sputnik.class)
@PrepareForTest()
class DemoSpockMock extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def customerInfoManager = PowerMockito.mock(AssortmentCustomerInfoManager)
void setup() {
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
}
def "testMockEnable"() {
given: "设置请求参数"
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
def getShoppingCartGoodsApportionRequestVo = JSON.parseObject("{\"shoppingCartInfoRequestVo\":{\"activityCode\":\"G1643164091158349\",\"buyType\":0,\"couponCode\":\"88709227085491207040\",\"couponCodes\":[{\"activityCode\":\"G1643164091158349\",\"couponCode\":\"88709227085491207040\",\"couponType\":7,\"discountAmount\":800,\"index\":1}],\"flag\":0,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2581\",\"reachStoreType\":5,\"sendGoods\":[],\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"shopId\":\"229830\",\"trackingNo\":\"8283bc4c7e5f4bbb8b357e3c0bef7183\",\"useCouponFlag\":1,\"useCustomerScore\":2,\"version\":\"2.0.60.6\"}}"
, GetShoppingCartGoodsApportionRequestVo.class)
def premiumExchangeActivity = getShoppingCartGoodsApportionRequestVo.getPremiumExchangeActivity()
def shoppingCartInfoRequestVo = getShoppingCartGoodsApportionRequestVo.getShoppingCartInfoRequestVo()
and: "mock掉接口返回的用户信息"
Mockito.when(customerInfoManager.getCustomerInfoByObject(Mockito.anyString())).thenReturn(customerInfoVo)
when: "调用获取用户信息方法"
def response = shoppingCartNewServiceImpl.getShoppingCartGoods(shoppingCartInfoRequestVo, premiumExchangeActivity)
then: "验证返回结果是否符合预期值"
}
}
package cn.freemud.service.impl
import cn.freemud.adapter.ActivityAdapter
import cn.freemud.adapter.CouponAdapter
import cn.freemud.adapter.StoreItemAdapter
import cn.freemud.entities.dto.GetCouponDetailResponseDto
import cn.freemud.entities.dto.ProductBaseResponse
import cn.freemud.entities.dto.ProductInfosDto
import cn.freemud.entities.dto.activity.ActivityQueryResponseDto
import cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
import cn.freemud.entities.dto.order.PackAmountConfig
import cn.freemud.entities.dto.product.CheckCartRequest
import cn.freemud.entities.dto.product.ValiadShopProductResponse
import cn.freemud.entities.dto.user.GetUserScoreUserDetailResponse
import cn.freemud.entities.vo.CartGoods
import cn.freemud.entities.vo.ShoppingCartInfoRequestVo
import cn.freemud.handle.CommonFunctionHandle
import cn.freemud.service.ActivityService
import cn.freemud.service.CommonService
import cn.freemud.service.active.ActiveFactory
import cn.freemud.service.active.impl.PlatformActiveServiceImpl
import cn.freemud.service.impl.calculate.CalculationCommonService
import cn.freemud.service.impl.calculate.CalculationSharingCartService
import cn.freemud.service.impl.calculate.CalculationSharingDiscountService
import cn.freemud.service.impl.calculate.promotion.*
import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory
import cn.freemud.service.shoppingCart.impl.PlatformShoppingCartRelationServiceImpl
import cn.freemud.service.thirdparty.ActivityClient
import cn.freemud.service.thirdparty.CouponOnlineClient
import cn.freemud.service.thirdparty.CustomerApplicationClient
import cn.freemud.service.thirdparty.ProductClient
import cn.freemud.utils.PromotionFactory
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import org.spockframework.runtime.Sputnik
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/4 16:56
* @description :
*/
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Sputnik.class)
@PrepareForTest(PromotionFactory.class)
class FishermanSpock extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def activityAdapter = new ActivityAdapter()
def couponAdapter = new CouponAdapter()
def productServiceImpl = new ProductServiceImpl()
def sharingDiscountService = new CalculationSharingDiscountService()
def couponService = new CouponServiceImpl()
def itemService = new ItemServiceImpl()
def storeItemAdapter = new StoreItemAdapter()
def defaultPromotionService = new DefaultPromotionService()
def couponPromotionService = new CouponPromotionService()
def buySendPromotionService = new BuySendPromotionService()
def additionalPromotionService = new AdditionalPromotionService()
def timeSalePromotionService = new TimeSalePromotionService()
def setMealService = new SetMealServiceImpl()
def customerScoreService = new CustomerScoreService()
def xyDiscountService = new XyDiscountServiceImpl()
def buyAndGiftsPromotionService = new BuyAndGiftsPromotionService()
def materialPromotionService = new MaterialPromotionService()
def fullPromotionService = new FullPromotionService()
def sharingCartService = new CalculationSharingCartService()
def assortmentSdkService = PowerMockito.mock(AssortmentSdkService)
def customerInfoManager = PowerMockito.mock(AssortmentCustomerInfoManager.class)
def productService = PowerMockito.mock(ProductServiceImpl.class)
def productClient = PowerMockito.mock(ProductClient.class)
def activityClient = PowerMockito.mock(ActivityClient.class)
def couponOnlineClient = PowerMockito.mock(CouponOnlineClient.class)
def commonService = PowerMockito.mock(CommonService.class)
def activityService = PowerMockito.mock(ActivityService)
def activeFactory = PowerMockito.mock(ActiveFactory)
// 组装计算活动参数对象
def calculationCommonService = new CalculationCommonService()
def commonFunctionHandle = PowerMockito.mock(CommonFunctionHandle)
def promotionSharingService = new CouponSharingService()
def fullSharingService = new FullSharingService()
def giftSharingService = new GiftSharingService()
def additionSharingService = new AdditionSharingService()
def scoreSharingService = new ScoreSharingService()
def deliverySharingService = new DeliverySharingService()
def buyOneGiveOneSendService = new BuyOneGiveOneSendService()
def customScoreClient = PowerMockito.mock(CustomerApplicationClient)
def shoppingCartRelationFactory = PowerMockito.mock(ShoppingCartRelationFactory)
void setup() {
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
shoppingCartNewServiceImpl.shoppingCartRelationFactory = shoppingCartRelationFactory
shoppingCartNewServiceImpl.productService = productService
shoppingCartNewServiceImpl.assortmentSdkService = assortmentSdkService
shoppingCartNewServiceImpl.activityAdapter = activityAdapter
shoppingCartNewServiceImpl.couponAdapter = couponAdapter
shoppingCartNewServiceImpl.couponService = couponService
shoppingCartNewServiceImpl.commonService = commonService
shoppingCartNewServiceImpl.sharingCartService = sharingCartService
// fisherman 测试过程中, 需要测试 新老算价需要自己 控制开关
shoppingCartNewServiceImpl.newSharing = "{\"type\":1,\"grayList\":\"2581\",\"enable\":true}"
shoppingCartNewServiceImpl.activityClient = activityClient
shoppingCartNewServiceImpl.sharingDiscountService = sharingDiscountService
productServiceImpl.productClient = productClient
sharingDiscountService.activityClient = activityClient
sharingDiscountService.couponService = couponService
sharingDiscountService.commonService = commonService
sharingDiscountService.activeFactory = activeFactory
couponService.couponOnlineClient = couponOnlineClient
couponService.commonService = commonService
couponService.itemService = itemService
couponService.storeItemClient = productClient
itemService.storeItemAdapter = storeItemAdapter
itemService.storeItemClient = productClient
fullPromotionService.activityService = activityService
// mock静态类
PowerMockito.mockStatic(PromotionFactory.class)
// 组装计算活动参数对象
sharingCartService.calculationCommonService = calculationCommonService
calculationCommonService.commonFunctionHandle = commonFunctionHandle
sharingCartService.promotionSharingService = promotionSharingService
promotionSharingService.assortmentSdkService = assortmentSdkService
sharingCartService.fullSharingService = fullSharingService
sharingCartService.giftSharingService = giftSharingService
sharingCartService.additionSharingService = additionSharingService
sharingCartService.scoreSharingService = scoreSharingService
sharingCartService.deliverySharingService = deliverySharingService
sharingCartService.buyOneGiveOneSendService = buyOneGiveOneSendService
fullSharingService.activityService = activityService
scoreSharingService.customScoreClient = customScoreClient
}
def "listCartGoods"() {
given: "参数设置"
def shoppingCartInfoRequestVo = JSON.parseObject("{\"activityCode\":\"\",\"appId\":\"wxa1f272347828dae8\",\"buyType\":0,\"cardCodes\":[\"5826900000012200001\"],\"channelType\":\"saas\",\"couponCode\":\"\",\"couponCodes\":[],\"enableSharing\":0,\"flag\":1,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2690\",\"reachStoreType\":4,\"receiveId\":\"\",\"sendGoods\":[],\"sessionId\":\"c0160864097837bd4aca54ed7537848f46bba70f\",\"shopId\":\"1001\",\"unChooseCouponCode\":\"\",\"useCustomerScore\":2,\"version\":\"2\"}"
, ShoppingCartInfoRequestVo.class)
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
// saas:user:info:cart:goods:2690_1001_3653544968271672251
def cartGoodsList = JSON.parseArray("[{\"addCartTime\":1654841967007,\"amount\":1,\"canUseCoupon\":1,\"cartGoodsUid\":\"ba1c5800-637c-4b72-bfc7-76da62d61c8c\",\"categoryName\":\"推荐\",\"classificationForeignName\":\"\",\"classificationId\":\"\",\"classificationName\":\"\",\"createTimeMili\":1654841967007,\"customerCode\":\"hongdouximilu\",\"finalPrice\":1,\"foreignName\":\"\",\"goodsId\":\"219187388813086254\",\"goodsType\":5,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"materialAmount\":0,\"memberDiscount\":100,\"name\":\"红豆西米露/大杯\",\"originalAmount\":1,\"originalMaterialAmount\":0,\"originalPrice\":1,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1631789025732.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":1,\"riseSell\":1,\"singleOrder\":0,\"skuForeignName\":\"\",\"skuId\":\"\",\"skuName\":\"红豆西米露/大杯\",\"spuForeignName\":\"\",\"spuId\":\"219187388813086254\",\"spuName\":\"红豆西米露/大杯\",\"stockLimit\":false,\"subForeignName\":\"\",\"subName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"addCartTime\":1654850258889,\"amount\":0,\"canUseCoupon\":1,\"cartGoodsUid\":\"9a7b1c23-4347-48a3-a612-fe303a1cb23f\",\"couponCode\":\"88709608644979836830\",\"createTimeMili\":1654850258889,\"extra\":[],\"goodsId\":\"spq88709608644979836830\",\"goodsType\":7,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"originalAmount\":0,\"originalPrice\":0,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1631788957908.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":1,\"skuId\":\"219187474445045306\",\"spuId\":\"219187474445045306\",\"stockLimit\":true,\"unit\":\"\",\"weight\":0.0,\"weightType\":false}]"
, CartGoods.class)
def checkCartRequest = new CheckCartRequest()
checkCartRequest.setCartGoodsList(cartGoodsList)
// code.allDetails "storelimit": 0,
def responseDto = JSON.parseObject("{\"details\":[{\"storelimit\":0,\"active\":{\"activeCode\":\"M1654656180041548\",\"activeDesc\":\"场通用”或“仅限烟酒类使用”\",\"activeName\":\"晓航测试券\",\"createDate\":\"2022-06-08 10:43:00\",\"createUser\":\"晓航\",\"endDate\":\"2032-06-07 10:42:59\",\"endString\":\"2032-06-07 10:42:59\",\"inventory\":0,\"lastEditDate\":\"2022-06-08 10:43:00\",\"lastEditUser\":\"\",\"maxDiscount\":0,\"maxRedeemTimes\":1,\"minAmount\":0,\"partnerId\":\"2690\",\"startDate\":\"2022-06-07 10:42:59\",\"startString\":\"2022-06-07 10:42:59\",\"state\":1,\"type\":0},\"activeCode\":\"M1654656180041548\",\"activeProduct\":[{\"activeId\":125781717,\"amount\":1,\"paid\":0,\"priceDiscount\":0.00,\"priceOriginal\":0.00,\"productId\":1234567,\"productIdPartner\":\"219187474445045306\",\"remain\":0}],\"activeProductSetting\":[],\"activeRedeemTimeIntervalList\":[],\"activeRestrictionVOS\":[],\"code\":\"88709608644979836830\",\"couponProductList\":[{\"activeProductId\":182981823,\"amount\":1,\"amountleft\":1,\"couponid\":960864498020545,\"createdate\":1654850379871,\"createuser\":\"api\",\"id\":0,\"lasteditdate\":1654850379871,\"lastedituser\":\"api\",\"merchantproductid\":\"219187474445045306\",\"paid\":0.00,\"priceDiscount\":0.00,\"productname\":\"玫瑰豉油鸡\",\"redeemAmount\":0,\"remain\":0}],\"create_time\":\"2022-06-08 10:47:39\",\"minAmount\":\"0\",\"sendReason\":\"手动送券,晓航,18868926846\",\"status\":0,\"storeChannelLimit\":0,\"storeLimitLevel\":1,\"subType\":0,\"title\":\"晓航测试券\",\"today_available_times\":1,\"total_available_times\":1,\"type\":0,\"valid_ends\":\"2022-06-30 23:59:59\",\"valid_start\":\"2022-06-08 00:00:00\"}],\"errors\":[],\"result\":1,\"statusCode\":0,\"ver\":1}"
, GetCouponDetailResponseDto.class)
// /Shop/ListProductInfoByIdList
def productInfosDto = JSON.parseObject("{\"data\":{\"count\":1,\"products\":[{\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2690\",\"customerCode\":\"20210916\",\"finalPrice\":1000,\"foreignName\":\"\",\"isSkuProduct\":0,\"labelNames\":[],\"linkedId\":\"\",\"maxNum\":0,\"minNum\":0,\"name\":\"玫瑰豉油鸡\",\"originalPrice\":1000,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1631788957908.jpg\",\"pid\":\"219187474445045306\",\"pknumber\":1,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1631788957908.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"remark\":\"\",\"sellTimeList\":[],\"sequence\":0,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specProductId\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"status\":2,\"stock\":9999,\"stockLimit\":1,\"tax\":0.01,\"taxId\":\"\",\"type\":1,\"unit\":\"\",\"updateStatus\":0,\"valid\":true,\"version\":0,\"weight\":0.0,\"weightType\":0}]},\"errcode\":100,\"errmsg\":\"成功\"}"
, ProductInfosDto.class)
// Shop/ValidateShopProduct
def valiadProductResponse = JSON.parseObject("{\"data\":{\"failureList\":[],\"successList\":[{\"code\":0,\"productType\":{\"additionalGroupList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2690\",\"customerCode\":\"20210916\",\"finalPrice\":1000,\"foreignName\":\"\",\"isDishware\":0,\"isSkuProduct\":0,\"linkedId\":\"\",\"memberDiscount\":0,\"name\":\"玫瑰豉油鸡\",\"openMemberDiscount\":0,\"originalPrice\":1000,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1631788957908.jpg\",\"pid\":\"219187474445045306\",\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"202109\",\"productComboList\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1631788957908.jpg\"}],\"rawMaterial\":\"\",\"riseSell\":1,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"specification\":\"\",\"status\":2,\"stock\":9999,\"stockLimit\":1,\"tax\":0.01,\"taxId\":\"\",\"type\":1,\"unit\":\"\",\"weight\":0.0,\"weightType\":0},\"skuId\":\"219187474445045306\",\"spuId\":\"219187474445045306\",\"uuid\":\"4905bcae-12b8-426f-94c7-8fda93a99914\"}]},\"errcode\":100,\"errmsg\":\"获取门店必选分类商品成功\"}"
, new TypeReference<ProductBaseResponse<ValiadShopProductResponse>>() {})
def platformActiveServiceImpl = new PlatformActiveServiceImpl()
// promotioncenter/calculateservice/discount/sharing
def sharingDiscountResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":{\"apportionGoods\":[],\"couponDiscounts\":[],\"discounts\":[],\"distributionFee\":0,\"goods\":[{\"actualGoodsNumber\":0,\"cartGoodType\":0,\"cartGoodsUid\":\"9a7b1c23-4347-48a3-a612-fe303a1cb23f\",\"discountAmount\":0,\"discounts\":[],\"gift\":false,\"goodsId\":\"219187474445045306\",\"goodsQuantity\":1,\"meal\":false,\"nowPrice\":1000,\"originalPrice\":1000,\"realAmount\":1000},{\"actualGoodsNumber\":0,\"cartGoodType\":0,\"cartGoodsUid\":\"ba1c5800-637c-4b72-bfc7-76da62d61c8c\",\"discountAmount\":0,\"discounts\":[],\"gift\":false,\"goodsId\":\"219187388813086254\",\"goodsQuantity\":1,\"meal\":false,\"nowPrice\":1,\"originalPrice\":1,\"realAmount\":1}],\"isScoreLimit\":0,\"nightDistributionFee\":0,\"originalTotalAmount\":1001,\"stocks\":[],\"totalAmount\":1001,\"totalDiscountAmount\":0,\"v3Promotion\":true},\"statusCode\":\"100\",\"ver\":1}"
, new TypeReference<ActivityCalculationDiscountResponseDto>() {})
def packAmountByStoreConfig = new PackAmountConfig()
packAmountByStoreConfig.setNewPackAmount(0L)
// 满减里面的活动查询 /activity/query
def activityQueryResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":[{\"activityCode\":\"MZSP2022051911010449819\",\"activityDesc\":\"description\",\"activityName\":\"晓航测试满赠活动\",\"activityStatus\":1,\"activitySubType\":1,\"activityType\":230,\"auditStatus\":1,\"benefits\":[{\"benefitName\":\"晓航测试满赠活动\",\"benefitSeq\":1,\"sendGoodsList\":[{\"goodsCode\":\"215806824348227645\",\"goodsId\":\"215806824348227645\",\"goodsName\":\"柚子的汉堡\",\"originalPrice\":1000,\"productType\":1,\"quantityLimit\":3,\"sendCoupon\":false,\"sendNumber\":3,\"serialNumber\":99}],\"thresholdAmount\":201}],\"couponType\":0,\"createTime\":\"1652929305000\",\"delayTimes\":0,\"delayUnit\":\"\",\"discountTimes\":0,\"endTime\":1655567999000,\"isShared\":1,\"maxMoney\":0,\"minNum\":0,\"partnerCode\":\"2690\",\"priority\":68,\"startTime\":1652889600000,\"totalTimes\":0,\"updateTime\":\"1653292419000\"}],\"statusCode\":\"100\",\"ver\":1}"
, new TypeReference<ActivityQueryResponseDto>() {})
// /user/scoreUseDetail
def userScoreUseDetail = JSON.parseObject("{\"code\":\"100\",\"message\":\"success\",\"result\":{\"currentScore\":9998,\"getReduceScoreLimit\":1,\"overlayOffers\":0,\"reduceAmount\":1000,\"reducePriceLimit\":0,\"scoreReduceRate\":\"1:1\",\"scoreReduceState\":true,\"scoreState\":1,\"useScore\":10},\"ver\":\"1\"}"
, new TypeReference<GetUserScoreUserDetailResponse>() {})
and: "调三方反馈参数 为自己的参数对象 "
Mockito.when(customerInfoManager.getCustomerInfoByObject(Mockito.any())).thenReturn(customerInfoVo)
Mockito.when(assortmentSdkService.getShoppingCart(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(cartGoodsList)
Mockito.when(assortmentSdkService.checkShoppingCartSdk(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(checkCartRequest)
Mockito.when(couponOnlineClient.getCouponDetails(Mockito.any())).thenReturn(responseDto)
Mockito.when(productClient.listProductInfos(Mockito.any())).thenReturn(productInfosDto)
Mockito.when(productClient.validateShopProduct(Mockito.any())).thenReturn(valiadProductResponse)
Mockito.when(commonService.getOrgIdsForCoupon("", "")).thenReturn(null)
Mockito.when(activeFactory.getBuildChooseGoodsService(Mockito.any())).thenReturn(platformActiveServiceImpl)
Mockito.when(activityClient.calculationSharingDiscount(Mockito.any())).thenReturn(sharingDiscountResponseDto)
Mockito.when(commonFunctionHandle.getPackAmountByStoreConfig(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(packAmountByStoreConfig)
Mockito.when(assortmentSdkService.setShoppingCart(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(null)
// 满减活动里面的 查询
Mockito.when(activityService.queryActivityByType(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(activityQueryResponseDto)
Mockito.when(customScoreClient.getUserScoreUseDetail(Mockito.any())).thenReturn(userScoreUseDetail)
Mockito.when(shoppingCartRelationFactory.getBuildShoppingCartGoodsResponseService(Mockito.any())).thenReturn(new PlatformShoppingCartRelationServiceImpl())
when: "调用方法逻辑"
def response = shoppingCartNewServiceImpl.getGoodsList(shoppingCartInfoRequestVo)
then: "验证 返回结果"
with(response) {
code == "100"
message == "success"
}
}
}
package cn.freemud.service.impl
import cn.freemud.adapter.ActivityAdapter
import cn.freemud.adapter.CouponAdapter
import cn.freemud.adapter.ShoppingCartConvertAdapter
import cn.freemud.adapter.StoreItemAdapter
import cn.freemud.base.entity.BaseResponse
import cn.freemud.entities.dto.GetCouponDetailResponseDto
import cn.freemud.entities.dto.ProductBaseResponse
import cn.freemud.entities.dto.ProductInfosDto
import cn.freemud.entities.dto.activity.ActivityQueryResponseDto
import cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
import cn.freemud.entities.dto.order.PackAmountConfig
import cn.freemud.entities.dto.product.ValiadShopProductResponse
import cn.freemud.entities.vo.CartGoods
import cn.freemud.entities.vo.GetShoppingCartGoodsApportionRequestVo
import cn.freemud.enums.ShoppingCartPromotionEnum
import cn.freemud.handle.CommonFunctionHandle
import cn.freemud.handle.PromotionCommonMethodHandle
import cn.freemud.service.ActivityService
import cn.freemud.service.CommonService
import cn.freemud.service.active.ActiveFactory
import cn.freemud.service.active.impl.PlatformActiveServiceImpl
import cn.freemud.service.impl.calculate.*
import cn.freemud.service.impl.calculate.promotion.*
import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory
import cn.freemud.service.thirdparty.ActivityClient
import cn.freemud.service.thirdparty.CouponOnlineClient
import cn.freemud.service.thirdparty.CustomerApplicationClient
import cn.freemud.service.thirdparty.ProductClient
import cn.freemud.utils.PromotionFactory
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBaseServiceImpl
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import org.spockframework.runtime.Sputnik
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/4 16:56
* @description : 购物车 新算价
*/
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Sputnik.class)
@PrepareForTest(PromotionFactory.class)
class ShoppingCartNewDiscountSpock extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def calculationSharingValidatorService = new CalculationSharingValidatorService()
def sharingEquallyService = new CalculationSharingEquallyService()
def promotionCommonMethodHandle = new PromotionCommonMethodHandle()
def activityAdapter = new ActivityAdapter()
def couponAdapter = new CouponAdapter()
def productServiceImpl = new ProductServiceImpl()
def shoppingCartConvertAdapter = new ShoppingCartConvertAdapter()
def sharingDiscountService = new CalculationSharingDiscountService()
def couponService = new CouponServiceImpl()
def itemService = new ItemServiceImpl()
def storeItemAdapter = new StoreItemAdapter()
def defaultPromotionService = new DefaultPromotionService()
def couponPromotionService = new CouponPromotionService()
def buySendPromotionService = new BuySendPromotionService()
def additionalPromotionService = new AdditionalPromotionService()
def timeSalePromotionService = new TimeSalePromotionService()
def setMealService = new SetMealServiceImpl()
def customerScoreService = new CustomerScoreService()
def xyDiscountService = new XyDiscountServiceImpl()
def buyAndGiftsPromotionService = new BuyAndGiftsPromotionService()
def materialPromotionService = new MaterialPromotionService()
def fullPromotionService = new FullPromotionService()
def sharingCartService = new CalculationSharingCartService()
def assortmentSdkService = new AssortmentSdkService()
// def assortmentSdkService = PowerMockito.mock(AssortmentSdkService)
def customerInfoManager = PowerMockito.mock(AssortmentCustomerInfoManager.class)
def shoppingCartBaseService = PowerMockito.mock(ShoppingCartBaseServiceImpl)
def productService = PowerMockito.mock(ProductServiceImpl.class)
def productClient = PowerMockito.mock(ProductClient.class)
def activityClient = PowerMockito.mock(ActivityClient.class)
def couponOnlineClient = PowerMockito.mock(CouponOnlineClient.class)
def commonService = PowerMockito.mock(CommonService.class)
def activityService = PowerMockito.mock(ActivityService)
def activeFactory = PowerMockito.mock(ActiveFactory)
// 组装计算活动参数对象
def calculationCommonService = new CalculationCommonService()
def commonFunctionHandle = PowerMockito.mock(CommonFunctionHandle)
def promotionSharingService = new CouponSharingService()
def fullSharingService = new FullSharingService()
def giftSharingService = new GiftSharingService()
def additionSharingService = new AdditionSharingService()
def scoreSharingService = new ScoreSharingService()
def deliverySharingService = new DeliverySharingService()
def buyOneGiveOneSendService = new BuyOneGiveOneSendService()
def customScoreClient = PowerMockito.mock(CustomerApplicationClient)
def shoppingCartRelationFactory = PowerMockito.mock(ShoppingCartRelationFactory)
void setup() {
productServiceImpl.shoppingCartConvertAdapter = shoppingCartConvertAdapter
assortmentSdkService.productServiceImpl = productServiceImpl
assortmentSdkService.mcCafePartnerId = "1206"
assortmentSdkService.mcCafeUniversalShopId = "1"
calculationSharingValidatorService.buyOneGiveOneSendService = buyOneGiveOneSendService
shoppingCartNewServiceImpl.calculationSharingValidatorService = calculationSharingValidatorService
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
sharingEquallyService.calculationCommonService = calculationCommonService
sharingEquallyService.deliverySharingService = deliverySharingService
sharingEquallyService.giftSharingService = giftSharingService
sharingEquallyService.additionSharingService = additionSharingService
sharingEquallyService.scoreSharingService = scoreSharingService
sharingEquallyService.promotionCommonMethodHandle = promotionCommonMethodHandle
sharingEquallyService.promotionSharingService = promotionSharingService
shoppingCartNewServiceImpl.sharingEquallyService = sharingEquallyService
shoppingCartNewServiceImpl.shoppingCartBaseService = shoppingCartBaseService
shoppingCartNewServiceImpl.shoppingCartRelationFactory = shoppingCartRelationFactory
shoppingCartNewServiceImpl.productService = productService
shoppingCartNewServiceImpl.assortmentSdkService = assortmentSdkService
shoppingCartNewServiceImpl.activityAdapter = activityAdapter
shoppingCartNewServiceImpl.couponAdapter = couponAdapter
shoppingCartNewServiceImpl.couponService = couponService
shoppingCartNewServiceImpl.commonService = commonService
shoppingCartNewServiceImpl.sharingCartService = sharingCartService
// fisherman 测试过程中, 需要测试 新老算价需要自己 控制开关
shoppingCartNewServiceImpl.newSharing = "{\"type\":1,\"grayList\":\"2581\",\"enable\":true}"
shoppingCartNewServiceImpl.activityClient = activityClient
shoppingCartNewServiceImpl.sharingDiscountService = sharingDiscountService
productServiceImpl.productClient = productClient
sharingDiscountService.activityClient = activityClient
sharingDiscountService.couponService = couponService
sharingDiscountService.commonService = commonService
sharingDiscountService.activeFactory = activeFactory
couponService.couponOnlineClient = couponOnlineClient
couponService.commonService = commonService
couponService.itemService = itemService
couponService.storeItemClient = productClient
itemService.storeItemAdapter = storeItemAdapter
itemService.storeItemClient = productClient
fullPromotionService.activityService = activityService
// mock静态类
PowerMockito.mockStatic(PromotionFactory.class)
// 组装计算活动参数对象
sharingCartService.calculationCommonService = calculationCommonService
calculationCommonService.commonFunctionHandle = commonFunctionHandle
sharingCartService.promotionSharingService = promotionSharingService
promotionSharingService.assortmentSdkService = assortmentSdkService
sharingCartService.fullSharingService = fullSharingService
sharingCartService.giftSharingService = giftSharingService
sharingCartService.additionSharingService = additionSharingService
sharingCartService.scoreSharingService = scoreSharingService
sharingCartService.deliverySharingService = deliverySharingService
sharingCartService.buyOneGiveOneSendService = buyOneGiveOneSendService
fullSharingService.activityService = activityService
scoreSharingService.customScoreClient = customScoreClient
}
def "测试 getShoppingCartGoods 订单调用购物车获取结算金额 新算价"() {
given: "参数设置"
def getShoppingCartGoodsApportionRequestVo = JSON.parseObject("{\"shoppingCartInfoRequestVo\":{\"activityCode\":\"D1639031228000490\",\"buyType\":0,\"couponCode\":\"88709762025965446405\",\"couponCodes\":[{\"activityCode\":\"D1639031228000490\",\"couponCode\":\"88709762025965446405\",\"couponType\":3,\"index\":1}],\"enableSharing\":1,\"flag\":0,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2690\",\"reachStoreType\":4,\"sessionId\":\"7f19e7a7c3621f3499cc518bcf6bc3052433379a\",\"shopId\":\"QAJIALE001\",\"trackingNo\":\"fdeb19a4881742b9a3b5e0b8d88c8921\",\"useCouponFlag\":1,\"useCustomerScore\":2,\"version\":\"3.0.21.4\"}}"
, GetShoppingCartGoodsApportionRequestVo.class)
def premiumExchangeActivity = getShoppingCartGoodsApportionRequestVo.getPremiumExchangeActivity()
def shoppingCartInfoRequestVo = getShoppingCartGoodsApportionRequestVo.getShoppingCartInfoRequestVo()
// 用户登录信息,可以不改
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
// 促销算价 promotioncenter/calculateservice/discount/sharing
def sharingDiscountResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":{\"apportionGoods\":[],\"couponDiscounts\":[],\"discounts\":[{\"activityCode\":\"88709762025965446405\",\"activityName\":\"柚子3折券\",\"discount\":97,\"priority\":60,\"type\":31}],\"distributionFee\":0,\"goods\":[{\"actualGoodsNumber\":1,\"cartGoodType\":0,\"cartGoodsUid\":\"e58094b9-412f-4c46-9278-1d81cd694fb5\",\"discountAmount\":69,\"discounts\":[{\"activityCode\":\"88709762025965446405\",\"activityName\":\"柚子3折券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":69,\"goodsId\":\"255176569631514924\",\"signleDiscount\":69,\"type\":31}],\"gift\":false,\"goodsId\":\"255176569631514924\",\"goodsQuantity\":1,\"groupCombox\":[{\"goodsId\":\"215806490097850416\",\"goodsQuantity\":1,\"originalPrice\":33}],\"meal\":true,\"nowPrice\":100,\"originalPrice\":100,\"realAmount\":31,\"score\":0,\"smallMaterial\":[{\"discountAmount\":25,\"discounts\":[{\"activityCode\":\"88709762025965446405\",\"activityDesc\":\"柚子3折券\",\"activityName\":\"柚子3折券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":25,\"goodsId\":\"215806490097850416\",\"signleDiscount\":25,\"type\":31}],\"goodsId\":\"215806490097850416\",\"goodsQuantity\":1,\"originalPrice\":33,\"realAmount\":8,\"type\":2},{\"discountAmount\":1,\"discounts\":[{\"activityCode\":\"88709762025965446405\",\"activityDesc\":\"柚子3折券\",\"activityName\":\"柚子3折券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":1,\"goodsId\":\"215806824348227645\",\"signleDiscount\":1,\"type\":31}],\"goodsId\":\"215806824348227645\",\"goodsQuantity\":1,\"originalPrice\":2,\"realAmount\":1,\"type\":2},{\"discountAmount\":2,\"discounts\":[{\"activityCode\":\"88709762025965446405\",\"activityDesc\":\"柚子3折券\",\"activityName\":\"柚子3折券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":2,\"goodsId\":\"215810517496862722\",\"signleDiscount\":2,\"type\":31}],\"goodsId\":\"215810517496862722\",\"goodsQuantity\":1,\"originalPrice\":4,\"realAmount\":2,\"type\":2}]}],\"isScoreLimit\":0,\"nightDistributionFee\":0,\"originalTotalAmount\":139,\"stocks\":[],\"totalAmount\":42,\"totalDiscountAmount\":97,\"v3Promotion\":false},\"statusCode\":\"100\",\"ver\":1}"
, ActivityCalculationDiscountResponseDto.class)
// 无效参数,
def goodList = JSON.parseArray("[]"
, CartGoods.class)
def responseDto = JSON.parseObject("{\"details\":[{\"active\":{\"ActiveCode\":\"G1643164091158349\",\"ActiveDesc\":\"\\\"优惠券规则:\\n\\n券有效时间:领取后当日生效,有效期45天(具体以门店营业时间为准)\\n\\n使用范围:全国范围内已上线华莱士官方点餐小程序的华莱士门店(湖南省、湖北省、吉林省、新疆自治区除外,广东省、河北省、安徽省、海南省、北京市部分门店可用)\\n\\n活动规则:\\n1、在券有效期内,可凭本券在“华莱士官方点餐”小程序获得一次鸡米花买一送一权益。\\n2、本代金券仅限在“华莱士官方点餐”小程序上使用,与特价折扣商品不可同享,且不支持任何形式的核销后退款、变现、找零或转让。\\n3、产品规格以门店售卖为准。\\n4、 若因不可抗力因素致使本活动因故无法进行,主办方将在法律允许范围内取消、终止、修改或暂停本活动,且不承担任何违约或赔偿责任,尽管有上述约定,主办方将采取合理行动积极促使活动恢复正常。\\n如有疑问,可联系电话:4008899096。\\\"\\n\",\"ActiveId\":158770339,\"ActiveName\":\"鸡米花买一送一券\",\"AppId\":\"{\\\"apps\\\":[{\\\"appId\\\":\\\"wx3f7ca0c75b213380\\\",\\\"appName\\\":\\\"华莱士官方点餐\\\"},{\\\"appId\\\":\\\"2021002109662866\\\",\\\"appName\\\":\\\"华莱士官方点餐支付宝\\\"}]}\",\"BuyCount\":2,\"CreateDate\":\"2022-01-26 10:28:11\",\"CreateUser\":\"Rena\",\"DailyRedeemTimes\":1,\"EBCode\":\"\",\"Effective\":45,\"EffectiveEnd\":1676476799000,\"EffectiveStart\":1643126400000,\"EndDate\":\"2032-01-24 15:35:23\",\"EndString\":\"2032-01-24 15:35:23\",\"FromDayEffective\":0,\"GiftCount\":1,\"Inventory\":0,\"LastEditDate\":\"2022-03-02 13:53:16\",\"LastEditUser\":\"Rena\",\"LimitType\":1,\"MaxDiscount\":0,\"MaxRedeemTimes\":1,\"MerchantDiscountPrice\":0.00,\"MinAmount\":0.00,\"NoticeType\":0,\"OriginalPrice\":0,\"OtherDiscountPrice\":0.00,\"PartnerID\":2581,\"PlatformDiscountPrice\":0.00,\"RedeemChannel\":\"pickup,delivery\",\"Remain\":0,\"SalePrice\":0,\"StartDate\":\"2022-01-24 15:35:23\",\"StartString\":\"2022-01-24 15:35:23\",\"State\":1,\"Type\":7,\"VoucherFaceValue\":0.00,\"couponKind\":0,\"createType\":0,\"exemptionRule\":21,\"isDonate\":0,\"isMarketingTransfer\":0,\"logo\":\"https://picture.sandload.cn/1643095730650.jpg\",\"productScopeDesc\":\"全场通用\",\"promotionSharing\":0,\"remark\":\"\",\"storeScopeDesc\":\"全门店通用\"},\"activeCode\":\"G1643164091158349\",\"activeOrganizes\":[],\"activeProduct\":[{\"ActiveID\":158770339,\"Amount\":2,\"ID\":101092250,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210794556366562343\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210794556366562343},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":102707818,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202721754691430443\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202721754691430443},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":106896658,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210401734183578909\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210401734183578909},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":108664259,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201892530732737281\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201892530732737281},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":109930762,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196181856362935850\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196181856362935850},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":110136846,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205739042253494553\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205739042253494553},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":111281004,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202543005601654827\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202543005601654827},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":114626445,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201893297779668538\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201893297779668538},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115395628,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202522421465524768\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202522421465524768},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115820199,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200624575557483286\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200624575557483286},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117240395,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202011967089649173\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202011967089649173},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117999939,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201889966261817090\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201889966261817090},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":123936211,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201271922131126554\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201271922131126554},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":124066993,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210802942716994352\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210802942716994352},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":125896835,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205705620076274750\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205705620076274750},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126390048,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201274763745872130\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201274763745872130},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126672465,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529859526748216\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529859526748216},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":127065845,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202539418023664675\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202539418023664675},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":128117060,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210243929020483597\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210243929020483597},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":129635517,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"206150230788338465\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":206150230788338465},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":134711312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200463475075688706\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200463475075688706},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":136288590,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897415072052794\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897415072052794},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":137630535,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202540819597675521\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202540819597675521},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":140530255,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897810603308572\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897810603308572},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":146050161,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"208982785000576831\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":208982785000576831},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":147751575,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202523893002430477\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202523893002430477},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":148992322,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"218142359735548461\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":218142359735548461},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":156830621,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196180894333253140\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196180894333253140},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":160705326,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202538605917268002\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202538605917268002},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":162463116,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529566968801295\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529566968801295},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":169597458,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"209226684733332798\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":209226684733332798},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":171307549,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"213420606371245629\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":213420606371245629},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":173136602,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526680993012751\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526680993012751},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176003576,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526989498738731\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526989498738731},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176541223,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202530381634771974\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202530381634771974},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":178377691,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202809932735654450\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202809932735654450},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":180645301,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201276161287901451\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201276161287901451},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":184234583,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205116588443264314\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205116588443264314},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":186250294,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210240193529248544\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210240193529248544},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":187829982,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202985175152355391\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202985175152355391},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":188803312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201890450460747316\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201890450460747316},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":189633316,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201904128631273001\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201904128631273001},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":199438172,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210137445573931030\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210137445573931030},{\"ActiveID\":158770339,\"Amount\":1,\"ID\":1724328479,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"233056712980957721\",\"Remain\":0,\"exchangePrice\":0.00,\"kgdProductId\":233056712980957721}],\"activeProductSetting\":[],\"activeRedeemTimeIntervalList\":[],\"activeRestrictionVOS\":[],\"code\":\"88709227085491207040\",\"create_time\":\"2022-02-20 15:10:42\",\"limitStoreId\":null,\"lockStatus\":false,\"minAmount\":\"0\",\"sendReason\":\"手动送券,SWEET SUGA,17327190802\",\"status\":0,\"storelimit\":0,\"storeChannelLimit\":0,\"storeLimitLevel\":1,\"title\":\"鸡米花买一送一券\",\"today_available_times\":1,\"total_available_times\":1,\"type\":7,\"valid_ends\":\"2022-04-05 23:59:59\",\"valid_start\":\"2022-02-20 00:00:00\"}],\"errors\":[],\"result\":1,\"statusCode\":0,\"ver\":1}"
, GetCouponDetailResponseDto.class)
// 购物车缓存 saas:user:info:cart:goods:2690_1001_3653544968271672251
// fisherman 注意修改 cartGoodsUid 和促销算价返回一致
def redisCartBaseResponse = JSON.parseObject("{\"code\":100,\"message\":\"success\",\"result\":[{\"addCartTime\":1666144449119,\"amount\":33,\"canUseCoupon\":1,\"cartGoodsUid\":\"e58094b9-412f-4c46-9278-1d81cd694fb5\",\"categoryName\":\"套餐\",\"classificationForeignName\":\"\",\"classificationId\":\"\",\"classificationName\":\"\",\"createTimeMili\":1666144449119,\"customerCode\":\"isStockLimit001\",\"finalPrice\":100,\"foreignName\":\"\",\"goodsId\":\"255176569631514924\",\"goodsType\":3,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"materialAmount\":0,\"memberDiscount\":100,\"name\":\"迦勒套餐限制库存\",\"originalAmount\":33,\"originalMaterialAmount\":0,\"originalPrice\":33,\"originalProductType\":7,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1666144031098.jpg\",\"productComboList\":[{\"amount\":33,\"customerCode\":\"jrb\",\"extra\":[],\"finalPrice\":33,\"foreignName\":\"\",\"goodsId\":\"215806490097850416\",\"linkedId\":\"\",\"name\":\"柚子的鸡肉棒\",\"originalAmount\":33,\"originalPrice\":33,\"originalProductType\":1,\"pic\":\"https://picture.sandload.cn/1628583566754.jpg\",\"qty\":1,\"skuId\":\"215806490097850416\",\"spuForeignName\":\"\",\"spuName\":\"柚子的鸡肉棒\",\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}],\"productGroupList\":[{\"amount\":33,\"customerCode\":\"jrb\",\"extra\":[],\"finalPrice\":33,\"foreignName\":\"\",\"goodsId\":\"215806490097850416\",\"linkedId\":\"\",\"name\":\"柚子的鸡肉棒\",\"originalAmount\":33,\"originalPrice\":33,\"originalProductType\":1,\"pic\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productGroupId\":251946861712302120,\"qty\":1,\"skuId\":\"215806490097850416\",\"spuForeignName\":\"\",\"spuName\":\"柚子的鸡肉棒\",\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"amount\":2,\"customerCode\":\"hb\",\"extra\":[],\"finalPrice\":2,\"foreignName\":\"\",\"goodsId\":\"215806824348227645\",\"linkedId\":\"\",\"name\":\"柚子的汉堡\",\"originalAmount\":2,\"originalPrice\":2,\"originalProductType\":1,\"pic\":\"https://picture.sandload.cn/1628583887266.png\",\"productGroupId\":251946861712302120,\"qty\":1,\"skuId\":\"215806824348227645\",\"spuForeignName\":\"\",\"spuName\":\"柚子的汉堡\",\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"amount\":4,\"customerCode\":\"gl\",\"extra\":[],\"finalPrice\":4,\"foreignName\":\"\",\"goodsId\":\"215810517496862722\",\"linkedId\":\"\",\"name\":\"柚子的果篮\",\"originalAmount\":40,\"originalPrice\":40,\"originalProductType\":1,\"pic\":\"https://picture.sandload.cn/1628587383665.jpg\",\"productGroupId\":251946861712302120,\"qty\":1,\"skuId\":\"215810517496862722\",\"spuForeignName\":\"\",\"spuName\":\"柚子的果篮\",\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}],\"productMaterialList\":[],\"qty\":1,\"riseSell\":1,\"singleOrder\":0,\"skuForeignName\":\"\",\"skuId\":\"255176569631514924\",\"skuName\":\"迦勒套餐限制库存\",\"spuForeignName\":\"\",\"spuId\":\"255176569631514924\",\"spuName\":\"迦勒套餐限制库存\",\"stockLimit\":true,\"subForeignName\":\"\",\"subName\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}],\"ver\":\"1.9.26\"}"
, new TypeReference<BaseResponse<List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods>>>() {})
def hasRequiredProducts = false
def platformActiveServiceImpl = new PlatformActiveServiceImpl()
def packAmountByStoreConfig = new PackAmountConfig()
packAmountByStoreConfig.setNewPackAmount(1000L)
// /Shop/ListProductInfoByIdList
def productInfosDto = JSON.parseObject("{\"data\":{\"count\":2,\"products\":[{\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2419\",\"customerCode\":\"1026\",\"finalPrice\":23800,\"isSkuProduct\":0,\"labelNames\":[],\"linkedId\":\"\",\"name\":\"东坡烤鸭(只)\",\"originalPrice\":23800,\"packPrice\":1000,\"picture\":\"https://picture.sandload.cn/1643174237586.jpg\",\"pid\":\"170183609423072022\",\"pknumber\":1,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"1026\",\"productComboList\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1643174237586.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"remark\":\"\",\"sellTimeList\":[{\"dateStatus\":1,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":2,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":4,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":8,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":16,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":32,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"},{\"dateStatus\":64,\"endTime\":\"21:00:00\",\"startTime\":\"11:00:00\"}],\"sequence\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"status\":2,\"stock\":9999,\"stockLimit\":2,\"type\":1,\"unit\":\"g\",\"updateStatus\":0,\"valid\":true,\"version\":0},{\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2419\",\"customerCode\":\"17155\",\"finalPrice\":0,\"isSkuProduct\":0,\"labelNames\":[],\"linkedId\":\"\",\"name\":\"不需要餐具\",\"originalPrice\":0,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1588219576180.jpg\",\"pid\":\"173451209882017045\",\"pknumber\":1,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"\",\"productComboList\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1588219576180.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"remark\":\"助力环保,从我做起\",\"sellTimeList\":[],\"sequence\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"status\":2,\"stock\":9999,\"stockLimit\":2,\"type\":1,\"unit\":\"\",\"updateStatus\":0,\"valid\":true,\"version\":0}],\"toPosProductIdType\":0},\"errcode\":100,\"errmsg\":\"成功\"}"
, ProductInfosDto.class)
// Shop/ValidateShopProduct
def valiadProductResponse = JSON.parseObject("{\"data\":{\"failureList\":[],\"successList\":[{\"code\":0,\"productType\":{\"additionalGroupList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"businessNo\":\"\",\"category\":\"\",\"categoryName\":\"\",\"companyId\":\"2690\",\"customerCode\":\"isStockLimit001\",\"finalPrice\":106,\"foreignName\":\"\",\"isDishware\":0,\"isSkuProduct\":0,\"linkedId\":\"\",\"memberDiscount\":0,\"name\":\"迦勒套餐限制库存\",\"openMemberDiscount\":0,\"originalPrice\":100,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1666144031098.jpg\",\"pid\":\"255176569631514924\",\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCode\":\"123123123asdf\",\"productComboList\":[{\"customerCode\":\"jrb\",\"finalPrice\":33,\"foreignProductName\":\"\",\"linkedId\":\"\",\"originalPrice\":33,\"packPrice\":1,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productType\":1,\"quantity\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"productGroupList\":[{\"allowRepeat\":1,\"groupCode\":\"迦勒套餐0021\",\"groupDetail\":[{\"customerCode\":\"jrb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":33,\"picture\":\"https://picture.sandload.cn/1628583566754.jpg\",\"productCode\":\"5566\",\"productFinalPrice\":33,\"productId\":\"215806490097850416\",\"productName\":\"柚子的鸡肉棒\",\"productPrice\":33,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"hb\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":2,\"picture\":\"https://picture.sandload.cn/1628583887266.png\",\"productCode\":\"445533\",\"productFinalPrice\":2,\"productId\":\"215806824348227645\",\"productName\":\"柚子的汉堡\",\"productPrice\":2,\"productType\":1,\"stockLimit\":2,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0},{\"customerCode\":\"gl\",\"foreignProductName\":\"\",\"linkedId\":\"\",\"markUpPrice\":4,\"picture\":\"https://picture.sandload.cn/1628587383665.jpg\",\"productCode\":\"776655\",\"productFinalPrice\":40,\"productId\":\"215810517496862722\",\"productName\":\"柚子的果篮\",\"productPrice\":40,\"productType\":1,\"stockLimit\":1,\"tax\":0.0,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":0}],\"linkId\":\"2690\",\"maxNumber\":5,\"minNumber\":3,\"must\":1,\"name\":\"迦勒商品租\",\"options\":\"\",\"pgid\":\"251946861712302120\",\"remark\":\"\",\"total\":0}],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1666144031098.jpg\"}],\"riseSell\":1,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"specification\":\"\",\"status\":2,\"stock\":50,\"stockLimit\":1,\"type\":7,\"unit\":\"\",\"weight\":0.0,\"weightType\":0},\"skuId\":\"255176569631514924\",\"spuId\":\"255176569631514924\",\"uuid\":\"e58094b9-412f-4c46-9278-1d81cd694fb5\"}]},\"errcode\":100,\"errmsg\":\"获取门店必选分类商品成功\"}"
, new TypeReference<ProductBaseResponse<ValiadShopProductResponse>>() {})
def activityQueryResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":[],\"statusCode\":\"100\",\"ver\":1}"
, new TypeReference<ActivityQueryResponseDto>() {})
and: "调三方反馈参数 为自己的参数对象 "
assortmentSdkService.getShoppingCart(_, _, _, _, _, shoppingCartBaseService, _) >> goodList
assortmentSdkService.setNowBuyShoppingCart(_, _, _, _, _, _, _, shoppingCartBaseService, _) >> goodList
Mockito.when(shoppingCartBaseService.getCartGoodsList(Mockito.any(), Mockito.any())).thenReturn(redisCartBaseResponse)
Mockito.when(customerInfoManager.getCustomerInfoByObject(Mockito.any())).thenReturn(customerInfoVo)
Mockito.when(productService.hasRequiredProducts(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(hasRequiredProducts)
// Mockito.when(assortmentSdkService.checkShoppingCartSdk(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(),
// Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(checkCartRequest)
// 新算价接口
Mockito.when(activityClient.calculationSharingDiscount(Mockito.any())).thenReturn(sharingDiscountResponseDto)
Mockito.when(commonService.getOrgIdsAsString(Mockito.any(), Mockito.any())).thenReturn(null)
Mockito.when(commonService.getOrgIdsForCoupon(Mockito.any(), Mockito.any())).thenReturn(["1e906bab-1800-4b00-8e36-29049d7f4efc", "391cec83-2b60-49a9-af2c-d8d6a813ce72", "16dc665e-8e03-41a8-83ae-95e92666d266"])
Mockito.when(couponOnlineClient.getCouponDetails(Mockito.any())).thenReturn(responseDto)
Mockito.when(productClient.listProductInfos(Mockito.any())).thenReturn(productInfosDto)
Mockito.when(productClient.validateShopProduct(Mockito.any())).thenReturn(valiadProductResponse)
Mockito.when(activityService.queryActivityByType(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(activityQueryResponseDto)
Mockito.when(activeFactory.getBuildChooseGoodsService(Mockito.any())).thenReturn(platformActiveServiceImpl)
Mockito.when(commonFunctionHandle.getPackAmountByStoreConfig(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(packAmountByStoreConfig)
and: "静态方法mock"
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.DEFAULT_PROMOTION)).thenReturn(defaultPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.COUPON_DISCOUNT)).thenReturn(couponPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_ONE_SEND)).thenReturn(buySendPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.ADDITIONAL_BUY)).thenReturn(additionalPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.TIME_SALE)).thenReturn(timeSalePromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.SET_MEAL)).thenReturn(setMealService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.CUSTOMER_SCORE)).thenReturn(customerScoreService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.XY_DISCOUNT)).thenReturn(xyDiscountService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_GIFTS)).thenReturn(buyAndGiftsPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.Material)).thenReturn(materialPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.FULL_REDUCTION)).thenReturn(fullPromotionService)
when: "调用方法逻辑"
// 测试过程中, 需要测试 新老算价需要自己 控制开关
def response = shoppingCartNewServiceImpl.getShoppingCartGoods(shoppingCartInfoRequestVo, premiumExchangeActivity)
then: "验证 返回结果"
with(response) {
code == "100"
message == "success"
}
}
}
package cn.freemud.service.impl
import cn.freemud.adapter.ActivityAdapter
import cn.freemud.adapter.CouponAdapter
import cn.freemud.adapter.StoreItemAdapter
import cn.freemud.entities.dto.GetCouponDetailResponseDto
import cn.freemud.entities.dto.ProductBaseResponse
import cn.freemud.entities.dto.ProductInfosDto
import cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
import cn.freemud.entities.dto.product.CheckCartRequest
import cn.freemud.entities.dto.product.ValiadShopProductResponse
import cn.freemud.entities.dto.product.ValiadShopProductResult
import cn.freemud.entities.vo.AddShoppingCartGoodsRequestVo
import cn.freemud.entities.vo.CartGoods
import cn.freemud.entities.vo.GetShoppingCartGoodsApportionRequestVo
import cn.freemud.service.CommonService
import cn.freemud.service.impl.calculate.CalculationSharingDiscountService
import cn.freemud.service.thirdparty.ActivityClient
import cn.freemud.service.thirdparty.CouponOnlineClient
import cn.freemud.service.thirdparty.ProductClient
import com.alibaba.fastjson.JSON
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/3 10:04
* @description :
*/
class ShoppingCartNewServiceImplTest extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def assortmentSdkService = Mock(AssortmentSdkService.class)
def customerInfoManager = Mock(AssortmentCustomerInfoManager.class)
def productService = Mock(ProductServiceImpl.class)
def productClient = Mock(ProductClient.class)
def activityAdapter = new ActivityAdapter()
def couponAdapter = new CouponAdapter()
def activityClient = Mock(ActivityClient.class)
def couponOnlineClient = Mock(CouponOnlineClient.class)
def commonService = Mock(CommonService.class)
def productServiceImpl = new ProductServiceImpl()
def sharingDiscountService = new CalculationSharingDiscountService()
def couponService = new CouponServiceImpl()
def itemService = new ItemServiceImpl()
def storeItemAdapter = new StoreItemAdapter()
void setup() {
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
shoppingCartNewServiceImpl.productService = productService
shoppingCartNewServiceImpl.assortmentSdkService = assortmentSdkService
shoppingCartNewServiceImpl.activityAdapter = activityAdapter
shoppingCartNewServiceImpl.couponAdapter = couponAdapter
shoppingCartNewServiceImpl.couponService = couponService
shoppingCartNewServiceImpl.commonService = commonService
// fisherman 测试过程中, 需要测试 新老算价需要自己 控制开关
shoppingCartNewServiceImpl.newSharing = "{\"type\":1,\"grayList\":\"2581\",\"enable\":true}"
shoppingCartNewServiceImpl.activityClient = activityClient
shoppingCartNewServiceImpl.sharingDiscountService = sharingDiscountService
productServiceImpl.productClient = productClient
sharingDiscountService.activityClient = activityClient
couponService.couponOnlineClient = couponOnlineClient
couponService.commonService = commonService
couponService.itemService = itemService
couponService.storeItemClient = productClient
itemService.storeItemAdapter = storeItemAdapter
itemService.storeItemClient = productClient
}
def "测试 /getShoppingCartGoodsApportion 订单调用购物车获取结算金额"() {
given: "参数设置"
def getShoppingCartGoodsApportionRequestVo = JSON.parseObject("{\"shoppingCartInfoRequestVo\":{\"activityCode\":\"G1643164091158349\",\"buyType\":0,\"couponCode\":\"88709227085491207040\",\"couponCodes\":[{\"activityCode\":\"G1643164091158349\",\"couponCode\":\"88709227085491207040\",\"couponType\":7,\"discountAmount\":800,\"index\":1}],\"flag\":0,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2581\",\"reachStoreType\":5,\"sendGoods\":[],\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"shopId\":\"229830\",\"trackingNo\":\"8283bc4c7e5f4bbb8b357e3c0bef7183\",\"useCouponFlag\":1,\"useCustomerScore\":2,\"version\":\"2.0.60.6\"}}"
, GetShoppingCartGoodsApportionRequestVo.class)
def premiumExchangeActivity = getShoppingCartGoodsApportionRequestVo.getPremiumExchangeActivity()
def shoppingCartInfoRequestVo = getShoppingCartGoodsApportionRequestVo.getShoppingCartInfoRequestVo()
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
def activityCalculationDiscountResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":{\"apportionGoods\":[{\"apportionAmount\":0,\"apportionDetails\":[],\"cartGoodsUid\":\"6dabf892-901b-40b8-a985-5c097c905678\",\"goodsId\":\"201889968054882060\",\"goodsQuantity\":1,\"nowPrice\":500,\"originalPrice\":500},{\"apportionAmount\":800,\"apportionDetails\":[{\"activityApportionAmount\":800,\"activityCode\":\"88709227085491207040\",\"activityName\":\"鸡米花买一送一券\",\"activityType\":330,\"apportionType\":-1}],\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"goodsId\":\"201889966261817090\",\"goodsQuantity\":1,\"nowPrice\":0,\"originalPrice\":800},{\"apportionAmount\":0,\"apportionDetails\":[],\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"goodsId\":\"201889966261817090\",\"goodsQuantity\":1,\"nowPrice\":800,\"originalPrice\":800}],\"couponDiscounts\":[{\"activityName\":\"鸡米花买一送一券\",\"activityType\":330,\"couponCode\":\"88709227085491207040\",\"discountAmount\":800}],\"discounts\":[{\"activityName\":\"鸡米花买一送一券\",\"discount\":800}],\"goods\":[{\"cartGoodType\":0,\"cartGoodsUid\":\"6dabf892-901b-40b8-a985-5c097c905678\",\"discountAmount\":0,\"discounts\":[],\"gift\":false,\"goodsId\":\"201889968054882060\",\"goodsQuantity\":1,\"meal\":false,\"nowPrice\":500,\"originalPrice\":500,\"realAmount\":500,\"score\":0,\"smallMaterial\":[]},{\"actualGoodsNumber\":1,\"cartGoodType\":0,\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"discountAmount\":800,\"discounts\":[{\"activityCode\":\"88709227085491207040\",\"activityName\":\"鸡米花买一送一券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":800,\"goodsId\":\"201889966261817090\",\"signleDiscount\":800,\"type\":330}],\"gift\":false,\"goodsId\":\"201889966261817090\",\"goodsQuantity\":2,\"meal\":false,\"nowPrice\":800,\"originalPrice\":800,\"realAmount\":800,\"score\":0,\"smallMaterial\":[]}],\"isScoreLimit\":0,\"nightDistributionFee\":0,\"originalTotalAmount\":2100,\"stocks\":[],\"totalAmount\":1300,\"totalDiscountAmount\":800,\"v3Promotion\":false},\"statusCode\":\"100\",\"ver\":1}"
, ActivityCalculationDiscountResponseDto.class)
def goodList = JSON.parseArray("[{\"addCartTime\":1646286585880,\"amount\":800,\"canUseCoupon\":0,\"cartGoodsUid\":\"b8eca7b4-8627-4726-8560-b1d9f74a1c8b\",\"couponCode\":\"88709227085491207040\",\"createTimeMili\":1646286585880,\"extra\":[],\"goodsId\":\"spq88709227085491207040\",\"goodsType\":10,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"originalAmount\":0,\"originalPrice\":800,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619081297921.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":2,\"skuId\":\"201889966261817090\",\"skuName\":\"鸡米花T\",\"spuId\":\"201889966261817090\",\"stockLimit\":false,\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"addCartTime\":1646286600492,\"amount\":500,\"canUseCoupon\":1,\"cartGoodsUid\":\"87653424-e6ef-45c7-ad84-2ebc777cccc9\",\"categoryName\":\"缤纷小食\",\"classificationForeignName\":\"正价单品\",\"classificationId\":\"0102\",\"classificationName\":\"正价单品\",\"createTimeMili\":1646286600492,\"customerCode\":\"hn80180054\",\"finalPrice\":500,\"foreignName\":\"\",\"goodsId\":\"201889968054882060\",\"goodsType\":5,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"materialAmount\":0,\"memberDiscount\":100,\"name\":\"元气鸡排T\",\"originalAmount\":500,\"originalMaterialAmount\":0,\"originalPrice\":500,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619082050722.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":1,\"riseSell\":1,\"singleOrder\":0,\"skuForeignName\":\"\",\"skuId\":\"\",\"skuName\":\"元气鸡排T\",\"spuForeignName\":\"\",\"spuId\":\"201889968054882060\",\"spuName\":\"元气鸡排T\",\"stockLimit\":false,\"subForeignName\":\"\",\"subName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}]"
, CartGoods.class)
def responseDto = JSON.parseObject("{\"details\":[{\"active\":{\"ActiveCode\":\"G1643164091158349\",\"ActiveDesc\":\"\\\"优惠券规则:\\n\\n券有效时间:领取后当日生效,有效期45天(具体以门店营业时间为准)\\n\\n使用范围:全国范围内已上线华莱士官方点餐小程序的华莱士门店(湖南省、湖北省、吉林省、新疆自治区除外,广东省、河北省、安徽省、海南省、北京市部分门店可用)\\n\\n活动规则:\\n1、在券有效期内,可凭本券在“华莱士官方点餐”小程序获得一次鸡米花买一送一权益。\\n2、本代金券仅限在“华莱士官方点餐”小程序上使用,与特价折扣商品不可同享,且不支持任何形式的核销后退款、变现、找零或转让。\\n3、产品规格以门店售卖为准。\\n4、 若因不可抗力因素致使本活动因故无法进行,主办方将在法律允许范围内取消、终止、修改或暂停本活动,且不承担任何违约或赔偿责任,尽管有上述约定,主办方将采取合理行动积极促使活动恢复正常。\\n如有疑问,可联系电话:4008899096。\\\"\\n\",\"ActiveId\":158770339,\"ActiveName\":\"鸡米花买一送一券\",\"AppId\":\"{\\\"apps\\\":[{\\\"appId\\\":\\\"wx3f7ca0c75b213380\\\",\\\"appName\\\":\\\"华莱士官方点餐\\\"},{\\\"appId\\\":\\\"2021002109662866\\\",\\\"appName\\\":\\\"华莱士官方点餐支付宝\\\"}]}\",\"BuyCount\":2,\"CreateDate\":\"2022-01-26 10:28:11\",\"CreateUser\":\"Rena\",\"DailyRedeemTimes\":1,\"EBCode\":\"\",\"Effective\":45,\"EffectiveEnd\":1676476799000,\"EffectiveStart\":1643126400000,\"EndDate\":\"2032-01-24 15:35:23\",\"EndString\":\"2032-01-24 15:35:23\",\"FromDayEffective\":0,\"GiftCount\":1,\"Inventory\":0,\"LastEditDate\":\"2022-03-02 13:53:16\",\"LastEditUser\":\"Rena\",\"LimitType\":1,\"MaxDiscount\":0,\"MaxRedeemTimes\":1,\"MerchantDiscountPrice\":0.00,\"MinAmount\":0.00,\"NoticeType\":0,\"OriginalPrice\":0,\"OtherDiscountPrice\":0.00,\"PartnerID\":2581,\"PlatformDiscountPrice\":0.00,\"RedeemChannel\":\"pickup,delivery\",\"Remain\":0,\"SalePrice\":0,\"StartDate\":\"2022-01-24 15:35:23\",\"StartString\":\"2022-01-24 15:35:23\",\"State\":1,\"Type\":7,\"VoucherFaceValue\":0.00,\"couponKind\":0,\"createType\":0,\"exemptionRule\":21,\"isDonate\":0,\"isMarketingTransfer\":0,\"logo\":\"https://picture.sandload.cn/1643095730650.jpg\",\"productScopeDesc\":\"全场通用\",\"promotionSharing\":0,\"remark\":\"\",\"storeScopeDesc\":\"全门店通用\"},\"activeCode\":\"G1643164091158349\",\"activeOrganizes\":[],\"activeProduct\":[{\"ActiveID\":158770339,\"Amount\":2,\"ID\":101092250,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210794556366562343\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210794556366562343},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":102707818,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202721754691430443\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202721754691430443},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":106896658,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210401734183578909\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210401734183578909},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":108664259,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201892530732737281\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201892530732737281},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":109930762,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196181856362935850\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196181856362935850},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":110136846,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205739042253494553\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205739042253494553},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":111281004,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202543005601654827\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202543005601654827},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":114626445,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201893297779668538\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201893297779668538},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115395628,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202522421465524768\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202522421465524768},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115820199,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200624575557483286\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200624575557483286},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117240395,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202011967089649173\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202011967089649173},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117999939,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201889966261817090\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201889966261817090},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":123936211,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201271922131126554\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201271922131126554},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":124066993,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210802942716994352\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210802942716994352},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":125896835,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205705620076274750\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205705620076274750},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126390048,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201274763745872130\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201274763745872130},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126672465,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529859526748216\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529859526748216},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":127065845,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202539418023664675\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202539418023664675},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":128117060,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210243929020483597\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210243929020483597},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":129635517,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"206150230788338465\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":206150230788338465},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":134711312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200463475075688706\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200463475075688706},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":136288590,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897415072052794\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897415072052794},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":137630535,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202540819597675521\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202540819597675521},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":140530255,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897810603308572\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897810603308572},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":146050161,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"208982785000576831\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":208982785000576831},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":147751575,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202523893002430477\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202523893002430477},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":148992322,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"218142359735548461\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":218142359735548461},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":156830621,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196180894333253140\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196180894333253140},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":160705326,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202538605917268002\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202538605917268002},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":162463116,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529566968801295\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529566968801295},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":169597458,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"209226684733332798\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":209226684733332798},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":171307549,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"213420606371245629\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":213420606371245629},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":173136602,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526680993012751\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526680993012751},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176003576,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526989498738731\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526989498738731},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176541223,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202530381634771974\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202530381634771974},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":178377691,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202809932735654450\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202809932735654450},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":180645301,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201276161287901451\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201276161287901451},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":184234583,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205116588443264314\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205116588443264314},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":186250294,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210240193529248544\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210240193529248544},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":187829982,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202985175152355391\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202985175152355391},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":188803312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201890450460747316\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201890450460747316},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":189633316,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201904128631273001\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201904128631273001},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":199438172,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210137445573931030\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210137445573931030},{\"ActiveID\":158770339,\"Amount\":1,\"ID\":1724328479,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"233056712980957721\",\"Remain\":0,\"exchangePrice\":0.00,\"kgdProductId\":233056712980957721}],\"activeProductSetting\":[],\"activeRedeemTimeIntervalList\":[],\"activeRestrictionVOS\":[],\"code\":\"88709227085491207040\",\"create_time\":\"2022-02-20 15:10:42\",\"limitStoreId\":null,\"lockStatus\":false,\"minAmount\":\"0\",\"sendReason\":\"手动送券,SWEET SUGA,17327190802\",\"status\":0,\"storelimit\":0,\"storeChannelLimit\":0,\"storeLimitLevel\":1,\"title\":\"鸡米花买一送一券\",\"today_available_times\":1,\"total_available_times\":1,\"type\":7,\"valid_ends\":\"2022-04-05 23:59:59\",\"valid_start\":\"2022-02-20 00:00:00\"}],\"errors\":[],\"result\":1,\"statusCode\":0,\"ver\":1}"
, GetCouponDetailResponseDto.class)
def checkCartRequest = new CheckCartRequest()
checkCartRequest.setCartGoodsList(goodList)
def hasRequiredProducts = false
def productInfosDto = JSON.parseObject("{\"data\":{\"count\":1,\"products\":[{\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"0102\",\"categoryName\":\"正价单品\",\"companyId\":\"2581\",\"customerCode\":\"hn80016\",\"finalPrice\":800,\"foreignName\":\"\",\"isSkuProduct\":0,\"labelNames\":[{\"foreignName\":\"\",\"id\":\"201728920800923959\",\"name\":\"辣味🌶🌶\",\"partnerId\":\"2581\",\"productList\":[],\"storeId\":\"\",\"type\":\"0\"}],\"linkedId\":\"\",\"maxNum\":0,\"minNum\":0,\"name\":\"鸡米花T\",\"originalPrice\":800,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1619081297921.jpg\",\"pid\":\"201889966261817090\",\"pknumber\":1,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1619081297921.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"remark\":\"一口接一口,口口留香。\",\"saleCount\":0,\"sellTimeList\":[],\"sequence\":0,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specProductId\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"status\":2,\"stock\":9999,\"stockLimit\":2,\"tax\":0.01,\"taxId\":\"\",\"type\":1,\"unit\":\"\",\"updateStatus\":0,\"valid\":true,\"version\":0,\"weight\":0.0,\"weightType\":0}]},\"errcode\":100,\"errmsg\":\"成功\"}"
, ProductInfosDto.class)
ProductBaseResponse productBaseResponse = new ProductBaseResponse();
def successList = JSON.parseArray("[{\"productType\":{\"additionalGroupList\":[],\"appIdList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"businessNo\":\"\",\"businessType\":\"\",\"category\":\"0102\",\"categoryName\":\"正价单品\",\"comboType\":0,\"companyId\":\"2581\",\"completeFlag\":2,\"customerCode\":\"hn80016\",\"customerName\":\"\",\"detailImages\":[],\"detailText\":\" \",\"finalPrice\":800,\"foreignDetailText\":\"\",\"foreignName\":\"\",\"foreignRawMaterial\":\"\",\"foreignRemark\":\"\",\"foreignUnit\":\"\",\"isDishware\":0,\"isLimitNumProduct\":0,\"isRecommend\":0,\"isSkuProduct\":0,\"isUpdateSetMeal\":1,\"labelNames\":[{\"backgroundColor\":\"\",\"endTime\":\"\",\"fontColor\":\"\",\"foreignName\":\"\",\"foreverShow\":0,\"id\":201728920800923959,\"isVisible\":1,\"labelDetail\":\"\",\"labelForm\":0,\"name\":\"辣味🌶🌶\",\"options\":\"\",\"partnerId\":\"2581\",\"productList\":[],\"startTime\":\"\",\"status\":0,\"storeId\":\"\",\"type\":\"0\"}],\"linkedId\":\"\",\"maxLimitNumber\":0,\"maxNum\":0,\"maxRestrictionQty\":0,\"memberDiscount\":100,\"memberPrice\":0,\"minLimitNumber\":0,\"minNum\":0,\"minRestrictionQty\":0,\"name\":\"鸡米花T\",\"openMemberDiscount\":0,\"options\":\"\",\"originalPrice\":800,\"otherDesc\":\"\",\"packPrice\":0,\"partnerStatus\":2,\"picture\":\"https://picture.sandload.cn/1619081297921.jpg\",\"pid\":\"201889966261817090\",\"pknumber\":1,\"priceOrigin\":\"\",\"priceSource\":2,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCategoryDetailList\":[],\"productCode\":\"010200001\",\"productComboList\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":0,\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1619081297921.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"rawMaterial\":\"\",\"remark\":\"一口接一口,口口留香。\",\"riseSell\":1,\"saleCount\":0,\"salesChannel\":\"\",\"sellTimeList\":[],\"sellTimeMonthList\":[],\"sellTimeRangeList\":[],\"sellTimeValid\":true,\"sequence\":0,\"shopLongTermSalesVolume\":0,\"shopShortTermSalesVolume\":0,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specProductId\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"standardGoodsFlag\":2,\"status\":2,\"stock\":9999,\"stockLimit\":2,\"storeCondition\":\"\",\"storeProductName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"trueOriginalPrice\":0,\"type\":1,\"unit\":\"\",\"valid\":true,\"version\":0,\"weight\":0.0,\"weightType\":0},\"skuId\":\"201889966261817090\",\"spuId\":\"201889966261817090\",\"subProductTypeMap\":null,\"uuid\":\"3bad199e-43a3-44bc-a42b-333415f09a58\"}]"
, ValiadShopProductResult.class)
ValiadShopProductResponse valiadShopProductResponse = new ValiadShopProductResponse();
valiadShopProductResponse.setSuccessList(successList)
valiadShopProductResponse.setFailureList(new ArrayList<ValiadShopProductResult>())
productBaseResponse.setData(valiadShopProductResponse)
and: "调三方反馈参数 为自己的参数对象 "
customerInfoManager.getCustomerInfoByObject("eac53a53f8ae62def7f40cb1e47a1bd9791d95a8") >> customerInfoVo
assortmentSdkService.getShoppingCart(_, _, _, _, _, _, _) >> goodList
productService.hasRequiredProducts(_, _, _, _) >> hasRequiredProducts
assortmentSdkService.checkShoppingCartSdk(_, _, _, _, _, _, _, _) >> checkCartRequest
activityClient.calculationDiscount(_) >> activityCalculationDiscountResponseDto
commonService.getOrgIdsAsString(_, _) >> null
commonService.getOrgIdsForCoupon(_, _) >> ["1e906bab-1800-4b00-8e36-29049d7f4efc", "391cec83-2b60-49a9-af2c-d8d6a813ce72", "16dc665e-8e03-41a8-83ae-95e92666d266"]
couponOnlineClient.getCouponDetails(_) >> responseDto
productClient.listProductInfos(_) >> productInfosDto
productClient.validateShopProduct(_) >> productBaseResponse
when: "调用方法逻辑"
// 测试过程中, 需要测试 新老算价需要自己 控制开关
def response = shoppingCartNewServiceImpl.getShoppingCartGoods(shoppingCartInfoRequestVo, premiumExchangeActivity)
then: "验证 返回结果"
with(response) {
code == "100"
message == "success"
}
}
}
package cn.freemud.service.impl
import cn.freemud.adapter.ShoppingCartConvertAdapter
import cn.freemud.adapter.StoreItemAdapter
import cn.freemud.entities.dto.GetCouponDetailResponseDto
import cn.freemud.entities.dto.ProductBaseResponse
import cn.freemud.entities.dto.ProductInfosDto
import cn.freemud.entities.dto.ProductListDto
import cn.freemud.entities.dto.product.CheckCartRequest
import cn.freemud.entities.dto.product.ValiadShopProductResponse
import cn.freemud.entities.vo.AddShoppingCartGoodsRequestVo
import cn.freemud.entities.vo.CartGoods
import cn.freemud.service.CouponService
import cn.freemud.service.ItemService
import cn.freemud.service.thirdparty.CouponOnlineClient
import cn.freemud.service.thirdparty.ProductClient
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import org.spockframework.runtime.Sputnik
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/16 15:16
* @description :
*/
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Sputnik.class)
@PrepareForTest([ShoppingCartConvertAdapter.class,
SDKCommonBaseContextWare.class])
class ShoppingCartNewServiceImpt2PowerMockTest extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def customerInfoManager = PowerMockito.mock(AssortmentCustomerInfoManager)
def assortmentSdkService = new AssortmentSdkService()
def couponServiceImpl = new CouponServiceImpl()
def couponOnlineClient = PowerMockito.mock(CouponOnlineClient)
def itemService = new ItemServiceImpl()
def storeItemAdapter = new StoreItemAdapter()
def storeItemClient = PowerMockito.mock(ProductClient)
void setup() {
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
shoppingCartNewServiceImpl.assortmentSdkService = assortmentSdkService
couponServiceImpl.couponOnlineClient = couponOnlineClient
couponServiceImpl.itemService = itemService
couponServiceImpl.storeItemClient = storeItemClient
itemService.storeItemAdapter = storeItemAdapter
itemService.storeItemClient = storeItemClient
assortmentSdkService.storeItemClient = storeItemClient
// mock静态类
PowerMockito.mockStatic(SDKCommonBaseContextWare.class)
}
def "测试 /addGoods"() {
given: "request 请求参数"
def addShoppingCartGoodsRequestVo = JSON.parseObject("{\"channelType\":\"saas\",\"channel\":1,\"partnerId\":\"2690\",\"appId\":\"wxa1f272347828dae8\",\"version\":\"2.0.68.7\",\"sessionId\":\"1410a547ea1bf178f17032a9e12ac6606db8cc6f\",\"orderType\":1,\"menuType\":\"saas\",\"shopId\":\"QAJIALE001\",\"spuId\":\"215809930343585821\",\"skuId\":\"\",\"qty\":1,\"categoryId\":\"0101\",\"productMaterialList\":[],\"categoryName\":\"单品\",\"productComboList\":[],\"productGroupList\":[],\"receiveId\":\"\",\"bizType\":null}"
, AddShoppingCartGoodsRequestVo.class)
and: "模拟第三方响应结果数据"
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
def responseDto = JSON.parseObject(""
, GetCouponDetailResponseDto.class)
def productInfosDto = JSON.parseObject(""
, ProductInfosDto.class)
def productListDto = JSON.parseObject(""
, ProductListDto.class)
def valiadProductResponse = JSON.parseObject(""
, new TypeReference<ProductBaseResponse<ValiadShopProductResponse>>() {})
def productInfosDto2 = JSON.parseObject(""
, new TypeReference<ProductInfosDto>() {})
// 模拟购物车商品
def goodList = JSON.parseArray("[{\"addCartTime\":1646286585880,\"amount\":800,\"canUseCoupon\":0,\"cartGoodsUid\":\"b8eca7b4-8627-4726-8560-b1d9f74a1c8b\",\"couponCode\":\"88709227085491207040\",\"createTimeMili\":1646286585880,\"extra\":[],\"goodsId\":\"spq88709227085491207040\",\"goodsType\":10,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"originalAmount\":0,\"originalPrice\":800,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619081297921.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":2,\"skuId\":\"201889966261817090\",\"skuName\":\"鸡米花T\",\"spuId\":\"201889966261817090\",\"stockLimit\":false,\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"addCartTime\":1646286600492,\"amount\":500,\"canUseCoupon\":1,\"cartGoodsUid\":\"87653424-e6ef-45c7-ad84-2ebc777cccc9\",\"categoryName\":\"缤纷小食\",\"classificationForeignName\":\"正价单品\",\"classificationId\":\"0102\",\"classificationName\":\"正价单品\",\"createTimeMili\":1646286600492,\"customerCode\":\"hn80180054\",\"finalPrice\":500,\"foreignName\":\"\",\"goodsId\":\"201889968054882060\",\"goodsType\":5,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"materialAmount\":0,\"memberDiscount\":100,\"name\":\"元气鸡排T\",\"originalAmount\":500,\"originalMaterialAmount\":0,\"originalPrice\":500,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619082050722.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":1,\"riseSell\":1,\"singleOrder\":0,\"skuForeignName\":\"\",\"skuId\":\"\",\"skuName\":\"元气鸡排T\",\"spuForeignName\":\"\",\"spuId\":\"201889968054882060\",\"spuName\":\"元气鸡排T\",\"stockLimit\":false,\"subForeignName\":\"\",\"subName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}]"
, CartGoods.class)
and: "模拟第三方调用"
Mockito.when(customerInfoManager.getCustomerInfoByObject(Mockito.any())).thenReturn(customerInfoVo)
Mockito.when(couponOnlineClient.getCouponDetails(Mockito.any())).thenReturn(responseDto)
Mockito.when(storeItemClient.listProductInfos(Mockito.any())).thenReturn(productInfosDto)
Mockito.when(storeItemClient.getSpuIdsBySkuIds(Mockito.any())).thenReturn(productListDto)
Mockito.when(storeItemClient.validateShopProduct(Mockito.any())).thenReturn(valiadProductResponse)
Mockito.when(storeItemClient.listProductInfos(Mockito.any())).thenReturn(productInfosDto2)
Mockito.when(assortmentSdkService.getShoppingCart(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(goodList)
and: "静态方法mock"
PowerMockito.when(SDKCommonBaseContextWare.getBean(CouponService.class)).thenReturn(couponServiceImpl)
when: "调用方法逻辑"
def response = shoppingCartNewServiceImpl.addGoods(addShoppingCartGoodsRequestVo)
then: "验证 返回结果"
with(response) {
code == "100"
message == "success"
}
}
}
package cn.freemud.service.impl
import cn.freemud.adapter.ActivityAdapter
import cn.freemud.adapter.CouponAdapter
import cn.freemud.adapter.StoreItemAdapter
import cn.freemud.entities.dto.GetCouponDetailResponseDto
import cn.freemud.entities.dto.ProductBaseResponse
import cn.freemud.entities.dto.ProductInfosDto
import cn.freemud.entities.dto.activity.ActivityQueryResponseDto
import cn.freemud.entities.dto.calculate.ActivityCalculationDiscountResponseDto
import cn.freemud.entities.dto.product.CheckCartRequest
import cn.freemud.entities.dto.product.ValiadShopProductResponse
import cn.freemud.entities.dto.product.ValiadShopProductResult
import cn.freemud.entities.vo.CartGoods
import cn.freemud.entities.vo.GetShoppingCartGoodsApportionRequestVo
import cn.freemud.enums.ShoppingCartPromotionEnum
import cn.freemud.handle.CommonFunctionHandle
import cn.freemud.service.ActivityService
import cn.freemud.service.CommonService
import cn.freemud.service.active.ActiveFactory
import cn.freemud.service.impl.calculate.CalculationCommonService
import cn.freemud.service.impl.calculate.CalculationSharingCartService
import cn.freemud.service.impl.calculate.CalculationSharingDiscountService
import cn.freemud.service.impl.calculate.promotion.*
import cn.freemud.service.shoppingCart.ShoppingCartRelationFactory
import cn.freemud.service.thirdparty.ActivityClient
import cn.freemud.service.thirdparty.CouponOnlineClient
import cn.freemud.service.thirdparty.CustomerApplicationClient
import cn.freemud.service.thirdparty.ProductClient
import cn.freemud.utils.PromotionFactory
import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.TypeReference
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import org.spockframework.runtime.Sputnik
import spock.lang.Specification
/**
* @author : xh.Z
* @email : fisherman0510@163.com
* @Date : 2022/3/4 16:56
* @description : 购物车 老算价
*/
@RunWith(PowerMockRunner.class)
@PowerMockRunnerDelegate(Sputnik.class)
@PrepareForTest(PromotionFactory.class)
class ShoppingCartOldDiscountSpock extends Specification {
def shoppingCartNewServiceImpl = new ShoppingCartNewServiceImpl()
def activityAdapter = new ActivityAdapter()
def couponAdapter = new CouponAdapter()
def productServiceImpl = new ProductServiceImpl()
def sharingDiscountService = new CalculationSharingDiscountService()
def couponService = new CouponServiceImpl()
def itemService = new ItemServiceImpl()
def storeItemAdapter = new StoreItemAdapter()
def defaultPromotionService = new DefaultPromotionService()
def couponPromotionService = new CouponPromotionService()
def buySendPromotionService = new BuySendPromotionService()
def additionalPromotionService = new AdditionalPromotionService()
def timeSalePromotionService = new TimeSalePromotionService()
def setMealService = new SetMealServiceImpl()
def customerScoreService = new CustomerScoreService()
def xyDiscountService = new XyDiscountServiceImpl()
def buyAndGiftsPromotionService = new BuyAndGiftsPromotionService()
def materialPromotionService = new MaterialPromotionService()
def fullPromotionService = new FullPromotionService()
def sharingCartService = new CalculationSharingCartService()
def assortmentSdkService = PowerMockito.mock(AssortmentSdkService)
def customerInfoManager = PowerMockito.mock(AssortmentCustomerInfoManager.class)
def productService = PowerMockito.mock(ProductServiceImpl.class)
def productClient = PowerMockito.mock(ProductClient.class)
def activityClient = PowerMockito.mock(ActivityClient.class)
def couponOnlineClient = PowerMockito.mock(CouponOnlineClient.class)
def commonService = PowerMockito.mock(CommonService.class)
def activityService = PowerMockito.mock(ActivityService)
def activeFactory = PowerMockito.mock(ActiveFactory)
// 组装计算活动参数对象
def calculationCommonService = new CalculationCommonService()
def commonFunctionHandle = PowerMockito.mock(CommonFunctionHandle)
def promotionSharingService = new CouponSharingService()
def fullSharingService = new FullSharingService()
def giftSharingService = new GiftSharingService()
def additionSharingService = new AdditionSharingService()
def scoreSharingService = new ScoreSharingService()
def deliverySharingService = new DeliverySharingService()
def buyOneGiveOneSendService = new BuyOneGiveOneSendService()
def customScoreClient = PowerMockito.mock(CustomerApplicationClient)
def shoppingCartRelationFactory = PowerMockito.mock(ShoppingCartRelationFactory)
void setup() {
shoppingCartNewServiceImpl.customerInfoManager = customerInfoManager
shoppingCartNewServiceImpl.shoppingCartRelationFactory = shoppingCartRelationFactory
shoppingCartNewServiceImpl.productService = productService
shoppingCartNewServiceImpl.assortmentSdkService = assortmentSdkService
shoppingCartNewServiceImpl.activityAdapter = activityAdapter
shoppingCartNewServiceImpl.couponAdapter = couponAdapter
shoppingCartNewServiceImpl.couponService = couponService
shoppingCartNewServiceImpl.commonService = commonService
shoppingCartNewServiceImpl.sharingCartService = sharingCartService
// fisherman 测试过程中, 需要测试 新老算价需要自己 控制开关
shoppingCartNewServiceImpl.newSharing = "{\"type\":1,\"grayList\":\"2581\",\"enable\":true}"
shoppingCartNewServiceImpl.activityClient = activityClient
shoppingCartNewServiceImpl.sharingDiscountService = sharingDiscountService
productServiceImpl.productClient = productClient
sharingDiscountService.activityClient = activityClient
sharingDiscountService.couponService = couponService
sharingDiscountService.commonService = commonService
sharingDiscountService.activeFactory = activeFactory
couponService.couponOnlineClient = couponOnlineClient
couponService.commonService = commonService
couponService.itemService = itemService
couponService.storeItemClient = productClient
itemService.storeItemAdapter = storeItemAdapter
itemService.storeItemClient = productClient
fullPromotionService.activityService = activityService
// mock静态类
PowerMockito.mockStatic(PromotionFactory.class)
// 组装计算活动参数对象
sharingCartService.calculationCommonService = calculationCommonService
calculationCommonService.commonFunctionHandle = commonFunctionHandle
sharingCartService.promotionSharingService = promotionSharingService
promotionSharingService.assortmentSdkService = assortmentSdkService
sharingCartService.fullSharingService = fullSharingService
sharingCartService.giftSharingService = giftSharingService
sharingCartService.additionSharingService = additionSharingService
sharingCartService.scoreSharingService = scoreSharingService
sharingCartService.deliverySharingService = deliverySharingService
sharingCartService.buyOneGiveOneSendService = buyOneGiveOneSendService
fullSharingService.activityService = activityService
scoreSharingService.customScoreClient = customScoreClient
}
def "测试 getShoppingCartGoods 订单调用购物车获取结算金额 老算价"() {
given: "参数设置"
def getShoppingCartGoodsApportionRequestVo = JSON.parseObject("{\"shoppingCartInfoRequestVo\":{\"activityCode\":\"G1643164091158349\",\"buyType\":0,\"couponCode\":\"88709227085491207040\",\"couponCodes\":[{\"activityCode\":\"G1643164091158349\",\"couponCode\":\"88709227085491207040\",\"couponType\":7,\"discountAmount\":800,\"index\":1}],\"flag\":0,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2581\",\"reachStoreType\":5,\"sendGoods\":[],\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"shopId\":\"229830\",\"trackingNo\":\"8283bc4c7e5f4bbb8b357e3c0bef7183\",\"useCouponFlag\":1,\"useCustomerScore\":2,\"version\":\"2.0.60.6\"}}"
, GetShoppingCartGoodsApportionRequestVo.class)
def premiumExchangeActivity = getShoppingCartGoodsApportionRequestVo.getPremiumExchangeActivity()
def shoppingCartInfoRequestVo = getShoppingCartGoodsApportionRequestVo.getShoppingCartInfoRequestVo()
def customerInfoVo = JSON.parseObject("{\"accessToken\":\"\",\"alipayUserId\":\"\",\"appId\":\"wx3f7ca0c75b213380\",\"appSecret\":\"\",\"appsecret\":\"\",\"channel\":\"1\",\"customerId\":\"\",\"devBrand\":\"\",\"devModel\":\"\",\"iappId\":\"7\",\"memberId\":\"3614319825989629832\",\"mobile\":\"17327190802\",\"newMember\":false,\"nickName\":\"SWEET SUGA\",\"openId\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"openid\":\"o98fP4qjUo7xm-nT-JAaVEk9yBqM\",\"partnerId\":\"2581\",\"photoUrl\":\"https://thirdwx.qlogo.cn/mmopen/vi_32/zahIlicTNSM0IA0qjOryv6s0SzIhlwW9EpQKvL63GbPhBwficMAibDohDEibSCQU0I5KohibIpp0yL57TWRcVKrRH2A/132\",\"registerTime\":\"2021-02-26 14:10:26\",\"sessionId\":\"eac53a53f8ae62def7f40cb1e47a1bd9791d95a8\",\"sessionKey\":\"GCyyapzbBSM4yXh9AduGOw==\",\"session_key\":\"GCyyapzbBSM4yXh9AduGOw==\",\"storeId\":\"\",\"tableNumber\":\"\",\"thirdPartyMemberID\":\"\",\"thirdPartyPartnerID\":\"\",\"unionId\":\"o7cEm68JPFhbrzqb0a0BcQE-dDVA\",\"wxAppId\":\"wx3f7ca0c75b213380\",\"wxAppid\":\"wx3f7ca0c75b213380\"}"
, AssortmentCustomerInfoVo.class)
def activityCalculationDiscountResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":{\"apportionGoods\":[{\"apportionAmount\":0,\"apportionDetails\":[],\"cartGoodsUid\":\"6dabf892-901b-40b8-a985-5c097c905678\",\"goodsId\":\"201889968054882060\",\"goodsQuantity\":1,\"nowPrice\":500,\"originalPrice\":500},{\"apportionAmount\":800,\"apportionDetails\":[{\"activityApportionAmount\":800,\"activityCode\":\"88709227085491207040\",\"activityName\":\"鸡米花买一送一券\",\"activityType\":330,\"apportionType\":-1}],\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"goodsId\":\"201889966261817090\",\"goodsQuantity\":1,\"nowPrice\":0,\"originalPrice\":800},{\"apportionAmount\":0,\"apportionDetails\":[],\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"goodsId\":\"201889966261817090\",\"goodsQuantity\":1,\"nowPrice\":800,\"originalPrice\":800}],\"couponDiscounts\":[{\"activityName\":\"鸡米花买一送一券\",\"activityType\":330,\"couponCode\":\"88709227085491207040\",\"discountAmount\":800}],\"discounts\":[{\"activityName\":\"鸡米花买一送一券\",\"discount\":800}],\"goods\":[{\"cartGoodType\":0,\"cartGoodsUid\":\"6dabf892-901b-40b8-a985-5c097c905678\",\"discountAmount\":0,\"discounts\":[],\"gift\":false,\"goodsId\":\"201889968054882060\",\"goodsQuantity\":1,\"meal\":false,\"nowPrice\":500,\"originalPrice\":500,\"realAmount\":500,\"score\":0,\"smallMaterial\":[]},{\"actualGoodsNumber\":1,\"cartGoodType\":0,\"cartGoodsUid\":\"d0fb5162-2f51-4e8c-9e61-fadade791483\",\"discountAmount\":800,\"discounts\":[{\"activityCode\":\"88709227085491207040\",\"activityName\":\"鸡米花买一送一券\",\"actualGoodsNumber\":1,\"addOnQuantity\":0,\"discount\":800,\"goodsId\":\"201889966261817090\",\"signleDiscount\":800,\"type\":330}],\"gift\":false,\"goodsId\":\"201889966261817090\",\"goodsQuantity\":2,\"meal\":false,\"nowPrice\":800,\"originalPrice\":800,\"realAmount\":800,\"score\":0,\"smallMaterial\":[]}],\"isScoreLimit\":0,\"nightDistributionFee\":0,\"originalTotalAmount\":2100,\"stocks\":[],\"totalAmount\":1300,\"totalDiscountAmount\":800,\"v3Promotion\":false},\"statusCode\":\"100\",\"ver\":1}"
, ActivityCalculationDiscountResponseDto.class)
def goodList = JSON.parseArray("[{\"addCartTime\":1646286585880,\"amount\":800,\"canUseCoupon\":0,\"cartGoodsUid\":\"b8eca7b4-8627-4726-8560-b1d9f74a1c8b\",\"couponCode\":\"88709227085491207040\",\"createTimeMili\":1646286585880,\"extra\":[],\"goodsId\":\"spq88709227085491207040\",\"goodsType\":10,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"originalAmount\":0,\"originalPrice\":800,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619081297921.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":2,\"skuId\":\"201889966261817090\",\"skuName\":\"鸡米花T\",\"spuId\":\"201889966261817090\",\"stockLimit\":false,\"unit\":\"\",\"weight\":0.0,\"weightType\":false},{\"addCartTime\":1646286600492,\"amount\":500,\"canUseCoupon\":1,\"cartGoodsUid\":\"87653424-e6ef-45c7-ad84-2ebc777cccc9\",\"categoryName\":\"缤纷小食\",\"classificationForeignName\":\"正价单品\",\"classificationId\":\"0102\",\"classificationName\":\"正价单品\",\"createTimeMili\":1646286600492,\"customerCode\":\"hn80180054\",\"finalPrice\":500,\"foreignName\":\"\",\"goodsId\":\"201889968054882060\",\"goodsType\":5,\"isB3S1Coupon\":0,\"isB3S1CouponGoods\":0,\"isMonthCard\":0,\"isMonthCardGoods\":0,\"isSunnyCoupon\":0,\"isUseMonthCard\":0,\"linkedId\":\"\",\"materialAmount\":0,\"memberDiscount\":100,\"name\":\"元气鸡排T\",\"originalAmount\":500,\"originalMaterialAmount\":0,\"originalPrice\":500,\"originalProductType\":1,\"packPrice\":0,\"pic\":\"https://picture.sandload.cn/1619082050722.jpg\",\"productComboList\":[],\"productGroupList\":[],\"productMaterialList\":[],\"qty\":1,\"riseSell\":1,\"singleOrder\":0,\"skuForeignName\":\"\",\"skuId\":\"\",\"skuName\":\"元气鸡排T\",\"spuForeignName\":\"\",\"spuId\":\"201889968054882060\",\"spuName\":\"元气鸡排T\",\"stockLimit\":false,\"subForeignName\":\"\",\"subName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"unit\":\"\",\"weight\":0.0,\"weightType\":false}]"
, CartGoods.class)
def responseDto = JSON.parseObject("{\"details\":[{\"active\":{\"ActiveCode\":\"G1643164091158349\",\"ActiveDesc\":\"\\\"优惠券规则:\\n\\n券有效时间:领取后当日生效,有效期45天(具体以门店营业时间为准)\\n\\n使用范围:全国范围内已上线华莱士官方点餐小程序的华莱士门店(湖南省、湖北省、吉林省、新疆自治区除外,广东省、河北省、安徽省、海南省、北京市部分门店可用)\\n\\n活动规则:\\n1、在券有效期内,可凭本券在“华莱士官方点餐”小程序获得一次鸡米花买一送一权益。\\n2、本代金券仅限在“华莱士官方点餐”小程序上使用,与特价折扣商品不可同享,且不支持任何形式的核销后退款、变现、找零或转让。\\n3、产品规格以门店售卖为准。\\n4、 若因不可抗力因素致使本活动因故无法进行,主办方将在法律允许范围内取消、终止、修改或暂停本活动,且不承担任何违约或赔偿责任,尽管有上述约定,主办方将采取合理行动积极促使活动恢复正常。\\n如有疑问,可联系电话:4008899096。\\\"\\n\",\"ActiveId\":158770339,\"ActiveName\":\"鸡米花买一送一券\",\"AppId\":\"{\\\"apps\\\":[{\\\"appId\\\":\\\"wx3f7ca0c75b213380\\\",\\\"appName\\\":\\\"华莱士官方点餐\\\"},{\\\"appId\\\":\\\"2021002109662866\\\",\\\"appName\\\":\\\"华莱士官方点餐支付宝\\\"}]}\",\"BuyCount\":2,\"CreateDate\":\"2022-01-26 10:28:11\",\"CreateUser\":\"Rena\",\"DailyRedeemTimes\":1,\"EBCode\":\"\",\"Effective\":45,\"EffectiveEnd\":1676476799000,\"EffectiveStart\":1643126400000,\"EndDate\":\"2032-01-24 15:35:23\",\"EndString\":\"2032-01-24 15:35:23\",\"FromDayEffective\":0,\"GiftCount\":1,\"Inventory\":0,\"LastEditDate\":\"2022-03-02 13:53:16\",\"LastEditUser\":\"Rena\",\"LimitType\":1,\"MaxDiscount\":0,\"MaxRedeemTimes\":1,\"MerchantDiscountPrice\":0.00,\"MinAmount\":0.00,\"NoticeType\":0,\"OriginalPrice\":0,\"OtherDiscountPrice\":0.00,\"PartnerID\":2581,\"PlatformDiscountPrice\":0.00,\"RedeemChannel\":\"pickup,delivery\",\"Remain\":0,\"SalePrice\":0,\"StartDate\":\"2022-01-24 15:35:23\",\"StartString\":\"2022-01-24 15:35:23\",\"State\":1,\"Type\":7,\"VoucherFaceValue\":0.00,\"couponKind\":0,\"createType\":0,\"exemptionRule\":21,\"isDonate\":0,\"isMarketingTransfer\":0,\"logo\":\"https://picture.sandload.cn/1643095730650.jpg\",\"productScopeDesc\":\"全场通用\",\"promotionSharing\":0,\"remark\":\"\",\"storeScopeDesc\":\"全门店通用\"},\"activeCode\":\"G1643164091158349\",\"activeOrganizes\":[],\"activeProduct\":[{\"ActiveID\":158770339,\"Amount\":2,\"ID\":101092250,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210794556366562343\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210794556366562343},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":102707818,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202721754691430443\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202721754691430443},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":106896658,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210401734183578909\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210401734183578909},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":108664259,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201892530732737281\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201892530732737281},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":109930762,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196181856362935850\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196181856362935850},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":110136846,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205739042253494553\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205739042253494553},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":111281004,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202543005601654827\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202543005601654827},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":114626445,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201893297779668538\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201893297779668538},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115395628,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202522421465524768\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202522421465524768},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":115820199,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200624575557483286\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200624575557483286},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117240395,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202011967089649173\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202011967089649173},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":117999939,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201889966261817090\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201889966261817090},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":123936211,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201271922131126554\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201271922131126554},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":124066993,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210802942716994352\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210802942716994352},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":125896835,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205705620076274750\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205705620076274750},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126390048,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201274763745872130\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201274763745872130},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":126672465,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529859526748216\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529859526748216},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":127065845,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202539418023664675\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202539418023664675},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":128117060,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210243929020483597\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210243929020483597},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":129635517,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"206150230788338465\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":206150230788338465},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":134711312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"200463475075688706\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":200463475075688706},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":136288590,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897415072052794\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897415072052794},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":137630535,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202540819597675521\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202540819597675521},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":140530255,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201897810603308572\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201897810603308572},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":146050161,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"208982785000576831\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":208982785000576831},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":147751575,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202523893002430477\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202523893002430477},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":148992322,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"218142359735548461\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":218142359735548461},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":156830621,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"196180894333253140\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":196180894333253140},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":160705326,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202538605917268002\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202538605917268002},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":162463116,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202529566968801295\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202529566968801295},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":169597458,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"209226684733332798\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":209226684733332798},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":171307549,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"213420606371245629\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":213420606371245629},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":173136602,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526680993012751\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526680993012751},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176003576,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202526989498738731\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202526989498738731},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":176541223,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202530381634771974\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202530381634771974},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":178377691,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202809932735654450\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202809932735654450},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":180645301,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201276161287901451\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201276161287901451},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":184234583,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"205116588443264314\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":205116588443264314},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":186250294,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210240193529248544\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210240193529248544},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":187829982,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"202985175152355391\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":202985175152355391},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":188803312,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201890450460747316\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201890450460747316},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":189633316,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"201904128631273001\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":201904128631273001},{\"ActiveID\":158770339,\"Amount\":2,\"ID\":199438172,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"210137445573931030\",\"Remain\":0,\"exchangePrice\":0,\"kgdProductId\":210137445573931030},{\"ActiveID\":158770339,\"Amount\":1,\"ID\":1724328479,\"MerchantDiscountPrice\":0.00,\"OtherDiscountPrice\":0,\"Paid\":0.00,\"PlatformDiscountPrice\":0.00,\"Price_Discount\":0.00,\"Price_Original\":0.00,\"ProductID\":1234567,\"ProductID_Partner\":\"233056712980957721\",\"Remain\":0,\"exchangePrice\":0.00,\"kgdProductId\":233056712980957721}],\"activeProductSetting\":[],\"activeRedeemTimeIntervalList\":[],\"activeRestrictionVOS\":[],\"code\":\"88709227085491207040\",\"create_time\":\"2022-02-20 15:10:42\",\"limitStoreId\":null,\"lockStatus\":false,\"minAmount\":\"0\",\"sendReason\":\"手动送券,SWEET SUGA,17327190802\",\"status\":0,\"storelimit\":0,\"storeChannelLimit\":0,\"storeLimitLevel\":1,\"title\":\"鸡米花买一送一券\",\"today_available_times\":1,\"total_available_times\":1,\"type\":7,\"valid_ends\":\"2022-04-05 23:59:59\",\"valid_start\":\"2022-02-20 00:00:00\"}],\"errors\":[],\"result\":1,\"statusCode\":0,\"ver\":1}"
, GetCouponDetailResponseDto.class)
def checkCartRequest = new CheckCartRequest()
checkCartRequest.setCartGoodsList(goodList)
def hasRequiredProducts = false
def productInfosDto = JSON.parseObject("{\"data\":{\"count\":1,\"products\":[{\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"category\":\"0102\",\"categoryName\":\"正价单品\",\"companyId\":\"2581\",\"customerCode\":\"hn80016\",\"finalPrice\":800,\"foreignName\":\"\",\"isSkuProduct\":0,\"labelNames\":[{\"foreignName\":\"\",\"id\":\"201728920800923959\",\"name\":\"辣味🌶🌶\",\"partnerId\":\"2581\",\"productList\":[],\"storeId\":\"\",\"type\":\"0\"}],\"linkedId\":\"\",\"maxNum\":0,\"minNum\":0,\"name\":\"鸡米花T\",\"originalPrice\":800,\"packPrice\":0,\"picture\":\"https://picture.sandload.cn/1619081297921.jpg\",\"pid\":\"201889966261817090\",\"pknumber\":1,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":\"0\",\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1619081297921.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"remark\":\"一口接一口,口口留香。\",\"saleCount\":0,\"sellTimeList\":[],\"sequence\":0,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specProductId\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"status\":2,\"stock\":9999,\"stockLimit\":2,\"tax\":0.01,\"taxId\":\"\",\"type\":1,\"unit\":\"\",\"updateStatus\":0,\"valid\":true,\"version\":0,\"weight\":0.0,\"weightType\":0}]},\"errcode\":100,\"errmsg\":\"成功\"}"
, ProductInfosDto.class)
ProductBaseResponse productBaseResponse = new ProductBaseResponse();
def successList = JSON.parseArray("[{\"productType\":{\"additionalGroupList\":[],\"appIdList\":[],\"barcode\":\"\",\"brandId\":\"\",\"brandName\":\"\",\"businessNo\":\"\",\"businessType\":\"\",\"category\":\"0102\",\"categoryName\":\"正价单品\",\"comboType\":0,\"companyId\":\"2581\",\"completeFlag\":2,\"customerCode\":\"hn80016\",\"customerName\":\"\",\"detailImages\":[],\"detailText\":\" \",\"finalPrice\":800,\"foreignDetailText\":\"\",\"foreignName\":\"\",\"foreignRawMaterial\":\"\",\"foreignRemark\":\"\",\"foreignUnit\":\"\",\"isDishware\":0,\"isLimitNumProduct\":0,\"isRecommend\":0,\"isSkuProduct\":0,\"isUpdateSetMeal\":1,\"labelNames\":[{\"backgroundColor\":\"\",\"endTime\":\"\",\"fontColor\":\"\",\"foreignName\":\"\",\"foreverShow\":0,\"id\":201728920800923959,\"isVisible\":1,\"labelDetail\":\"\",\"labelForm\":0,\"name\":\"辣味🌶🌶\",\"options\":\"\",\"partnerId\":\"2581\",\"productList\":[],\"startTime\":\"\",\"status\":0,\"storeId\":\"\",\"type\":\"0\"}],\"linkedId\":\"\",\"maxLimitNumber\":0,\"maxNum\":0,\"maxRestrictionQty\":0,\"memberDiscount\":100,\"memberPrice\":0,\"minLimitNumber\":0,\"minNum\":0,\"minRestrictionQty\":0,\"name\":\"鸡米花T\",\"openMemberDiscount\":0,\"options\":\"\",\"originalPrice\":800,\"otherDesc\":\"\",\"packPrice\":0,\"partnerStatus\":2,\"picture\":\"https://picture.sandload.cn/1619081297921.jpg\",\"pid\":\"201889966261817090\",\"pknumber\":1,\"priceOrigin\":\"\",\"priceSource\":2,\"productAttributeGroupList\":[],\"productBindingCouponTypes\":[],\"productCategoryDetailList\":[],\"productCode\":\"010200001\",\"productComboList\":[],\"productGroupList\":[],\"productPictureList\":[{\"sequence\":0,\"type\":\"default\",\"url\":\"https://picture.sandload.cn/1619081297921.jpg\"}],\"productSpecification\":[],\"productionLocation\":\"\",\"rawMaterial\":\"\",\"remark\":\"一口接一口,口口留香。\",\"riseSell\":1,\"saleCount\":0,\"salesChannel\":\"\",\"sellTimeList\":[],\"sellTimeMonthList\":[],\"sellTimeRangeList\":[],\"sellTimeValid\":true,\"sequence\":0,\"shopLongTermSalesVolume\":0,\"shopShortTermSalesVolume\":0,\"singleOrder\":0,\"skuList\":[],\"skuSpecValues\":[],\"sourceChannel\":\"\",\"specProductId\":\"\",\"specification\":\"\",\"specificationGroupList\":[],\"specificationList\":[],\"standardGoodsFlag\":2,\"status\":2,\"stock\":9999,\"stockLimit\":2,\"storeCondition\":\"\",\"storeProductName\":\"\",\"tax\":0.01,\"taxId\":\"\",\"trueOriginalPrice\":0,\"type\":1,\"unit\":\"\",\"valid\":true,\"version\":0,\"weight\":0.0,\"weightType\":0},\"skuId\":\"201889966261817090\",\"spuId\":\"201889966261817090\",\"subProductTypeMap\":null,\"uuid\":\"3bad199e-43a3-44bc-a42b-333415f09a58\"}]"
, ValiadShopProductResult.class)
ValiadShopProductResponse valiadShopProductResponse = new ValiadShopProductResponse();
valiadShopProductResponse.setSuccessList(successList)
valiadShopProductResponse.setFailureList(new ArrayList<ValiadShopProductResult>())
productBaseResponse.setData(valiadShopProductResponse)
def activityQueryResponseDto = JSON.parseObject("{\"msg\":\"成功\",\"result\":[],\"statusCode\":\"100\",\"ver\":1}"
, new TypeReference<ActivityQueryResponseDto>() {})
and: "调三方反馈参数 为自己的参数对象 "
Mockito.when(assortmentSdkService.getShoppingCart(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(goodList)
Mockito.when(customerInfoManager.getCustomerInfoByObject(Mockito.any())).thenReturn(customerInfoVo)
Mockito.when(productService.hasRequiredProducts(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(hasRequiredProducts)
Mockito.when(assortmentSdkService.checkShoppingCartSdk(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(checkCartRequest)
Mockito.when(activityClient.calculationDiscount(Mockito.any())).thenReturn(activityCalculationDiscountResponseDto)
Mockito.when(commonService.getOrgIdsAsString(Mockito.any(), Mockito.any())).thenReturn(null)
Mockito.when(commonService.getOrgIdsForCoupon(Mockito.any(), Mockito.any())).thenReturn(["1e906bab-1800-4b00-8e36-29049d7f4efc", "391cec83-2b60-49a9-af2c-d8d6a813ce72", "16dc665e-8e03-41a8-83ae-95e92666d266"])
Mockito.when(couponOnlineClient.getCouponDetails(Mockito.any())).thenReturn(responseDto)
Mockito.when(productClient.listProductInfos(Mockito.any())).thenReturn(productInfosDto)
Mockito.when(productClient.validateShopProduct(Mockito.any())).thenReturn(productBaseResponse)
Mockito.when(activityService.queryActivityByType(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(activityQueryResponseDto)
and: "静态方法mock"
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.DEFAULT_PROMOTION)).thenReturn(defaultPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.COUPON_DISCOUNT)).thenReturn(couponPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_ONE_SEND)).thenReturn(buySendPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.ADDITIONAL_BUY)).thenReturn(additionalPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.TIME_SALE)).thenReturn(timeSalePromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.SET_MEAL)).thenReturn(setMealService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.CUSTOMER_SCORE)).thenReturn(customerScoreService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.XY_DISCOUNT)).thenReturn(xyDiscountService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.BUY_GIFTS)).thenReturn(buyAndGiftsPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.Material)).thenReturn(materialPromotionService)
PowerMockito.when(PromotionFactory.getPromotionService(ShoppingCartPromotionEnum.FULL_REDUCTION)).thenReturn(fullPromotionService)
when: "调用方法逻辑"
// 测试过程中, 需要测试 新老算价需要自己 控制开关
def response = shoppingCartNewServiceImpl.getShoppingCartGoods(shoppingCartInfoRequestVo, premiumExchangeActivity)
then: "验证 返回结果"
with(response) {
code == "100"
message == "success"
}
}
}
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