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
cd2c72bb
Commit
cd2c72bb
authored
Feb 02, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通讯录成员转移接口开发
parent
44728780
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
12 deletions
+53
-12
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+12
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+1
-1
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+1
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+18
-7
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+3
-3
WxEnterpriseActiveDataServiceTest.java
...vice/src/test/java/WxEnterpriseActiveDataServiceTest.java
+18
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
cd2c72bb
...
@@ -124,6 +124,18 @@ public class StaffDTO implements Serializable {
...
@@ -124,6 +124,18 @@ public class StaffDTO implements Serializable {
* 是否授权 0否1是
* 是否授权 0否1是
*/
*/
private
Integer
authorizedFlag
;
private
Integer
authorizedFlag
;
/**
* 企微激活码
*/
private
String
activeCode
;
public
String
getActiveCode
()
{
return
activeCode
;
}
public
void
setActiveCode
(
String
activeCode
)
{
this
.
activeCode
=
activeCode
;
}
public
Integer
getAuthorizedFlag
()
{
public
Integer
getAuthorizedFlag
()
{
// 如果员工有qr_code,则代表已经授权
// 如果员工有qr_code,则代表已经授权
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
cd2c72bb
...
@@ -329,5 +329,5 @@ public interface StaffApiService {
...
@@ -329,5 +329,5 @@ public interface StaffApiService {
/**
/**
* 转移员工许可
* 转移员工许可
*/
*/
ServiceResponse
<
Integer
>
batchTransferLicense
(
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQOList
,
String
wxEnterpriseId
);
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Integer
>
batchTransferLicense
(
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQOList
,
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
cd2c72bb
...
@@ -168,7 +168,7 @@ public interface StaffMapper {
...
@@ -168,7 +168,7 @@ public interface StaffMapper {
*/
*/
Integer
getOccupyNum
();
Integer
getOccupyNum
();
StaffDTO
getStaffInfoByWxOpenUserId
(
@Param
(
"wxOpenUseId"
)
String
wxOpenUseId
);
TabHaobanStaff
getStaffInfoByWxOpenUserId
(
@Param
(
"wxOpenUseId"
)
String
wxOpenUseId
);
/**
/**
* 通过wxOpenUserId更新企业成员许可信息
* 通过wxOpenUserId更新企业成员许可信息
*/
*/
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
cd2c72bb
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Constant
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
...
@@ -935,15 +936,25 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -935,15 +936,25 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
@Override
@Override
public
ServiceResponse
<
Integer
>
batchTransferLicense
(
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQOList
,
String
wxEnterpriseId
)
{
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Integer
>
batchTransferLicense
(
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQOList
,
String
wxEnterpriseId
)
{
WxEnterpriseDTO
wxEnterpriseDTO
=
this
.
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
this
.
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
String
openCorpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
openCorpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
List
<
AccountTransferUserDTO
>
accountTransferUserDTOList
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
transferActiveCodeQOList
),
AccountTransferUserDTO
.
class
);
List
<
AccountTransferUserDTO
>
accountTransferUserDTOList
=
JSONArray
.
parseArray
(
transferActiveCodeQOList
.
toString
(),
AccountTransferUserDTO
.
class
);
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
List
<
AccountTransferUserDTO
>>
listServiceResponse
=
qywxOrderApiService
.
batchTransferLicense
(
serviceCorpid
,
openCorpid
,
accountTransferUserDTOList
);
if
(
Constant
.
SUCCESS
.
equals
(
listServiceResponse
.
getCode
())){
qywxOrderApiService
.
batchTransferLicense
(
serviceCorpid
,
openCorpid
,
accountTransferUserDTOList
);
//企微转移成功,好办staff表对应更新
transferActiveCodeQOList
.
stream
().
forEach
(
a
->{
return
null
;
//先查询转移成员的许可信息
TabHaobanStaff
staffDTO
=
staffMapper
.
getStaffInfoByWxOpenUserId
(
a
.
getHandover_userid
());
//置空转移成员的许可信息
staffMapper
.
updateStaffInfoByWxOpenUserId
(
a
.
getHandover_userid
(),
null
,
null
,
null
);
//更新接收成员的许可信息
staffMapper
.
updateStaffInfoByWxOpenUserId
(
a
.
getTakeover_userid
(),
staffDTO
.
getActiveTime
(),
staffDTO
.
getExpireTime
(),
staffDTO
.
getActiveCode
());
});
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
();
}
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
listServiceResponse
.
getCode
(),
listServiceResponse
.
getMessage
());
}
}
}
}
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
cd2c72bb
...
@@ -604,11 +604,11 @@
...
@@ -604,11 +604,11 @@
</update>
</update>
<select
id=
"getOccupyNum"
resultType=
"java.lang.Integer"
>
<select
id=
"getOccupyNum"
resultType=
"java.lang.Integer"
>
SELECT count(*) FROM tab_haoban_staff WHERE
status_flag=0 and expire_time is not null
SELECT count(*) FROM tab_haoban_staff WHERE
a.status_flag = 0 and a.update_time >= DATE_FORMAT(NOW(),'%Y-%m-%d') and a.active_status = 1
</select>
</select>
<select
id=
"getStaffInfoByWxOpenUserId"
result
Type=
"com.gic.haoban.manage.api.dto.StaffDTO
"
>
<select
id=
"getStaffInfoByWxOpenUserId"
result
Map=
"BaseResultMap
"
>
SELECT
*
FROM tab_haoban_staff WHERE wx_open_user_id = #{wxOpenUseId}
SELECT
<include
refid=
"Base_Column_List"
/>
FROM tab_haoban_staff WHERE wx_open_user_id = #{wxOpenUseId}
</select>
</select>
<update
id=
"updateStaffInfoByWxOpenUserId"
>
<update
id=
"updateStaffInfoByWxOpenUserId"
>
...
...
haoban-manage3-service/src/test/java/WxEnterpriseActiveDataServiceTest.java
View file @
cd2c72bb
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.qdto.TransferActiveCodeQDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -6,6 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -6,6 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @description:
* @description:
* @Author: wenhua
* @Author: wenhua
...
@@ -17,9 +23,21 @@ public class WxEnterpriseActiveDataServiceTest {
...
@@ -17,9 +23,21 @@ public class WxEnterpriseActiveDataServiceTest {
@Autowired
@Autowired
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
@Autowired
private
StaffApiService
staffApiService
;
@Test
@Test
public
void
test
(){
public
void
test
(){
Integer
integer
=
wxEnterpriseActiveDataService
.
saveOrUpdate
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
Integer
integer
=
wxEnterpriseActiveDataService
.
saveOrUpdate
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
System
.
out
.
println
(
integer
);
System
.
out
.
println
(
integer
);
}
}
@Test
public
void
test1
(){
List
<
TransferActiveCodeQDTO
>
transferActiveCodeQOList
=
new
ArrayList
<>();
TransferActiveCodeQDTO
transferActiveCodeQDTO
=
new
TransferActiveCodeQDTO
();
transferActiveCodeQDTO
.
setHandover_userid
(
"wo59NLDQAAD_2Dpx951BGjVRLSAdhjcA"
);
transferActiveCodeQDTO
.
setTakeover_userid
(
"wo59NLDQAA-mkaCEYRl6Lj0ifFurH1PQ"
);
transferActiveCodeQOList
.
add
(
transferActiveCodeQDTO
);
ServiceResponse
<
Integer
>
integerServiceResponse
=
staffApiService
.
batchTransferLicense
(
transferActiveCodeQOList
,
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
}
}
}
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