diff --git a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java index 0af1bc8..93abd08 100644 --- a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java @@ -22,6 +22,7 @@ import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import shkd.utils.DobeDWUtils; +import shkd.utils.OAUtils; import java.io.IOException; import java.util.ArrayList; @@ -106,6 +107,7 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { String bank_account = null; List updateList = new ArrayList<>(); + List userinfos = new ArrayList<>(); UserParam user = null; DynamicObject currentUser = null; DynamicObject deptOrg = null; @@ -141,6 +143,10 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { dataMap.put("email", email);//电子邮箱 user.setDataMap(dataMap); updateList.add(user); + //组装要与OA绑定的人员集合 + if(personoabid){ + userinfos.add(currentUser); + } //处理部门和职位 if(!DobeDWUtils.isEmpty(deptid)){ deptOrg = QueryServiceHelper.queryOne("bos_org","id,number,name",new QFilter[]{new QFilter("fyzjorgid","=",deptid)}); @@ -223,6 +229,15 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { } } } + //调用OA人员绑定 + if(userinfos.size() > 0){ + String billNo = "person-first-all-bid"; + //获取token + String oaToken = OAUtils.getOaToken(billNo); + if (!DobeDWUtils.isEmpty(oaToken)) { + OAUtils.thirdpartyUser(userinfos, oaToken, billNo); + } + } } private boolean isNeedUpdate(DynamicObject personbank,String name,String bank,String bank_branch,String bank_account){ if(!name.equals(personbank.getString("name"))){