记得上下班打卡 | 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
b5d9dcb9
Commit
b5d9dcb9
authored
May 12, 2026
by
姜秀龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sqb admin 需要判断商品上下架状态
parent
4e23bb64
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
10 deletions
+85
-10
GoblinAdminSqbGoodsVo.java
...iquidnet/service/goblin/dto/vo/GoblinAdminSqbGoodsVo.java
+6
-0
GoblinSqbPerfLinkedGoodsVo.java
...net/service/goblin/dto/vo/GoblinSqbPerfLinkedGoodsVo.java
+6
-0
index.html
...n/resources/templates/zhengzai/goblin/sqbGoods/index.html
+21
-3
SqbPerformanceGoodsServiceImpl.java
...i/goblin/service/impl/SqbPerformanceGoodsServiceImpl.java
+52
-7
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinAdminSqbGoodsVo.java
View file @
b5d9dcb9
...
...
@@ -35,4 +35,10 @@ public class GoblinAdminSqbGoodsVo implements Serializable {
@ApiModelProperty
(
value
=
"单品库存"
)
private
Integer
skuStock
;
@ApiModelProperty
(
value
=
"是否允许关联演出(SPU+SKU 均上架且未删除)"
)
private
Boolean
linkable
;
@ApiModelProperty
(
value
=
"上下架展示:上架 / 已下架 等"
)
private
String
shelfStatusLabel
;
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinSqbPerfLinkedGoodsVo.java
View file @
b5d9dcb9
...
...
@@ -42,4 +42,10 @@ public class GoblinSqbPerfLinkedGoodsVo implements Serializable {
@ApiModelProperty
(
value
=
"状态 0-禁用 1-启用"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"是否满足上架可售(与前台一致:SPU/SKU 上架且未删)"
)
private
Boolean
linkable
;
@ApiModelProperty
(
value
=
"上下架展示文案"
)
private
String
shelfStatusLabel
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/goblin/sqbGoods/index.html
View file @
b5d9dcb9
...
...
@@ -51,6 +51,7 @@
<th>
商品ID
</th>
<th>
商品头图
</th>
<th>
商品名称
</th>
<th>
状态
</th>
<th>
商品售价(元)
</th>
<th>
换购价(元)
</th>
<th>
商品库存
</th>
...
...
@@ -59,7 +60,7 @@
</thead>
<tbody
id=
"linkedGoodsBody"
>
<tr
id=
"emptyRow"
>
<td
colspan=
"
7
"
style=
"text-align:center;color:#999;"
>
暂无关联商品
</td>
<td
colspan=
"
8
"
style=
"text-align:center;color:#999;"
>
暂无关联商品
</td>
</tr>
</tbody>
</table>
...
...
@@ -129,7 +130,8 @@
var
spu
=
item
.
spuTitle
!=
null
?
item
.
spuTitle
:
item
.
spuName
;
var
sku
=
item
.
skuTitle
!=
null
?
item
.
skuTitle
:
item
.
skuName
;
var
text
=
item
.
title
||
formatSqbSpuSkuLabel
(
spu
,
sku
);
return
{
id
:
item
.
skuId
,
text
:
text
,
_raw
:
item
};
var
linkable
=
item
.
linkable
!==
false
;
return
{
id
:
item
.
skuId
,
text
:
text
,
disabled
:
!
linkable
,
_raw
:
item
};
})};
}
}
...
...
@@ -138,6 +140,11 @@
// 选中即添加
$
(
'#goodsSelect'
).
on
(
'select2:select'
,
function
(
e
)
{
var
raw
=
e
.
params
.
data
.
_raw
;
if
(
raw
&&
raw
.
linkable
===
false
)
{
layer
.
msg
(
'该商品已下架,不可关联'
,
{
icon
:
2
});
$
(
this
).
val
(
null
).
trigger
(
'change'
);
return
;
}
if
(
raw
)
{
addLinked
(
raw
);
}
// 清空选择框
$
(
this
).
val
(
null
).
trigger
(
'change'
);
...
...
@@ -158,6 +165,8 @@
skuId
:
item
.
skuId
,
spuId
:
item
.
spuId
,
spuName
:
item
.
spuName
||
''
,
skuName
:
item
.
skuName
||
''
,
coverPic
:
item
.
coverPic
||
''
,
price
:
item
.
price
,
stock
:
item
.
stock
,
shelfStatusLabel
:
item
.
shelfStatusLabel
||
''
,
linkable
:
item
.
linkable
!==
false
,
settlementPrice
:
(
item
.
settlementPrice
!=
null
?
item
.
settlementPrice
:
''
),
persisted
:
true
};
...
...
@@ -170,7 +179,7 @@
function
renderLinkedGoods
()
{
var
tbody
=
document
.
getElementById
(
'linkedGoodsBody'
);
if
(
linkedGoods
.
length
===
0
)
{
tbody
.
innerHTML
=
'<tr id="emptyRow"><td colspan="
7
" style="text-align:center;color:#999;">暂无关联商品</td></tr>'
;
tbody
.
innerHTML
=
'<tr id="emptyRow"><td colspan="
8
" style="text-align:center;color:#999;">暂无关联商品</td></tr>'
;
return
;
}
var
html
=
''
;
...
...
@@ -181,10 +190,13 @@
var
imgHtml
=
item
.
coverPic
?
'<img src="'
+
item
.
coverPic
+
'" class="img-thumb" title="点击放大" alt="商品头图"/>'
:
'<span style="color:#ccc;font-size:12px;">无图</span>'
;
var
shelfTxt
=
item
.
shelfStatusLabel
||
(
item
.
linkable
===
false
?
'已下架'
:
'上架'
);
var
shelfStyle
=
item
.
linkable
===
false
?
'color:#c00;font-weight:bold;'
:
'color:#090;'
;
html
+=
'<tr data-idx="'
+
idx
+
'">'
;
html
+=
'<td><small>'
+
item
.
skuId
+
'</small></td>'
;
html
+=
'<td>'
+
imgHtml
+
'</td>'
;
html
+=
'<td>'
+
formatSqbSpuSkuLabel
(
item
.
spuName
,
item
.
skuName
)
+
'</td>'
;
html
+=
'<td style="'
+
shelfStyle
+
'">'
+
shelfTxt
+
'</td>'
;
html
+=
'<td>'
+
priceYuan
+
'</td>'
;
html
+=
'<td><input type="number" class="form-control settlement-input" value="'
+
settlementVal
+
'" placeholder="不填按售价" onchange="updateSettlement('
+
idx
+
', this.value)" min="0" step="0.01"/></td>'
;
...
...
@@ -196,6 +208,10 @@
}
function
addLinked
(
item
)
{
if
(
item
.
linkable
===
false
)
{
layer
.
msg
(
'该商品已下架,不可关联'
,
{
icon
:
2
});
return
;
}
for
(
var
i
=
0
;
i
<
linkedGoods
.
length
;
i
++
)
{
if
(
linkedGoods
[
i
].
skuId
===
item
.
skuId
)
{
layer
.
msg
(
'该商品已在关联列表中'
);
...
...
@@ -209,6 +225,8 @@
coverPic
:
item
.
skuPic
||
item
.
coverPic
||
''
,
price
:
item
.
price
,
stock
:
(
item
.
skuStock
!=
null
?
item
.
skuStock
:
item
.
stock
),
shelfStatusLabel
:
item
.
shelfStatusLabel
||
(
item
.
linkable
===
false
?
'已下架'
:
'上架'
),
linkable
:
item
.
linkable
!==
false
,
settlementPrice
:
null
,
autoOffline
:
0
,
persisted
:
false
});
renderLinkedGoods
();
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/goblin/service/impl/SqbPerformanceGoodsServiceImpl.java
View file @
b5d9dcb9
...
...
@@ -42,6 +42,23 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
/** skuType=33 代表收钱吧商品 */
private
static
final
int
SQB_SKU_TYPE
=
33
;
/** 与前台 Goblin 一致:单品上架状态 3=上架 */
private
static
final
String
SHELVES_ON
=
"3"
;
private
static
boolean
isSqbSkuAndSpuOnShelf
(
GoblinGoodsSku
sku
,
GoblinGoods
spu
)
{
if
(
sku
==
null
||
spu
==
null
)
{
return
false
;
}
if
(!
"0"
.
equals
(
sku
.
getDelFlg
())
||
!
"0"
.
equals
(
spu
.
getDelFlg
()))
{
return
false
;
}
return
SHELVES_ON
.
equals
(
sku
.
getShelvesStatus
())
&&
SHELVES_ON
.
equals
(
spu
.
getShelvesStatus
());
}
private
static
String
shelfStatusLabel
(
boolean
onShelf
)
{
return
onShelf
?
"上架"
:
"已下架"
;
}
private
static
String
sqbSpuSkuDisplay
(
String
spuTitle
,
String
skuTitle
)
{
String
s
=
spuTitle
!=
null
?
spuTitle
.
trim
()
:
""
;
String
k
=
skuTitle
!=
null
?
skuTitle
.
trim
()
:
""
;
...
...
@@ -117,17 +134,28 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
GoblinGoodsSku
sku
=
goblinGoodsSkuMapper
.
selectOne
(
skuQuery
);
if
(
sku
==
null
)
{
log
.
warn
(
"[演出商品关联] SKU不存在,skuId={}"
,
skuId
);
continue
;
return
ResponseDto
.
failure
(
"SKU不存在:"
+
skuId
)
;
}
int
sortVal
=
item
.
getSort
()
!=
null
?
item
.
getSort
()
:
0
;
LambdaQueryWrapper
<
GoblinSqbPerformanceGoods
>
existQuery
=
new
LambdaQueryWrapper
<>();
existQuery
.
eq
(
GoblinSqbPerformanceGoods:
:
getPerformancesId
,
performancesId
)
.
eq
(
GoblinSqbPerformanceGoods:
:
getSkuId
,
skuId
)
.
last
(
"LIMIT 1"
);
GoblinSqbPerformanceGoods
existing
=
performanceGoodsMapper
.
selectOne
(
existQuery
);
if
(
sku
.
getSkuType
()
==
null
||
sku
.
getSkuType
()
!=
SQB_SKU_TYPE
)
{
return
ResponseDto
.
failure
(
"仅可关联收钱吧商品(skuType=33),skuId="
+
skuId
);
}
if
(
existing
==
null
)
{
GoblinGoods
spu
=
goblinGoodsMapper
.
selectOne
(
new
LambdaQueryWrapper
<
GoblinGoods
>()
.
eq
(
GoblinGoods:
:
getSpuId
,
sku
.
getSpuId
()).
last
(
"LIMIT 1"
));
if
(!
isSqbSkuAndSpuOnShelf
(
sku
,
spu
))
{
return
ResponseDto
.
failure
(
"商品未上架或已下架,不可关联。请先让商户上架后再操作。skuId="
+
skuId
);
}
}
int
sortVal
=
item
.
getSort
()
!=
null
?
item
.
getSort
()
:
0
;
if
(
existing
!=
null
)
{
LambdaUpdateWrapper
<
GoblinSqbPerformanceGoods
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
GoblinSqbPerformanceGoods:
:
getPerformancesId
,
performancesId
)
...
...
@@ -229,14 +257,17 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
.
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
spuNameById
=
new
HashMap
<>();
Map
<
String
,
String
>
spuCoverById
=
new
HashMap
<>();
Map
<
String
,
GoblinGoods
>
spuById
=
new
HashMap
<>();
if
(!
spuIdList
.
isEmpty
())
{
LambdaQueryWrapper
<
GoblinGoods
>
goodsQuery
=
new
LambdaQueryWrapper
<>();
goodsQuery
.
in
(
GoblinGoods:
:
getSpuId
,
spuIdList
)
.
select
(
GoblinGoods:
:
getSpuId
,
GoblinGoods:
:
getName
,
GoblinGoods:
:
getCoverPic
);
.
select
(
GoblinGoods:
:
getSpuId
,
GoblinGoods:
:
getName
,
GoblinGoods:
:
getCoverPic
,
GoblinGoods:
:
getShelvesStatus
,
GoblinGoods:
:
getDelFlg
);
for
(
GoblinGoods
g
:
goblinGoodsMapper
.
selectList
(
goodsQuery
))
{
if
(
g
.
getSpuId
()
!=
null
)
{
spuNameById
.
put
(
g
.
getSpuId
(),
g
.
getName
());
spuCoverById
.
put
(
g
.
getSpuId
(),
g
.
getCoverPic
());
spuById
.
put
(
g
.
getSpuId
(),
g
);
}
}
}
...
...
@@ -257,6 +288,13 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
vo
.
setCoverPic
(
pickSkuOrSpuCover
(
sku
.
getSkuPic
(),
spuCoverById
.
get
(
rel
.
getSpuId
())));
vo
.
setPrice
(
sku
.
getPrice
());
vo
.
setStock
(
sku
.
getSkuStock
());
GoblinGoods
spu
=
spuById
.
get
(
rel
.
getSpuId
());
boolean
onShelf
=
isSqbSkuAndSpuOnShelf
(
sku
,
spu
);
vo
.
setLinkable
(
onShelf
);
vo
.
setShelfStatusLabel
(
shelfStatusLabel
(
onShelf
));
}
else
{
vo
.
setLinkable
(
false
);
vo
.
setShelfStatusLabel
(
"已下架"
);
}
goodsList
.
add
(
vo
);
}
...
...
@@ -273,7 +311,7 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
public
ResponseDto
<
List
<
GoblinAdminSqbGoodsVo
>>
searchGoods
(
String
keyword
)
{
try
{
LambdaQueryWrapper
<
GoblinGoodsSku
>
skuQuery
=
new
LambdaQueryWrapper
<>();
skuQuery
.
eq
(
GoblinGoodsSku:
:
getSkuType
,
SQB_SKU_TYPE
);
skuQuery
.
eq
(
GoblinGoodsSku:
:
getSkuType
,
SQB_SKU_TYPE
)
.
ne
(
GoblinGoodsSku:
:
getDelFlg
,
"1"
)
;
if
(
StringUtils
.
hasText
(
keyword
))
{
LambdaQueryWrapper
<
GoblinGoods
>
goodsQuery
=
new
LambdaQueryWrapper
<>();
goodsQuery
.
select
(
GoblinGoods:
:
getSpuId
)
...
...
@@ -304,14 +342,17 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
.
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
spuTitleById
=
new
HashMap
<>();
Map
<
String
,
String
>
spuCoverById
=
new
HashMap
<>();
Map
<
String
,
GoblinGoods
>
spuRowById
=
new
HashMap
<>();
if
(!
spuIdForTitle
.
isEmpty
())
{
LambdaQueryWrapper
<
GoblinGoods
>
gq
=
new
LambdaQueryWrapper
<>();
gq
.
in
(
GoblinGoods:
:
getSpuId
,
spuIdForTitle
)
.
select
(
GoblinGoods:
:
getSpuId
,
GoblinGoods:
:
getName
,
GoblinGoods:
:
getCoverPic
);
.
select
(
GoblinGoods:
:
getSpuId
,
GoblinGoods:
:
getName
,
GoblinGoods:
:
getCoverPic
,
GoblinGoods:
:
getShelvesStatus
,
GoblinGoods:
:
getDelFlg
);
for
(
GoblinGoods
g
:
goblinGoodsMapper
.
selectList
(
gq
))
{
if
(
g
.
getSpuId
()
!=
null
)
{
spuTitleById
.
put
(
g
.
getSpuId
(),
g
.
getName
());
spuCoverById
.
put
(
g
.
getSpuId
(),
g
.
getCoverPic
());
spuRowById
.
put
(
g
.
getSpuId
(),
g
);
}
}
}
...
...
@@ -325,7 +366,11 @@ public class SqbPerformanceGoodsServiceImpl implements ISqbPerformanceGoodsServi
String
skuTitle
=
sku
.
getName
()
!=
null
?
sku
.
getName
()
:
""
;
vo
.
setSpuTitle
(
spuTitle
);
vo
.
setSkuTitle
(
skuTitle
);
vo
.
setTitle
(
sqbSpuSkuDisplay
(
spuTitle
,
skuTitle
));
GoblinGoods
spu
=
spuRowById
.
get
(
sku
.
getSpuId
());
boolean
onShelf
=
isSqbSkuAndSpuOnShelf
(
sku
,
spu
);
vo
.
setLinkable
(
onShelf
);
vo
.
setShelfStatusLabel
(
shelfStatusLabel
(
onShelf
));
vo
.
setTitle
(
sqbSpuSkuDisplay
(
spuTitle
,
skuTitle
)
+
(
onShelf
?
""
:
"(已下架)"
));
vo
.
setSkuPic
(
pickSkuOrSpuCover
(
sku
.
getSkuPic
(),
spuCoverById
.
get
(
sku
.
getSpuId
())));
vo
.
setPrice
(
sku
.
getPrice
());
vo
.
setSkuStock
(
sku
.
getSkuStock
());
...
...
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