liupeng 4 år sedan
förälder
incheckning
63d270f7ab

+ 2 - 0
code/sapparent/sapservice/src/main/java/org/fouram/entity/WxUser.java

@@ -24,4 +24,6 @@ public class WxUser implements Serializable {
 	private String firstDepartName;
 	private Long secondDepartId;
 	private String secondDepartName;
+	private String departIds;
+	private String position;
 }

+ 3 - 10
code/sapparent/sapservice/src/main/java/org/fouram/service/WxUserService.java

@@ -12,7 +12,6 @@ import org.springframework.stereotype.Service;
 
 import com.google.common.collect.Maps;
 
-import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.cp.bean.WxCpUser;
 
 @Service
@@ -43,6 +42,8 @@ public class WxUserService extends BaseService {
 				wxUser.setSecondDepartName(departs.get(1).getName());
 				wxUser.setSecondDepartId(departs.get(1).getId());
 			}
+			wxUser.setPosition(user.getPosition());
+			wxUser.setDepartIds(user.getDepartIds().toString().replace("[", ",").replace("]", ",").replace(" ", ""));
 			dbUser = selectById(userId);
 			if (dbUser == null) {
 				save("WxUserMapper.save", wxUser);
@@ -52,7 +53,7 @@ public class WxUserService extends BaseService {
 			}
 		}
 	}
-
+	
 	public WxUser selectById(String userId) throws Exception {
 		return (WxUser) findObject("WxUserMapper.selectById", userId);
 	}
@@ -68,12 +69,4 @@ public class WxUserService extends BaseService {
 	public List<String> selectAllUserIds() throws Exception {
 		return (List<String>) findList("WxUserMapper.selectAllUserIds", null);
 	}
-	
-	public static void main(String[] args) {
-		try {
-			System.out.println(WXCpUserUtil.listAllUser().size());
-		} catch (WxErrorException e) {
-			e.printStackTrace();
-		}
-	}
 }