Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
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
hooloo
ms
soss
Commits
d0e61982
Commit
d0e61982
authored
Jun 14, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复商品同是推荐、特惠重复的问题
parent
bb5760ba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsMapper.java
+2
-1
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
+1
-1
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+1
-1
soss-system/src/main/resources/mapper/system/ShopGoodsMapper.xml
+22
-2
No files found.
soss-system/src/main/java/com/soss/system/mapper/ShopGoodsMapper.java
View file @
d0e61982
...
...
@@ -64,7 +64,8 @@ public interface ShopGoodsMapper
List
<
Goods
>
selectShopCategoryGoods
(
long
shopId
);
List
<
Goods
>
selectShopCategoryGoodsByCategoryId
(
@Param
(
"shopId"
)
long
shopId
,
@Param
(
"categoryId"
)
Long
categoryId
);
List
<
Goods
>
selectShopCategoryGoodsByCategoryIdForOss
(
@Param
(
"shopId"
)
long
shopId
,
@Param
(
"categoryId"
)
Long
categoryId
);
List
<
Goods
>
selectShopCategoryGoodsByCategoryIdForApp
(
@Param
(
"shopId"
)
long
shopId
,
@Param
(
"categoryId"
)
Long
categoryId
);
void
updateStatus
(
@Param
(
"shopID"
)
String
shopID
,
@Param
(
"goodsId"
)
Long
goodsId
,
@Param
(
"machineId"
)
String
robotID
,
@Param
(
"status"
)
String
s
);
...
...
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
View file @
d0e61982
...
...
@@ -130,7 +130,7 @@ public class OrderTakingServiceImpl {
categoryVo
.
setId
(
category
.
getId
());
categoryVo
.
setName
(
category
.
getName
());
categoryVo
.
setIcon
(
category
.
getIcon
());
List
<
Goods
>
goodsList
=
shopGoodsMapper
.
selectShopCategoryGoodsByCategoryId
(
shopId
,
category
.
getId
());
List
<
Goods
>
goodsList
=
shopGoodsMapper
.
selectShopCategoryGoodsByCategoryId
ForApp
(
shopId
,
category
.
getId
());
List
<
GoodsVo
>
goodsVoList
=
new
ArrayList
<>();
List
<
GoodsVo
>
selloutList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
goodsList
))
{
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
d0e61982
...
...
@@ -295,7 +295,7 @@ public class ShopServiceImpl implements IShopService {
});
List
<
GoodsCategory
>
shopCategories
=
goodsCategoryMapper
.
selectGoodsCategoryByIds
(
categoryIds
);
for
(
GoodsCategory
category
:
shopCategories
)
{
List
<
Goods
>
goodsList
=
shopGoodsMapper
.
selectShopCategoryGoodsByCategoryId
(
shopId
,
category
.
getId
());
List
<
Goods
>
goodsList
=
shopGoodsMapper
.
selectShopCategoryGoodsByCategoryId
ForOss
(
shopId
,
category
.
getId
());
for
(
Goods
goods
:
goodsList
)
{
ShopGoodsSku
shopGoodsSku
=
new
ShopGoodsSku
();
...
...
soss-system/src/main/resources/mapper/system/ShopGoodsMapper.xml
View file @
d0e61982
...
...
@@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and shop_id =#{shopId}
order by sg.turn
</select>
<select
id=
"selectShopCategoryGoodsByCategoryId"
resultType=
"com.soss.system.domain.Goods"
>
<select
id=
"selectShopCategoryGoodsByCategoryId
ForApp
"
resultType=
"com.soss.system.domain.Goods"
>
select
g.id,
g.name,
...
...
@@ -98,10 +98,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sr.recommend_tag
from goods g
LEFT JOIN shop_goods sg ON g.id = sg.goods_id
LEFT JOIN shop_recommend sr ON g.id = sr.goods_id and sr.`type` = 2
LEFT JOIN shop_recommend sr ON g.id = sr.goods_id and sr.`type` = 2 and sg.shop_id = sr.shop_id
where g.state ='3' and g.is_deleted = 0 and sg.shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by isRecommend DESC,sg.turn
</select>
<select
id=
"selectShopCategoryGoodsByCategoryIdForOss"
resultType=
"com.soss.system.domain.Goods"
>
select
g.id,
g.name,
g.category,
g.price,
g.discount,
g.take_time,
g.spec,
g.pics,
g.`desc`,
g.remarks,
g.shelf_at as shelfAt,
g.code,
'1' as state
from goods g
LEFT JOIN shop_goods sg ON g.id = sg.goods_id
where g.state ='3' and g.is_deleted = 0 and sg.shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by sg.turn
</select>
<select
id=
"selectShopNoAddGoods"
resultType=
"com.soss.system.domain.Goods"
>
select id, name, category, price, discount, take_time, spec, pics, `desc`, remarks, state, is_deleted, created_at, updated_at, code,shelf_at from goods
where
...
...
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