移动文件代码修改
This commit is contained in:
parent
3a67cfc45b
commit
aeae3d499e
@ -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;
|
||||
|
||||
/*
|
||||
* 新建流程
|
||||
*/
|
||||
@ -76,6 +78,7 @@ public class CreateProcessController {
|
||||
* }
|
||||
*/
|
||||
|
||||
UserContext userContext = UserContext.fromSessionId(sid);
|
||||
|
||||
|
||||
System.err.println("开始移动文件=======>" + plname);
|
||||
@ -117,83 +120,10 @@ 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 + "】成功!";
|
||||
/*
|
||||
@ -212,14 +142,13 @@ public class CreateProcessController {
|
||||
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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user