Commit d5782b8a by qwmqiuwenmin

fix

parent 8d8e079f
...@@ -53,6 +53,8 @@ public class StaffDTO implements Serializable{ ...@@ -53,6 +53,8 @@ public class StaffDTO implements Serializable{
private Integer syncPostionFlag; private Integer syncPostionFlag;
private Integer superManagerFlag; private Integer superManagerFlag;
private Boolean weixinPush;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -251,5 +253,13 @@ public class StaffDTO implements Serializable{ ...@@ -251,5 +253,13 @@ public class StaffDTO implements Serializable{
this.superManagerFlag = superManagerFlag; this.superManagerFlag = superManagerFlag;
} }
public Boolean getWeixinPush() {
return weixinPush;
}
public void setWeixinPush(Boolean weixinPush) {
this.weixinPush = weixinPush;
}
} }
...@@ -262,7 +262,9 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -262,7 +262,9 @@ public class MessageApiServiceImpl implements MessageApiService {
} }
departmentIds = departmentIds.substring(0,departmentIds.length() - 1); departmentIds = departmentIds.substring(0,departmentIds.length() - 1);
} }
staffApiService.staffEdit(EntityUtil.changeEntityByJSON(StaffDTO.class, staff), departmentIds); StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
staffDTO.setWeixinPush(true);
staffApiService.staffEdit(staffDTO, departmentIds);
}else { }else {
this.addUser(qywxCallBackDTO, staff); this.addUser(qywxCallBackDTO, staff);
......
...@@ -424,30 +424,33 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -424,30 +424,33 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
} }
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId()); Boolean weixinPush = staffDTO.getWeixinPush();
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(oldStaff.getWxEnterpriseId(),1); if(!weixinPush){
if(enterpriseDTO != null) { WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId());
if(application != null) { TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(oldStaff.getWxEnterpriseId(),1);
UserDTO userDTO = new UserDTO(); if(enterpriseDTO != null) {
userDTO.setCorpid(enterpriseDTO.getCorpid()); if(application != null) {
UserDTO userDTO = new UserDTO();
String[] departmentIdArr = departmentIds.split(","); userDTO.setCorpid(enterpriseDTO.getCorpid());
Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
int index = 0; String[] departmentIdArr = departmentIds.split(",");
for (String string : departmentIdArr) { Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
TabHaobanDepartment tabs = departmentService.selectById(string); int index = 0;
wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId()); for (String string : departmentIdArr) {
index ++; TabHaobanDepartment tabs = departmentService.selectById(string);
wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId());
index ++;
}
userDTO.setDepartment(wxDepartmentIdArrIntegers);
userDTO.setGender(staffDTO.getSex().toString());
userDTO.setMobile(staffDTO.getPhoneNumber());
userDTO.setName(staffDTO.getStaffName());
userDTO.setUserid(oldStaff.getWxUserId());
userDTO.setPosition(staffDTO.getPostion());
userDTO.setExternal_position(staffDTO.getExtendPostion());
JSONResponse jp = qywxUserApiService.updateWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId());
} }
userDTO.setDepartment(wxDepartmentIdArrIntegers);
userDTO.setGender(staffDTO.getSex().toString());
userDTO.setMobile(staffDTO.getPhoneNumber());
userDTO.setName(staffDTO.getStaffName());
userDTO.setUserid(oldStaff.getWxUserId());
userDTO.setPosition(staffDTO.getPostion());
userDTO.setExternal_position(staffDTO.getExtendPostion());
JSONResponse jp = qywxUserApiService.updateWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId());
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment