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
2b66452b
Commit
2b66452b
authored
Jan 04, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-daiban-12-14' into developer
parents
b6d3dee0
e9c1f988
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
159 additions
and
9 deletions
+159
-9
StaffDTO.java
...src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
+19
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+31
-0
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+19
-0
TabHaobanStaff.java
.../com/gic/haoban/manage/service/entity/TabHaobanStaff.java
+20
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+0
-4
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+0
-0
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+37
-1
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+31
-3
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+2
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffDTO.java
View file @
2b66452b
...
...
@@ -94,6 +94,9 @@ public class StaffDTO implements Serializable {
private
String
wxOpenUseId
;
private
String
wxOpenId
;
private
String
qrCode
;
public
String
getClerkId
()
{
return
clerkId
;
}
...
...
@@ -328,4 +331,20 @@ public class StaffDTO implements Serializable {
public
void
setWxOpenUseId
(
String
wxOpenUseId
)
{
this
.
wxOpenUseId
=
wxOpenUseId
;
}
public
String
getWxOpenId
()
{
return
wxOpenId
;
}
public
void
setWxOpenId
(
String
wxOpenId
)
{
this
.
wxOpenId
=
wxOpenId
;
}
public
String
getQrCode
()
{
return
qrCode
;
}
public
void
setQrCode
(
String
qrCode
)
{
this
.
qrCode
=
qrCode
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
2b66452b
...
...
@@ -46,8 +46,10 @@ public interface StaffApiService {
int
countByDepartmentId
(
String
departmentId
);
@Deprecated
void
syncGicClerk
(
String
fieldListString
);
@Deprecated
void
addGicClerk
(
GicClerkDTO
clerkDTO
);
StaffDepartmentRelatedDTO
getDepartmentIdAndCode
(
String
departmentId
,
String
code
);
...
...
@@ -157,4 +159,33 @@ public interface StaffApiService {
* @date 2021-12-21 19:53:30
*/
int
updateOpenUserIdsByUserId
(
String
wxEnterpriseId
,
String
wxUserId
,
String
wxOpenUseId
);
/**
* 更新开放id员工id
*
* @param staffId 员工id
* @param openId 开放id
* @return int
*/
int
updateOpenIdByStaffId
(
String
staffId
,
String
openId
);
/**
* 更新二维码通过员工id
*
* @param staffId 员工id
* @param qrCode 二维码
* @return int
*/
int
updateQrCodeByStaffId
(
String
staffId
,
String
qrCode
);
/**
* 获取职员id二维码
*
* @param clerkId 职员id
* @return {@link String}
*/
String
getQrCodeByClerkId
(
String
clerkId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
2b66452b
...
...
@@ -93,4 +93,22 @@ public interface StaffMapper {
*/
TabHaobanStaff
selectByOpenUserIdAndEnterpriseId
(
@Param
(
"wxOpenUseId"
)
String
wxOpenUseId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 更新开放id员工id
*
* @param staffId 员工id
* @param openId 开放id
* @return int
*/
int
updateOpenIdByStaffId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"openId"
)
String
openId
);
/**
* 更新二维码通过员工id
*
* @param staffId 员工id
* @param qrCode 二维码
* @return int
*/
int
updateQrCodeByStaffId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"qrCode"
)
String
qrCode
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaff.java
View file @
2b66452b
...
...
@@ -45,6 +45,9 @@ public class TabHaobanStaff implements Serializable {
private
String
wxOpenUseId
;
private
String
wxOpenId
;
private
String
qrCode
;
public
String
getStaffId
()
{
return
staffId
;
}
...
...
@@ -196,4 +199,20 @@ public class TabHaobanStaff implements Serializable {
public
void
setWxOpenUseId
(
String
wxOpenUseId
)
{
this
.
wxOpenUseId
=
wxOpenUseId
;
}
public
String
getWxOpenId
()
{
return
wxOpenId
;
}
public
void
setWxOpenId
(
String
wxOpenId
)
{
this
.
wxOpenId
=
wxOpenId
;
}
public
String
getQrCode
()
{
return
qrCode
;
}
public
void
setQrCode
(
String
qrCode
)
{
this
.
qrCode
=
qrCode
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
2b66452b
...
...
@@ -53,16 +53,12 @@ public class StaffServiceImpl implements StaffService {
tab
.
setStaffId
(
StringUtil
.
randomUUID
());
}
tab
.
setStatusFlag
(
1
);
// if(StringUtils.isBlank(tab.getWxUserId())){
// tab.setWxUserId(tab.getStaffId());
// }
mapper
.
insertSelective
(
tab
);
return
tab
.
getStaffId
();
}
@Override
public
Page
<
TabHaobanStaff
>
pageStaff
(
Set
<
String
>
staffIds
,
Integer
activeFlag
,
String
keyword
)
{
return
mapper
.
pageStaff
(
staffIds
,
activeFlag
,
keyword
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
2b66452b
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
2b66452b
...
...
@@ -21,11 +21,14 @@
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"wx_open_user_id"
property=
"wxOpenUseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_open_id"
property=
"wxOpenId"
jdbcType=
"VARCHAR"
/>
<result
column=
"qr_code"
property=
"qrCode"
jdbcType=
"VARCHAR"
/>
</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
sort,sync_postion_flag,super_manager_flag,wx_open_user_id
,wx_open_id,qr_code
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -99,6 +102,12 @@
<if
test=
"wxOpenUseId != null"
>
wx_open_user_id,
</if>
<if
test=
"wxOpenId != null"
>
wx_open_id,
</if>
<if
test=
"qrCode != null"
>
qr_code,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"staffId != null"
>
...
...
@@ -158,6 +167,12 @@
<if
test=
"wxOpenUseId != null"
>
#{wxOpenUseId},
</if>
<if
test=
"wxOpenId != null"
>
#{wxOpenId},
</if>
<if
test=
"qrCode != null"
>
#{qrCode}
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
...
...
@@ -217,6 +232,12 @@
<if
test=
"wxOpenUseId != null"
>
wx_open_user_id = #{wxOpenUseId},
</if>
<if
test=
"wxOpenId != null"
>
wx_open_id = #{wxOpenId},
</if>
<if
test=
"qrCode != null"
>
qr_code = #{qrCode}
</if>
</set>
where staff_id = #{staffId,jdbcType=VARCHAR}
</update>
...
...
@@ -415,4 +436,18 @@
and status_flag = 1 limit 1
</select>
<update
id=
"updateOpenIdByStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
update tab_haoban_staff
set wx_open_id = #{openId},
update_time = now()
where staff_id = #{staffId}
</update>
<update
id=
"updateQrCodeByStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
update tab_haoban_staff
set qr_code = #{qrCode},
update_time = now()
where staff_id = #{staffId}
</update>
</mapper>
\ No newline at end of file
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
2b66452b
...
...
@@ -29,11 +29,14 @@ import com.gic.haoban.manage.api.dto.*;
import
com.gic.haoban.manage.api.enums.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.CommonQO
;
import
com.gic.haoban.manage.web.vo.*
;
import
com.gic.haoban.manage.web.vo.notify.CustomerFriendMemberVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.service.qywx.QywxCorpApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
...
...
@@ -90,6 +93,10 @@ public class ClerkController extends WebBaseController {
private
CustomerApiService
customerApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
Config
config
;
//选择成员列表
@RequestMapping
(
"/staff-list"
)
...
...
@@ -1244,7 +1251,6 @@ public class ClerkController extends WebBaseController {
@RequestMapping
(
"can-relation-count"
)
@IgnoreLogin
public
HaobanResponse
canRelationCount
(
@RequestBody
@Valid
CommonQO
qo
)
{
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
qo
.
getWxEnterpriseId
());
if
(
list
==
null
||
list
.
isEmpty
())
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
...
@@ -1259,6 +1265,7 @@ public class ClerkController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
clerkList
.
size
());
}
/**
* 根据员工id获取openId
*
...
...
@@ -1269,7 +1276,28 @@ public class ClerkController extends WebBaseController {
@RequestMapping
(
"getOpenIdByStaffId"
)
public
RestResponse
<
String
>
getOpenIdByStaffId
()
{
String
staffId
=
this
.
getLoginUser
().
getStaffId
();
String
openId
=
""
;
return
RestResponse
.
successResult
(
openId
);
String
wxEnterpriseId
=
this
.
getLoginUser
().
getWxEnterpriseId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
int
code
=
HaoBanErrCode
.
ERR_6
.
getCode
();
return
RestResponse
.
failure
(
String
.
valueOf
(
code
),
HaoBanErrCode
.
ERR_6
.
getMsg
());
}
String
wxOpenId
=
staffDTO
.
getWxOpenId
();
if
(
StringUtils
.
isNotBlank
(
wxOpenId
))
{
return
RestResponse
.
successResult
(
wxOpenId
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
int
code
=
HaoBanErrCode
.
ERR_400002
.
getCode
();
return
RestResponse
.
failure
(
String
.
valueOf
(
code
),
HaoBanErrCode
.
ERR_400002
.
getMsg
());
}
String
wxUserId
=
staffDTO
.
getWxUserId
();
String
openid
=
qywxUserApiService
.
getSelfOpenIdByUserId
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
wxUserId
);
if
(
StringUtils
.
isBlank
(
openid
))
{
int
code
=
HaoBanErrCode
.
ERR_600003
.
getCode
();
return
RestResponse
.
failure
(
String
.
valueOf
(
code
),
HaoBanErrCode
.
ERR_600003
.
getMsg
());
}
staffApiService
.
updateOpenIdByStaffId
(
staffId
,
openid
);
return
RestResponse
.
successResult
(
openid
);
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
2b66452b
...
...
@@ -191,7 +191,8 @@ public enum HaoBanErrCode {
ERR_500003
(
500003
,
"企业corpid不对应,需要重新登录传code"
),
ERR_600001
(
600001
,
"成员不存在,请联系管理员后台授权通讯录权限"
),
ERR_600002
(
600002
,
"无手机号"
),
ERR_600003
(
600003
,
"未获取成员openid"
),
ERR_10004
(
10004
,
"成员名称不能为空"
),
ERR_10005
(
10005
,
"成员已存在"
),
ERR_10006
(
10006
,
"成员不存在"
),
...
...
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