From c087558b2778fcf9f57cad65207b85ebf30533fa Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Tue, 26 Nov 2024 11:39:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=AF=B9=E5=BA=94=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E4=B8=AD=E5=A2=9E=E5=8A=A0=E7=94=B2=E6=96=B9=E7=9A=84?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=92=8C=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/repc/task/DobeDWorgRelationTask.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main/java/shkd/repc/task/DobeDWorgRelationTask.java b/main/java/shkd/repc/task/DobeDWorgRelationTask.java index 141ab3b..1b25bfd 100644 --- a/main/java/shkd/repc/task/DobeDWorgRelationTask.java +++ b/main/java/shkd/repc/task/DobeDWorgRelationTask.java @@ -28,6 +28,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { private static Log log = LogFactory.getLog(DobeDWorgRelationTask.class); private static final String entityName = "qeug_recon_orgrelation";//供应链库 表名 tk_qeug_recon_orgrelation + private static final String developerName = "qeug_recon_developer";//供应链库 表名 tk_qeug_recon_developer private static final String orgEntityName = "bos_org";//系统库 表名 t_ORG_ORG private static final String dw_menthod = "mdm_orgcorp"; @@ -93,6 +94,7 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { String paynumber = null; String taxno = null; DynamicObject yworginfo = null; + DynamicObject devepinfo = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); @@ -152,6 +154,21 @@ public class DobeDWorgRelationTask extends AbstractTask implements Plugin { yworginfo.set("uniformsocialcreditcode", taxno);//业务单元-统一社会信用代码 SaveServiceHelper.update(yworginfo); } + //根据财务组织编号和名称判断甲方是否需要新增和修改 + devepinfo = BusinessDataServiceHelper.loadSingle(developerName,new QFilter[]{new QFilter("number","=",companyNumber)}); + if(devepinfo == null){ + devepinfo = BusinessDataServiceHelper.newDynamicObject(developerName); + devepinfo.set("number", companyNumber); + devepinfo.set("name", companyName); + devepinfo.set("enable", 1); + devepinfo.set("status", "C");//单据状态 A保存 B已提交 C已审核 + devepinfo.set("creator", 43007523L);//创建人默认指定为金小蝶 + //保存数据:直接保存入库,不走操作校验 + SaveServiceHelper.save(new DynamicObject[]{devepinfo}); + }else if(!companyName.equals(devepinfo.getString("name"))){ + devepinfo.set("name", companyName); + SaveServiceHelper.update(devepinfo); + } } }