From 747bbb47b1451683157c606fb1443ff33f241bf6 Mon Sep 17 00:00:00 2001 From: yujh Date: Wed, 16 Oct 2024 14:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=A8=A1=E7=89=88=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/output/template/web/TemplateWeb.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java b/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java index 43447857..4843e687 100644 --- a/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java +++ b/com.awspaas.user.apps.output.template/src/com/awspaas/user/apps/output/template/web/TemplateWeb.java @@ -63,10 +63,17 @@ public class TemplateWeb extends ActionWeb { ResponseObject ro =ResponseObject.newOkResponse(); UserContext me = super.getContext(); ProcessInstance processInstance = SDK.getProcessAPI().createProcessInstance(TemplateConstant.mapping_dw_id,me.getUID(), "新增"); - BO bo =new BO(); - bo.set("TPLID",tplId); - bo.set("PALID",palId); - SDK.getBOAPI().create(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo, processInstance, me); + BO bo = SDK.getBOAPI().query(TemplateConstant.BO_EU_TPL_PAL_MAPPING).addQuery("CREATEUSER=", me.getUID()).addQuery("PALID=", palId).orderByCreated().desc().detail(); + if(null!=bo){//存在则走更新,不存在则走修改 + bo.set("TPLID",tplId); + bo.set("PALID",palId); + SDK.getBOAPI().update(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo); + }else{ + bo =new BO(); + bo.set("TPLID",tplId); + bo.set("PALID",palId); + SDK.getBOAPI().create(TemplateConstant.BO_EU_TPL_PAL_MAPPING, bo, processInstance, me); + } return ro.toString(); } }