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
f59603c3
Commit
f59603c3
authored
Nov 29, 2020
by
zhiheng.zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
35152a4b
f36736f2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
243 additions
and
26 deletions
+243
-26
order-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayRequestDto.java
+21
-0
order-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayResponseDto.java
+27
-0
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
+30
-4
order-application-service/src/main/java/cn/freemud/service/thirdparty/SvcComPayClient.java
+25
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayRequestDto.java
+21
-0
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayResponseDto.java
+27
-0
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
+67
-22
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/SvcComPayClient.java
+25
-0
No files found.
order-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayRequestDto.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
entities
.
dto
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.entities.dto SvcComPayRequestDto
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
@NoArgsConstructor
public
class
SvcComPayRequestDto
{
private
String
partnerId
;
private
String
storeId
;
}
order-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayResponseDto.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
entities
.
dto
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.entities.dto SvcComPayResoonseDto
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
@NoArgsConstructor
public
class
SvcComPayResponseDto
{
private
String
code
;
private
String
message
;
private
Result
result
;
@Data
@NoArgsConstructor
static
public
class
Result
{
private
Boolean
value
;
}
}
order-application-service/src/main/java/cn/freemud/service/impl/OrderServiceImpl.java
View file @
f59603c3
...
@@ -266,6 +266,8 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -266,6 +266,8 @@ public class OrderServiceImpl implements Orderservice {
@Autowired
@Autowired
private
AssortmentOpenPlatformIappWxappStoreManager
assortmentOpenPlatformIappWxappStoreManager
;
private
AssortmentOpenPlatformIappWxappStoreManager
assortmentOpenPlatformIappWxappStoreManager
;
@Autowired
private
SvcComPayClient
svcComPayClient
;
@Override
@Override
public
BaseResponse
checkBeforeCreateOrder
(
CheckBeforeCreateOrderRequestVo
requestVo
)
{
public
BaseResponse
checkBeforeCreateOrder
(
CheckBeforeCreateOrderRequestVo
requestVo
)
{
String
trackingNo
=
LogTreadLocal
.
getTrackingNo
();
String
trackingNo
=
LogTreadLocal
.
getTrackingNo
();
...
@@ -2321,11 +2323,10 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -2321,11 +2323,10 @@ public class OrderServiceImpl implements Orderservice {
,
String
storeId
,
String
storeId
,
String
trackingNo
)
{
,
String
trackingNo
)
{
boolean
tigger
=
false
;
OrderPayResponse
orderPayResponse
=
new
OrderPayResponse
();
OrderPayResponse
orderPayResponse
=
new
OrderPayResponse
();
tigger
=
true
;
boolean
check
=
this
.
checkSvcComPay
(
orderBean
.
getCompanyId
(),
orderBean
.
getShopId
())
;
//混合支付
//混合支付
if
(
tigger
&&
StringUtils
.
isNotBlank
(
channel
))
{
if
(
check
&&
StringUtils
.
isNotBlank
(
channel
))
{
log
.
info
(
"混合支付:"
);
log
.
info
(
"混合支付:"
);
String
partnerPayOvertime
=
this
.
getPartnerPayOvertime
(
orderBean
.
getCompanyId
());
String
partnerPayOvertime
=
this
.
getPartnerPayOvertime
(
orderBean
.
getCompanyId
());
orderPayResponse
=
comPayOrder
(
cardCode
,
orderBean
,
paymentRequest
,
partnerPayOvertime
,
totalAmount
.
intValue
(),
channel
,
storeId
,
LogThreadLocal
.
getTrackingNo
());
orderPayResponse
=
comPayOrder
(
cardCode
,
orderBean
,
paymentRequest
,
partnerPayOvertime
,
totalAmount
.
intValue
(),
channel
,
storeId
,
LogThreadLocal
.
getTrackingNo
());
...
@@ -3218,7 +3219,7 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -3218,7 +3219,7 @@ public class OrderServiceImpl implements Orderservice {
if
(
combPayResponse
==
null
||
!
ResponseCodeConstant
.
PAYMENT_RESPONSE_SUCCESS
.
equals
(
combPayResponse
.
getCode
()))
{
if
(
combPayResponse
==
null
||
!
ResponseCodeConstant
.
PAYMENT_RESPONSE_SUCCESS
.
equals
(
combPayResponse
.
getCode
()))
{
log
.
info
(
"混合支付返回信息错误,trackingNo:{} request:{} response:{}"
,
trackingNo
,
JSONObject
.
toJSONString
(
combPayRequest
),
JSONObject
.
toJSONString
(
combPayResponse
));
log
.
info
(
"混合支付返回信息错误,trackingNo:{} request:{} response:{}"
,
trackingNo
,
JSONObject
.
toJSONString
(
combPayRequest
),
JSONObject
.
toJSONString
(
combPayResponse
));
orderPayResponse
.
setMsg
(
combPayResponse
.
getMsg
()
);
orderPayResponse
.
setMsg
(
combPayResponse
!=
null
?
"支付:"
+
combPayResponse
.
getMsg
()
:
"混合支付忙不过来啦,请稍后再试"
);
return
orderPayResponse
;
return
orderPayResponse
;
}
}
Integer
svcAmount
=
0
;
Integer
svcAmount
=
0
;
...
@@ -3339,4 +3340,29 @@ public class OrderServiceImpl implements Orderservice {
...
@@ -3339,4 +3340,29 @@ public class OrderServiceImpl implements Orderservice {
// // TODO: 2019/9/10 hubowen mq推送变更
// // TODO: 2019/9/10 hubowen mq推送变更
// backOrdersStatusChange(orderBean.getOid(), orderBean.getStatus());
// backOrdersStatusChange(orderBean.getOid(), orderBean.getStatus());
//}
//}
/**
* 获取混合支付是否开启
* @param partnerId
* @return
*/
private
boolean
checkSvcComPay
(
String
partnerId
,
String
storeId
)
{
SvcComPayRequestDto
requestDto
=
new
SvcComPayRequestDto
();
requestDto
.
setPartnerId
(
partnerId
);
requestDto
.
setStoreId
(
storeId
);
SvcComPayResponseDto
query
=
null
;
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
query
=
svcComPayClient
.
query
(
requestDto
);
if
(
query
!=
null
)
break
;
}
log
.
info
(
"order checkSvcComPay:{}"
,
JSON
.
toJSONString
(
query
));
if
(
query
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
query
.
getCode
()))
{
return
false
;
}
if
(
query
.
getResult
()!=
null
&&
query
.
getResult
().
getValue
())
{
return
true
;
}
else
{
return
false
;
}
}
}
}
order-application-service/src/main/java/cn/freemud/service/thirdparty/SvcComPayClient.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.entities.dto.SvcComPayRequestDto
;
import
cn.freemud.entities.dto.SvcComPayResponseDto
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.service.thirdparty SvcClient
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@FeignClient
(
name
=
"payment-center-management"
,
url
=
"${saas.svc.switch.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
SvcComPayClient
{
@PostMapping
(
"/paymentmanager/partnerSetting/queryAssociationPaymentFlagPartnerSetting"
)
SvcComPayResponseDto
query
(
SvcComPayRequestDto
svcComPayRequestDto
);
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayRequestDto.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
entities
.
dto
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.entities.dto SvcComPayRequestDto
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
@NoArgsConstructor
public
class
SvcComPayRequestDto
{
private
String
partnerId
;
private
String
storeId
;
}
shopping-cart-application-service/src/main/java/cn/freemud/entities/dto/SvcComPayResponseDto.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
entities
.
dto
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.entities.dto SvcComPayResoonseDto
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Data
@NoArgsConstructor
public
class
SvcComPayResponseDto
{
private
String
code
;
private
String
message
;
private
Result
result
;
@Data
@NoArgsConstructor
static
public
class
Result
{
private
Boolean
value
;
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
View file @
f59603c3
...
@@ -151,6 +151,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -151,6 +151,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private
ActivityService
activityService
;
private
ActivityService
activityService
;
@Autowired
@Autowired
private
RedisCache
redisCache
;
private
RedisCache
redisCache
;
@Autowired
private
SvcComPayClient
svcComPayClient
;
private
static
final
String
limitCartKey
=
"ecology:kgd:wxappconfig:open_platform_partner_wxapp_config:appkey_"
;
private
static
final
String
limitCartKey
=
"ecology:kgd:wxappconfig:open_platform_partner_wxapp_config:appkey_"
;
...
@@ -1643,30 +1645,49 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -1643,30 +1645,49 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if
(
response
.
getData
()
==
null
||
response
.
getData
().
getData
()
==
null
||
response
.
getData
().
getData
().
getCardSimpleInfos
().
size
()
>
1
)
{
if
(
response
.
getData
()
==
null
||
response
.
getData
().
getData
()
==
null
||
response
.
getData
().
getData
().
getCardSimpleInfos
().
size
()
>
1
)
{
throw
new
ServiceException
(
ResponseResult
.
USER_SVC_CARD_ERROR
);
throw
new
ServiceException
(
ResponseResult
.
USER_SVC_CARD_ERROR
);
}
}
//混合支付无需校验svc卡余额,但是配送和包装费不计算在svc卡支付
boolean
check
=
this
.
checkSvcComPay
(
partnerId
,
storeId
);
Integer
amount1
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getAmount
();
if
(
check
)
{
Integer
vamount
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getVamount
();
//混合支付无需校验svc卡余额,但是配送和包装费不计算在svc卡支付
Integer
svcTotalAmount
=
amount1
+
vamount
;
Integer
amount1
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getAmount
();
//获取实际配送费
Integer
vamount
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getVamount
();
Integer
deliveryAmount
=
0
;
Integer
svcTotalAmount
=
amount1
+
vamount
;
Integer
svcPayAmount
=
0
;
//获取实际配送费
if
(
StringUtils
.
isNotBlank
(
receiveId
)
&&
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
()
!=
null
)
{
Integer
deliveryAmount
=
0
;
//Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId);
Integer
svcPayAmount
=
0
;
deliveryAmount
=
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
().
intValue
();
if
(
StringUtils
.
isNotBlank
(
receiveId
)
&&
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
()
!=
null
)
{
orderAmount
+=
deliveryAmount
;
//Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId);
}
deliveryAmount
=
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
().
intValue
();
if
(
svcTotalAmount
>
0
&&
svcTotalAmount
>
orderAmount
)
{
orderAmount
+=
deliveryAmount
;
svcPayAmount
=
orderAmount
;
}
shoppingCartGoodsResponseVo
.
setTotalAmount
(
0L
);
if
(
svcTotalAmount
>
0
&&
svcTotalAmount
>
orderAmount
)
{
svcPayAmount
=
orderAmount
;
shoppingCartGoodsResponseVo
.
setTotalAmount
(
0L
);
}
else
if
(
svcTotalAmount
>
0
&&
svcTotalAmount
<=
orderAmount
)
{
svcPayAmount
=
svcTotalAmount
;
shoppingCartGoodsResponseVo
.
setTotalAmount
((
orderAmount
.
longValue
()-
svcPayAmount
.
longValue
()));
}
BigDecimal
bigDecimal
=
new
BigDecimal
(
svcPayAmount
);
String
amountStr
=
bigDecimal
.
divide
(
new
BigDecimal
(
100
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toString
();
shoppingCartGoodsResponseVo
.
setSvcPayAmount
(
amountStr
);
shoppingCartGoodsResponseVo
.
setSvcDiscountDesc
(
"储值卡支付¥"
+
amountStr
);
}
}
else
if
(
svcTotalAmount
>
0
&&
svcTotalAmount
<=
orderAmount
)
{
else
{
svcPayAmount
=
svcTotalAmount
;
//获取实际配送费
shoppingCartGoodsResponseVo
.
setTotalAmount
((
orderAmount
.
longValue
()-
svcPayAmount
.
longValue
()));
if
(
StringUtils
.
isNotBlank
(
receiveId
)
&&
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
()
!=
null
)
{
Integer
deliveryAmount
=
shoppingCartGoodsResponseVo
.
getDiscountDeliveryAmount
().
intValue
();
orderAmount
+=
deliveryAmount
;
}
Integer
amount1
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getAmount
();
Integer
vamount
=
response
.
getData
().
getData
().
getCardSimpleInfos
().
get
(
0
).
getVamount
();
if
(
orderAmount
>
amount1
+
vamount
)
{
throw
new
ServiceException
(
ResponseResult
.
USER_SVC_CARD_AMOUNT_DEFICIENCY
);
}
BigDecimal
bigDecimal
=
new
BigDecimal
(
orderAmount
);
String
amountStr
=
bigDecimal
.
divide
(
new
BigDecimal
(
100
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toString
();
shoppingCartGoodsResponseVo
.
setTotalAmount
(
0L
);
shoppingCartGoodsResponseVo
.
setSvcDiscountDesc
(
"储值卡支付¥"
+
amountStr
);
}
}
BigDecimal
bigDecimal
=
new
BigDecimal
(
svcPayAmount
);
String
amountStr
=
bigDecimal
.
divide
(
new
BigDecimal
(
100
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
toString
();
shoppingCartGoodsResponseVo
.
setSvcPayAmount
(
amountStr
);
shoppingCartGoodsResponseVo
.
setSvcDiscountDesc
(
"储值卡支付¥"
+
amountStr
);
}
}
/**
/**
...
@@ -2049,4 +2070,28 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
...
@@ -2049,4 +2070,28 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
}
}
/**
* 获取混合支付是否开启
* @param partnerId
* @return
*/
private
boolean
checkSvcComPay
(
String
partnerId
,
String
storeId
)
{
SvcComPayRequestDto
requestDto
=
new
SvcComPayRequestDto
();
requestDto
.
setPartnerId
(
partnerId
);
requestDto
.
setStoreId
(
storeId
);
SvcComPayResponseDto
query
=
null
;
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
query
=
svcComPayClient
.
query
(
requestDto
);
if
(
query
!=
null
)
break
;
}
if
(
query
==
null
||
!
ResponseResult
.
SUCCESS
.
getCode
().
equals
(
query
.
getCode
()))
{
return
false
;
}
if
(
query
.
getResult
()!=
null
&&
query
.
getResult
().
getValue
())
{
return
true
;
}
else
{
return
false
;
}
}
}
}
shopping-cart-application-service/src/main/java/cn/freemud/service/thirdparty/SvcComPayClient.java
0 → 100644
View file @
f59603c3
package
cn
.
freemud
.
service
.
thirdparty
;
import
cn.freemud.entities.dto.SvcComPayRequestDto
;
import
cn.freemud.entities.dto.SvcComPayResponseDto
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title: cn.freemud.service.thirdparty SvcClient
* @Description: TDO 描述....
* @author: 铁牌灵魂工程师
* @date: 2020/11/27
* @Copyright: www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@FeignClient
(
name
=
"payment-center-management"
,
url
=
"${saas.svc.switch.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
SvcComPayClient
{
@PostMapping
(
"/paymentmanager/partnerSetting/queryAssociationPaymentFlagPartnerSetting"
)
SvcComPayResponseDto
query
(
SvcComPayRequestDto
svcComPayRequestDto
);
}
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