package cn.freemud.utils;

import cn.freemud.management.adapter.DeliverySdkAdapter;
import cn.freemud.management.entities.dto.request.console.BizDTO;
import cn.freemud.management.entities.dto.request.console.ConsoleResponseDTO;
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/5/17 19:50
 * @description :
 */
public class DemoMain {
    public static void main(String[] args) {
        String str = "{\"abnormalDesc\":\"\",\"abnormalState\":0,\"actualPayAmount\":0,\"afterSalesOrderList\":[],\"appId\":\"wxa1f272347828dae8\",\"barCounter\":\"\",\"bizType\":1,\"canRefund\":true,\"cancelReason\":\"\",\"companySelfCode\":\"\",\"createTime\":\"1652951684000\",\"daySeq\":3,\"deliveryContactInfoList\":[{\"addressDetail\":\"学清嘉创大厦A座,15层\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"{\\\"receiveId\\\": \\\"3652236942336672686\\\"}\",\"infoType\":1,\"latitude\":40.0149612,\"longitude\":116.3530960,\"mobile\":\"18017275431\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":1,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\"},{\"addressDetail\":\"third\",\"city\":\"\",\"contactsName\":\"\",\"expressNo\":\"0\",\"extInfo\":\"\",\"infoType\":0,\"latitude\":0E-7,\"longitude\":0E-7,\"mobile\":\"\",\"province\":\"\",\"region\":\"\",\"relateObjectType\":3,\"street\":\"\",\"telephone\":\"\",\"thirdDeliveryId\":\"0\"}],\"deliveryPromise\":0,\"deliveryState\":-2,\"dinersNumber\":0,\"downstreamPosCode\":\"0\",\"downstreamThirdOrderCode\":\"0\",\"estimateDeliveryCompleteTime\":\"1652952163000\",\"expressChannelCode\":\"\",\"expressChannelName\":\"\",\"expressNo\":\"\",\"expressType\":0,\"extInfo\":\"{\\\"appid\\\":\\\"wxa1f272347828dae8\\\",\\\"deliveryHoursDayEnd\\\":\\\"\\\",\\\"deliveryHoursDayStart\\\":\\\"2022-05-19 00:00:00\\\",\\\"fmId\\\":\\\"436213004703232000\\\",\\\"fromAppId\\\":\\\"wxa1f272347828dae8\\\",\\\"memberLevel\\\":\\\"星耀77777\\\",\\\"openid\\\":\\\"o0wG94vrmHbVDPayTdd_bLAFbAw8\\\",\\\"packageAmountCollectType\\\":1,\\\"paidMember\\\":false,\\\"payDate\\\":\\\"2022-05-19 17:14:45\\\",\\\"payTransId\\\":\\\"436213004703232000\\\",\\\"prepayId\\\":\\\"\\\",\\\"pushOrderTime\\\":0,\\\"serviceTime\\\":50,\\\"sessionId\\\":\\\"6dd53d0c2e3420026c8556dda661631a0bbbd80b\\\",\\\"sessionKey\\\":\\\"Ngr/pMQqO4cvFfusxCKGUQ==\\\",\\\"totalScore\\\":0,\\\"version\\\":\\\"2.0.78.2\\\"}\",\"immediately\":true,\"isParent\":false,\"localTableKey\":\"\",\"marketingCode\":\"\",\"marketingType\":0,\"needInvoice\":false,\"note\":\"\",\"operator\":\"\",\"orderArea\":\"0\",\"orderClient\":2,\"orderCode\":\"24422392457926913900003\",\"orderCostDetailList\":[],\"orderExtended\":{\"agentPayerId\":\"\",\"agentPayerName\":\"\",\"orderClientGroup\":\"北京\",\"orderClientGroupCode\":\"beijin\",\"sendWord\":\"\",\"spellGroupCode\":\"\",\"storeNameEn\":\"\",\"userPhone\":\"\"},\"orderInvoice\":{\"address\":\"\",\"bankCardNo\":\"\",\"content\":\"\",\"invoiceBank\":\"\",\"invoiceUrl\":\"\",\"itemId\":\"\",\"partnerId\":\"\",\"phoneNo\":\"\",\"taxNo\":\"\",\"title\":\"\"},\"orderItemList\":[{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"82901192-3a35-45ab-be5b-ec454589fb74\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"wefsdf\\\"}\",\"id\":244223924610726421,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"wefsdf\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"232562948867890490\",\"productName\":\"molly美式\",\"productPicUrl\":\"https://picture.sandload.cn/1644545749037.jpg\",\"productPrice\":12.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":1,\"productSharePrice\":0.0,\"productSpec\":\"232562948867890490\",\"productSpecName\":\"molly美式\",\"productType\":88,\"productUnit\":\"gk\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":12.0,\"settlementPrice\":12.0,\"thirdProductId\":\"wesdsd\",\"userId\":\"\",\"weight\":301.67},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0}\",\"id\":244223924618066455,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"232562948867890490_1\",\"photoUrl\":\"\",\"productCode\":\"\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"215806159829964858\",\"productName\":\"加珍珠\",\"productPicUrl\":\"\",\"productPrice\":11.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":2,\"productSharePrice\":0.0,\"productSpec\":\"215806159829964858\",\"productSpecName\":\"加珍珠\",\"productType\":0,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":11.0,\"settlementPrice\":11.0,\"thirdProductId\":\"H00301\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"472efe33-661b-4d1e-8cf8-d9d1ef1a6bb9\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"789943\\\", \\\"thirdProductSpecId\\\": \\\"H00401\\\"}\",\"id\":244223924640086553,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"232351862368655873\",\"productName\":\"molly柚子汁\",\"productPicUrl\":\"https://picture.sandload.cn/1644371925808.jpg\",\"productPrice\":111.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":3,\"productSharePrice\":0.0,\"productSpec\":\"232351862372850186\",\"productSpecName\":\"molly柚子汁/小杯\",\"productType\":88,\"productUnit\":\"gk\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":111.0,\"settlementPrice\":111.0,\"thirdProductId\":\"232351862372850186\",\"userId\":\"\",\"weight\":2000.00},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0}\",\"id\":244223924647426587,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"232351862368655873_3\",\"photoUrl\":\"\",\"productCode\":\"\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"215806159829964858\",\"productName\":\"加珍珠\",\"productPicUrl\":\"\",\"productPrice\":11.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":4,\"productSharePrice\":0.0,\"productSpec\":\"215806159829964858\",\"productSpecName\":\"加珍珠\",\"productType\":0,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":11.0,\"settlementPrice\":11.0,\"thirdProductId\":\"H00301\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isSendGoods\\\": false, \\\"cartGoodsUid\\\": \\\"59162ef4-759e-4c53-8336-ca51c97a7966\\\", \\\"isB3S1Coupon\\\": 0, \\\"spuProductCode\\\": \\\"564drt\\\"}\",\"id\":244223924653718045,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"0\",\"photoUrl\":\"\",\"productCode\":\"564drt\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"240704191696410398\",\"productName\":\"套餐1\",\"productPicUrl\":\"https://picture.sandload.cn/1652328677777.png\",\"productPrice\":2.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":5,\"productSharePrice\":1.0,\"productSpec\":\"240704191696410398\",\"productSpecName\":\"套餐1\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1.0,\"settlementPrice\":1.0,\"thirdProductId\":\"tghuier09778\",\"userId\":\"\",\"weight\":0.00},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"klo907e\\\"}\",\"id\":244223924663155231,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"240704191696410398_5\",\"photoUrl\":\"\",\"productCode\":\"klo907e\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"240704129620711188\",\"productName\":\"K2\",\"productPicUrl\":\"https://picture.sandload.cn/1652328632626.jpg\",\"productPrice\":1.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":0,\"productSharePrice\":0.0,\"productSpec\":\"240704129620711188\",\"productSpecName\":\"K2\",\"productType\":6,\"productUnit\":\"gk\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":1.0,\"settlementPrice\":1.0,\"thirdProductId\":\"uhgtrfd098\",\"userId\":\"\",\"weight\":410.20},{\"canRefund\":true,\"extInfo\":\"{\\\"tax\\\": 0.01, \\\"stapleFood\\\": 0, \\\"isMonthCard\\\": 0, \\\"isB3S1Coupon\\\": 0, \\\"isFixedProduct\\\": true, \\\"spuProductCode\\\": \\\"uhjkolp\\\"}\",\"id\":244223924675738145,\"ignoreInOrderClose\":false,\"marketingCode\":\"0\",\"marketingType\":0,\"nickName\":\"\",\"note\":\"\",\"openId\":\"\",\"parentProductId\":\"240704191696410398_5\",\"photoUrl\":\"\",\"productCode\":\"uhjkolp\",\"productForeignName\":\"\",\"productForeignProperty\":\"\",\"productForeignSpecName\":\"\",\"productId\":\"240704090658772746\",\"productName\":\"K1\",\"productPicUrl\":\"https://picture.sandload.cn/1652328579149.png\",\"productPrice\":1.0,\"productProperty\":\"\",\"productQuantity\":1,\"productSeq\":0,\"productSharePrice\":1.0,\"productSpec\":\"240704090658772746\",\"productSpecName\":\"K1\",\"productType\":6,\"productUnit\":\"\",\"productUpc\":\"\",\"productWeightUnit\":0,\"salePrice\":0.0,\"settlementPrice\":0.0,\"thirdProductId\":\"90lo0p\",\"userId\":\"\",\"weight\":0.00}],\"orderPayItemCreateReqList\":[{\"cardCode\":\"5826900000011930004\",\"fmTradeNo\":\"7702690244223925101440607\",\"id\":244223925448538668,\"operator\":\"\",\"orderCode\":\"24422392457926913900003\",\"orderId\":244223924579269139,\"outOrderNo\":\"\",\"partnerId\":\"2690\",\"payAmount\":124,\"payChannelName\":\"储值卡\",\"payChannelType\":3,\"storeId\":\"202104120\",\"transId\":\"436213004703232000\"}],\"orderSendCouponRespList\":[],\"orderSettlementDetailList\":[{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"0\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":-1.0,\"settlementType\":211,\"shopAmount\":0,\"shopDiscountAmount\":-1},{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"setMeal\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"套餐商品优惠\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"240704191696410398\",\"productSeq\":5,\"prospectiveAmount\":0.0,\"settlementAmount\":1.0,\"settlementType\":211,\"shopAmount\":0,\"shopDiscountAmount\":1},{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"240704191696410398\",\"productSeq\":5,\"prospectiveAmount\":0.0,\"settlementAmount\":1.0,\"settlementType\":0,\"shopAmount\":0,\"shopDiscountAmount\":1},{\"agentDiscountAmount\":0,\"carrierDiscountAmount\":0,\"extInfo\":\"\",\"externalObjectId\":\"\",\"externalObjectName\":\"\",\"externalObjectSubId\":\"\",\"ignoreInDiscountAmount\":false,\"isOnline\":true,\"note\":\"\",\"number\":1,\"platformDiscountAmount\":0,\"platformServiceAmount\":0,\"productId\":\"240704090658772746\",\"productSeq\":0,\"prospectiveAmount\":0.0,\"settlementAmount\":1.0,\"settlementType\":0,\"shopAmount\":0,\"shopDiscountAmount\":1},{\"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.0,\"settlementAmount\":124.0,\"settlementType\":205,\"shopAmount\":0,\"shopDiscountAmount\":1}],\"orderState\":2,\"orderSubState\":0,\"orderType\":3,\"originalAmount\":125.0,\"parentCode\":\"0\",\"partnerId\":\"2690\",\"partnerName\":\"\",\"payChannel\":\"10102\",\"payChannelName\":\"储值卡\",\"payChannelType\":\"3\",\"payRequestNo\":\"436213004703232000\",\"payState\":2,\"payTime\":\"1652951685864\",\"payType\":1,\"pickUpGoodsNo\":\"5157\",\"posCode\":\"\",\"posTableKey\":\"\",\"printNum\":0,\"settlementAmount\":124.0,\"sourceType\":0,\"storeId\":\"202104120\",\"storeName\":\"molly的小店\",\"storeUnifyId\":\"0\",\"suspendDesc\":\"\",\"suspendState\":0,\"thirdOrderCode\":\"24422392457926913900003\",\"thirdStoreId\":\"202104120\",\"toStoreId\":\"0\",\"updateTime\":\"1652951684000\",\"userId\":\"3649418880733072423\",\"userName\":\"顺丰同城\",\"weight\":2711.87}";
        OrderInfoReqs orderInfoReqs = JSON.parseObject(str, OrderInfoReqs.class);
        OrderBeanV1 orderBeanV1 = new OrderCenterSdkAdapter().convent2NEWOrderInfo(orderInfoReqs);
        System.out.println(JSON.toJSONString(orderBeanV1));

        DeliverySdkAdapter deliverySdkAdapter = new DeliverySdkAdapter();
        ConsoleResponseDTO<BizDTO> objectConsoleResponseDTO = new ConsoleResponseDTO<>();
        deliverySdkAdapter.buildDeliveryOrderRequestDto(orderBeanV1,objectConsoleResponseDTO,"");
    }
}
