版本号代码,统一调用PAL中versionUtil方法

This commit is contained in:
yujh_java 2025-06-19 09:48:29 +08:00
parent c9bbdcff22
commit fcb48378ca
10 changed files with 39 additions and 172 deletions

View File

@ -33,6 +33,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.impl.PALRepositoryModelI
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
@ -160,18 +161,8 @@ public class Report1Gener {
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel repositoryPropertyModel : repositoryPropertyList) {
if ("P_versions".equals(repositoryPropertyModel.getPropertyId())){
String plvers = model.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
extendAttr.put(repositoryPropertyModel.getPropertyId(), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
extendAttr.put(repositoryPropertyModel.getPropertyId(), VersionUtil.getVersionStrV(model.getVersion()));
}else {
extendAttr.put(repositoryPropertyModel.getPropertyId(), repositoryPropertyModel.getPropertyValue());
}
@ -993,18 +984,8 @@ public class Report1Gener {
// 版本P_versions
String attr = "P_versions";
String val = "";
String plvers = model.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);
obj.put(attr, "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr, VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";

View File

@ -17,6 +17,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.bpms.org.cache.UserCache;
import com.actionsoft.bpms.server.DispatcherRequest;
@ -102,18 +103,8 @@ public class PrReportComment {
dataMap.put("pl_" + propertyObj.getString("key"), OutputWordUtil.specialCharTransfer(propertyObj.getString("value")));
}
}else if("P_versions".equals(propertyObj.getString("key"))) {
//版本取系统版本号
String plvers = repositoryModel.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
dataMap.put("pl_" + propertyObj.getString("key"), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
dataMap.put("pl_" + propertyObj.getString("key"), VersionUtil.getVersionStrV(repositoryModel.getVersion()));
}else {
dataMap.put("pl_" + propertyObj.getString("key"), value);
@ -299,18 +290,8 @@ public class PrReportComment {
dataMap.put("pl_" + propertyObj.getString("key"), OutputWordUtil.specialCharTransfer(propertyObj.getString("value")));
}
}else if("P_versions".equals(propertyObj.getString("key"))) {
//版本取系统版本号
String plvers = repositoryModel.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
dataMap.put("pl_" + propertyObj.getString("key"), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
dataMap.put("pl_" + propertyObj.getString("key"), VersionUtil.getVersionStrV(repositoryModel.getVersion()));
}else if("application".equals(propertyObj.getString("key"))){
dataMap.put("pl_" + propertyObj.getString("key"), value.replace("\n", WRAPSTRING));
}else{

View File

@ -18,6 +18,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyMod
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.util.HttpPostUtil;
import com.actionsoft.apps.coe.pal.util.WPS4Util;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
@ -2639,17 +2640,8 @@ public class OutputWordUtil {
// 版本P_versions制度用的是versions
//String attr = "versions";
String val = "";
String plvers = model.getVersion() + "";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);
obj.put(attr, "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr, VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";
val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);

View File

@ -22,6 +22,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyMod
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
@ -147,17 +148,8 @@ public class Report1Gener {
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel repositoryPropertyModel : repositoryPropertyList) {
if ("P_versions".equals(repositoryPropertyModel.getPropertyId())){
String plvers = model.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
extendAttr.put(repositoryPropertyModel.getPropertyId(), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
extendAttr.put(repositoryPropertyModel.getPropertyId(), VersionUtil.getVersionStrV(model.getVersion()));
}else {
extendAttr.put(repositoryPropertyModel.getPropertyId(), repositoryPropertyModel.getPropertyValue());
}
@ -634,18 +626,8 @@ public class Report1Gener {
// 版本P_versions
String attr = "P_versions";
String val = "";
String plvers = model.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);
obj.put(attr, "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr, VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";
val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);

View File

@ -14,6 +14,7 @@ import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
import com.actionsoft.apps.coe.pal.pal.repository.PALRepositoryQueryAPIManager;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.bpms.org.cache.UserCache;
import com.actionsoft.bpms.util.Base64;
import com.actionsoft.bpms.util.UtilDate;
@ -87,17 +88,8 @@ public class PrReportComment {
String value = OutputWordUtil.specialCharTransfer(propertyObj.getString("value"));
//版本取系统版本号
if("P_versions".equals(propertyObj.getString("key"))) {
String plvers = repositoryModel.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
dataMap.put("pl_" + propertyObj.getString("key"), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
dataMap.put("pl_" + propertyObj.getString("key"), VersionUtil.getVersionStrV(repositoryModel.getVersion()));
}else if("form_Scope_application".equals(propertyObj.getString("key"))){
dataMap.put("pl_" + propertyObj.getString("key"), value.replace("\n", WRAPSTRING));
}else{

View File

@ -13,6 +13,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyMod
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.bpms.bo.engine.BO;
@ -236,17 +237,8 @@ public class InstitutionalTextWeb extends ActionWeb {
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel repositoryPropertyModel : repositoryPropertyList) {
if ("P_versions".equals(repositoryPropertyModel.getPropertyId())) {
String plvers = model.getVersion() + "";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
extendAttr.put(repositoryPropertyModel.getPropertyId(), "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
extendAttr.put(repositoryPropertyModel.getPropertyId(), VersionUtil.getVersionStrV(model.getVersion()));
} else {
extendAttr.put(repositoryPropertyModel.getPropertyId(), repositoryPropertyModel.getPropertyValue());
}
@ -401,17 +393,8 @@ public class InstitutionalTextWeb extends ActionWeb {
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel repositoryPropertyModel : repositoryPropertyList) {
if ("P_versions".equals(repositoryPropertyModel.getPropertyId())) {
String plvers = model.getVersion() + "";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
extendAttr.put(repositoryPropertyModel.getPropertyId(), "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
extendAttr.put(repositoryPropertyModel.getPropertyId(), VersionUtil.getVersionStrV(model.getVersion()));
} else {
extendAttr.put(repositoryPropertyModel.getPropertyId(), repositoryPropertyModel.getPropertyValue());
}

View File

@ -14,6 +14,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import org.apache.poi.hslf.usermodel.HSLFPictureData;
import org.apache.poi.hslf.usermodel.HSLFPictureShape;
import org.apache.poi.hslf.usermodel.HSLFShape;
@ -866,17 +867,8 @@ public class UpFileExcelAndPptController {
// 版本P_versions
String attr = "P_versions";
String val = "";
String plvers = String.valueOf(model.getVersion());
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.charAt(0) + "." + plvers.substring(plvers.length() - 1);
} else {
plver = plvers.charAt(0) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", "");
obj.put(attr, "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr, VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";

View File

@ -15,6 +15,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyMod
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import com.actionsoft.apps.coe.pal.util.HighSecurityUtil;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
@ -164,17 +165,8 @@ public class Report1Gener {
if (repositoryPropertyList != null && repositoryPropertyList.size() > 0) {
for (PALRepositoryPropertyModel repositoryPropertyModel : repositoryPropertyList) {
if ("P_versions".equals(repositoryPropertyModel.getPropertyId())) {
String plvers = model.getVersion() + "";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
extendAttr.put(repositoryPropertyModel.getPropertyId(), "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
extendAttr.put(repositoryPropertyModel.getPropertyId(), VersionUtil.getVersionStrV(model.getVersion()));
} else {
extendAttr.put(repositoryPropertyModel.getPropertyId(), repositoryPropertyModel.getPropertyValue());
}
@ -373,18 +365,8 @@ public class Report1Gener {
// 版本P_versions制度用的是versions
String attr = "versions";
String val = "";
String plvers = model.getVersion() + "";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);
obj.put(attr, "V" + plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr,VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";
val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", WRAPSTRING);

View File

@ -30,6 +30,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryAttributeMo
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryPropertyModel;
import com.actionsoft.apps.coe.pal.pal.repository.util.CoeProcessLevelUtil;
import com.actionsoft.apps.coe.pal.pal.ws.web.VersionUtil;
import com.actionsoft.apps.coe.pal.system.property.CoePropertyUtil;
import org.apache.commons.lang.StringUtils;
@ -106,17 +107,8 @@ public class PrReportComment {
String value = OutputWordUtil.specialCharTransfer(propertyObj.getString("value"));
//版本取系统版本号
if("versions".equals(propertyObj.getString("key"))) {
String plvers = repositoryModel.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
//plver = plvers.substring(0, 1) + "." + plvers.substring(plvers.length() - 1, plvers.length());
plver = plvers.substring(0,plvers.indexOf(".")) + "." + plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
dataMap.put("pl_" + propertyObj.getString("key"), "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
dataMap.put("pl_" + propertyObj.getString("key"), VersionUtil.getVersionStrV(repositoryModel.getVersion()));
}else if("application".equals(propertyObj.getString("key"))) {
dataMap.put("pl_application", value.replace("\n", WRAPSTRING));
}else {

View File

@ -849,18 +849,8 @@ public class UpdatePptxAndExcelAslp implements ASLP {
// 版本P_versions
String attr = "P_versions";
String val = "";
String plvers = model.getVersion()+"";
String plver = "";
if (!"".equals(plvers)) {
if (plvers.length() > 1) {
plver = plvers.substring(0, 1) + "."
+ plvers.substring(plvers.length() - 1, plvers.length());
} else {
plver = plvers.substring(0, 1) + ".0";
}
}
//val = specialCharTransfer(map.containsKey(attr) ? (map.get(attr).getString("text")) : "").replace("\n", "");
obj.put(attr, "V"+plver);
//yujh 修改统一使用版本工具类获取版本号
obj.put(attr, VersionUtil.getVersionStrV(model.getVersion()));
// 拟制/修订单位Issuing_department
attr = "Issuing_department";