diff --git a/com.actionsoft.apps.coe.pal/i18n/resource.xml b/com.actionsoft.apps.coe.pal/i18n/resource.xml
index f30ca956..7c59209f 100755
--- a/com.actionsoft.apps.coe.pal/i18n/resource.xml
+++ b/com.actionsoft.apps.coe.pal/i18n/resource.xml
@@ -97,9 +97,9 @@
-
-
+
-
+
-
diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar
index ed0c8c1d..db34aaf8 100644
Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ
diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java
index 5bbb188d..87e6542d 100755
--- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java
+++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/PALRepositoryQueryAPIManager.java
@@ -5,6 +5,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -229,14 +230,12 @@ public class PALRepositoryQueryAPIManager {
continue;
}
String className = obj.getClass().getName();
- className = className.substring(className.lastIndexOf(".") + 1, className.length());
+ className = className.substring(className.lastIndexOf(".") + 1);
queryResult(map1, set, key, obj, className);
}
if (set.size() > 1) {
return false;
- } else if (set.size() == 1 && set.contains(true))
- return true;
- return false;
+ } else return set.size() == 1 && set.contains(true);
}
private void queryResult(Map map1, Set set, String key, Object obj, String className) {
@@ -474,7 +473,7 @@ public class PALRepositoryQueryAPIManager {
while (it.hasNext()) {
PALRepositoryModel model = it.next();
if (model.getWsId().equals(wsId) && model.isUse()) {
- list.add((PALRepositoryModelImpl) model);
+ list.add(model);
}
}
return list;
@@ -492,7 +491,7 @@ public class PALRepositoryQueryAPIManager {
while (it.hasNext()) {
PALRepositoryModel model = it.next();
if (model.getWsId().equals(wsId) && model.getMethodCategory().equals(category)) {
- list.add((PALRepositoryModelImpl) model);
+ list.add(model);
}
}
return list;
@@ -518,7 +517,7 @@ public class PALRepositoryQueryAPIManager {
flag = false;
}
if (flag) {
- list.add((PALRepositoryModelImpl) model);
+ list.add(model);
}
}
}
@@ -1187,7 +1186,7 @@ public class PALRepositoryQueryAPIManager {
isPublished = true;
}
- StringBuilder removeIds = new StringBuilder("");
+ StringBuilder removeIds = new StringBuilder();
if (modelList.size() > 0) {
if (methods != null && !"".equals(methods)) {
List removeList = new ArrayList();
@@ -1289,7 +1288,7 @@ public class PALRepositoryQueryAPIManager {
for (String str: palMethodList) {
for (PALRepositoryModel model : list1) {
if (model.getMethodCategory().equals(str)) {
- list.add(new String(str));
+ list.add(str);
break;
}
}
@@ -1307,9 +1306,6 @@ public class PALRepositoryQueryAPIManager {
jsonObject.put("currId", category);
jsonObject.put("versionId", category);
String name = I18nRes.findValue(CoEConstant.APP_ID, category);
- if(name.equals("流程")){
- name="流程制度";
- }
jsonObject.put("name", name);
JSONObject icon = new JSONObject();
icon.put("icon", "");
@@ -1847,9 +1843,7 @@ public class PALRepositoryQueryAPIManager {
if (list != null && list.size() > 0) {
Set versionIds = new HashSet();
for (PALRepositoryModel model : list) {
- if (!versionIds.contains(model.getVersionId())) {
- versionIds.add(model.getVersionId());
- }
+ versionIds.add(model.getVersionId());
}
/*
@@ -2294,9 +2288,7 @@ public class PALRepositoryQueryAPIManager {
if (list != null && list.size() > 0) {
Set versionIds = new HashSet();
for (PALRepositoryModel model : list) {
- if (!versionIds.contains(model.getVersionId())) {
- versionIds.add(model.getVersionId());
- }
+ versionIds.add(model.getVersionId());
}
for (PALRepositoryModel model : list) {
boolean flag = true;
@@ -2343,7 +2335,7 @@ public class PALRepositoryQueryAPIManager {
String deptId = getDeptIdsInSql(_uc);
List list = dao.getSpecityLevelByDeptId(deptId, wsId, methodId, category, isUsed, isPublish, level);
if (list != null && list.size() > 0) {
- StringBuilder filePerms = new StringBuilder("");
+ StringBuilder filePerms = new StringBuilder();
for (PALRepositoryModel model : list) {
filePerms.append(model.getId()).append(",");
}
@@ -2414,7 +2406,7 @@ public class PALRepositoryQueryAPIManager {
* @return 图片url
*/
public String getPalRepositoryModelPicture(UserContext _uc, String uuid) {
- PALRepositoryModel cplm = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
+ PALRepositoryModel cplm = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
if (cplm == null) {
return null;
}
@@ -3090,7 +3082,7 @@ public class PALRepositoryQueryAPIManager {
}
if (HighSecurity.isON()) {
String secAdmin = HighSecurity.getSecModel().getSysAdmin();
- String arr[] = secAdmin.split(" ");
+ String[] arr = secAdmin.split(" ");
uid = arr[0];
}
String sid = new SSOUtil().registerClientSessionNoPassword(uid, "cn", "127.0.0.1", "pc");
@@ -3137,11 +3129,7 @@ public class PALRepositoryQueryAPIManager {
UtilFile utilFile = new UtilFile(path + "/" + cplm.getId() + ".small.png");
if (utilFile.exists()) {
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
- try {
- photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
+ photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
}
}
} else {// 获取执行平台图片
@@ -3171,11 +3159,7 @@ public class PALRepositoryQueryAPIManager {
UtilFile utilFile = new UtilFile(path + "/" + cplm.getId() + ".png");
if (utilFile.exists()) {
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
- try {
- photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
+ photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
}
}
} else {// 获取执行平台图片
@@ -3453,9 +3437,7 @@ public class PALRepositoryQueryAPIManager {
return false;
}
if (!CoeProcessLevelUtil.isBpmProcessEdit()) {
- if (model.isCorrelate()) {
- return true;
- }
+ return model.isCorrelate();
}
return false;
}
@@ -3477,11 +3459,7 @@ public class PALRepositoryQueryAPIManager {
if (model == null) {
return true;
}
- if (model.isCorrelate() && model.getCorrelateType() == 1 && "show".equals(model.getExt1())) {
- return true;
- } else {
- return false;
- }
+ return model.isCorrelate() && model.getCorrelateType() == 1 && "show".equals(model.getExt1());
}
private static class Inner {
@@ -3864,7 +3842,7 @@ public class PALRepositoryQueryAPIManager {
List result = new ArrayList<>();
// 获取属性的关联类型(relationType)
Map relationTypeMap = new HashMap<>();
- PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(palId);
+ PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(palId);
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelById(m.getMethodId());
if (palMethodModel != null) {
List attributes = palMethodModel.getAttributes();
@@ -4131,10 +4109,7 @@ public class PALRepositoryQueryAPIManager {
public boolean checkFileSecurity(PALRepositoryModel model){
PALMethodModel methodModel = PALMethodCache.getPALMethodModelById(model.getMethodId());
- if (null != methodModel && !methodModel.isFolder() && model.getSecurityLevel() == -1){
- return true;
- }
- return false;
+ return null != methodModel && !methodModel.isFolder() && model.getSecurityLevel() == -1;
}
/**