Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
ac5c2a54
Commit
ac5c2a54
authored
Aug 11, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:收费改为消息队列
parent
723e82ff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
HaobanQywxFeeApiService.java
...aoban/manage/api/service/fee/HaobanQywxFeeApiService.java
+11
-1
HaobanQywxFeeApiServiceImpl.java
...ice/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
+25
-9
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/fee/HaobanQywxFeeApiService.java
View file @
ac5c2a54
...
@@ -23,7 +23,17 @@ public interface HaobanQywxFeeApiService {
...
@@ -23,7 +23,17 @@ public interface HaobanQywxFeeApiService {
* @author mozhu
* @author mozhu
* @date 2022-08-03 17:28:56
* @date 2022-08-03 17:28:56
*/
*/
void
insert
(
String
param
);
void
run
(
String
param
);
/**
* "routerName": "qywxAddFeeMq"
*
* @param wxEnterpriseId wx企业id
* @author mozhu
* @date 2022-08-11 14:38:50
*/
void
addFee
(
String
wxEnterpriseId
);
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
View file @
ac5c2a54
...
@@ -11,6 +11,7 @@ import com.gic.dubbo.entity.ProviderLocalTag;
...
@@ -11,6 +11,7 @@ import com.gic.dubbo.entity.ProviderLocalTag;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.AlertMessageDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeAccountInterceptLogDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
...
@@ -31,6 +32,7 @@ import com.gic.wechat.api.dto.qywx.fee.*;
...
@@ -31,6 +32,7 @@ import com.gic.wechat.api.dto.qywx.fee.*;
import
com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO
;
import
com.gic.wechat.api.dto.qywx.fee.qdto.FeeOrderListQDTO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -64,18 +66,34 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -64,18 +66,34 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
private
HaobanQywxFeeAccountInterceptLogService
haobanQywxFeeAccountInterceptLogService
;
private
HaobanQywxFeeAccountInterceptLogService
haobanQywxFeeAccountInterceptLogService
;
@Override
@Override
public
void
insert
(
String
param
)
{
public
void
run
(
String
param
)
{
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
String
serviceCorpid
=
config
.
getCorpid
();
for
(
TabHaobanWxEnterprise
wxEnterprise
:
tabHaobanWxEnterprises
)
{
for
(
TabHaobanWxEnterprise
wxEnterprise
:
tabHaobanWxEnterprises
)
{
String
wxEnterpriseId
=
wxEnterprise
.
getWxEnterpriseId
();
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
try
{
instance
.
sendMessage
(
"addFeeMq"
,
wxEnterprise
.
getWxEnterpriseId
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息处理异常:{}"
,
e
.
getMessage
(),
e
);
}
}
}
@Override
public
void
addFee
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
logger
.
error
(
"wx企业id为空"
);
return
;
}
String
serviceCorpid
=
config
.
getCorpid
();
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
String
corpid
=
qwDTO
.
getThirdCorpid
();
String
corpid
=
qwDTO
.
getThirdCorpid
();
String
corpName
=
wxEnterpriseDTO
.
getCorpName
();
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
corpid
,
serviceCorpid
);
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
corpid
,
serviceCorpid
);
if
(!
"1"
.
equals
(
autoActiveStatus
))
{
if
(!
"1"
.
equals
(
autoActiveStatus
))
{
logger
.
info
(
"未开启自动激活:{}"
,
corpid
);
logger
.
info
(
"未开启自动激活:{}"
,
corpid
);
wxEnterpriseService
.
updateAutoActiveFlagById
(
0
,
wxEnterpriseId
);
wxEnterpriseService
.
updateAutoActiveFlagById
(
0
,
wxEnterpriseId
);
continue
;
return
;
}
}
logger
.
info
(
"企微收费:{},{}"
,
corpid
,
wxEnterpriseId
);
logger
.
info
(
"企微收费:{},{}"
,
corpid
,
wxEnterpriseId
);
...
@@ -228,7 +246,7 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -228,7 +246,7 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
if
(
haobanQywxFeeDetailDTO
!=
null
)
{
if
(
haobanQywxFeeDetailDTO
!=
null
)
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
wxEnterprise
.
getCorpName
()
);
tabHaobanQywxFee
.
setCorpName
(
corpName
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
haobanQywxFeeDetailDTO
.
getInterceptTime
());
tabHaobanQywxFee
.
setInterceptTime
(
haobanQywxFeeDetailDTO
.
getInterceptTime
());
...
@@ -238,14 +256,14 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -238,14 +256,14 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
//告警
//告警
messageAlert
(
wxEnterpriseId
,
wxEnterprise
.
getCorpName
()
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
());
messageAlert
(
wxEnterpriseId
,
corpName
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
());
}
}
List
<
TabHaobanQywxFeeAccountInterceptLog
>
tabHaobanQywxFeeAccountInterceptLogs
=
haobanQywxFeeAccountInterceptLogService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
List
<
TabHaobanQywxFeeAccountInterceptLog
>
tabHaobanQywxFeeAccountInterceptLogs
=
haobanQywxFeeAccountInterceptLogService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
tabHaobanQywxFeeAccountInterceptLogs
))
{
if
(
CollectionUtils
.
isNotEmpty
(
tabHaobanQywxFeeAccountInterceptLogs
))
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
wxEnterprise
.
getCorpName
()
);
tabHaobanQywxFee
.
setCorpName
(
corpName
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
));
tabHaobanQywxFee
.
setInterceptTime
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
));
...
@@ -256,8 +274,6 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
...
@@ -256,8 +274,6 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
}
}
}
}
}
@Override
@Override
public
Page
<
HaobanQywxFeeDTO
>
listPage
(
QywxFeeListQDTO
qywxFeeListQDTO
)
{
public
Page
<
HaobanQywxFeeDTO
>
listPage
(
QywxFeeListQDTO
qywxFeeListQDTO
)
{
...
...
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