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
a97a8429
Commit
a97a8429
authored
Apr 20, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步处理 日志
parent
e18875b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
16 deletions
+82
-16
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+9
-0
StaffDepartmentRelatedService.java
...manage/service/service/StaffDepartmentRelatedService.java
+2
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+28
-0
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+43
-15
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
a97a8429
...
...
@@ -68,4 +68,13 @@ public interface StaffApiService {
* @return
*/
public
ServiceResponse
saveSyncStaffByGic
(
GicClerkDTO
clerkDTO
);
/**
* 获取成员头像
*
* @param clerkCode
* @param storeId
* @return
*/
public
ServiceResponse
<
String
>
getStaffQrcode
(
String
clerkCode
,
String
storeId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffDepartmentRelatedService.java
View file @
a97a8429
...
...
@@ -29,5 +29,6 @@ public interface StaffDepartmentRelatedService {
List
<
TabHaobanStaffDepartmentRelated
>
listByWxUserId
(
String
wxUserId
);
StaffDepartmentRelatedDTO
getById
(
String
staffDepartmentStaffRelatedId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
a97a8429
...
...
@@ -1068,6 +1068,34 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public
ServiceResponse
<
String
>
getStaffQrcode
(
String
clerkCode
,
String
storeId
)
{
ServiceResponse
<
String
>
resp
=
new
ServiceResponse
<>();
TabHaobanDepartment
department
=
departmentService
.
selectByRelatedId
(
storeId
);
if
(
null
==
department
)
{
resp
.
setMessage
(
"部门没关联"
);
resp
.
setCode
(
0
);
return
resp
;
}
List
<
TabHaobanStaffDepartmentRelated
>
retList
=
staffDepartmentRelatedService
.
listByDepartmentId
(
department
.
getDepartmentId
());
if
(
CollectionUtils
.
isEmpty
(
retList
))
{
resp
.
setMessage
(
"成员没关联"
);
resp
.
setCode
(
0
);
return
resp
;
}
for
(
TabHaobanStaffDepartmentRelated
tab
:
retList
)
{
if
(
tab
.
getClerkCode
().
equals
(
clerkCode
))
{
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
department
.
getWxEnterpriseId
());
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterpriseDTO
.
getCorpid
(),
wxEnterpriseDTO
.
getContactSecret
(),
tab
.
getWxUserId
());
if
(
user
!=
null
)
{
resp
.
setResult
(
user
.
getQr_code
());
return
resp
;
}
}
}
return
resp
;
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
// return mobile;
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
a97a8429
...
...
@@ -2,6 +2,8 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.DepartmentDTO
;
...
...
@@ -36,6 +38,9 @@ public class ServiceTest {
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Test
public
void
test
()
{
System
.
err
.
println
(
RedisUtil
.
getCache
(
"init-enterprise-ca66a01b79474c40b3e7c7f93daf1a3b"
));
...
...
@@ -104,20 +109,20 @@ public class ServiceTest {
// System.out.println(JSONObject.toJSONString(phonenumber));
// }
//
//
@Test
//
public void createSelfUser() {
//
UserDTO userDTO = new UserDTO();
//
userDTO.setUserid("niweizhong2");
//
userDTO.setName("空闻大师2");
//
userDTO.setDepartment(new Integer[]{5072});
//
userDTO.setMobile("17605628851");
//
userDTO.setCorpid("ww9ede832a84b7ae5f");
//
JSONResponse workWxUser = qywxUserApiService.createSelfWorkWxUser(userDTO, "ww9ede832a84b7ae5f",
//
"3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8");
//
System.out.println(JSONObject.toJSONString(workWxUser));
//
}
//
//
@Test
public
void
createSelfUser
()
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setUserid
(
"niweizhong2"
);
userDTO
.
setName
(
"空闻大师2"
);
userDTO
.
setDepartment
(
new
Integer
[]{
5072
});
userDTO
.
setMobile
(
"17605628851"
);
userDTO
.
setCorpid
(
"ww9ede832a84b7ae5f"
);
JSONResponse
workWxUser
=
qywxUserApiService
.
createSelfWorkWxUser
(
userDTO
,
"ww9ede832a84b7ae5f"
,
"3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
workWxUser
));
}
@Test
public
void
sendMessage
()
{
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
...
...
@@ -129,10 +134,33 @@ public void sendMessage() {
messageDTO
.
setDescription
(
"我的测试test11111"
);
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"名称"
,
"hua"
);
messageDTO
.
setItems
(
map
);
//
messageDTO.setItems(map);
boolean
ret
=
qywxSuiteApiService
.
sendMessage
(
"ww9ede832a84b7ae5f"
,
"ww2c34dc56739bb105"
,
messageDTO
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
ret
));
}
@Test
public
void
listExternalUserid
()
{
UserDTO
userDTO
=
new
UserDTO
();
userDTO
.
setUserid
(
"niweizhong2"
);
userDTO
.
setName
(
"空闻大师2"
);
userDTO
.
setDepartment
(
new
Integer
[]{
5072
});
userDTO
.
setMobile
(
"17605628851"
);
userDTO
.
setCorpid
(
"ww9ede832a84b7ae5f"
);
String
s
=
qywxUserApiService
.
listExternalUserid
(
"ww9ede832a84b7ae5f"
,
"ww2c34dc56739bb105"
,
"qiuwenmin"
);
System
.
out
.
println
(
s
);
}
@Test
public
void
getQrcode
()
{
UserDTO
workWxUser
=
qywxUserApiService
.
getSelfWorkWxUser
(
"ww9ede832a84b7ae5f"
,
"3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8"
,
"lining"
);
ServiceResponse
<
String
>
qrcode
=
staffApiService
.
getStaffQrcode
(
"167442"
,
"ff8080817181d322017182737b16021f"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
qrcode
));
}
}
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