Commit 629a12db authored by 吴泽佳's avatar 吴泽佳

去除多余代码

parent 3ccacd2f
......@@ -18,12 +18,10 @@ import me.chanjar.weixin.cp.bean.Gender;
import me.chanjar.weixin.cp.bean.WxCpDepart;
import me.chanjar.weixin.cp.bean.WxCpUser;
import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -64,7 +62,7 @@ public class OrgSyncByWxcpJob {
try {
orgSyncByWxcp("Y");
} catch (Exception e) {
log.error("====== 异常结束执行OrgSyncByWxcpJob,错误:{}=======", e);
log.error("====== 异常结束执行OrgSyncByWxcpJob,错误:{}=======", e.getMessage());
}
log.info("====== 结束执行OrgSyncByWxcpJob ======");
}
......@@ -86,8 +84,8 @@ public class OrgSyncByWxcpJob {
//3 从企业微信获取组织信息及员工信息
WxCpDefaultConfigImpl wxCpDefaultConfig = JSONUtil.toBean(orgExt.getJsonWxcpKey(), WxCpDefaultConfigImpl.class);
List<WxCpDepart> wxCpDepartList = null; // 机构信息
List<WxCpDepartDto> wxCpDepartDtoList = null;//自定义的 部门信息
List<WxCpDepart> wxCpDepartList; // 机构信息
List<WxCpDepartDto> wxCpDepartDtoList;//自定义的 部门信息
try {
wxCpDepartList = getWxCpDepartList(wxCpDefaultConfig);
wxCpDepartDtoList = getWxCpUserList(wxCpDepartList,wxCpDefaultConfig);
......@@ -133,7 +131,6 @@ public class OrgSyncByWxcpJob {
ifaAssetsService.insertIfaAssets(ifaAssets);
} catch (Exception e) {
log.info("======往ifaAssets写数据错误->机构:{} -> 错误信息-> {}======", orgId, e.getMessage());
continue;
}
}
//7 讲最新的md5值 存至 orgExt 表中
......@@ -520,7 +517,7 @@ public class OrgSyncByWxcpJob {
private List<WxCpDepart> getWxCpDepartList(WxCpDefaultConfigImpl wxCpDefaultConfig) throws Exception {
WxCpService cpService = new WxCpServiceImpl();
cpService.setWxCpConfigStorage(wxCpDefaultConfig);
List<WxCpDepart> wxCpDeparts = null;
List<WxCpDepart> wxCpDeparts;
try {
wxCpDeparts = cpService.getDepartmentService().list(null);
} catch (WxErrorException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment