From e75ce1af728c0a3a0b4ca0ca81e9655d942c9682 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 20 Dec 2024 17:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=96=B0=E5=A2=9E=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=AD=E5=A2=9E=E5=8A=A0=E5=90=8C=E6=AD=A5OA?= =?UTF-8?q?=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/bamp/base/task/DobeDWpersonTask.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/main/java/shkd/bamp/base/task/DobeDWpersonTask.java b/main/java/shkd/bamp/base/task/DobeDWpersonTask.java index 504e2f9..570e1cf 100644 --- a/main/java/shkd/bamp/base/task/DobeDWpersonTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWpersonTask.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; @@ -90,7 +91,7 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin { QFilter exprtFilter = new QFilter("number", QCP.not_in, exprtNumber); QFilter dwFilter = new QFilter("source", QCP.equals, "dw"); QFilter enableFilter = new QFilter("enable", QCP.equals, "1"); - DynamicObject[] dos = BusinessDataServiceHelper.load("bos_user","id,enable,isforbidden",new QFilter[]{exprtFilter.and(dwFilter).and(enableFilter)}); + DynamicObject[] dos = BusinessDataServiceHelper.load(entityName,"id,enable,isforbidden",new QFilter[]{exprtFilter.and(dwFilter).and(enableFilter)}); if(dos.length > 0){ DynamicObject currentUser = null; for (int i = 0; i < dos.length; i++) { @@ -227,10 +228,26 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin { } if(addList.size() > 0){ UserServiceHelper.add(addList); + List userinfos = new ArrayList<>(); + DynamicObject userinfo = null; //判断执行结果 for (UserParam result : addList) { if (!result.isSuccess()) { log.info(String.format("人员新增异常:%s", result.getMsg())); + }else{ + userinfo = BusinessDataServiceHelper.newDynamicObject(entityName);; + userinfo.set("number",result.getDataMap().get("number"));//人员编号 + userinfo.set("name",result.getDataMap().get("name"));//人员姓名 + userinfos.add(userinfo); + } + } + //处理OA人员绑定 + if(userinfos.size() > 0){ + String billNo = "person-new-bid"; + //获取token + String oaToken = OAUtils.getOaToken(billNo); + if (!DobeDWUtils.isEmpty(oaToken)) { + OAUtils.thirdpartyUser(userinfos, oaToken, billNo); } } }