From aeae3d499ec109cf41c7da1a120af6d30e0a8813 Mon Sep 17 00:00:00 2001 From: Mr-wang Date: Fri, 27 Oct 2023 22:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=96=87=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CreateProcessController.java | 121 ++++-------------- 1 file changed, 25 insertions(+), 96 deletions(-) diff --git a/com.awspaas.user.apps.app20221008163300/src/com/awspaas/user/apps/app/controller/CreateProcessController.java b/com.awspaas.user.apps.app20221008163300/src/com/awspaas/user/apps/app/controller/CreateProcessController.java index ff169aa0..090e8dc0 100644 --- a/com.awspaas.user.apps.app20221008163300/src/com/awspaas/user/apps/app/controller/CreateProcessController.java +++ b/com.awspaas.user.apps.app20221008163300/src/com/awspaas/user/apps/app/controller/CreateProcessController.java @@ -26,6 +26,8 @@ import com.alibaba.fastjson.JSONObject; import bsh.util.Util; +import static com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil.moveRepository; + /* * 新建流程 */ @@ -75,7 +77,8 @@ public class CreateProcessController { * * } */ - + + UserContext userContext = UserContext.fromSessionId(sid); System.err.println("开始移动文件=======>" + plname); @@ -117,109 +120,35 @@ public class CreateProcessController { // System.err.println("当前文件架构名=======>" + prName); if (error.trim().equals(prName.trim())) { - String update = "UPDATE App_Act_Coe_Pal_Repository SET PLPARENTID = '" + maprightId - + "' WHERE ID ='" + uuid + "'"; - int update2 = DBSql.update(update); - PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao(); - - String name1 = right.substring(right.lastIndexOf(".") + 2).trim(); - if(UtilString.isNotEmpty(name1)) { - //设置四级架构名称 - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L4", name1); - - // 设置三级架构名称 - String sql3 = "SELECT PLPARENTID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + maprightId - + "'"; - String prd3 = DBSql.getString(sql3); - String sqlp3 = "SELECT PLNAME,ID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + prd3 + "'"; - RowMap map3 = DBSql.getMap(sqlp3); - if (map3!=null) { - String uuid3 = map3.getString("ID"); - String plName3 = map3.getString("PLNAME"); - String name4 = plName3.substring(plName3.lastIndexOf(".") + 2).trim(); - - // 设置三级架构名称 - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L3", name4); - - // 设置二级架构名称 - String sql2 = "SELECT PLPARENTID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + uuid3 - + "'"; - String prd2 = DBSql.getString(sql2); - String sqlp2 = "SELECT PLNAME,ID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + prd2 + "'"; - RowMap map2 = DBSql.getMap(sqlp2); - if (map2 != null) { - String uuid2 = map2.getString("ID"); - String plName2 = map2.getString("PLNAME"); - String name2 = plName2.substring(plName2.lastIndexOf(".") + 2).trim(); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L2", name2); - - // 设置一级架构名称 - String sql1 = "SELECT PLPARENTID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + uuid2 + "'"; - String prd1 = DBSql.getString(sql1); - String sqlp1 = "SELECT PLNAME,ID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + prd1 + "'"; - RowMap map1 = DBSql.getMap(sqlp1); - - if (map1 != null) { - String uuid1 = map1.getString("ID"); - String plName1 = map1.getString("PLNAME"); - String name3 = plName1.substring(plName1.lastIndexOf(".") + 2).trim(); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L1", name3); - //DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET PLLEVEL = '5' WHERE ID = '"+uuid1+"'"); - - } else { - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L4", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L3", name1); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L1", name2); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L2", name4); - //DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET PLLEVEL = '4' WHERE ID = '"+uuid2+"'"); - } - - } else { - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L4", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L2", name1); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L3", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L1", name4); - //DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET PLLEVEL = '3' WHERE ID = '"+uuid3+"'"); - - } - }else { - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L4", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L2", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L3", "/"); - propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L1", name1); - //DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET PLLEVEL = '1' WHERE ID = '"+uuid+"'"); + ResponseObject responseObject = moveRepository(userContext, sqlerror, maprightId); + boolean ok = responseObject.isOk(); + if (ok){ + ro.put("result", "ok"); + String result = "文件从【" + error + "】移动到【" + right + "】成功!"; + /* + * String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT = '" + result + * + "',PAID = '" + uuid + "' WHERE PALNAME = '" + plNameL + "'"; + * DBSql.update(updateSql); + */ + BO bo = new BO(); + bo.set("PALNAME", plName); + bo.set("ERRORFRAMEWORK", error); + bo.set("CORRECTFRAMEWORK", right); + bo.set("PAID", uuid); + bo.set("RESULT", result); + int createDataBO = SDK.getBOAPI().createDataBO("BO_EU_PAL_FRAMWORK_SUCCESS", bo, UserContext.fromUID("admin")); + if(createDataBO>0) { + String sqly = "DELETE FROM BO_EU_PAL_FRAMEWORK_TOOL WHERE PALNAME = '"+plNameL+"'"; + DBSql.update(sqly); } } - - - - ro.put("result", "ok"); - String result = "文件从【" + error + "】移动到【" + right + "】成功!"; - /* - * String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT = '" + result - * + "',PAID = '" + uuid + "' WHERE PALNAME = '" + plNameL + "'"; - * DBSql.update(updateSql); - */ - BO bo = new BO(); - bo.set("PALNAME", plName); - bo.set("ERRORFRAMEWORK", error); - bo.set("CORRECTFRAMEWORK", right); - bo.set("PAID", uuid); - bo.set("RESULT", result); - int createDataBO = SDK.getBOAPI().createDataBO("BO_EU_PAL_FRAMWORK_SUCCESS", bo, UserContext.fromUID("admin")); - if(createDataBO>0) { - String sqly = "DELETE FROM BO_EU_PAL_FRAMEWORK_TOOL WHERE PALNAME = '"+plNameL+"'"; - DBSql.update(sqly); - } } else { ro.put("result", "error"); String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT ='文件移动失败,原架构和文件属性里的架构不匹配请检查!' WHERE PALNAME = '" + plNameL + "'"; DBSql.update(updateSql); - - - + } }else { ro.put("result", "error");