From eb2c7061211b7178b135d57aac4649f5b5135479 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=97=AD?= <2795210596@qq.com>
Date: Sun, 20 Apr 2025 09:49:02 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=9D=97=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0=E9=94=99=E8=AF=AF=EF=BC=8C=E5=A2=9E=E5=8A=A0es?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=90=83=E6=9D=86=E5=95=86=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
tmerclub-api/pom.xml | 1 +
tmerclub-api/tmerclub-api-local/pom.xml | 52 ++++++++++++
.../feign/CueProductFeignClient.java | 20 +++++
tmerclub-api/tmerclub-api-order/pom.xml | 2 +-
.../api/delivery}/dto/CurOderReturnsDTO.java | 2 +-
.../delivery/feign/DeliveryFeignClient.java | 2 +-
.../api/order}/dto/SaveOrderToMallDTO.java | 2 +-
.../api/order/feign/OrderFeignClient.java | 2 +-
tmerclub-common/pom.xml | 2 +-
.../pom.xml | 2 +-
.../cloud/common/local/bo/EsCueBrandBO.java | 30 +++++++
.../cloud/common/local/bo/EsCueProductBO.java | 63 ++++++++++++++
.../cloud/common/local/bo/EsCueSeriesBO.java | 26 ++++++
.../cloud/common/local/bo/EsCueTypeBO.java | 31 +++++++
.../common/local/constant/CueOrderStatus.java | 0
.../common/local/dto/CueProductSearchDTO.java | 0
.../common/local/vo/CueBrandSearchVO.java | 1 -
.../common/local/vo/CueProductSearchVO.java | 0
.../common/local/vo/CueSeriesSearchVO.java | 1 -
.../common/local/vo/CueTypeSearchVO.java | 1 -
tmerclub-local/pom.xml | 2 +-
.../feign/CueProductFeignController.java | 82 +++++++++++++++++++
.../manager/CreateOrderManager.java | 4 +-
.../main/resources/mapper/CueOrderMapper.xml | 2 +-
tmerclub-order/pom.xml | 2 +-
.../feign/DeliveryFeignController.java | 2 +-
.../order/feign/OrderFeignController.java | 2 +-
tmerclub-search/pom.xml | 7 +-
.../listener/CueProductCanalListener.java | 39 ++++++++-
29 files changed, 361 insertions(+), 21 deletions(-)
create mode 100644 tmerclub-api/tmerclub-api-local/pom.xml
create mode 100644 tmerclub-api/tmerclub-api-local/src/main/java/com/tmerclub/cloud/api/loacl/cuerecycle/feign/CueProductFeignClient.java
rename {tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local => tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery}/dto/CurOderReturnsDTO.java (92%)
rename {tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local => tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order}/dto/SaveOrderToMallDTO.java (92%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/pom.xml (94%)
create mode 100644 tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueBrandBO.java
create mode 100644 tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueProductBO.java
create mode 100644 tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueSeriesBO.java
create mode 100644 tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueTypeBO.java
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/constant/CueOrderStatus.java (100%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/dto/CueProductSearchDTO.java (100%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java (95%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/vo/CueProductSearchVO.java (100%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java (95%)
rename tmerclub-common/{tmerclub-common-loacl => tmerclub-common-local}/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java (95%)
create mode 100644 tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/feign/CueProductFeignController.java
diff --git a/tmerclub-api/pom.xml b/tmerclub-api/pom.xml
index 58160f4..7fc4c04 100644
--- a/tmerclub-api/pom.xml
+++ b/tmerclub-api/pom.xml
@@ -27,6 +27,7 @@
tmerclub-api-flow
tmerclub-api-payment
tmerclub-api-im
+ tmerclub-api-local
diff --git a/tmerclub-api/tmerclub-api-local/pom.xml b/tmerclub-api/tmerclub-api-local/pom.xml
new file mode 100644
index 0000000..cf9b77b
--- /dev/null
+++ b/tmerclub-api/tmerclub-api-local/pom.xml
@@ -0,0 +1,52 @@
+
+
+
+ tmerclub-api
+ com.moyuer.cloud
+ 0.0.1
+
+ 4.0.0
+
+ tmerclub-api-local
+ jar
+ 本地生活对内接口
+
+
+ com.moyuer.cloud
+ tmerclub-common-order
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-common-cache
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-common-local
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-api-product
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-api-marketing
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-api-user
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-api-search
+ ${project.version}
+
+
+
\ No newline at end of file
diff --git a/tmerclub-api/tmerclub-api-local/src/main/java/com/tmerclub/cloud/api/loacl/cuerecycle/feign/CueProductFeignClient.java b/tmerclub-api/tmerclub-api-local/src/main/java/com/tmerclub/cloud/api/loacl/cuerecycle/feign/CueProductFeignClient.java
new file mode 100644
index 0000000..c01c257
--- /dev/null
+++ b/tmerclub-api/tmerclub-api-local/src/main/java/com/tmerclub/cloud/api/loacl/cuerecycle/feign/CueProductFeignClient.java
@@ -0,0 +1,20 @@
+package com.tmerclub.cloud.api.loacl.cuerecycle.feign;
+
+import com.tmerclub.cloud.common.local.bo.EsCueProductBO;
+
+/**
+ * 球杆商品本地调用服务
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+public interface CueProductFeignClient {
+
+ /**
+ * 根据商品id获取商品信息
+ *
+ * @param productId 商品id
+ * @return 商品信息
+ */
+ EsCueProductBO getEsCueProduct(Long productId);
+}
diff --git a/tmerclub-api/tmerclub-api-order/pom.xml b/tmerclub-api/tmerclub-api-order/pom.xml
index 5af5b46..8d8b10f 100644
--- a/tmerclub-api/tmerclub-api-order/pom.xml
+++ b/tmerclub-api/tmerclub-api-order/pom.xml
@@ -25,7 +25,7 @@
com.moyuer.cloud
- tmerclub-common-loacl
+ tmerclub-common-local
${project.version}
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/CurOderReturnsDTO.java b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/dto/CurOderReturnsDTO.java
similarity index 92%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/CurOderReturnsDTO.java
rename to tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/dto/CurOderReturnsDTO.java
index 19753ca..5a35522 100644
--- a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/CurOderReturnsDTO.java
+++ b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/dto/CurOderReturnsDTO.java
@@ -1,4 +1,4 @@
-package com.tmerclub.cloud.common.local.dto;
+package com.tmerclub.cloud.api.delivery.dto;
import lombok.Data;
diff --git a/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/feign/DeliveryFeignClient.java b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/feign/DeliveryFeignClient.java
index b565315..60ed831 100644
--- a/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/feign/DeliveryFeignClient.java
+++ b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/delivery/feign/DeliveryFeignClient.java
@@ -2,7 +2,7 @@ package com.tmerclub.cloud.api.delivery.feign;
import com.tmerclub.cloud.api.delivery.dto.CalculateAndGetDeliverInfoDTO;
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
-import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
+import com.tmerclub.cloud.api.delivery.dto.CurOderReturnsDTO;
import com.tmerclub.cloud.common.order.vo.TransportVO;
import com.tmerclub.cloud.common.order.vo.UserDeliveryInfoVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/SaveOrderToMallDTO.java b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/dto/SaveOrderToMallDTO.java
similarity index 92%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/SaveOrderToMallDTO.java
rename to tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/dto/SaveOrderToMallDTO.java
index 78bf7a7..1f21f31 100644
--- a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/SaveOrderToMallDTO.java
+++ b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/dto/SaveOrderToMallDTO.java
@@ -1,4 +1,4 @@
-package com.tmerclub.cloud.common.local.dto;
+package com.tmerclub.cloud.api.order.dto;
import lombok.Data;
diff --git a/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/feign/OrderFeignClient.java b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/feign/OrderFeignClient.java
index e6f3df8..eb95fe3 100644
--- a/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/feign/OrderFeignClient.java
+++ b/tmerclub-api/tmerclub-api-order/src/main/java/com/tmerclub/cloud/api/order/feign/OrderFeignClient.java
@@ -11,7 +11,7 @@ import com.tmerclub.cloud.api.user.bo.UserOrderStatisticBO;
import com.tmerclub.cloud.api.user.bo.UserOrderStatisticListBO;
import com.tmerclub.cloud.api.user.dto.MemberReqDTO;
import com.tmerclub.cloud.common.exception.LuckException;
-import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
+import com.tmerclub.cloud.api.order.dto.SaveOrderToMallDTO;
import com.tmerclub.cloud.common.order.bo.EsOrderBO;
import com.tmerclub.cloud.common.order.bo.OrderIdWithRefundIdBO;
import com.tmerclub.cloud.common.order.bo.OrderStatusBO;
diff --git a/tmerclub-common/pom.xml b/tmerclub-common/pom.xml
index e73240e..765e5a3 100644
--- a/tmerclub-common/pom.xml
+++ b/tmerclub-common/pom.xml
@@ -24,7 +24,7 @@
tmerclub-common-mongodb
tmerclub-common-leaf
tmerclub-common-sharding-proxy
- tmerclub-common-loacl
+ tmerclub-common-local
diff --git a/tmerclub-common/tmerclub-common-loacl/pom.xml b/tmerclub-common/tmerclub-common-local/pom.xml
similarity index 94%
rename from tmerclub-common/tmerclub-common-loacl/pom.xml
rename to tmerclub-common/tmerclub-common-local/pom.xml
index 282b182..dc15462 100644
--- a/tmerclub-common/tmerclub-common-loacl/pom.xml
+++ b/tmerclub-common/tmerclub-common-local/pom.xml
@@ -9,7 +9,7 @@
4.0.0
- tmerclub-common-loacl
+ tmerclub-common-local
jar
tmerclub 本地生活相关代码
diff --git a/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueBrandBO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueBrandBO.java
new file mode 100644
index 0000000..4ac0df9
--- /dev/null
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueBrandBO.java
@@ -0,0 +1,30 @@
+package com.tmerclub.cloud.common.local.bo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * ES查询球杆品牌信息
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+@Data
+public class EsCueBrandBO implements Serializable {
+ @Serial
+ private static final long serialVersionUID = 1L;
+ /**
+ * 品牌ID
+ */
+ private Long brandId;
+ /**
+ * 品牌名称
+ */
+ private String brandName;
+ /**
+ * 品牌logo
+ */
+ private String brandLogo;
+}
\ No newline at end of file
diff --git a/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueProductBO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueProductBO.java
new file mode 100644
index 0000000..a6896f1
--- /dev/null
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueProductBO.java
@@ -0,0 +1,63 @@
+package com.tmerclub.cloud.common.local.bo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * ES查询球杆商品信息
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+@Data
+public class EsCueProductBO implements Serializable {
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 球杆ID
+ */
+ private Long productId;
+ /**
+ * 球杆类型ID
+ */
+ private Long typeId;
+ /**
+ * 球杆品牌ID
+ */
+ private Long brandId;
+ /**
+ * 球杆系列ID
+ */
+ private Long seriesId;
+ /**
+ * 球杆名称
+ */
+ private String productName;
+ /**
+ * 球杆描述
+ */
+ private String productDescription;
+ /**
+ * 球杆图片
+ */
+ private String productImages;
+ /**
+ * 球杆价格
+ */
+ private Long productPrice;
+ /**
+ * 球杆品牌信息
+ */
+ private EsCueBrandBO brandItem;
+ /**
+ * 球杆系列信息
+ */
+ private EsCueSeriesBO seriesItem;
+ /**
+ * 球杆类型信息
+ */
+ private EsCueTypeBO typeItem;
+}
diff --git a/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueSeriesBO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueSeriesBO.java
new file mode 100644
index 0000000..7e804f0
--- /dev/null
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueSeriesBO.java
@@ -0,0 +1,26 @@
+package com.tmerclub.cloud.common.local.bo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * ES查询球杆系列信息
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+@Data
+public class EsCueSeriesBO implements Serializable {
+ @Serial
+ private static final long serialVersionUID = 1L;
+ /**
+ * 系列ID
+ */
+ private Long seriesId;
+ /**
+ * 系列名称
+ */
+ private String seriesName;
+}
diff --git a/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueTypeBO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueTypeBO.java
new file mode 100644
index 0000000..30a1dc7
--- /dev/null
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/bo/EsCueTypeBO.java
@@ -0,0 +1,31 @@
+package com.tmerclub.cloud.common.local.bo;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * 类型信息
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+@Data
+public class EsCueTypeBO implements Serializable {
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 类型ID
+ */
+ private Long typeId;
+ /**
+ * 类型名称
+ */
+ private String typeName;
+ /**
+ * 类型图片
+ */
+ private String typeImage;
+}
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/constant/CueOrderStatus.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/constant/CueOrderStatus.java
similarity index 100%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/constant/CueOrderStatus.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/constant/CueOrderStatus.java
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/CueProductSearchDTO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/dto/CueProductSearchDTO.java
similarity index 100%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/dto/CueProductSearchDTO.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/dto/CueProductSearchDTO.java
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java
similarity index 95%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java
index 76e028c..d91518e 100644
--- a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueBrandSearchVO.java
@@ -5,7 +5,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
-import java.util.Date;
/**
* 球杆品牌视图
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueProductSearchVO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueProductSearchVO.java
similarity index 100%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueProductSearchVO.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueProductSearchVO.java
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java
similarity index 95%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java
index 2b75fbc..b4e57f3 100644
--- a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueSeriesSearchVO.java
@@ -5,7 +5,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
-import java.util.Date;
/**
* 球杆系列视图
diff --git a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java
similarity index 95%
rename from tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java
rename to tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java
index e59a94e..a10ea00 100644
--- a/tmerclub-common/tmerclub-common-loacl/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java
+++ b/tmerclub-common/tmerclub-common-local/src/main/java/com/tmerclub/cloud/common/local/vo/CueTypeSearchVO.java
@@ -5,7 +5,6 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
-import java.util.Date;
/**
* 球杆类型视图
diff --git a/tmerclub-local/pom.xml b/tmerclub-local/pom.xml
index f1fb08c..a6045fe 100644
--- a/tmerclub-local/pom.xml
+++ b/tmerclub-local/pom.xml
@@ -31,7 +31,7 @@
com.moyuer.cloud
- tmerclub-common-loacl
+ tmerclub-api-local
${project.version}
diff --git a/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/feign/CueProductFeignController.java b/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/feign/CueProductFeignController.java
new file mode 100644
index 0000000..b87e652
--- /dev/null
+++ b/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/feign/CueProductFeignController.java
@@ -0,0 +1,82 @@
+package com.tmerclub.cloud.cuerecycle.feign;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.tmerclub.cloud.api.loacl.cuerecycle.feign.CueProductFeignClient;
+import com.tmerclub.cloud.common.local.bo.EsCueBrandBO;
+import com.tmerclub.cloud.common.local.bo.EsCueProductBO;
+import com.tmerclub.cloud.common.local.bo.EsCueSeriesBO;
+import com.tmerclub.cloud.common.local.bo.EsCueTypeBO;
+import com.tmerclub.cloud.cuerecycle.mapper.CueBrandMapper;
+import com.tmerclub.cloud.cuerecycle.mapper.CueProductMapper;
+import com.tmerclub.cloud.cuerecycle.mapper.CueSeriesMapper;
+import com.tmerclub.cloud.cuerecycle.mapper.CueTypeMapper;
+import com.tmerclub.cloud.cuerecycle.model.vo.CueBrandVO;
+import com.tmerclub.cloud.cuerecycle.model.vo.CueProductVO;
+import com.tmerclub.cloud.cuerecycle.model.vo.CueSeriesVO;
+import com.tmerclub.cloud.cuerecycle.model.vo.CueTypeVO;
+import jakarta.annotation.Resource;
+import org.apache.dubbo.config.annotation.DubboService;
+
+/**
+ * 球杆商品本地调用服务实现
+ *
+ * @author: frank
+ * @create: 2025-04-19
+ **/
+@DubboService
+public class CueProductFeignController implements CueProductFeignClient {
+
+ @Resource
+ CueProductMapper cueProductMapper;
+ @Resource
+ CueTypeMapper cueTypeMapper;
+ @Resource
+ CueBrandMapper cueBrandMapper;
+ @Resource
+ CueSeriesMapper cueSeriesMapper;
+
+ @Override
+ public EsCueProductBO getEsCueProduct(Long productId) {
+ // 查询ES结构数据
+ CueProductVO cueProductVO = cueProductMapper.getById(productId);
+ if (ObjectUtil.isNotNull(cueProductVO)) {
+ EsCueProductBO esCueProductBO = new EsCueProductBO();
+ esCueProductBO.setProductId(cueProductVO.getProductId());
+ esCueProductBO.setTypeId(cueProductVO.getTypeId());
+ esCueProductBO.setBrandId(cueProductVO.getBrandId());
+ esCueProductBO.setSeriesId(cueProductVO.getSeriesId());
+ esCueProductBO.setProductName(cueProductVO.getProductName());
+ esCueProductBO.setProductDescription(cueProductVO.getProductDescription());
+ esCueProductBO.setProductImages(cueProductVO.getProductImages());
+ esCueProductBO.setProductPrice(cueProductVO.getProductPrice());
+ // 查询关联品牌信息
+ EsCueBrandBO brandItem = new EsCueBrandBO();
+ if (ObjectUtil.isNotNull(cueProductVO.getBrandId())) {
+ CueBrandVO cueBrandVO = cueBrandMapper.getById(cueProductVO.getBrandId());
+ brandItem.setBrandId(cueBrandVO.getBrandId());
+ brandItem.setBrandName(cueBrandVO.getBrandName());
+ brandItem.setBrandLogo(cueBrandVO.getBrandLogo());
+ }
+ esCueProductBO.setBrandItem(brandItem);
+ // 查询关联系列信息
+ EsCueSeriesBO seriesItem = new EsCueSeriesBO();
+ if (ObjectUtil.isNotNull(cueProductVO.getSeriesId())) {
+ CueSeriesVO cueSeriesVO = cueSeriesMapper.getById(cueProductVO.getSeriesId());
+ seriesItem.setSeriesId(cueSeriesVO.getSeriesId());
+ seriesItem.setSeriesName(cueSeriesVO.getSeriesName());
+ }
+ esCueProductBO.setSeriesItem(seriesItem);
+ // 查询关联类型信息
+ EsCueTypeBO typeItem = new EsCueTypeBO();
+ if (ObjectUtil.isNotNull(cueProductVO.getTypeId())) {
+ CueTypeVO cueTypeVO = cueTypeMapper.getById(cueProductVO.getTypeId());
+ typeItem.setTypeId(cueTypeVO.getTypeId());
+ typeItem.setTypeName(cueTypeVO.getTypeName());
+ typeItem.setTypeImage(cueTypeVO.getTypeImage());
+ }
+ esCueProductBO.setTypeItem(typeItem);
+ return esCueProductBO;
+ }
+ return null;
+ }
+}
diff --git a/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/manager/CreateOrderManager.java b/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/manager/CreateOrderManager.java
index ffaa21a..ea88d1a 100644
--- a/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/manager/CreateOrderManager.java
+++ b/tmerclub-local/src/main/java/com/tmerclub/cloud/cuerecycle/manager/CreateOrderManager.java
@@ -11,8 +11,8 @@ import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
import com.tmerclub.cloud.api.user.feign.UserBalanceLogFeignClient;
import com.tmerclub.cloud.common.exception.LuckException;
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
-import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
-import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
+import com.tmerclub.cloud.api.delivery.dto.CurOderReturnsDTO;
+import com.tmerclub.cloud.api.order.dto.SaveOrderToMallDTO;
import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
import com.tmerclub.cloud.common.order.vo.UserAddrVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
diff --git a/tmerclub-local/src/main/resources/mapper/CueOrderMapper.xml b/tmerclub-local/src/main/resources/mapper/CueOrderMapper.xml
index 807581e..1bb60a0 100644
--- a/tmerclub-local/src/main/resources/mapper/CueOrderMapper.xml
+++ b/tmerclub-local/src/main/resources/mapper/CueOrderMapper.xml
@@ -193,7 +193,7 @@
send_number = #{sendNumber},
-
+
warehouse_id = #{warehouseId},
diff --git a/tmerclub-order/pom.xml b/tmerclub-order/pom.xml
index 58a3053..2fbce81 100644
--- a/tmerclub-order/pom.xml
+++ b/tmerclub-order/pom.xml
@@ -42,7 +42,7 @@
com.moyuer.cloud
- tmerclub-common-loacl
+ tmerclub-common-local
${project.version}
diff --git a/tmerclub-order/src/main/java/com/tmerclub/cloud/delivery/feign/DeliveryFeignController.java b/tmerclub-order/src/main/java/com/tmerclub/cloud/delivery/feign/DeliveryFeignController.java
index e91d007..ea123e9 100644
--- a/tmerclub-order/src/main/java/com/tmerclub/cloud/delivery/feign/DeliveryFeignController.java
+++ b/tmerclub-order/src/main/java/com/tmerclub/cloud/delivery/feign/DeliveryFeignController.java
@@ -7,7 +7,7 @@ import com.tmerclub.cloud.api.delivery.feign.DeliveryFeignClient;
import com.tmerclub.cloud.api.delivery.vo.ShopTransportVO;
import com.tmerclub.cloud.api.user.feign.UserAddrFeignClient;
import com.tmerclub.cloud.common.constant.Constant;
-import com.tmerclub.cloud.common.local.dto.CurOderReturnsDTO;
+import com.tmerclub.cloud.api.delivery.dto.CurOderReturnsDTO;
import com.tmerclub.cloud.common.order.vo.*;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.common.util.BeanUtil;
diff --git a/tmerclub-order/src/main/java/com/tmerclub/cloud/order/feign/OrderFeignController.java b/tmerclub-order/src/main/java/com/tmerclub/cloud/order/feign/OrderFeignController.java
index 6875bc8..d2b4e90 100644
--- a/tmerclub-order/src/main/java/com/tmerclub/cloud/order/feign/OrderFeignController.java
+++ b/tmerclub-order/src/main/java/com/tmerclub/cloud/order/feign/OrderFeignController.java
@@ -22,7 +22,7 @@ import com.tmerclub.cloud.common.exception.LuckException;
import com.tmerclub.cloud.common.i18n.LanguageEnum;
import com.tmerclub.cloud.common.leaf.manager.SegmentManager;
import com.tmerclub.cloud.common.local.constant.CueOrderStatus;
-import com.tmerclub.cloud.common.local.dto.SaveOrderToMallDTO;
+import com.tmerclub.cloud.api.order.dto.SaveOrderToMallDTO;
import com.tmerclub.cloud.common.order.bo.EsOrderBO;
import com.tmerclub.cloud.common.order.bo.OrderIdWithRefundIdBO;
import com.tmerclub.cloud.common.order.bo.OrderStatusBO;
diff --git a/tmerclub-search/pom.xml b/tmerclub-search/pom.xml
index 24699e3..f689789 100644
--- a/tmerclub-search/pom.xml
+++ b/tmerclub-search/pom.xml
@@ -31,7 +31,12 @@
com.moyuer.cloud
- tmerclub-common-loacl
+ tmerclub-common-local
+ ${project.version}
+
+
+ com.moyuer.cloud
+ tmerclub-api-local
${project.version}
diff --git a/tmerclub-search/src/main/java/com/tmerclub/cloud/search/listener/CueProductCanalListener.java b/tmerclub-search/src/main/java/com/tmerclub/cloud/search/listener/CueProductCanalListener.java
index 7132978..133386b 100644
--- a/tmerclub-search/src/main/java/com/tmerclub/cloud/search/listener/CueProductCanalListener.java
+++ b/tmerclub-search/src/main/java/com/tmerclub/cloud/search/listener/CueProductCanalListener.java
@@ -1,7 +1,13 @@
package com.tmerclub.cloud.search.listener;
+import cn.hutool.core.util.ObjectUtil;
+import com.tmerclub.cloud.api.loacl.cuerecycle.feign.CueProductFeignClient;
+import com.tmerclub.cloud.common.local.bo.EsCueProductBO;
import com.tmerclub.cloud.search.bo.CueProductBO;
import com.tmerclub.cloud.search.canal.model.CanalBinLogResult;
+import com.tmerclub.cloud.search.constant.EsIndexEnum;
+import com.tmerclub.cloud.search.util.EsSearchUtil;
+import org.apache.dubbo.config.annotation.DubboReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -17,13 +23,40 @@ public class CueProductCanalListener extends BaseCanalBinlogEventThrowExceptionP
private static final Logger log = LoggerFactory.getLogger(CueProductCanalListener.class);
+ @DubboReference
+ CueProductFeignClient cueProductFeignClient;
+
@Override
protected void processInsertInternal(CanalBinLogResult result) {
- log.error("球杆商品新增:{}", result.getDatabaseName());
+ log.info("球杆商品新增:{}", result.getDatabaseName());
+ CueProductBO afterData = result.getAfterData();
+ EsCueProductBO esCueProductBO = getEsCueProductData(afterData.getProductId());
+ if (ObjectUtil.isNull(esCueProductBO)) {
+ log.error("球杆商品新增异常ID:{}", afterData.getProductId());
+ return;
+ }
+ EsSearchUtil.esSave(afterData.getProductId(), EsIndexEnum.CUE_PRODUCT, esCueProductBO);
}
@Override
protected void processUpdateInternal(CanalBinLogResult result) {
- log.error("球杆商品修改:{}", result.getDatabaseName());
+ log.info("球杆商品修改:{}", result.getDatabaseName());
+ CueProductBO afterData = result.getAfterData();
+ EsCueProductBO esCueProductBO = getEsCueProductData(afterData.getProductId());
+ if (ObjectUtil.isNull(esCueProductBO)) {
+ log.error("球杆商品修改异常ID:{}", afterData.getProductId());
+ return;
+ }
+ EsSearchUtil.esUpdate(afterData.getProductId(), EsIndexEnum.CUE_PRODUCT, esCueProductBO);
}
-}
+
+ /**
+ * 获取球杆商品数据
+ *
+ * @param productId 商品ID
+ * @return 球杆商品数据
+ */
+ private EsCueProductBO getEsCueProductData(Long productId) {
+ return cueProductFeignClient.getEsCueProduct(productId);
+ }
+}
\ No newline at end of file