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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
196 additions
and
170 deletions
+196
-170
HaobanQywxFeeApiService.java
...aoban/manage/api/service/fee/HaobanQywxFeeApiService.java
+11
-1
HaobanQywxFeeApiServiceImpl.java
...ice/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
+185
-169
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 {
* @author mozhu
* @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;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
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.fee.HaobanQywxFeeAccountInterceptLogDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
...
...
@@ -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.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -64,201 +66,215 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
private
HaobanQywxFeeAccountInterceptLogService
haobanQywxFeeAccountInterceptLogService
;
@Override
public
void
insert
(
String
param
)
{
public
void
run
(
String
param
)
{
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
String
serviceCorpid
=
config
.
getCorpid
();
for
(
TabHaobanWxEnterprise
wxEnterprise
:
tabHaobanWxEnterprises
)
{
String
wxEnterpriseId
=
wxEnterprise
.
getWxEnterpriseId
();
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
String
corpid
=
qwDTO
.
getThirdCorpid
();
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
corpid
,
serviceCorpid
);
if
(!
"1"
.
equals
(
autoActiveStatus
))
{
logger
.
info
(
"未开启自动激活:{}"
,
corpid
);
wxEnterpriseService
.
updateAutoActiveFlagById
(
0
,
wxEnterpriseId
);
continue
;
GicMQClient
instance
=
GICMQClientUtil
.
getClientInstance
();
try
{
instance
.
sendMessage
(
"addFeeMq"
,
wxEnterprise
.
getWxEnterpriseId
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"发送消息处理异常:{}"
,
e
.
getMessage
(),
e
);
}
logger
.
info
(
"企微收费:{},{}"
,
corpid
,
wxEnterpriseId
);
}
}
//更新订单
List
<
String
>
orderIds
=
new
ArrayList
<>();
while
(
true
)
{
FeeOrderListQDTO
feeOrderListQDTO
=
new
FeeOrderListQDTO
();
feeOrderListQDTO
.
setCorpid
(
corpid
);
feeOrderListQDTO
.
setLimit
(
Manage3Constants
.
QW_LIMIT
);
FeeOrderResponseList
feeOrderResponseList
=
qywxUserApiService
.
listOrder
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
int
errcode
=
feeOrderResponseList
.
getErrcode
();
if
(
errcode
!=
0
)
{
logger
.
error
(
"查询订单列表失败:{}"
,
feeOrderResponseList
.
getErrmsg
());
break
;
}
for
(
FeeOrderResponseList
.
OrderListDTO
orderListDTO
:
feeOrderResponseList
.
getOrderList
())
{
orderIds
.
add
(
orderListDTO
.
getOrderId
());
}
Integer
hasMore
=
feeOrderResponseList
.
getHasMore
();
if
(
hasMore
==
0
)
{
logger
.
error
(
"订单无更多账号"
);
break
;
}
feeOrderListQDTO
.
setCursor
(
feeOrderResponseList
.
getNextCursor
());
feeOrderResponseList
=
qywxUserApiService
.
listOrder
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
for
(
FeeOrderResponseList
.
OrderListDTO
orderListDTO
:
feeOrderResponseList
.
getOrderList
())
{
orderIds
.
add
(
orderListDTO
.
getOrderId
());
}
@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
);
String
corpid
=
qwDTO
.
getThirdCorpid
();
String
corpName
=
wxEnterpriseDTO
.
getCorpName
();
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
corpid
,
serviceCorpid
);
if
(!
"1"
.
equals
(
autoActiveStatus
))
{
logger
.
info
(
"未开启自动激活:{}"
,
corpid
);
wxEnterpriseService
.
updateAutoActiveFlagById
(
0
,
wxEnterpriseId
);
return
;
}
logger
.
info
(
"企微收费:{},{}"
,
corpid
,
wxEnterpriseId
);
//更新订单
List
<
String
>
orderIds
=
new
ArrayList
<>();
while
(
true
)
{
FeeOrderListQDTO
feeOrderListQDTO
=
new
FeeOrderListQDTO
();
feeOrderListQDTO
.
setCorpid
(
corpid
);
feeOrderListQDTO
.
setLimit
(
Manage3Constants
.
QW_LIMIT
);
FeeOrderResponseList
feeOrderResponseList
=
qywxUserApiService
.
listOrder
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
int
errcode
=
feeOrderResponseList
.
getErrcode
();
if
(
errcode
!=
0
)
{
logger
.
error
(
"查询订单列表失败:{}"
,
feeOrderResponseList
.
getErrmsg
());
break
;
}
for
(
FeeOrderResponseList
.
OrderListDTO
orderListDTO
:
feeOrderResponseList
.
getOrderList
())
{
orderIds
.
add
(
orderListDTO
.
getOrderId
());
}
Integer
hasMore
=
feeOrderResponseList
.
getHasMore
();
if
(
hasMore
==
0
)
{
logger
.
error
(
"订单无更多账号"
);
break
;
}
feeOrderListQDTO
.
setCursor
(
feeOrderResponseList
.
getNextCursor
());
feeOrderResponseList
=
qywxUserApiService
.
listOrder
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
for
(
FeeOrderResponseList
.
OrderListDTO
orderListDTO
:
feeOrderResponseList
.
getOrderList
())
{
orderIds
.
add
(
orderListDTO
.
getOrderId
());
}
}
List
<
String
>
activeCodes
=
new
ArrayList
<>();
for
(
String
orderId
:
orderIds
)
{
FeeOrderDeatilResponseDTO
order
=
qywxUserApiService
.
getOrder
(
corpid
,
serviceCorpid
,
orderId
);
if
(
order
.
getErrcode
()
!=
0
)
{
logger
.
error
(
"请求企微失败:{}"
,
orderId
);
break
;
}
List
<
String
>
activeCodes
=
new
ArrayList
<>();
for
(
String
orderId
:
orderIds
)
{
FeeOrderDeatilResponseDTO
order
=
qywxUserApiService
.
getOrder
(
corpid
,
serviceCorpid
,
orderId
);
if
(
order
.
getErrcode
()
!=
0
)
{
logger
.
error
(
"请求企微失败:{}"
,
orderId
);
break
;
}
//插入订单
FeeOrderDeatilResponseDTO
.
OrderDTO
orderDTO
=
order
.
getOrder
();
Integer
orderStatus
=
orderDTO
.
getOrderStatus
();
if
(
orderStatus
!=
1
)
{
logger
.
info
(
"只处理已支付订单:{}"
,
orderId
);
continue
;
}
//插入订单
FeeOrderDeatilResponseDTO
.
OrderDTO
orderDTO
=
order
.
getOrder
();
Integer
orderStatus
=
orderDTO
.
getOrderStatus
();
if
(
orderStatus
!=
1
)
{
logger
.
info
(
"只处理已支付订单:{}"
,
orderId
);
continue
;
}
TabHaobanQywxFeeOrder
tabHaobanQywxFeeOrder
=
new
TabHaobanQywxFeeOrder
();
tabHaobanQywxFeeOrder
.
setFeeOrderId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFeeOrder
.
setOrderId
(
orderId
);
tabHaobanQywxFeeOrder
.
setCorpId
(
corpid
);
tabHaobanQywxFeeOrder
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeOrder
.
setOrderType
(
orderDTO
.
getOrderType
());
tabHaobanQywxFeeOrder
.
setOrderStatus
(
orderStatus
);
tabHaobanQywxFeeOrder
.
setPrice
(
new
BigDecimal
(
orderDTO
.
getPrice
()));
tabHaobanQywxFeeOrder
.
setBaseCount
(
orderDTO
.
getAccountCount
().
getBaseCount
());
tabHaobanQywxFeeOrder
.
setExternalContactCount
(
orderDTO
.
getAccountCount
().
getExternalContactCount
());
tabHaobanQywxFeeOrder
.
setMonths
(
orderDTO
.
getAccountDuration
().
getMonths
());
tabHaobanQywxFeeOrder
.
setCreateTime
(
DateUtil
.
date
(
orderDTO
.
getCreateTime
()));
tabHaobanQywxFeeOrder
.
setPayTime
(
DateUtil
.
date
(
orderDTO
.
getPayTime
()));
haobanQywxFeeOrderService
.
insert
(
tabHaobanQywxFeeOrder
);
TabHaobanQywxFeeOrder
tabHaobanQywxFeeOrder
=
new
TabHaobanQywxFeeOrder
();
tabHaobanQywxFeeOrder
.
setFeeOrderId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFeeOrder
.
setOrderId
(
orderId
);
tabHaobanQywxFeeOrder
.
setCorpId
(
corpid
);
tabHaobanQywxFeeOrder
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeOrder
.
setOrderType
(
orderDTO
.
getOrderType
());
tabHaobanQywxFeeOrder
.
setOrderStatus
(
orderStatus
);
tabHaobanQywxFeeOrder
.
setPrice
(
new
BigDecimal
(
orderDTO
.
getPrice
()));
tabHaobanQywxFeeOrder
.
setBaseCount
(
orderDTO
.
getAccountCount
().
getBaseCount
());
tabHaobanQywxFeeOrder
.
setExternalContactCount
(
orderDTO
.
getAccountCount
().
getExternalContactCount
());
tabHaobanQywxFeeOrder
.
setMonths
(
orderDTO
.
getAccountDuration
().
getMonths
());
tabHaobanQywxFeeOrder
.
setCreateTime
(
DateUtil
.
date
(
orderDTO
.
getCreateTime
()));
tabHaobanQywxFeeOrder
.
setPayTime
(
DateUtil
.
date
(
orderDTO
.
getPayTime
()));
haobanQywxFeeOrderService
.
insert
(
tabHaobanQywxFeeOrder
);
}
}
//更新账号
while
(
true
)
{
FeeOrderListQDTO
feeOrderListQDTO
=
new
FeeOrderListQDTO
();
feeOrderListQDTO
.
setCorpid
(
corpid
);
feeOrderListQDTO
.
setLimit
(
Manage3Constants
.
QW_LIMIT
);
AccountListResponseDTO
accountListResponseDTO
=
qywxUserApiService
.
listActivedAccount
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
//更新账号
while
(
true
)
{
FeeOrderListQDTO
feeOrderListQDTO
=
new
FeeOrderListQDTO
();
feeOrderListQDTO
.
setCorpid
(
corpid
);
feeOrderListQDTO
.
setLimit
(
Manage3Constants
.
QW_LIMIT
);
AccountListResponseDTO
accountListResponseDTO
=
qywxUserApiService
.
listActivedAccount
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
if
(
accountListResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"订单账号列表报错:{}"
,
accountListResponseDTO
.
getErrmsg
());
break
;
}
if
(
accountListResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"订单账号列表报错:{}"
,
accountListResponseDTO
.
getErrmsg
());
break
;
}
List
<
AccountListDTO
>
accountList
=
accountListResponseDTO
.
getAccountList
();
for
(
AccountListDTO
accountListDTO
:
accountList
)
{
activeCodes
.
add
(
accountListDTO
.
getActiveCode
());
}
List
<
AccountListDTO
>
accountList
=
accountListResponseDTO
.
getAccountList
();
for
(
AccountListDTO
accountListDTO
:
accountList
)
{
activeCodes
.
add
(
accountListDTO
.
getActiveCode
());
}
Integer
hasMore
=
accountListResponseDTO
.
getHasMore
();
if
(
hasMore
==
0
)
{
logger
.
error
(
"无更多账号"
);
break
;
}
feeOrderListQDTO
.
setCursor
(
feeOrderListQDTO
.
getCursor
());
accountListResponseDTO
=
qywxUserApiService
.
listActivedAccount
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
for
(
AccountListDTO
accountListDTO
:
accountListResponseDTO
.
getAccountList
())
{
activeCodes
.
add
(
accountListDTO
.
getActiveCode
());
}
Integer
hasMore
=
accountListResponseDTO
.
getHasMore
();
if
(
hasMore
==
0
)
{
logger
.
error
(
"无更多账号"
);
break
;
}
feeOrderListQDTO
.
setCursor
(
feeOrderListQDTO
.
getCursor
());
accountListResponseDTO
=
qywxUserApiService
.
listActivedAccount
(
corpid
,
serviceCorpid
,
feeOrderListQDTO
);
for
(
AccountListDTO
accountListDTO
:
accountListResponseDTO
.
getAccountList
())
{
activeCodes
.
add
(
accountListDTO
.
getActiveCode
());
}
}
for
(
String
activeCode
:
activeCodes
)
{
ActiveInfoCodeResponseDTO
activeInfoCodeResponseDTO
=
qywxUserApiService
.
getActiveInfoByCode
(
corpid
,
serviceCorpid
,
activeCode
);
if
(
activeInfoCodeResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
error
(
"激活码详情报错:{}"
,
activeInfoCodeResponseDTO
.
getErrmsg
());
continue
;
}
String
userid
=
activeInfoCodeResponseDTO
.
getUserid
();
TabHaobanQywxFeeOrderAccount
tabHaobanQywxFeeOrderAccount
=
new
TabHaobanQywxFeeOrderAccount
();
tabHaobanQywxFeeOrderAccount
.
setFeeAccountId
(
UniqueIdUtils
.
uniqueLong
());
//tabHaobanQywxFeeOrderAccount.setOrderId();
tabHaobanQywxFeeOrderAccount
.
setCorpId
(
corpid
);
tabHaobanQywxFeeOrderAccount
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeOrderAccount
.
setWxUserId
(
userid
);
tabHaobanQywxFeeOrderAccount
.
setActiveCode
(
activeInfoCodeResponseDTO
.
getActiveCode
());
tabHaobanQywxFeeOrderAccount
.
setAccountType
(
activeInfoCodeResponseDTO
.
getType
());
tabHaobanQywxFeeOrderAccount
.
setStatus
(
activeInfoCodeResponseDTO
.
getStatus
());
tabHaobanQywxFeeOrderAccount
.
setExpireTime
(
DateUtil
.
date
(
activeInfoCodeResponseDTO
.
getExpireTime
()));
tabHaobanQywxFeeOrderAccount
.
setActiveTime
(
DateUtil
.
date
(
activeInfoCodeResponseDTO
.
getActiveTime
()));
haobanQywxFeeOrderAccountService
.
insert
(
tabHaobanQywxFeeOrderAccount
);
for
(
String
activeCode
:
activeCodes
)
{
ActiveInfoCodeResponseDTO
activeInfoCodeResponseDTO
=
qywxUserApiService
.
getActiveInfoByCode
(
corpid
,
serviceCorpid
,
activeCode
);
if
(
activeInfoCodeResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
error
(
"激活码详情报错:{}"
,
activeInfoCodeResponseDTO
.
getErrmsg
());
continue
;
}
String
userid
=
activeInfoCodeResponseDTO
.
getUserid
();
TabHaobanQywxFeeOrderAccount
tabHaobanQywxFeeOrderAccount
=
new
TabHaobanQywxFeeOrderAccount
();
tabHaobanQywxFeeOrderAccount
.
setFeeAccountId
(
UniqueIdUtils
.
uniqueLong
());
//tabHaobanQywxFeeOrderAccount.setOrderId();
tabHaobanQywxFeeOrderAccount
.
setCorpId
(
corpid
);
tabHaobanQywxFeeOrderAccount
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeOrderAccount
.
setWxUserId
(
userid
);
tabHaobanQywxFeeOrderAccount
.
setActiveCode
(
activeInfoCodeResponseDTO
.
getActiveCode
());
tabHaobanQywxFeeOrderAccount
.
setAccountType
(
activeInfoCodeResponseDTO
.
getType
());
tabHaobanQywxFeeOrderAccount
.
setStatus
(
activeInfoCodeResponseDTO
.
getStatus
());
tabHaobanQywxFeeOrderAccount
.
setExpireTime
(
DateUtil
.
date
(
activeInfoCodeResponseDTO
.
getExpireTime
()));
tabHaobanQywxFeeOrderAccount
.
setActiveTime
(
DateUtil
.
date
(
activeInfoCodeResponseDTO
.
getActiveTime
()));
haobanQywxFeeOrderAccountService
.
insert
(
tabHaobanQywxFeeOrderAccount
);
//更新成员
ActiveInfoUserResponseDTO
activeInfoUserResponseDTO
=
qywxUserApiService
.
getActiveInfoByUser
(
corpid
,
serviceCorpid
,
userid
);
if
(
activeInfoUserResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"成员激活详情报错:{}"
,
activeInfoUserResponseDTO
.
getErrmsg
());
break
;
}
List
<
AccountListDTO
>
activeInfoList
=
activeInfoUserResponseDTO
.
getActiveInfoList
();
Integer
activeStatus
=
activeInfoUserResponseDTO
.
getActiveStatus
();
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
for
(
AccountListDTO
accountListDTO
:
activeInfoList
)
{
TabHaobanQywxFeeAccountStaff
tabHaobanQywxFeeAccountStaff
=
new
TabHaobanQywxFeeAccountStaff
();
tabHaobanQywxFeeAccountStaff
.
setFeeAccountStaffId
(
UniqueIdUtils
.
uniqueLong
());
//tabHaobanQywxFeeAccountStaff.setOrderId();
tabHaobanQywxFeeAccountStaff
.
setCorpId
(
corpid
);
tabHaobanQywxFeeAccountStaff
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeAccountStaff
.
setWxUserId
(
userid
);
if
(
tabHaobanStaff
!=
null
)
{
String
staffId
=
tabHaobanStaff
.
getStaffId
();
tabHaobanQywxFeeAccountStaff
.
setStaffId
(
staffId
);
}
tabHaobanQywxFeeAccountStaff
.
setActiveCode
(
accountListDTO
.
getActiveCode
());
tabHaobanQywxFeeAccountStaff
.
setAccountType
(
accountListDTO
.
getType
());
tabHaobanQywxFeeAccountStaff
.
setExpireTime
(
DateUtil
.
date
(
accountListDTO
.
getExpireTime
()));
tabHaobanQywxFeeAccountStaff
.
setActiveTime
(
DateUtil
.
date
(
accountListDTO
.
getActiveTime
()));
haobanQywxFeeAccountStaffService
.
insert
(
tabHaobanQywxFeeAccountStaff
);
}
//更新成员
ActiveInfoUserResponseDTO
activeInfoUserResponseDTO
=
qywxUserApiService
.
getActiveInfoByUser
(
corpid
,
serviceCorpid
,
userid
);
if
(
activeInfoUserResponseDTO
.
getErrcode
()
!=
0
)
{
logger
.
info
(
"成员激活详情报错:{}"
,
activeInfoUserResponseDTO
.
getErrmsg
());
break
;
}
List
<
AccountListDTO
>
activeInfoList
=
activeInfoUserResponseDTO
.
getActiveInfoList
();
Integer
activeStatus
=
activeInfoUserResponseDTO
.
getActiveStatus
();
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectByUserIdAndEnterpriseId
(
userid
,
wxEnterpriseId
);
for
(
AccountListDTO
accountListDTO
:
activeInfoList
)
{
TabHaobanQywxFeeAccountStaff
tabHaobanQywxFeeAccountStaff
=
new
TabHaobanQywxFeeAccountStaff
();
tabHaobanQywxFeeAccountStaff
.
setFeeAccountStaffId
(
UniqueIdUtils
.
uniqueLong
());
//tabHaobanQywxFeeAccountStaff.setOrderId();
tabHaobanQywxFeeAccountStaff
.
setCorpId
(
corpid
);
tabHaobanQywxFeeAccountStaff
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFeeAccountStaff
.
setWxUserId
(
userid
);
if
(
tabHaobanStaff
!=
null
)
{
String
staffId
=
tabHaobanStaff
.
getStaffId
();
staffService
.
updateActiveStatusById
(
activeStatus
,
staffId
);
tabHaobanQywxFeeAccountStaff
.
setStaffId
(
staffId
);
}
tabHaobanQywxFeeAccountStaff
.
setActiveCode
(
accountListDTO
.
getActiveCode
());
tabHaobanQywxFeeAccountStaff
.
setAccountType
(
accountListDTO
.
getType
());
tabHaobanQywxFeeAccountStaff
.
setExpireTime
(
DateUtil
.
date
(
accountListDTO
.
getExpireTime
()));
tabHaobanQywxFeeAccountStaff
.
setActiveTime
(
DateUtil
.
date
(
accountListDTO
.
getActiveTime
()));
haobanQywxFeeAccountStaffService
.
insert
(
tabHaobanQywxFeeAccountStaff
);
}
if
(
tabHaobanStaff
!=
null
)
{
String
staffId
=
tabHaobanStaff
.
getStaffId
();
staffService
.
updateActiveStatusById
(
activeStatus
,
staffId
);
}
}
//更新企微状态
wxEnterpriseService
.
updateAutoActiveFlagById
(
1
,
wxEnterpriseId
);
//更新企微状态
wxEnterpriseService
.
updateAutoActiveFlagById
(
1
,
wxEnterpriseId
);
//更新收费
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
haobanQywxFeeAccountStaffService
.
feeIntercept
(
wxEnterpriseId
);
if
(
haobanQywxFeeDetailDTO
!=
null
)
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
wxEnterprise
.
getCorpName
()
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
haobanQywxFeeDetailDTO
.
getInterceptTime
());
tabHaobanQywxFee
.
setInterceptUserNum
(
haobanQywxFeeDetailDTO
.
getInterceptUserNum
());
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
//告警
messageAlert
(
wxEnterpriseId
,
wxEnterprise
.
getCorpName
()
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
());
}
//更新收费
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
haobanQywxFeeAccountStaffService
.
feeIntercept
(
wxEnterpriseId
);
if
(
haobanQywxFeeDetailDTO
!=
null
)
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
corpName
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
haobanQywxFeeDetailDTO
.
getInterceptTime
());
tabHaobanQywxFee
.
setInterceptUserNum
(
haobanQywxFeeDetailDTO
.
getInterceptUserNum
());
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
//告警
messageAlert
(
wxEnterpriseId
,
corpName
,
corpid
,
AlertTypeEnum
.
FEE_ALARM
.
getName
());
}
List
<
TabHaobanQywxFeeAccountInterceptLog
>
tabHaobanQywxFeeAccountInterceptLogs
=
haobanQywxFeeAccountInterceptLogService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
tabHaobanQywxFeeAccountInterceptLogs
))
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
wxEnterprise
.
getCorpName
());
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
));
tabHaobanQywxFee
.
setInterceptUserNum
(
tabHaobanQywxFeeAccountInterceptLogs
.
size
());
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
1
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
}
List
<
TabHaobanQywxFeeAccountInterceptLog
>
tabHaobanQywxFeeAccountInterceptLogs
=
haobanQywxFeeAccountInterceptLogService
.
queryByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
tabHaobanQywxFeeAccountInterceptLogs
))
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
corpName
);
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
DateUtil
.
offsetDay
(
new
Date
(),
-
1
));
tabHaobanQywxFee
.
setInterceptUserNum
(
tabHaobanQywxFeeAccountInterceptLogs
.
size
());
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
1
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
}
}
@Override
public
Page
<
HaobanQywxFeeDTO
>
listPage
(
QywxFeeListQDTO
qywxFeeListQDTO
)
{
Page
<
HaobanQywxFeeBO
>
haobanQywxFeeBOS
=
haobanQywxFeeService
.
listPage
(
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