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
5ab9f1c7
Commit
5ab9f1c7
authored
Feb 10, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
1a3dd770
96e8476d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
13 deletions
+59
-13
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+11
-0
StaffService.java
...a/com/gic/haoban/manage/service/service/StaffService.java
+8
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+8
-0
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+12
-7
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+5
-1
StaffMapper.xml
...manage3-service/src/main/resources/mapper/StaffMapper.xml
+15
-5
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
5ab9f1c7
...
...
@@ -132,4 +132,14 @@ public interface StaffMapper {
*/
TabHaobanStaff
selectByPhoneNumberAndEnterpriseId
(
@Param
(
"phoneNumber"
)
String
phoneNumber
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 删除除了当前staffId以外其他的staff
*
* @param staffId staffId
* @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
*/
void
delOtherStaff
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"wxUserId"
)
String
wxUserId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffService.java
View file @
5ab9f1c7
...
...
@@ -98,4 +98,12 @@ public interface StaffService {
int
updateOpenUserIdsByUserId
(
String
wxEnterpriseId
,
String
wxUserId
,
String
wxOpenUseId
);
/**
* 删除除了当前staffId以外其他的staff
*
* @param staffId staffId
* @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
*/
void
delOtherStaff
(
String
staffId
,
String
wxEnterpriseId
,
String
wxUserId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
5ab9f1c7
...
...
@@ -120,4 +120,12 @@ public class StaffServiceImpl implements StaffService {
return
mapper
.
updateOpenUserIdsByUserId
(
wxEnterpriseId
,
wxUserId
,
wxOpenUseId
);
}
@Override
public
void
delOtherStaff
(
String
staffId
,
String
wxEnterpriseId
,
String
wxUserId
)
{
if
(
StringUtils
.
isEmpty
(
staffId
)){
return
;
}
mapper
.
delOtherStaff
(
staffId
,
wxEnterpriseId
,
wxUserId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
5ab9f1c7
...
...
@@ -12,10 +12,7 @@ import com.gic.haoban.app.customer.service.api.service.InnerApiService;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.AppPageType
;
import
com.gic.haoban.manage.api.enums.GicDataType
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.enums.WxEditType
;
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.service.config.Config
;
...
...
@@ -90,6 +87,9 @@ public class MessageApiServiceImpl implements MessageApiService {
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
SecretSettingService
secretSettingService
;
@Override
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
if
(
true
)
{
...
...
@@ -143,8 +143,13 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"添加企业员工失败:{}"
,
response
.
getMessage
());
return
;
}
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
enterprise
.
getWxEnterpriseId
(),
SecretTypeEnum
.
HAOBAN_HELP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
log
.
info
(
"没有配置secret:{}"
,
JSONObject
.
toJSONString
(
enterprise
));
return
;
}
// 取第一个企业的id
doDealUser
(
dto
,
relatedList
.
get
(
0
).
getEnterpriseId
());
doDealUser
(
dto
,
relatedList
.
get
(
0
).
getEnterpriseId
()
,
secretSetting
.
getSecretVal
()
);
// 以下暂时不会用到
// if (dto != null) {
...
...
@@ -184,11 +189,11 @@ public class MessageApiServiceImpl implements MessageApiService {
return
userid
.
startsWith
(
"5"
);
}
private
void
doDealUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
)
{
private
void
doDealUser
(
QywxCallBackDTO
dto
,
String
enterpriseId
,
String
secret
)
{
ClerkQwDTO
clerkQwDTO
=
new
ClerkQwDTO
();
clerkQwDTO
.
setEnterpriseId
(
enterpriseId
);
String
mainDeptId
=
dto
.
getMainDepartment
();
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departments
=
qywxDepartmentApiService
.
list
Department
(
dto
.
getAuthCorpId
(),
dto
.
getSuiteId
()
,
Integer
.
valueOf
(
mainDeptId
));
List
<
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
>
departments
=
qywxDepartmentApiService
.
list
SelfDepartment
(
dto
.
getAuthCorpId
(),
secret
,
Integer
.
valueOf
(
mainDeptId
));
if
(
CollectionUtils
.
isEmpty
(
departments
))
{
log
.
info
(
"通过主部门查询部门列表为空 mainDeptId:{}"
,
mainDeptId
);
return
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
5ab9f1c7
...
...
@@ -390,6 +390,10 @@ public class StaffApiServiceImpl implements StaffApiService {
String
nationCode
=
arr
[
0
];
String
phoneNumber
=
arr
[
1
];
TabHaobanStaff
staff
=
staffService
.
selectByPhoneNumberAndEnterpriseId
(
phoneNumber
.
trim
(),
wxEnterpriseId
);
if
(
staff
!=
null
)
{
//兼容导购调整手机号逻辑-该方法强行保证一个导购只存在一条有效导购数据
staffService
.
delOtherStaff
(
staff
.
getStaffId
(),
staff
.
getWxEnterpriseId
(),
staff
.
getWxUserId
());
}
staff
=
(
staff
==
null
?
new
TabHaobanStaff
()
:
staff
);
staff
.
setWxUserId
(
userId
);
staff
.
setUpdateTime
(
new
Date
());
...
...
@@ -1519,7 +1523,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return
staffQrCodeDTO
;
}
String
qr_code
=
user
.
getQr_code
();
staffMapper
.
updateQrCodeByStaffId
(
staffId
,
qr_code
);
staffMapper
.
updateQrCodeByStaffId
(
staffId
,
qr_code
);
staffQrCodeDTO
.
setQrCode
(
qr_code
);
return
staffQrCodeDTO
;
}
...
...
haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
View file @
5ab9f1c7
...
...
@@ -26,7 +26,8 @@
</resultMap>
<sql
id=
"Base_Column_List"
>
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
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
</sql>
...
...
@@ -42,6 +43,15 @@
where staff_id = #{staffId,jdbcType=VARCHAR}
</delete>
<update
id=
"delOtherStaff"
>
update tab_haoban_staff
set status_flag = 0
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
and staff_id != #{staffId}
</update>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
insert into tab_haoban_staff
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -438,15 +448,15 @@
<update
id=
"updateOpenIdByStaffId"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaff"
>
update tab_haoban_staff
set wx_open_id = #{openId},
update_time
= now()
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()
set qr_code
= #{qrCode},
update_time = now()
where staff_id = #{staffId}
</update>
...
...
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