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
28f7af27
Commit
28f7af27
authored
Feb 21, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品列表添加特惠标签字段
parent
7a544c1c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
14 deletions
+26
-14
soss-system/src/main/java/com/soss/system/domain/Goods.java
+4
-1
soss-system/src/main/java/com/soss/system/domain/vo/orderTaking/GoodsVo.java
+4
-0
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
+9
-7
soss-system/src/main/resources/mapper/system/ShopGoodsMapper.xml
+8
-4
soss-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
+1
-2
No files found.
soss-system/src/main/java/com/soss/system/domain/Goods.java
View file @
28f7af27
...
...
@@ -66,7 +66,7 @@ public class Goods extends BaseEntity {
* 特惠标签
*/
@Excel
(
name
=
"特惠标签"
)
private
BigDecimal
recommendTag
;
private
String
recommendTag
;
/**
* 制作用时 单位 秒
...
...
@@ -145,6 +145,9 @@ public class Goods extends BaseEntity {
@Excel
(
name
=
"商品编码"
)
private
String
code
;
/** 是否特惠商品 */
private
String
isRecommend
;
private
List
<
String
>
goodsTagList
;
public
List
<
String
>
getGoodsTagList
()
{
...
...
soss-system/src/main/java/com/soss/system/domain/vo/orderTaking/GoodsVo.java
View file @
28f7af27
...
...
@@ -26,7 +26,11 @@ public class GoodsVo {
private
String
specString
;
/** 特惠商品 */
private
String
isRecommend
;
/** 特惠标签 */
private
String
recommendTag
;
private
String
category
;
}
soss-system/src/main/java/com/soss/system/service/impl/OrderTakingServiceImpl.java
View file @
28f7af27
...
...
@@ -104,7 +104,7 @@ public class OrderTakingServiceImpl {
// }
// }
//推荐
List
<
String
>
recommendGoodsId
=
new
ArrayList
<>();
//
List<String> recommendGoodsId = new ArrayList<>();
List
<
RecommendVo
>
recommendVos
=
new
ArrayList
<>();
List
<
GoodsVo
>
recommendGoods
=
shopRecommendMapper
.
selectShopGoodsByTyepe
(
"1"
,
shopId
);
...
...
@@ -125,7 +125,7 @@ public class OrderTakingServiceImpl {
goodsVo
.
setSpecString
(
null
);
goodsVo
.
setPics
(
JSONObject
.
parseObject
(
goodsVo
.
getPictures
()));
goodsVo
.
setPictures
(
null
);
recommendGoodsId
.
add
(
goodsVo
.
getGoodsId
());
//
recommendGoodsId.add(goodsVo.getGoodsId());
GoodsTag
goodsTag
=
new
GoodsTag
();
goodsTag
.
setState
(
"1"
);
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodsId
()));
...
...
@@ -174,11 +174,13 @@ public class OrderTakingServiceImpl {
goodsVo
.
setSpecs
(
buildGoodsSpec
(
good
.
getSpec
()));
goodsVo
.
setCategory
(
good
.
getCategory
());
goodsVo
.
setSpecString
(
null
);
if
(
recommendGoodsId
.
contains
(
String
.
valueOf
(
good
.
getId
()))){
goodsVo
.
setIsRecommend
(
"1"
);
}
else
{
goodsVo
.
setIsRecommend
(
"0"
);
}
goodsVo
.
setIsRecommend
(
good
.
getIsRecommend
());
goodsVo
.
setRecommendTag
(
good
.
getRecommendTag
());
// if(recommendGoodsId.contains(String.valueOf(good.getId()))){
// goodsVo.setIsRecommend("1");
// }else{
// goodsVo.setIsRecommend("0");
// }
GoodsTag
goodsTag
=
new
GoodsTag
();
goodsTag
.
setState
(
"1"
);
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodsId
()));
...
...
soss-system/src/main/resources/mapper/system/ShopGoodsMapper.xml
View file @
28f7af27
...
...
@@ -92,10 +92,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
g.remarks,
g.shelf_at as shelfAt,
g.code,
'1' as state
from shop_goods sg, goods g where sg.goods_id = g.id and g.state ='3' and g.is_deleted = 0
and shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by sg.turn
'1' as state,
case when sr.id>0 then 1 else 0 end as isRecommend,
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
where g.state ='3' and g.is_deleted = 0 and sg.shop_id = #{shopId} and category like concat('%,', #{categoryId}, ',%')
order by sr.recommend_price DESC,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
...
...
soss-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
View file @
28f7af27
...
...
@@ -135,8 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sr.`type` = #{type}
and sr.shop_id =#{shopId}
and sr.state ='1' and g.is_deleted ='0'
order by
sr.recommend_price desc,sr.turn
order by sr.turn
</select>
<select
id=
"selectShopRecommendGoods"
resultType=
"com.soss.system.domain.Goods"
>
select
...
...
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