|
@@ -35,18 +35,18 @@ public class WXCpUserUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static String createOrUpdate(String userId, String name, Long[] firstOrgWxIdList,
|
|
|
- Long[] secondOrgWxIdList, Long[] thirdOrgWxIdList, Long[] fourthOrgWxIdList, String position,
|
|
|
- String mobile, String gender, String email, String telephone, String firstOrgName) {
|
|
|
+ public static String createOrUpdate(String userId, String name, Long[] firstOrgWxDepartIdList,
|
|
|
+ Long[] secondOrgWxDepartIdList, Long[] thirdOrgWxDepartIdList, Long[] fourthOrgWxDepartIdList,
|
|
|
+ String position, String mobile, String gender, String email, String telephone, String firstOrgName) {
|
|
|
WxCpUser user = getById(userId);
|
|
|
try {
|
|
|
if (user == null) {
|
|
|
- user = getUser(userId, name, firstOrgWxIdList, secondOrgWxIdList, thirdOrgWxIdList, fourthOrgWxIdList,
|
|
|
- position, mobile, gender, email, telephone, firstOrgName);
|
|
|
+ user = getUser(userId, name, firstOrgWxDepartIdList, secondOrgWxDepartIdList, thirdOrgWxDepartIdList,
|
|
|
+ fourthOrgWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
userService.create(user);
|
|
|
} else {
|
|
|
- user = getUser(userId, name, firstOrgWxIdList, secondOrgWxIdList, thirdOrgWxIdList, fourthOrgWxIdList,
|
|
|
- position, mobile, gender, email, telephone, firstOrgName);
|
|
|
+ user = getUser(userId, name, firstOrgWxDepartIdList, secondOrgWxDepartIdList, thirdOrgWxDepartIdList,
|
|
|
+ fourthOrgWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
userService.update(user);
|
|
|
}
|
|
|
return "SUCCESS";
|
|
@@ -55,9 +55,10 @@ public class WXCpUserUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static WxCpUser getUser(String userId, String name, Long[] firstOrgWxIdList, Long[] secondOrgWxIdList,
|
|
|
- Long[] thirdOrgWxIdList, Long[] fourthOrgWxIdList, String position, String mobile, String gender,
|
|
|
- String email, String telephone, String firstOrgName) throws WxErrorException {
|
|
|
+ private static WxCpUser getUser(String userId, String name, Long[] firstOrgWxDepartIdList,
|
|
|
+ Long[] secondOrgWxDepartIdList, Long[] thirdOrgWxDepartIdList, Long[] fourthOrgWxDepartIdList,
|
|
|
+ String position, String mobile, String gender, String email, String telephone, String firstOrgName)
|
|
|
+ throws WxErrorException {
|
|
|
WxCpUser user = new WxCpUser();
|
|
|
if (Tools.notEmpty(userId)) {
|
|
|
user.setUserId(userId);
|
|
@@ -65,10 +66,10 @@ public class WXCpUserUtil {
|
|
|
if (Tools.notEmpty(name)) {
|
|
|
user.setName(name);
|
|
|
}
|
|
|
- Long[] departIds = new Long[firstOrgWxIdList.length];
|
|
|
- for (int i = 0; i < firstOrgWxIdList.length; i++) {
|
|
|
- departIds[i] = WXCpDepartUtil.create(firstOrgWxIdList[i], secondOrgWxIdList[i], thirdOrgWxIdList[i],
|
|
|
- fourthOrgWxIdList[i]);
|
|
|
+ Long[] departIds = new Long[firstOrgWxDepartIdList.length];
|
|
|
+ for (int i = 0; i < firstOrgWxDepartIdList.length; i++) {
|
|
|
+ departIds[i] = WXCpDepartUtil.create(firstOrgWxDepartIdList[i], secondOrgWxDepartIdList[i],
|
|
|
+ thirdOrgWxDepartIdList[i], fourthOrgWxDepartIdList[i]);
|
|
|
}
|
|
|
user.setDepartIds(departIds);
|
|
|
if (Tools.notEmpty(position)) {
|