From 32aecd66e39db86073f7c9f777dba1629115aa85 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Fri, 20 Dec 2024 15:31:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../todotask/todoZyTaskServiceHandler.java | 24 ++++++++++++------- main/java/shkd/utils/OAUtils.java | 12 ++++------ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 0147e60..4f78017 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -78,8 +78,11 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + url; - h5url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; + //https://newoa.dobechina.com +// url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + url; +// h5url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; + url = "https://newoa.dobechina.com/seeyon/isc.do?method=ssoISC&toUrl=" + url; + h5url = "https://newoa.dobechina.com/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; //获取任务创建人 Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id @@ -103,8 +106,8 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { String oaToken = OAUtils.getOaToken(billNo); if (StringUtils.isNotEmpty(oaToken)) { - //todo OA人员绑定接口 - thirdpartyUser(approversLists, oaToken, billNo); +// //todo OA人员绑定接口-->迁移到主数据人员同步时 +// thirdpartyUser(approversLists, oaToken, billNo); HashMap thirdPartyMap = new HashMap<>(); thirdPartyMap.put("oaToken", oaToken); @@ -117,7 +120,8 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { thirdPartyMap.put("url1", url1); thirdPartyMap.put("billNo", billNo); thirdPartyMap.put("startNumber", startNumber);//发起人 - thirdPartyMap.put("h5url", h5url); +// thirdPartyMap.put("h5url", h5url); + thirdPartyMap.put("h5url", url); //推送OA待办新增接口 thirdParty(thirdPartyMap); @@ -287,8 +291,11 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { } catch (UnsupportedEncodingException e) { e.printStackTrace(); } - url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + url; - h5url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; + //https://newoa.dobechina.com +// url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + url; +// h5url = "http://172.31.254.240:9090/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; + url = "https://newoa.dobechina.com/seeyon/isc.do?method=ssoISC&toUrl=" + url; + h5url = "https://newoa.dobechina.com/seeyon/isc.do?method=ssoISC&toUrl=" + h5url; //获取token String oaToken = OAUtils.getOaToken(billNo); @@ -304,7 +311,8 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { thirdPartyMap.put("url1", url1); thirdPartyMap.put("billNo", billNo); thirdPartyMap.put("startNumber", startNumber);//发起人 - thirdPartyMap.put("h5url", h5url); +// thirdPartyMap.put("h5url", h5url); + thirdPartyMap.put("h5url", url); //推送OA消息新增接口 thirdpartyMessage(thirdPartyMap); diff --git a/main/java/shkd/utils/OAUtils.java b/main/java/shkd/utils/OAUtils.java index 81e59d2..558848b 100644 --- a/main/java/shkd/utils/OAUtils.java +++ b/main/java/shkd/utils/OAUtils.java @@ -116,11 +116,9 @@ public class OAUtils { /** * OA接口绑定用户 - * 代办接口之前需要先(用户的绑定 你通过定时任务 增量推就行,或者你们系统有人员进来推一次,这个人绑定成功了 就不需要再绑定,除非人员工号有变动) - * 先调OA接口绑定用户(相当于校验金蝶用户的number在OA系统是否存在,不存则推送失败) + * 用户的绑定 金蝶通过定时任务 增量推就行,或者金蝶系统有人员进来推一次,这个人绑定成功了 就不需要再绑定,除非人员工号有变动 * @param approversLists 金蝶系统的审批人集合 * @param oaToken 致远OA获取的token - * @return */ public static String thirdpartyUser(List approversLists, String oaToken,String billNo){ @@ -139,13 +137,13 @@ public class OAUtils { JSONObject jsonObject = new JSONObject(); jsonObject.put("registerCode", "3004");//系统注册编码:3004 jsonObject.put("thirdUserId",approver.getString("number"));//三方系统人员编码(通过人员编码匹配,需要和OA保持一致) -// jsonObject.put("thirdUserId","jdtest");//todo 三方系统人员编码(通过人员编码匹配,需要和OA保持一致) jsonObject.put("thirdLoginName", approver.getString("name"));//三方系统人员登录名 -// jsonObject.put("thirdLoginName", "金蝶测试");//todo 三方系统人员登录名 jsonObject.put("thirdName", approver.getString("name"));//三方系统人员姓名 -// jsonObject.put("thirdName", "金蝶测试");//todo 三方系统人员姓名 jsonObject.put("thirdCode", approver.getString("number"));//三方系统人员编码 -// jsonObject.put("thirdCode","jdtest");//todo 三方系统人员编码 +// jsonObject.put("thirdUserId","jdtest"); +// jsonObject.put("thirdLoginName", "金蝶测试"); +// jsonObject.put("thirdName", "金蝶测试"); +// jsonObject.put("thirdCode","jdtest"); thirdList.add(jsonObject); } thirdBody.put("userlist", thirdList); From b57ca40237186adae1a957ea1facf5f7b2a3af2b Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 20 Dec 2024 15:34:59 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=94=A8=E5=8F=8Bbip=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=E4=BB=98=E6=AC=BE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=8D=95=E7=A7=91=E7=9B=AE=E4=BC=A0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java index ad0d989..0ff0223 100644 --- a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java +++ b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java @@ -347,7 +347,8 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen //外部公司:22020104\应付账款\往来单位\外部单位(工程类) //集团内部关联公司:22020105\应付账款\往来单位\内部单位(关联方) //如果费用登记中用户选择了会计科目,则使用该字段编号,否则还使用集团内外 yxl 20241116 - if(isnotext && payrequestinfo.getDynamicObject("qeug_accountview")!=null){ + //付款申请单中用户选择了会计科目,则使用该字段编号,否则还使用集团内外 yxl 20241220 + if(payrequestinfo.getDynamicObject("qeug_accountview")!=null){ String accountview = payrequestinfo.getDynamicObject("qeug_accountview").getString("number"); items.put("pk_subjcode",accountview.replace(".","")); }else{ From e1582cfe50eefdb114228a9deea5c5d6bce72c50 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 20 Dec 2024 15:36:18 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E7=BB=91=E5=AE=9AOA=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/bamp/base/task/DobeDWpersonUpdateTask.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java index 88f4d57..0af1bc8 100644 --- a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java @@ -59,10 +59,14 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { log.info(String.format("人员接口异常:%s", e.getMessage())); throw new RuntimeException(e); } + boolean personoabid = false; + if(map != null && "yes".equals(map.get("personoabid"))){ + personoabid = true; + } JSONObject json_body = JSON.parseObject(resultData); //接口返回的数据进行了分页 int totalNum = json_body.getIntValue("totalNum");//分页-SQL查询总数据量 - handleUser(json_body); + handleUser(json_body,personoabid); int queryCount = DobeDWUtils.getQueryCount(totalNum); if(queryCount > 1){ //查询次数不止一次,需要分页查询 @@ -81,13 +85,13 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { throw new RuntimeException(e); } json_body = JSON.parseObject(resultData); - handleUser(json_body); + handleUser(json_body,personoabid); } } } - private void handleUser(JSONObject json_body) { + private void handleUser(JSONObject json_body,boolean personoabid) { //解析接口返回值,与系统数据比较 JSONArray detailsJson = json_body.getJSONArray("data"); // String userID = null; From 68eadb76b1f8f0acbef2857454bcac90e1b81437 Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Fri, 20 Dec 2024 15:43:14 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E4=BC=98=E5=8C=96,xifu,=E5=90=88=E5=90=8C=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- .../ContractMaterialImportPlugin.java | 65 +++++++++++ .../formplugin/PayreqProjectFormPlugin.java | 7 ++ .../ReconPayreqProjectFormPlugin.java | 7 ++ .../repc/recon/formplugin/TestFormPlugin.java | 101 +++++++----------- 4 files changed, 120 insertions(+), 60 deletions(-) create mode 100644 main/java/shkd/repc/recon/formplugin/ContractMaterialImportPlugin.java diff --git a/main/java/shkd/repc/recon/formplugin/ContractMaterialImportPlugin.java b/main/java/shkd/repc/recon/formplugin/ContractMaterialImportPlugin.java new file mode 100644 index 0000000..ecd4e69 --- /dev/null +++ b/main/java/shkd/repc/recon/formplugin/ContractMaterialImportPlugin.java @@ -0,0 +1,65 @@ +package shkd.repc.recon.formplugin; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.datamodel.BasedataItem; +import kd.bos.entity.datamodel.events.QueryImportBasedataEventArgs; +import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import kd.bos.servicehelper.org.OrgUnitServiceHelper; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * 合同表单插件 + */ +public class ContractMaterialImportPlugin extends AbstractFormPlugin { + + private static final String BOS_ORG = "bos_org";//组织实体 + + private static final String BD_MATERIAL = "bd_material";//物料实体 + //TODO: 生成物料逻辑迁移到导入过程中,获取excel行 + @Override + public void queryImportBasedata(QueryImportBasedataEventArgs e) { + super.queryImportBasedata(e); + Map> searchResult = e.getSearchResult(); + for (Map.Entry> entry : searchResult.entrySet()) { + List basedata = entry.getValue(); + if (basedata.isEmpty()) { // 查不到基础资料数据 + Long materialId = newMaterial(entry.getKey().getSearchValue()); + basedata.add(materialId); + //algo.storage.redis.ip_port +// System.getProperty("algo.storage.redis.ip_port"); + } else { + // 查到多个基础资料数据 + // 业务场景,应根据需求剔除不合法的基础资料数据(最终保留一个) + Iterator it = basedata.iterator(); + it.next(); + while (it.hasNext()) { + it.remove(); + } + } + } + } + private Long newMaterial(String number){ + long rootOrgId = OrgUnitServiceHelper.getRootOrgId(); + DynamicObject org = BusinessDataServiceHelper.loadSingle(rootOrgId, BOS_ORG); + DynamicObject bd_material = BusinessDataServiceHelper.newDynamicObject(BD_MATERIAL); + bd_material.set("number",number); + bd_material.set("name",number); + if (null != org) { + bd_material.set("createorg",org); + } + bd_material.set("materialtype","1");//物料类型:物资 + bd_material.set("enable", "1");//使用状态:可用 + bd_material.set("status", "C");//数据状态:审核 + bd_material.set("ctrlstrategy", "5");//控制策略:全局共享 + bd_material.set("enablepur",true);//可采购 + bd_material.set("enablesale",true);//可销售 + bd_material.set("enableinv",true);//可库存 + SaveServiceHelper.save(new DynamicObject[]{bd_material}); + return bd_material.getLong("id"); + } +} diff --git a/main/java/shkd/repc/recon/formplugin/PayreqProjectFormPlugin.java b/main/java/shkd/repc/recon/formplugin/PayreqProjectFormPlugin.java index defd856..69ebcd0 100644 --- a/main/java/shkd/repc/recon/formplugin/PayreqProjectFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/PayreqProjectFormPlugin.java @@ -27,6 +27,13 @@ public class PayreqProjectFormPlugin extends AbstractBillPlugIn { if ("org".equals(name)) { updateRenovationProject(); } + + //xifu携带名称 + if ("qeug_xf".equals(name)) { + String qeug_xf = (String)this.getModel().getValue("qeug_xf"); + this.getModel().setValue("billname",qeug_xf); + this.getView().updateView("billname"); + } } private void updateRenovationProject() { diff --git a/main/java/shkd/repc/recon/formplugin/ReconPayreqProjectFormPlugin.java b/main/java/shkd/repc/recon/formplugin/ReconPayreqProjectFormPlugin.java index 8f20919..8effefc 100644 --- a/main/java/shkd/repc/recon/formplugin/ReconPayreqProjectFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/ReconPayreqProjectFormPlugin.java @@ -32,6 +32,13 @@ public class ReconPayreqProjectFormPlugin extends AbstractBillPlugIn { if ("usedepart".equals(name)) { updateFinanceOrg(); } + + //xifu携带名称 + if ("qeug_xf".equals(name)) { + String qeug_xf = (String)this.getModel().getValue("qeug_xf"); + this.getModel().setValue("billname",qeug_xf); + this.getView().updateView("billname"); + } } private void updateRenovationProject() { diff --git a/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java b/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java index 6449f88..1e2339a 100644 --- a/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java +++ b/main/java/shkd/repc/recon/formplugin/TestFormPlugin.java @@ -4,13 +4,18 @@ import com.apusic.aas.util.digester.Digester; import com.apusic.aas.util.digester.Rule; import com.apusic.aas.util.digester.Rules; import kd.bos.bill.BillShowParameter; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.form.ShowType; import kd.bos.form.events.AfterDoOperationEventArgs; import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import kd.bos.servicehelper.org.OrgUnitServiceHelper; import java.util.List; -public class TestFormPlugin extends AbstractFormPlugin implements Rules { +public class TestFormPlugin extends AbstractFormPlugin { @Override public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) { @@ -18,69 +23,45 @@ public class TestFormPlugin extends AbstractFormPlugin implements Rules { String operateKey = afterDoOperationEventArgs.getOperateKey(); if ("save".equals(operateKey)) { - BillShowParameter billShowParameter = new BillShowParameter(); - billShowParameter.setFormId("recos_conplan");// 合约规划 - billShowParameter.getOpenStyle().setShowType(ShowType.Modal); - billShowParameter.getOpenStyle().setTargetKey("tabap"); - this.getView().showForm(billShowParameter); +// BillShowParameter billShowParameter = new BillShowParameter(); +// billShowParameter.setFormId("recos_conplan");// 合约规划 +// billShowParameter.getOpenStyle().setShowType(ShowType.Modal); +// billShowParameter.getOpenStyle().setTargetKey("tabap"); +// this.getView().showForm(billShowParameter); + + long rootOrgId = OrgUnitServiceHelper.getRootOrgId(); + DynamicObject org = BusinessDataServiceHelper.loadSingle(rootOrgId, "bos_org"); + DynamicObject bd_material = BusinessDataServiceHelper.newDynamicObject("bd_material"); + bd_material.set("enable", "1");//使用状态 + bd_material.set("status", "C");//数据状态 + bd_material.set("ctrlstrategy", "5");//控制策略 + bd_material.set("number","001"); + bd_material.set("name","001"); + if (null != org) { + bd_material.set("createorg",org); + } + bd_material.set("materialtype","1"); + bd_material.set("enablepur",true);//可采购 + bd_material.set("enablesale",true);//可销售 + bd_material.set("enableinv",true);//可库存 + SaveServiceHelper.save(new DynamicObject[]{bd_material}); + + + + } - List rules = this.rules(); - this.getControl("rules"); - this.getView().getModel(); - - Rule rule = null; - rule.getNamespaceURI(); } @Override - public Digester getDigester() { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - return null; - } - - @Override - public void setDigester(Digester digester) { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - } - - @Override - public void add(String s, Rule rule) { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - } - - @Override - public void clear() { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - } - - @Override - public List match(String s, String s1) { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - return null; - } - - @Override - public List rules() { - System.out.println(""); - System.out.println(""); - System.out.println(""); - System.out.println(""); - return null; + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + String name = e.getProperty().getName(); + //根据组织携带项目 + if ("billname".equals(name)) { + String billname = (String)this.getModel().getValue("billname"); + this.getModel().setValue("qeug_xf",billname); + this.getView().updateView("qeug_xf"); + } } } From b29520b15c04e0063da171db5a297d5dade9c50b Mon Sep 17 00:00:00 2001 From: weiyunlong Date: Fri, 20 Dec 2024 16:02:39 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=BE=85=E5=8A=9E=E4=BC=98=E5=8C=96,?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98(?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=BA=BA=E9=9B=86=E5=90=88=E5=89=94=E9=99=A4?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BA=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit S --- main/java/shkd/todotask/todoZyTaskServiceHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/java/shkd/todotask/todoZyTaskServiceHandler.java b/main/java/shkd/todotask/todoZyTaskServiceHandler.java index 4f78017..5c2fc3b 100644 --- a/main/java/shkd/todotask/todoZyTaskServiceHandler.java +++ b/main/java/shkd/todotask/todoZyTaskServiceHandler.java @@ -92,9 +92,9 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler { if (null != startUser) { startNumber = startUser.getString("number"); startName = startUser.getString("name"); - if (!userIds.contains(startUserId)) { - approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口) - } +// if (!userIds.contains(startUserId)) { +// approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口) +// } } //待办创建时间(格式:yyyy-MM-dd HH:mm:ss) Date createDate = messageContext.getCreateDate(); From 45604cbd6dadead35d04d6e1a14018e9700d0242 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 20 Dec 2024 16:10:53 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BA=BA=E5=91=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=88=9D=E5=A7=8B=E5=8C=96=E5=90=8C?= =?UTF-8?q?=E6=AD=A5OA=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bamp/base/task/DobeDWpersonUpdateTask.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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"))){