Commit d5782b8a by qwmqiuwenmin

fix

parent 8d8e079f
......@@ -53,6 +53,8 @@ public class StaffDTO implements Serializable{
private Integer syncPostionFlag;
private Integer superManagerFlag;
private Boolean weixinPush;
private static final long serialVersionUID = 1L;
......@@ -251,5 +253,13 @@ public class StaffDTO implements Serializable{
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 {
}
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 {
this.addUser(qywxCallBackDTO, staff);
......
......@@ -424,30 +424,33 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(oldStaff.getWxEnterpriseId(),1);
if(enterpriseDTO != null) {
if(application != null) {
UserDTO userDTO = new UserDTO();
userDTO.setCorpid(enterpriseDTO.getCorpid());
String[] departmentIdArr = departmentIds.split(",");
Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
int index = 0;
for (String string : departmentIdArr) {
TabHaobanDepartment tabs = departmentService.selectById(string);
wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId());
index ++;
Boolean weixinPush = staffDTO.getWeixinPush();
if(!weixinPush){
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(oldStaff.getWxEnterpriseId(),1);
if(enterpriseDTO != null) {
if(application != null) {
UserDTO userDTO = new UserDTO();
userDTO.setCorpid(enterpriseDTO.getCorpid());
String[] departmentIdArr = departmentIds.split(",");
Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
int index = 0;
for (String string : departmentIdArr) {
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