重新添加权限时,使用视图的bindid(703)

This commit is contained in:
hjh 2023-05-11 15:58:30 +08:00
parent 94c4d43bf8
commit 11f32941f0

View File

@ -85,11 +85,11 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
String publishDateType = bo.getString("CHOICEEFFECTIVEDATE");
String publishDate = bo.getString("EFFECTIVEDATE");
if("1".equals(publishDateType)) {
if ("1".equals(publishDateType)) {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(publishDate);
Timestamp stamp = new Timestamp(date.getTime());
model.setPublishDate(stamp);
}else {
} else {
model.setPublishDate(nowTime);
}
model.setId(UUIDGener.getUUID());
@ -140,10 +140,10 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
repositoryDao.updatePublishStatusAndDate("N", boN.get("PUBLISHFILEID").toString(), null, model.getPublishDate());
//修改关联角色绩效发布状态
updateRoleAndPerformance(boN.get("PUBLISHFILEID").toString(),model.getPublishDate(),"N");
updateRoleAndPerformance(boN.get("PUBLISHFILEID").toString(), model.getPublishDate(), "N");
//绩效模型中数据模型回填流程编号
updateProcessNumber(boN.get("PUBLISHFILEID").toString(),param.getUserContext(),bo.get("WSID").toString(),boN.getString("PUBLISH_NUMBER"),model.getPublishDate());
updateProcessNumber(boN.get("PUBLISHFILEID").toString(), param.getUserContext(), bo.get("WSID").toString(), boN.getString("PUBLISH_NUMBER"), model.getPublishDate());
}
@ -170,10 +170,10 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
//修改关联角色绩效发布状态
updateRoleAndPerformance(boC.get("CHANGEDFILEIDNEW").toString(),model.getPublishDate(),"C");
updateRoleAndPerformance(boC.get("CHANGEDFILEIDNEW").toString(), model.getPublishDate(), "C");
//绩效模型中数据模型回填流程编号
updateProcessNumber(boC.get("CHANGEDFILEIDNEW").toString(),param.getUserContext(),bo.get("WSID").toString(),boC.getString("PUBLISH_NUMBER"),model.getPublishDate());
updateProcessNumber(boC.get("CHANGEDFILEIDNEW").toString(), param.getUserContext(), bo.get("WSID").toString(), boC.getString("PUBLISH_NUMBER"), model.getPublishDate());
}
}
@ -209,6 +209,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
/**
* 以当前发布变更停用的流程作为前后置流程的流程对其流程接口的文本进行调整
*
* @param bo
* @param bolistN
* @param bolistC
@ -217,7 +218,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
private void updatePublishRepositoryRelationRearLeadhape(UserContext uc, BO bo, List<BO> bolistN, List<BO> bolistC, List<BO> bolistS) {
Set<String> newSet = new HashSet<>();
Set<String> changeSet = new HashSet<>();
Set<String> stopSet= new HashSet<>();
Set<String> stopSet = new HashSet<>();
if (bolistN != null) {
for (BO boN : bolistN) {
String palId = boN.get("PUBLISHFILEID").toString();
@ -280,7 +281,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
boolean update = false;
JSONObject definition = JSONObject.parseObject(define);
JSONObject elements = definition.getJSONObject("elements");
JSONArray procedureShapeArr= getProcedureShapeArr(elements);
JSONArray procedureShapeArr = getProcedureShapeArr(elements);
for (int i = 0; i < procedureShapeArr.size(); i++) {
JSONObject shape = procedureShapeArr.getJSONObject(i);
if (matchProcedureObj(shape, pubilshModel.getVersionId(), pubilshModel.getName(), position)) {
@ -303,13 +304,13 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
CoeDesignerAPIManager.getInstance().storeDefinition(defineModel);// dao操作
// 记录操作行为日志
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE + ",文件属性["+ ("top".equals(position) ? "前置" : "后置") +"流程]触发流程接口形状更新");
SDK.getLogAPI().consoleInfo("[成功][" + pubilshModel.getName() + "]被"+ ("new".equals(type) ? "发布" : "change".equals(type) ? "变更" : "废止") +",文件属性["+ ("top".equals(position) ? "前置" : "后置") +"流程]触发流程[" + model.getName() + "][" + model.getId() + "]流程接口形状更新");
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_UPDATE, CoEOpLogConst.INFO_REPOSITORY_DESIGNER_UPDATE + ",文件属性[" + ("top".equals(position) ? "前置" : "后置") + "流程]触发流程接口形状更新");
SDK.getLogAPI().consoleInfo("[成功][" + pubilshModel.getName() + "]被" + ("new".equals(type) ? "发布" : "change".equals(type) ? "变更" : "废止") + ",文件属性[" + ("top".equals(position) ? "前置" : "后置") + "流程]触发流程[" + model.getName() + "][" + model.getId() + "]流程接口形状更新");
}
}
} catch (Exception e) {
e.printStackTrace();
SDK.getLogAPI().consoleErr("模型["+ model.getName() +"][" + model.getId() + "]模型文件转换JSON异常");
SDK.getLogAPI().consoleErr("模型[" + model.getName() + "][" + model.getId() + "]模型文件转换JSON异常");
continue;
}
}
@ -396,7 +397,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
continue;
}
// 新增模型时间
if (updatePropertyEffectiveDate(model, date, propertyDao,publishDateType,publishDatet)) {
if (updatePropertyEffectiveDate(model, date, propertyDao, publishDateType, publishDatet)) {
// 重新创建手册
service.execute(new Runnable() {
@Override
@ -416,7 +417,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
continue;
}
// 新增模型时间
if (updatePropertyEffectiveDate(model, date, propertyDao,publishDateType,publishDatet)) {
if (updatePropertyEffectiveDate(model, date, propertyDao, publishDateType, publishDatet)) {
// 重新创建手册
service.execute(new Runnable() {
@Override
@ -431,6 +432,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
/**
* 新生成流程手册编号进行处理
*
* @param uuid
*/
private void updateProcessReport(String uuid, String processInstId, String type, String appUser) {
@ -522,6 +524,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
/**
* 创建手册
*
* @param model
* @param wsId
* @param userId
@ -560,9 +563,9 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
* @param date
* @param propertyDao
*/
private boolean updatePropertyEffectiveDate(PALRepositoryModel model, String date, PALRepositoryPropertyDao propertyDao,String publishDateType,String publishDate) {
private boolean updatePropertyEffectiveDate(PALRepositoryModel model, String date, PALRepositoryPropertyDao propertyDao, String publishDateType, String publishDate) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String time= df.format(new Date());
String time = df.format(new Date());
// epc:process.epc effective_date
// 表单:data.form form_effective_date
// 制度:control.policy effective_date
@ -586,9 +589,9 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
List<PALRepositoryPropertyModel> list = propertyDao.getPropertysByPlid(model.getId(), attrId);
for (PALRepositoryPropertyModel propertyModel : list) {
if (attrId.equals(propertyModel.getPropertyId())) {
if("1".equals(publishDateType)) {
if ("1".equals(publishDateType)) {
propertyDao.updatePropertyByPropertyId(model.getId(), attrId, publishDate);
}else {
} else {
propertyDao.updatePropertyByPropertyId(model.getId(), attrId, time);
}
@ -613,6 +616,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
/**
* 流程发布范围权限单独存储
*
* @param publish 流程发布bo主表
* @param bolistN 新增发布流程信息
* @param bolistC 变更发布流程信息需要将已存在的相应流程权限信息进行删除再进行权限存储
@ -681,7 +685,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
}
// 重新添加权限
List<BO> list = new ArrayList<>();
//List<BO> list = new ArrayList<>();
for (Map.Entry<String, String> entry : addVerMap.entrySet()) {
String verId = entry.getKey();
String name = entry.getValue();
@ -694,19 +698,25 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
bo.set("ORGPERM", "1".equals(sendScope) ? SDK.getORGAPI().getCompanyByUser(applyUser).getId() : sendScopeOrg);
bo.set("POSTPERM", "1".equals(sendScope) ? "" : sendScopePost);
bo.set("LEVELPERM", "1".equals(sendScope) ? "" : sendScopeLevel);
list.add(bo);
ProcessInstance boProcessInstance = SDK.getProcessAPI()
.createBOProcessInstance("obj_e076b01bd0d04bc39e5af12e2c8c188c", applyUser, "权限阅览");
SDK.getBOAPI().create(newBoName, bo, boProcessInstance.getId(), applyUser);
// list.add(bo);
}
if (list.size() > 0) {
SDK.getBOAPI().create(newBoName, list, bindId, applyUser);
// if (list.size() > 0) {
// SDK.getBOAPI().create(newBoName, list, bindId, applyUser);
// SDK.getLogAPI().consoleInfo("[发布范围权限信息保存至范围权限表]更新成功");
// }
SDK.getLogAPI().consoleInfo("[发布范围权限信息保存至范围权限表]更新成功");
}
}
/****
* 发布明细如果关联角色绩效图不显示在发布界面在流程结束后同步发布
*/
public void updateRoleAndPerformance(String publishFileId,Timestamp publishDate,String type){
public void updateRoleAndPerformance(String publishFileId, Timestamp publishDate, String type) {
try {
List roleList = new ArrayList();
roleList.add(0, "org.role");
@ -737,10 +747,11 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
/**
* 1发布结束后获取关联绩效模型填充流程编号
* 2获取信息插入绩效指标库
*
* @param publishFileId
* @param publishDate
*/
public void updateProcessNumber(String publishFileId, UserContext uc, String wsId, String processNumber,Timestamp publishDate) {
public void updateProcessNumber(String publishFileId, UserContext uc, String wsId, String processNumber, Timestamp publishDate) {
try {
//获取关联绩效模型数据
List performanceList = new ArrayList();
@ -777,7 +788,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
coeProcessLevelWeb.handleShapeDefaultAttr(wsId, parentModel, elements, methodAttrsMap);
if(UtilString.isNotEmpty(processNumber)){
if (UtilString.isNotEmpty(processNumber)) {
//编号规则为: MP(流程编号是08.01.05.05/P05V1.0-YLYYYY对应的流程绩效编号MP-08.01.05.05-YLYYYY.AA(AA=1~99顺序排号)对流程编号去除"/P05V1.0)
//去掉 /P05V1.0-
@ -802,17 +813,16 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
if (!dataAttributes.isEmpty() && dataAttributes.size() > 0) {
for (Object attribute : dataAttributes) {
JSONObject obj = (JSONObject) attribute;
if (obj.containsKey("attributesJsonArray")) {
JSONArray attributesJsonArray = obj.getJSONArray("attributesJsonArray");
BO recordBO = new BO();
boolean insertFlag=false;
boolean insertFlag = false;
if (attributesJsonArray.size() > 0) {
//事前循环jsonarry判断绩效编号是否填写
for (int c=0;c<attributesJsonArray.size();c++) {
for (int c = 0; c < attributesJsonArray.size(); c++) {
if (attributesJsonArray.getJSONObject(c).containsKey("id")) {
String getid1 = attributesJsonArray.getJSONObject(c).getString("id");
String value1 = attributesJsonArray.getJSONObject(c).getString("value");
@ -988,7 +998,6 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
}
}
} catch (AWSDataAccessException e) {
e.printStackTrace();
@ -998,6 +1007,4 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
}
}