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
b651af2e
Commit
b651af2e
authored
Apr 24, 2020
by
dingkai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车配送费
parent
731cade8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
4 deletions
+45
-4
shopping-cart-application-service/pom.xml
+1
-1
shopping-cart-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
+1
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+43
-3
No files found.
shopping-cart-application-service/pom.xml
View file @
b651af2e
...
...
@@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>
com.freemud.application.service.sdk
</groupId>
<version>
1.4
.1-SNAPSHOT
</version>
<version>
2.6
.1-SNAPSHOT
</version>
<artifactId>
storecenter-sdk
</artifactId>
</dependency>
...
...
shopping-cart-application-service/src/main/java/cn/freemud/enums/ResponseResult.java
View file @
b651af2e
...
...
@@ -58,6 +58,7 @@ public enum ResponseResult {
STORE_BUSINESS_HOUR_ERROR
(
"43010"
,
"门店营业时间错误"
),
STORE_NOT_ENABLE_COLLECT_GOODS
(
"43011"
,
"门店不支持到店"
),
STORE_MALL_NOT_FOUND
(
"43012"
,
"商城门店不存在"
),
STORE_DELIVERY_AMOUNT_ERROR
(
"43013"
,
"配送费错误"
),
/**
* 购物车状态码
...
...
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
b651af2e
...
...
@@ -50,7 +50,9 @@ import com.freemud.application.sdk.api.paymentcenter.client.response.SVCCardAmou
import
com.freemud.application.sdk.api.paymentcenter.client.service.PaymentNewService
;
import
com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO
;
import
com.freemud.application.sdk.api.promotioncenter.response.ActivityResponse
;
import
com.freemud.application.sdk.api.storecenter.request.QueryDeliveryRequest
;
import
com.freemud.application.sdk.api.storecenter.request.StoreInfoRequest
;
import
com.freemud.application.sdk.api.storecenter.response.QueryDeliverDetailResponse
;
import
com.freemud.application.sdk.api.storecenter.response.StoreResponse
;
import
com.freemud.application.sdk.api.storecenter.service.StoreCenterService
;
import
com.freemud.sdk.api.assortment.shoppingcart.constant.CommonsConstant
;
...
...
@@ -84,6 +86,10 @@ import static java.util.stream.Collectors.toList;
@Service
public
class
ShoppingCartNewServiceImpl
implements
ShoppingCartNewService
{
// 配送费逻辑是否使用旧的
@Value
(
"${store.delivery.use:old:false}"
)
private
boolean
storeDeliveryUseOld
;
@Autowired
private
ActivityAdapter
activityAdapter
;
@Autowired
...
...
@@ -1439,6 +1445,34 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
return
amount
;
}
private
Long
getNewDeliveryAmount
(
String
receiveId
,
String
partnerId
,
String
storeId
)
{
String
trackingNo
=
LogThreadLocal
.
getTrackingNo
();
Long
amount
=
0L
;
if
(
StringUtils
.
isBlank
(
receiveId
))
{
return
amount
;
}
QueryReceiveAddressRequest
queryReceive
=
new
QueryReceiveAddressRequest
(
receiveId
,
partnerId
);
//查询会员后货地址经纬度
com
.
freemud
.
application
.
sdk
.
api
.
base
.
BaseResponse
<
QueryReceiveAddressResponse
>
queryReceiveAddressResponse
=
memberCenterService
.
queryReceiveAddressById
(
queryReceive
,
trackingNo
);
if
(!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
queryReceiveAddressResponse
.
getCode
())
||
queryReceiveAddressResponse
.
getData
()
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
USER_GETRECEIVEADDRESS_ERROR
);
}
QueryDeliveryRequest
queryDeliveryRequest
=
new
QueryDeliveryRequest
();
queryDeliveryRequest
.
setPartnerId
(
partnerId
);
queryDeliveryRequest
.
setStoreCode
(
storeId
);
queryDeliveryRequest
.
setUserLatitude
(
queryReceiveAddressResponse
.
getData
().
getLatitude
());
queryDeliveryRequest
.
setUserLongitude
(
queryReceiveAddressResponse
.
getData
().
getLongitude
());
com
.
freemud
.
application
.
sdk
.
api
.
base
.
BaseResponse
<
QueryDeliverDetailResponse
>
queryDeliverDetailResponse
=
storeCenterService
.
queryDeliverDetail
(
queryDeliveryRequest
,
trackingNo
);
if
(
queryDeliverDetailResponse
==
null
||
queryDeliverDetailResponse
.
getStatusCode
()
!=
100
||
queryDeliverDetailResponse
.
getData
()
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
STORE_ITEM_NOT_DELIVERY
);
}
if
(
queryDeliverDetailResponse
.
getData
().
getDeliveryAmount
()
==
null
)
{
throw
new
ServiceException
(
ResponseResult
.
STORE_DELIVERY_AMOUNT_ERROR
);
}
return
queryDeliverDetailResponse
.
getData
().
getDeliveryAmount
();
}
/**
* 获取配送范围内集合
*/
...
...
@@ -1484,12 +1518,18 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
private
Long
calculateDeliveryAmount
(
String
receiveId
,
String
partnerId
,
String
storeId
,
String
wxappid
){
Long
deliveryAmount
=
0
l
;
if
(
receiveId
==
null
)
{
}
else
{
Long
deliveryAmount
=
0L
;
if
(
StringUtils
.
isBlank
(
receiveId
))
{
return
deliveryAmount
;
}
log
.
info
(
"获取配送配逻辑 tackingNo:{},storeDeliveryUseOld:{},receiveId:{},partnerId:{},storeId:{}"
,
LogThreadLocal
.
getTrackingNo
(),
storeDeliveryUseOld
,
receiveId
,
partnerId
,
storeId
);
if
(
storeDeliveryUseOld
)
{
deliveryAmount
=
Long
.
parseLong
(
getDeliveryAmount
(
receiveId
,
partnerId
,
storeId
).
toString
());
}
else
{
deliveryAmount
=
getNewDeliveryAmount
(
receiveId
,
partnerId
,
storeId
);
}
return
deliveryAmount
;
}
}
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