Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
7ea84534
Commit
7ea84534
authored
Dec 15, 2020
by
chongfu.liang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/20201202-商品券换购券商品添加可售时间校验'
parents
d331f236
395eb5e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
21 deletions
+3
-21
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
+3
-21
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/CouponServiceImpl.java
View file @
7ea84534
...
...
@@ -84,6 +84,7 @@ public class CouponServiceImpl implements CouponService {
private
final
Gson
gson
=
new
Gson
();
//@Autowired
//private MemberProductClient memberProductClient;
@Autowired
private
CustomerExtendClient
customerExtendClient
;
...
...
@@ -711,15 +712,6 @@ public class CouponServiceImpl implements CouponService {
||
valiadProductResponse
.
getData
()
==
null
||
CollectionUtils
.
isEmpty
(
valiadProductResponse
.
getData
().
getSuccessList
()))
{
return
null
;
}
List
<
ProductBeanDTO
>
productList
=
valiadProductResponse
.
getData
().
getSuccessList
().
stream
().
map
(
ValiadShopProductResult:
:
getProductType
).
collect
(
Collectors
.
toList
());
Optional
<
ProductBeanDTO
>
firstProduct
=
productList
.
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
p
.
getPid
(),
productsVo
.
getSpuId
())).
findFirst
();
if
(!
firstProduct
.
isPresent
())
{
return
null
;
}
ProductBeanDTO
spuProduct
=
firstProduct
.
get
();
CheckSpqInfoResponseDto
dto
=
new
CheckSpqInfoResponseDto
();
dto
.
setCouponCode
(
couponCode
);
dto
.
setActiveCode
(
couponDetailResponseDto
.
getDetails
().
get
(
0
).
getActive
().
getActiveCode
());
...
...
@@ -728,7 +720,7 @@ public class CouponServiceImpl implements CouponService {
dto
.
setPrice
(
productsVo
.
getFinalPrice
());
dto
.
setSpuId
(
productsVo
.
getSpuId
());
dto
.
setSpuName
(
productsVo
.
getSkuName
());
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
spuProduct
.
getStockLimit
()));
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
productsVo
.
getStockLimit
()));
dto
.
setSkuId
(
productsVo
.
getSkuId
());
dto
.
setSkuName
(
StringUtils
.
isNotBlank
(
productsVo
.
getSkuName
())
?
productsVo
.
getSkuName
()
:
productsVo
.
getSpuName
());
dto
.
setPicture
(
productsVo
.
getSpuPicture
());
...
...
@@ -834,16 +826,6 @@ public class CouponServiceImpl implements CouponService {
||
valiadProductResponse
.
getData
()
==
null
||
CollectionUtils
.
isEmpty
(
valiadProductResponse
.
getData
().
getSuccessList
()))
{
return
null
;
}
List
<
ProductBeanDTO
>
productList
=
valiadProductResponse
.
getData
().
getSuccessList
().
stream
().
map
(
ValiadShopProductResult:
:
getProductType
).
collect
(
Collectors
.
toList
());
Optional
<
ProductBeanDTO
>
firstProduct
=
productList
.
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
p
.
getPid
(),
productsVo
.
getSpuId
())).
findFirst
();
if
(!
firstProduct
.
isPresent
())
{
return
null
;
}
ProductBeanDTO
spuProduct
=
firstProduct
.
get
();
// 如果是套餐商品,更新套餐内固定商品&可选商品的详细信息
ProductBeanDTO
.
SkuProductBean
skuProduct
=
spuProduct
.
getSkuList
().
stream
().
filter
(
p
->
ObjectUtils
.
equals
(
productsVo
.
getSkuId
(),
p
.
getSkuId
())).
findFirst
().
get
();
CheckSpqInfoResponseDto
dto
=
new
CheckSpqInfoResponseDto
();
dto
.
setCouponCode
(
couponCode
);
dto
.
setActiveCode
(
couponActivityDetail
.
getActive
().
getActiveCode
());
...
...
@@ -857,7 +839,7 @@ public class CouponServiceImpl implements CouponService {
dto
.
setPicture
(
productsVo
.
getSpuPicture
());
dto
.
setDefaultSpecName
(
productsVo
.
getDefaultSpecName
());
dto
.
setDefaultSpecId
(
productsVo
.
getDefaultSpecId
());
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
skuProduct
.
getStockLimit
()));
dto
.
setStockLimit
(
ObjectUtils
.
equals
(
1
,
productsVo
.
getStockLimit
()));
dto
.
setExtras
(
productsVo
.
getExtra
());
log
.
info
(
"dto***"
+
dto
);
return
dto
;
...
...
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