liupeng 5 lat temu
rodzic
commit
9c9a71f2c0

+ 4 - 4
code/sapparent/sapservice/src/main/java/org/fouram/core/plugin/weixin/cp/util/WXCpUserUtil.java

@@ -37,16 +37,16 @@ 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 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);
+						position, mobile, gender, email, telephone, firstOrgName);
 				userService.create(user);
 			} else {
 				user = getUser(userId, name, firstOrgWxIdList, secondOrgWxIdList, thirdOrgWxIdList, fourthOrgWxIdList,
-						position, mobile, gender, email, telephone);
+						position, mobile, gender, email, telephone, firstOrgName);
 				userService.update(user);
 			}
 			return "SUCCESS";
@@ -57,7 +57,7 @@ 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) throws WxErrorException {
+			String email, String telephone, String firstOrgName) throws WxErrorException {
 		WxCpUser user = new WxCpUser();
 		if (Tools.notEmpty(userId)) {
 			user.setUserId(userId);

+ 4 - 0
code/sapparent/sapservice/src/main/java/org/fouram/entity/SapUser.java

@@ -24,12 +24,16 @@ public class SapUser implements Serializable {
 	private String name;
 	private String firstOrgId;
 	private String firstOrgName;
+	private Long firstOrgWxId;
 	private String secondOrgId;
 	private String secondOrgName;
+	private Long secondOrgWxId;
 	private String thirdOrgId;
 	private String thirdOrgName;
+	private Long thirdOrgWxId;
 	private String fourthOrgId;
 	private String fourthOrgName;
+	private Long fourthOrgWxId;
 	private String position;
 	private String formatPosition;
 	private String mobile;

+ 11 - 11
code/sapparent/sapservice/src/main/java/org/fouram/service/SapUserService.java

@@ -134,24 +134,24 @@ public class SapUserService extends BaseService {
 		System.out.println(personId);
 		List<SapUser> sapUsers = selectListByPersonId(personId);
 		SapUser wxSapUser = sapUsers.get(0);
-		String[] firstOrgList = new String[sapUsers.size()];
-		String[] secondOrgList = new String[sapUsers.size()];
-		String[] thirdOrgList = new String[sapUsers.size()];
-		String[] fourthOrgList = new String[sapUsers.size()];
+		Long[] firstOrgWxIdList = new Long[sapUsers.size()];
+		Long[] secondOrgWxIdList = new Long[sapUsers.size()];
+		Long[] thirdOrgWxIdList = new Long[sapUsers.size()];
+		Long[] fourthOrgWxIdList = new Long[sapUsers.size()];
 		for (int i = 0; i < sapUsers.size(); i++) {
 			SapUser sapUser = sapUsers.get(i);
 			String checkResult = checkSapUser(sapUser);
 			if (StringUtils.isNotBlank(checkResult)) {
 				return checkResult;
 			}
-			firstOrgList[i] = sapUser.getFirstOrgName();
-			secondOrgList[i] = sapUser.getSecondOrgName();
-			thirdOrgList[i] = sapUser.getThirdOrgName();
-			fourthOrgList[i] = sapUser.getFourthOrgName();
+			firstOrgWxIdList[i] = sapUser.getFirstOrgWxId();
+			secondOrgWxIdList[i] = sapUser.getSecondOrgWxId();
+			thirdOrgWxIdList[i] = sapUser.getThirdOrgWxId();
+			fourthOrgWxIdList[i] = sapUser.getFourthOrgWxId();
 		}
-		return WXCpUserUtil.createOrUpdate(personId, wxSapUser.getName(), firstOrgList, secondOrgList, thirdOrgList,
-				fourthOrgList, wxSapUser.getFormatPosition(), wxSapUser.getFormatMobile(), wxSapUser.getGender(),
-				wxSapUser.getFormatEmail(), wxSapUser.getFormatBusinessPhone());
+		return WXCpUserUtil.createOrUpdate(personId, wxSapUser.getName(), firstOrgWxIdList, secondOrgWxIdList, thirdOrgWxIdList,
+				fourthOrgWxIdList, wxSapUser.getFormatPosition(), wxSapUser.getFormatMobile(), wxSapUser.getGender(),
+				wxSapUser.getFormatEmail(), wxSapUser.getFormatBusinessPhone(), wxSapUser.getFirstOrgName());
 	}
 
 	public String checkSapUser(SapUser sapUser) {