remove processDefinition resourceIds (#6813)
This commit is contained in:
parent
e36d18b588
commit
dfe4945b48
|
|
@ -724,20 +724,6 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|||
|
||||
switch (releaseState) {
|
||||
case ONLINE:
|
||||
// To check resources whether they are already cancel authorized or deleted
|
||||
String resourceIds = processDefinition.getResourceIds();
|
||||
if (org.apache.commons.lang.StringUtils.isNotBlank(resourceIds)) {
|
||||
Integer[] resourceIdArray = Arrays.stream(resourceIds.split(Constants.COMMA)).map(Integer::parseInt).toArray(Integer[]::new);
|
||||
PermissionCheck<Integer> permissionCheck = new PermissionCheck<>(AuthorizationType.RESOURCE_FILE_ID, processService, resourceIdArray, loginUser.getId(), logger);
|
||||
try {
|
||||
permissionCheck.checkPermission();
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
putMsg(result, Status.RESOURCE_NOT_EXIST_OR_NO_PERMISSION, RELEASESTATE);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
processDefinition.setReleaseState(releaseState);
|
||||
processDefinitionMapper.updateById(processDefinition);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -119,12 +119,6 @@ public class TaskDefinitionServiceImpl extends BaseServiceImpl implements TaskDe
|
|||
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName());
|
||||
return result;
|
||||
}
|
||||
TaskDefinition taskDefinition = taskDefinitionMapper.queryByName(projectCode, taskDefinitionLog.getName());
|
||||
if (taskDefinition != null) {
|
||||
logger.error("task definition name {} already exists", taskDefinitionLog.getName());
|
||||
putMsg(result, Status.TASK_DEFINITION_NAME_EXISTED, taskDefinitionLog.getName());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
int saveTaskResult = processService.saveTaskDefine(loginUser, projectCode, taskDefinitionLogs);
|
||||
if (saveTaskResult == Constants.DEFINITION_FAILURE) {
|
||||
|
|
|
|||
|
|
@ -436,8 +436,6 @@ public class ProcessDefinitionServiceTest {
|
|||
Assert.assertEquals(Status.SUCCESS, onlineRes.get(Constants.STATUS));
|
||||
|
||||
// project check auth success, processs definition online
|
||||
ProcessDefinition processDefinition1 = getProcessDefinition();
|
||||
processDefinition1.setResourceIds("1,2");
|
||||
Map<String, Object> onlineWithResourceRes = processDefinitionService.releaseProcessDefinition(
|
||||
loginUser, projectCode, 46, ReleaseState.ONLINE);
|
||||
Assert.assertEquals(Status.SUCCESS, onlineWithResourceRes.get(Constants.STATUS));
|
||||
|
|
|
|||
|
|
@ -163,12 +163,6 @@ public class ProcessDefinition {
|
|||
@TableField(exist = false)
|
||||
private String modifyBy;
|
||||
|
||||
/**
|
||||
* resource ids
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* warningGroupId
|
||||
*/
|
||||
|
|
@ -345,14 +339,6 @@ public class ProcessDefinition {
|
|||
this.scheduleReleaseState = scheduleReleaseState;
|
||||
}
|
||||
|
||||
public String getResourceIds() {
|
||||
return resourceIds;
|
||||
}
|
||||
|
||||
public void setResourceIds(String resourceIds) {
|
||||
this.resourceIds = resourceIds;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
return timeout;
|
||||
}
|
||||
|
|
@ -472,7 +458,6 @@ public class ProcessDefinition {
|
|||
+ ", tenantId=" + tenantId
|
||||
+ ", tenantCode='" + tenantCode + '\''
|
||||
+ ", modifyBy='" + modifyBy + '\''
|
||||
+ ", resourceIds='" + resourceIds + '\''
|
||||
+ ", warningGroupId=" + warningGroupId
|
||||
+ '}';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ public class ProcessDefinitionLog extends ProcessDefinition {
|
|||
this.setTimeout(processDefinition.getTimeout());
|
||||
this.setTenantId(processDefinition.getTenantId());
|
||||
this.setModifyBy(processDefinition.getModifyBy());
|
||||
this.setResourceIds(processDefinition.getResourceIds());
|
||||
this.setWarningGroupId(processDefinition.getWarningGroupId());
|
||||
this.setExecutionType(processDefinition.getExecutionType());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,6 @@ public class ProcessDefinitionMapperTest extends BaseDaoTest {
|
|||
@Test
|
||||
public void listResourcesTest() {
|
||||
ProcessDefinition processDefinition = insertOne("def 1");
|
||||
processDefinition.setResourceIds("3,5");
|
||||
processDefinition.setReleaseState(ReleaseState.ONLINE);
|
||||
List<Map<String, Object>> maps = processDefinitionMapper.listResources();
|
||||
Assert.assertNotNull(maps);
|
||||
|
|
@ -338,7 +337,6 @@ public class ProcessDefinitionMapperTest extends BaseDaoTest {
|
|||
@Test
|
||||
public void listResourcesByUserTest() {
|
||||
ProcessDefinition processDefinition = insertOne("def 1");
|
||||
processDefinition.setResourceIds("3,5");
|
||||
processDefinition.setReleaseState(ReleaseState.ONLINE);
|
||||
List<Map<String, Object>> maps = processDefinitionMapper.listResourcesByUser(processDefinition.getUserId());
|
||||
Assert.assertNotNull(maps);
|
||||
|
|
|
|||
Loading…
Reference in New Issue