|
@@ -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");
|
|
|
}
|
|
|
}
|