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); } } }