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
d0a35e85
Commit
d0a35e85
authored
Mar 04, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9564aa6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+34
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
d0a35e85
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.GicMessageDTO
;
import
com.gic.haoban.manage.api.dto.QywxCallBackDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.enums.GicDataType
;
import
com.gic.haoban.manage.api.enums.GicEditType
;
import
com.gic.haoban.manage.api.enums.WxEditType
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.MessageApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.mq.sdk.GicMQClient
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -42,6 +48,8 @@ public class MessageApiServiceImpl implements MessageApiService {
private
StaffService
staffService
;
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
@Autowired
private
StaffApiService
staffApiService
;
@Override
public
void
gicMessageReceive
(
GicMessageDTO
gicMessageDTO
)
{
...
...
@@ -198,9 +206,32 @@ public class MessageApiServiceImpl implements MessageApiService {
staff
.
setWxUserId
(
qywxCallBackDTO
.
getNewUserid
());
staff
.
setStaffId
(
oldStaff
.
getStaffId
());
log
.
info
(
"【微信回调更新】staff={}"
,
JSON
.
toJSONString
(
staff
));
this
.
staffService
.
updateByPrimaryKey
(
staff
);
this
.
staffDepartmentRelatedService
.
delByUserid
(
qywxCallBackDTO
.
getUserid
());
this
.
addUserDepart
(
qywxCallBackDTO
,
oldStaff
.
getStaffId
(),
enterprise
.
getWxEnterpriseId
());
// this.staffService.updateByPrimaryKey(staff);
// this.staffDepartmentRelatedService.delByUserid(qywxCallBackDTO.getUserid());
// this.addUserDepart(qywxCallBackDTO, oldStaff.getStaffId(), enterprise.getWxEnterpriseId());
String
[]
departArr
=
qywxCallBackDTO
.
getDepartment
();
String
departmentIds
=
""
;
//部门修改了
if
(
departArr
!=
null
){
for
(
String
s
:
departArr
){
TabHaobanDepartment
department
=
this
.
departmentService
.
getByWxId
(
s
,
enterprise
.
getWxEnterpriseId
());
if
(
department
==
null
){
log
.
info
(
"部门不存在"
);
continue
;
}
departmentIds
+=
department
.
getDepartmentId
()
+
","
;
}
departmentIds
=
departmentIds
.
substring
(
0
,
departmentIds
.
length
()
-
1
);
}
else
{
//部门没有修改
List
<
TabHaobanStaffDepartmentRelated
>
list
=
staffDepartmentRelatedService
.
listStaffDepartmentByStaffId
(
staff
.
getStaffId
());
for
(
TabHaobanStaffDepartmentRelated
tabHaobanStaffDepartmentRelated
:
list
)
{
departmentIds
+=
tabHaobanStaffDepartmentRelated
.
getDepartmentId
()
+
","
;
}
departmentIds
=
departmentIds
.
substring
(
0
,
departmentIds
.
length
()
-
1
);
}
staffApiService
.
staffEdit
(
EntityUtil
.
changeEntityByJSON
(
StaffDTO
.
class
,
staff
),
departmentIds
);
}
else
{
this
.
addUser
(
qywxCallBackDTO
,
staff
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
d0a35e85
...
...
@@ -376,7 +376,7 @@ public class StaffApiServiceImpl implements StaffApiService {
index
++;
}
userDTO
.
setDepartment
(
wxDepartmentIdArrIntegers
);
userDTO
.
setGender
(
"女"
);
userDTO
.
setGender
(
staffDTO
.
getSex
().
toString
()
);
userDTO
.
setMobile
(
staffDTO
.
getPhoneNumber
());
userDTO
.
setName
(
staffDTO
.
getStaffName
());
userDTO
.
setUserid
(
oldStaff
.
getWxUserId
());
...
...
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