|
|
@@ -64,7 +64,7 @@ public class SynProjectCoreBizTask { |
|
|
|
* |
|
|
|
*/ |
|
|
|
@Scheduled(cron = "0 0 2 * * ?") |
|
|
|
public void doTask() throws UnknownHostException { |
|
|
|
public void doTask(String orgCode) throws UnknownHostException { |
|
|
|
if (!HOST.equals(InetAddress.getLocalHost().getHostName())) { |
|
|
|
log.info("定时器没开启或者host不对! {}:{}", |
|
|
|
HOST,InetAddress.getLocalHost().getHostName()); |
|
|
@@ -77,7 +77,8 @@ public class SynProjectCoreBizTask { |
|
|
|
|
|
|
|
List<DingOrganization> orgs = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.in(DingOrganization::getTypeCode, Lists.newArrayList(DingOrganizationContant.UNIT_TYPE |
|
|
|
, DingOrganizationContant.GOV_TEMPORARY))); |
|
|
|
, DingOrganizationContant.GOV_TEMPORARY)) |
|
|
|
.eq(StringUtils.isNotBlank(orgCode),DingOrganization::getOrganizationCode,orgCode)); |
|
|
|
|
|
|
|
log.info("总共需要同步 orgs size :{}",orgs.size()); |
|
|
|
|
|
|
@@ -93,6 +94,7 @@ public class SynProjectCoreBizTask { |
|
|
|
|
|
|
|
//去请求IRS接口 |
|
|
|
JSONObject jsonObject = projectIrsManage.searchCoreBiz(null, organization.getOrganizationCode(), 1000, 1); |
|
|
|
|
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray(BizConst.RESPONSE_KEY_DATA); |
|
|
|
if(CollUtil.isNotEmpty(jsonArray)){ |
|
|
|
jsonArray.forEach(j -> { |
|
|
|