移动文件代码修改

This commit is contained in:
Mr-wang 2023-10-27 22:42:45 +08:00
parent 3a67cfc45b
commit aeae3d499e

View File

@ -26,6 +26,8 @@ import com.alibaba.fastjson.JSONObject;
import bsh.util.Util; 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); System.err.println("开始移动文件=======>" + plname);
@ -117,109 +120,35 @@ public class CreateProcessController {
// //
System.err.println("当前文件架构名=======>" + prName); System.err.println("当前文件架构名=======>" + prName);
if (error.trim().equals(prName.trim())) { 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);
ResponseObject responseObject = moveRepository(userContext, sqlerror, maprightId);
// 设置三级架构名称 boolean ok = responseObject.isOk();
String sql3 = "SELECT PLPARENTID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + maprightId if (ok){
+ "'"; ro.put("result", "ok");
String prd3 = DBSql.getString(sql3); String result = "文件从【" + error + "】移动到【" + right + "】成功!";
String sqlp3 = "SELECT PLNAME,ID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + prd3 + "'"; /*
RowMap map3 = DBSql.getMap(sqlp3); * String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT = '" + result
if (map3!=null) { * + "',PAID = '" + uuid + "' WHERE PALNAME = '" + plNameL + "'";
String uuid3 = map3.getString("ID"); * DBSql.update(updateSql);
String plName3 = map3.getString("PLNAME"); */
String name4 = plName3.substring(plName3.lastIndexOf(".") + 2).trim(); BO bo = new BO();
bo.set("PALNAME", plName);
// 设置三级架构名称 bo.set("ERRORFRAMEWORK", error);
propertyDao.updatePropertyByPropertyId(uuid, "Process_Architecture_L3", name4); bo.set("CORRECTFRAMEWORK", right);
bo.set("PAID", uuid);
// 设置二级架构名称 bo.set("RESULT", result);
String sql2 = "SELECT PLPARENTID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + uuid3 int createDataBO = SDK.getBOAPI().createDataBO("BO_EU_PAL_FRAMWORK_SUCCESS", bo, UserContext.fromUID("admin"));
+ "'"; if(createDataBO>0) {
String prd2 = DBSql.getString(sql2); String sqly = "DELETE FROM BO_EU_PAL_FRAMEWORK_TOOL WHERE PALNAME = '"+plNameL+"'";
String sqlp2 = "SELECT PLNAME,ID FROM App_Act_Coe_Pal_Repository WHERE ID ='" + prd2 + "'"; DBSql.update(sqly);
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+"'");
} }
} }
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 { } else {
ro.put("result", "error"); ro.put("result", "error");
String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT ='文件移动失败,原架构和文件属性里的架构不匹配请检查!' WHERE PALNAME = '" String updateSql = "UPDATE BO_EU_PAL_FRAMEWORK_TOOL SET RESULT ='文件移动失败,原架构和文件属性里的架构不匹配请检查!' WHERE PALNAME = '"
+ plNameL + "'"; + plNameL + "'";
DBSql.update(updateSql); DBSql.update(updateSql);
} }
}else { }else {
ro.put("result", "error"); ro.put("result", "error");