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
077df184
Commit
077df184
authored
Jun 10, 2020
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
本地缓存
parent
03174eba
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
7 deletions
+51
-7
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+7
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+3
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+3
-2
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+5
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+6
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+11
-1
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+16
-4
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
077df184
...
...
@@ -100,4 +100,11 @@ public interface StaffApiService {
* @return
*/
public
boolean
activeStaff
(
String
staffId
);
/**
* 获取一个staff
* @param wxEnterpriseId
* @return
*/
public
StaffDTO
getWxStaffOne
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
077df184
...
...
@@ -40,4 +40,6 @@ public interface StaffMapper {
List
<
TabHaobanStaff
>
listByUserIdsAndWxEnterpriseId
(
@Param
(
"userIds"
)
List
<
String
>
userIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
public
int
cleanStaff
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
);
TabHaobanStaff
getWxStaffByOne
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
077df184
...
...
@@ -29,9 +29,10 @@ public interface StaffService {
/**
* 清楚微信信息
* @param wxEnterpriseId
* @param wxUserIds
* @return
*/
public
int
cleanStaff
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"staffIds"
)
List
<
String
>
staffIds
);
public
int
cleanStaff
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
);
TabHaobanStaff
getWxStaffByOne
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
077df184
...
...
@@ -87,4 +87,9 @@ public class StaffServiceImpl implements StaffService {
public
int
cleanStaff
(
String
wxEnterpriseId
,
List
<
String
>
staffIds
)
{
return
mapper
.
cleanStaff
(
wxEnterpriseId
,
staffIds
);
}
@Override
public
TabHaobanStaff
getWxStaffByOne
(
String
wxEnterpriseId
)
{
return
mapper
.
getWxStaffByOne
(
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
077df184
...
...
@@ -1465,6 +1465,12 @@ public class StaffApiServiceImpl implements StaffApiService {
return
true
;
}
@Override
public
StaffDTO
getWxStaffOne
(
String
wxEnterpriseId
)
{
TabHaobanStaff
wxStaffByOne
=
staffService
.
getWxStaffByOne
(
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
wxStaffByOne
);
}
// private String getMobile(String phoneNumber,String nationcode){
// String mobile = nationcode + phoneNumber;
// return mobile;
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
077df184
...
...
@@ -353,5 +353,14 @@
#{item}
</foreach>
</update>
<select
id=
"getWxStaffByOne"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id is not null and wx_user_id!=''
limit 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
077df184
...
...
@@ -20,6 +20,7 @@ import com.gic.haoban.manage.api.dto.StaffDTO;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.web.anno.IgnoreLogin
;
...
...
@@ -62,6 +63,9 @@ public class WxEnterpriseController extends WebBaseController{
private
Config
config
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
StaffApiService
staffApiService
;
//授权企业列表
...
...
@@ -263,7 +267,7 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
contactSecret
=
contactSecret
.
trim
();
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
login
.
getStaffDTO
().
getWxUserId
(
));
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_SECRET
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
...
...
@@ -301,7 +305,7 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
wxSecretKey
=
wxSecretKey
.
trim
();
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
wxEnterprise
.
getCorpid
(),
wxSecretKey
,
login
.
getStaffDTO
().
getWxUserId
(
));
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
wxEnterprise
.
getCorpid
(),
wxSecretKey
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
logger
.
info
(
"【保存联系人key】res={}"
,
res
);
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
CONTACT_CUSTOMER
.
getVal
(),
null
);
...
...
@@ -351,7 +355,7 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
memberSecret
=
memberSecret
.
trim
();
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
memberSecret
,
login
.
getStaffDTO
().
getWxUserId
(
));
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
memberSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()
));
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
MEMBER_WAPP
.
getVal
(),
enterpriseId
);
if
(
null
==
secretSetting
)
{
...
...
@@ -374,6 +378,13 @@ public class WxEnterpriseController extends WebBaseController{
}
}
private
String
getWxUserId
(
String
wxEnterpriseId
,
StaffDTO
loginStaffDTO
)
{
if
(
loginStaffDTO
!=
null
&&
(!
StringUtils
.
isEmpty
(
loginStaffDTO
.
getWxUserId
())))
{
return
loginStaffDTO
.
getWxUserId
();
}
StaffDTO
staffOne
=
staffApiService
.
getWxStaffOne
(
wxEnterpriseId
);
return
staffOne
.
getWxUserId
();
}
//微信企业绑定接口绑定通讯录key
@IgnoreLogin
...
...
@@ -393,7 +404,8 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10012
);
}
contactSecret
=
contactSecret
.
trim
();
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
login
.
getStaffDTO
().
getWxUserId
());
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
wxEnterprise
.
getCorpid
(),
contactSecret
,
getWxUserId
(
wxEnterpriseId
,
login
.
getStaffDTO
()));
logger
.
info
(
"【保存联系人key】user={}"
,
JSON
.
toJSONString
(
user
));
SecretSettingDTO
secretSetting
=
wxEnterpriseApiService
.
getSecretSetting
(
wxEnterpriseId
,
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
(),
null
);
if
(
null
==
secretSetting
)
{
...
...
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