|
@@ -148,7 +148,8 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
|
@Override
|
|
@Override
|
|
public IPage<ProcessDefinitionDTO> selectPage(ProcessDefinition processDefinition, IPage<ProcessDefinitionDTO> iPage) {
|
|
public IPage<ProcessDefinitionDTO> selectPage(ProcessDefinition processDefinition, IPage<ProcessDefinitionDTO> iPage) {
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
-
|
|
|
|
|
|
+ processDefinition.setTenantId(loginUser.getTenantId());
|
|
|
|
+ processDefinition.setCompanyOrgId(loginUser.getCompanyId());
|
|
IPage<ProcessDefinitionDTO> processDefinitionDTOIPage = processDefinitionMapper.selectPage(iPage, processDefinition);
|
|
IPage<ProcessDefinitionDTO> processDefinitionDTOIPage = processDefinitionMapper.selectPage(iPage, processDefinition);
|
|
return processDefinitionDTOIPage;
|
|
return processDefinitionDTOIPage;
|
|
}
|
|
}
|
|
@@ -156,14 +157,16 @@ public class WorkFlowServiceImpl implements WorkFlowService {
|
|
@Override
|
|
@Override
|
|
public void saveProcessDefinition(ProcessDefinition processDefinition) {
|
|
public void saveProcessDefinition(ProcessDefinition processDefinition) {
|
|
log.info("begin add ProcessDefinition processDefinition:" + JSON.toJSONString(processDefinition));
|
|
log.info("begin add ProcessDefinition processDefinition:" + JSON.toJSONString(processDefinition));
|
|
- String tenantId = UserUtil.getCurrentUser().getTenantId();
|
|
|
|
- int uniqueCount = processDefinitionMapper.checkProcessUnique(null, tenantId,
|
|
|
|
- processDefinition.getCompanyOrgId(),processDefinition.getTaskType());
|
|
|
|
- if (uniqueCount > 0) {
|
|
|
|
- throw new ServiceException(ResultStatus.PROCESS_ALREADY_EXISTS);
|
|
|
|
- }
|
|
|
|
|
|
+ LoginUser currentUser = UserUtil.getCurrentUser();
|
|
|
|
+ String tenantId =currentUser.getTenantId();
|
|
|
|
+
|
|
List<Integer> companyIds = processDefinition.getCompanyIds();
|
|
List<Integer> companyIds = processDefinition.getCompanyIds();
|
|
companyIds.forEach(id->{
|
|
companyIds.forEach(id->{
|
|
|
|
+ int uniqueCount = processDefinitionMapper.checkProcessUnique(null, tenantId,
|
|
|
|
+ id,processDefinition.getTaskType());
|
|
|
|
+ if (uniqueCount > 0) {
|
|
|
|
+ throw new ServiceException(ResultStatus.PROCESS_ALREADY_EXISTS);
|
|
|
|
+ }
|
|
processDefinition.setVersion(1);
|
|
processDefinition.setVersion(1);
|
|
processDefinition.setRunningVersion(0);
|
|
processDefinition.setRunningVersion(0);
|
|
processDefinition.setTenantId(tenantId);
|
|
processDefinition.setTenantId(tenantId);
|