记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
fc3794cd
Commit
fc3794cd
authored
Mar 26, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收钱吧 商品同步相关逻辑整理修改
parent
111223e2
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
387 additions
and
413 deletions
+387
-413
sqb_goods_integration.sql
docu/sqb_goods_integration.sql
+8
-8
GoblinSqbGoodsSyncParam.java
...lin/param/shouqianba/request/GoblinSqbGoodsSyncParam.java
+31
-0
IGoblinSqbGoodsService.java
...uidnet/service/goblin/service/IGoblinSqbGoodsService.java
+15
-6
GoblinSqbGoodsExt.java
...om/liquidnet/service/goblin/entity/GoblinSqbGoodsExt.java
+3
-2
GoblinSqbGoodsController.java
...t/service/goblin/controller/GoblinSqbGoodsController.java
+33
-7
GoblinSqbGoodsServiceImpl.java
...ervice/goblin/service/impl/GoblinSqbGoodsServiceImpl.java
+297
-390
No files found.
docu/sqb_goods_integration.sql
View file @
fc3794cd
...
@@ -6,8 +6,8 @@ CREATE TABLE `goblin_sqb_mall_info` (
...
@@ -6,8 +6,8 @@ CREATE TABLE `goblin_sqb_mall_info` (
`signature`
VARCHAR
(
256
)
NOT
NULL
COMMENT
'商城密钥'
,
`signature`
VARCHAR
(
256
)
NOT
NULL
COMMENT
'商城密钥'
,
`store_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'关联我方店铺ID'
,
`store_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'关联我方店铺ID'
,
`status`
TINYINT
NOT
NULL
DEFAULT
1
COMMENT
'0-禁用 1-启用'
,
`status`
TINYINT
NOT
NULL
DEFAULT
1
COMMENT
'0-禁用 1-启用'
,
`created_at`
DATETIME
NO
T
NULL
,
`created_at`
timestamp
NULL
DEFAUL
T
NULL
,
`updated_at`
DATETIME
NO
T
NULL
,
`updated_at`
timestamp
NULL
DEFAUL
T
NULL
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
UNIQUE
KEY
`uk_mall_sn`
(
`mall_sn`
)
UNIQUE
KEY
`uk_mall_sn`
(
`mall_sn`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'收钱吧商城信息'
;
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'收钱吧商城信息'
;
...
@@ -20,8 +20,8 @@ CREATE TABLE `goblin_sqb_goods_ext` (
...
@@ -20,8 +20,8 @@ CREATE TABLE `goblin_sqb_goods_ext` (
`sqb_product_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'收钱吧商品ID'
,
`sqb_product_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'收钱吧商品ID'
,
`sqb_product_sn`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'收钱吧商品编号'
,
`sqb_product_sn`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'收钱吧商品编号'
,
`sqb_sku_id`
VARCHAR
(
64
)
COMMENT
'收钱吧SKU ID'
,
`sqb_sku_id`
VARCHAR
(
64
)
COMMENT
'收钱吧SKU ID'
,
`created_at`
DATETIME
NO
T
NULL
,
`created_at`
timestamp
NULL
DEFAUL
T
NULL
,
`updated_at`
DATETIME
NO
T
NULL
,
`updated_at`
timestamp
NULL
DEFAUL
T
NULL
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
UNIQUE
KEY
`uk_spu_sku`
(
`spu_id`
,
`sku_id`
),
UNIQUE
KEY
`uk_spu_sku`
(
`spu_id`
,
`sku_id`
),
KEY
`idx_mall_sn`
(
`mall_sn`
)
KEY
`idx_mall_sn`
(
`mall_sn`
)
...
@@ -34,8 +34,8 @@ CREATE TABLE `goblin_sqb_performance_goods` (
...
@@ -34,8 +34,8 @@ CREATE TABLE `goblin_sqb_performance_goods` (
`sku_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'SKU ID'
,
`sku_id`
VARCHAR
(
64
)
NOT
NULL
COMMENT
'SKU ID'
,
`sort`
INT
NOT
NULL
DEFAULT
0
COMMENT
'排序权重'
,
`sort`
INT
NOT
NULL
DEFAULT
0
COMMENT
'排序权重'
,
`status`
TINYINT
NOT
NULL
DEFAULT
1
COMMENT
'0-禁用 1-启用'
,
`status`
TINYINT
NOT
NULL
DEFAULT
1
COMMENT
'0-禁用 1-启用'
,
`created_at`
DATETIME
NO
T
NULL
,
`created_at`
timestamp
NULL
DEFAUL
T
NULL
,
`updated_at`
DATETIME
NO
T
NULL
,
`updated_at`
timestamp
NULL
DEFAUL
T
NULL
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
UNIQUE
KEY
`uk_perf_sku`
(
`performances_id`
,
`sku_id`
),
UNIQUE
KEY
`uk_perf_sku`
(
`performances_id`
,
`sku_id`
),
KEY
`idx_performances_id`
(
`performances_id`
)
KEY
`idx_performances_id`
(
`performances_id`
)
...
@@ -59,8 +59,8 @@ CREATE TABLE `goblin_sqb_order` (
...
@@ -59,8 +59,8 @@ CREATE TABLE `goblin_sqb_order` (
`coupon_expire_time`
DATETIME
COMMENT
'券码过期时间'
,
`coupon_expire_time`
DATETIME
COMMENT
'券码过期时间'
,
`status`
TINYINT
NOT
NULL
DEFAULT
0
COMMENT
'0-待支付 1-已支付 2-已核销 3-已退款 4-退款中 9-失败'
,
`status`
TINYINT
NOT
NULL
DEFAULT
0
COMMENT
'0-待支付 1-已支付 2-已核销 3-已退款 4-退款中 9-失败'
,
`refund_reason`
VARCHAR
(
256
)
COMMENT
'退款原因'
,
`refund_reason`
VARCHAR
(
256
)
COMMENT
'退款原因'
,
`created_at`
DATETIME
NO
T
NULL
,
`created_at`
timestamp
NULL
DEFAUL
T
NULL
,
`updated_at`
DATETIME
NO
T
NULL
,
`updated_at`
timestamp
NULL
DEFAUL
T
NULL
,
PRIMARY
KEY
(
`mid`
),
PRIMARY
KEY
(
`mid`
),
UNIQUE
KEY
`uk_order_id`
(
`order_id`
),
UNIQUE
KEY
`uk_order_id`
(
`order_id`
),
KEY
`idx_user_id`
(
`user_id`
),
KEY
`idx_user_id`
(
`user_id`
),
...
...
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/param/shouqianba/request/GoblinSqbGoodsSyncParam.java
0 → 100644
View file @
fc3794cd
package
com
.
liquidnet
.
service
.
goblin
.
param
.
shouqianba
.
request
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
/**
* 收钱吧商品同步单项参数
*/
@Data
public
class
GoblinSqbGoodsSyncParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@NotBlank
(
message
=
"收钱吧商品 ID 不能为空"
)
@ApiModelProperty
(
value
=
"收钱吧商品 ID (对应 spuId)"
,
required
=
true
)
private
String
sqbProductId
;
@ApiModelProperty
(
value
=
"收钱吧商品编码 (非必填)"
)
private
String
sqbProductSn
;
@NotBlank
(
message
=
"商城编号不能为空"
)
@ApiModelProperty
(
value
=
"收钱吧商城编号"
,
required
=
true
)
private
String
mallSn
;
@NotBlank
(
message
=
"商城签名不能为空"
)
@ApiModelProperty
(
value
=
"收钱吧商城签名"
,
required
=
true
)
private
String
mallSignature
;
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinSqbGoodsService.java
View file @
fc3794cd
...
@@ -2,9 +2,9 @@ package com.liquidnet.service.goblin.service;
...
@@ -2,9 +2,9 @@ package com.liquidnet.service.goblin.service;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo
;
import
com.liquidnet.service.goblin.param.shouqianba.request.GoblinSqbGoodsSyncParam
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 收钱吧商品同步服务接口
* 收钱吧商品同步服务接口
...
@@ -20,13 +20,22 @@ public interface IGoblinSqbGoodsService {
...
@@ -20,13 +20,22 @@ public interface IGoblinSqbGoodsService {
ResponseDto
<
List
<
GoblinSqbPerfGoodsVo
>>
getAllMallProducts
();
ResponseDto
<
List
<
GoblinSqbPerfGoodsVo
>>
getAllMallProducts
();
/**
/**
* 批量同步商品到 goblin 系统
* 批量新增商品到 goblin 系统(不存在则新增)
* 已存在则更新,不存在则新增(spuType=33)
*
*
* @param items 待同步商品列表,每项包含 mallSn、sqbProductId、sqbProductSn
* @param storeId 门店ID
* @return 同步结果
* @param items 待新增商品列表
* @return 结果
*/
*/
ResponseDto
<
String
>
syncGoods
(
List
<
Map
<
String
,
String
>>
items
);
ResponseDto
<
String
>
addGoods
(
String
storeId
,
List
<
GoblinSqbGoodsSyncParam
>
items
);
/**
* 批量更新商品到 goblin 系统(仅更新已存在)
*
* @param storeId 门店ID
* @param items 待更新商品列表
* @return 结果
*/
ResponseDto
<
String
>
updateGoods
(
String
storeId
,
List
<
GoblinSqbGoodsSyncParam
>
items
);
/**
/**
* 查询演出关联商品列表(先查 Redis 缓存,未命中则查 MySQL 并写入缓存)
* 查询演出关联商品列表(先查 Redis 缓存,未命中则查 MySQL 并写入缓存)
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/entity/GoblinSqbGoodsExt.java
View file @
fc3794cd
...
@@ -7,6 +7,7 @@ import lombok.Data;
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
/**
* <p>
* <p>
...
@@ -56,8 +57,8 @@ public class GoblinSqbGoodsExt implements Serializable {
...
@@ -56,8 +57,8 @@ public class GoblinSqbGoodsExt implements Serializable {
*/
*/
private
String
sqbSkuId
;
private
String
sqbSkuId
;
private
String
createdAt
;
private
LocalDateTime
createdAt
;
private
String
updatedAt
;
private
LocalDateTime
updatedAt
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinSqbGoodsController.java
View file @
fc3794cd
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSqbPerfGoodsVo
;
import
com.liquidnet.service.goblin.service.IGoblinSqbGoodsService
;
import
com.liquidnet.service.goblin.service.IGoblinSqbGoodsService
;
import
com.liquidnet.service.goblin.util.GoblinRedisUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.liquidnet.service.goblin.param.shouqianba.request.GoblinSqbGoodsSyncParam
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 收钱吧商品同步 Controller
* 收钱吧商品同步 Controller
...
@@ -24,6 +27,9 @@ public class GoblinSqbGoodsController {
...
@@ -24,6 +27,9 @@ public class GoblinSqbGoodsController {
@Autowired
@Autowired
IGoblinSqbGoodsService
goblinSqbGoodsService
;
IGoblinSqbGoodsService
goblinSqbGoodsService
;
@Autowired
GoblinRedisUtils
goblinRedisUtils
;
/**
/**
* 查询所有商城及商品列表
* 查询所有商城及商品列表
* 后端自动拉取所有商城,循环获取每个商城的商品列表,聚合返回前端
* 后端自动拉取所有商城,循环获取每个商城的商品列表,聚合返回前端
...
@@ -35,13 +41,33 @@ public class GoblinSqbGoodsController {
...
@@ -35,13 +41,33 @@ public class GoblinSqbGoodsController {
}
}
/**
/**
* 批量同步商品到 goblin 系统
* 批量新增收钱吧商品
* 已存在则更新,不存在则新增(spuType=33)
*/
@PostMapping
(
"/add"
)
@ApiOperation
(
"批量新增收钱吧商品"
)
public
ResponseDto
<
String
>
addGoods
(
@RequestParam
(
"storeId"
)
String
storeId
,
@RequestBody
@Validated
List
<
GoblinSqbGoodsSyncParam
>
items
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
log
.
warn
(
"[收钱吧商品同步] 批量新增: 无权操作该店铺, uid={}, storeId={}"
,
currentUid
,
storeId
);
return
ResponseDto
.
failure
(
"无权操作该店铺"
);
}
return
goblinSqbGoodsService
.
addGoods
(
storeId
,
items
);
}
/**
* 批量更新收钱吧商品
*/
*/
@PostMapping
(
"/sync"
)
@PostMapping
(
"/update"
)
@ApiOperation
(
"批量同步收钱吧商品"
)
@ApiOperation
(
"批量更新收钱吧商品"
)
public
ResponseDto
<
String
>
sync
(
@RequestBody
List
<
Map
<
String
,
String
>>
items
)
{
public
ResponseDto
<
String
>
updateGoods
(
@RequestParam
(
"storeId"
)
String
storeId
,
return
goblinSqbGoodsService
.
syncGoods
(
items
);
@RequestBody
@Validated
List
<
GoblinSqbGoodsSyncParam
>
items
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
if
(!
goblinRedisUtils
.
hasStoreId
(
currentUid
,
storeId
))
{
log
.
warn
(
"[收钱吧商品同步] 批量更新: 无权操作该店铺, uid={}, storeId={}"
,
currentUid
,
storeId
);
return
ResponseDto
.
failure
(
"无权操作该店铺"
);
}
return
goblinSqbGoodsService
.
updateGoods
(
storeId
,
items
);
}
}
/**
/**
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinSqbGoodsServiceImpl.java
View file @
fc3794cd
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment