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
a67953f7
Commit
a67953f7
authored
Aug 21, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量分配成员许可码
parent
f0d50744
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
HaobanQywxFeeOrderService.java
...manage/service/service/fee/HaobanQywxFeeOrderService.java
+2
-0
HaobanQywxFeeOrderServiceImpl.java
...rvice/service/fee/impl/HaobanQywxFeeOrderServiceImpl.java
+5
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+53
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/HaobanQywxFeeOrderService.java
View file @
a67953f7
...
@@ -42,4 +42,6 @@ public interface HaobanQywxFeeOrderService {
...
@@ -42,4 +42,6 @@ public interface HaobanQywxFeeOrderService {
*/
*/
List
<
TabHaobanQywxFeeOrder
>
listOrder
(
String
wxEnterpriseId
)
;
List
<
TabHaobanQywxFeeOrder
>
listOrder
(
String
wxEnterpriseId
)
;
TabHaobanQywxFeeOrder
selectByOrderId
(
String
wxEnterpriseId
,
String
orderId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/impl/HaobanQywxFeeOrderServiceImpl.java
View file @
a67953f7
...
@@ -55,4 +55,9 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService
...
@@ -55,4 +55,9 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService
public
List
<
TabHaobanQywxFeeOrder
>
listOrder
(
String
wxEnterpriseId
)
{
public
List
<
TabHaobanQywxFeeOrder
>
listOrder
(
String
wxEnterpriseId
)
{
return
this
.
tabHaobanQywxFeeOrderMapper
.
listOrder
(
wxEnterpriseId
);
return
this
.
tabHaobanQywxFeeOrderMapper
.
listOrder
(
wxEnterpriseId
);
}
}
@Override
public
TabHaobanQywxFeeOrder
selectByOrderId
(
String
wxEnterpriseId
,
String
orderId
)
{
return
this
.
tabHaobanQywxFeeOrderMapper
.
selectByOrderId
(
wxEnterpriseId
,
orderId
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
a67953f7
...
@@ -37,12 +37,14 @@ import com.gic.haoban.manage.service.config.Config;
...
@@ -37,12 +37,14 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.errorcode.QywxErrCode
;
import
com.gic.haoban.manage.service.errorcode.QywxErrCode
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.thirdparty.cloudfile.CloudFileUtil
;
import
com.gic.thirdparty.cloudfile.CloudFileUtil
;
...
@@ -52,6 +54,7 @@ import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
...
@@ -52,6 +54,7 @@ import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
import
com.gic.wechat.api.dto.qywx.QywxNewUseridDTO
;
import
com.gic.wechat.api.dto.qywx.QywxNewUseridDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.fee.AccountTransferUserDTO
;
import
com.gic.wechat.api.dto.qywx.fee.AccountTransferUserDTO
;
import
com.gic.wechat.api.dto.qywx.fee.FeeOrderDeatilResponseDTO
;
import
com.gic.wechat.api.dto.qywx.response.QywxResponseDTO
;
import
com.gic.wechat.api.dto.qywx.response.QywxResponseDTO
;
import
com.gic.wechat.api.service.qywx.QywxOrderApiService
;
import
com.gic.wechat.api.service.qywx.QywxOrderApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
...
@@ -126,6 +129,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -126,6 +129,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
@Autowired
@Autowired
private
HaobanQywxFeeOrderAccountService
haobanQywxFeeOrderAccountService
;
private
HaobanQywxFeeOrderAccountService
haobanQywxFeeOrderAccountService
;
@Autowired
private
HaobanQywxFeeOrderService
haobanQywxFeeOrderService
;
@Override
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
public
StaffDTO
selectById
(
String
staffId
)
{
...
@@ -1188,6 +1193,7 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1188,6 +1193,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"成员userid不存在!"
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"成员userid不存在!"
);
}
}
String
staffId
=
staff
.
getStaffId
();
String
staffId
=
staff
.
getStaffId
();
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
if
(
null
==
activeDataDTO
){
if
(
null
==
activeDataDTO
){
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
wxEnterprise
.
getWxEnterpriseId
());
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
wxEnterprise
.
getWxEnterpriseId
());
...
@@ -1315,6 +1321,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1315,6 +1321,9 @@ public class StaffApiServiceImpl implements StaffApiService {
int
num
=
0
;
int
num
=
0
;
String
errMessage
=
null
;
String
errMessage
=
null
;
for
(
int
i
=
0
;
i
<
haobanStaffs
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
haobanStaffs
.
size
();
i
++){
String
activeCode
=
accounts
.
get
(
i
).
getActiveCode
();
String
orderId
=
accounts
.
get
(
i
).
getOrderId
();
String
staffId
=
haobanStaffs
.
get
(
i
).
getStaffId
();
JSONObject
object
=
new
JSONObject
();
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"active_code"
,
accounts
.
get
(
i
).
getActiveCode
());
object
.
put
(
"active_code"
,
accounts
.
get
(
i
).
getActiveCode
());
object
.
put
(
"corpid"
,
openCorpid
);
object
.
put
(
"corpid"
,
openCorpid
);
...
@@ -1327,6 +1336,50 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1327,6 +1336,50 @@ public class StaffApiServiceImpl implements StaffApiService {
if
(!
response
.
isSuccess
()){
if
(!
response
.
isSuccess
()){
num
++;
num
++;
errMessage
=
"许可账号分配失败,复制链接查看失败原因:https://developer.work.weixin.qq.com/devtool/query?e="
+
response
.
getCode
();
errMessage
=
"许可账号分配失败,复制链接查看失败原因:https://developer.work.weixin.qq.com/devtool/query?e="
+
response
.
getCode
();
}
else
{
//手动分配成功需要实时更新许可激活码状态
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterpriseId
);
if
(
null
==
activeDataDTO
){
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
wxEnterpriseId
);
}
else
{
//需要区分激活码,待转移状态的激活码不需要处理
TabHaobanStaff
haobanStaff
=
staffMapper
.
getNumByActiveCode
(
wxEnterpriseId
,
activeCode
);
if
(
null
==
haobanStaff
){
//已使用的加1,已激活的加1,未激活的减1
Integer
used
=
activeDataDTO
.
getUsed
();
Integer
inactive
=
activeDataDTO
.
getInactive
();
Integer
activated
=
activeDataDTO
.
getActivated
();
used
++;
activated
++;
if
(
null
!=
inactive
&&
inactive
>
0
){
inactive
--;
}
activeDataDTO
.
setUsed
(
used
);
activeDataDTO
.
setInactive
(
inactive
);
activeDataDTO
.
setActivated
(
activated
);
wxEnterpriseActiveDataService
.
updateByStaffActiveDataDTO
(
activeDataDTO
);
}
else
{
//判断是否是其它占用的许可被当天激活
Date
delTime
=
haobanStaff
.
getDelTime
();
Date
now
=
new
Date
();
int
days
=
DateUtil
.
daysBetween
(
delTime
,
now
);
if
(
days
==
0
){
staffMapper
.
updateOccupyFlagByStaffId
(
haobanStaff
.
getStaffId
());
}
}
}
//根据订单id,查询订单详情,获取购买的时长,当前激活时间加上时长为过期时间
TabHaobanQywxFeeOrder
tabHaobanQywxFeeOrder
=
haobanQywxFeeOrderService
.
selectByOrderId
(
wxEnterpriseId
,
orderId
);
Integer
months
=
tabHaobanQywxFeeOrder
.
getMonths
();
Date
expireTime
=
null
;
if
(
null
!=
months
){
//转换成天数
months
=
months
*
31
;
expireTime
=
DateUtil
.
addDay
(
new
Date
(),
months
);
}
staffMapper
.
updateActiveStatusById
(
staffId
,
new
Date
(),
expireTime
,
activeCode
);
//更新好办激活码许可表
haobanQywxFeeOrderAccountService
.
updateByActiveCode
(
wxEnterpriseId
,
activeCode
);
}
}
}
}
result
.
setNums
(
num
);
result
.
setNums
(
num
);
...
...
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