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
ddc58801
Commit
ddc58801
authored
Oct 27, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复checkSku特惠价格不生效问题
parent
1f802778
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
soss-system/src/main/java/com/soss/system/mapper/ShopRecommendMapper.java
+6
-2
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+7
-1
soss-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
+5
-0
No files found.
soss-system/src/main/java/com/soss/system/mapper/ShopRecommendMapper.java
View file @
ddc58801
package
com
.
soss
.
system
.
mapper
;
import
java.util.List
;
import
com.soss.system.domain.Goods
;
import
com.soss.system.domain.ShopRecommend
;
import
com.soss.system.domain.vo.orderTaking.GoodsVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 推荐和今日特惠Mapper接口
...
...
@@ -24,6 +23,11 @@ public interface ShopRecommendMapper
public
ShopRecommend
selectShopRecommendById
(
String
id
);
/**
* 根据商品id查询特惠
*/
public
ShopRecommend
selectShopRecommendByGoodsId
(
@Param
(
"shopId"
)
Long
shopId
,
@Param
(
"goodsId"
)
Long
goodsId
);
/**
* 查询推荐和今日特惠列表
*
* @param shopRecommend 推荐和今日特惠
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
ddc58801
...
...
@@ -23,7 +23,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -505,7 +505,13 @@ public class ShopServiceImpl implements IShopService {
goodsVo
.
setGoodsId
(
String
.
valueOf
(
good
.
getId
()));
goodsVo
.
setName
(
good
.
getName
());
goodsVo
.
setDesc
(
good
.
getDesc
());
ShopRecommend
shopRecommend
=
shopRecommendMapper
.
selectShopRecommendByGoodsId
(
shopId
,
good
.
getId
());
if
(
shopRecommend
!=
null
&&
shopRecommend
.
getRecommendPrice
()
!=
null
&&
shopRecommend
.
getRecommendPrice
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
goodsVo
.
setDiscount
(
shopRecommend
.
getRecommendPrice
().
stripTrailingZeros
().
toPlainString
());
}
else
{
goodsVo
.
setDiscount
(
good
.
getDiscount
().
stripTrailingZeros
().
toPlainString
());
}
goodsVo
.
setPrice
(
good
.
getPrice
().
stripTrailingZeros
().
toPlainString
());
goodsVo
.
setPics
(
JSONObject
.
parseObject
(
good
.
getPics
()));
goodsVo
.
setRemarks
(
good
.
getRemarks
());
...
...
soss-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
View file @
ddc58801
...
...
@@ -46,6 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by turn
</select>
<select
id=
"selectShopRecommendByGoodsId"
resultMap=
"ShopRecommendResult"
>
<include
refid=
"selectShopRecommendVo"
/>
where `type` = 2 and shop_id = #{shopId} and goods_id = #{goodsId}
</select>
<select
id=
"selectShopRecommendById"
parameterType=
"String"
resultMap=
"ShopRecommendResult"
>
<include
refid=
"selectShopRecommendVo"
/>
where id = #{id}
...
...
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