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
27b77a88
Commit
27b77a88
authored
Sep 16, 2022
by
胡敬轩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '爱马哥低碳活动代码下架' into qa
parents
7e9ea838
c2af959b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
99 deletions
+0
-99
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
+0
-99
No files found.
order-application-service/src/main/java/cn/freemud/service/impl/OrderAdapterServiceImpl.java
View file @
27b77a88
...
...
@@ -80,13 +80,6 @@ import java.util.stream.Collectors;
@Service
public
class
OrderAdapterServiceImpl
{
//爱马哥微信低碳活动 一次性活动,结束即可删除 格式(商户号@活动号,用逗号分割):2690@13981711,1864@34343345
@Value
(
"${weixin.pay.success.activity:}"
)
private
String
weixinPayActivity
;
//爱马哥微信低碳活动 一次性活动,结束即可删除 格式(商户号@商品,用逗号分割):2690@13981711,1864@34343345
@Value
(
"${weixin.pay.success.goods:}"
)
private
String
weixinPayGoods
;
//华莱士百事抽奖 一次性活动,结束即可删除 格式(商户号,用逗号分割):2690,2581
@Value
(
"${baishi.activity.partner:2581,2692,2690}"
)
private
String
baishiActivityPartner
;
...
...
@@ -420,8 +413,6 @@ public class OrderAdapterServiceImpl {
if
(
CollectionUtils
.
isNotEmpty
(
message
.
getSvcPayItems
()))
{
sendSvcPayInfoToSvcTransaction
(
message
.
getSvcPayItems
(),
orderBean
.
getCompanyId
(),
orderBean
.
getOid
(),
orderBean
.
getUserId
(),
orderBean
.
getShopId
());
}
//爱马哥低碳活动 活动结束即可删除此代码,大概2022-09月结束
sendLowCarbonToWeixin
(
message
,
orderBean
);
return
result
;
}
catch
(
Exception
e
)
{
throw
e
;
...
...
@@ -518,96 +509,6 @@ public class OrderAdapterServiceImpl {
/**
* 微信低碳活动上报,活动结束即可删除
*
* @param message
* @param orderBean
*/
private
void
sendLowCarbonToWeixin
(
PaysuccessNoticeMessage
message
,
OrderBeanV1
orderBean
)
{
ApiLog
.
printLog
(
"sendLowCarbonToWeixin"
,
message
,
orderBean
,
null
);
BaseResponse
response
=
null
;
try
{
// 微商城订单处理 因为没有appid
if
(
Objects
.
equals
(
BizTypeEnum
.
MALL
.
getBizType
(),
orderBean
.
getBizType
()))
{
return
;
}
//先判断有没有微信支付
List
<
OrderPayItemResp
>
orderPayItem
=
orderBean
.
getOrderPayItem
();
boolean
hasWeixinPay
=
Objects
.
equals
(
orderBean
.
getPayChannelType
(),
String
.
valueOf
(
PayChannelType
.
WECHAT
.
getIndex
()))
||
(
CollectionUtils
.
isNotEmpty
(
orderPayItem
)
&&
orderPayItem
.
stream
().
anyMatch
(
payItem
->
Objects
.
equals
(
payItem
.
getPayChannelType
(),
PayChannelType
.
WECHAT
.
getIndex
().
intValue
())));
if
(!
hasWeixinPay
)
{
return
;
}
//再判断用没有配置活动
String
activityId
=
getActivityId
(
orderBean
.
getCompanyId
());
if
(
StringUtils
.
isBlank
(
activityId
))
{
return
;
}
//再判断订单商品是否在白名单里面
if
(
isGoodInActivity
(
orderBean
.
getCompanyId
(),
orderBean
.
getProductList
()))
{
ReportActivityBehaviorsRequest
request
=
new
ReportActivityBehaviorsRequest
();
request
.
setPartnerId
(
orderBean
.
getCompanyId
());
request
.
setActivityId
(
activityId
);
request
.
setOpenId
(
message
.
getOpenid
());
request
.
setTransactionId
(
message
.
getThirdPartTradeNo
());
request
.
setMiniAppId
(
orderBean
.
getAppId
());
response
=
ecologyProgramApplicationClient
.
reportActivityBehaviors
(
request
);
if
(!
Objects
.
equals
(
response
.
getCode
(),
"100"
))
{
if
(!
Objects
.
equals
(
response
.
getMessage
(),
"用户未参加或已退出该活动"
)){
//用户未报名活动的过滤掉
// 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
){
// 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
)
{
String
[]
partnerArr
=
weixinPayActivity
.
split
(
","
);
if
(
partnerArr
!=
null
&&
partnerArr
.
length
>
0
)
{
for
(
String
partnerStr
:
partnerArr
)
{
String
[]
arr
=
partnerStr
.
split
(
"@"
);
if
(
Objects
.
equals
(
arr
[
0
],
partnerId
))
{
return
arr
[
1
];
}
}
}
return
null
;
}
private
boolean
isGoodInActivity
(
String
partnerId
,
List
<
ProductBeanV1
>
productList
)
{
List
<
String
>
partnerList
=
Arrays
.
asList
(
weixinPayGoods
.
split
(
","
));
if
(
CollectionUtils
.
isNotEmpty
(
partnerList
)
&&
CollectionUtils
.
isNotEmpty
(
productList
))
{
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
;
}
/**
* 华莱士临时需求,
*
* @param request
...
...
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