From af58b2564e329b3b347b0a28022ff0d9f43a3103 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Fri, 22 Nov 2024 18:12:45 +0800 Subject: [PATCH] =?UTF-8?q?1=20=E6=AD=A3=E5=BC=8F=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87=E5=90=8E=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=BC=80=E9=80=9A=E8=B4=A6=E5=8F=B7=E4=BA=BA=E5=91=98=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=202=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E4=B8=9A=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=203=20=E7=BB=84=E7=BB=87=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=83=A8=E9=97=A8=E8=B4=9F=E8=B4=A3=E4=BA=BA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/bamp/base/task/DobeDWaccountViewTask.java | 4 ++-- main/java/shkd/bamp/base/task/DobeDWorgTask.java | 13 +++++++++++++ .../repc/resm/opplugin/PushOASupplierOPPlugin.java | 9 ++------- main/java/shkd/repc/task/DobeDWprojectTask.java | 8 ++++++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/main/java/shkd/bamp/base/task/DobeDWaccountViewTask.java b/main/java/shkd/bamp/base/task/DobeDWaccountViewTask.java index 3616487..da33883 100644 --- a/main/java/shkd/bamp/base/task/DobeDWaccountViewTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWaccountViewTask.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.util.TypeUtils; import kd.bos.context.RequestContext; -import kd.bos.dataentity.OperateOption; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.exception.KDException; import kd.bos.id.ID; @@ -13,7 +12,6 @@ import kd.bos.logging.LogFactory; import kd.bos.orm.query.QFilter; import kd.bos.schedule.executor.AbstractTask; import kd.bos.servicehelper.BusinessDataServiceHelper; -import kd.bos.servicehelper.operation.OperationServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import shkd.utils.DobeDWUtils; @@ -210,6 +208,7 @@ public class DobeDWaccountViewTask extends AbstractTask implements Plugin { } private boolean getAcctSX(String mb,String acctsx){ + //科目属性 if("cash".equals(mb) && "现金科目".equals(acctsx)){ return true; }else if("bank".equals(mb) && "银行科目".equals(acctsx)){ @@ -221,6 +220,7 @@ public class DobeDWaccountViewTask extends AbstractTask implements Plugin { } private String getSY(String sytype){ + //损益类型 String typevalue = null; switch (sytype){ case "收入要素": diff --git a/main/java/shkd/bamp/base/task/DobeDWorgTask.java b/main/java/shkd/bamp/base/task/DobeDWorgTask.java index f0109e6..1d1ffc2 100644 --- a/main/java/shkd/bamp/base/task/DobeDWorgTask.java +++ b/main/java/shkd/bamp/base/task/DobeDWorgTask.java @@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.context.RequestContext; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.db.DB; +import kd.bos.db.DBRoute; import kd.bos.exception.KDException; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; @@ -93,6 +95,8 @@ public class DobeDWorgTask extends AbstractTask implements Plugin { String orgName = null; String orgID = null; String parentId = null; + String person_charge = null;//部门下的负责人的工号 + String updateSql = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); orgNumber = json_body.getString("org_code"); @@ -100,6 +104,7 @@ public class DobeDWorgTask extends AbstractTask implements Plugin { orgID = json_body.getString("org_id"); // String orgLevel = json_body.getString("org_level");//组织层级 parentId = json_body.getString("org_parentid"); + person_charge = json_body.getString("person_chargecode"); if(DobeDWUtils.isEmpty(orgID) || DobeDWUtils.isEmpty(orgNumber) || DobeDWUtils.isEmpty(orgName) || DobeDWUtils.isEmpty(parentId)){ //如果组织ID和组织编码 名称是空的,则跳过此记录 @@ -109,6 +114,13 @@ public class DobeDWorgTask extends AbstractTask implements Plugin { //根据组织ID查找系统现有数据是否存在,这种写法会抛异常,需要关注原因 currentOrg = QueryServiceHelper.queryOne(entityName,"id,number,name",new QFilter[]{new QFilter("fyzjorgid","=",orgID)}); if(currentOrg != null){ + //根据组织下的负责人id去人员分录表中更新负责人标记,先去除这个部门下人员的负责人标记,再更新 + if(!DobeDWUtils.isEmpty(person_charge)){ + updateSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?);"; + DB.update(DBRoute.of("sys"), updateSql, new Object[]{0,orgID}); + updateSql = "UPDATE t_SEC_UserPosition SET fisincharge=? WHERE fdptid in (select fid from t_org_org where fyzjorgid=?) and fid in (select fid from t_sec_user where fnumber=?);"; + DB.update(DBRoute.of("sys"), updateSql, new Object[]{1,orgID,person_charge}); + } //已存在,做更新 if(orgNumber.equals(currentOrg.getString("number")) && orgName.equals(currentOrg.getString("name"))){ //编号和名称都没有变化,无需更新 @@ -159,6 +171,7 @@ public class DobeDWorgTask extends AbstractTask implements Plugin { if (!param.isSuccess()) { log.info(String.format("组织新增异常:%s", param.getMsg())); } + //部门新增时,不用去更新部门下的负责人 } } } diff --git a/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java b/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java index 9d22fd4..2c540ed 100644 --- a/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java +++ b/main/java/shkd/repc/resm/opplugin/PushOASupplierOPPlugin.java @@ -4,25 +4,19 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; -import kd.bos.entity.operate.result.OperateErrorInfo; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; -import kd.bos.entity.validate.ErrorLevel; import kd.bos.logging.Log; import kd.bos.logging.LogFactory; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; -import kd.bos.util.HttpClientUtils; import kd.bos.util.StringUtils; -import shkd.repc.recon.opplugin.TestOPPlugin; import shkd.utils.OAUtils; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.HashMap; -import java.util.Map; import static shkd.utils.OAUtils.pushOASupplier; @@ -63,7 +57,8 @@ public class PushOASupplierOPPlugin extends AbstractOperationServicePlugIn { } //处理联系人分录中的开通账号的人员名称更新到主表字段上面 yxl 20241120 - handleContactPerson(supplier); + //文本字段的人员工作流中配置人员时选不到,得改成用户字段让经办人自己选择,如下代码注释 +// handleContactPerson(supplier); } } } diff --git a/main/java/shkd/repc/task/DobeDWprojectTask.java b/main/java/shkd/repc/task/DobeDWprojectTask.java index 4e60509..1b72004 100644 --- a/main/java/shkd/repc/task/DobeDWprojectTask.java +++ b/main/java/shkd/repc/task/DobeDWprojectTask.java @@ -87,10 +87,11 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // String fversionnum = null;//版本号 // String fisleaf = null;//是否叶子节点 String faddress = null;//项目地址 - String project_stage = null;//项目性质--二开字段,用于工作流发起判断 + String project_stage = null;//业务体系--二开字段,用于工作流发起判断(新拓 成熟) String forgid = null;//所属组织-行政组织 Date project_getdate = null;//项目获取时间 - String fdwid = null;//数仓项目id + String fdwid = null;//数仓项目id--二开字段,唯一标识 + String ywlx = null;//业务类型--二开字段,仅记录数仓数据 DynamicObject orginfo = null; DynamicObject projectinfo = null; // DynamicObject projectstageinfo = null; @@ -103,6 +104,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { forgid = json_body.getString("org_code"); project_getdate = json_body.getDate("project_getdate"); project_stage = json_body.getString("project_stage"); + ywlx = json_body.getString("project_stage_detail"); fdwid = json_body.getString("project_id"); if(DobeDWUtils.isEmpty(fbillno) || DobeDWUtils.isEmpty(fbillname) || DobeDWUtils.isEmpty(fdwid)){ log.info(String.format("项目接口入参为空异常:%s", json_body.toJSONString())); @@ -127,6 +129,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // } projectinfo.set("address", faddress); projectinfo.set("acquiredate", project_getdate); + projectinfo.set("qeug_ywlx", ywlx); // projectinfo.set("billstatus", "A");//单据状态 A保存 B已提交 C已审核 // projectinfo.set("showflag", true);//是否列表显示 // projectinfo.set("enable", 1);//是否启用 @@ -179,6 +182,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { }else if("成熟园区".equals(project_stage)){ projectinfo.set("qeug_combofield", "chengshu"); } + projectinfo.set("qeug_ywlx", ywlx); //保存数据:直接保存入库,不走操作校验 SaveServiceHelper.save(new DynamicObject[]{projectinfo}); }