架构插入数据修复

This commit is contained in:
zhal 2022-09-19 09:23:48 +08:00
parent ecab246b21
commit 20b80bf135
3 changed files with 53 additions and 3 deletions

View File

@ -16,6 +16,7 @@ import com.actionsoft.apps.coe.pal.pal.ws.constant.CoeWsConstant;
import com.actionsoft.apps.coe.pal.system.util.StringUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.coe.pal.util.ShapeUtils;
import com.actionsoft.apps.coe.pal.util.SubUtil;
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
import com.actionsoft.apps.resource.AppContext;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
@ -8244,11 +8245,26 @@ public class CoeProcessLevelWeb extends ActionWeb {
//设置三级架构如果没有填充值为/
for(int i=1;i<=3;i++){
String str2;
String repid=((JSONObject) repositoryPathData.get(i)).getString("id");
PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(repid);
String methodId=parentModel.getMethodId();
String str2 = "";
if(i<=repositoryPathData.size()-1){
String name1=((JSONObject) repositoryPathData.get(i)).getString("name");
String str1=name1.substring(0, name1.lastIndexOf(".")+1);
str2=name1.substring(str1.length()+1, name1.length());
if(UtilString.isNotEmpty(str1)){
String end=name1.substring(name1.lastIndexOf(".")+1);
int len=Integer.valueOf(SubUtil.getQuantity(end).length());
str2=name1.substring(str1.length()+len, name1.length());
}else{
str2=name1;
}
}else{
str2="/";
}
@ -10469,7 +10485,14 @@ public String deleteReply(String replyid, String messageid) {
if(i<=pathArray.size()-1){
String name1=((JSONObject) pathArray.get(i)).getString("name");
String str1=name1.substring(0, name1.lastIndexOf(".")+1);
L=name1.substring(str1.length()+1, name1.length());
//L=name1.substring(str1.length()+1, name1.length());
if(UtilString.isNotEmpty(str1)) {
String end = name1.substring(name1.lastIndexOf(".") + 1);
int len = Integer.valueOf(SubUtil.getQuantity(end).length());
L = name1.substring(str1.length() + len, name1.length());
}else{
L=name1;
}
}else{
L="/";
}

View File

@ -0,0 +1,27 @@
package com.actionsoft.apps.coe.pal.util;
public class SubUtil {
/**
* 截取字符串前面的正整数"22天""22","18个人"得到"18".
* @return
*/
public static String getQuantity(String regular){
int index = 0;
for (int i = 0; i < regular.length(); i++) {
char c = regular.charAt(i);
if (Character.isDigit(c)) {
if (i == regular.length() - 1) {
index = i + 1;
} else {
index = i;
}
continue;
} else {
index = i;
break;
}
}
return regular.substring(0, index);
}
}