From 77a9205a3591ee9dedff9754bea4d2ae06245ab9 Mon Sep 17 00:00:00 2001 From: ljl Date: Fri, 3 Nov 2023 16:35:58 +0800 Subject: [PATCH] yh --- ...seOrderItemsAndSourceItemsResponseDTO.java | 48 +- .../GetSourceItemInfosResponseDTO.java | 13 + .../dsapi/response/SourceItemRelation.java | 10 + .../dto/dsapi/response/SourceProductInfo.java | 32 ++ .../api/dto/dsapi/response/SourceSkuInfo.java | 19 + .../PurchaseOrderCancelMessageDTO.java | 2 + .../PurchaseOrderChangeMessageDTO.java | 2 + .../ms/api/dto/dsorder/PurchaseOrderDTO.java | 1 + .../PurchaseOrderRelateMessageDTO.java | 2 + .../com/ms/api/dto/dsorder/RefundInfoDTO.java | 18 + .../ms/biz/bo/MatchSourceSkuInfoResultBO.java | 3 +- .../java/com/ms/biz/consts/CommonConst.java | 2 +- .../com/ms/biz/consts/Refund1688Const.java | 18 + .../ms/biz/dto/openspi/request/Address.java | 2 +- .../dto/openspi/request/BatchCreateParam.java | 3 + .../dto/openspi/request/BatchPayParam.java | 2 +- .../biz/dto/openspi/request/CreateOrder.java | 2 +- .../request/QuerySupplyPlatformAuthParam.java | 2 +- .../ms/biz/dto/openspi/request/SkuOrder.java | 8 +- .../dto/openspi/response/BatchCreateData.java | 2 +- .../dto/openspi/response/BatchPayData.java | 2 +- .../biz/dto/openspi/response/OrderResult.java | 2 +- .../dto/openspi/response/PaymentResult.java | 2 +- .../response/QuerySupplyPlatformAuthData.java | 2 +- .../ms/biz/service/DdAftersaleMsgService.java | 21 + .../com/ms/biz/service/DdTradeMsgService.java | 21 + .../DoudianAftersaleMsgBufferService.java | 21 + .../DoudianAftersaleMsgQueueService.java | 21 + .../service/DoudianMsgParseQueueService.java | 21 + .../com/ms/biz/service/DoudianMsgService.java | 32 ++ .../service/DoudianTradeMsgBufferService.java | 21 + .../service/DoudianTradeMsgQueueService.java | 21 + .../java/com/ms/biz/service/DsApiService.java | 1 + .../com/ms/biz/service/DsMessageService.java | 2 + .../PlatformPurchaseOrderAddressService.java | 21 + ...atformPurchaseOrderMaskAddressService.java | 21 + .../service/PlatformPurchaseOrderService.java | 21 + .../PlatformPurchaseOrderSkuService.java | 21 + .../service/PurchaseOrderAddressService.java | 21 - .../biz/service/PurchaseOrderItemService.java | 21 + .../PurchaseOrderMaskAddressService.java | 21 - .../biz/service/PurchaseOrderSkuService.java | 21 - .../impl/DdAftersaleMsgServiceImpl.java | 53 +++ .../service/impl/DdTradeMsgServiceImpl.java | 53 +++ .../impl/DistributionOrderServiceImpl.java | 424 +++++++++++++----- .../DoudianAftersaleMsgBufferServiceImpl.java | 53 +++ .../DoudianAftersaleMsgQueueServiceImpl.java | 53 +++ .../impl/DoudianMsgParseQueueServiceImpl.java | 53 +++ .../service/impl/DoudianMsgServiceImpl.java | 242 ++++++++++ .../DoudianTradeMsgBufferServiceImpl.java | 53 +++ .../impl/DoudianTradeMsgQueueServiceImpl.java | 53 +++ .../ms/biz/service/impl/DsApiServiceImpl.java | 12 +- .../service/impl/DsMessageServiceImpl.java | 231 +++++++++- ...atformPurchaseOrderAddressServiceImpl.java | 53 +++ ...rmPurchaseOrderMaskAddressServiceImpl.java | 53 +++ .../PlatformPurchaseOrderServiceImpl.java | 53 +++ .../PlatformPurchaseOrderSkuServiceImpl.java | 53 +++ .../impl/PurchaseOrderAddressServiceImpl.java | 53 --- .../impl/PurchaseOrderItemServiceImpl.java | 53 +++ .../PurchaseOrderMaskAddressServiceImpl.java | 53 --- .../impl/PurchaseOrderServiceImpl.java | 2 +- .../impl/PurchaseOrderSkuServiceImpl.java | 53 --- .../callback/DoudianMsgReceiveService.java | 52 +++ .../callback/MemberAuthCallbackService.java | 12 - .../spi/callback/ShopAuthCallbackService.java | 13 - .../biz/task/DoudianMsgParseTaskService.java | 107 +++++ .../task/DsMessageConsumeMsgTaskService.java | 2 +- .../java/com/ms/biz/tool/DsOrderTool.java | 12 +- .../util/{DdRequestUtil.java => DDApi.java} | 21 +- .../com/ms/dal/entity/DdAftersaleMsg.java | 61 +++ .../java/com/ms/dal/entity/DdTradeMsg.java | 61 +++ .../dal/entity/DoudianAftersaleMsgBuffer.java | 41 ++ .../dal/entity/DoudianAftersaleMsgQueue.java | 61 +++ .../java/com/ms/dal/entity/DoudianMsg.java | 51 +++ .../ms/dal/entity/DoudianMsgParseQueue.java | 55 +++ .../ms/dal/entity/DoudianTradeMsgBuffer.java | 40 ++ .../ms/dal/entity/DoudianTradeMsgQueue.java | 60 +++ .../ms/dal/entity/PlatformPurchaseOrder.java | 81 ++++ ...java => PlatformPurchaseOrderAddress.java} | 2 +- ... => PlatformPurchaseOrderMaskAddress.java} | 2 +- ...Sku.java => PlatformPurchaseOrderSku.java} | 12 +- .../java/com/ms/dal/entity/PurchaseOrder.java | 80 +++- .../com/ms/dal/entity/PurchaseOrderItem.java | 77 ++++ .../ms/dal/mapper/DdAftersaleMsgMapper.java | 26 ++ .../com/ms/dal/mapper/DdTradeMsgMapper.java | 26 ++ .../DoudianAftersaleMsgBufferMapper.java | 26 ++ .../DoudianAftersaleMsgQueueMapper.java | 26 ++ .../com/ms/dal/mapper/DoudianMsgMapper.java | 26 ++ .../mapper/DoudianMsgParseQueueMapper.java | 27 ++ .../mapper/DoudianTradeMsgBufferMapper.java | 26 ++ .../mapper/DoudianTradeMsgQueueMapper.java | 26 ++ .../PlatformPurchaseOrderAddressMapper.java | 26 ++ .../mapper/PlatformPurchaseOrderMapper.java | 30 ++ ...latformPurchaseOrderMaskAddressMapper.java | 26 ++ .../PlatformPurchaseOrderSkuMapper.java | 33 ++ .../mapper/PurchaseOrderAddressMapper.java | 26 -- .../dal/mapper/PurchaseOrderItemMapper.java | 31 ++ .../ms/dal/mapper/PurchaseOrderMapper.java | 9 +- .../PurchaseOrderMaskAddressMapper.java | 26 -- .../ms/dal/mapper/PurchaseOrderSkuMapper.java | 29 -- .../src/main/resources/application.properties | 12 +- .../resources/mapper/DdAftersaleMsgMapper.xml | 168 +++++++ .../resources/mapper/DdTradeMsgMapper.xml | 168 +++++++ .../DoudianAftersaleMsgBufferMapper.xml | 115 +++++ .../mapper/DoudianAftersaleMsgQueueMapper.xml | 168 +++++++ .../resources/mapper/DoudianMsgMapper.xml | 142 ++++++ .../mapper/DoudianMsgParseQueueMapper.xml | 162 +++++++ .../mapper/DoudianTradeMsgBufferMapper.xml | 115 +++++ .../mapper/DoudianTradeMsgQueueMapper.xml | 168 +++++++ ...=> PlatformPurchaseOrderAddressMapper.xml} | 28 +- .../mapper/PlatformPurchaseOrderMapper.xml | 237 ++++++++++ ...latformPurchaseOrderMaskAddressMapper.xml} | 28 +- ...xml => PlatformPurchaseOrderSkuMapper.xml} | 110 +++-- .../mapper/PurchaseOrderItemMapper.xml | 239 ++++++++++ .../resources/mapper/PurchaseOrderMapper.xml | 329 ++++++++++---- .../java/com/ms/web/config/CorsConfig.java | 1 - .../ms/web/controller/OpenSPIController.java | 21 +- 117 files changed, 5105 insertions(+), 709 deletions(-) create mode 100644 ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetSourceItemInfosResponseDTO.java create mode 100644 ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceItemRelation.java create mode 100644 ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceProductInfo.java create mode 100644 ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceSkuInfo.java create mode 100644 ms-api/src/main/java/com/ms/api/dto/dsorder/RefundInfoDTO.java create mode 100644 ms-biz/src/main/java/com/ms/biz/consts/Refund1688Const.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DdAftersaleMsgService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DdTradeMsgService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgBufferService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgQueueService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianMsgParseQueueService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianMsgService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgBufferService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgQueueService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderAddressService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderMaskAddressService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderSkuService.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderAddressService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderItemService.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderMaskAddressService.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderSkuService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DdAftersaleMsgServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DdTradeMsgServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgBufferServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgQueueServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgParseQueueServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgBufferServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgQueueServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderAddressServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderMaskAddressServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderSkuServiceImpl.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderAddressServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderItemServiceImpl.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderMaskAddressServiceImpl.java delete mode 100644 ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderSkuServiceImpl.java create mode 100644 ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java create mode 100644 ms-biz/src/main/java/com/ms/biz/task/DoudianMsgParseTaskService.java rename ms-biz/src/main/java/com/ms/biz/util/{DdRequestUtil.java => DDApi.java} (85%) create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DdAftersaleMsg.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DdTradeMsg.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgBuffer.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgQueue.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianMsg.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianMsgParseQueue.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgBuffer.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgQueue.java create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrder.java rename ms-dal/src/main/java/com/ms/dal/entity/{PurchaseOrderAddress.java => PlatformPurchaseOrderAddress.java} (94%) rename ms-dal/src/main/java/com/ms/dal/entity/{PurchaseOrderMaskAddress.java => PlatformPurchaseOrderMaskAddress.java} (94%) rename ms-dal/src/main/java/com/ms/dal/entity/{PurchaseOrderSku.java => PlatformPurchaseOrderSku.java} (81%) create mode 100644 ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderItem.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DdAftersaleMsgMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DdTradeMsgMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgBufferMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgQueueMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgParseQueueMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgBufferMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgQueueMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderAddressMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMaskAddressMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderSkuMapper.java delete mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderAddressMapper.java create mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderItemMapper.java delete mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMaskAddressMapper.java delete mode 100644 ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderSkuMapper.java create mode 100644 ms-dal/src/main/resources/mapper/DdAftersaleMsgMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DdTradeMsgMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianAftersaleMsgBufferMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianAftersaleMsgQueueMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianMsgMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianMsgParseQueueMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianTradeMsgBufferMapper.xml create mode 100644 ms-dal/src/main/resources/mapper/DoudianTradeMsgQueueMapper.xml rename ms-dal/src/main/resources/mapper/{PurchaseOrderAddressMapper.xml => PlatformPurchaseOrderAddressMapper.xml} (93%) create mode 100644 ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMapper.xml rename ms-dal/src/main/resources/mapper/{PurchaseOrderMaskAddressMapper.xml => PlatformPurchaseOrderMaskAddressMapper.xml} (92%) rename ms-dal/src/main/resources/mapper/{PurchaseOrderSkuMapper.xml => PlatformPurchaseOrderSkuMapper.xml} (67%) create mode 100644 ms-dal/src/main/resources/mapper/PurchaseOrderItemMapper.xml diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetPurchaseOrderItemsAndSourceItemsResponseDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetPurchaseOrderItemsAndSourceItemsResponseDTO.java index 680bdf6..63ee10f 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetPurchaseOrderItemsAndSourceItemsResponseDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetPurchaseOrderItemsAndSourceItemsResponseDTO.java @@ -1,57 +1,22 @@ package com.ms.api.dto.dsapi.response; import lombok.Data; +import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.List; import java.util.Map; +@EqualsAndHashCode(callSuper = true) @Data public class GetPurchaseOrderItemsAndSourceItemsResponseDTO extends CommonResponseDTO { - private Map sourceItemIdAndProductInfoMap; + private Map sourceItemIdAndProductInfoMap; private Map sourceItemIdAndProductApiRetMap; private Map>> platformItemIdAndSourceItemSkuRelationMap; private Map> platformOrderIdAndPurchaseOrderItemsMap; private Map> platformOrderIdAndPurchaseOrdersMap; private Map platformItemIdAndSourceItemInfoMap; - - @Data - public static class ProductInfo implements Serializable { - private Long sourceItemId; - private String productType; - private String categoryName; - private String status; - private String title; - private String productUrl; - private List images; - private String instanceCode; - private Integer isJxhyOffer; - private String sellerLoginId; - private Long sellerId; - private String resourceOwner; - private List skus; - private EncryptLogisticsOrderSupportChannel encryptLogisticsOrderSupportChannel; - private Map platformSkuIdAndSourceSkuInfoMap; - private Map platformSkuIdAndSourceSkuIdMap; - } - - @Data - public static class Sku implements Serializable { - private Long sourceSkuId; - private String specId; - private Double retailPrice; - private Double price; - private Double consignPrice; - private String img; - private String skuSubName; - private Long sourceItemId; - private Integer stock; - private String instanceCode; - private Integer isJxhyOffer; - private Double jxhyPrice; - } - @Data public static class SourceItemSkuRelation implements Serializable { private Integer moveProductManualSourceSkuRelationId; @@ -164,13 +129,8 @@ public class GetPurchaseOrderItemsAndSourceItemsResponseDTO extends CommonRespon @Data public static class SourceItemInfo implements Serializable { - private ProductInfo productInfo; + private SourceProductInfo productInfo; private Long sourceItemId; private CommonResponseDTO productApiRet; } - - @Data - public static class EncryptLogisticsOrderSupportChannel implements Serializable { - private List supportChannels; - } } diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetSourceItemInfosResponseDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetSourceItemInfosResponseDTO.java new file mode 100644 index 0000000..918f9ba --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/GetSourceItemInfosResponseDTO.java @@ -0,0 +1,13 @@ +package com.ms.api.dto.dsapi.response; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Map; + +@EqualsAndHashCode(callSuper = true) +@Data +public class GetSourceItemInfosResponseDTO extends CommonResponseDTO{ + private Map sourceItemIdAndProductInfoMap; + private Map sourceItemIdAndProductApiRetMap; +} diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceItemRelation.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceItemRelation.java new file mode 100644 index 0000000..499c122 --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceItemRelation.java @@ -0,0 +1,10 @@ +package com.ms.api.dto.dsapi.response; + +import lombok.Data; + +@Data +public class SourceItemRelation { + private String sourceItemId; + private Long productId; + private String title; +} diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceProductInfo.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceProductInfo.java new file mode 100644 index 0000000..413beda --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceProductInfo.java @@ -0,0 +1,32 @@ +package com.ms.api.dto.dsapi.response; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +@Data +public class SourceProductInfo { + private Long sourceItemId; + private String productType; + private String categoryName; + private String status; + private String title; + private String productUrl; + private List images; + private String instanceCode; + private Integer isJxhyOffer; + private String sellerLoginId; + private Long sellerId; + private String resourceOwner; + private List skus; + private EncryptLogisticsOrderSupportChannel encryptLogisticsOrderSupportChannel; + private Map platformSkuIdAndSourceSkuIdMap; + + @Data + public static class EncryptLogisticsOrderSupportChannel implements Serializable { + private List supportChannels; + } +} + diff --git a/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceSkuInfo.java b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceSkuInfo.java new file mode 100644 index 0000000..2521cb5 --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/dsapi/response/SourceSkuInfo.java @@ -0,0 +1,19 @@ +package com.ms.api.dto.dsapi.response; + +import lombok.Data; + +@Data +public class SourceSkuInfo { + private Long sourceSkuId; + private String specId; + private Double retailPrice; + private Double price; + private Double consignPrice; + private String img; + private String skuSubName; + private Long sourceItemId; + private Integer stock; + private String instanceCode; + private Integer isJxhyOffer; + private Double jxhyPrice; +} diff --git a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderCancelMessageDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderCancelMessageDTO.java index fa5252e..90a6980 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderCancelMessageDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderCancelMessageDTO.java @@ -1,10 +1,12 @@ package com.ms.api.dto.dsorder; import lombok.Data; +import lombok.EqualsAndHashCode; import java.io.Serializable; import java.util.List; +@EqualsAndHashCode(callSuper = true) @Data public class PurchaseOrderCancelMessageDTO extends DsMessageDTO { private String skuId; diff --git a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderChangeMessageDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderChangeMessageDTO.java index ca66e4b..5bc610d 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderChangeMessageDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderChangeMessageDTO.java @@ -1,7 +1,9 @@ package com.ms.api.dto.dsorder; import lombok.Data; +import lombok.EqualsAndHashCode; +@EqualsAndHashCode(callSuper = true) @Data public class PurchaseOrderChangeMessageDTO extends DsMessageDTO { private PurchaseOrderDTO purchaseOrderInfo; diff --git a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderDTO.java index 30f9e30..bafd698 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderDTO.java @@ -38,6 +38,7 @@ public class PurchaseOrderDTO { private Integer isSupportEncryptOrder; private List mergePurchasePlatformOrderIds; private String notFirst1688OrderType; + private Map refundInfo; public List getSkuIds() { List skuIds = new ArrayList<>(); diff --git a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderRelateMessageDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderRelateMessageDTO.java index 94d2757..1e7982c 100644 --- a/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderRelateMessageDTO.java +++ b/ms-api/src/main/java/com/ms/api/dto/dsorder/PurchaseOrderRelateMessageDTO.java @@ -1,7 +1,9 @@ package com.ms.api.dto.dsorder; import lombok.Data; +import lombok.EqualsAndHashCode; +@EqualsAndHashCode(callSuper = true) @Data public class PurchaseOrderRelateMessageDTO extends DsMessageDTO { private PurchaseOrderDTO purchaseOrderInfo; diff --git a/ms-api/src/main/java/com/ms/api/dto/dsorder/RefundInfoDTO.java b/ms-api/src/main/java/com/ms/api/dto/dsorder/RefundInfoDTO.java new file mode 100644 index 0000000..0ac2839 --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/dsorder/RefundInfoDTO.java @@ -0,0 +1,18 @@ +package com.ms.api.dto.dsorder; + +import lombok.Data; + +import java.util.Date; + +@Data +public class RefundInfoDTO { + private String refundId; + private String status; + private String refundStatus; + private Date gmtTimeOut; + private String rejectReason; + private String sellerMobile; + private String sellerRealName; + private String sellerReceiveAddress; + private String sellerTel; +} diff --git a/ms-biz/src/main/java/com/ms/biz/bo/MatchSourceSkuInfoResultBO.java b/ms-biz/src/main/java/com/ms/biz/bo/MatchSourceSkuInfoResultBO.java index 050b849..65457a1 100644 --- a/ms-biz/src/main/java/com/ms/biz/bo/MatchSourceSkuInfoResultBO.java +++ b/ms-biz/src/main/java/com/ms/biz/bo/MatchSourceSkuInfoResultBO.java @@ -1,12 +1,13 @@ package com.ms.biz.bo; import com.ms.api.dto.dsapi.response.GetPurchaseOrderItemsAndSourceItemsResponseDTO; +import com.ms.api.dto.dsapi.response.SourceSkuInfo; import lombok.Data; import java.util.Map; @Data public class MatchSourceSkuInfoResultBO { - private Map platformSkuIdAndMatchSourceSkuInfoMap; + private Map platformSkuIdAndMatchSourceSkuInfoMap; private Map platformSkuIdAndMatchFailSkuInfoMap; } diff --git a/ms-biz/src/main/java/com/ms/biz/consts/CommonConst.java b/ms-biz/src/main/java/com/ms/biz/consts/CommonConst.java index b59d5c0..b08b6c9 100644 --- a/ms-biz/src/main/java/com/ms/biz/consts/CommonConst.java +++ b/ms-biz/src/main/java/com/ms/biz/consts/CommonConst.java @@ -6,7 +6,7 @@ import java.util.List; public class CommonConst { public static final String SUCCESS = "success"; public static final String FAIL = "fail"; - public static final String PLATFORM = "ddmicroapp"; + public static final String PLATFORM = "ddsupplycenter"; public static final String BIZ_MOVE = "move"; public static final int MATERIAL_AUDIT_STATUS_QUEUE_MAX_CNT = 5000; public static final String COLLECT_TASK_SOURCE_1688 = "1688"; diff --git a/ms-biz/src/main/java/com/ms/biz/consts/Refund1688Const.java b/ms-biz/src/main/java/com/ms/biz/consts/Refund1688Const.java new file mode 100644 index 0000000..98ba59f --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/consts/Refund1688Const.java @@ -0,0 +1,18 @@ +package com.ms.biz.consts; + +import java.util.HashMap; +import java.util.Map; + +public class Refund1688Const { + public static final String REFUND_STATUS_WAIT_SELLER_AGREE = "waitselleragree"; + + public static final String REFUND_STATUS_REFUND_SUCCESS = "refundsuccess"; + + public static final String REFUND_STATUS_REFUND_CLOSE = "refundclose"; + + public static final String REFUND_STATUS_WAIT_BUYER_MODIFY = "waitbuyermodify"; + + public static final String REFUND_STATUS_WAIT_BUYER_SEND = "waitbuyersend"; + + public static final String REFUND_STATUS_WAIT_BUYER_RECEIVE = "waitsellerreceive"; +} diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/Address.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/Address.java index 285ccdb..63d3c23 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/Address.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/Address.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.request; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchCreateParam.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchCreateParam.java index 0339bcb..54f8d1c 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchCreateParam.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchCreateParam.java @@ -1,5 +1,6 @@ package com.ms.biz.dto.openspi.request; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.util.List; @@ -7,5 +8,7 @@ import java.util.List; @Data public class BatchCreateParam { private List orders; + + @SerializedName("shop_id") private Long shopId; } diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchPayParam.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchPayParam.java index ae12348..87715d4 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchPayParam.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/BatchPayParam.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.request; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/CreateOrder.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/CreateOrder.java index 3b8cc5c..f27385c 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/CreateOrder.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/CreateOrder.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.request; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.util.List; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/QuerySupplyPlatformAuthParam.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/QuerySupplyPlatformAuthParam.java index 2c9043d..bf08d2c 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/QuerySupplyPlatformAuthParam.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/QuerySupplyPlatformAuthParam.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.request; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; @Data diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/SkuOrder.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/SkuOrder.java index e169be6..3a12381 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/SkuOrder.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/request/SkuOrder.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.request; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; @Data @@ -11,6 +11,12 @@ public class SkuOrder { @SerializedName("sku_order_id") private String skuOrderId; + @SerializedName("outer_product_id") + private String outerProductId; + + @SerializedName("outer_sku_id") + private String outerSkuId; + @SerializedName("cargo_id") private Long cargoId; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchCreateData.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchCreateData.java index b3d8f54..0b871cd 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchCreateData.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchCreateData.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.response; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.util.List; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchPayData.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchPayData.java index 2faea90..314e56b 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchPayData.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/BatchPayData.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.response; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.util.List; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/OrderResult.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/OrderResult.java index e85750e..0e49f09 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/OrderResult.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/OrderResult.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.response; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/PaymentResult.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/PaymentResult.java index 0f4f579..00d807a 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/PaymentResult.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/PaymentResult.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.response; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; import java.io.Serializable; diff --git a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/QuerySupplyPlatformAuthData.java b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/QuerySupplyPlatformAuthData.java index c618481..d3b53ac 100644 --- a/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/QuerySupplyPlatformAuthData.java +++ b/ms-biz/src/main/java/com/ms/biz/dto/openspi/response/QuerySupplyPlatformAuthData.java @@ -1,6 +1,6 @@ package com.ms.biz.dto.openspi.response; -import com.google.gson.annotations.SerializedName; +import com.doudian.open.gson.annotations.SerializedName; import lombok.Data; @Data diff --git a/ms-biz/src/main/java/com/ms/biz/service/DdAftersaleMsgService.java b/ms-biz/src/main/java/com/ms/biz/service/DdAftersaleMsgService.java new file mode 100644 index 0000000..b1fdf1c --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DdAftersaleMsgService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DdAftersaleMsg; + +/** + * + */ +public interface DdAftersaleMsgService { + + int deleteByPrimaryKey(Long id); + + int insert(DdAftersaleMsg record); + + int insertSelective(DdAftersaleMsg record); + + DdAftersaleMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DdAftersaleMsg record); + + int updateByPrimaryKey(DdAftersaleMsg record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DdTradeMsgService.java b/ms-biz/src/main/java/com/ms/biz/service/DdTradeMsgService.java new file mode 100644 index 0000000..a62e3be --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DdTradeMsgService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DdTradeMsg; + +/** + * + */ +public interface DdTradeMsgService { + + int deleteByPrimaryKey(Long id); + + int insert(DdTradeMsg record); + + int insertSelective(DdTradeMsg record); + + DdTradeMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DdTradeMsg record); + + int updateByPrimaryKey(DdTradeMsg record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgBufferService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgBufferService.java new file mode 100644 index 0000000..b38bc9f --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgBufferService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianAftersaleMsgBuffer; + +/** + * + */ +public interface DoudianAftersaleMsgBufferService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianAftersaleMsgBuffer record); + + int insertSelective(DoudianAftersaleMsgBuffer record); + + DoudianAftersaleMsgBuffer selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianAftersaleMsgBuffer record); + + int updateByPrimaryKey(DoudianAftersaleMsgBuffer record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgQueueService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgQueueService.java new file mode 100644 index 0000000..8713a2d --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianAftersaleMsgQueueService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianAftersaleMsgQueue; + +/** + * + */ +public interface DoudianAftersaleMsgQueueService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianAftersaleMsgQueue record); + + int insertSelective(DoudianAftersaleMsgQueue record); + + DoudianAftersaleMsgQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianAftersaleMsgQueue record); + + int updateByPrimaryKey(DoudianAftersaleMsgQueue record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgParseQueueService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgParseQueueService.java new file mode 100644 index 0000000..3b09aee --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgParseQueueService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianMsgParseQueue; + +/** + * + */ +public interface DoudianMsgParseQueueService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianMsgParseQueue record); + + int insertSelective(DoudianMsgParseQueue record); + + DoudianMsgParseQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianMsgParseQueue record); + + int updateByPrimaryKey(DoudianMsgParseQueue record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgService.java new file mode 100644 index 0000000..860971a --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianMsgService.java @@ -0,0 +1,32 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianMsg; +import com.ms.dal.entity.DoudianMsgParseQueue; + +/** + * + */ +public interface DoudianMsgService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianMsg record); + + int insertSelective(DoudianMsg record); + + DoudianMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianMsg record); + + int updateByPrimaryKey(DoudianMsg record); + + boolean addDoudianMsg(String msgBody); + + DoudianMsgParseQueue lockDoudianMsgParseQueue(); + + boolean processDoudianMsgParseQueue(Long doudianMsgId); + + void failProcessDoudianMsgParseQueue(Long doudianMsgId); + + boolean deleteDoudianMsgParseQueue(Long doudianMsgId); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgBufferService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgBufferService.java new file mode 100644 index 0000000..26ea4c6 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgBufferService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianTradeMsgBuffer; + +/** + * + */ +public interface DoudianTradeMsgBufferService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianTradeMsgBuffer record); + + int insertSelective(DoudianTradeMsgBuffer record); + + DoudianTradeMsgBuffer selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianTradeMsgBuffer record); + + int updateByPrimaryKey(DoudianTradeMsgBuffer record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgQueueService.java b/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgQueueService.java new file mode 100644 index 0000000..bff0881 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/DoudianTradeMsgQueueService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.DoudianTradeMsgQueue; + +/** + * + */ +public interface DoudianTradeMsgQueueService { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianTradeMsgQueue record); + + int insertSelective(DoudianTradeMsgQueue record); + + DoudianTradeMsgQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianTradeMsgQueue record); + + int updateByPrimaryKey(DoudianTradeMsgQueue record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java b/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java index b338aa4..c549d76 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java +++ b/ms-biz/src/main/java/com/ms/biz/service/DsApiService.java @@ -22,4 +22,5 @@ public interface DsApiService { CommonResponseDTO cancelPurchaseOrder(String platform, Long shopId, String orderId, String purchaseOrderSn); GetPurchaseOrderPayUrlResponseDTO getPurchaseOrderPayUrl(List sourceOrderId, Long shopId); GetPlatformAuthUrlResponseDTO getPlatformAuthUrl(ShopBO shopBO); + GetSourceItemInfosResponseDTO getSourceItemInfos(Long shopId, List sourceItemIds); } diff --git a/ms-biz/src/main/java/com/ms/biz/service/DsMessageService.java b/ms-biz/src/main/java/com/ms/biz/service/DsMessageService.java index 6572b01..5aa8811 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/DsMessageService.java +++ b/ms-biz/src/main/java/com/ms/biz/service/DsMessageService.java @@ -34,4 +34,6 @@ public interface DsMessageService { void addDsMessage(Long shopId, Long platformPushMsgId, String bizId, String bizType, String data); void clearDsMessageQueue(DsMessageConsumerQueue queue, ResultDTO result); + + void processDsMessage(Long dsMessageId); } diff --git a/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderAddressService.java b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderAddressService.java new file mode 100644 index 0000000..6cbd950 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderAddressService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.PlatformPurchaseOrderAddress; + +/** + * + */ +public interface PlatformPurchaseOrderAddressService { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderAddress record); + + int insertSelective(PlatformPurchaseOrderAddress record); + + PlatformPurchaseOrderAddress selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderAddress record); + + int updateByPrimaryKey(PlatformPurchaseOrderAddress record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderMaskAddressService.java b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderMaskAddressService.java new file mode 100644 index 0000000..2408f31 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderMaskAddressService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.PlatformPurchaseOrderMaskAddress; + +/** + * + */ +public interface PlatformPurchaseOrderMaskAddressService { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderMaskAddress record); + + int insertSelective(PlatformPurchaseOrderMaskAddress record); + + PlatformPurchaseOrderMaskAddress selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderMaskAddress record); + + int updateByPrimaryKey(PlatformPurchaseOrderMaskAddress record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderService.java b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderService.java new file mode 100644 index 0000000..fcea7cf --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.PlatformPurchaseOrder; + +/** + * + */ +public interface PlatformPurchaseOrderService { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrder record); + + int insertSelective(PlatformPurchaseOrder record); + + PlatformPurchaseOrder selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrder record); + + int updateByPrimaryKey(PlatformPurchaseOrder record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderSkuService.java b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderSkuService.java new file mode 100644 index 0000000..37c176b --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/PlatformPurchaseOrderSkuService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.PlatformPurchaseOrderSku; + +/** + * + */ +public interface PlatformPurchaseOrderSkuService { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderSku record); + + int insertSelective(PlatformPurchaseOrderSku record); + + PlatformPurchaseOrderSku selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderSku record); + + int updateByPrimaryKey(PlatformPurchaseOrderSku record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderAddressService.java b/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderAddressService.java deleted file mode 100644 index 30d5b4b..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderAddressService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ms.biz.service; - -import com.ms.dal.entity.PurchaseOrderAddress; - -/** - * - */ -public interface PurchaseOrderAddressService { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderAddress record); - - int insertSelective(PurchaseOrderAddress record); - - PurchaseOrderAddress selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderAddress record); - - int updateByPrimaryKey(PurchaseOrderAddress record); -} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderItemService.java b/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderItemService.java new file mode 100644 index 0000000..62b299d --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderItemService.java @@ -0,0 +1,21 @@ +package com.ms.biz.service; + +import com.ms.dal.entity.PurchaseOrderItem; + +/** + * + */ +public interface PurchaseOrderItemService { + + int deleteByPrimaryKey(Long id); + + int insert(PurchaseOrderItem record); + + int insertSelective(PurchaseOrderItem record); + + PurchaseOrderItem selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(PurchaseOrderItem record); + + int updateByPrimaryKey(PurchaseOrderItem record); +} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderMaskAddressService.java b/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderMaskAddressService.java deleted file mode 100644 index 4f99749..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderMaskAddressService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ms.biz.service; - -import com.ms.dal.entity.PurchaseOrderMaskAddress; - -/** - * - */ -public interface PurchaseOrderMaskAddressService { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderMaskAddress record); - - int insertSelective(PurchaseOrderMaskAddress record); - - PurchaseOrderMaskAddress selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderMaskAddress record); - - int updateByPrimaryKey(PurchaseOrderMaskAddress record); -} diff --git a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderSkuService.java b/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderSkuService.java deleted file mode 100644 index a4b5aa6..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/PurchaseOrderSkuService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ms.biz.service; - -import com.ms.dal.entity.PurchaseOrderSku; - -/** - * - */ -public interface PurchaseOrderSkuService { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderSku record); - - int insertSelective(PurchaseOrderSku record); - - PurchaseOrderSku selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderSku record); - - int updateByPrimaryKey(PurchaseOrderSku record); -} diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DdAftersaleMsgServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DdAftersaleMsgServiceImpl.java new file mode 100644 index 0000000..80e5dc0 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DdAftersaleMsgServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DdAftersaleMsg; +import com.ms.biz.service.DdAftersaleMsgService; +import com.ms.dal.mapper.DdAftersaleMsgMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DdAftersaleMsgServiceImpl implements DdAftersaleMsgService{ + + @Autowired + private DdAftersaleMsgMapper ddAftersaleMsgMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return ddAftersaleMsgMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DdAftersaleMsg record) { + return ddAftersaleMsgMapper.insert(record); + } + + @Override + public int insertSelective(DdAftersaleMsg record) { + return ddAftersaleMsgMapper.insertSelective(record); + } + + @Override + public DdAftersaleMsg selectByPrimaryKey(Long id) { + return ddAftersaleMsgMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DdAftersaleMsg record) { + return ddAftersaleMsgMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DdAftersaleMsg record) { + return ddAftersaleMsgMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DdTradeMsgServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DdTradeMsgServiceImpl.java new file mode 100644 index 0000000..29ba012 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DdTradeMsgServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DdTradeMsg; +import com.ms.biz.service.DdTradeMsgService; +import com.ms.dal.mapper.DdTradeMsgMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DdTradeMsgServiceImpl implements DdTradeMsgService{ + + @Autowired + private DdTradeMsgMapper ddTradeMsgMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return ddTradeMsgMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DdTradeMsg record) { + return ddTradeMsgMapper.insert(record); + } + + @Override + public int insertSelective(DdTradeMsg record) { + return ddTradeMsgMapper.insertSelective(record); + } + + @Override + public DdTradeMsg selectByPrimaryKey(Long id) { + return ddTradeMsgMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DdTradeMsg record) { + return ddTradeMsgMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DdTradeMsg record) { + return ddTradeMsgMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java index 652a80e..e3ec15c 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DistributionOrderServiceImpl.java @@ -1,12 +1,16 @@ package com.ms.biz.service.impl; +import com.doudian.open.api.supplyCenter_cargo_detail.data.SpecPricesItem; +import com.doudian.open.api.supplyCenter_cargo_detail.data.SupplyCenterCargoDetailData; +import com.doudian.open.api.supplyCenter_cargo_detail.param.SupplyCenterCargoDetailParam; import com.ms.api.dto.dsapi.request.*; -import com.ms.api.dto.dsapi.response.BatchCreateDistributionOrdersResponseDTO; -import com.ms.api.dto.dsapi.response.DsSuccessRetDTO; -import com.ms.api.dto.dsapi.response.GetPurchaseOrderPayUrlResponseDTO; +import com.ms.api.dto.dsapi.response.*; import com.ms.api.dto.dsorder.PurchaseOrderDTO; import com.ms.api.dto.dsorder.PurchaseOrderItemDTO; import com.ms.biz.consts.CommonConst; +import com.ms.biz.consts.DsOrderConst; +import com.ms.biz.consts.PurchaseOrderConst; +import com.ms.biz.consts.StatusConst; import com.ms.biz.dto.openspi.request.*; import com.ms.biz.dto.openspi.response.BatchCreateData; import com.ms.biz.dto.openspi.response.BatchPayData; @@ -14,22 +18,20 @@ import com.ms.biz.dto.openspi.response.OrderResult; import com.ms.biz.dto.openspi.response.PaymentResult; import com.ms.biz.service.DistributionOrderService; import com.ms.biz.service.DsApiService; -import com.ms.dal.entity.PurchaseOrder; -import com.ms.dal.entity.PurchaseOrderAddress; -import com.ms.dal.entity.PurchaseOrderMaskAddress; -import com.ms.dal.entity.PurchaseOrderSku; -import com.ms.dal.mapper.PurchaseOrderAddressMapper; -import com.ms.dal.mapper.PurchaseOrderMapper; -import com.ms.dal.mapper.PurchaseOrderMaskAddressMapper; -import com.ms.dal.mapper.PurchaseOrderSkuMapper; +import com.ms.biz.util.DDApi; +import com.ms.dal.entity.*; +import com.ms.dal.mapper.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.stereotype.Service; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionStatus; +import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; @Service @Slf4j @@ -38,127 +40,274 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { private final DataSourceTransactionManager dataSourceTransactionManager; private final TransactionDefinition transactionDefinition; + private PlatformPurchaseOrderMapper platformPurchaseOrderMapper; + private PlatformPurchaseOrderSkuMapper platformPurchaseOrderSkuMapper; + private PlatformPurchaseOrderAddressMapper platformPurchaseOrderAddressMapper; + private PlatformPurchaseOrderMaskAddressMapper platformPurchaseOrderMaskAddressMapper; private PurchaseOrderMapper purchaseOrderMapper; - private PurchaseOrderSkuMapper purchaseOrderSkuMapper; - private PurchaseOrderAddressMapper purchaseOrderAddressMapper; - private PurchaseOrderMaskAddressMapper purchaseOrderMaskAddressMapper; + private PurchaseOrderItemMapper purchaseOrderItemMapper; private DsApiService dsApiService; @Override public void batchCreate(BatchCreateParam param, BatchCreateData data) { + System.out.println("param: " + param); if (param.getOrders().size() > 1) { throw new RuntimeException("目前暂不支持多单采购"); } Long shopId = param.getShopId(); + + Map orderIdAndPurOrderIdMap = new HashMap<>(); + Map skuIdAndPurSkuOrderIdMap = new HashMap<>(); + for (CreateOrder order: param.getOrders()) { + orderIdAndPurOrderIdMap.put(order.getOrderId(), order.getPurOrderId()); + for (SkuOrder skuOrder: order.getSkuOrders()) { + skuIdAndPurSkuOrderIdMap.put(skuOrder.getSkuId(), skuOrder.getPurSkuOrderId()); + } + } + + Set purOrderIds = new HashSet<>(orderIdAndPurOrderIdMap.values()); + List existsPlatformPurchaseOrders = platformPurchaseOrderMapper.getListByPurOrderIds(new ArrayList<>(purOrderIds)); + Set existsPurOrderIds = existsPlatformPurchaseOrders.stream().map(PlatformPurchaseOrder::getPurOrderId).collect(Collectors.toSet()); + if (!existsPurOrderIds.isEmpty()) { + throw new RuntimeException("已经存在采购单号:" + String.join(",", existsPurOrderIds)); + } + storeCreateOrders(shopId, param.getOrders()); + BatchCreateDistributionOrdersRequestDTO request = buildBatchCreateDistributionOrdersRequestDTO(param); BatchCreateDistributionOrdersResponseDTO response = dsApiService.batchCreateDistributionOrders(param.getShopId(), request); List orderResults = new ArrayList<>(); + List purchaseOrders = new ArrayList<>(); + List purchaseOrderItems = new ArrayList<>(); for (DsSuccessRetDTO successRet: response.getSuccessList()) { - for (PurchaseOrderDTO purchaseOrder: successRet.getRelatePurchaseOrderInfos()) { - OrderResult orderResult = new OrderResult(); - orderResult.setOutPreOrderId(purchaseOrder.getPurchaseOrderSn()); - orderResult.setPurOrderId(purchaseOrder.getPlatformOrderId()); - orderResult.setSupplierOrderId(purchaseOrder.getPurchaseOrderSn()); - orderResult.setSupplierOrderUrl(null); - - List skuOrderResults = new ArrayList<>(); - for (PurchaseOrderItemDTO item: purchaseOrder.getItems()) { - OrderResult.SkuOrderResult skuOrderResult = new OrderResult.SkuOrderResult(); - skuOrderResult.setPurSkuOrderId(""); - skuOrderResult.setSupplierSkuOrderId(""); - skuOrderResults.add(skuOrderResult); - } - orderResult.setSkuOrderResults(skuOrderResults); + for (PurchaseOrderDTO purchaseOrderDTO: successRet.getRelatePurchaseOrderInfos()) { + String purOrderId = orderIdAndPurOrderIdMap.get(purchaseOrderDTO.getPlatformOrderId()); + PurchaseOrder purchaseOrder = buildPurchaseOrderByDTO(purchaseOrderDTO, purOrderId); + purchaseOrders.add(purchaseOrder); + List items = buildPurchaseOrderItemsByPurchaseOrderDTO(purchaseOrderDTO, purOrderId); + purchaseOrderItems.addAll(items); + OrderResult orderResult = buildOrderResult(purchaseOrderDTO, orderIdAndPurOrderIdMap, skuIdAndPurSkuOrderIdMap); orderResults.add(orderResult); } } data.setOrderResults(orderResults); + + purchaseOrderItemMapper.insertBatch(purchaseOrderItems); + purchaseOrderMapper.insertBatch(purchaseOrders); + } + + private PurchaseOrder buildPurchaseOrderByDTO(PurchaseOrderDTO purchaseOrderDTO, String purOrderId) { + Date purchaseOrderSendTime = null; + Date purchaseOrderStartTime = null; + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + if (StringUtils.isNotBlank(purchaseOrderDTO.getPurchaseOrderStartTime())) { + purchaseOrderStartTime = dateFormat.parse(purchaseOrderDTO.getPurchaseOrderStartTime()); + } + if (StringUtils.isNotBlank(purchaseOrderDTO.getPurchaseOrderSendTime())) { + purchaseOrderSendTime = dateFormat.parse(purchaseOrderDTO.getPurchaseOrderSendTime()); + } + } catch (java.text.ParseException e) { + throw new RuntimeException("时间格式错误"); + } + + PurchaseOrder purchaseOrder = new PurchaseOrder(); + purchaseOrder.setPurOrderId(purOrderId); + purchaseOrder.setOrderId(Long.valueOf(purchaseOrderDTO.getPlatformOrderId())); + purchaseOrder.setPurchasePlatform(purchaseOrderDTO.getPurchasePlatform()); + purchaseOrder.setPurchaseOrderStatus(purchaseOrderDTO.getPurchaseOrderStatus()); + purchaseOrder.setPurchaseOrderSendTime(purchaseOrderSendTime); + purchaseOrder.setPurchaseOrderStartTime(purchaseOrderStartTime); + purchaseOrder.setPurchaseOrderBuyer(purchaseOrderDTO.getPurchaseOrderBuyer()); + purchaseOrder.setPurchaseOrderSeller(purchaseOrderDTO.getPurchaseOrderSeller()); + purchaseOrder.setLogisticsIsAccept(purchaseOrderDTO.getLogisticsIsAccept()); + purchaseOrder.setPurchaseOrderFullAddress(purchaseOrderDTO.getPurchaseOrderFullAddress()); + purchaseOrder.setPurchaseOrderMobile(purchaseOrderDTO.getPurchaseOrderMobile()); + purchaseOrder.setPurchaseOrderFullname(purchaseOrderDTO.getPurchaseOrderFullname()); + purchaseOrder.setPurchaseOrderSn(purchaseOrderDTO.getPurchaseOrderSn()); + purchaseOrder.setPurchaseOrderLogisticsName(purchaseOrderDTO.getPurchaseOrderLogisticsName()); + purchaseOrder.setPurchaseOrderWaybillCode(purchaseOrderDTO.getPurchaseOrderWaybillCode()); + purchaseOrder.setStatus(StatusConst.normal); + purchaseOrder.setGmtCreate(new Date()); + purchaseOrder.setGmtModified(new Date()); + return purchaseOrder; + } + + private List buildPurchaseOrderItemsByPurchaseOrderDTO(PurchaseOrderDTO purchaseOrderDTO, String purOrderId) { + List items = new ArrayList<>(); + for (PurchaseOrderItemDTO itemDTO: purchaseOrderDTO.getItems()) { + PurchaseOrderItem item = new PurchaseOrderItem(); + item.setPurOrderId(purOrderId); + item.setOrderId(Long.valueOf(purchaseOrderDTO.getPlatformOrderId())); + item.setPurchaseNum(itemDTO.getPurchaseNum()); + item.setSkuId(itemDTO.getSkuId()); + item.setWareId(itemDTO.getWareId()); + item.setPurchaseUrl(itemDTO.getPurchaseUrl()); + item.setStatus(StatusConst.normal); + item.setGmtCreate(new Date()); + item.setGmtModified(new Date()); + items.add(item); + } + return items; + } + + private Map> getSkuAndProductOfSourceMap(List productIds) { + List hadGetProductIds = new ArrayList<>(); + Map skuIdAndOutSkuIdMap = new HashMap<>(); + Map productIdAndOutProductIdMap = new HashMap<>(); + for (Long productId: productIds) { + if (hadGetProductIds.contains(productId)) { + continue; + } + SupplyCenterCargoDetailParam supplyCenterCargoDetailParam = new SupplyCenterCargoDetailParam(); + supplyCenterCargoDetailParam.setProductId(productId.toString()); + SupplyCenterCargoDetailData supplyCenterCargoDetailData = DDApi.supplyCenterCargoDetail(supplyCenterCargoDetailParam); + productIdAndOutProductIdMap.put(productId, supplyCenterCargoDetailData.getOuterProductId()); + for (SpecPricesItem item: supplyCenterCargoDetailData.getSpecPrices()) { + skuIdAndOutSkuIdMap.put(item.getSkuId(), item.getOuterSkuId()); + } + hadGetProductIds.add(productId); + } + Map> result = new HashMap<>(); + result.put("skuIdAndOutSkuIdMap", skuIdAndOutSkuIdMap); + result.put("productIdAndOutProductIdMap", productIdAndOutProductIdMap); + return result; + } + + private Map getProductIdAndSourceProductInfoMap(Long shopId, Map productIdAndOutProductIdMap) { + List sourceItemIds = new ArrayList<>(productIdAndOutProductIdMap.values()); + GetSourceItemInfosResponseDTO sourceItemInfosResp = dsApiService.getSourceItemInfos(shopId, sourceItemIds); + if (!sourceItemInfosResp.isSuccess()) { + throw new RuntimeException(sourceItemInfosResp.getReason()); + } + List errorList = new ArrayList<>(); + for (Map.Entry entry: sourceItemInfosResp.getSourceItemIdAndProductApiRetMap().entrySet()) { + errorList.add(entry.getValue().getReason()); + } + if (!errorList.isEmpty()) { + throw new RuntimeException(String.join(" / ", errorList)); + } + + Map productIdAndSourceProductInfoMap = new HashMap<>(); + for (Map.Entry entry : productIdAndOutProductIdMap.entrySet()) { + SourceProductInfo sourceProductInfo = sourceItemInfosResp.getSourceItemIdAndProductInfoMap().get(entry.getValue()); + productIdAndSourceProductInfoMap.put(entry.getKey(), sourceProductInfo); + } + return productIdAndSourceProductInfoMap; + } + + private OrderResult buildOrderResult(PurchaseOrderDTO purchaseOrder, Map orderIdAndPurOrderIdMap, Map skuIdAndPurSkuOrderIdMap) { + OrderResult orderResult = new OrderResult(); + orderResult.setOutPreOrderId(""); // TODO 无此参数 + orderResult.setPurOrderId(orderIdAndPurOrderIdMap.get(purchaseOrder.getPlatformOrderId())); + orderResult.setSupplierOrderId(purchaseOrder.getPurchaseOrderSn()); + orderResult.setSupplierOrderUrl(null); + + List skuOrderResults = new ArrayList<>(); + for (PurchaseOrderItemDTO item: purchaseOrder.getItems()) { + OrderResult.SkuOrderResult skuOrderResult = new OrderResult.SkuOrderResult(); + skuOrderResult.setPurSkuOrderId(skuIdAndPurSkuOrderIdMap.get(item.getSkuId())); + skuOrderResult.setSupplierSkuOrderId(""); // TODO 无此参数 + skuOrderResults.add(skuOrderResult); + } + orderResult.setSkuOrderResults(skuOrderResults); + return orderResult; } private void storeCreateOrders(Long shopId, List orders) { TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); try { for (CreateOrder order: orders) { - savePurchaseOrder(shopId, order); - savePurchaseOrderAddress(shopId, order.getPurOrderId(), order.getPostAddress()); - savePurchaseOrderMaskAddress(shopId, order.getPurOrderId(), order.getMaskPostAddress()); - savePurchaseOrderSku(shopId, order.getPurOrderId(), order.getSkuOrders()); + savePlatformPurchaseOrder(shopId, order); + savePlatformPurchaseOrderAddress(shopId, order.getPurOrderId(), order.getPostAddress()); + savePlatformPurchaseOrderMaskAddress(shopId, order.getPurOrderId(), order.getMaskPostAddress()); + savePlatformPurchaseOrderSku(shopId, order.getPurOrderId(), order.getSkuOrders()); } dataSourceTransactionManager.commit(transactionStatus); } catch (Throwable e) { + log.error("storeCreateOrders", e); dataSourceTransactionManager.rollback(transactionStatus); - throw new RuntimeException("数据保存异常"); + throw new RuntimeException("数据保存异常:" + e.getMessage()); } } - private PurchaseOrder savePurchaseOrder(Long shopId, CreateOrder order) { - PurchaseOrder purchaseOrder = new PurchaseOrder(); - purchaseOrder.setPurOrderId(order.getPurOrderId()); - purchaseOrder.setOrderId(order.getOrderId()); - purchaseOrder.setShopId(shopId); - purchaseOrder.setGmtModified(new Date()); - purchaseOrder.setGmtModified(new Date()); - purchaseOrderMapper.insertSelective(purchaseOrder); - return purchaseOrder; + private PlatformPurchaseOrder savePlatformPurchaseOrder(Long shopId, CreateOrder order) { + PlatformPurchaseOrder platformPurchaseOrder = new PlatformPurchaseOrder(); + platformPurchaseOrder.setPurOrderId(order.getPurOrderId()); + platformPurchaseOrder.setOrderId(order.getOrderId()); + platformPurchaseOrder.setShopId(shopId); + platformPurchaseOrder.setPurchaseStatus(PurchaseOrderConst.PURCHASE_ORDER_STATUS_WAIT_PAY); + platformPurchaseOrder.setStatus(StatusConst.normal); + platformPurchaseOrder.setGmtModified(new Date()); + platformPurchaseOrder.setGmtModified(new Date()); + platformPurchaseOrderMapper.insertSelective(platformPurchaseOrder); + return platformPurchaseOrder; } - private List savePurchaseOrderSku(Long shopId, String purOrderId, List skuOrders) { - List purchaseOrderSkus = new ArrayList<>(); + private List savePlatformPurchaseOrderSku(Long shopId, String purOrderId, List skuOrders) { + if (skuOrders.isEmpty()) { + return new ArrayList<>(); + } + List platformPurchaseOrderSkus = new ArrayList<>(); for (SkuOrder skuOrder: skuOrders) { - PurchaseOrderSku purchaseOrderSku = new PurchaseOrderSku(); - purchaseOrderSku.setPurOrderId(purOrderId); - purchaseOrderSku.setShopId(shopId); - purchaseOrderSku.setPurSkuOrderId(skuOrder.getPurSkuOrderId()); - purchaseOrderSku.setSkuId(skuOrder.getSkuId()); - purchaseOrderSku.setProductId(skuOrder.getProductId()); - purchaseOrderSku.setCargoId(skuOrder.getCargoId()); - purchaseOrderSku.setCargoSkuId(skuOrder.getCargoSkuId()); - purchaseOrderSku.setNum(skuOrder.getNum()); - purchaseOrderSku.setGmtModified(new Date()); - purchaseOrderSku.setGmtCreate(new Date()); + PlatformPurchaseOrderSku platformPurchaseOrderSku = new PlatformPurchaseOrderSku(); + platformPurchaseOrderSku.setPurOrderId(purOrderId); + platformPurchaseOrderSku.setShopId(shopId); + platformPurchaseOrderSku.setPurSkuOrderId(skuOrder.getPurSkuOrderId()); + platformPurchaseOrderSku.setOuterSkuId(skuOrder.getOuterSkuId()); + platformPurchaseOrderSku.setOuterProductId(skuOrder.getOuterProductId()); + platformPurchaseOrderSku.setSkuOrderId(skuOrder.getSkuOrderId()); + platformPurchaseOrderSku.setSkuId(skuOrder.getSkuId()); + platformPurchaseOrderSku.setProductId(skuOrder.getProductId()); + platformPurchaseOrderSku.setCargoId(skuOrder.getCargoId()); + platformPurchaseOrderSku.setCargoSkuId(skuOrder.getCargoSkuId()); + platformPurchaseOrderSku.setNum(skuOrder.getNum()); + platformPurchaseOrderSku.setGmtModified(new Date()); + platformPurchaseOrderSku.setGmtCreate(new Date()); + platformPurchaseOrderSkus.add(platformPurchaseOrderSku); } - purchaseOrderSkuMapper.insertBatch(purchaseOrderSkus); - return purchaseOrderSkus; + System.out.println("purchaseOrderSkus: " + platformPurchaseOrderSkus); + platformPurchaseOrderSkuMapper.insertBatch(platformPurchaseOrderSkus); + return platformPurchaseOrderSkus; } - private PurchaseOrderAddress savePurchaseOrderAddress(Long shopId, String purOrderId, Address address) { - PurchaseOrderAddress purchaseOrderAddress = new PurchaseOrderAddress(); - purchaseOrderAddress.setPurOrderId(purOrderId); - purchaseOrderAddress.setShopId(shopId); - purchaseOrderAddress.setProvinceId(address.getProvince().getId()); - purchaseOrderAddress.setProvinceName(address.getProvince().getName()); - purchaseOrderAddress.setCityId(address.getCity().getId()); - purchaseOrderAddress.setCityName(address.getCity().getName()); - purchaseOrderAddress.setTownId(address.getTown().getId()); - purchaseOrderAddress.setTownName(address.getTown().getName()); - purchaseOrderAddress.setEncryptDetail(address.getEncryptDetail()); - purchaseOrderAddress.setPostReceiver(address.getPostReceiver()); - purchaseOrderAddress.setPostTel(address.getPostTel()); - purchaseOrderAddress.setGmtCreate(new Date()); - purchaseOrderAddress.setGmtModified(new Date()); - purchaseOrderAddressMapper.insertSelective(purchaseOrderAddress); - return purchaseOrderAddress; + private PlatformPurchaseOrderAddress savePlatformPurchaseOrderAddress(Long shopId, String purOrderId, Address address) { + PlatformPurchaseOrderAddress platformPurchaseOrderAddress = new PlatformPurchaseOrderAddress(); + platformPurchaseOrderAddress.setPurOrderId(purOrderId); + platformPurchaseOrderAddress.setShopId(shopId); + platformPurchaseOrderAddress.setProvinceId(address.getProvince().getId()); + platformPurchaseOrderAddress.setProvinceName(address.getProvince().getName()); + platformPurchaseOrderAddress.setCityId(address.getCity().getId()); + platformPurchaseOrderAddress.setCityName(address.getCity().getName()); + platformPurchaseOrderAddress.setTownId(address.getTown().getId()); + platformPurchaseOrderAddress.setTownName(address.getTown().getName()); + platformPurchaseOrderAddress.setEncryptDetail(address.getEncryptDetail()); + platformPurchaseOrderAddress.setPostReceiver(address.getPostReceiver()); + platformPurchaseOrderAddress.setPostTel(address.getPostTel()); + platformPurchaseOrderAddress.setGmtCreate(new Date()); + platformPurchaseOrderAddress.setGmtModified(new Date()); + platformPurchaseOrderAddressMapper.insertSelective(platformPurchaseOrderAddress); + return platformPurchaseOrderAddress; } - private PurchaseOrderMaskAddress savePurchaseOrderMaskAddress(Long shopId, String purOrderId, Address address) { - PurchaseOrderMaskAddress purchaseOrderMaskAddress = new PurchaseOrderMaskAddress(); - purchaseOrderMaskAddress.setPurOrderId(purOrderId); - purchaseOrderMaskAddress.setShopId(shopId); - purchaseOrderMaskAddress.setProvinceId(address.getProvince().getId()); - purchaseOrderMaskAddress.setProvinceName(address.getProvince().getName()); - purchaseOrderMaskAddress.setCityId(address.getCity().getId()); - purchaseOrderMaskAddress.setCityName(address.getCity().getName()); - purchaseOrderMaskAddress.setTownId(address.getTown().getId()); - purchaseOrderMaskAddress.setTownName(address.getTown().getName()); - purchaseOrderMaskAddress.setDetail(address.getDetail()); - purchaseOrderMaskAddress.setPostReceiver(address.getPostReceiver()); - purchaseOrderMaskAddress.setPostTel(address.getPostTel()); - purchaseOrderMaskAddress.setGmtCreate(new Date()); - purchaseOrderMaskAddress.setGmtModified(new Date()); - purchaseOrderMaskAddressMapper.insertSelective(purchaseOrderMaskAddress); - return purchaseOrderMaskAddress; + private PlatformPurchaseOrderMaskAddress savePlatformPurchaseOrderMaskAddress(Long shopId, String purOrderId, Address address) { + PlatformPurchaseOrderMaskAddress platformPurchaseOrderMaskAddress = new PlatformPurchaseOrderMaskAddress(); + platformPurchaseOrderMaskAddress.setPurOrderId(purOrderId); + platformPurchaseOrderMaskAddress.setShopId(shopId); + platformPurchaseOrderMaskAddress.setProvinceId(address.getProvince().getId()); + platformPurchaseOrderMaskAddress.setProvinceName(address.getProvince().getName()); + platformPurchaseOrderMaskAddress.setCityId(address.getCity().getId()); + platformPurchaseOrderMaskAddress.setCityName(address.getCity().getName()); + platformPurchaseOrderMaskAddress.setTownId(address.getTown().getId()); + platformPurchaseOrderMaskAddress.setTownName(address.getTown().getName()); + platformPurchaseOrderMaskAddress.setDetail(address.getDetail()); + platformPurchaseOrderMaskAddress.setPostReceiver(address.getPostReceiver()); + platformPurchaseOrderMaskAddress.setPostTel(address.getPostTel()); + platformPurchaseOrderMaskAddress.setGmtCreate(new Date()); + platformPurchaseOrderMaskAddress.setGmtModified(new Date()); + platformPurchaseOrderMaskAddressMapper.insertSelective(platformPurchaseOrderMaskAddress); + return platformPurchaseOrderMaskAddress; } private ConsigneeInfoDTO buildConsigneeInfoDTO(Address address) { @@ -189,12 +338,12 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { return encryptOutOrderInfo; } - private PlatformOrderDTO buildPlatformOrderDTO(Long shopId, CreateOrder order) { + private PlatformOrderDTO buildPlatformOrderDTO(Long shopId, CreateOrder order, Map productIdAndSourceProductInfoMap, Map skuIdAndOutSkuIdMap) { ConsigneeInfoDTO consigneeInfo = buildConsigneeInfoDTO(order.getMaskPostAddress()); - EncryptOutOrderInfoDTO encryptOutOrderInfo = buildEncryptOutOrderInfoDTO(order.getPurOrderId(), order.getPostAddress()); + EncryptOutOrderInfoDTO encryptOutOrderInfo = buildEncryptOutOrderInfoDTO(order.getOrderId(), order.getPostAddress()); List items = new ArrayList<>(); for (SkuOrder skuOrder: order.getSkuOrders()) { - PlatformOrderItemDTO item = buildPlatformOrderItemDTO(order.getPurOrderId(), skuOrder); + PlatformOrderItemDTO item = buildPlatformOrderItemDTO(order.getOrderId(), skuOrder, productIdAndSourceProductInfoMap, skuIdAndOutSkuIdMap); items.add(item); } @@ -204,59 +353,93 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { platformOrder.setSourceOrderBuyerRemark(""); platformOrder.setSourceOrderSellerMemo(""); platformOrder.setBuyerRemark(""); - platformOrder.setUserId(""); + platformOrder.setUserId(shopId.toString()); platformOrder.setConsigneeInfo(consigneeInfo); platformOrder.setEncryptOutOrderInfo(encryptOutOrderInfo); platformOrder.setItems(items); return platformOrder; } - private PlatformOrderItemDTO buildPlatformOrderItemDTO(String orderId, SkuOrder skuOrder) { + private SourceSkuInfo getSourceSkuInfo(SkuOrder skuOrder, Map productIdAndSourceProductInfoMap, Map skuIdAndOutSkuIdMap) { + SourceProductInfo sourceProductInfo = productIdAndSourceProductInfoMap.get(skuOrder.getProductId()); + if (sourceProductInfo == null) { + throw new RuntimeException("未匹配到货源商品"); + } + SourceSkuInfo sourceSkuInfo = null; + String sourceSkuId = skuIdAndOutSkuIdMap.get(skuOrder.getSkuId()); + if (sourceSkuId == null) { + throw new RuntimeException("未匹配到货源SKU"); + } + for (SourceSkuInfo sku: sourceProductInfo.getSkus()) { + if (Objects.equals(sku.getSourceSkuId(), Long.valueOf(sourceSkuId))) { + sourceSkuInfo = sku; + } + } + return sourceSkuInfo; + } + + private PlatformOrderItemDTO buildPlatformOrderItemDTO(String orderId, SkuOrder skuOrder, Map productIdAndSourceProductInfoMap, Map skuIdAndOutSkuIdMap) { + SourceSkuInfo sourceSkuInfo = getSourceSkuInfo(skuOrder, productIdAndSourceProductInfoMap, skuIdAndOutSkuIdMap); + if (sourceSkuInfo == null) { + throw new RuntimeException("未匹配到货源SKU"); + } + boolean isJxhyOffer= sourceSkuInfo.getIsJxhyOffer().equals(1); + PlatformOrderItemDTO item = new PlatformOrderItemDTO(); item.setItemTotal(skuOrder.getNum().intValue()); - item.setSourceSkuId(skuOrder.getCargoSkuId()); - item.setSourceItemId(String.valueOf(skuOrder.getCargoId())); + item.setSourceSkuId(sourceSkuInfo.getSourceSkuId()); + item.setSourceItemId(sourceSkuInfo.getSourceItemId().toString()); item.setPlatformItemId(String.valueOf(skuOrder.getProductId())); item.setPlatformSkuId(skuOrder.getSkuId()); item.setPlatformOrderId(orderId); - item.setPlatformSkuSubName(""); - item.setSpecId(""); + item.setPlatformSkuSubName(sourceSkuInfo.getSkuSubName()); + item.setSpecId(sourceSkuInfo.getSpecId()); + item.setIsJxhyOffer(isJxhyOffer); + item.setJxhyPrice(sourceSkuInfo.getJxhyPrice()); return item; } private BatchCreateDistributionOrdersRequestDTO buildBatchCreateDistributionOrdersRequestDTO(BatchCreateParam param) { + Map productIdAndOutProductIdMap = new HashMap<>(); + Map skuIdAndOutSkuIdMap = new HashMap<>(); + for (CreateOrder order: param.getOrders()) { + for (SkuOrder skuOrder: order.getSkuOrders()) { + productIdAndOutProductIdMap.put(skuOrder.getProductId(), skuOrder.getOuterProductId()); + skuIdAndOutSkuIdMap.put(skuOrder.getSkuId(), skuOrder.getOuterSkuId()); + } + } + + Map productIdAndSourceProductInfoMap = getProductIdAndSourceProductInfoMap(param.getShopId(), productIdAndOutProductIdMap); + BatchCreateDistributionOrdersRequestDTO request = new BatchCreateDistributionOrdersRequestDTO(); List platformOrders = new ArrayList<>(); for (CreateOrder order: param.getOrders()) { - PlatformOrderDTO platformOrder = buildPlatformOrderDTO(param.getShopId(), order); + PlatformOrderDTO platformOrder = buildPlatformOrderDTO(param.getShopId(), order, productIdAndSourceProductInfoMap, skuIdAndOutSkuIdMap); platformOrders.add(platformOrder); } request.setPlatformOrders(platformOrders); request.setPlatform(CommonConst.PLATFORM); - request.setActionSource(""); - request.setOperateInfo(null); - request.setPurchaseSource(""); + request.setActionSource(DsOrderConst.ACTION_SOURCE_BATCH_PURCHASE); + request.setPurchaseSource(DsOrderConst.PURCHASE_SOURCE_PLATFORM_BATCH); request.setIsAutoPay(0); request.setRepurchase(false); - request.setPlatformOrderIdAndPurchaseConfirmLogIdMap(null); return request; } @Override public void batchPay(BatchPayParam param, BatchPayData data) { - Map> shopIdAndPurOrderIdListMap = new HashMap<>(); - for (BatchPayParam.Param p: param.getParams()) { - Set purOrderIdList = new HashSet<>(); - if (shopIdAndPurOrderIdListMap.containsKey(p.getShopId())) { - purOrderIdList = shopIdAndPurOrderIdListMap.get(p.getShopId()); - } - purOrderIdList.add(p.getPurOrderId()); - shopIdAndPurOrderIdListMap.put(p.getShopId(), purOrderIdList); + if (param.getParams().size() != 1) { + throw new RuntimeException("每次只能请求1个采购单"); + } + + PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(param.getParams().get(0).getPurOrderId()); + if (platformPurchaseOrder == null) { + throw new RuntimeException("采购单不存在"); } List paymentResults = new ArrayList<>(); - for (Map.Entry> item: shopIdAndPurOrderIdListMap.entrySet()) { - GetPurchaseOrderPayUrlResponseDTO response = dsApiService.getPurchaseOrderPayUrl(new ArrayList<>(item.getValue()), item.getKey()); + for (BatchPayParam.Param p: param.getParams()) { + GetPurchaseOrderPayUrlResponseDTO response = dsApiService.getPurchaseOrderPayUrl(Collections.singletonList(p.getPurOrderId()), p.getShopId()); if (response.isSuccess()) { PaymentResult paymentResult = new PaymentResult(); PaymentResult.PayUrl payUrl = new PaymentResult.PayUrl(); @@ -264,8 +447,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { payUrl.setPcUrl(response.getPayUrl()); paymentResult.setPayUrl(payUrl); - paymentResult.setPurOrderId(new ArrayList<>(item.getValue()).get(0)); + paymentResult.setPurOrderId(p.getPurOrderId()); paymentResults.add(paymentResult); + + platformPurchaseOrder.setPayPcUrl(response.getPayUrl()); + platformPurchaseOrder.setPayH5Url(response.getPayUrl()); + platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder); + + } else { + throw new RuntimeException(response.getReason()); } } data.setPaymentResults(paymentResults); diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgBufferServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgBufferServiceImpl.java new file mode 100644 index 0000000..2ec5872 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgBufferServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DoudianAftersaleMsgBuffer; +import com.ms.biz.service.DoudianAftersaleMsgBufferService; +import com.ms.dal.mapper.DoudianAftersaleMsgBufferMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DoudianAftersaleMsgBufferServiceImpl implements DoudianAftersaleMsgBufferService{ + + @Autowired + private DoudianAftersaleMsgBufferMapper doudianAftersaleMsgBufferMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianAftersaleMsgBufferMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianAftersaleMsgBuffer record) { + return doudianAftersaleMsgBufferMapper.insert(record); + } + + @Override + public int insertSelective(DoudianAftersaleMsgBuffer record) { + return doudianAftersaleMsgBufferMapper.insertSelective(record); + } + + @Override + public DoudianAftersaleMsgBuffer selectByPrimaryKey(Long id) { + return doudianAftersaleMsgBufferMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianAftersaleMsgBuffer record) { + return doudianAftersaleMsgBufferMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianAftersaleMsgBuffer record) { + return doudianAftersaleMsgBufferMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgQueueServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgQueueServiceImpl.java new file mode 100644 index 0000000..1e7fe47 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianAftersaleMsgQueueServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DoudianAftersaleMsgQueue; +import com.ms.biz.service.DoudianAftersaleMsgQueueService; +import com.ms.dal.mapper.DoudianAftersaleMsgQueueMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DoudianAftersaleMsgQueueServiceImpl implements DoudianAftersaleMsgQueueService{ + + @Autowired + private DoudianAftersaleMsgQueueMapper doudianAftersaleMsgQueueMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianAftersaleMsgQueueMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianAftersaleMsgQueue record) { + return doudianAftersaleMsgQueueMapper.insert(record); + } + + @Override + public int insertSelective(DoudianAftersaleMsgQueue record) { + return doudianAftersaleMsgQueueMapper.insertSelective(record); + } + + @Override + public DoudianAftersaleMsgQueue selectByPrimaryKey(Long id) { + return doudianAftersaleMsgQueueMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianAftersaleMsgQueue record) { + return doudianAftersaleMsgQueueMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianAftersaleMsgQueue record) { + return doudianAftersaleMsgQueueMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgParseQueueServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgParseQueueServiceImpl.java new file mode 100644 index 0000000..73441d6 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgParseQueueServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DoudianMsgParseQueue; +import com.ms.biz.service.DoudianMsgParseQueueService; +import com.ms.dal.mapper.DoudianMsgParseQueueMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DoudianMsgParseQueueServiceImpl implements DoudianMsgParseQueueService{ + + @Autowired + private DoudianMsgParseQueueMapper doudianMsgParseQueueMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianMsgParseQueueMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianMsgParseQueue record) { + return doudianMsgParseQueueMapper.insert(record); + } + + @Override + public int insertSelective(DoudianMsgParseQueue record) { + return doudianMsgParseQueueMapper.insertSelective(record); + } + + @Override + public DoudianMsgParseQueue selectByPrimaryKey(Long id) { + return doudianMsgParseQueueMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianMsgParseQueue record) { + return doudianMsgParseQueueMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianMsgParseQueue record) { + return doudianMsgParseQueueMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgServiceImpl.java new file mode 100644 index 0000000..0b9ebea --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianMsgServiceImpl.java @@ -0,0 +1,242 @@ +package com.ms.biz.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.ms.biz.consts.DoudianMsgConst; +import com.ms.biz.consts.StatusConst; +import com.ms.dal.entity.*; +import com.ms.biz.service.DoudianMsgService; +import com.ms.dal.mapper.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + + +/** + * + */ +@Slf4j +@Service +public class DoudianMsgServiceImpl implements DoudianMsgService{ + + @Autowired + private DoudianMsgMapper doudianMsgMapper; + + @Autowired + private DoudianMsgParseQueueMapper doudianMsgParseQueueMapper; + + @Autowired + private DdTradeMsgMapper ddTradeMsgMapper; + + @Autowired + private DoudianTradeMsgBufferMapper doudianTradeMsgBufferMapper; + + @Autowired + private DdAftersaleMsgMapper ddAftersaleMsgMapper; + + @Autowired + private DoudianAftersaleMsgBufferMapper doudianAftersaleMsgBufferMapper; + + @Autowired + private RedisTemplate redisTemplate; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianMsgMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianMsg record) { + return doudianMsgMapper.insert(record); + } + + @Override + public int insertSelective(DoudianMsg record) { + return doudianMsgMapper.insertSelective(record); + } + + @Override + public DoudianMsg selectByPrimaryKey(Long id) { + return doudianMsgMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianMsg record) { + return doudianMsgMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianMsg record) { + return doudianMsgMapper.updateByPrimaryKey(record); + } + + @Transactional(rollbackFor = Exception.class) + @Override + public boolean addDoudianMsg(String msgBody) { + DoudianMsg doudianMsgData = new DoudianMsg(); + doudianMsgData.setMsgBody(msgBody); + doudianMsgData.setStatus(StatusConst.wait); + doudianMsgData.setGmtCreate(new Date()); + doudianMsgData.setGmtModified(new Date()); + doudianMsgMapper.insertSelective(doudianMsgData); + + DoudianMsgParseQueue doudianMsgParseQueueData = new DoudianMsgParseQueue(); + doudianMsgParseQueueData.setDoudianMsgId(doudianMsgData.getDoudianMsgId()); + doudianMsgParseQueueData.setLocked(0L); + doudianMsgParseQueueData.setGmtCreate(new Date()); + doudianMsgParseQueueData.setGmtModified(new Date()); + doudianMsgParseQueueMapper.insertSelective(doudianMsgParseQueueData); + + redisTemplate.opsForList().leftPush("doudian_msg_parse_queue", String.valueOf(doudianMsgParseQueueData.getDoudianMsgParseQueueId())); + + return true; + } + + @Override + public DoudianMsgParseQueue lockDoudianMsgParseQueue() { + String queueRedisKey = "doudian_msg_parse_queue"; + String queueId = redisTemplate.opsForList().rightPop(queueRedisKey); + if (StringUtils.isEmpty(queueId)) { + return null; + } + + DoudianMsgParseQueue row = doudianMsgParseQueueMapper.selectUnlockRowByQueueId(Long.valueOf(queueId)); + + if (row == null) { + return null; + } + + DoudianMsgParseQueue updateData = new DoudianMsgParseQueue(); + updateData.setDoudianMsgParseQueueId(row.getDoudianMsgParseQueueId()); + row.setLocked(1L); + row.setGmtLastHeartbeat(new Date()); + row.setGmtLocked(new Date()); + row.setGmtModified(new Date()); + int affRow = doudianMsgParseQueueMapper.updateByPrimaryKeySelective(row); + if (affRow == 1) { + return row; + } + + return null; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean processDoudianMsgParseQueue(Long doudianMsgId) { + if (doudianMsgId == null) { + return false; + } + DoudianMsg doudianMsgInfo = doudianMsgMapper.selectByPrimaryKey(doudianMsgId); + if (doudianMsgInfo == null) { + return false; + } + List msgList = JSON.parseArray(doudianMsgInfo.getMsgBody(), String.class); + List shopIds = new ArrayList<>(); + for (String msg : msgList) { + JSONObject msgItem = JSONObject.parseObject(msg); + JSONObject currentMsgData = JSONObject.parseObject(msgItem.getString("data")); + if (currentMsgData.containsKey("shop_id")) { + shopIds.add(currentMsgData.get("shop_id").toString()); + } else { + log.info(String.format("timer doudian_msg shop_id_empty doudianMsgId{%s} msgBody: %s", doudianMsgId, doudianMsgInfo.getMsgBody())); + } + } + + List doudianTradeMsgDatas = new ArrayList<>(); + List doudianTradeMsgBufferDatas = new ArrayList<>(); + List aftersaleMsgsDatas = new ArrayList<>(); + List aftersaleMsgBufferDatas = new ArrayList<>(); + + for (String msg : msgList) { + JSONObject msgItem = JSONObject.parseObject(msg); + Map currentMsgData = JSONObject.parseObject(msgItem.getString("data"), Map.class); + Long shopId = Long.valueOf(currentMsgData.get("shop_id").toString()); + + if (DoudianMsgConst.ALL_TRADE_TAGS.contains(Integer.valueOf(msgItem.get("tag").toString()))) { + DdTradeMsg msgObj = new DdTradeMsg(); + msgObj.setMsgId(msgItem.get("msg_id").toString()); + msgObj.setShopId(shopId); + msgObj.setTag(Integer.valueOf(msgItem.get("tag").toString())); + msgObj.setData(msgItem.get("data").toString()); + msgObj.setStatus(StatusConst.wait); + msgObj.setGmtCreate(new Date()); + msgObj.setGmtModified(new Date()); + doudianTradeMsgDatas.add(msgObj); + + DoudianTradeMsgBuffer buffer = new DoudianTradeMsgBuffer(); + buffer.setMsgId(msgItem.get("msg_id").toString()); + buffer.setShopId(shopId); + buffer.setGmtCreate(new Date()); + buffer.setGmtModified(new Date()); + doudianTradeMsgBufferDatas.add(buffer); + } + + if (DoudianMsgConst.ALL_AFTERSALE_TAGS.contains(Integer.valueOf(msgItem.get("tag").toString()))) { + DdAftersaleMsg msgObj = new DdAftersaleMsg(); + msgObj.setMsgId(msgItem.get("msg_id").toString()); + msgObj.setShopId(shopId); + msgObj.setTag(Integer.valueOf(msgItem.get("tag").toString())); + msgObj.setData(msgItem.get("data").toString()); + msgObj.setStatus(StatusConst.wait); + msgObj.setGmtCreate(new Date()); + msgObj.setGmtModified(new Date()); + aftersaleMsgsDatas.add(msgObj); + + DoudianAftersaleMsgBuffer buffer = new DoudianAftersaleMsgBuffer(); + buffer.setMsgId(msgItem.get("msg_id").toString()); + buffer.setShopId(shopId); + buffer.setGmtCreate(new Date()); + buffer.setGmtModified(new Date()); + aftersaleMsgBufferDatas.add(buffer); + } + } + // 插入分好类的数据 + for (DdTradeMsg item : doudianTradeMsgDatas) { + ddTradeMsgMapper.insertSelective(item); + } + for (DoudianTradeMsgBuffer item : doudianTradeMsgBufferDatas) { + doudianTradeMsgBufferMapper.insertSelective(item); + } + for (DdAftersaleMsg item : aftersaleMsgsDatas) { + ddAftersaleMsgMapper.insertSelective(item); + } + for (DoudianAftersaleMsgBuffer item : aftersaleMsgBufferDatas) { + doudianAftersaleMsgBufferMapper.insertSelective(item); + } + DoudianMsg updateDoudianMsg = new DoudianMsg(); + updateDoudianMsg.setDoudianMsgId(doudianMsgId); + updateDoudianMsg.setStatus(StatusConst.success); + updateDoudianMsg.setGmtModified(new Date()); + doudianMsgMapper.updateByPrimaryKeySelective(updateDoudianMsg); + + return true; + } + + @Override + public void failProcessDoudianMsgParseQueue(Long doudianMsgId) { + DoudianMsg updateDoudianMsg = new DoudianMsg(); + updateDoudianMsg.setDoudianMsgId(doudianMsgId); + updateDoudianMsg.setStatus(StatusConst.fail); + updateDoudianMsg.setReason("插入数据失败"); + updateDoudianMsg.setGmtModified(new Date()); + doudianMsgMapper.updateByPrimaryKeySelective(updateDoudianMsg); + } + + @Override + public boolean deleteDoudianMsgParseQueue(Long queueId) { + int affRow = doudianMsgParseQueueMapper.deleteByPrimaryKey(queueId); + return affRow > 0; + } +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgBufferServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgBufferServiceImpl.java new file mode 100644 index 0000000..21da90f --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgBufferServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DoudianTradeMsgBuffer; +import com.ms.biz.service.DoudianTradeMsgBufferService; +import com.ms.dal.mapper.DoudianTradeMsgBufferMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DoudianTradeMsgBufferServiceImpl implements DoudianTradeMsgBufferService{ + + @Autowired + private DoudianTradeMsgBufferMapper doudianTradeMsgBufferMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianTradeMsgBufferMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianTradeMsgBuffer record) { + return doudianTradeMsgBufferMapper.insert(record); + } + + @Override + public int insertSelective(DoudianTradeMsgBuffer record) { + return doudianTradeMsgBufferMapper.insertSelective(record); + } + + @Override + public DoudianTradeMsgBuffer selectByPrimaryKey(Long id) { + return doudianTradeMsgBufferMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianTradeMsgBuffer record) { + return doudianTradeMsgBufferMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianTradeMsgBuffer record) { + return doudianTradeMsgBufferMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgQueueServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgQueueServiceImpl.java new file mode 100644 index 0000000..9a3c339 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DoudianTradeMsgQueueServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.DoudianTradeMsgQueue; +import com.ms.biz.service.DoudianTradeMsgQueueService; +import com.ms.dal.mapper.DoudianTradeMsgQueueMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class DoudianTradeMsgQueueServiceImpl implements DoudianTradeMsgQueueService{ + + @Autowired + private DoudianTradeMsgQueueMapper doudianTradeMsgQueueMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return doudianTradeMsgQueueMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(DoudianTradeMsgQueue record) { + return doudianTradeMsgQueueMapper.insert(record); + } + + @Override + public int insertSelective(DoudianTradeMsgQueue record) { + return doudianTradeMsgQueueMapper.insertSelective(record); + } + + @Override + public DoudianTradeMsgQueue selectByPrimaryKey(Long id) { + return doudianTradeMsgQueueMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(DoudianTradeMsgQueue record) { + return doudianTradeMsgQueueMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(DoudianTradeMsgQueue record) { + return doudianTradeMsgQueueMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java index b134e8f..b67a1ea 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DsApiServiceImpl.java @@ -119,10 +119,20 @@ public class DsApiServiceImpl implements DsApiService { params.put("shopName",shopInfo.getShopName()); params.put("gmtExpire", "2024-08-30 00:00:00"); params.put("version","3"); - String resp = execute("/order/getPurchaseOrderPayUrl", params); + String resp = execute("/platform_shop/get_platform_auth_url", params); return JSON.parseObject(resp, GetPlatformAuthUrlResponseDTO.class); } + @Override + public GetSourceItemInfosResponseDTO getSourceItemInfos(Long shopId, List sourceItemIds) { + Map params = new HashMap<>(); + params.put("platform", CommonConst.PLATFORM); + params.put("userId", SecurityTool.encodeByAES(String.valueOf(shopId))); + params.put("sourceItemIds", sourceItemIds); + String resp = execute("/order/getSourceItemInfos", params); + return JSON.parseObject(resp, GetSourceItemInfosResponseDTO.class); + } + private Map objectToMap(Object obj) { Map map = new HashMap<>(); Class clazz = obj.getClass(); diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java index a095cc4..26198e4 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/DsMessageServiceImpl.java @@ -1,18 +1,32 @@ package com.ms.biz.service.impl; import com.alibaba.fastjson.JSONObject; +import com.doudian.open.api.supplyCenter_order_cancel.param.SupplyCenterOrderCancelParam; +import com.doudian.open.api.supplyCenter_order_confirm.param.SupplyCenterOrderConfirmParam; +import com.doudian.open.api.supplyCenter_order_logistics.param.SupplyCenterOrderLogisticsParam; +import com.doudian.open.api.supplyCenter_order_pay.param.SkuOrderPayInfosItem; +import com.doudian.open.api.supplyCenter_order_pay.param.SupplyCenterOrderPayParam; +import com.doudian.open.api.supplyCenter_order_syncSupplierInfo.param.SkuOrdersItem; +import com.doudian.open.api.supplyCenter_order_syncSupplierInfo.param.SupplierOrderUrl; +import com.doudian.open.api.supplyCenter_order_syncSupplierInfo.param.SupplyCenterOrderSyncSupplierInfoParam; +import com.doudian.open.api.supplyCenter_refund_operate.param.Address; +import com.doudian.open.api.supplyCenter_refund_operate.param.SkuRefundInfosItem; +import com.doudian.open.api.supplyCenter_refund_operate.param.SupplyCenterRefundOperateParam; import com.ms.biz.consts.DsMessageConst; +import com.ms.biz.consts.PurchaseOrderConst; import com.ms.biz.consts.StatusConst; +import com.ms.biz.dto.openspi.request.SkuOrder; import com.ms.biz.service.DsMessageConsumerBufferService; import com.ms.biz.service.DsMessageConsumerQueueService; import com.ms.biz.service.DsMessageService; import com.ms.api.dto.dsorder.*; import com.ms.biz.tool.CommonTool; -import com.ms.dal.entity.DsMessage; -import com.ms.dal.entity.DsMessageConsumerQueue; -import com.ms.dal.mapper.DsMessageMapper; +import com.ms.biz.util.DDApi; +import com.ms.dal.entity.*; +import com.ms.dal.mapper.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.lang.Nullable; import org.springframework.stereotype.Service; @@ -20,9 +34,10 @@ import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Objects; +import java.util.*; +import java.util.stream.Collectors; @Service @Slf4j @@ -34,6 +49,10 @@ public class DsMessageServiceImpl implements DsMessageService { private DsMessageMapper dsMessageMapper; private DsMessageConsumerBufferService dsMessageConsumerBufferService; private DsMessageConsumerQueueService dsMessageConsumerQueueService; + private PlatformPurchaseOrderMapper platformPurchaseOrderMapper; + private PlatformPurchaseOrderSkuMapper platformPurchaseOrderSkuMapper; + private PurchaseOrderMapper purchaseOrderMapper; + private PurchaseOrderItemMapper purchaseOrderItemMapper; @Override public int deleteByPrimaryKey(Long id) { @@ -152,6 +171,208 @@ public class DsMessageServiceImpl implements DsMessageService { } dsMessageConsumerQueueService.deleteByPrimaryKey(queue.getDsMessageConsumerQueueId()); } + + public void processDsMessage(Long dsMessageId) { + DsMessage dsMessage = selectByPrimaryKey(dsMessageId); + if (dsMessage == null) { + throw new RuntimeException("消息不存在"); + } + + DsMessageDTO messageDTO = parseData(dsMessage); + boolean isExpire = isDsMessageExpire(dsMessage, messageDTO); + if (isExpire) { + if (Objects.equals(dsMessage.getBizType(), DsMessageConst.BIZ_TYPE_RELATE_PURCHASE_ORDER)) { + PurchaseOrderDTO purchaseOrderDTO = ((PurchaseOrderRelateMessageDTO)messageDTO).getPurchaseOrderInfo(); + // do something + } + throw new RuntimeException("消息已过期"); + } + + switch (dsMessage.getBizType()) { + case DsMessageConst.BIZ_TYPE_RELATE_PURCHASE_ORDER: + handlePurchaseOrderRelate((PurchaseOrderRelateMessageDTO)messageDTO); + break; + case DsMessageConst.BIZ_TYPE_PURCHASE_ORDER_CHANGE: + handlePurchaseOrderChange((PurchaseOrderChangeMessageDTO)messageDTO); + break; + case DsMessageConst.BIZ_TYPE_CANCEL_PURCHASE_ORDER: + handlePurchaseOrderCancel((PurchaseOrderCancelMessageDTO)messageDTO); + break; + default: + throw new RuntimeException("bizType [" + dsMessage.getBizType() + "] 暂无对应的处理逻辑"); + } + } + + private boolean isDsMessageExpire(DsMessage dsMessage, DsMessageDTO messageDTO) { + if (messageDTO.getGmtMessageCreate() == null) { + return false; + } + switch (dsMessage.getBizType()) { + case DsMessageConst.BIZ_TYPE_CANCEL_PURCHASE_ORDER: + return hasNewThanDsMessage(dsMessage, DsMessageConst.BIZ_TYPE_RELATE_PURCHASE_ORDER); + case DsMessageConst.BIZ_TYPE_PURCHASE_ORDER_CHANGE: + return hasNewThanDsMessage(dsMessage, DsMessageConst.BIZ_TYPE_PURCHASE_ORDER_CHANGE); + case DsMessageConst.BIZ_TYPE_RELATE_PURCHASE_ORDER: + return hasNewThanDsMessage(dsMessage, DsMessageConst.BIZ_TYPE_CANCEL_PURCHASE_ORDER); + default: + return false; + } + } + + private void handlePurchaseOrderChange(PurchaseOrderChangeMessageDTO messageDTO) { + PurchaseOrderDTO purchaseOrderDTO = messageDTO.getPurchaseOrderInfo(); + PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurchaseOrderSn(purchaseOrderDTO.getPurchaseOrderSn()); + PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(purchaseOrder.getPurOrderId()); + List platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId())); + Map skuIdAndPlatformPurchaseOrderSkuMap = platformPurchaseOrderSkus.stream().collect(Collectors.toMap(PlatformPurchaseOrderSku::getSkuId, x->x)); + + String purchaseOrderStatus = purchaseOrderDTO.getPurchaseOrderStatus(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date messageCreateTime; + try { + messageCreateTime = dateFormat.parse(messageDTO.getGmtMessageCreate()); + } catch (java.text.ParseException e) { + throw new RuntimeException("时间格式错误"); + } + + if (!Objects.equals(purchaseOrder.getPurchaseOrderStatus(),purchaseOrderStatus)){ + switch (purchaseOrderStatus) { + case PurchaseOrderConst.PURCHASE_ORDER_STATUS_WAIT_SEND: + handlePurchaseOrderAfterPay(purchaseOrderDTO, messageCreateTime, purchaseOrder, skuIdAndPlatformPurchaseOrderSkuMap); + break; + case PurchaseOrderConst.PURCHASE_ORDER_STATUS_WAIT_CONFIRM: + handlePurchaseOrderAfterSend(purchaseOrderDTO, purchaseOrder); + break; + case PurchaseOrderConst.PURCHASE_ORDER_STATUS_FINISHED: + handlePurchaseOrderAfterFinish(purchaseOrderDTO, messageCreateTime, purchaseOrder); + break; + case PurchaseOrderConst.PURCHASE_ORDER_STATUS_CANCEL: + handlePurchaseOrderAfterCancel(purchaseOrderDTO, messageCreateTime, purchaseOrder); + platformPurchaseOrder.setStatus(StatusConst.delete); // TODO 多单?精选 + break; + } + platformPurchaseOrder.setPurchaseStatus(purchaseOrderStatus); + platformPurchaseOrder.setGmtModified(new Date()); + platformPurchaseOrderMapper.updateByPrimaryKeySelective(platformPurchaseOrder); + + purchaseOrder.setPurchaseOrderStatus(purchaseOrderStatus); + purchaseOrder.setGmtModified(new Date()); + purchaseOrderMapper.updateByPrimaryKeySelective(purchaseOrder); + + if (purchaseOrder.getStatus().equals(StatusConst.delete)) { + purchaseOrderItemMapper.updateStatusByPurchaseOrderIds(StatusConst.delete, Collections.singletonList(purchaseOrder.getPurchaseOrderId())); + } + } + handlePurchaseOrderRefund(purchaseOrderDTO, purchaseOrder, skuIdAndPlatformPurchaseOrderSkuMap); + } + + private void handlePurchaseOrderAfterPay(PurchaseOrderDTO purchaseOrderDTO, Date messageCreateTime, PurchaseOrder purchaseOrder, Map skuIdAndPlatformPurchaseOrderSkuMap) { + purchaseOrder.setPurchaseOrderPayment(new BigDecimal(purchaseOrderDTO.getPurchaseOrderPayment())); + + SupplyCenterOrderPayParam param = new SupplyCenterOrderPayParam(); + param.setPayAmount((long)(Double.parseDouble(purchaseOrderDTO.getPurchaseOrderPayment()) * 100)); + param.setPayTime(messageCreateTime.getTime()); + param.setPurOrderId(purchaseOrder.getPurOrderId()); + param.setPostAmount(0L); + List skuOrderPayInfosItems = new ArrayList<>(); + for (PurchaseOrderItemDTO item: purchaseOrderDTO.getItems()) { + PlatformPurchaseOrderSku platformPurchaseOrderSku = skuIdAndPlatformPurchaseOrderSkuMap.get(item.getSkuId()); + SkuOrderPayInfosItem skuOrderPayInfosItem = new SkuOrderPayInfosItem(); + skuOrderPayInfosItem.setPayAmount((long)(item.getPurchasePrice() * 100)); + skuOrderPayInfosItem.setPurSkuOrderId(platformPurchaseOrderSku.getPurSkuOrderId()); + skuOrderPayInfosItems.add(skuOrderPayInfosItem); + } + param.setSkuOrderPayInfos(skuOrderPayInfosItems); + DDApi.supplyCenterOrderPay(param); + } + + private void handlePurchaseOrderAfterSend(PurchaseOrderDTO purchaseOrderDTO, PurchaseOrder purchaseOrder) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date purchaseOrderSendTime = null; + try { + if (StringUtils.isNotBlank(purchaseOrderDTO.getPurchaseOrderSendTime())) { + purchaseOrderSendTime = dateFormat.parse(purchaseOrderDTO.getPurchaseOrderSendTime()); + } + } catch (java.text.ParseException e) { + throw new RuntimeException("时间格式错误"); + } + purchaseOrder.setPurchaseOrderSendTime(purchaseOrderSendTime); + purchaseOrder.setPurchaseOrderLogisticsName(purchaseOrder.getPurchaseOrderLogisticsName()); + purchaseOrder.setPurchaseOrderWaybillCode(purchaseOrder.getPurchaseOrderWaybillCode()); + + SupplyCenterOrderLogisticsParam param = new SupplyCenterOrderLogisticsParam(); + param.setPurOrderId(purchaseOrder.getPurOrderId()); + if (purchaseOrderSendTime != null) { + param.setExpressTime(purchaseOrderSendTime.getTime()); + } + param.setExpressType(1); + DDApi.supplyCenterOrderLogistics(param); + } + + private void handlePurchaseOrderAfterFinish(PurchaseOrderDTO purchaseOrderDTO, Date messageCreateTime, PurchaseOrder purchaseOrder) { + SupplyCenterOrderConfirmParam param = new SupplyCenterOrderConfirmParam(); + param.setPurOrderId(purchaseOrder.getPurOrderId()); + param.setConfirmTime(messageCreateTime.getTime()); + DDApi.supplyCenterOrderConfirm(param); + } + + private void handlePurchaseOrderAfterCancel(PurchaseOrderDTO purchaseOrderDTO, Date messageCreateTime, PurchaseOrder purchaseOrder) { + purchaseOrder.setStatus(StatusConst.delete); + SupplyCenterOrderCancelParam param = new SupplyCenterOrderCancelParam(); + param.setPurOrderId(purchaseOrder.getPurOrderId()); + param.setCancelTime(messageCreateTime.getTime()); + DDApi.supplyCenterOrderCancel(param); + } + + private void handlePurchaseOrderRefund(PurchaseOrderDTO purchaseOrderDTO, PurchaseOrder purchaseOrder, Map skuIdAndPlatformPurchaseOrderSkuMap) { + if (purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) { + return; + } + SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam(); + param.setPurOrderId(purchaseOrderDTO.getPlatformOrderId()); + List skuRefundInfosItems = new ArrayList<>(); + for (Map.Entry entry: purchaseOrderDTO.getRefundInfo().entrySet()) { + RefundInfoDTO refundInfo = entry.getValue(); + Address address = new Address(); + address.setUserName(refundInfo.getSellerRealName()); + address.setDetail(refundInfo.getSellerReceiveAddress()); + address.setMobile(refundInfo.getSellerMobile()); + SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem(); + skuRefundInfosItem.setPurSkuOrderId(""); + skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason()); + skuRefundInfosItem.setAddress(address); + skuRefundInfosItem.setCloseReason(""); + skuRefundInfosItem.setOperationType(1); + skuRefundInfosItems.add(skuRefundInfosItem); + } + param.setSkuRefundInfos(skuRefundInfosItems); + DDApi.supplyCenterRefundOperate(param); + } + + private void handlePurchaseOrderCancel(PurchaseOrderCancelMessageDTO messageDTO) { + } + + private void handlePurchaseOrderRelate(PurchaseOrderRelateMessageDTO messageDTO) { + PurchaseOrderDTO purchaseOrderDTO = messageDTO.getPurchaseOrderInfo(); + PurchaseOrder purchaseOrder = purchaseOrderMapper.getByPurchaseOrderSn(purchaseOrderDTO.getPurchaseOrderSn()); + List platformPurchaseOrderSkus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId())); + Map skuIdAndPlatformPurchaseOrderSkuMap = platformPurchaseOrderSkus.stream().collect(Collectors.toMap(PlatformPurchaseOrderSku::getSkuId, x->x)); + + PlatformPurchaseOrder platformPurchaseOrder = platformPurchaseOrderMapper.selectByPrimaryKey(purchaseOrder.getPurOrderId()); + SupplyCenterOrderSyncSupplierInfoParam param = new SupplyCenterOrderSyncSupplierInfoParam(); + param.setPurOrderId(platformPurchaseOrder.getPurOrderId()); + param.setSupplierOrderId(purchaseOrderDTO.getPurchaseOrderSn()); + param.setSupplierOrderUrl(new SupplierOrderUrl()); + List skuOrders = new ArrayList<>(); + for (PurchaseOrderItemDTO item: purchaseOrderDTO.getItems()) { + PlatformPurchaseOrderSku platformPurchaseOrderSku = skuIdAndPlatformPurchaseOrderSkuMap.get(item.getSkuId()); + SkuOrdersItem skuOrdersItem = new SkuOrdersItem(); + skuOrdersItem.setPurSkuOrderId(platformPurchaseOrderSku.getPurSkuOrderId()); + skuOrdersItem.setSupplierSkuOrderId(""); // TODO 上游没值 + } + param.setSkuOrders(skuOrders); + DDApi.supplyCenterOrderSyncSupplierInfo(param); + } } diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderAddressServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderAddressServiceImpl.java new file mode 100644 index 0000000..ced60f2 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderAddressServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.biz.service.PlatformPurchaseOrderAddressService; +import com.ms.dal.entity.PlatformPurchaseOrderAddress; +import com.ms.dal.mapper.PlatformPurchaseOrderAddressMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class PlatformPurchaseOrderAddressServiceImpl implements PlatformPurchaseOrderAddressService { + + @Autowired + private PlatformPurchaseOrderAddressMapper platformPurchaseOrderAddressMapper; + + @Override + public int deleteByPrimaryKey(String id) { + return platformPurchaseOrderAddressMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(PlatformPurchaseOrderAddress record) { + return platformPurchaseOrderAddressMapper.insert(record); + } + + @Override + public int insertSelective(PlatformPurchaseOrderAddress record) { + return platformPurchaseOrderAddressMapper.insertSelective(record); + } + + @Override + public PlatformPurchaseOrderAddress selectByPrimaryKey(String id) { + return platformPurchaseOrderAddressMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(PlatformPurchaseOrderAddress record) { + return platformPurchaseOrderAddressMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(PlatformPurchaseOrderAddress record) { + return platformPurchaseOrderAddressMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderMaskAddressServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderMaskAddressServiceImpl.java new file mode 100644 index 0000000..9e5530b --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderMaskAddressServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.biz.service.PlatformPurchaseOrderMaskAddressService; +import com.ms.dal.entity.PlatformPurchaseOrderMaskAddress; +import com.ms.dal.mapper.PlatformPurchaseOrderMaskAddressMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class PlatformPurchaseOrderMaskAddressServiceImpl implements PlatformPurchaseOrderMaskAddressService { + + @Autowired + private PlatformPurchaseOrderMaskAddressMapper platformPurchaseOrderMaskAddressMapper; + + @Override + public int deleteByPrimaryKey(String id) { + return platformPurchaseOrderMaskAddressMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(PlatformPurchaseOrderMaskAddress record) { + return platformPurchaseOrderMaskAddressMapper.insert(record); + } + + @Override + public int insertSelective(PlatformPurchaseOrderMaskAddress record) { + return platformPurchaseOrderMaskAddressMapper.insertSelective(record); + } + + @Override + public PlatformPurchaseOrderMaskAddress selectByPrimaryKey(String id) { + return platformPurchaseOrderMaskAddressMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(PlatformPurchaseOrderMaskAddress record) { + return platformPurchaseOrderMaskAddressMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(PlatformPurchaseOrderMaskAddress record) { + return platformPurchaseOrderMaskAddressMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderServiceImpl.java new file mode 100644 index 0000000..4c2a21f --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.biz.service.PlatformPurchaseOrderService; +import com.ms.dal.entity.PlatformPurchaseOrder; +import com.ms.dal.mapper.PlatformPurchaseOrderMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class PlatformPurchaseOrderServiceImpl implements PlatformPurchaseOrderService { + + @Autowired + private PlatformPurchaseOrderMapper platformPurchaseOrderMapper; + + @Override + public int deleteByPrimaryKey(String id) { + return platformPurchaseOrderMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(PlatformPurchaseOrder record) { + return platformPurchaseOrderMapper.insert(record); + } + + @Override + public int insertSelective(PlatformPurchaseOrder record) { + return platformPurchaseOrderMapper.insertSelective(record); + } + + @Override + public PlatformPurchaseOrder selectByPrimaryKey(String id) { + return platformPurchaseOrderMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(PlatformPurchaseOrder record) { + return platformPurchaseOrderMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(PlatformPurchaseOrder record) { + return platformPurchaseOrderMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderSkuServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderSkuServiceImpl.java new file mode 100644 index 0000000..eabbbc1 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PlatformPurchaseOrderSkuServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.biz.service.PlatformPurchaseOrderSkuService; +import com.ms.dal.entity.PlatformPurchaseOrderSku; +import com.ms.dal.mapper.PlatformPurchaseOrderSkuMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class PlatformPurchaseOrderSkuServiceImpl implements PlatformPurchaseOrderSkuService { + + @Autowired + private PlatformPurchaseOrderSkuMapper platformPurchaseOrderSkuMapper; + + @Override + public int deleteByPrimaryKey(String id) { + return platformPurchaseOrderSkuMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(PlatformPurchaseOrderSku record) { + return platformPurchaseOrderSkuMapper.insert(record); + } + + @Override + public int insertSelective(PlatformPurchaseOrderSku record) { + return platformPurchaseOrderSkuMapper.insertSelective(record); + } + + @Override + public PlatformPurchaseOrderSku selectByPrimaryKey(String id) { + return platformPurchaseOrderSkuMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(PlatformPurchaseOrderSku record) { + return platformPurchaseOrderSkuMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(PlatformPurchaseOrderSku record) { + return platformPurchaseOrderSkuMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderAddressServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderAddressServiceImpl.java deleted file mode 100644 index cb06033..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderAddressServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ms.biz.service.impl; - -import com.ms.biz.service.PurchaseOrderAddressService; -import com.ms.dal.entity.PurchaseOrderAddress; -import com.ms.dal.mapper.PurchaseOrderAddressMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - - -/** - * - */ -@Service -public class PurchaseOrderAddressServiceImpl implements PurchaseOrderAddressService { - - @Autowired - private PurchaseOrderAddressMapper purchaseOrderAddressMapper; - - @Override - public int deleteByPrimaryKey(Long id) { - return purchaseOrderAddressMapper.deleteByPrimaryKey(id); - } - - @Override - public int insert(PurchaseOrderAddress record) { - return purchaseOrderAddressMapper.insert(record); - } - - @Override - public int insertSelective(PurchaseOrderAddress record) { - return purchaseOrderAddressMapper.insertSelective(record); - } - - @Override - public PurchaseOrderAddress selectByPrimaryKey(Long id) { - return purchaseOrderAddressMapper.selectByPrimaryKey(id); - } - - @Override - public int updateByPrimaryKeySelective(PurchaseOrderAddress record) { - return purchaseOrderAddressMapper.updateByPrimaryKeySelective(record); - } - - @Override - public int updateByPrimaryKey(PurchaseOrderAddress record) { - return purchaseOrderAddressMapper.updateByPrimaryKey(record); - } - -} - - - - diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderItemServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderItemServiceImpl.java new file mode 100644 index 0000000..bdf1555 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderItemServiceImpl.java @@ -0,0 +1,53 @@ +package com.ms.biz.service.impl; + +import com.ms.dal.entity.PurchaseOrderItem; +import com.ms.biz.service.PurchaseOrderItemService; +import com.ms.dal.mapper.PurchaseOrderItemMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * + */ +@Service +public class PurchaseOrderItemServiceImpl implements PurchaseOrderItemService{ + + @Autowired + private PurchaseOrderItemMapper purchaseOrderItemMapper; + + @Override + public int deleteByPrimaryKey(Long id) { + return purchaseOrderItemMapper.deleteByPrimaryKey(id); + } + + @Override + public int insert(PurchaseOrderItem record) { + return purchaseOrderItemMapper.insert(record); + } + + @Override + public int insertSelective(PurchaseOrderItem record) { + return purchaseOrderItemMapper.insertSelective(record); + } + + @Override + public PurchaseOrderItem selectByPrimaryKey(Long id) { + return purchaseOrderItemMapper.selectByPrimaryKey(id); + } + + @Override + public int updateByPrimaryKeySelective(PurchaseOrderItem record) { + return purchaseOrderItemMapper.updateByPrimaryKeySelective(record); + } + + @Override + public int updateByPrimaryKey(PurchaseOrderItem record) { + return purchaseOrderItemMapper.updateByPrimaryKey(record); + } + +} + + + + diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderMaskAddressServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderMaskAddressServiceImpl.java deleted file mode 100644 index 7e8d893..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderMaskAddressServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ms.biz.service.impl; - -import com.ms.biz.service.PurchaseOrderMaskAddressService; -import com.ms.dal.entity.PurchaseOrderMaskAddress; -import com.ms.dal.mapper.PurchaseOrderMaskAddressMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - - -/** - * - */ -@Service -public class PurchaseOrderMaskAddressServiceImpl implements PurchaseOrderMaskAddressService{ - - @Autowired - private PurchaseOrderMaskAddressMapper purchaseOrderMaskAddressMapper; - - @Override - public int deleteByPrimaryKey(Long id) { - return purchaseOrderMaskAddressMapper.deleteByPrimaryKey(id); - } - - @Override - public int insert(PurchaseOrderMaskAddress record) { - return purchaseOrderMaskAddressMapper.insert(record); - } - - @Override - public int insertSelective(PurchaseOrderMaskAddress record) { - return purchaseOrderMaskAddressMapper.insertSelective(record); - } - - @Override - public PurchaseOrderMaskAddress selectByPrimaryKey(Long id) { - return purchaseOrderMaskAddressMapper.selectByPrimaryKey(id); - } - - @Override - public int updateByPrimaryKeySelective(PurchaseOrderMaskAddress record) { - return purchaseOrderMaskAddressMapper.updateByPrimaryKeySelective(record); - } - - @Override - public int updateByPrimaryKey(PurchaseOrderMaskAddress record) { - return purchaseOrderMaskAddressMapper.updateByPrimaryKey(record); - } - -} - - - - diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderServiceImpl.java index 7736598..e28ce66 100644 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderServiceImpl.java @@ -1,7 +1,7 @@ package com.ms.biz.service.impl; -import com.ms.biz.service.PurchaseOrderService; import com.ms.dal.entity.PurchaseOrder; +import com.ms.biz.service.PurchaseOrderService; import com.ms.dal.mapper.PurchaseOrderMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderSkuServiceImpl.java b/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderSkuServiceImpl.java deleted file mode 100644 index 97ea32b..0000000 --- a/ms-biz/src/main/java/com/ms/biz/service/impl/PurchaseOrderSkuServiceImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ms.biz.service.impl; - -import com.ms.biz.service.PurchaseOrderSkuService; -import com.ms.dal.entity.PurchaseOrderSku; -import com.ms.dal.mapper.PurchaseOrderSkuMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - - -/** - * - */ -@Service -public class PurchaseOrderSkuServiceImpl implements PurchaseOrderSkuService{ - - @Autowired - private PurchaseOrderSkuMapper purchaseOrderSkuMapper; - - @Override - public int deleteByPrimaryKey(Long id) { - return purchaseOrderSkuMapper.deleteByPrimaryKey(id); - } - - @Override - public int insert(PurchaseOrderSku record) { - return purchaseOrderSkuMapper.insert(record); - } - - @Override - public int insertSelective(PurchaseOrderSku record) { - return purchaseOrderSkuMapper.insertSelective(record); - } - - @Override - public PurchaseOrderSku selectByPrimaryKey(Long id) { - return purchaseOrderSkuMapper.selectByPrimaryKey(id); - } - - @Override - public int updateByPrimaryKeySelective(PurchaseOrderSku record) { - return purchaseOrderSkuMapper.updateByPrimaryKeySelective(record); - } - - @Override - public int updateByPrimaryKey(PurchaseOrderSku record) { - return purchaseOrderSkuMapper.updateByPrimaryKey(record); - } - -} - - - - diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java new file mode 100644 index 0000000..be6ea51 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/DoudianMsgReceiveService.java @@ -0,0 +1,52 @@ +package com.ms.biz.spi.callback; + +import com.alibaba.fastjson.JSON; +import com.jinritemai.cloud.base.api.BaseRequest; +import com.jinritemai.cloud.base.api.BaseResponse; +import com.jinritemai.cloud.base.api.ExtensionService; +import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.biz.common.R; +import com.ms.biz.common.SPIBaseService; +import com.ms.biz.service.DoudianMsgService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +@ExtensionService("CloudOpenMsgConsumer") +@Slf4j +public class DoudianMsgReceiveService extends SPIBaseService implements ExtensionServiceHandler, Void> { + + @Autowired + private DoudianMsgService doudianMsgService; + + @Override + public BaseResponse handle(BaseRequest> req) { +// initHandle(req); + + // ----参数校验---- + List msgList = req.getData(); + if (msgList == null || msgList.isEmpty()) { + R.ok(); + } + String msgBody = JSON.toJSONString(msgList); + log.info("CloudOpenMsgConsumer request: " + msgBody); + // ----逻辑校验---- + + // ----业务处理---- + boolean addRet = false; + try { + addRet = doudianMsgService.addDoudianMsg(msgBody); + } catch (Exception e) { + log.error(String.format("addDoudianMsg fail, exception: %s", e.getMessage())); + } + + if (!addRet) { + log.info(String.format("fail msgBody: %s", JSON.toJSONString(msgList))); + return BaseResponse.builder().success(false).code("1").build(); + } + + // 处理成功则返回 true code 0 + return BaseResponse.builder().success(true).code("0").build(); + } +} diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/MemberAuthCallbackService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/MemberAuthCallbackService.java index 117a8fb..23bdb5f 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/callback/MemberAuthCallbackService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/MemberAuthCallbackService.java @@ -36,19 +36,7 @@ public class MemberAuthCallbackService extends SPIBaseService implements Extensi MemberAuthCallBackRequestDTO fields = req.getData(); log.info("receive callback: " + JSON.toJSONString(fields)); String body = fields.getBody(); -// String body = "{\"userId\":\"111087462\",\"cnaliMemberId\":\"b2b-6848123449731a\",\"authCode\":\"NGVkNWM1NjctNzYxMy01YWIwLWI5MDUtMmFhYjYwZGFiYzI5\",\"gmtMemberExpireTime\":\"2023-12-21 23:59:59\",\"type\":\"auth\"}"; - // ----逻辑校验---- - - // ----业务处理---- try { -// final String charset = "utf-8"; -// String contents = URLDecoder.decode(body, charset); -// String[] keyValues = contents.split("&"); -// for (int i = 0; i < keyValues.length; i++) { -// String key = keyValues[i].substring(0, keyValues[i].indexOf("=")); -// String value = keyValues[i].substring(keyValues[i].indexOf("=") + 1); -// map.put(key, value); -// } JSONObject map = JSONObject.parseObject(body); String authCode = map.getString("authCode"); String cnaliMemberId = map.getString("cnaliMemberId"); diff --git a/ms-biz/src/main/java/com/ms/biz/spi/callback/ShopAuthCallbackService.java b/ms-biz/src/main/java/com/ms/biz/spi/callback/ShopAuthCallbackService.java index 43a2b4f..6c39c13 100644 --- a/ms-biz/src/main/java/com/ms/biz/spi/callback/ShopAuthCallbackService.java +++ b/ms-biz/src/main/java/com/ms/biz/spi/callback/ShopAuthCallbackService.java @@ -53,19 +53,6 @@ public class ShopAuthCallbackService extends SPIBaseService implements Extension if (msgType == 2) { // 授权消息 shopId = msgObj.getLong("shop_id"); -// String code = msgObj.getString("code"); -// try { -// TokenCreateRequest request = new TokenCreateRequest(); -// TokenCreateParam param = request.getParam(); -// param.setCode(code); -// param.setGrantType("authorization_code"); -// log.info("create token response: " + JSON.toJSONString(param)); -// TokenCreateResponse response = request.execute(); -// TokenCreateData tokenCreateData = response.getData(); -// shopName = tokenCreateData.getShopName(); -// } catch (Exception e) { -// log.error("获取商户信息失败", e); -// } int actionType = msgObj.getInteger("action_type"); if (actionType == 1 || actionType == 3) { // 关闭授权或授权超时时,去更新授权过期时间为当期时间 diff --git a/ms-biz/src/main/java/com/ms/biz/task/DoudianMsgParseTaskService.java b/ms-biz/src/main/java/com/ms/biz/task/DoudianMsgParseTaskService.java new file mode 100644 index 0000000..9cd9ed0 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/biz/task/DoudianMsgParseTaskService.java @@ -0,0 +1,107 @@ +package com.ms.biz.task; + +import com.ms.biz.common.TaskBaseService; +import com.ms.biz.service.DoudianMsgService; +import com.ms.dal.entity.DoudianMsgParseQueue; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.concurrent.Executor; + +@Configuration +@Component +@Slf4j +public class DoudianMsgParseTaskService extends TaskBaseService { + + @Autowired + private DoudianMsgService doudianMsgService; + + /** + * 同时开启任务处理数量 + */ + public int getCorePoolSiz() { + return 5; + } + + /** + * 任务管理器名称 + */ + public String getTaskExecutorName() { + return "doudianMsgParseTaskPool"; + } + + @Bean(name = "doudianMsgParseTaskPool") + @Override + public Executor getAsyncExecutor() { + return super.getAsyncExecutor(); + } + + @Resource(name = "doudianMsgParseTaskPool") + protected Executor taskPool; + + @Override + protected Executor getTaskPool() { + return taskPool; + } + + @Async("doudianMsgParseTaskPool") + @Override + public void runTask() { + super.runTask(); + } + + @Override + public Object getTask() { + DoudianMsgParseQueue queue = doudianMsgService.lockDoudianMsgParseQueue(); + return queue; + } + + /** + * 处理任务 + * + * @param params + * @return + */ + @Override + public Object processTask(Object params) { + if (params == null) { + return null; + } + DoudianMsgParseQueue queue = (DoudianMsgParseQueue) params; + Long doudianMsgId = queue.getDoudianMsgId(); + + boolean isSuccess = false; + try { + isSuccess = doudianMsgService.processDoudianMsgParseQueue(doudianMsgId); + } catch (Exception e) { + log.error("ParseDoudianMsgTask processTask exception: ", e); + doudianMsgService.failProcessDoudianMsgParseQueue(doudianMsgId); + } + + if (isSuccess) { + return queue.getDoudianMsgParseQueueId(); + } else { + return null; + } + + } + + /** + * 清理任务 + * + * @param params + */ + @Override + public void clearTask(Object params) { + if (params == null) { + return; + } + Long queueId = (Long)params; + doudianMsgService.deleteDoudianMsgParseQueue(queueId); + } +} diff --git a/ms-biz/src/main/java/com/ms/biz/task/DsMessageConsumeMsgTaskService.java b/ms-biz/src/main/java/com/ms/biz/task/DsMessageConsumeMsgTaskService.java index 75780aa..8dc9b77 100644 --- a/ms-biz/src/main/java/com/ms/biz/task/DsMessageConsumeMsgTaskService.java +++ b/ms-biz/src/main/java/com/ms/biz/task/DsMessageConsumeMsgTaskService.java @@ -78,7 +78,7 @@ public class DsMessageConsumeMsgTaskService extends TaskBaseService { Map res = new HashMap<>(); res.put("queue", params); try { -// distributionOrderService.processDsMessage(((DsMessageConsumerQueue)params).getDsMessageId()); + dsMessageService.processDsMessage(((DsMessageConsumerQueue)params).getDsMessageId()); res.put("processResult", ResultDTO.success()); } catch (RuntimeException e) { log.error("[dsMessageConsumeMsgTask]error: ", e); diff --git a/ms-biz/src/main/java/com/ms/biz/tool/DsOrderTool.java b/ms-biz/src/main/java/com/ms/biz/tool/DsOrderTool.java index b4312cc..1510709 100644 --- a/ms-biz/src/main/java/com/ms/biz/tool/DsOrderTool.java +++ b/ms-biz/src/main/java/com/ms/biz/tool/DsOrderTool.java @@ -5,6 +5,8 @@ import java.time.ZoneOffset; import java.time.format.DateTimeFormatter; import java.util.*; +import com.ms.api.dto.dsapi.response.SourceProductInfo; +import com.ms.api.dto.dsapi.response.SourceSkuInfo; import com.ms.biz.bo.OrderItemSkuInfoBO; import com.ms.biz.consts.AfterSaleConst; import com.ms.biz.consts.DsOrderConst; @@ -129,7 +131,7 @@ public class DsOrderTool { return (sourceSkuSubNameLength == platformSkuSubNameLength && platformSkuSubNameLength == findCount); } - public static GetPurchaseOrderItemsAndSourceItemsResponseDTO.Sku getMatchSourceSkuInfo(OrderItemSkuInfoBO platformItem, Map platformSkuIdAndSourceSkuIdMap, GetPurchaseOrderItemsAndSourceItemsResponseDTO.ProductInfo productInfo) { + public static SourceSkuInfo getMatchSourceSkuInfo(OrderItemSkuInfoBO platformItem, Map platformSkuIdAndSourceSkuIdMap, SourceProductInfo productInfo) { if (platformItem == null || productInfo == null) { return null; } @@ -139,9 +141,9 @@ public class DsOrderTool { String manualRelateSourceSkuId = platformSkuIdAndSourceSkuIdMap.get(platformItem.getSkuId()); Long sourceItemId = productInfo.getSourceItemId(); - GetPurchaseOrderItemsAndSourceItemsResponseDTO.Sku manualRelateSkuInfo = null; - GetPurchaseOrderItemsAndSourceItemsResponseDTO.Sku matchSkuInfo = null; - for (GetPurchaseOrderItemsAndSourceItemsResponseDTO.Sku skuInfo : productInfo.getSkus()) { + SourceSkuInfo manualRelateSkuInfo = null; + SourceSkuInfo matchSkuInfo = null; + for (SourceSkuInfo skuInfo : productInfo.getSkus()) { if (!StringUtils.isEmpty(manualRelateSourceSkuId) && manualRelateSourceSkuId.equals(skuInfo.getSourceSkuId().toString())) { manualRelateSkuInfo = skuInfo; break; @@ -158,7 +160,7 @@ public class DsOrderTool { return manualRelateSkuInfo != null ? manualRelateSkuInfo : matchSkuInfo; } - public static int getRealSourceSkuPurchaseQuantity(Long platformSkuId, Integer platformItemTotal, GetPurchaseOrderItemsAndSourceItemsResponseDTO.Sku matchSourceSkuInfo, Map platformSkuIdAndSourceSkuInfoMap) { + public static int getRealSourceSkuPurchaseQuantity(Long platformSkuId, Integer platformItemTotal, SourceSkuInfo matchSourceSkuInfo, Map platformSkuIdAndSourceSkuInfoMap) { if (platformSkuIdAndSourceSkuInfoMap == null || platformSkuIdAndSourceSkuInfoMap.isEmpty() || matchSourceSkuInfo == null) { return platformItemTotal; } diff --git a/ms-biz/src/main/java/com/ms/biz/util/DdRequestUtil.java b/ms-biz/src/main/java/com/ms/biz/util/DDApi.java similarity index 85% rename from ms-biz/src/main/java/com/ms/biz/util/DdRequestUtil.java rename to ms-biz/src/main/java/com/ms/biz/util/DDApi.java index 96b4de0..cf27fce 100644 --- a/ms-biz/src/main/java/com/ms/biz/util/DdRequestUtil.java +++ b/ms-biz/src/main/java/com/ms/biz/util/DDApi.java @@ -2,6 +2,10 @@ package com.ms.biz.util; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; +import com.doudian.open.api.supplyCenter_cargo_detail.SupplyCenterCargoDetailRequest; +import com.doudian.open.api.supplyCenter_cargo_detail.SupplyCenterCargoDetailResponse; +import com.doudian.open.api.supplyCenter_cargo_detail.data.SupplyCenterCargoDetailData; +import com.doudian.open.api.supplyCenter_cargo_detail.param.SupplyCenterCargoDetailParam; import com.doudian.open.api.supplyCenter_order_cancel.SupplyCenterOrderCancelRequest; import com.doudian.open.api.supplyCenter_order_cancel.SupplyCenterOrderCancelResponse; import com.doudian.open.api.supplyCenter_order_cancel.data.SupplyCenterOrderCancelData; @@ -31,7 +35,7 @@ import com.ms.biz.tool.CommonTool; import lombok.extern.slf4j.Slf4j; @Slf4j -public class DdRequestUtil { +public class DDApi { public static SupplyCenterOrderConfirmData supplyCenterOrderConfirm(SupplyCenterOrderConfirmParam param) { log.info("DdApi:{}", "supplyCenterOrderConfirm"); @@ -45,7 +49,7 @@ public class DdRequestUtil { throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); } - public static SupplyCenterOrderSyncSupplierInfoData supplyCenterOrderConfirm(SupplyCenterOrderSyncSupplierInfoParam param) { + public static SupplyCenterOrderSyncSupplierInfoData supplyCenterOrderSyncSupplierInfo(SupplyCenterOrderSyncSupplierInfoParam param) { log.info("DdApi:{}", "supplyCenterOrderConfirm"); SupplyCenterOrderSyncSupplierInfoRequest request = new SupplyCenterOrderSyncSupplierInfoRequest(); request.setParam(param); @@ -105,8 +109,21 @@ public class DdRequestUtil { throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); } + public static SupplyCenterCargoDetailData supplyCenterCargoDetail(SupplyCenterCargoDetailParam param) { + log.info("DdApi:{}", "supplyCenterCargoDetail"); + SupplyCenterCargoDetailRequest request = new SupplyCenterCargoDetailRequest(); + request.setParam(param); + SupplyCenterCargoDetailResponse response = execute(request); + boolean success = CommonTool.checkDdApiRequestIsSuccess(response); + if (success && ObjectUtil.isNotEmpty(response.getData())) { + return response.getData(); + } + throw new RuntimeException(String.format("抖店请求错误:msg:%s,code:%s,subCode:%s,subMsg:%s,", response.getMsg(), response.getCode(), response.getSubCode(), response.getSubMsg())); + } + private static T execute(DoudianOpRequest request) { log.info("DdParam:{}", JSONObject.toJSONString(request.getParam())); + log.info("DdRequest:{}", JSONObject.toJSONString(request)); T response = request.execute(); log.info("DdResponse:{}", JSONObject.toJSONString(response)); return response; diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DdAftersaleMsg.java b/ms-dal/src/main/java/com/ms/dal/entity/DdAftersaleMsg.java new file mode 100644 index 0000000..923608b --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DdAftersaleMsg.java @@ -0,0 +1,61 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店售后消息 + * @TableName dd_aftersale_msg + */ + +@Data +public class DdAftersaleMsg implements Serializable { + /** + * 自增id + */ + private Long ddAftersaleMsgId; + + /** + * 官方消息id + */ + private String msgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 消息类型 + */ + private Integer tag; + + /** + * 消息内容 JSON + */ + private String data; + + /** + * 消息处理状态 + */ + private String status; + + /** + * 消息处理失败原因 + */ + private String reason; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DdTradeMsg.java b/ms-dal/src/main/java/com/ms/dal/entity/DdTradeMsg.java new file mode 100644 index 0000000..1a9769d --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DdTradeMsg.java @@ -0,0 +1,61 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店订单消息 + * @TableName dd_trade_msg + */ + +@Data +public class DdTradeMsg implements Serializable { + /** + * 自增id + */ + private Long ddTradeMsgId; + + /** + * 官方的消息id + */ + private String msgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 消息类型 + */ + private Integer tag; + + /** + * 消息内容 json + */ + private String data; + + /** + * 消息处理状态 + */ + private String status; + + /** + * 消息处理失败原因 + */ + private String reason; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgBuffer.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgBuffer.java new file mode 100644 index 0000000..afae7c3 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgBuffer.java @@ -0,0 +1,41 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店售后消息处理buffer + * @TableName doudian_aftersale_msg_buffer + */ + +@Data +public class DoudianAftersaleMsgBuffer implements Serializable { + /** + * 自增id + */ + private Long doudianAftersaleMsgBufferId; + + /** + * 官方消息id + */ + private String msgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgQueue.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgQueue.java new file mode 100644 index 0000000..4b944e3 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianAftersaleMsgQueue.java @@ -0,0 +1,61 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店售后消息处理queue + * @TableName doudian_aftersale_msg_queue + */ + +@Data +public class DoudianAftersaleMsgQueue implements Serializable { + /** + * 自增id + */ + private Long doudianAftersaleMsgQueueId; + + /** + * 官方消息id + */ + private String msgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 锁id + */ + private Integer locked; + + /** + * 锁时间 + */ + private Date gmtLocked; + + /** + * 主机名 + */ + private String hostname; + + /** + * 上次心跳时间 + */ + private Date gmtLastHeartbeat; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsg.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsg.java new file mode 100644 index 0000000..fb24093 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsg.java @@ -0,0 +1,51 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店消息推送 + * @TableName doudian_msg + */ + +@Data +public class DoudianMsg implements Serializable { + /** + * 自增id + */ + private Long doudianMsgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 消息 json,包含多條消息 + */ + private String msgBody; + + /** + * 消息处理状态 + */ + private String status; + + /** + * 处理失败原因 + */ + private String reason; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsgParseQueue.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsgParseQueue.java new file mode 100644 index 0000000..caf28d4 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianMsgParseQueue.java @@ -0,0 +1,55 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店消息解析队列 + * @TableName doudian_msg_parse_queue + */ +@Data +public class DoudianMsgParseQueue implements Serializable { + /** + * 自增id + */ + private Long doudianMsgParseQueueId; + + /** + * 抖店消息推送表主键 + */ + private Long doudianMsgId; + + /** + * 锁id + */ + private Long locked; + + /** + * 锁时间 + */ + private Date gmtLocked; + + /** + * 主机名 + */ + private String hostname; + + /** + * 上次心态时间 + */ + private Date gmtLastHeartbeat; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 创建时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgBuffer.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgBuffer.java new file mode 100644 index 0000000..9d8b670 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgBuffer.java @@ -0,0 +1,40 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店订单消息处理buffer + * @TableName doudian_trade_msg_buffer + */ +@Data +public class DoudianTradeMsgBuffer implements Serializable { + /** + * 自增id + */ + private Long doudianTradeMsgBufferId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 官方消息id + */ + private String msgId; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgQueue.java b/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgQueue.java new file mode 100644 index 0000000..b7df502 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/DoudianTradeMsgQueue.java @@ -0,0 +1,60 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 抖店订单消息处理queue + * @TableName doudian_trade_msg_queue + */ +@Data +public class DoudianTradeMsgQueue implements Serializable { + /** + * 自增id + */ + private Long doudianTradeMsgQueueId; + + /** + * 官方消息id + */ + private String msgId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 锁id + */ + private Long locked; + + /** + * 锁时间 + */ + private Date gmtLocked; + + /** + * 主键名 + */ + private String hostname; + + /** + * 上次心态时间 + */ + private Date gmtLastHeartbeat; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrder.java b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrder.java new file mode 100644 index 0000000..6c1c5d6 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrder.java @@ -0,0 +1,81 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 采购订单表 + * @TableName purchase_order + */ + +@Data +public class PlatformPurchaseOrder implements Serializable { + /** + * 选品采购单号 + */ + private String purOrderId; + + /** + * 订单id + */ + private String orderId; + + /** + * 店铺id + */ + private Long shopId; + + /** + * 外部预下单单号 + */ + private String outPreOrderId; + + /** + * 供货商订单号 + */ + private String supplierOrderId; + + /** + * 采购状态 + */ + private String purchaseStatus; + + /** + * 采购单状态 + */ + private String status; + + /** + * h5端供货商的订单跳转链接 + */ + private String supplierOrderH5Url; + + /** + * pc端供货商的订单跳转链接 + */ + private String supplierOrderPcUrl; + + /** + * h5端支付url + */ + private String payH5Url; + + /** + * pc端支付url + */ + private String payPcUrl; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderAddress.java b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderAddress.java similarity index 94% rename from ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderAddress.java rename to ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderAddress.java index 0988fb6..5b30909 100644 --- a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderAddress.java +++ b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderAddress.java @@ -11,7 +11,7 @@ import java.util.Date; */ @Data -public class PurchaseOrderAddress implements Serializable { +public class PlatformPurchaseOrderAddress implements Serializable { /** * 选品采购单号 */ diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderMaskAddress.java b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderMaskAddress.java similarity index 94% rename from ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderMaskAddress.java rename to ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderMaskAddress.java index 1169ec5..f70ba4c 100644 --- a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderMaskAddress.java +++ b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderMaskAddress.java @@ -11,7 +11,7 @@ import java.util.Date; */ @Data -public class PurchaseOrderMaskAddress implements Serializable { +public class PlatformPurchaseOrderMaskAddress implements Serializable { /** * 选品采购单号 */ diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderSku.java b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderSku.java similarity index 81% rename from ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderSku.java rename to ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderSku.java index 62c111f..dab4f9e 100644 --- a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderSku.java +++ b/ms-dal/src/main/java/com/ms/dal/entity/PlatformPurchaseOrderSku.java @@ -11,7 +11,7 @@ import java.util.Date; */ @Data -public class PurchaseOrderSku implements Serializable { +public class PlatformPurchaseOrderSku implements Serializable { /** * 采购子单 */ @@ -32,6 +32,16 @@ public class PurchaseOrderSku implements Serializable { */ private String skuOrderId; + /** + * 外部商品ID + */ + private String outerProductId; + + /** + * 外部skuid + */ + private String outerSkuId; + /** * 货品id */ diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrder.java b/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrder.java index cb2cc33..e8d642c 100644 --- a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrder.java +++ b/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrder.java @@ -3,59 +3,105 @@ package com.ms.dal.entity; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** - * 采购订单表 + * * @TableName purchase_order */ @Data public class PurchaseOrder implements Serializable { + /** + * + */ + private Long purchaseOrderId; + /** * 选品采购单号 */ private String purOrderId; /** - * 订单id + * 平台订单id + */ + private Long orderId; + + /** + * 采购平台 + */ + private String purchasePlatform; + + /** + * 采购单号 + */ + private String purchaseOrderSn; + + /** + * 买家 + */ + private String purchaseOrderBuyer; + + /** + * 卖家 + */ + private String purchaseOrderSeller; + + /** + * 金额 + */ + private BigDecimal purchaseOrderPayment; + + /** + * 采购状态 + */ + private String purchaseOrderStatus; + + /** + * 物流名称 + */ + private String purchaseOrderLogisticsName; + + /** + * 运单号 */ - private String orderId; + private String purchaseOrderWaybillCode; /** - * 店铺id + * 发货时间 */ - private Long shopId; + private Date purchaseOrderSendTime; /** - * 外部预下单单号 + * 姓名 */ - private String outPreOrderId; + private String purchaseOrderFullname; /** - * 供货商订单号 + * 手机号 */ - private String supplierOrderId; + private String purchaseOrderMobile; /** - * h5端供货商的订单跳转链接 + * 地址 */ - private String supplierOrderH5Url; + private String purchaseOrderFullAddress; /** - * pc端供货商的订单跳转链接 + * 采购时间 */ - private String supplierOrderPcUrl; + private Date purchaseOrderStartTime; /** - * h5端支付url + * 采购人姓名 */ - private String payH5Url; + private Integer logisticsIsAccept; /** - * pc端支付url + * 状态 */ - private String payPcUrl; + private String status; /** * 创建时间 diff --git a/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderItem.java b/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderItem.java new file mode 100644 index 0000000..a7b0ae8 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/entity/PurchaseOrderItem.java @@ -0,0 +1,77 @@ +package com.ms.dal.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * + * @TableName purchase_order_item + */ + +@Data +public class PurchaseOrderItem implements Serializable { + /** + * + */ + private Long purchaseOrderItemId; + + /** + * 采购ID + */ + private Long purchaseOrderId; + + /** + * 选品采购单号 + */ + private String purOrderId; + + /** + * 平台订单id + */ + private Long orderId; + + /** + * 商品ID + */ + private Long wareId; + + /** + * SKU ID + */ + private Long skuId; + + /** + * 采购链接 + */ + private String purchaseUrl; + + /** + * 采购价格 + */ + private BigDecimal purchasePrice; + + /** + * 采购数量 + */ + private Integer purchaseNum; + + /** + * 状态 + */ + private String status; + + /** + * 创建时间 + */ + private Date gmtCreate; + + /** + * 修改时间 + */ + private Date gmtModified; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DdAftersaleMsgMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DdAftersaleMsgMapper.java new file mode 100644 index 0000000..2c24ba0 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DdAftersaleMsgMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DdAftersaleMsg; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DdAftersaleMsg + */ +@Mapper +public interface DdAftersaleMsgMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DdAftersaleMsg record); + + int insertOrUpdate(DdAftersaleMsg record); + + int insertSelective(DdAftersaleMsg record); + + DdAftersaleMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DdAftersaleMsg record); + + int updateByPrimaryKey(DdAftersaleMsg record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DdTradeMsgMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DdTradeMsgMapper.java new file mode 100644 index 0000000..02a7800 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DdTradeMsgMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DdTradeMsg; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DdTradeMsg + */ +@Mapper +public interface DdTradeMsgMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DdTradeMsg record); + + int insertOrUpdate(DdTradeMsg record); + + int insertSelective(DdTradeMsg record); + + DdTradeMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DdTradeMsg record); + + int updateByPrimaryKey(DdTradeMsg record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgBufferMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgBufferMapper.java new file mode 100644 index 0000000..3a55260 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgBufferMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianAftersaleMsgBuffer; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianAftersaleMsgBuffer + */ +@Mapper +public interface DoudianAftersaleMsgBufferMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianAftersaleMsgBuffer record); + + int insertOrUpdate(DoudianAftersaleMsgBuffer record); + + int insertSelective(DoudianAftersaleMsgBuffer record); + + DoudianAftersaleMsgBuffer selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianAftersaleMsgBuffer record); + + int updateByPrimaryKey(DoudianAftersaleMsgBuffer record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgQueueMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgQueueMapper.java new file mode 100644 index 0000000..f8f6b01 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianAftersaleMsgQueueMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianAftersaleMsgQueue; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianAftersaleMsgQueue + */ +@Mapper +public interface DoudianAftersaleMsgQueueMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianAftersaleMsgQueue record); + + int insertOrUpdate(DoudianAftersaleMsgQueue record); + + int insertSelective(DoudianAftersaleMsgQueue record); + + DoudianAftersaleMsgQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianAftersaleMsgQueue record); + + int updateByPrimaryKey(DoudianAftersaleMsgQueue record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgMapper.java new file mode 100644 index 0000000..17ceb22 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianMsg; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianMsg + */ +@Mapper +public interface DoudianMsgMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianMsg record); + + int insertOrUpdate(DoudianMsg record); + + int insertSelective(DoudianMsg record); + + DoudianMsg selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianMsg record); + + int updateByPrimaryKey(DoudianMsg record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgParseQueueMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgParseQueueMapper.java new file mode 100644 index 0000000..8884c4f --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianMsgParseQueueMapper.java @@ -0,0 +1,27 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianMsgParseQueue; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianMsgParseQueue + */ +@Mapper +public interface DoudianMsgParseQueueMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianMsgParseQueue record); + + int insertOrUpdate(DoudianMsgParseQueue record); + + int insertSelective(DoudianMsgParseQueue record); + + DoudianMsgParseQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianMsgParseQueue record); + + int updateByPrimaryKey(DoudianMsgParseQueue record); + + DoudianMsgParseQueue selectUnlockRowByQueueId(Long queueId); +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgBufferMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgBufferMapper.java new file mode 100644 index 0000000..6ab4bb8 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgBufferMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianTradeMsgBuffer; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianTradeMsgBuffer + */ +@Mapper +public interface DoudianTradeMsgBufferMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianTradeMsgBuffer record); + + int insertOrUpdate(DoudianTradeMsgBuffer record); + + int insertSelective(DoudianTradeMsgBuffer record); + + DoudianTradeMsgBuffer selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianTradeMsgBuffer record); + + int updateByPrimaryKey(DoudianTradeMsgBuffer record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgQueueMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgQueueMapper.java new file mode 100644 index 0000000..2afcafa --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/DoudianTradeMsgQueueMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.DoudianTradeMsgQueue; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.DoudianTradeMsgQueue + */ +@Mapper +public interface DoudianTradeMsgQueueMapper { + + int deleteByPrimaryKey(Long id); + + int insert(DoudianTradeMsgQueue record); + + int insertOrUpdate(DoudianTradeMsgQueue record); + + int insertSelective(DoudianTradeMsgQueue record); + + DoudianTradeMsgQueue selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(DoudianTradeMsgQueue record); + + int updateByPrimaryKey(DoudianTradeMsgQueue record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderAddressMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderAddressMapper.java new file mode 100644 index 0000000..9ef786a --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderAddressMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.PlatformPurchaseOrderAddress; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.PurchaseOrderAddress + */ +@Mapper +public interface PlatformPurchaseOrderAddressMapper { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderAddress record); + + int insertOrUpdate(PlatformPurchaseOrderAddress record); + + int insertSelective(PlatformPurchaseOrderAddress record); + + PlatformPurchaseOrderAddress selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderAddress record); + + int updateByPrimaryKey(PlatformPurchaseOrderAddress record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMapper.java new file mode 100644 index 0000000..b88a5e6 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMapper.java @@ -0,0 +1,30 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.PlatformPurchaseOrder; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Entity com.ms.dal.PlatformPurchaseOrder + */ +@Mapper +public interface PlatformPurchaseOrderMapper { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrder record); + + int insertOrUpdate(PlatformPurchaseOrder record); + + int insertSelective(PlatformPurchaseOrder record); + + PlatformPurchaseOrder selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrder record); + + int updateByPrimaryKey(PlatformPurchaseOrder record); + + List getListByPurOrderIds(@Param("purOrderIds") List purOrderIds); +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMaskAddressMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMaskAddressMapper.java new file mode 100644 index 0000000..e6bd851 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderMaskAddressMapper.java @@ -0,0 +1,26 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.PlatformPurchaseOrderMaskAddress; +import org.apache.ibatis.annotations.Mapper; + +/** + * @Entity com.ms.dal.entity.PurchaseOrderMaskAddress + */ +@Mapper +public interface PlatformPurchaseOrderMaskAddressMapper { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderMaskAddress record); + + int insertOrUpdate(PlatformPurchaseOrderMaskAddress record); + + int insertSelective(PlatformPurchaseOrderMaskAddress record); + + PlatformPurchaseOrderMaskAddress selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderMaskAddress record); + + int updateByPrimaryKey(PlatformPurchaseOrderMaskAddress record); + +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderSkuMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderSkuMapper.java new file mode 100644 index 0000000..f55843e --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PlatformPurchaseOrderSkuMapper.java @@ -0,0 +1,33 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.PlatformPurchaseOrderSku; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Entity com.ms.dal.PlatformPurchaseOrderSku + */ +@Mapper +public interface PlatformPurchaseOrderSkuMapper { + + int deleteByPrimaryKey(String id); + + int insert(PlatformPurchaseOrderSku record); + + int insertOrUpdate(PlatformPurchaseOrderSku record); + + int insertSelective(PlatformPurchaseOrderSku record); + + PlatformPurchaseOrderSku selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(PlatformPurchaseOrderSku record); + + int updateByPrimaryKey(PlatformPurchaseOrderSku record); + + List getListByPurOrderIds(@Param("purOrderIds") List purOrderIds); + + + int insertBatch(List list); +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderAddressMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderAddressMapper.java deleted file mode 100644 index e53ae41..0000000 --- a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderAddressMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ms.dal.mapper; - -import com.ms.dal.entity.PurchaseOrderAddress; -import org.apache.ibatis.annotations.Mapper; - -/** - * @Entity com.ms.dal.entity.PurchaseOrderAddress - */ -@Mapper -public interface PurchaseOrderAddressMapper { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderAddress record); - - int insertOrUpdate(PurchaseOrderAddress record); - - int insertSelective(PurchaseOrderAddress record); - - PurchaseOrderAddress selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderAddress record); - - int updateByPrimaryKey(PurchaseOrderAddress record); - -} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderItemMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderItemMapper.java new file mode 100644 index 0000000..cf13273 --- /dev/null +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderItemMapper.java @@ -0,0 +1,31 @@ +package com.ms.dal.mapper; + +import com.ms.dal.entity.PurchaseOrderItem; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Entity com.ms.dal.PurchaseOrderItem + */ +@Mapper +public interface PurchaseOrderItemMapper { + + int deleteByPrimaryKey(Long id); + + int insert(PurchaseOrderItem record); + + int insertOrUpdate(PurchaseOrderItem record); + + int insertSelective(PurchaseOrderItem record); + + PurchaseOrderItem selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(PurchaseOrderItem record); + + int updateByPrimaryKey(PurchaseOrderItem record); + int insertBatch(List list); + + int updateStatusByPurchaseOrderIds(@Param("status") String status, @Param("purchaseOrderIds") List purchaseOrderIds); +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMapper.java index fab22f7..8ab3f43 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMapper.java @@ -1,10 +1,14 @@ package com.ms.dal.mapper; import com.ms.dal.entity.PurchaseOrder; +import com.ms.dal.entity.PurchaseOrderItem; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** - * @Entity com.ms.dal.entity.PurchaseOrder + * @Entity com.ms.dal.PurchaseOrder */ @Mapper public interface PurchaseOrderMapper { @@ -23,4 +27,7 @@ public interface PurchaseOrderMapper { int updateByPrimaryKey(PurchaseOrder record); + int insertBatch(List list); + + PurchaseOrder getByPurchaseOrderSn(@Param("purchaseOrderSn") String purchaseOrderSn); } diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMaskAddressMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMaskAddressMapper.java deleted file mode 100644 index b9a7b72..0000000 --- a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderMaskAddressMapper.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ms.dal.mapper; - -import com.ms.dal.entity.PurchaseOrderMaskAddress; -import org.apache.ibatis.annotations.Mapper; - -/** - * @Entity com.ms.dal.entity.PurchaseOrderMaskAddress - */ -@Mapper -public interface PurchaseOrderMaskAddressMapper { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderMaskAddress record); - - int insertOrUpdate(PurchaseOrderMaskAddress record); - - int insertSelective(PurchaseOrderMaskAddress record); - - PurchaseOrderMaskAddress selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderMaskAddress record); - - int updateByPrimaryKey(PurchaseOrderMaskAddress record); - -} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderSkuMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderSkuMapper.java deleted file mode 100644 index a5bf799..0000000 --- a/ms-dal/src/main/java/com/ms/dal/mapper/PurchaseOrderSkuMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ms.dal.mapper; - -import com.ms.dal.entity.PurchaseOrderSku; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * @Entity com.ms.dal.entity.PurchaseOrderSku - */ -@Mapper -public interface PurchaseOrderSkuMapper { - - int deleteByPrimaryKey(Long id); - - int insert(PurchaseOrderSku record); - - int insertOrUpdate(PurchaseOrderSku record); - - int insertSelective(PurchaseOrderSku record); - - PurchaseOrderSku selectByPrimaryKey(Long id); - - int updateByPrimaryKeySelective(PurchaseOrderSku record); - - int updateByPrimaryKey(PurchaseOrderSku record); - - int insertBatch(List list); -} diff --git a/ms-dal/src/main/resources/application.properties b/ms-dal/src/main/resources/application.properties index 05db26b..3a6fb8c 100644 --- a/ms-dal/src/main/resources/application.properties +++ b/ms-dal/src/main/resources/application.properties @@ -22,12 +22,16 @@ mybatis.mapper-locations=classpath*:mapper/*.xml mybatis.configuration.log-impl=org.apache.ibatis.logging.slf4j.Slf4jImpl mybatis.configuration.map-underscore-to-camel-case=true -cloud.app.key=7264840234423027259 -cloud.app.secret=4c927c89-d55c-42cf-805c-694269a4b165 +cloud.app.key=7290512081592305208 +cloud.app.secret=d21bf43e-c671-4fa5-b35a-762a9c775129 -spring.redis.host=r-2zext1mz5bw1hsochrpd.redis.rds.aliyuncs.com +#spring.redis.host=r-2zext1mz5bw1hsochrpd.redis.rds.aliyuncs.com +#spring.redis.port=6379 +#spring.redis.password=Jnk2UBjewhjY&Bhj2 + +spring.redis.host=127.0.0.1 spring.redis.port=6379 -spring.redis.password=Jnk2UBjewhjY&Bhj2 +spring.redis.password= spring.tos.domain=http://ddy-pub-dev.tos-cn-beijing.volces.com/ spring.tos.endpoint=http://tos-cn-beijing.volces.com diff --git a/ms-dal/src/main/resources/mapper/DdAftersaleMsgMapper.xml b/ms-dal/src/main/resources/mapper/DdAftersaleMsgMapper.xml new file mode 100644 index 0000000..60e05bc --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DdAftersaleMsgMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + dd_aftersale_msg_id,msg_id,shop_id, + tag,data,status, + reason,gmt_create,gmt_modified + + + + + + delete from dd_aftersale_msg + where dd_aftersale_msg_id = #{ddAftersaleMsgId,jdbcType=BIGINT} + + + insert into dd_aftersale_msg + ( dd_aftersale_msg_id,msg_id,shop_id + ,tag,data,status + ,reason,gmt_create,gmt_modified + ) + values (#{ddAftersaleMsgId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{tag,jdbcType=SMALLINT},#{data,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR} + ,#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into dd_aftersale_msg + + dd_aftersale_msg_id, + msg_id, + shop_id, + tag, + data, + status, + reason, + gmt_create, + gmt_modified, + + + #{ddAftersaleMsgId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{tag,jdbcType=SMALLINT}, + #{data,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + tag = #{tag,jdbcType=SMALLINT}, + + + data = #{data,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into dd_aftersale_msg + + dd_aftersale_msg_id, + msg_id, + shop_id, + tag, + data, + status, + reason, + gmt_create, + gmt_modified, + + + #{ddAftersaleMsgId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{tag,jdbcType=SMALLINT}, + #{data,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update dd_aftersale_msg + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + tag = #{tag,jdbcType=SMALLINT}, + + + data = #{data,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where dd_aftersale_msg_id = #{ddAftersaleMsgId,jdbcType=BIGINT} + + + update dd_aftersale_msg + set + msg_id = #{msgId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + tag = #{tag,jdbcType=SMALLINT}, + data = #{data,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + reason = #{reason,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where dd_aftersale_msg_id = #{ddAftersaleMsgId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DdTradeMsgMapper.xml b/ms-dal/src/main/resources/mapper/DdTradeMsgMapper.xml new file mode 100644 index 0000000..9fb5804 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DdTradeMsgMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + dd_trade_msg_id,msg_id,shop_id, + tag,data,status, + reason,gmt_create,gmt_modified + + + + + + delete from dd_trade_msg + where dd_trade_msg_id = #{ddTradeMsgId,jdbcType=BIGINT} + + + insert into dd_trade_msg + ( dd_trade_msg_id,msg_id,shop_id + ,tag,data,status + ,reason,gmt_create,gmt_modified + ) + values (#{ddTradeMsgId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{tag,jdbcType=SMALLINT},#{data,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR} + ,#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into dd_trade_msg + + dd_trade_msg_id, + msg_id, + shop_id, + tag, + data, + status, + reason, + gmt_create, + gmt_modified, + + + #{ddTradeMsgId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{tag,jdbcType=SMALLINT}, + #{data,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + tag = #{tag,jdbcType=SMALLINT}, + + + data = #{data,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into dd_trade_msg + + dd_trade_msg_id, + msg_id, + shop_id, + tag, + data, + status, + reason, + gmt_create, + gmt_modified, + + + #{ddTradeMsgId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{tag,jdbcType=SMALLINT}, + #{data,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update dd_trade_msg + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + tag = #{tag,jdbcType=SMALLINT}, + + + data = #{data,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where dd_trade_msg_id = #{ddTradeMsgId,jdbcType=BIGINT} + + + update dd_trade_msg + set + msg_id = #{msgId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + tag = #{tag,jdbcType=SMALLINT}, + data = #{data,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + reason = #{reason,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where dd_trade_msg_id = #{ddTradeMsgId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgBufferMapper.xml b/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgBufferMapper.xml new file mode 100644 index 0000000..6fdc533 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgBufferMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + doudian_aftersale_msg_buffer_id,msg_id,shop_id, + gmt_create,gmt_modified + + + + + + delete from doudian_aftersale_msg_buffer + where doudian_aftersale_msg_buffer_id = #{doudianAftersaleMsgBufferId,jdbcType=BIGINT} + + + insert into doudian_aftersale_msg_buffer + ( doudian_aftersale_msg_buffer_id,msg_id,shop_id + ,gmt_create,gmt_modified) + values (#{doudianAftersaleMsgBufferId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) + + + insert into doudian_aftersale_msg_buffer + + doudian_aftersale_msg_buffer_id, + msg_id, + shop_id, + gmt_create, + gmt_modified, + + + #{doudianAftersaleMsgBufferId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_aftersale_msg_buffer + + doudian_aftersale_msg_buffer_id, + msg_id, + shop_id, + gmt_create, + gmt_modified, + + + #{doudianAftersaleMsgBufferId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_aftersale_msg_buffer + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_aftersale_msg_buffer_id = #{doudianAftersaleMsgBufferId,jdbcType=BIGINT} + + + update doudian_aftersale_msg_buffer + set + msg_id = #{msgId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_aftersale_msg_buffer_id = #{doudianAftersaleMsgBufferId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgQueueMapper.xml b/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgQueueMapper.xml new file mode 100644 index 0000000..52dc722 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianAftersaleMsgQueueMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + doudian_aftersale_msg_queue_id,msg_id,shop_id, + locked,gmt_locked,hostname, + gmt_last_heartbeat,gmt_create,gmt_modified + + + + + + delete from doudian_aftersale_msg_queue + where doudian_aftersale_msg_queue_id = #{doudianAftersaleMsgQueueId,jdbcType=BIGINT} + + + insert into doudian_aftersale_msg_queue + ( doudian_aftersale_msg_queue_id,msg_id,shop_id + ,locked,gmt_locked,hostname + ,gmt_last_heartbeat,gmt_create,gmt_modified + ) + values (#{doudianAftersaleMsgQueueId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{locked,jdbcType=INTEGER},#{gmtLocked,jdbcType=TIMESTAMP},#{hostname,jdbcType=VARCHAR} + ,#{gmtLastHeartbeat,jdbcType=TIMESTAMP},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into doudian_aftersale_msg_queue + + doudian_aftersale_msg_queue_id, + msg_id, + shop_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianAftersaleMsgQueueId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{locked,jdbcType=INTEGER}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=INTEGER}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_aftersale_msg_queue + + doudian_aftersale_msg_queue_id, + msg_id, + shop_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianAftersaleMsgQueueId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{locked,jdbcType=INTEGER}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_aftersale_msg_queue + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=INTEGER}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_aftersale_msg_queue_id = #{doudianAftersaleMsgQueueId,jdbcType=BIGINT} + + + update doudian_aftersale_msg_queue + set + msg_id = #{msgId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + locked = #{locked,jdbcType=INTEGER}, + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + hostname = #{hostname,jdbcType=VARCHAR}, + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_aftersale_msg_queue_id = #{doudianAftersaleMsgQueueId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DoudianMsgMapper.xml b/ms-dal/src/main/resources/mapper/DoudianMsgMapper.xml new file mode 100644 index 0000000..7894962 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianMsgMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + doudian_msg_id,shop_id,msg_body, + status,reason,gmt_create, + gmt_modified + + + + + + delete from doudian_msg + where doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT} + + + insert into doudian_msg + ( doudian_msg_id,shop_id,msg_body + ,status,reason,gmt_create + ,gmt_modified) + values (#{doudianMsgId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{msgBody,jdbcType=VARCHAR} + ,#{status,jdbcType=VARCHAR},#{reason,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP} + ,#{gmtModified,jdbcType=TIMESTAMP}) + + + insert into doudian_msg + + doudian_msg_id, + shop_id, + msg_body, + status, + reason, + gmt_create, + gmt_modified, + + + #{doudianMsgId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{msgBody,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + msg_body = #{msgBody,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_msg + + doudian_msg_id, + shop_id, + msg_body, + status, + reason, + gmt_create, + gmt_modified, + + + #{doudianMsgId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{msgBody,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{reason,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_msg + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + msg_body = #{msgBody,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + reason = #{reason,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT} + + + update doudian_msg + set + shop_id = #{shopId,jdbcType=BIGINT}, + msg_body = #{msgBody,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + reason = #{reason,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DoudianMsgParseQueueMapper.xml b/ms-dal/src/main/resources/mapper/DoudianMsgParseQueueMapper.xml new file mode 100644 index 0000000..678682e --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianMsgParseQueueMapper.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + doudian_msg_parse_queue_id,doudian_msg_id,locked, + gmt_locked,hostname,gmt_last_heartbeat, + gmt_create,gmt_modified + + + + + + delete from doudian_msg_parse_queue + where doudian_msg_parse_queue_id = #{doudianMsgParseQueueId,jdbcType=BIGINT} + + + insert into doudian_msg_parse_queue + ( doudian_msg_parse_queue_id,doudian_msg_id,locked + ,gmt_locked,hostname,gmt_last_heartbeat + ,gmt_create,gmt_modified) + values (#{doudianMsgParseQueueId,jdbcType=BIGINT},#{doudianMsgId,jdbcType=BIGINT},#{locked,jdbcType=BIGINT} + ,#{gmtLocked,jdbcType=TIMESTAMP},#{hostname,jdbcType=VARCHAR},#{gmtLastHeartbeat,jdbcType=TIMESTAMP} + ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) + + + insert into doudian_msg_parse_queue + + doudian_msg_parse_queue_id, + doudian_msg_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianMsgParseQueueId,jdbcType=BIGINT}, + #{doudianMsgId,jdbcType=BIGINT}, + #{locked,jdbcType=BIGINT}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=BIGINT}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_msg_parse_queue + + doudian_msg_parse_queue_id, + doudian_msg_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianMsgParseQueueId,jdbcType=BIGINT}, + #{doudianMsgId,jdbcType=BIGINT}, + #{locked,jdbcType=BIGINT}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_msg_parse_queue + + + doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=BIGINT}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_msg_parse_queue_id = #{doudianMsgParseQueueId,jdbcType=BIGINT} + + + update doudian_msg_parse_queue + set + doudian_msg_id = #{doudianMsgId,jdbcType=BIGINT}, + locked = #{locked,jdbcType=BIGINT}, + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + hostname = #{hostname,jdbcType=VARCHAR}, + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_msg_parse_queue_id = #{doudianMsgParseQueueId,jdbcType=BIGINT} + + + diff --git a/ms-dal/src/main/resources/mapper/DoudianTradeMsgBufferMapper.xml b/ms-dal/src/main/resources/mapper/DoudianTradeMsgBufferMapper.xml new file mode 100644 index 0000000..bf05c51 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianTradeMsgBufferMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + doudian_trade_msg_buffer_id,shop_id,msg_id, + gmt_create,gmt_modified + + + + + + delete from doudian_trade_msg_buffer + where doudian_trade_msg_buffer_id = #{doudianTradeMsgBufferId,jdbcType=BIGINT} + + + insert into doudian_trade_msg_buffer + ( doudian_trade_msg_buffer_id,shop_id,msg_id + ,gmt_create,gmt_modified) + values (#{doudianTradeMsgBufferId,jdbcType=BIGINT},#{shopId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR} + ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) + + + insert into doudian_trade_msg_buffer + + doudian_trade_msg_buffer_id, + shop_id, + msg_id, + gmt_create, + gmt_modified, + + + #{doudianTradeMsgBufferId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_trade_msg_buffer + + doudian_trade_msg_buffer_id, + shop_id, + msg_id, + gmt_create, + gmt_modified, + + + #{doudianTradeMsgBufferId,jdbcType=BIGINT}, + #{shopId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_trade_msg_buffer + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_trade_msg_buffer_id = #{doudianTradeMsgBufferId,jdbcType=BIGINT} + + + update doudian_trade_msg_buffer + set + shop_id = #{shopId,jdbcType=BIGINT}, + msg_id = #{msgId,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_trade_msg_buffer_id = #{doudianTradeMsgBufferId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/DoudianTradeMsgQueueMapper.xml b/ms-dal/src/main/resources/mapper/DoudianTradeMsgQueueMapper.xml new file mode 100644 index 0000000..4201db6 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/DoudianTradeMsgQueueMapper.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + doudian_trade_msg_queue_id,msg_id,shop_id, + locked,gmt_locked,hostname, + gmt_last_heartbeat,gmt_create,gmt_modified + + + + + + delete from doudian_trade_msg_queue + where doudian_trade_msg_queue_id = #{doudianTradeMsgQueueId,jdbcType=BIGINT} + + + insert into doudian_trade_msg_queue + ( doudian_trade_msg_queue_id,msg_id,shop_id + ,locked,gmt_locked,hostname + ,gmt_last_heartbeat,gmt_create,gmt_modified + ) + values (#{doudianTradeMsgQueueId,jdbcType=BIGINT},#{msgId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{locked,jdbcType=BIGINT},#{gmtLocked,jdbcType=TIMESTAMP},#{hostname,jdbcType=VARCHAR} + ,#{gmtLastHeartbeat,jdbcType=TIMESTAMP},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into doudian_trade_msg_queue + + doudian_trade_msg_queue_id, + msg_id, + shop_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianTradeMsgQueueId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{locked,jdbcType=BIGINT}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=BIGINT}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into doudian_trade_msg_queue + + doudian_trade_msg_queue_id, + msg_id, + shop_id, + locked, + gmt_locked, + hostname, + gmt_last_heartbeat, + gmt_create, + gmt_modified, + + + #{doudianTradeMsgQueueId,jdbcType=BIGINT}, + #{msgId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{locked,jdbcType=BIGINT}, + #{gmtLocked,jdbcType=TIMESTAMP}, + #{hostname,jdbcType=VARCHAR}, + #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update doudian_trade_msg_queue + + + msg_id = #{msgId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + locked = #{locked,jdbcType=BIGINT}, + + + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + + + hostname = #{hostname,jdbcType=VARCHAR}, + + + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where doudian_trade_msg_queue_id = #{doudianTradeMsgQueueId,jdbcType=BIGINT} + + + update doudian_trade_msg_queue + set + msg_id = #{msgId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + locked = #{locked,jdbcType=BIGINT}, + gmt_locked = #{gmtLocked,jdbcType=TIMESTAMP}, + hostname = #{hostname,jdbcType=VARCHAR}, + gmt_last_heartbeat = #{gmtLastHeartbeat,jdbcType=TIMESTAMP}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where doudian_trade_msg_queue_id = #{doudianTradeMsgQueueId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderAddressMapper.xml b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderAddressMapper.xml similarity index 93% rename from ms-dal/src/main/resources/mapper/PurchaseOrderAddressMapper.xml rename to ms-dal/src/main/resources/mapper/PlatformPurchaseOrderAddressMapper.xml index 2d2bf27..ea7fc5e 100644 --- a/ms-dal/src/main/resources/mapper/PurchaseOrderAddressMapper.xml +++ b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderAddressMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -33,16 +33,16 @@ - delete from purchase_order_address + delete from platform_purchase_order_address where pur_order_id = #{purOrderId,jdbcType=VARCHAR} - - insert into purchase_order_address + + insert into platform_purchase_order_address ( pur_order_id,shop_id,province_name ,province_id,city_id,city_name ,town_name,town_id,street_id @@ -56,9 +56,9 @@ ,#{postReceiver,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} ) - - insert into purchase_order_address + insert into platform_purchase_order_address pur_order_id, shop_id, @@ -139,8 +139,8 @@ - - insert into purchase_order_address + + insert into platform_purchase_order_address pur_order_id, shop_id, @@ -176,8 +176,8 @@ #{gmtModified,jdbcType=TIMESTAMP}, - - update purchase_order_address + + update platform_purchase_order_address shop_id = #{shopId,jdbcType=BIGINT}, @@ -224,8 +224,8 @@ where pur_order_id = #{purOrderId,jdbcType=VARCHAR} - - update purchase_order_address + + update platform_purchase_order_address set shop_id = #{shopId,jdbcType=BIGINT}, province_name = #{provinceName,jdbcType=VARCHAR}, diff --git a/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMapper.xml b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMapper.xml new file mode 100644 index 0000000..2e86ac3 --- /dev/null +++ b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMapper.xml @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + pur_order_id,order_id,shop_id, + out_pre_order_id,supplier_order_id,supplier_order_h5_url, + supplier_order_pc_url,purchase_status,status, + pay_h5_url,pay_pc_url,gmt_create, + gmt_modified + + + + + + + delete from platform_purchase_order + where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + + + insert into platform_purchase_order + ( pur_order_id,order_id,shop_id + ,out_pre_order_id,supplier_order_id,supplier_order_h5_url + ,supplier_order_pc_url,purchase_status,status + ,pay_h5_url,pay_pc_url,gmt_create + ,gmt_modified) + values (#{purOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} + ,#{outPreOrderId,jdbcType=VARCHAR},#{supplierOrderId,jdbcType=VARCHAR},#{supplierOrderH5Url,jdbcType=VARCHAR} + ,#{supplierOrderPcUrl,jdbcType=VARCHAR},#{purchaseStatus,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR} + ,#{payH5Url,jdbcType=VARCHAR},#{payPcUrl,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP} + ,#{gmtModified,jdbcType=TIMESTAMP}) + + + insert into platform_purchase_order + + pur_order_id, + order_id, + shop_id, + out_pre_order_id, + supplier_order_id, + supplier_order_h5_url, + supplier_order_pc_url, + purchase_status, + status, + pay_h5_url, + pay_pc_url, + gmt_create, + gmt_modified, + + + #{purOrderId,jdbcType=VARCHAR}, + #{orderId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{outPreOrderId,jdbcType=VARCHAR}, + #{supplierOrderId,jdbcType=VARCHAR}, + #{supplierOrderH5Url,jdbcType=VARCHAR}, + #{supplierOrderPcUrl,jdbcType=VARCHAR}, + #{purchaseStatus,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{payH5Url,jdbcType=VARCHAR}, + #{payPcUrl,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, + + + supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, + + + supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, + + + supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, + + + purchase_status = #{purchaseStatus,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, + + + pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into platform_purchase_order + + pur_order_id, + order_id, + shop_id, + out_pre_order_id, + supplier_order_id, + supplier_order_h5_url, + supplier_order_pc_url, + purchase_status, + status, + pay_h5_url, + pay_pc_url, + gmt_create, + gmt_modified, + + + #{purOrderId,jdbcType=VARCHAR}, + #{orderId,jdbcType=VARCHAR}, + #{shopId,jdbcType=BIGINT}, + #{outPreOrderId,jdbcType=VARCHAR}, + #{supplierOrderId,jdbcType=VARCHAR}, + #{supplierOrderH5Url,jdbcType=VARCHAR}, + #{supplierOrderPcUrl,jdbcType=VARCHAR}, + #{purchaseStatus,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, + #{payH5Url,jdbcType=VARCHAR}, + #{payPcUrl,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update platform_purchase_order + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=BIGINT}, + + + out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, + + + supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, + + + supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, + + + supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, + + + purchase_status = #{purchaseStatus,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, + + + pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + + + update platform_purchase_order + set + order_id = #{orderId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=BIGINT}, + out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, + supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, + supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, + supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, + purchase_status = #{purchaseStatus,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, + pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + + diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderMaskAddressMapper.xml b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMaskAddressMapper.xml similarity index 92% rename from ms-dal/src/main/resources/mapper/PurchaseOrderMaskAddressMapper.xml rename to ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMaskAddressMapper.xml index a436516..02a6277 100644 --- a/ms-dal/src/main/resources/mapper/PurchaseOrderMaskAddressMapper.xml +++ b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderMaskAddressMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -33,16 +33,16 @@ - delete from purchase_order_mask_address + delete from platform_purchase_order_mask_address where pur_order_id = #{purOrderId,jdbcType=VARCHAR} - - insert into purchase_order_mask_address + + insert into platform_purchase_order_mask_address ( pur_order_id,shop_id,province_id ,province_name,city_id,city_name ,town_id,town_name,street_id @@ -56,9 +56,9 @@ ,#{postReceiver,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} ) - - insert into purchase_order_mask_address + insert into platform_purchase_order_mask_address pur_order_id, shop_id, @@ -139,8 +139,8 @@ - - insert into purchase_order_mask_address + + insert into platform_purchase_order_mask_address pur_order_id, shop_id, @@ -176,8 +176,8 @@ #{gmtModified,jdbcType=TIMESTAMP}, - - update purchase_order_mask_address + + update platform_purchase_order_mask_address shop_id = #{shopId,jdbcType=BIGINT}, @@ -224,8 +224,8 @@ where pur_order_id = #{purOrderId,jdbcType=VARCHAR} - - update purchase_order_mask_address + + update platform_purchase_order_mask_address set shop_id = #{shopId,jdbcType=BIGINT}, province_id = #{provinceId,jdbcType=VARCHAR}, diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderSkuMapper.xml b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderSkuMapper.xml similarity index 67% rename from ms-dal/src/main/resources/mapper/PurchaseOrderSkuMapper.xml rename to ms-dal/src/main/resources/mapper/PlatformPurchaseOrderSkuMapper.xml index 01becc3..db974cb 100644 --- a/ms-dal/src/main/resources/mapper/PurchaseOrderSkuMapper.xml +++ b/ms-dal/src/main/resources/mapper/PlatformPurchaseOrderSkuMapper.xml @@ -2,13 +2,15 @@ - + - + + + @@ -20,41 +22,46 @@ pur_sku_order_id,pur_order_id,shop_id, - sku_order_id,cargo_id,cargo_sku_id, - product_id,sku_id,num, - gmt_create,gmt_modified + sku_order_id,out_product_id,out_sku_id, + cargo_id,cargo_sku_id,product_id, + sku_id,num,gmt_create, + gmt_modified - delete from purchase_order_sku + delete from platform_purchase_order_sku where pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR} - - insert into purchase_order_sku + + insert into platform_purchase_order_sku ( pur_sku_order_id,pur_order_id,shop_id - ,sku_order_id,cargo_id,cargo_sku_id - ,product_id,sku_id,num - ,gmt_create,gmt_modified) + ,sku_order_id,outer_product_id,outer_sku_id + ,cargo_id,cargo_sku_id,product_id + ,sku_id,num,gmt_create + ,gmt_modified) values (#{purSkuOrderId,jdbcType=VARCHAR},#{purOrderId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} - ,#{skuOrderId,jdbcType=VARCHAR},#{cargoId,jdbcType=BIGINT},#{cargoSkuId,jdbcType=BIGINT} - ,#{productId,jdbcType=BIGINT},#{skuId,jdbcType=BIGINT},#{num,jdbcType=BIGINT} - ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) + ,#{skuOrderId,jdbcType=VARCHAR},#{outerProductId,jdbcType=VARCHAR},#{outerSkuId,jdbcType=VARCHAR} + ,#{cargoId,jdbcType=BIGINT},#{cargoSkuId,jdbcType=BIGINT},#{productId,jdbcType=BIGINT} + ,#{skuId,jdbcType=BIGINT},#{num,jdbcType=BIGINT},#{gmtCreate,jdbcType=TIMESTAMP} + ,#{gmtModified,jdbcType=TIMESTAMP}) - - insert into purchase_order_sku + insert into platform_purchase_order_sku pur_sku_order_id, pur_order_id, shop_id, sku_order_id, + outer_product_id, + outer_sku_id, cargo_id, cargo_sku_id, product_id, @@ -68,6 +75,8 @@ #{purOrderId,jdbcType=VARCHAR}, #{shopId,jdbcType=BIGINT}, #{skuOrderId,jdbcType=VARCHAR}, + #{outerProductId,jdbcType=VARCHAR}, + #{outerSkuId,jdbcType=VARCHAR}, #{cargoId,jdbcType=BIGINT}, #{cargoSkuId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT}, @@ -87,6 +96,12 @@ sku_order_id = #{skuOrderId,jdbcType=VARCHAR}, + + out_product_id = #{outProductId,jdbcType=VARCHAR}, + + + out_sku_id = #{outSkuId,jdbcType=VARCHAR}, + cargo_id = #{cargoId,jdbcType=BIGINT}, @@ -110,13 +125,15 @@ - - insert into purchase_order_sku + + insert into platform_purchase_order_sku pur_sku_order_id, pur_order_id, shop_id, sku_order_id, + outer_product_id, + outer_sku_id, cargo_id, cargo_sku_id, product_id, @@ -130,6 +147,8 @@ #{purOrderId,jdbcType=VARCHAR}, #{shopId,jdbcType=BIGINT}, #{skuOrderId,jdbcType=VARCHAR}, + #{outerProductId,jdbcType=VARCHAR}, + #{outerSkuId,jdbcType=VARCHAR}, #{cargoId,jdbcType=BIGINT}, #{cargoSkuId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT}, @@ -139,8 +158,8 @@ #{gmtModified,jdbcType=TIMESTAMP}, - - update purchase_order_sku + + update platform_purchase_order_sku pur_order_id = #{purOrderId,jdbcType=VARCHAR}, @@ -151,6 +170,12 @@ sku_order_id = #{skuOrderId,jdbcType=VARCHAR}, + + outer_product_id = #{outerProductId,jdbcType=VARCHAR}, + + + outer_sku_id = #{outerSkuId,jdbcType=VARCHAR}, + cargo_id = #{cargoId,jdbcType=BIGINT}, @@ -175,12 +200,14 @@ where pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR} - - update purchase_order_sku + + update platform_purchase_order_sku set pur_order_id = #{purOrderId,jdbcType=VARCHAR}, shop_id = #{shopId,jdbcType=BIGINT}, sku_order_id = #{skuOrderId,jdbcType=VARCHAR}, + outer_product_id = #{outerProductId,jdbcType=VARCHAR}, + outer_sku_id = #{outerSkuId,jdbcType=VARCHAR}, cargo_id = #{cargoId,jdbcType=BIGINT}, cargo_sku_id = #{cargoSkuId,jdbcType=BIGINT}, product_id = #{productId,jdbcType=BIGINT}, @@ -190,18 +217,37 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} where pur_sku_order_id = #{purSkuOrderId,jdbcType=VARCHAR} - - insert into purchase_order_sku + + insert into platform_purchase_order_sku (pur_sku_order_id,pur_order_id,shop_id - ,sku_order_id,cargo_id,cargo_sku_id - ,product_id,sku_id,num - ,gmt_create,gmt_modified) + ,sku_order_id,outer_product_id,outer_sku_id + ,cargo_id,cargo_sku_id,product_id + ,sku_id,num,gmt_create + ,gmt_modified) values - (#{purSkuOrderId,jdbcType=VARCHAR},#{purOrderId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} - ,#{skuOrderId,jdbcType=VARCHAR},#{cargoId,jdbcType=BIGINT},#{cargoSkuId,jdbcType=BIGINT} - ,#{productId,jdbcType=BIGINT},#{skuId,jdbcType=BIGINT},#{num,jdbcType=BIGINT} - ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) + (#{item.purSkuOrderId,jdbcType=VARCHAR},#{item.purOrderId,jdbcType=VARCHAR},#{item.shopId,jdbcType=BIGINT} + ,#{item.skuOrderId,jdbcType=VARCHAR},#{item.outerProductId,jdbcType=VARCHAR},#{item.outerSkuId,jdbcType=VARCHAR} + ,#{item.cargoId,jdbcType=BIGINT},#{item.cargoSkuId,jdbcType=BIGINT},#{item.productId,jdbcType=BIGINT} + ,#{item.skuId,jdbcType=BIGINT},#{item.num,jdbcType=BIGINT},#{item.gmtCreate,jdbcType=TIMESTAMP} + ,#{item.gmtModified,jdbcType=TIMESTAMP}) + diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderItemMapper.xml b/ms-dal/src/main/resources/mapper/PurchaseOrderItemMapper.xml new file mode 100644 index 0000000..02a7adc --- /dev/null +++ b/ms-dal/src/main/resources/mapper/PurchaseOrderItemMapper.xml @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + purchase_order_item_id,purchase_order_id,pur_order_id, + order_id,ware_id,sku_id, + purchase_url,purchase_price,purchase_num, + status,gmt_create,gmt_modified + + + + + + delete from purchase_order_item + where purchase_order_item_id = #{purchaseOrderItemId,jdbcType=BIGINT} + + + insert into purchase_order_item + ( purchase_order_item_id,purchase_order_id,pur_order_id + ,order_id,ware_id,sku_id + ,purchase_url,purchase_price,purchase_num + ,status,gmt_create,gmt_modified + ) + values (#{purchaseOrderItemId,jdbcType=BIGINT},#{purchaseOrderId,jdbcType=BIGINT},#{purOrderId,jdbcType=VARCHAR} + ,#{orderId,jdbcType=BIGINT},#{wareId,jdbcType=BIGINT},#{skuId,jdbcType=BIGINT} + ,#{purchaseUrl,jdbcType=VARCHAR},#{purchasePrice,jdbcType=DECIMAL},#{purchaseNum,jdbcType=SMALLINT} + ,#{status,jdbcType=VARCHAR},#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP} + ) + + + insert into purchase_order_item + + purchase_order_item_id, + purchase_order_id, + pur_order_id, + order_id, + ware_id, + sku_id, + purchase_url, + purchase_price, + purchase_num, + status, + gmt_create, + gmt_modified, + + + #{purchaseOrderItemId,jdbcType=BIGINT}, + #{purchaseOrderId,jdbcType=BIGINT}, + #{purOrderId,jdbcType=VARCHAR}, + #{orderId,jdbcType=BIGINT}, + #{wareId,jdbcType=BIGINT}, + #{skuId,jdbcType=BIGINT}, + #{purchaseUrl,jdbcType=VARCHAR}, + #{purchasePrice,jdbcType=DECIMAL}, + #{purchaseNum,jdbcType=SMALLINT}, + #{status,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + ON DUPLICATE KEY UPDATE + + + purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}, + + + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=BIGINT}, + + + ware_id = #{wareId,jdbcType=BIGINT}, + + + sku_id = #{skuId,jdbcType=BIGINT}, + + + purchase_url = #{purchaseUrl,jdbcType=VARCHAR}, + + + purchase_price = #{purchasePrice,jdbcType=DECIMAL}, + + + purchase_num = #{purchaseNum,jdbcType=SMALLINT}, + + + status = #{status,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + + + insert into purchase_order_item + + purchase_order_item_id, + purchase_order_id, + pur_order_id, + order_id, + ware_id, + sku_id, + purchase_url, + purchase_price, + purchase_num, + status, + gmt_create, + gmt_modified, + + + #{purchaseOrderItemId,jdbcType=BIGINT}, + #{purchaseOrderId,jdbcType=BIGINT}, + #{purOrderId,jdbcType=VARCHAR}, + #{orderId,jdbcType=BIGINT}, + #{wareId,jdbcType=BIGINT}, + #{skuId,jdbcType=BIGINT}, + #{purchaseUrl,jdbcType=VARCHAR}, + #{purchasePrice,jdbcType=DECIMAL}, + #{purchaseNum,jdbcType=SMALLINT}, + #{status,jdbcType=VARCHAR}, + #{gmtCreate,jdbcType=TIMESTAMP}, + #{gmtModified,jdbcType=TIMESTAMP}, + + + + update purchase_order_item + + + purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}, + + + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=BIGINT}, + + + ware_id = #{wareId,jdbcType=BIGINT}, + + + sku_id = #{skuId,jdbcType=BIGINT}, + + + purchase_url = #{purchaseUrl,jdbcType=VARCHAR}, + + + purchase_price = #{purchasePrice,jdbcType=DECIMAL}, + + + purchase_num = #{purchaseNum,jdbcType=SMALLINT}, + + + status = #{status,jdbcType=VARCHAR}, + + + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + + + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, + + + where purchase_order_item_id = #{purchaseOrderItemId,jdbcType=BIGINT} + + + update purchase_order_item + set + purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT}, + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=BIGINT}, + ware_id = #{wareId,jdbcType=BIGINT}, + sku_id = #{skuId,jdbcType=BIGINT}, + purchase_url = #{purchaseUrl,jdbcType=VARCHAR}, + purchase_price = #{purchasePrice,jdbcType=DECIMAL}, + purchase_num = #{purchaseNum,jdbcType=SMALLINT}, + status = #{status,jdbcType=VARCHAR}, + gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, + gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} + where purchase_order_item_id = #{purchaseOrderItemId,jdbcType=BIGINT} + + + insert into purchase_order_item + (purchase_order_item_id,purchase_order_id,order_id + ,pur_order_id,ware_id,sku_id,purchase_url + ,purchase_price,purchase_num,status + ,gmt_create,gmt_modified) + values + + (#{item.purchaseOrderItemId,jdbcType=BIGINT},#{item.purchaseOrderId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT} + ,#{purOrderId,jdbcType=VARCHAR},#{item.wareId,jdbcType=BIGINT},#{item.skuId,jdbcType=BIGINT},#{item.purchaseUrl,jdbcType=VARCHAR} + ,#{item.purchasePrice,jdbcType=DECIMAL},#{item.purchaseNum,jdbcType=SMALLINT},#{item.status,jdbcType=VARCHAR} + ,#{item.gmtCreate,jdbcType=TIMESTAMP},#{item.gmtModified,jdbcType=TIMESTAMP}) + + + + update purchase_order_item + set + status = #{status,jdbcType=VARCHAR}, + gmt_modified = now() + where 1=1 + + + and purchase_order_id in + + #{item} + + + + AND 1=0 + + + + diff --git a/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml b/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml index a8884b3..226f88d 100644 --- a/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml +++ b/ms-dal/src/main/resources/mapper/PurchaseOrderMapper.xml @@ -5,23 +5,35 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + - pur_order_id,order_id,shop_id, - out_pre_order_id,supplier_order_id,supplier_order_h5_url, - supplier_order_pc_url,pay_h5_url,pay_pc_url, + purchase_order_id,pur_order_id,order_id, + purchase_platform,purchase_order_sn,purchase_order_buyer, + purchase_order_seller,purchase_order_payment,purchase_order_status, + purchase_order_logistics_name,purchase_order_waybill_code,purchase_order_send_time, + purchase_order_fullname,purchase_order_mobile,purchase_order_full_address, + purchase_order_start_time,logistics_is_accept,status, gmt_create,gmt_modified @@ -29,78 +41,135 @@ select from purchase_order - where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + where purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT} + + delete from purchase_order - where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + where purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT} - + insert into purchase_order - ( pur_order_id,order_id,shop_id - ,out_pre_order_id,supplier_order_id,supplier_order_h5_url - ,supplier_order_pc_url,pay_h5_url,pay_pc_url + ( purchase_order_id,pur_order_id,order_id + ,purchase_platform,purchase_order_sn,purchase_order_buyer + ,purchase_order_seller,purchase_order_payment,purchase_order_status + ,purchase_order_logistics_name,purchase_order_waybill_code,purchase_order_send_time + ,purchase_order_fullname,purchase_order_mobile,purchase_order_full_address + ,purchase_order_start_time,logistics_is_accept,status ,gmt_create,gmt_modified) - values (#{purOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{shopId,jdbcType=BIGINT} - ,#{outPreOrderId,jdbcType=VARCHAR},#{supplierOrderId,jdbcType=VARCHAR},#{supplierOrderH5Url,jdbcType=VARCHAR} - ,#{supplierOrderPcUrl,jdbcType=VARCHAR},#{payH5Url,jdbcType=VARCHAR},#{payPcUrl,jdbcType=VARCHAR} + values (#{purchaseOrderId,jdbcType=BIGINT},#{purOrderId,jdbcType=VARCHAR},#{orderId,jdbcType=BIGINT} + ,#{purchasePlatform,jdbcType=VARCHAR},#{purchaseOrderSn,jdbcType=VARCHAR},#{purchaseOrderBuyer,jdbcType=VARCHAR} + ,#{purchaseOrderSeller,jdbcType=VARCHAR},#{purchaseOrderPayment,jdbcType=DECIMAL},#{purchaseOrderStatus,jdbcType=VARCHAR} + ,#{purchaseOrderLogisticsName,jdbcType=VARCHAR},#{purchaseOrderWaybillCode,jdbcType=VARCHAR},#{purchaseOrderSendTime,jdbcType=TIMESTAMP} + ,#{purchaseOrderFullname,jdbcType=VARCHAR},#{purchaseOrderMobile,jdbcType=VARCHAR},#{purchaseOrderFullAddress,jdbcType=VARCHAR} + ,#{purchaseOrderStartTime,jdbcType=TIMESTAMP},#{logisticsIsAccept,jdbcType=TINYINT},#{status,jdbcType=VARCHAR} ,#{gmtCreate,jdbcType=TIMESTAMP},#{gmtModified,jdbcType=TIMESTAMP}) - insert into purchase_order + purchase_order_id, pur_order_id, order_id, - shop_id, - out_pre_order_id, - supplier_order_id, - supplier_order_h5_url, - supplier_order_pc_url, - pay_h5_url, - pay_pc_url, + purchase_platform, + purchase_order_sn, + purchase_order_buyer, + purchase_order_seller, + purchase_order_payment, + purchase_order_status, + purchase_order_logistics_name, + purchase_order_waybill_code, + purchase_order_send_time, + purchase_order_fullname, + purchase_order_mobile, + purchase_order_full_address, + purchase_order_start_time, + logistics_is_accept, + status, gmt_create, gmt_modified, + #{purchaseOrderId,jdbcType=BIGINT}, #{purOrderId,jdbcType=VARCHAR}, - #{orderId,jdbcType=VARCHAR}, - #{shopId,jdbcType=BIGINT}, - #{outPreOrderId,jdbcType=VARCHAR}, - #{supplierOrderId,jdbcType=VARCHAR}, - #{supplierOrderH5Url,jdbcType=VARCHAR}, - #{supplierOrderPcUrl,jdbcType=VARCHAR}, - #{payH5Url,jdbcType=VARCHAR}, - #{payPcUrl,jdbcType=VARCHAR}, + #{orderId,jdbcType=BIGINT}, + #{purchasePlatform,jdbcType=VARCHAR}, + #{purchaseOrderSn,jdbcType=VARCHAR}, + #{purchaseOrderBuyer,jdbcType=VARCHAR}, + #{purchaseOrderSeller,jdbcType=VARCHAR}, + #{purchaseOrderPayment,jdbcType=DECIMAL}, + #{purchaseOrderStatus,jdbcType=VARCHAR}, + #{purchaseOrderLogisticsName,jdbcType=VARCHAR}, + #{purchaseOrderWaybillCode,jdbcType=VARCHAR}, + #{purchaseOrderSendTime,jdbcType=TIMESTAMP}, + #{purchaseOrderFullname,jdbcType=VARCHAR}, + #{purchaseOrderMobile,jdbcType=VARCHAR}, + #{purchaseOrderFullAddress,jdbcType=VARCHAR}, + #{purchaseOrderStartTime,jdbcType=TIMESTAMP}, + #{logisticsIsAccept,jdbcType=TINYINT}, + #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, ON DUPLICATE KEY UPDATE + + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + - order_id = #{orderId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=BIGINT}, + + + purchase_platform = #{purchasePlatform,jdbcType=VARCHAR}, + + + purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR}, + + + purchase_order_buyer = #{purchaseOrderBuyer,jdbcType=VARCHAR}, + + + purchase_order_seller = #{purchaseOrderSeller,jdbcType=VARCHAR}, + + + purchase_order_payment = #{purchaseOrderPayment,jdbcType=DECIMAL}, + + + purchase_order_status = #{purchaseOrderStatus,jdbcType=VARCHAR}, + + + purchase_order_logistics_name = #{purchaseOrderLogisticsName,jdbcType=VARCHAR}, - - shop_id = #{shopId,jdbcType=BIGINT}, + + purchase_order_waybill_code = #{purchaseOrderWaybillCode,jdbcType=VARCHAR}, - - out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, + + purchase_order_send_time = #{purchaseOrderSendTime,jdbcType=TIMESTAMP}, - - supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, + + purchase_order_fullname = #{purchaseOrderFullname,jdbcType=VARCHAR}, - - supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, + + purchase_order_mobile = #{purchaseOrderMobile,jdbcType=VARCHAR}, - - supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, + + purchase_order_full_address = #{purchaseOrderFullAddress,jdbcType=VARCHAR}, - - pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, + + purchase_order_start_time = #{purchaseOrderStartTime,jdbcType=TIMESTAMP}, - - pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + + logistics_is_accept = #{logisticsIsAccept,jdbcType=TINYINT}, + + + status = #{status,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, @@ -110,31 +179,49 @@ - + insert into purchase_order + purchase_order_id, pur_order_id, order_id, - shop_id, - out_pre_order_id, - supplier_order_id, - supplier_order_h5_url, - supplier_order_pc_url, - pay_h5_url, - pay_pc_url, + purchase_platform, + purchase_order_sn, + purchase_order_buyer, + purchase_order_seller, + purchase_order_payment, + purchase_order_status, + purchase_order_logistics_name, + purchase_order_waybill_code, + purchase_order_send_time, + purchase_order_fullname, + purchase_order_mobile, + purchase_order_full_address, + purchase_order_start_time, + logistics_is_accept, + status, gmt_create, gmt_modified, + #{purchaseOrderId,jdbcType=BIGINT}, #{purOrderId,jdbcType=VARCHAR}, - #{orderId,jdbcType=VARCHAR}, - #{shopId,jdbcType=BIGINT}, - #{outPreOrderId,jdbcType=VARCHAR}, - #{supplierOrderId,jdbcType=VARCHAR}, - #{supplierOrderH5Url,jdbcType=VARCHAR}, - #{supplierOrderPcUrl,jdbcType=VARCHAR}, - #{payH5Url,jdbcType=VARCHAR}, - #{payPcUrl,jdbcType=VARCHAR}, + #{orderId,jdbcType=BIGINT}, + #{purchasePlatform,jdbcType=VARCHAR}, + #{purchaseOrderSn,jdbcType=VARCHAR}, + #{purchaseOrderBuyer,jdbcType=VARCHAR}, + #{purchaseOrderSeller,jdbcType=VARCHAR}, + #{purchaseOrderPayment,jdbcType=DECIMAL}, + #{purchaseOrderStatus,jdbcType=VARCHAR}, + #{purchaseOrderLogisticsName,jdbcType=VARCHAR}, + #{purchaseOrderWaybillCode,jdbcType=VARCHAR}, + #{purchaseOrderSendTime,jdbcType=TIMESTAMP}, + #{purchaseOrderFullname,jdbcType=VARCHAR}, + #{purchaseOrderMobile,jdbcType=VARCHAR}, + #{purchaseOrderFullAddress,jdbcType=VARCHAR}, + #{purchaseOrderStartTime,jdbcType=TIMESTAMP}, + #{logisticsIsAccept,jdbcType=TINYINT}, + #{status,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP}, @@ -142,29 +229,56 @@ update purchase_order + + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + - order_id = #{orderId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=BIGINT}, + + + purchase_platform = #{purchasePlatform,jdbcType=VARCHAR}, + + + purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR}, + + + purchase_order_buyer = #{purchaseOrderBuyer,jdbcType=VARCHAR}, + + + purchase_order_seller = #{purchaseOrderSeller,jdbcType=VARCHAR}, - - shop_id = #{shopId,jdbcType=BIGINT}, + + purchase_order_payment = #{purchaseOrderPayment,jdbcType=DECIMAL}, - - out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, + + purchase_order_status = #{purchaseOrderStatus,jdbcType=VARCHAR}, - - supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, + + purchase_order_logistics_name = #{purchaseOrderLogisticsName,jdbcType=VARCHAR}, - - supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, + + purchase_order_waybill_code = #{purchaseOrderWaybillCode,jdbcType=VARCHAR}, - - supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, + + purchase_order_send_time = #{purchaseOrderSendTime,jdbcType=TIMESTAMP}, - - pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, + + purchase_order_fullname = #{purchaseOrderFullname,jdbcType=VARCHAR}, - - pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + + purchase_order_mobile = #{purchaseOrderMobile,jdbcType=VARCHAR}, + + + purchase_order_full_address = #{purchaseOrderFullAddress,jdbcType=VARCHAR}, + + + purchase_order_start_time = #{purchaseOrderStartTime,jdbcType=TIMESTAMP}, + + + logistics_is_accept = #{logisticsIsAccept,jdbcType=TINYINT}, + + + status = #{status,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, @@ -173,21 +287,50 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}, - where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + where purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT} update purchase_order set - order_id = #{orderId,jdbcType=VARCHAR}, - shop_id = #{shopId,jdbcType=BIGINT}, - out_pre_order_id = #{outPreOrderId,jdbcType=VARCHAR}, - supplier_order_id = #{supplierOrderId,jdbcType=VARCHAR}, - supplier_order_h5_url = #{supplierOrderH5Url,jdbcType=VARCHAR}, - supplier_order_pc_url = #{supplierOrderPcUrl,jdbcType=VARCHAR}, - pay_h5_url = #{payH5Url,jdbcType=VARCHAR}, - pay_pc_url = #{payPcUrl,jdbcType=VARCHAR}, + pur_order_id = #{purOrderId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=BIGINT}, + purchase_platform = #{purchasePlatform,jdbcType=VARCHAR}, + purchase_order_sn = #{purchaseOrderSn,jdbcType=VARCHAR}, + purchase_order_buyer = #{purchaseOrderBuyer,jdbcType=VARCHAR}, + purchase_order_seller = #{purchaseOrderSeller,jdbcType=VARCHAR}, + purchase_order_payment = #{purchaseOrderPayment,jdbcType=DECIMAL}, + purchase_order_status = #{purchaseOrderStatus,jdbcType=VARCHAR}, + purchase_order_logistics_name = #{purchaseOrderLogisticsName,jdbcType=VARCHAR}, + purchase_order_waybill_code = #{purchaseOrderWaybillCode,jdbcType=VARCHAR}, + purchase_order_send_time = #{purchaseOrderSendTime,jdbcType=TIMESTAMP}, + purchase_order_fullname = #{purchaseOrderFullname,jdbcType=VARCHAR}, + purchase_order_mobile = #{purchaseOrderMobile,jdbcType=VARCHAR}, + purchase_order_full_address = #{purchaseOrderFullAddress,jdbcType=VARCHAR}, + purchase_order_start_time = #{purchaseOrderStartTime,jdbcType=TIMESTAMP}, + logistics_is_accept = #{logisticsIsAccept,jdbcType=TINYINT}, + status = #{status,jdbcType=VARCHAR}, gmt_create = #{gmtCreate,jdbcType=TIMESTAMP}, gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} - where pur_order_id = #{purOrderId,jdbcType=VARCHAR} + where purchase_order_id = #{purchaseOrderId,jdbcType=BIGINT} + + insert into purchase_order + (purchase_order_id,order_id,purchase_platform,pur_order_id + ,purchase_order_sn,purchase_order_buyer,purchase_order_seller + ,purchase_order_payment,purchase_order_status,purchase_order_logistics_name + ,purchase_order_waybill_code,purchase_order_send_time,purchase_order_fullname + ,purchase_order_mobile,purchase_order_full_address,purchase_order_start_time + ,logistics_is_accept,status,gmt_create + ,gmt_modified) + values + + (#{item.purchaseOrderId,jdbcType=BIGINT},#{item.orderId,jdbcType=BIGINT},#{item.purchasePlatform,jdbcType=VARCHAR},#{purOrderId,jdbcType=VARCHAR} + ,#{item.purchaseOrderSn,jdbcType=VARCHAR},#{item.purchaseOrderBuyer,jdbcType=VARCHAR},#{item.purchaseOrderSeller,jdbcType=VARCHAR} + ,#{item.purchaseOrderPayment,jdbcType=DECIMAL},#{item.purchaseOrderStatus,jdbcType=VARCHAR},#{item.purchaseOrderLogisticsName,jdbcType=VARCHAR} + ,#{item.purchaseOrderWaybillCode,jdbcType=VARCHAR},#{item.purchaseOrderSendTime,jdbcType=TIMESTAMP},#{item.purchaseOrderFullname,jdbcType=VARCHAR} + ,#{item.purchaseOrderMobile,jdbcType=VARCHAR},#{item.purchaseOrderFullAddress,jdbcType=VARCHAR},#{item.purchaseOrderStartTime,jdbcType=TIMESTAMP} + ,#{item.logisticsIsAccept,jdbcType=TINYINT},#{item.status,jdbcType=VARCHAR},#{item.gmtCreate,jdbcType=TIMESTAMP} + ,#{item.gmtModified,jdbcType=TIMESTAMP}) + + diff --git a/ms-web/src/main/java/com/ms/web/config/CorsConfig.java b/ms-web/src/main/java/com/ms/web/config/CorsConfig.java index fcc413d..5723d6f 100644 --- a/ms-web/src/main/java/com/ms/web/config/CorsConfig.java +++ b/ms-web/src/main/java/com/ms/web/config/CorsConfig.java @@ -15,5 +15,4 @@ public class CorsConfig implements WebMvcConfigurer { .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") .maxAge(3600); } - } diff --git a/ms-web/src/main/java/com/ms/web/controller/OpenSPIController.java b/ms-web/src/main/java/com/ms/web/controller/OpenSPIController.java index 417174a..9210fd4 100644 --- a/ms-web/src/main/java/com/ms/web/controller/OpenSPIController.java +++ b/ms-web/src/main/java/com/ms/web/controller/OpenSPIController.java @@ -2,15 +2,8 @@ package com.ms.web.controller; import com.doudian.open.core.DoudianOpSpi; import com.doudian.open.core.DoudianOpSpiBizHandler; -import com.ms.api.dto.dsapi.request.*; -import com.ms.api.dto.dsapi.response.BatchCreateDistributionOrdersResponseDTO; -import com.ms.api.dto.dsapi.response.DsSuccessRetDTO; import com.ms.api.dto.dsapi.response.GetPlatformAuthUrlResponseDTO; -import com.ms.api.dto.dsapi.response.GetPurchaseOrderPayUrlResponseDTO; -import com.ms.api.dto.dsorder.PurchaseOrderDTO; -import com.ms.api.dto.dsorder.PurchaseOrderItemDTO; import com.ms.biz.bo.ShopBO; -import com.ms.biz.consts.CommonConst; import com.ms.biz.dto.openspi.request.*; import com.ms.biz.dto.openspi.response.*; import com.ms.biz.service.DistributionOrderService; @@ -21,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; -import java.util.*; @Slf4j @RestController @@ -44,7 +36,7 @@ public class OpenSPIController { private final DoudianOpSpiBizHandler querySupplyPlatformAuthBizHandler = context -> { QuerySupplyPlatformAuthParam param = context.getParam(); - + log.info("param: " + param); ShopBO shop = shopService.getShopInfo(param.getShopId()); GetPlatformAuthUrlResponseDTO response = dsApiService.getPlatformAuthUrl(shop); if (response.isSuccess()) { @@ -53,11 +45,11 @@ public class OpenSPIController { data.setAuthUrl(response.getRedirectUrl()); context.wrapSuccess(); } else { - context.wrapError(100002L, "系统错误"); + context.wrapError(100002L, response.getReason()); } }; - @RequestMapping(path = "supplyCenter/order/batchCreate" , method = {RequestMethod.GET}) + @RequestMapping(path = "supplyCenter/order/batchCreate" , method = {RequestMethod.POST}) @ResponseBody public String batchCreate(HttpServletRequest httpServletRequest) { return DoudianOpSpi.config(BatchCreateRequest.class, batchCreateBizHandler, httpServletRequest).responseJson(); @@ -70,11 +62,12 @@ public class OpenSPIController { distributionOrderService.batchCreate(param, data); context.wrapSuccess(); } catch (Throwable e) { - context.wrapError(100002L, "系统错误"); + log.error("batchCreateErr", e); + context.wrapError(100002L, e.getMessage()); } }; - @RequestMapping(path = "supplyCenter/order/batchPay" , method = {RequestMethod.GET}) + @RequestMapping(path = "supplyCenter/order/batchPay" , method = {RequestMethod.POST}) @ResponseBody public String batchPay(HttpServletRequest httpServletRequest) { return DoudianOpSpi.config(BatchCreateRequest.class, batchPayBizHandler, httpServletRequest).responseJson(); @@ -86,7 +79,7 @@ public class OpenSPIController { try { distributionOrderService.batchPay(param, data); } catch (Throwable e) { - context.wrapError(100002L, "系统错误"); + context.wrapError(100002L, e.getMessage()); } }; }