|
@@ -44,22 +44,18 @@ public class WXCpUserUtil {
|
|
|
|
|
|
public static String createOrUpdate(String userId, String name, Long[] firstWxDepartIdList,
|
|
|
Long[] secondWxDepartIdList, Long[] thirdWxDepartIdList, Long[] fourthWxDepartIdList, String position,
|
|
|
- String mobile, String gender, String email, String telephone, String firstOrgName) {
|
|
|
+ String mobile, String gender, String email, String telephone, String firstOrgName) throws WxErrorException {
|
|
|
WxCpUser user = getByIdOrEmail(userId, email);
|
|
|
- try {
|
|
|
- if (user == null) {
|
|
|
- user = getUser(userId, name, firstWxDepartIdList, secondWxDepartIdList, thirdWxDepartIdList,
|
|
|
- fourthWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
- userService.create(user);
|
|
|
- } else {
|
|
|
- user = getUser(user.getUserId(), name, firstWxDepartIdList, secondWxDepartIdList, thirdWxDepartIdList,
|
|
|
- fourthWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
- userService.update(user);
|
|
|
- }
|
|
|
- return SapUserResultEnum.SUCCESS.getCode();
|
|
|
- } catch (WxErrorException e) {
|
|
|
- return e.getMessage();
|
|
|
- }
|
|
|
+ if (user == null) {
|
|
|
+ user = getUser(userId, name, firstWxDepartIdList, secondWxDepartIdList, thirdWxDepartIdList,
|
|
|
+ fourthWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
+ userService.create(user);
|
|
|
+ } else {
|
|
|
+ user = getUser(user.getUserId(), name, firstWxDepartIdList, secondWxDepartIdList, thirdWxDepartIdList,
|
|
|
+ fourthWxDepartIdList, position, mobile, gender, email, telephone, firstOrgName);
|
|
|
+ userService.update(user);
|
|
|
+ }
|
|
|
+ return SapUserResultEnum.SUCCESS.getCode();
|
|
|
}
|
|
|
|
|
|
private static WxCpUser getUser(String userId, String name, Long[] firstWxDepartIdList, Long[] secondWxDepartIdList,
|