From 04429b95d31dcdc28d4113bdbc7b5fcc433b89d6 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Thu, 5 Dec 2024 17:09:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=94=B9=E6=88=90=E6=93=8D=E4=BD=9C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=A2=9E=E5=8A=A0=E5=90=8C=E6=AD=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B9=E7=9B=AEF7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/shkd/repc/task/DobeDWprojectTask.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/main/java/shkd/repc/task/DobeDWprojectTask.java b/main/java/shkd/repc/task/DobeDWprojectTask.java index 8608c77..2389095 100644 --- a/main/java/shkd/repc/task/DobeDWprojectTask.java +++ b/main/java/shkd/repc/task/DobeDWprojectTask.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.context.RequestContext; +import kd.bos.dataentity.OperateOption; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.db.DB; import kd.bos.db.DBRoute; @@ -14,6 +15,7 @@ import kd.bos.orm.query.QFilter; import kd.bos.schedule.executor.AbstractTask; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; +import kd.bos.servicehelper.operation.OperationServiceHelper; import kd.bos.servicehelper.operation.SaveServiceHelper; import kd.sdk.plugin.Plugin; import okhttp3.OkHttpClient; @@ -29,6 +31,7 @@ import java.util.Map; * 后台任务插件 */ public class DobeDWprojectTask extends AbstractTask implements Plugin { + //项目f7的基础资料是单独的表 t_repmd_project private static final String entityName = "repmd_projectbill";//表名 t_repmd_projectbill private static Log log = LogFactory.getLog(DobeDWprojectTask.class); private static final String dw_menthod = "mdm_projectinfo"; @@ -97,6 +100,7 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { DynamicObject orginfo = null; DynamicObject projectinfo = null; String updateSql = "UPDATE t_org_org SET fk_qeug_combofield=? WHERE fnumber=?;"; + String updateF7Sql = "UPDATE t_repmd_project SET fk_qeug_combofield=? WHERE fnumber=?;"; // DynamicObject projectstageinfo = null; for (int i = 0; i < detailsJson.size(); i++) { json_body = detailsJson.getJSONObject(i); @@ -119,7 +123,12 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // projectstageinfo = QueryServiceHelper.queryOne("repmd_projectstages","id,number",new QFilter[]{new QFilter("number","=",fprojectstageid)}); if(projectinfo != null){ if("C".equals(projectinfo.getString("billstatus"))){ - //如果项目已审核,则不进行修改 + //如果项目已审核,则不进行项目建立的数据修改;只更新项目F7的业务体系字段 + if("新拓园区".equals(project_stage)){ + DB.update(DBRoute.of("scm"), updateF7Sql, new Object[]{"XTYQ",fbillno}); + }else if("成熟园区".equals(project_stage)){ + DB.update(DBRoute.of("scm"), updateF7Sql, new Object[]{"CSYQ",fbillno}); + } continue; } //已存在,做更新 名称 阶段 版本号等信息;组织、编号、是否叶子节点不能更新;需要前台操作 @@ -146,7 +155,9 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { // projectinfo.set("billno", fbillno); // projectinfo.set("org", ); // projectinfo.set("isleaf", fisleaf); - SaveServiceHelper.update(projectinfo); + //原保存逻辑直接存入数据库,现在改成调用保存操作 +// SaveServiceHelper.update(projectinfo); + OperationServiceHelper.executeOperate("save",entityName,new DynamicObject[]{projectinfo}, OperateOption.create()); }else{ //不存在,做新增 根据实体名称创建动态对象 projectinfo = BusinessDataServiceHelper.newDynamicObject(entityName); @@ -187,7 +198,8 @@ public class DobeDWprojectTask extends AbstractTask implements Plugin { } projectinfo.set("qeug_ywlx", ywlx); //保存数据:直接保存入库,不走操作校验 - SaveServiceHelper.save(new DynamicObject[]{projectinfo}); +// SaveServiceHelper.save(new DynamicObject[]{projectinfo}); + OperationServiceHelper.executeOperate("save",entityName,new DynamicObject[]{projectinfo}, OperateOption.create()); } //获得组织对象后,将本项目的体系字段更新到组织的体系上面 if(!DobeDWUtils.isEmpty(project_stage) && !DobeDWUtils.isEmpty(forgid)){