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
a006226a
Commit
a006226a
authored
Sep 24, 2020
by
孙昱
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'qa' of gitlab.freemud.com:order-group-application/order-group into qa
parents
26e58eb6
68e2ee75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+11
-7
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
+5
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/GiftSharingService.java
+1
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
a006226a
...
@@ -56,17 +56,21 @@ public class CalculationCommonService {
...
@@ -56,17 +56,21 @@ public class CalculationCommonService {
/**
/**
* 使用促销算价赋值行记录
* 使用促销算价赋值行记录
*/
*/
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goods
=
discountResult
.
getGoods
();
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goods
=
null
;
long
totalOriginalAmount
=
0L
,
totalAmount
=
0L
,
totalPackageAmount
=
0L
;
if
(
discountResult
!=
null
&&
CollectionUtils
.
isNotEmpty
(
discountResult
.
getGoods
()))
{
long
originalAmount
=
0L
,
amount
=
0L
,
packageAmount
=
0L
;
goods
=
discountResult
.
getGoods
();
}
long
totalOriginalAmount
=
0L
,
totalAmount
=
0L
,
totalPackageAmount
=
0L
;
long
originalAmount
=
0L
,
amount
=
0L
,
packageAmount
=
0L
;
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
for
(
CartGoods
cartGoods
:
cartGoodsList
)
{
originalAmount
=
0L
;
originalAmount
=
0L
;
amount
=
0L
;
amount
=
0L
;
packageAmount
=
0L
;
packageAmount
=
0L
;
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
find
=
goods
.
stream
().
filter
((
k
)
->
k
.
getCartGoodsUid
().
equals
(
cartGoods
.
getCartGoodsUid
())).
findFirst
().
get
();
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
find
=
goods
.
stream
().
filter
((
k
)
->
k
.
getCartGoodsUid
().
equals
(
cartGoods
.
getCartGoodsUid
())).
findFirst
().
get
();
if
(
find
==
null
)
continue
;
if
(
find
==
null
)
continue
;
//成交价行记录
//成交价行记录
amount
+=
find
.
getRealAmount
()*
cartGoods
.
getQty
();
//amount += find.getRealAmount() * cartGoods.getQty();
amount
+=
find
.
getRealAmount
();
cartGoods
.
setAmount
(
amount
);
cartGoods
.
setAmount
(
amount
);
totalAmount
+=
amount
;
totalAmount
+=
amount
;
//原价行记录
//原价行记录
...
@@ -454,7 +458,7 @@ public class CalculationCommonService {
...
@@ -454,7 +458,7 @@ public class CalculationCommonService {
List
<
Integer
>
types
=
new
ArrayList
<>();
List
<
Integer
>
types
=
new
ArrayList
<>();
types
.
add
(
ActivityTypeEnum
.
TYPE_2
.
getCode
());
types
.
add
(
ActivityTypeEnum
.
TYPE_2
.
getCode
());
types
.
add
(
ActivityTypeEnum
.
TYPE_1
.
getCode
());
types
.
add
(
ActivityTypeEnum
.
TYPE_1
.
getCode
());
if
(
CollectionUtils
.
isEmpty
(
discountResult
.
getGoods
()))
return
;
if
(
discountResult
==
null
||
CollectionUtils
.
isEmpty
(
discountResult
.
getGoods
()))
return
;
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goodsList
=
discountResult
.
getGoods
()
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goodsList
=
discountResult
.
getGoods
()
.
stream
()
.
stream
()
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/FullSharingService.java
View file @
a006226a
...
@@ -45,6 +45,9 @@ public class FullSharingService {
...
@@ -45,6 +45,9 @@ public class FullSharingService {
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ShoppingCartGoodsResponseVo
shoppingCartGoodsResponseVo
,
ActivityQueryDto
activityQueryDto
)
{
,
ActivityQueryDto
activityQueryDto
)
{
if
(
discountResult
==
null
||
CollectionUtils
.
isEmpty
(
discountResult
.
getGoods
()))
{
return
;
}
shoppingCartGoodsResponseVo
.
setActivityTip
(
new
ActivityTip
());
shoppingCartGoodsResponseVo
.
setActivityTip
(
new
ActivityTip
());
List
<
ActivityTypeEnum
>
activityTypeEnums
=
new
LinkedList
<>();
List
<
ActivityTypeEnum
>
activityTypeEnums
=
new
LinkedList
<>();
/**
/**
...
@@ -323,6 +326,7 @@ public class FullSharingService {
...
@@ -323,6 +326,7 @@ public class FullSharingService {
public
HashMap
<
String
,
Long
>
drawnFullDiscount
(
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
materialDiscount
,
List
<
Integer
>
typeEnums
,
int
type
)
{
public
HashMap
<
String
,
Long
>
drawnFullDiscount
(
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
materialDiscount
,
List
<
Integer
>
typeEnums
,
int
type
)
{
HashMap
<
String
,
Long
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Long
>
hashMap
=
new
HashMap
<>();
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
smallMaterial
:
materialDiscount
)
{
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
smallMaterial
:
materialDiscount
)
{
if
(
CollectionUtils
.
isEmpty
(
smallMaterial
.
getDiscounts
()))
continue
;
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
discount
:
smallMaterial
.
getDiscounts
())
{
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
discount
:
smallMaterial
.
getDiscounts
())
{
if
(
typeEnums
.
contains
(
discount
.
getType
()))
{
if
(
typeEnums
.
contains
(
discount
.
getType
()))
{
hashMap
.
put
(
discount
.
getGoodsId
(),
discount
.
getDiscount
());
hashMap
.
put
(
discount
.
getGoodsId
(),
discount
.
getDiscount
());
...
@@ -338,6 +342,7 @@ public class FullSharingService {
...
@@ -338,6 +342,7 @@ public class FullSharingService {
public
HashMap
<
String
,
Long
>
drawnFullDiscount
(
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GroupCombox
>
groupCombDiscount
,
List
<
Integer
>
typeEnums
)
{
public
HashMap
<
String
,
Long
>
drawnFullDiscount
(
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GroupCombox
>
groupCombDiscount
,
List
<
Integer
>
typeEnums
)
{
HashMap
<
String
,
Long
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Long
>
hashMap
=
new
HashMap
<>();
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GroupCombox
com
:
groupCombDiscount
)
{
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GroupCombox
com
:
groupCombDiscount
)
{
if
(
CollectionUtils
.
isEmpty
(
com
.
getDiscounts
()))
continue
;
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
discount
:
com
.
getDiscounts
())
{
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
discount
:
com
.
getDiscounts
())
{
if
(
typeEnums
.
contains
(
discount
.
getType
()))
{
if
(
typeEnums
.
contains
(
discount
.
getType
()))
{
hashMap
.
put
(
discount
.
getGoodsId
(),
discount
.
getDiscount
());
hashMap
.
put
(
discount
.
getGoodsId
(),
discount
.
getDiscount
());
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/promotion/GiftSharingService.java
View file @
a006226a
...
@@ -46,7 +46,7 @@ public class GiftSharingService {
...
@@ -46,7 +46,7 @@ public class GiftSharingService {
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
ShoppingCartInfoRequestVo
shoppingCartInfoRequestVo
,
ActivityQueryDto
activityQueryDto
)
{
,
ActivityQueryDto
activityQueryDto
)
{
if
(
CollectionUtils
.
isEmpty
(
discountResult
.
getSend
Goods
()))
{
if
(
discountResult
==
null
||
CollectionUtils
.
isEmpty
(
discountResult
.
get
Goods
()))
{
return
;
return
;
}
}
String
menuType
=
shoppingCartInfoRequestVo
==
null
?
null
:
shoppingCartInfoRequestVo
.
getMenuType
();
String
menuType
=
shoppingCartInfoRequestVo
==
null
?
null
:
shoppingCartInfoRequestVo
.
getMenuType
();
...
...
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