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
93794d7c
Commit
93794d7c
authored
Jun 10, 2022
by
胡敬轩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
爱马哥低碳活动 活动结束即可删除此代码
parent
a1f4e4da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
+33
-3
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
View file @
93794d7c
...
@@ -28,6 +28,7 @@ import cn.freemud.service.thirdparty.SvcTransactionClient;
...
@@ -28,6 +28,7 @@ import cn.freemud.service.thirdparty.SvcTransactionClient;
import
cn.freemud.service.universal.factory.CreateOrderServiceFactory
;
import
cn.freemud.service.universal.factory.CreateOrderServiceFactory
;
import
cn.freemud.utils.RedisUtil
;
import
cn.freemud.utils.RedisUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo
;
import
com.freemud.api.assortment.datamanager.enums.IappIdType
;
import
com.freemud.api.assortment.datamanager.enums.IappIdType
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
import
com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager
;
...
@@ -42,6 +43,7 @@ import com.freemud.application.sdk.api.ordercenter.enums.MarketTypeEnum;
...
@@ -42,6 +43,7 @@ import com.freemud.application.sdk.api.ordercenter.enums.MarketTypeEnum;
import
com.freemud.application.sdk.api.ordercenter.enums.NewOrderStatus
;
import
com.freemud.application.sdk.api.ordercenter.enums.NewOrderStatus
;
import
com.freemud.application.sdk.api.ordercenter.enums.PayChannelType
;
import
com.freemud.application.sdk.api.ordercenter.enums.PayChannelType
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderPayItemResp
;
import
com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderPayItemResp
;
import
com.freemud.application.sdk.api.service.EmailAlertService
;
import
com.freemud.sdk.api.assortment.order.util.LockUtils
;
import
com.freemud.sdk.api.assortment.order.util.LockUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -164,6 +166,8 @@ public class OrderAdapterServiceImpl {
...
@@ -164,6 +166,8 @@ public class OrderAdapterServiceImpl {
private
SvcTransactionClient
svcTransactionClient
;
private
SvcTransactionClient
svcTransactionClient
;
@Autowired
@Autowired
private
EcologyProgramApplicationClient
ecologyProgramApplicationClient
;
private
EcologyProgramApplicationClient
ecologyProgramApplicationClient
;
@Autowired
private
EmailAlertService
emailAlertService
;
//获取下单实现对象
//获取下单实现对象
private
OrderFactoryService
getCreateOrderBean
(
AssortmentCustomerInfoVo
assortmentCustomerInfoVo
,
CreateOrderVo
createOrderVo
){
private
OrderFactoryService
getCreateOrderBean
(
AssortmentCustomerInfoVo
assortmentCustomerInfoVo
,
CreateOrderVo
createOrderVo
){
...
@@ -490,6 +494,7 @@ public class OrderAdapterServiceImpl {
...
@@ -490,6 +494,7 @@ public class OrderAdapterServiceImpl {
*/
*/
private
void
sendLowCarbonToWeixin
(
PaysuccessNoticeMessage
message
,
OrderBeanV1
orderBean
){
private
void
sendLowCarbonToWeixin
(
PaysuccessNoticeMessage
message
,
OrderBeanV1
orderBean
){
ApiLog
.
printLog
(
"sendLowCarbonToWeixin"
,
message
,
orderBean
,
null
);
ApiLog
.
printLog
(
"sendLowCarbonToWeixin"
,
message
,
orderBean
,
null
);
BaseResponse
response
=
null
;
try
{
try
{
//先判断有没有微信支付
//先判断有没有微信支付
List
<
OrderPayItemResp
>
orderPayItem
=
orderBean
.
getOrderPayItem
();
List
<
OrderPayItemResp
>
orderPayItem
=
orderBean
.
getOrderPayItem
();
...
@@ -512,10 +517,15 @@ public class OrderAdapterServiceImpl {
...
@@ -512,10 +517,15 @@ public class OrderAdapterServiceImpl {
request
.
setOpenId
(
message
.
getOpenid
());
request
.
setOpenId
(
message
.
getOpenid
());
request
.
setTransactionId
(
message
.
getThirdPartTradeNo
());
request
.
setTransactionId
(
message
.
getThirdPartTradeNo
());
request
.
setMiniAppId
(
orderBean
.
getAppId
());
request
.
setMiniAppId
(
orderBean
.
getAppId
());
ecologyProgramApplicationClient
.
reportActivityBehaviors
(
request
);
response
=
ecologyProgramApplicationClient
.
reportActivityBehaviors
(
request
);
if
(!
Objects
.
equals
(
response
.
getCode
(),
"100"
))
{
emailAlertService
.
sendEmailAlert
(
"低碳活动上报失败"
,
String
.
format
(
"request:%s \r\nresponse:%s \r\norderNo:%s"
,
JSONObject
.
toJSONString
(
request
),
JSONObject
.
toJSONString
(
response
),
orderBean
.
getOid
()));
ApiLog
.
printLog
(
"sendLowCarbonToWeixin error "
+
orderBean
.
getOid
(),
message
,
request
,
response
);
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
ErrorLog
.
printErrorLog
(
"sendLowCarbonToWeixin "
,
"/ecology/micro-program/low-carbon-action/activities/behaviors-report"
,
orderBean
,
e
);
emailAlertService
.
sendEmailAlert
(
"低碳活动上报异常"
,
String
.
format
(
"request:%s \r\nresponse:%s \r\norderNo:%s"
,
JSONObject
.
toJSONString
(
message
),
JSONObject
.
toJSONString
(
response
),
orderBean
.
getOid
()));
ErrorLog
.
printErrorLog
(
"sendLowCarbonToWeixin exception"
,
"/ecology/micro-program/low-carbon-action/activities/behaviors-report"
,
orderBean
,
e
);
}
}
}
}
private
String
getActivityId
(
String
partnerId
){
private
String
getActivityId
(
String
partnerId
){
...
@@ -534,7 +544,27 @@ public class OrderAdapterServiceImpl {
...
@@ -534,7 +544,27 @@ public class OrderAdapterServiceImpl {
private
boolean
isGoodInActivity
(
String
partnerId
,
List
<
ProductBeanV1
>
productList
){
private
boolean
isGoodInActivity
(
String
partnerId
,
List
<
ProductBeanV1
>
productList
){
List
<
String
>
partnerList
=
Arrays
.
asList
(
weixinPayGoods
.
split
(
","
));
List
<
String
>
partnerList
=
Arrays
.
asList
(
weixinPayGoods
.
split
(
","
));
if
(
CollectionUtils
.
isNotEmpty
(
partnerList
)
&&
CollectionUtils
.
isNotEmpty
(
productList
)){
if
(
CollectionUtils
.
isNotEmpty
(
partnerList
)
&&
CollectionUtils
.
isNotEmpty
(
productList
)){
return
productList
.
stream
().
anyMatch
(
productBeanV1
->
partnerList
.
contains
(
partnerId
+
"@"
+(
StringUtils
.
isBlank
(
productBeanV1
.
getSpecification
())?
productBeanV1
.
getProductId
():
productBeanV1
.
getSpecification
())));
return
productList
.
stream
().
anyMatch
(
productBeanV1
->
{
boolean
mainProduct
=
partnerList
.
contains
(
partnerId
+
"@"
+(
StringUtils
.
isBlank
(
productBeanV1
.
getSpecification
())?
productBeanV1
.
getProductId
():
productBeanV1
.
getSpecification
()));
if
(
mainProduct
){
return
true
;
}
if
(
CollectionUtils
.
isNotEmpty
(
productBeanV1
.
getSendProduct
())){
boolean
sendProduct
=
productBeanV1
.
getSendProduct
().
stream
().
anyMatch
(
send
->
partnerList
.
contains
(
partnerId
+
"@"
+(
StringUtils
.
isBlank
(
send
.
getSpecification
())?
send
.
getProductId
():
send
.
getSpecification
())));
if
(
sendProduct
){
return
true
;
}
}
if
(
CollectionUtils
.
isNotEmpty
(
productBeanV1
.
getComboProduct
())){
boolean
comboProduct
=
productBeanV1
.
getComboProduct
().
stream
().
anyMatch
(
combo
->
partnerList
.
contains
(
partnerId
+
"@"
+(
StringUtils
.
isBlank
(
combo
.
getSpecification
())?
combo
.
getProductId
():
combo
.
getSpecification
())));
if
(
comboProduct
){
return
true
;
}
}
return
false
;
});
}
}
return
false
;
return
false
;
}
}
...
...
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