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
56a002f3
Commit
56a002f3
authored
Aug 01, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
其它占用的许可被当天激活实时更新
parent
c72e69ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
10 deletions
+59
-10
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-1
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+24
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+12
-4
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+20
-5
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
56a002f3
...
...
@@ -188,6 +188,7 @@ public interface StaffMapper {
*/
List
<
String
>
queryStaffIdsWithEnterpriseId
(
@Param
(
"wxEnterpriseIds"
)
List
<
String
>
wxEnterpriseIds
);
Integer
getNumByActiveCode
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"activeCode"
)
String
activeCode
);
TabHaobanStaff
getNumByActiveCode
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"activeCode"
)
String
activeCode
);
void
updateOccupyFlagByStaffId
(
@Param
(
"staffId"
)
String
staffId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
56a002f3
...
...
@@ -57,6 +57,30 @@ public class TabHaobanStaff implements Serializable {
private
Date
activeTime
;
private
Date
expireTime
;
private
String
activeCode
;
/**
* 其他占用许可是否自动激活 0否1是
*/
private
Integer
occupyFlag
;
/**
* 成员的删除时间
*/
private
Date
delTime
;
public
Date
getDelTime
()
{
return
delTime
;
}
public
void
setDelTime
(
Date
delTime
)
{
this
.
delTime
=
delTime
;
}
public
Integer
getOccupyFlag
()
{
return
occupyFlag
;
}
public
void
setOccupyFlag
(
Integer
occupyFlag
)
{
this
.
occupyFlag
=
occupyFlag
;
}
public
Date
getActiveTime
()
{
return
activeTime
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
56a002f3
...
...
@@ -1183,15 +1183,13 @@ public class StaffApiServiceImpl implements StaffApiService {
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"成员userid不存在!"
);
}
String
staffId
=
staff
.
getStaffId
();
groupChatService
.
initStaffGroupChat
(
staffId
);
staffMapper
.
updateActiveStatusById
(
staffId
,
timeStampDate
,
expireTimeDate
,
activeCode
);
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
if
(
null
==
activeDataDTO
){
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
wxEnterprise
.
getWxEnterpriseId
());
}
else
{
//需要区分激活码,待转移状态的激活码不需要处理
Integer
num
=
staffMapper
.
getNumByActiveCode
(
wxEnterprise
.
getWxEnterpriseId
(),
activeCode
);
if
(
nu
m
==
0
){
TabHaobanStaff
haobanStaff
=
staffMapper
.
getNumByActiveCode
(
wxEnterprise
.
getWxEnterpriseId
(),
activeCode
);
if
(
nu
ll
==
haobanStaff
){
//已使用的加1,已激活的加1,未激活的减1
Integer
used
=
activeDataDTO
.
getUsed
();
Integer
inactive
=
activeDataDTO
.
getInactive
();
...
...
@@ -1205,8 +1203,18 @@ public class StaffApiServiceImpl implements StaffApiService {
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
());
}
}
}
staffMapper
.
updateActiveStatusById
(
staffId
,
timeStampDate
,
expireTimeDate
,
activeCode
);
groupChatService
.
initStaffGroupChat
(
staffId
);
}
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
true
);
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
56a002f3
...
...
@@ -27,14 +27,16 @@
<result
column=
"open_concat_flag"
property=
"openConcatFlag"
/>
<result
column=
"active_time"
property=
"activeTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"expire_time"
property=
"expireTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"del_time"
property=
"delTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"active_code"
property=
"activeCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"occupy_flag"
property=
"occupyFlag"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,open_concat_flag,active_time,expire_time,active_code
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code,add_num,open_concat_flag,active_time,expire_time,active_code
,occupy_flag,del_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -323,7 +325,7 @@
<!-- 其他占用 -->
<if
test=
"occupy != null and 1==occupy"
>
and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and a.status_flag = 0 and a.del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and a.occupy_flag = 0
</if>
<!-- -->
<if
test=
"occupy != null and 2==occupy"
>
...
...
@@ -621,7 +623,12 @@
</update>
<select
id=
"getOccupyNum"
resultType=
"java.lang.Integer"
>
SELECT count(*) FROM tab_haoban_staff WHERE status_flag = 0 and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and wx_enterprise_id = #{wxEnterpriseId}
SELECT count(*) FROM tab_haoban_staff
WHERE status_flag = 0
and del_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and expire_time >= DATE_FORMAT(NOW(),'%Y-%m-%d')
and wx_enterprise_id = #{wxEnterpriseId}
and occupy_flag = 0
</select>
<select
id=
"getExpiringNum"
resultType=
"java.lang.Integer"
>
...
...
@@ -646,8 +653,15 @@
#{wxEnterpriseId}
</foreach>
</select>
<select
id=
"getNumByActiveCode"
result
Type=
"java.lang.Integer
"
>
SELECT
count(*) FROM tab_haoban_staff WHERE wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode}
<select
id=
"getNumByActiveCode"
result
Map=
"BaseResultMap
"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM tab_haoban_staff WHERE wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode} limit 1
</select>
<update
id=
"updateOccupyFlagByStaffId"
>
update tab_haoban_staff set
occupy_flag = 1,
update_time = now()
where staff_id= #{staffId}
</update>
</mapper>
\ No newline at end of file
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