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
a04ab877
Commit
a04ab877
authored
Jan 30, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/获取用户敏感信息' into 'developer'
激活码 See merge request
!907
parents
de74d060
0e342371
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
56 deletions
+65
-56
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+5
-8
TabHaobanQywxFeeAccountStaffMapper.java
...ce/dao/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.java
+2
-0
TabHaobanQywxFeeAccountStaff.java
...nage/service/entity/fee/TabHaobanQywxFeeAccountStaff.java
+6
-6
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+1
-1
HaobanQywxFeeAccountStaffService.java
...service/service/fee/HaobanQywxFeeAccountStaffService.java
+2
-0
HaobanQywxFeeAccountStaffServiceImpl.java
...ervice/fee/impl/HaobanQywxFeeAccountStaffServiceImpl.java
+6
-7
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+22
-23
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+11
-2
TabHaobanQywxFeeAccountStaffMapper.xml
...sources/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.xml
+10
-9
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
a04ab877
...
...
@@ -135,16 +135,13 @@ public interface StaffMapper {
/**
* 更新是否激活
*
* @param activeStatus 活跃状态
* @param staffId 员工id
* @return int
* @author mozhu
* @date 2022-08-03 17:36:52
*/
int
updateActiveStatusById
(
@Param
(
"
staffId"
)
String
staff
Id
,
@Param
(
"activeTime"
)
Date
activeTime
,
int
updateActiveStatusById
(
@Param
(
"
wxOpenUserId"
)
String
wxOpenUser
Id
,
@Param
(
"activeTime"
)
Date
activeTime
,
@Param
(
"expireTime"
)
Date
expireTime
,
@Param
(
"activeDoTime"
)
Date
activeDoTime
,
@Param
(
"activeStatus"
)
Integer
activeStatus
);
@Param
(
"activeCode"
)
String
activeCode
,
@Param
(
"activeStatus"
)
Integer
activeStatus
);
// 初始化激活码信息,先删除
void
deleteActivieInfo
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
)
;
/**
* 重置添加num
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.java
View file @
a04ab877
...
...
@@ -66,5 +66,7 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
* @date 2022-08-08 15:53:32
*/
int
lastFeeInterceptCount
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
void
deleteAll
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/fee/TabHaobanQywxFeeAccountStaff.java
View file @
a04ab877
...
...
@@ -20,7 +20,7 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable {
/**
* 员工id
*/
private
String
staff
Id
;
private
String
wxUser
Id
;
/**
* 帐号码
*/
...
...
@@ -62,13 +62,13 @@ public class TabHaobanQywxFeeAccountStaff implements Serializable {
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
get
Staff
Id
()
{
return
staff
Id
;
public
String
get
WxUser
Id
()
{
return
wxUser
Id
;
}
public
void
set
StaffId
(
String
staff
Id
)
{
this
.
staffId
=
staff
Id
;
public
void
set
WxUserId
(
String
wxUser
Id
)
{
this
.
wxUserId
=
wxUser
Id
;
}
public
String
getActiveCode
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
a04ab877
...
...
@@ -139,7 +139,7 @@ public interface StaffService {
* @return
* @throws
*/
int
updateActiveStatusById
(
String
staffId
,
Date
activeTime
,
Date
expireTime
,
Date
activeDoTime
,
Integer
activeStatus
);
int
updateActiveStatusById
(
String
staffId
,
Date
activeTime
,
Date
expireTime
,
String
activeCode
,
Integer
activeStatus
);
void
updateOpenConcatFlag
(
List
<
String
>
wxUserIdList
,
int
mixFlag
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/HaobanQywxFeeAccountStaffService.java
View file @
a04ab877
...
...
@@ -53,4 +53,6 @@ public interface HaobanQywxFeeAccountStaffService {
*/
int
monthWillInterceptNum
(
String
wxEnterpriseId
);
void
deleteAll
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/impl/HaobanQywxFeeAccountStaffServiceImpl.java
View file @
a04ab877
...
...
@@ -28,15 +28,14 @@ public class HaobanQywxFeeAccountStaffServiceImpl implements HaobanQywxFeeAccoun
*/
@Override
public
TabHaobanQywxFeeAccountStaff
save
(
TabHaobanQywxFeeAccountStaff
account
)
{
TabHaobanQywxFeeAccountStaff
old
=
this
.
tabHaobanQywxFeeAccountStaffMapper
.
selectByActiveCode
(
account
.
getWxEnterpriseId
(),
account
.
getActiveCode
())
;
if
(
null
!=
old
)
{
account
.
setFeeAccountStaffId
(
old
.
getFeeAccountStaffId
());
this
.
tabHaobanQywxFeeAccountStaffMapper
.
update
(
account
)
;
}
else
{
this
.
tabHaobanQywxFeeAccountStaffMapper
.
insert
(
account
);
}
this
.
tabHaobanQywxFeeAccountStaffMapper
.
insert
(
account
);
return
account
;
}
@Override
public
void
deleteAll
(
String
wxEnterpriseId
)
{
this
.
tabHaobanQywxFeeAccountStaffMapper
.
deleteAll
(
wxEnterpriseId
);
}
@Override
public
List
<
HaobanQywxFeeDetailDTO
>
feeDetail
(
String
wxEnterpriseId
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
a04ab877
...
...
@@ -174,10 +174,9 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public
int
updateActiveStatusById
(
String
staffId
,
Date
activeTime
,
Date
expireTime
,
Date
activeDoTime
,
Integer
activeStatus
)
{
return
mapper
.
updateActiveStatusById
(
staffId
,
activeTime
,
expireTime
,
activeDoTime
,
activeStatus
)
;
public
int
updateActiveStatusById
(
String
wxOpenUserId
,
Date
activeTime
,
Date
expireTime
,
String
activeCode
,
Integer
activeStatus
)
{
return
mapper
.
updateActiveStatusById
(
wxOpenUserId
,
activeTime
,
expireTime
,
activeCode
,
activeStatus
)
;
}
@Override
...
...
@@ -203,6 +202,8 @@ public class StaffServiceImpl implements StaffService {
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
for
(
TabHaobanWxEnterprise
item
:
list
)
{
if
(
item
.
getWxSecurityType
()>
0
&&
StringUtils
.
isNotEmpty
(
item
.
getOpenCorpid
())
&&
item
.
getStatusFlag
()==
1
)
{
this
.
haobanQywxFeeAccountStaffService
.
deleteAll
(
item
.
getWxEnterpriseId
())
;
this
.
mapper
.
deleteActivieInfo
(
item
.
getWxEnterpriseId
());
this
.
listAccount
(
item
,
500
,
null
);
}
}
...
...
@@ -231,32 +232,30 @@ public class StaffServiceImpl implements StaffService {
private
void
updateAccount
(
String
wxEnterpriseId
,
String
openCorpid
,
List
<
AccountListDTO
>
list
)
{
for
(
AccountListDTO
item
:
list
)
{
String
userId
=
item
.
getUserid
()
;
Date
start
=
new
Date
(
item
.
getActiveTime
()*
1000L
)
;
Date
end
=
new
Date
(
item
.
getExpireTime
()*
1000L
)
;
TabHaobanStaff
staff
=
this
.
mapper
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
)
;
if
(
null
==
staff
&&
end
.
getTime
()>
System
.
currentTimeMillis
())
{
staff
=
this
.
mapper
.
getDeleteUser
(
userId
,
wxEnterpriseId
)
;
}
TabHaobanQywxFeeAccountStaff
accountStaff
=
new
TabHaobanQywxFeeAccountStaff
();
accountStaff
.
setFeeAccountStaffId
(
UniqueIdUtils
.
uniqueLong
());
accountStaff
.
setWxEnterpriseId
(
wxEnterpriseId
);
accountStaff
.
setCorpId
(
openCorpid
);
if
(
null
!=
staff
)
{
this
.
updateActiveStatusById
(
staff
.
getStaffId
(),
start
,
end
,
new
Date
(),
1
)
;
accountStaff
.
setStaffId
(
staff
.
getStaffId
());
}
else
{
log
.
info
(
"查询激活账号,用户不存在,userid={}"
,
userId
);
accountStaff
.
setStaffId
(
userId
);
}
ActiveInfoUserResponseDTO
activeInfoUserResponseDTO
=
qywxUserApiService
.
getActiveInfoByUser
(
openCorpid
,
config
.
getCorpid
(),
userId
);
log
.
info
(
"查询激活详情={},{}"
,
JSON
.
toJSONString
(
activeInfoUserResponseDTO
),
userId
);
log
.
info
(
"查询用户激活详情={},{}"
,
JSON
.
toJSONString
(
activeInfoUserResponseDTO
),
userId
);
String
activeCode
=
null
;
if
(
activeInfoUserResponseDTO
.
getErrcode
()
==
0
)
{
for
(
AccountListDTO
dto
:
activeInfoUserResponseDTO
.
getActiveInfoList
())
{
if
(
dto
.
getType
()==
2
)
{
ac
countStaff
.
setActiveCode
(
dto
.
getActiveCode
())
;
ac
tiveCode
=
dto
.
getActiveCode
()
;
}
}
}
if
(
StringUtils
.
isEmpty
(
activeCode
)){
log
.
info
(
"无互通激活码={}"
,
userId
);
continue
;
}
Date
start
=
new
Date
(
item
.
getActiveTime
()*
1000L
)
;
Date
end
=
new
Date
(
item
.
getExpireTime
()*
1000L
)
;
log
.
info
(
"更新staff表,userId={}"
,
userId
);
this
.
updateActiveStatusById
(
userId
,
start
,
end
,
activeCode
,
1
)
;
TabHaobanQywxFeeAccountStaff
accountStaff
=
new
TabHaobanQywxFeeAccountStaff
();
accountStaff
.
setFeeAccountStaffId
(
UniqueIdUtils
.
uniqueLong
());
accountStaff
.
setWxEnterpriseId
(
wxEnterpriseId
);
accountStaff
.
setCorpId
(
openCorpid
);
accountStaff
.
setActiveCode
(
activeCode
);
accountStaff
.
setWxUserId
(
userId
);
accountStaff
.
setAccountType
(
item
.
getType
());
accountStaff
.
setExpireTime
(
DateUtil
.
date
(
item
.
getExpireTime
()
*
1000
));
accountStaff
.
setActiveTime
(
DateUtil
.
date
(
item
.
getActiveTime
()
*
1000
));
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
a04ab877
...
...
@@ -502,9 +502,18 @@
set active_status = #{activeStatus},
`active_time` = #{activeTime},
`expire_time` = #{expireTime},
`active_
do_time` = #{activeDoTim
e},
`active_
code` = #{activeCod
e},
update_time = now()
where staff_id = #{staffId}
where wx_open_user_id = #{wxOpenUserId}
</update>
<update
id=
"deleteActivieInfo"
>
update tab_haoban_staff
set active_status = 0,
`active_time` = null,
`expire_time` = null ,
update_time = now()
where wx_enterprise_id = #{wxEnterpriseId} and expire_time is not null
</update>
...
...
haoban-manage3-service/src/main/resources/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.xml
View file @
a04ab877
...
...
@@ -6,7 +6,7 @@
<result
property=
"feeAccountStaffId"
column=
"fee_account_staff_id"
jdbcType=
"INTEGER"
/>
<result
property=
"corpId"
column=
"corp_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"wxEnterpriseId"
column=
"wx_enterprise_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"
staffId"
column=
"staff
_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"
wxUserId"
column=
"wx_user
_id"
jdbcType=
"VARCHAR"
/>
<result
property=
"activeCode"
column=
"active_code"
jdbcType=
"VARCHAR"
/>
<result
property=
"accountType"
column=
"account_type"
jdbcType=
"INTEGER"
/>
<result
property=
"expireTime"
column=
"expire_time"
jdbcType=
"TIMESTAMP"
/>
...
...
@@ -15,7 +15,7 @@
<sql
id=
"Base_Column_List"
>
fee_account_staff_id
, corp_id, wx_enterprise_id,
staff
_id, active_code, account_type, expire_time, active_time
, corp_id, wx_enterprise_id,
wx_user
_id, active_code, account_type, expire_time, active_time
</sql>
<!--查询单个-->
...
...
@@ -29,8 +29,8 @@
<!--新增所有列-->
<insert
id=
"insert"
>
insert into tab_haoban_qywx_fee_account_staff(fee_account_staff_id, corp_id, wx_enterprise_id,
staff
_id, active_code, account_type, expire_time, active_time)
values (#{feeAccountStaffId}, #{corpId}, #{wxEnterpriseId}, #{
staff
Id}, #{activeCode},
wx_user
_id, active_code, account_type, expire_time, active_time)
values (#{feeAccountStaffId}, #{corpId}, #{wxEnterpriseId}, #{
wxUser
Id}, #{activeCode},
#{accountType}, #{expireTime}, #{activeTime})
</insert>
...
...
@@ -44,9 +44,6 @@
<if
test=
"wxEnterpriseId != null and wxEnterpriseId != ''"
>
wx_enterprise_id = #{wxEnterpriseId},
</if>
<if
test=
"staffId != null and staffId != ''"
>
staff_id = #{staffId},
</if>
<if
test=
"activeCode != null and activeCode != ''"
>
active_code = #{activeCode},
</if>
...
...
@@ -65,7 +62,7 @@
<select
id=
"feeDetail"
resultType=
"com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO"
>
select
count(distinct
staff
_id) interceptUserNum,
count(distinct
wx_user
_id) interceptUserNum,
DATE_FORMAT( expire_time, '%Y-%m-%d' ) interceptTime
from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId}
...
...
@@ -85,9 +82,13 @@
<select
id=
"lastFeeInterceptCount"
resultType=
"java.lang.Integer"
>
select
count(distinct
staff
_id)
count(distinct
wx_user
_id)
from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId}
and expire_time between DATE(CURDATE()) and DATE_add(CURDATE(), INTERVAL 30 DAY)
</select>
<delete
id=
"deleteAll"
>
delete from tab_haoban_qywx_fee_account_staff where wx_enterprise_id = #{wxEnterpriseId}
</delete>
</mapper>
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