|
|
@@ -3,6 +3,7 @@ package com.usoftchina.uas.office.qywx.listener;
|
|
|
import com.usoftchina.qywx.sdk.AddrBookSdk;
|
|
|
import com.usoftchina.qywx.sdk.dto.UpdateUserReq;
|
|
|
import com.usoftchina.uas.office.dto.UasEvent;
|
|
|
+import com.usoftchina.uas.office.entity.DataCenter;
|
|
|
import com.usoftchina.uas.office.listener.UasEventListener;
|
|
|
import com.usoftchina.uas.office.qywx.entity.Employee;
|
|
|
import com.usoftchina.uas.office.qywx.service.UasEmployeeService;
|
|
|
@@ -27,7 +28,7 @@ public class UasEmployeeListener {
|
|
|
*/
|
|
|
@UasEventListener(caller = "Employeemanager", operation = "AUDIT")
|
|
|
public void onEmployeeAudit(UasEvent event) {
|
|
|
- if (!addrBookSdk.enabled()) {
|
|
|
+ if (!addrBookSdk.enabled() || !event.getMaster().equals(DataCenter.INSTANCE.getUsername())) {
|
|
|
return;
|
|
|
}
|
|
|
Employee employee = employeeService.getById(Integer.parseInt(event.getKey().toString()));
|
|
|
@@ -47,7 +48,7 @@ public class UasEmployeeListener {
|
|
|
*/
|
|
|
@UasEventListener(caller = "Employeemanager", operation = "RESAUDIT")
|
|
|
public void onEmployeeUnAudit(UasEvent event) {
|
|
|
- if (!addrBookSdk.enabled()) {
|
|
|
+ if (!addrBookSdk.enabled() || !event.getMaster().equals(DataCenter.INSTANCE.getUsername())) {
|
|
|
return;
|
|
|
}
|
|
|
Employee employee = employeeService.getById(Integer.parseInt(event.getKey().toString()));
|
|
|
@@ -61,7 +62,7 @@ public class UasEmployeeListener {
|
|
|
*/
|
|
|
@UasEventListener(caller = "Employeemanager", operation = "DELETE")
|
|
|
public void onEmployeeDelete(UasEvent event) {
|
|
|
- if (!addrBookSdk.enabled()) {
|
|
|
+ if (!addrBookSdk.enabled() || !event.getMaster().equals(DataCenter.INSTANCE.getUsername())) {
|
|
|
return;
|
|
|
}
|
|
|
Employee employee = employeeService.getRemovedById(Integer.parseInt(event.getKey().toString()));
|