liupeng 5 年之前
父节点
当前提交
3c0f9b6ce9

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

@@ -19,15 +19,15 @@ import me.chanjar.weixin.cp.bean.WxCpUser.ExternalAttribute;
  */
 public class WXCpUserUtil {
 
-	public static String createOrUpdate(String userId, String name, String[] subCompanyList, String[] departmentList,
+	public static String createOrUpdateForTest(String userId, String name, String[] subCompanyList, String[] departmentList,
 			String position, String mobile, String gender, String email) {
 		WxCpUser user = getById(userId);
 		try {
 			if (user == null) {
-				user = getUser(userId, name, subCompanyList, departmentList, position, mobile, gender, email);
+				user = getUserForTest(userId, name, subCompanyList, departmentList, position, mobile, gender, email);
 				userService.create(user);
 			} else {
-				user = getUser(userId, name, subCompanyList, departmentList, position, mobile, gender, email);
+				user = getUserForTest(userId, name, subCompanyList, departmentList, position, mobile, gender, email);
 				userService.update(user);
 			}
 			return WebConstants.SUCCESS;
@@ -99,7 +99,7 @@ public class WXCpUserUtil {
 		userService.update(user);
 	}
 
-	private static WxCpUser getUser(String userId, String name, String[] subCompanyList, String[] departmentList,
+	private static WxCpUser getUserForTest(String userId, String name, String[] subCompanyList, String[] departmentList,
 			String position, String mobile, String gender, String email) throws WxErrorException {
 		WxCpUser user = new WxCpUser();
 		if (Tools.notEmpty(userId)) {
@@ -153,7 +153,7 @@ public class WXCpUserUtil {
 	}
 
 	public static void main(String[] args) {
-		createOrUpdate("yangbin", "杨斌", new String[] { "华人时代" }, new String[] { "管理层" }, "", "", "男",
+		createOrUpdateForTest("yangbin", "杨斌", new String[] { "华人时代" }, new String[] { "管理层" }, "", "", "男",
 				"13671179900@jiinfo.cn");
 	}
 }

+ 2 - 2
code/sapparent/sapservice/src/main/java/org/fouram/service/TestUserService.java

@@ -15,7 +15,7 @@ public class TestUserService extends BaseService {
 	public void createOrUpdateWXUsers() throws Exception {
 		List<TestUser> testUsers = (List<TestUser>) findList("TestUserMapper.selectAllList", null);
 		System.out.println(testUsers.size());
-		for (int i = 0; i < testUsers.size(); i ++) {
+		for (int i = 0; i < testUsers.size(); i++) {
 			TestUser testUser = testUsers.get(i);
 			String wxUserResult = createOrUpdateWXUser(testUser);
 			LoggerUtil.info(wxUserResult);
@@ -30,7 +30,7 @@ public class TestUserService extends BaseService {
 		String[] departmentList = new String[] { testUser.getDepartment() };
 		String position = "";
 		String mobile = "";
-		return WXCpUserUtil.createOrUpdate(testUser.getPersonId(), testUser.getName(), subCompanyList,
+		return WXCpUserUtil.createOrUpdateForTest(testUser.getPersonId(), testUser.getName(), subCompanyList,
 				departmentList, position, mobile, testUser.getGender(), testUser.getEmail());
 	}
 }