Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fit-finance
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
fitness-server
fit-finance
Commits
6ef0b8fe
Commit
6ef0b8fe
authored
Jun 15, 2024
by
程裕兵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:send member message
parent
cccf78c7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
3 deletions
+72
-3
app/src/main/java/com/jiejing/fitness/finance/app/FitnessFinanceApplication.java
+1
-0
pom.xml
+5
-0
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioCashierRecordMapper.xml
+2
-2
service/pom.xml
+4
-0
service/src/main/java/com/jiejing/fitness/finance/service/pay/impl/RefundServiceImpl.java
+16
-1
service/src/main/java/com/jiejing/fitness/finance/service/rpc/ConfigRpcService.java
+44
-0
No files found.
app/src/main/java/com/jiejing/fitness/finance/app/FitnessFinanceApplication.java
View file @
6ef0b8fe
...
...
@@ -39,6 +39,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
"com.jiejing.message.api"
,
"com.jiejing.fitness.rpc.api"
,
"com.jiejing.permcenter.api"
,
"com.jiejing.configcenter.api"
,
})
@SpringBootApplication
(
scanBasePackages
=
"com.jiejing"
,
exclude
=
{
DruidDataSourceAutoConfigure
.
class
...
...
pom.xml
View file @
6ef0b8fe
...
...
@@ -86,6 +86,11 @@
<artifactId>
permcenter-api
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.jiejing.base
</groupId>
<artifactId>
configcenter-api
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</dependency>
<!-- ======================= jiejing api end ======================= -->
...
...
repository/src/main/java/com/jiejing/fitness/finance/repository/mapper/StudioCashierRecordMapper.xml
View file @
6ef0b8fe
...
...
@@ -82,7 +82,7 @@
<select
id=
"statistic"
resultType=
"com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO"
>
select sum(trans_amount) as total_trans_amount,
sum(
case when trans_state = 'PAY_IN' then actual_amount else 0 end
) as total_actual_amount,
sum(
actual_amount
) as total_actual_amount,
sum(fee) as total_fee, count(id) as total
from studio_cashier_record
<where>
...
...
@@ -150,7 +150,7 @@
<select
id=
"statisticRefund"
resultType=
"com.jiejing.fitness.finance.api.cashier.vo.StudioCashierStatisticVO"
>
select sum(trans_amount) as total_trans_amount,
sum(case when trans_state = 'REFUND_SUCCESS' then actual_amount else 0 end
) as total_actual_amount,
sum(actual_amount
) as total_actual_amount,
sum(case when trans_state = 'REFUND_SUCCESS' then fee else 0 end) as total_fee,
count(id) as total
from studio_cashier_record
...
...
service/pom.xml
View file @
6ef0b8fe
...
...
@@ -36,6 +36,10 @@
<artifactId>
permcenter-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.jiejing.base
</groupId>
<artifactId>
configcenter-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.jiejing.event
</groupId>
<artifactId>
scs-event
</artifactId>
</dependency>
...
...
service/src/main/java/com/jiejing/fitness/finance/service/pay/impl/RefundServiceImpl.java
View file @
6ef0b8fe
...
...
@@ -16,6 +16,7 @@ import com.jiejing.common.utils.convert.BeanUtil;
import
com.jiejing.common.utils.text.StringUtil
;
import
com.jiejing.common.utils.time.TimeUtil
;
import
com.jiejing.fitness.enums.auth.AuthDomainEnum
;
import
com.jiejing.fitness.enums.config.ObjectTypeEnum
;
import
com.jiejing.fitness.enums.finance.BrandCashierTransStateEnum
;
import
com.jiejing.fitness.event.finance.CashierEvent
;
import
com.jiejing.fitness.finance.api.merchant.vo.StudioMerchantCheckRefundVO
;
...
...
@@ -33,6 +34,7 @@ import com.jiejing.fitness.finance.service.merchant.StudioMerchantService;
import
com.jiejing.fitness.finance.service.pay.RefundService
;
import
com.jiejing.fitness.finance.service.pay.convert.RefundConvert
;
import
com.jiejing.fitness.finance.service.pay.params.StudioMerchantRefundParams
;
import
com.jiejing.fitness.finance.service.rpc.ConfigRpcService
;
import
com.jiejing.fitness.finance.service.rpc.PayRpcService
;
import
com.jiejing.fitness.finance.service.rpc.PermissionRpcService
;
import
com.jiejing.fitness.finance.service.rpc.StudioRpcService
;
...
...
@@ -90,6 +92,9 @@ public class RefundServiceImpl implements RefundService {
@Resource
private
ConfigService
configService
;
@Resource
private
ConfigRpcService
configRpcService
;
@Resource
(
name
=
"financeThreadPool"
)
private
Executor
executor
;
...
...
@@ -206,15 +211,25 @@ public class RefundServiceImpl implements RefundService {
return
;
}
Boolean
wx
=
configRpcService
.
getStudioBoolConfig
(
record
.
getStudioId
(),
"WECHAT_MEMBER_REFUND_SUCCESS"
);
Boolean
sms
=
configRpcService
.
getStudioBoolConfig
(
record
.
getStudioId
(),
"SMS_MEMBER_REFUND_SUCCESS"
);
String
targetId
;
Long
memberId
=
extra
.
getLong
(
"notice_member_id"
);
List
<
MsgChannelEnum
>
channels
=
Lists
.
newArrayList
(
MsgChannelEnum
.
SMS
);
List
<
MsgChannelEnum
>
channels
=
sms
?
Lists
.
newArrayList
(
MsgChannelEnum
.
SMS
)
:
Lists
.
newArrayList
(
);
if
(
null
!=
memberId
)
{
targetId
=
memberId
.
toString
();
if
(
wx
)
{
channels
.
add
(
MsgChannelEnum
.
WE_CHAT
);
}
}
else
{
targetId
=
record
.
getBuyerPhone
();
}
if
(
CollectionUtil
.
isEmpty
(
channels
))
{
log
.
info
(
"all config is false {}, {}"
,
wx
,
sms
);
return
;
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>(
1
);
paramMap
.
put
(
"targetId"
,
targetId
);
paramMap
.
put
(
"studioId"
,
record
.
getStudioId
());
...
...
service/src/main/java/com/jiejing/fitness/finance/service/rpc/ConfigRpcService.java
0 → 100644
View file @
6ef0b8fe
package
com
.
jiejing
.
fitness
.
finance
.
service
.
rpc
;
import
com.google.common.collect.Lists
;
import
com.jiejing.common.model.JsonResult
;
import
com.jiejing.configcenter.api.config.ConfigApi
;
import
com.jiejing.configcenter.api.config.request.GetConfigDetailsRequest
;
import
com.jiejing.configcenter.api.config.vo.DetailVO
;
import
com.jiejing.fitness.enums.config.ObjectTypeEnum
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
javax.annotation.Resource
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
/**
* @author chengyubing
* @since 2024/6/15 17:20
*/
@Slf4j
@Service
public
class
ConfigRpcService
{
@Resource
private
ConfigApi
configApi
;
public
List
<
DetailVO
>
listConfig
(
ObjectTypeEnum
objectType
,
Long
objectId
,
List
<
String
>
codes
)
{
JsonResult
<
List
<
DetailVO
>>
result
=
configApi
.
getConfigDetails
(
GetConfigDetailsRequest
.
builder
().
objectType
(
objectType
.
getCode
()).
objectId
(
objectId
).
codes
(
codes
)
.
build
());
result
.
assertSuccess
();
return
Optional
.
ofNullable
(
result
.
getResult
()).
orElse
(
new
ArrayList
<>());
}
public
DetailVO
getConfig
(
ObjectTypeEnum
objectType
,
Long
objectId
,
String
code
)
{
return
this
.
listConfig
(
objectType
,
objectId
,
Lists
.
newArrayList
(
code
)).
stream
().
findFirst
().
orElse
(
null
);
}
public
Boolean
getStudioBoolConfig
(
Long
objectId
,
String
code
)
{
DetailVO
vo
=
getConfig
(
ObjectTypeEnum
.
STUDIO
,
objectId
,
code
);
return
Boolean
.
parseBoolean
(
vo
.
getConfigValue
());
}
}
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