From e19ee8152426184a26f5f64c44db8431262cc3e7 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Wed, 18 Dec 2024 18:23:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=90=8C=E6=AD=A5=E8=AF=84=E6=A0=87=E4=B8=93=E5=AE=B6?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=9B=20=E7=94=A8?= =?UTF-8?q?=E5=8F=8Bbip=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E5=86=85=E5=A4=96=E9=83=A8=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E7=9A=84=E5=88=86=E7=B1=BB=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/bamp/base/task/DobeDWpersonTask.java | 27 ++++++++++++++++++ .../base/task/DobeDWpersonUpdateTask.java | 28 +++++++++++++++++++ .../recon/opplugin/YongyouBIPOperation.java | 6 ++-- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/main/java/shkd/bamp/base/task/DobeDWpersonTask.java b/main/java/shkd/bamp/base/task/DobeDWpersonTask.java index ca9bb87..504e2f9 100644 --- a/main/java/shkd/bamp/base/task/DobeDWpersonTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWpersonTask.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.context.RequestContext; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.exception.KDException; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; @@ -34,6 +35,9 @@ import java.util.Map; public class DobeDWpersonTask extends AbstractTask implements Plugin { private static final String entityName = "bos_user";//系统库 表名 t_sec_user private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank + + private static final String proficientName = "rebm_proficient";//供应链库 评标专家库 表名 t_bid_proficient + private static final String proficientTypeName = "rebm_proficienttype";//供应链库 专家专业分类 表名 t_bid_majortype private static Log log = LogFactory.getLog(DobeDWpersonTask.class); private static final String dw_menthod = "mdm_user"; @@ -120,6 +124,9 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin { DynamicObject personbank = null; DynamicObject deptOrg = null; Map dataMap = null; + DynamicObject proficientInfo = null;//评标专家库 + DynamicObject ptinfo = BusinessDataServiceHelper.loadSingleFromCache(proficientTypeName,"id,number,name",new QFilter[]{new QFilter("number","=","00")}); + DynamicObjectCollection ptcoll = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); // userID = json_body.getString("user_id"); @@ -182,6 +189,26 @@ public class DobeDWpersonTask extends AbstractTask implements Plugin { log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid)); } } + //处理新增 评标专家库 + proficientInfo = BusinessDataServiceHelper.newDynamicObject(proficientName); + proficientInfo.set("billno",number);//专家编号 + proficientInfo.set("name",name);//专家姓名 + proficientInfo.set("type","internalExperts");//专家来源--默认内部专家 + proficientInfo.set("telephone",phone);//手机号 + ptcoll = proficientInfo.getDynamicObjectCollection("majortype"); + DynamicObject newptinfo = new DynamicObject(ptcoll.getDynamicObjectType()); + newptinfo.set("fbasedataId", ptinfo); + ptcoll.add(newptinfo); + proficientInfo.set("majortype",ptcoll);//专业分类 + proficientInfo.set("org",deptOrg.getLong("id"));//采购组织 + proficientInfo.set("userdstatus","Enable"); //使用状态--默认可用 + proficientInfo.set("billstatus","C"); //使用状态--默认已审核 + proficientInfo.set("politicalstatus","other"); //政治面貌--默认其他 + proficientInfo.set("majortypenames",ptinfo.getString("name")); //专业分类名称字符串 + proficientInfo.set("entitytypeid",proficientName); //实体类型ID + //保存数据:直接保存入库,不走操作校验 + SaveServiceHelper.save(new DynamicObject[]{proficientInfo}); + //处理新增人员收款银行账户 if(DobeDWUtils.isEmpty(bank_account)){ continue; diff --git a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java index b4e2f64..88f4d57 100644 --- a/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWpersonUpdateTask.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.context.RequestContext; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.exception.KDException; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; @@ -34,6 +35,8 @@ import java.util.Map; public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { private static final String entityName = "bos_user";//系统库 表名 t_sec_user private static final String personEntityName = "qeug_recon_personbank";//供应链库 人员收款银行账户 表名 tk_qeug_recon_personbank + private static final String proficientName = "rebm_proficient";//供应链库 评标专家库 表名 t_bid_proficient + private static final String proficientTypeName = "rebm_proficienttype";//供应链库 专家专业分类 表名 t_bid_majortype private static Log log = LogFactory.getLog(DobeDWpersonUpdateTask.class); private static final String dw_menthod = "mdm_user"; @@ -104,6 +107,9 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { DynamicObject deptOrg = null; DynamicObject personbank = null; Map dataMap = null; + DynamicObject proficientInfo = null;//评标专家库 + DynamicObject ptinfo = BusinessDataServiceHelper.loadSingleFromCache(proficientTypeName,"id,number,name",new QFilter[]{new QFilter("number","=","00")}); + DynamicObjectCollection ptcoll = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); // userID = json_body.getString("user_id"); @@ -153,6 +159,28 @@ public class DobeDWpersonUpdateTask extends AbstractTask implements Plugin { log.info(String.format("数仓的部门在金蝶中未找到对应组织:%s", deptid)); } } + //处理新增 评标专家库 + proficientInfo = BusinessDataServiceHelper.loadSingle(proficientName,new QFilter[]{new QFilter("billno","=",number)}); + if(proficientInfo == null){ + proficientInfo = BusinessDataServiceHelper.newDynamicObject(proficientName); + proficientInfo.set("billno",number);//专家编号 + proficientInfo.set("name",name);//专家姓名 + proficientInfo.set("type","internalExperts");//专家来源--默认内部专家 + proficientInfo.set("telephone",phone);//手机号 + ptcoll = proficientInfo.getDynamicObjectCollection("majortype"); + DynamicObject newptinfo = new DynamicObject(ptcoll.getDynamicObjectType()); + newptinfo.set("fbasedataId", ptinfo); + ptcoll.add(newptinfo); + proficientInfo.set("majortype",ptcoll);//专业分类 + proficientInfo.set("org",deptOrg.getLong("id"));//采购组织 + proficientInfo.set("userdstatus","Enable"); //使用状态--默认可用 + proficientInfo.set("billstatus","C"); //使用状态--默认已审核 + proficientInfo.set("politicalstatus","other"); //政治面貌--默认其他 + proficientInfo.set("majortypenames",ptinfo.getString("name")); //专业分类名称字符串 + proficientInfo.set("entitytypeid",proficientName); //实体类型ID + //保存数据:直接保存入库,不走操作校验 + SaveServiceHelper.save(new DynamicObject[]{proficientInfo}); + } //处理人员收款银行账户的修改,银行账户为空时,不处理 if(DobeDWUtils.isEmpty(bank_account)){ continue; diff --git a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java index e1fa1ef..ad0d989 100644 --- a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java +++ b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java @@ -352,7 +352,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen items.put("pk_subjcode",accountview.replace(".","")); }else{ String suptype = getSupplierType(supplierid); - if("DB01".equals(suptype)){ + if("GYSFL-202411-001".equals(suptype)){ items.put("pk_subjcode","22020105");//集团内 }else{ items.put("pk_subjcode","22020104");//收支项目编码 费用项目,例:660224-管理费用-服务费 会计科目(一个) @@ -474,7 +474,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen typeinfo = typecolls.get(j); if(typeinfo.getDynamicObject("suppliergroup") != null){ supTypeStr = typeinfo.getDynamicObject("suppliergroup").getString("number"); - if("DB01".equals(supTypeStr) || "DB02".equals(supTypeStr)){ + if("GYSFL-202411-001".equals(supTypeStr) || "GYSFL-202411-002".equals(supTypeStr)){ break; } } @@ -483,7 +483,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen } if(supTypeStr == null){ - supTypeStr = "DB02";//如果上述未找到对应分类,则默认算集团外 + supTypeStr = "GYSFL-202411-002";//如果上述未找到对应分类,则默认算集团外 } return supTypeStr; }