@@ -0,0 +1,27 @@
+package org.fouram.core.plugin.weixin.cp.util;
+
+import java.util.List;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.cp.bean.WxCpDepart;
+import me.chanjar.weixin.cp.bean.WxCpUser;
+/**
+ * 企业微信用户工具类
+ *
+ * @author Liup
+ */
+public class GetAllDepartDataUtil {
+ public static void main(String[] args) throws WxErrorException {
+ List<WxCpDepart> departs = WXCpDepartUtil.getAllChildDeparts(1L);
+ for(WxCpDepart depart : departs) {
+ List<WxCpUser> users = WXCpUserUtil.listByDepartment(depart.getId());
+ for (WxCpUser user : users) {
+ if(user.getMobile().equals("18801209212")) {
+ System.out.println(user);
+ }
+}
@@ -34,12 +34,4 @@
<update id="updateWxDepartId">
update sap_org set wxDepartId=#{wxDepartId} where id=#{id}
</update>
-
- <delete id="deleteNotUsed">
- delete from sap_org
- where id not in (SELECT DISTINCT firstOrgId from sap_user where delFlag = 0
- union all SELECT DISTINCT secondOrgId from sap_user where delFlag = 0
- union all SELECT DISTINCT thirdOrgId from sap_user where delFlag = 0
- union all SELECT DISTINCT fourthOrgId from sap_user where delFlag = 0)
- </delete>
</mapper>
@@ -126,8 +126,6 @@ public class SapOrgService extends BaseService {
}
public Map<String, Long> updateAllWxDepartId() throws Exception {
- // 删除未使用部门
- deleteNotUsed();
Map<String, Long> result = Maps.newHashMap();
List<SapOrg> firstOrgs = selectListByParentId(WebConstants.TOP_DEPART.toString());
List<SapOrg> allOrgs = Lists.newArrayList();
@@ -172,10 +170,6 @@ public class SapOrgService extends BaseService {
update("SapOrgMapper.updateWxDepartId", org);
- public void deleteNotUsed() throws Exception {
- delete("SapOrgMapper.deleteNotUsed", null);
- }
@SuppressWarnings("unchecked")
public List<SapOrg> selectListByName(String name) throws Exception {
return toInfoDetails((List<SapOrg>) findList("SapOrgMapper.selectListByName", name));
@@ -1,21 +1,17 @@
#fouram
-wxCp.corpId = ww51602aeb8dab7a95
-wxCp.corpSecret = 0i1jzYxLcriGTXhoatAGYaCFUXshfASbavRScZQxVmI
+#wxCp.corpId = ww51602aeb8dab7a95
+#wxCp.corpSecret = 0i1jzYxLcriGTXhoatAGYaCFUXshfASbavRScZQxVmI
#test
#wxCp.corpId = ww3fa314d9782219c7
#wxCp.corpSecret = 80lhnjKd6hKNp1tNkRsN9i0wOtrSZ7Sg_apJDNa1RDQ
#prod
-#wxCp.corpId = ww911e29458d3a46fd
-#wxCp.corpSecret = amUNgH2lo-szEYkLmClZN2jMYcDu0NnXIAtWfW729P4
+wxCp.corpId = ww911e29458d3a46fd
+wxCp.corpSecret = amUNgH2lo-szEYkLmClZN2jMYcDu0NnXIAtWfW729P4
wxCp.mailList.corpSecret = aI66cnVoFAd381rgd3NpyZaEP2qnuZJ2ogpZKWmz9qg
wxCp.redirectUri = http://cmcadressbook.suggest.vip/sapcms
wxCp.mailList.userId = 1,2,3,4,5,6,7,8,9,10,dd4d61108fecaa34918a555fd1d8cce1,1102
#sapApi.user = APIADMIN@cmccoltdD:123456