修改升版角色问题

This commit is contained in:
zhal 2023-10-11 14:51:25 +08:00
parent ca72061bb4
commit 4922064aa6
6 changed files with 20 additions and 105 deletions

View File

@ -1150,7 +1150,6 @@ public class OutputWordUtil {
}
try {
System.out.println("生成附件路径是=================="+outFile.getPath());
doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013);
} catch (Exception e) {
e.printStackTrace();

View File

@ -221,7 +221,6 @@ public class PALRepositoryRemoveInfo extends DaoObject<PALRepositoryRemoveInfoMo
sql.append(" AND r.PLNAME like " + namelike);
// param.put("PLNAME", namelike);
}
System.out.println("sql============"+sql);
return DBSql.getInt(sql.toString(), "totalCount", param);
}
@ -680,7 +679,6 @@ public class PALRepositoryRemoveInfo extends DaoObject<PALRepositoryRemoveInfoMo
// 发布知识
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
System.out.println("知识发布============" + ro);
}

View File

@ -875,12 +875,15 @@ public class DesignerRelationShapeWeb extends ActionWeb {
macroLibraries.put("treeData", jsonArr_new.toString());
}else if(attrId.equals("role")){
if (objects != null) {
for (int i = 0; i < objects.size(); i++) {
String id = objects.getJSONObject(i).getString("id");
String url = objects.getJSONObject(i).getString("url");
if (UtilString.isNotEmpty(url)) {
String titles = objects.getJSONObject(i).getString("title");
System.out.println("titles============"+titles);
if (titles.equals("角色模型")) {
objects.getJSONObject(i).put("nocheck", true);
jsonArr_new.add(objects.getJSONObject(i));
@ -1225,6 +1228,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
// }
//
// }
System.out.println("jsonArray========="+jsonArray);
return jsonArray.toString();
}
@ -1343,6 +1347,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
} else {
list = PALRepositoryQueryAPIManager.getInstance().getUsedPalRepositoryTreeDataByPid(_uc, wsId, pid, teamId);
}
System.out.println("list=========="+list);
JSONArray result = new JSONArray();
for (int i = 0; i < list.size(); i++) {
@ -1350,6 +1355,7 @@ public class DesignerRelationShapeWeb extends ActionWeb {
node.put("url", "./jd?sid=" + super.getContext().getSessionId() + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_info&ruuid=" + node.getString("id") + "&uuid=" + node.getString("id"));
result.add(node);
}
System.out.println("result========"+result);
return result.toString();
}
@ -2795,8 +2801,6 @@ public class DesignerRelationShapeWeb extends ActionWeb {
map.put("treeData", treeData);
/******************************自定义排序******************************************************/
System.out.println("depjsonArray==================="+depjsonArray);
if (depjsonArray.size() > 0 ) {
boolean containsJSONObject = true;
for(int i=0;i<depjsonArray.size();i++){
@ -4229,7 +4233,6 @@ public class DesignerRelationShapeWeb extends ActionWeb {
String sql = "SELECT COUNT(1) FROM APP_ACT_COE_PAL_REPOSITORY WHERE CREATEUSER=? AND PLMETHODID=? ";
String uid = _uc.getUID();
int anInt = DBSql.getInt(sql, new Object[]{uid, methodId});
System.out.println("是否第一次新建模型>>>>>" + anInt);
//只有一条记录的时候判断是否第一次创建对应模型
if (type.equals("0")) {
if (anInt == 1) {
@ -4237,7 +4240,6 @@ public class DesignerRelationShapeWeb extends ActionWeb {
String getID = DBSql.getString(getCreateDateSql);
String isfirstSql = "SELECT ISFIRSTCREATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + getID + "'";
String isfirst = DBSql.getString(isfirstSql);
System.out.println("isfirst>>>>>>>>" + isfirst);
if (isfirst == null || isfirst == "") {
DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET ISFIRSTCREATE = 1 WHERE ID = '" + getID + "'");
ro.put("isFirst", true);

View File

@ -4215,8 +4215,15 @@ public class CoeDesignerWeb extends ActionWeb {
//1.创建角色模型
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(oldUUID);
if (oldModelList.size() > 0 && oldModelList.get(0).getAttrId().equals("role")) {
CreateRelevanceRoleModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId);
if (oldModelList.size() > 0) {
for (DesignerShapeRelationModel oldModel : oldModelList) {
if (oldModel.getAttrId().equals("role")) {
CreateRelevanceRoleModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId,oldModel.getRelationFileId());
break;
}
}
}
//创建绩效关联关系
@ -4246,13 +4253,14 @@ public class CoeDesignerWeb extends ActionWeb {
* @param isLargeIteration
* @param olduuid
*/
public String CreateRelevanceRoleModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map<String, String> mapNewUUID, Double tempVer, String teamId) {
public String CreateRelevanceRoleModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map<String, String> mapNewUUID, Double tempVer, String teamId,String relationFileId) {
ResponseObject ro = null;
DesignerShapeRelationDao dao = new DesignerShapeRelationDao();
List<DesignerShapeRelationModel> oldModelList = dao.getModelListByFileId(olduuid);
//1.创建角色模型
String relationFileId = oldModelList.get(0).getRelationFileId();
//String relationFileId = oldModelList.get(0).getRelationFileId();
String srcPath = "";// 源文件路径
String targetPath = "";// 目标文件路径
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
@ -4335,98 +4343,6 @@ public class CoeDesignerWeb extends ActionWeb {
ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage());
}
/*if(oldModelList.size()>0){
for (DesignerShapeRelationModel oldModel : oldModelList) {
PALRepositoryModel model = PALRepositoryCache.getCache().get(newModel.getId());
//如果关联角色图则同步复制角色图关联关系
if(oldModel.getAttrId().equals("role")){
String methodIds="org.role";
if (mapNewUUID.containsKey(oldModel.getShapeId())) {
String srcPath = "";// 源文件路径
String targetPath = "";// 目标文件路径
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(oldModel.getRelationFileId());
final String oldUUID = lastplModel.getId();
lastplModel.setId(UUIDGener.getUUID());
final String newUUID = lastplModel.getId();
//大小版本号处理
tempVer = isLargeIteration ? coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId()) : coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId(),lastplModel.getVersion());
lastplModel.setHistoryMaxVersion("0");
lastplModel.setVersion(VersionUtil.increaseVersionNo(tempVer,isLargeIteration));
lastplModel.setUse(false);
srcPath = lastplModel.getFilePath();
if (!"".equals(srcPath) && srcPath != null) {
targetPath = srcPath.replace(oldModel.getRelationFileId(), lastplModel.getId());
}
lastplModel.setFilePath(targetPath);
lastplModel.setPublish(false);
lastplModel.setStop(false);
lastplModel.setApproval(false);
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
String uid = super.getContext().getUID();
lastplModel.setCreateUser(uid);
lastplModel.setCreateDate(nowTime);
lastplModel.setModifyUser(uid);
lastplModel.setModifyDate(nowTime);
List data=new ArrayList<>();
data.add(0,"org.role");
data.add(1,newModel.getId());
lastplModel.setExt2(data.toString());
//密级
lastplModel.setSecurityLevel(-1);
int store = 0;
try {
store = CoeProcessLevelDaoFacotory.createCoeProcessLevel().insert(lastplModel);
if (store == 1) {
// 修改设计器文件
CoeFile fileUtil = new CoeFile();
fileUtil.copyDefaultVersion(srcPath, oldModel.getRelationFileId(), targetPath, lastplModel.getId());
// 获取新旧节点关联关系
final Map<String, String> mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), true);
// 处理流程属性
String property = CoePropertyUtil.getPropertyValue(oldModel.getRelationFileId() + "_attr");
if (!UtilString.isEmpty(property)) {
CoePropertyUtil.createProperty(newUUID + "_attr", property);
}
//重新设置修订关联关系
DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel();
newModel1.setId(UUIDGener.getUUID());
newModel1.setFileId(newModel.getId());
newModel1.setShapeId(mapNewUUID.get(oldModel.getShapeId()));
newModel1.setShapeText(oldModel.getShapeText());
newModel1.setAttrId(oldModel.getAttrId());
newModel1.setRelationFileId(newUUID);
newModel1.setRelationShapeId(oldModel.getRelationShapeId());
newModel1.setRelationShapeText(oldModel.getRelationShapeText());
dao.insert(newModel1);
CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), PALRepositoryCache.getCache().get(newUUID), mapNewUUID1, _uc);
ro = ResponseObject.newOkResponse("创建成功");
ro.put("uuid", lastplModel.getId());
}else{
ro = ResponseObject.newWarnResponse("创建失败");
}
} catch (Exception e) {
ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage());
}
}
ro = ResponseObject.newWarnResponse("创建失败");
}else{
ro = ResponseObject.newWarnResponse("创建失败");
}
break;
}
}else{
ro = ResponseObject.newWarnResponse("创建失败");
}*/
return ro.toString();
}

View File

@ -114,8 +114,8 @@ public class RepositoryTreeUtil {
if (model != null) palObject.put("dutyUserName", model.getUserName());
}
String sqls = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYNAME='文件编码' and PLID = '"+palModel.getId()+"'";
palObject.put("stopNumber", DBSql.getString(sqls));
//String sqls = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYNAME='文件编码' and PLID = '"+palModel.getId()+"'";
//palObject.put("stopNumber", DBSql.getString(sqls));
// if (professionalIcon) {
if (false) {
palObject.put("icon", "../apps/" + CoEConstant.APP_ID + "/img/method/" + palModel.getMethodId() + "/16.png");