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
372045a6
Commit
372045a6
authored
Sep 27, 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
79150162
f2e2fc71
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
36 deletions
+37
-36
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OpenPlatformPartnerWxappConfig.java
+0
-26
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+0
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
+35
-9
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingCartService.java
+2
-1
No files found.
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/OpenPlatformPartnerWxappConfig.java
deleted
100644 → 0
View file @
79150162
package
cn
.
freemud
.
entities
.
dto
;
import
lombok.Data
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @version V1.0
* @Title: OpenPlatformPartnerWxappConfig
* @Package cn.freemud.entities.dto
* @Description:
* @author: ping1.wu
* @date: 2020/9/15 15:59
* @Copyright: 2020 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
public
class
OpenPlatformPartnerWxappConfig
{
private
String
wxAppid
;
private
String
appKey
;
private
String
appValue
;
private
Integer
state
;
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
372045a6
This diff is collapsed.
Click to expand it.
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationCommonService.java
View file @
372045a6
...
...
@@ -21,10 +21,8 @@ import org.apache.commons.lang.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
static
cn
.
freemud
.
constant
.
ShoppingCartConstant
.
SHOPPING_CART_EMPTY_GOODS_LIST
;
...
...
@@ -66,12 +64,13 @@ public class CalculationCommonService {
originalAmount
=
0L
;
amount
=
0L
;
packageAmount
=
0L
;
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
find
=
goods
.
stream
().
filter
((
k
)
->
k
.
getCartGoodsUid
().
equals
(
cartGoods
.
getCartGoodsUid
())).
findFirst
().
get
();
if
(
find
==
null
)
continue
;
//CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(cartGoods.getCartGoodsUid())).findFirst().get();
//if (find == null) continue;
this
.
rowRealAmount
(
goods
,
cartGoods
);
//成交价行记录
//amount += find.getRealAmount() * cartGoods.getQty();
amount
+=
find
.
getReal
Amount
();
cartGoods
.
setAmount
(
amount
);
amount
=
cartGoods
.
get
Amount
();
//
cartGoods.setAmount(amount);
totalAmount
+=
amount
;
//原价行记录
originalAmount
=
cartGoods
.
getOriginalPrice
()
*
cartGoods
.
getQty
();
...
...
@@ -89,6 +88,32 @@ public class CalculationCommonService {
shoppingCartGoodsResponseVo
.
setTotalDiscountAmount
(
discountResult
==
null
?
0L
:
discountResult
.
getTotalDiscountAmount
());
}
private
void
rowRealAmount
(
List
<
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
>
goods
,
CartGoods
cartGoods
)
{
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
find
=
goods
.
stream
().
filter
((
k
)
->
k
.
getCartGoodsUid
().
equals
(
cartGoods
.
getCartGoodsUid
()))
.
findFirst
()
.
get
();
if
(
find
==
null
)
return
;
cartGoods
.
setAmount
(
find
.
getRealAmount
());
if
(
CollectionUtils
.
isEmpty
(
cartGoods
.
getProductGroupList
()))
return
;
Map
<
String
,
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
>
choices
=
find
.
getSmallMaterial
()
.
stream
().
filter
(
d
->
"2"
.
equals
(
d
.
getType
()))
.
collect
(
Collectors
.
toMap
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
::
getGoodsId
,
Function
.
identity
(),
(
k1
,
k2
)
->
k1
));
long
amount
=
0L
;
for
(
CartGoods
.
ComboxGoods
choice
:
cartGoods
.
getProductGroupList
())
{
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
SmallMaterial
mt
=
choices
.
get
(
choice
.
getGoodsId
());
if
(
mt
==
null
)
{
amount
=
choice
.
getAmount
()
*
cartGoods
.
getQty
();
}
else
{
amount
=
mt
.
getRealAmount
();
choice
.
setAmount
(
mt
.
getRealAmount
().
longValue
());
}
}
cartGoods
.
setAmount
(
cartGoods
.
getAmount
()
+
amount
);
}
/**
* 设置行记录享受的优惠及总优惠
*
...
...
@@ -471,9 +496,10 @@ public class CalculationCommonService {
for
(
CalculationSharingDiscountResponseDto
.
CalculationDiscountResult
.
Goods
goods
:
goodsList
)
{
dis
=
goods
.
getDiscounts
()
.
stream
()
.
filter
(
g
->
types
.
contains
(
types
)).
findFirst
().
orElse
(
null
);
.
filter
(
g
->
types
.
contains
(
g
.
getType
()
)).
findFirst
().
orElse
(
null
);
if
(
null
==
dis
)
continue
;
if
(
goods
.
getGoodsQuantity
()
>
dis
.
getActualGoodsNumber
())
{
//goods.get
toastMsg
=
"该商品限"
+
dis
.
getActualGoodsNumber
()
+
"份优惠 超出按照原价计算哦"
;
uid
=
goods
.
getCartGoodsUid
();
}
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/calculate/CalculationSharingCartService.java
View file @
372045a6
...
...
@@ -100,8 +100,9 @@ public class CalculationSharingCartService {
/**
* 可选搭配的价格累加到套餐的成交价上
* this.combineGroupRowAmount(cartGoodsList);
*/
this
.
combineGroupRowAmount
(
cartGoodsList
);
/**
* 特价类型超出部分提示
...
...
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