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
02d762de
Commit
02d762de
authored
Jun 21, 2021
by
zhangzhiheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/qa' into qa
parents
ae29d3f8
10abb21d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
40 deletions
+59
-40
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
+3
-1
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/enums/OrderSettlementType.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/CommonService.java
+18
-4
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
+37
-35
shopping-cart-application-service/src/test/java/cn.freemud/service/ShoppingCartMCoffeeServiceTest.java
+0
-0
No files found.
order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
View file @
02d762de
...
@@ -2188,7 +2188,7 @@ public class OrderAdapter {
...
@@ -2188,7 +2188,7 @@ public class OrderAdapter {
return
orderAccountVos
;
return
orderAccountVos
;
}
}
List
<
Integer
>
list
=
Arrays
.
asList
(
OrderSettlementType
.
FULL_REDUCTION
.
getIndex
(),
OrderSettlementType
.
CASH_COUPON
.
getIndex
(),
List
<
Integer
>
list
=
Arrays
.
asList
(
OrderSettlementType
.
FULL_REDUCTION
.
getIndex
(),
OrderSettlementType
.
CASH_COUPON
.
getIndex
(),
OrderSettlementType
.
PRODUCT_COUPON
.
getIndex
(),
OrderSettlementType
.
DISCOUNT_COUPON
.
getIndex
(),
OrderSettlementType
.
POINTS
.
getIndex
());
OrderSettlementType
.
PRODUCT_COUPON
.
getIndex
(),
OrderSettlementType
.
DISCOUNT_COUPON
.
getIndex
(),
OrderSettlementType
.
POINTS
.
getIndex
()
,
OrderSettlementType
.
FREIGHT_COUPON
.
getIndex
()
);
for
(
QueryOrdersResponse
.
DataBean
.
OrderBean
.
OrderSettlement
orderSettlement
:
orderSettlements
){
for
(
QueryOrdersResponse
.
DataBean
.
OrderBean
.
OrderSettlement
orderSettlement
:
orderSettlements
){
if
(
list
.
contains
(
orderSettlement
.
getSettlementType
())){
if
(
list
.
contains
(
orderSettlement
.
getSettlementType
())){
OrderAccountVo
accountVo
=
new
OrderAccountVo
();
OrderAccountVo
accountVo
=
new
OrderAccountVo
();
...
@@ -2201,6 +2201,8 @@ public class OrderAdapter {
...
@@ -2201,6 +2201,8 @@ public class OrderAdapter {
accountVo
.
setTypeName
(
"满减"
);
accountVo
.
setTypeName
(
"满减"
);
}
else
if
(
type
==
OrderSettlementType
.
POINTS
.
getIndex
()){
}
else
if
(
type
==
OrderSettlementType
.
POINTS
.
getIndex
()){
accountVo
.
setTypeName
(
"积分抵扣"
);
accountVo
.
setTypeName
(
"积分抵扣"
);
}
else
if
(
type
==
OrderSettlementType
.
FREIGHT_COUPON
.
getIndex
())
{
accountVo
.
setTypeName
(
"配送券"
);
}
}
int
value
=
orderSettlement
.
getSettlementAmount
().
intValue
();
int
value
=
orderSettlement
.
getSettlementAmount
().
intValue
();
accountVo
.
setDiscountAmount
(
value
<
0
?
-
value
:
value
);
accountVo
.
setDiscountAmount
(
value
<
0
?
-
value
:
value
);
...
...
ordercenter-sdk/src/main/java/com/freemud/application/sdk/api/ordercenter/enums/OrderSettlementType.java
View file @
02d762de
...
@@ -34,6 +34,7 @@ public enum OrderSettlementType {
...
@@ -34,6 +34,7 @@ public enum OrderSettlementType {
SPELL_GROUP
(
25
,
"拼团"
),
SPELL_GROUP
(
25
,
"拼团"
),
TAKEAWAY_ADD_PRICE
(
46
,
"外卖加价购"
),
TAKEAWAY_ADD_PRICE
(
46
,
"外卖加价购"
),
SUPER_PURCHASE
(
47
,
"超值加购"
),
SUPER_PURCHASE
(
47
,
"超值加购"
),
FREIGHT_COUPON
(
99
,
"配送券"
),
PRODUCT_COUPON
(
118
,
"商品券"
),
PRODUCT_COUPON
(
118
,
"商品券"
),
POINTS
(
200
,
"积分"
),
POINTS
(
200
,
"积分"
),
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/CommonService.java
View file @
02d762de
...
@@ -10,11 +10,13 @@ import com.freemud.application.sdk.api.storecenter.request.vo.GetOrgTreeListRequ
...
@@ -10,11 +10,13 @@ import com.freemud.application.sdk.api.storecenter.request.vo.GetOrgTreeListRequ
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.response.vo.GetOrgTreeListResponse
;
import
com.freemud.application.sdk.api.storecenter.response.vo.GetOrgTreeListResponse
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
import
com.freemud.application.sdk.api.util.ResponseUtils
;
import
com.google.common.base.Joiner
;
import
com.google.common.base.Joiner
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -43,11 +45,23 @@ public interface CommonService {
...
@@ -43,11 +45,23 @@ public interface CommonService {
request
.
setPartnerId
(
partnerId
);
request
.
setPartnerId
(
partnerId
);
request
.
setStoreCode
(
storeCode
);
request
.
setStoreCode
(
storeCode
);
StoreCenterService
storeCenterService
=
SpringBeanUtil
.
getBean
(
StoreCenterService
.
class
);
StoreCenterService
storeCenterService
=
SpringBeanUtil
.
getBean
(
StoreCenterService
.
class
);
BaseResponse
<
List
<
String
>>
orgList
=
storeCenterService
.
getOrgList
(
request
,
LogThreadLocal
.
getTrackingNo
());
BaseResponse
<
GetOrgTreeListResponse
>
response
=
storeCenterService
.
getOrgTreeList
(
request
,
LogThreadLocal
.
getTrackingNo
());
if
(
orgList
!=
null
&&
ResponseCodeConstant
.
RESPONSE_SUCCESS_STR
.
equals
(
orgList
.
getCode
()))
{
// BaseResponse<List<String>> orgList = storeCenterService.getOrgList(request, LogThreadLocal.getTrackingNo());
return
orgList
.
getData
();
if
(
Objects
.
equals
(
"100"
,
response
.
getCode
())
&&
response
.
getData
()
!=
null
)
{
List
<
GetOrgTreeListResponse
.
OrgList
>
orgList
=
((
GetOrgTreeListResponse
)
response
.
getData
()).
getOrgList
();
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
orgList
))
{
return
null
;
}
else
{
List
<
String
>
orgIds
=
(
List
)
orgList
.
stream
().
map
(
GetOrgTreeListResponse
.
OrgList
::
getOrganizationId
).
collect
(
Collectors
.
toList
());
return
orgIds
;
}
}
else
{
return
null
;
}
}
return
null
;
// if (orgList != null && ResponseCodeConstant.RESPONSE_SUCCESS_STR.equals(orgList.getCode())) {
// return orgList.getData();
// }
// return null;
}
}
/**
/**
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/mcoffee/calculation/CouponDiscountCalculation.java
View file @
02d762de
...
@@ -179,6 +179,7 @@ public class CouponDiscountCalculation {
...
@@ -179,6 +179,7 @@ public class CouponDiscountCalculation {
for
(
int
i
=
0
;
i
<
cartGoodsList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
cartGoodsList
.
size
();
i
++)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
cartGoods
.
setIsB3S1CouponGoods
(
0
);
cartGoods
.
setIsB3S1CouponGoods
(
0
);
boolean
useCoupon
=
false
;
if
(
"9998"
.
equals
(
cartGoods
.
getSkuId
()))
{
if
(
"9998"
.
equals
(
cartGoods
.
getSkuId
()))
{
continue
;
continue
;
}
}
...
@@ -199,47 +200,48 @@ public class CouponDiscountCalculation {
...
@@ -199,47 +200,48 @@ public class CouponDiscountCalculation {
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_32
.
getCode
().
equals
(
t
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
t
.
getType
())
||
ActivityTypeEnum
.
TYPE_37
.
getCode
().
equals
(
t
.
getType
())
||
ActivityTypeEnum
.
TYPE_39
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
||
ActivityTypeEnum
.
TYPE_39
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
useCoupon
=
targetDiscount
.
isPresent
();
if
(
null
!=
targetDiscount
&&
targetDiscount
.
isPresent
())
{
if
(
null
!=
targetDiscount
&&
targetDiscount
.
isPresent
())
{
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
targetDiscount
.
get
();
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
goodsDiscount
=
targetDiscount
.
get
();
cartGoods
.
setCouponName
(
goodsDiscount
.
getActivityName
());
cartGoods
.
setCouponName
(
goodsDiscount
.
getActivityName
());
//普通商品券 和月享卡1.0的 商品最终售价更新为促销返回价格
//普通商品券 和月享卡1.0的 商品最终售价更新为促销返回价格
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
}
}
}
}
Optional
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
b3S1DiscountOptional
=
discountsNew
.
stream
()
Optional
<
ActivityCalculationDiscountResponseDto
.
CalculationDiscountResult
.
Goods
.
GoodsDiscount
>
b3S1DiscountOptional
=
discountsNew
.
stream
()
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_35
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
.
filter
(
t
->
ActivityTypeEnum
.
TYPE_35
.
getCode
().
equals
(
t
.
getType
())).
findFirst
();
if
(
b3S1DiscountOptional
.
isPresent
())
{
if
(
b3S1DiscountOptional
.
isPresent
())
{
haveB3S1Fav
=
true
;
haveB3S1Fav
=
true
;
if
(
b3S1DiscountOptional
.
get
().
getActivityCode
().
equals
(
b3S1SeedCode
))
{
if
(
b3S1DiscountOptional
.
get
().
getActivityCode
().
equals
(
b3S1SeedCode
))
{
useTimes
+=
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
();
useTimes
+=
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
();
}
}
if
(
cartGoods
.
getQty
()
>
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
())
{
if
(
cartGoods
.
getQty
()
>
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
())
{
int
newNum
=
cartGoods
.
getQty
()
-
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
();
int
newNum
=
cartGoods
.
getQty
()
-
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
();
CartGoods
cartGoodsNew
=
new
CartGoods
();
CartGoods
cartGoodsNew
=
new
CartGoods
();
BeanUtils
.
copyProperties
(
cartGoods
,
cartGoodsNew
);
BeanUtils
.
copyProperties
(
cartGoods
,
cartGoodsNew
);
cartGoods
.
setQty
(
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
());
cartGoods
.
setQty
(
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
());
cartGoods
.
setCouponCode
(
b3S1DiscountOptional
.
get
().
getActivityCode
());
cartGoods
.
setCouponCode
(
b3S1DiscountOptional
.
get
().
getActivityCode
());
cartGoods
.
setCouponName
(
b3S1DiscountOptional
.
get
().
getActivityName
());
cartGoods
.
setCouponName
(
b3S1DiscountOptional
.
get
().
getActivityName
());
cartGoods
.
setIsB3S1CouponGoods
(
1
);
cartGoods
.
setIsB3S1CouponGoods
(
1
);
cartGoodsNew
.
setCartGoodsUid
(
UUID
.
randomUUID
().
toString
());
cartGoodsNew
.
setCartGoodsUid
(
UUID
.
randomUUID
().
toString
());
cartGoodsNew
.
setQty
(
newNum
);
cartGoodsNew
.
setQty
(
newNum
);
cartGoodsNew
.
setCouponCode
(
null
);
cartGoodsNew
.
setCouponCode
(
null
);
cartGoodsNew
.
setCouponName
(
null
);
cartGoodsNew
.
setCouponName
(
null
);
cartGoodsNew
.
setAmount
(
cartGoods
.
getOriginalPrice
()
*
cartGoods
.
getQty
());
cartGoodsNew
.
setAmount
(
cartGoods
.
getOriginalPrice
()
*
cartGoods
.
getQty
());
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
newCartGoodsList
.
add
(
cartGoodsNew
);
newCartGoodsList
.
add
(
cartGoodsNew
);
}
else
if
(
cartGoods
.
getQty
()
==
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
())
{
}
else
if
(
cartGoods
.
getQty
()
==
b3S1DiscountOptional
.
get
().
getActualGoodsNumber
())
{
cartGoods
.
setCouponCode
(
b3S1DiscountOptional
.
get
().
getActivityCode
());
cartGoods
.
setCouponCode
(
b3S1DiscountOptional
.
get
().
getActivityCode
());
cartGoods
.
setCouponName
(
b3S1DiscountOptional
.
get
().
getActivityName
());
cartGoods
.
setCouponName
(
b3S1DiscountOptional
.
get
().
getActivityName
());
cartGoods
.
setIsB3S1CouponGoods
(
1
);
cartGoods
.
setIsB3S1CouponGoods
(
1
);
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
cartGoods
.
setAmount
(
goodsMap
.
get
(
cartGoods
.
getCartGoodsUid
()).
getRealAmount
());
}
}
}
else
{
}
else
{
if
(!
targetDiscount
.
isPresent
())
{
if
(!
useCoupon
)
{
cartGoods
.
setCouponCode
(
null
);
cartGoods
.
setCouponCode
(
null
);
cartGoods
.
setCouponName
(
null
);
cartGoods
.
setCouponName
(
null
);
}
}
}
}
}
}
...
@@ -280,7 +282,7 @@ public class CouponDiscountCalculation {
...
@@ -280,7 +282,7 @@ public class CouponDiscountCalculation {
}
}
for
(
int
i
=
index
+
1
;
i
<
cartGoodsList
.
size
();
i
++)
{
for
(
int
i
=
index
+
1
;
i
<
cartGoodsList
.
size
();
i
++)
{
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
CartGoods
cartGoods
=
cartGoodsList
.
get
(
i
);
if
(
cartGoods
.
getIsB3S1Coupon
()
==
1
)
{
if
(
cartGoods
.
getIsB3S1Coupon
Goods
()
==
1
)
{
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
remove
(
i
);
cartGoodsList
.
add
(
index
,
cartGoods
);
cartGoodsList
.
add
(
index
,
cartGoods
);
index
++;
index
++;
...
...
shopping-cart-application-service/src/test/java/cn.freemud/service/ShoppingCartMCoffeeServiceTest.java
View file @
02d762de
This diff is collapsed.
Click to expand it.
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