diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index 86857649..a1363f2d 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -88,7 +88,8 @@ public class AbilityCenterControllerV2 { if (page.getTotal() <= 0) { // return new Result().error("联系管理员添加流程"); } - abilityBatchApplicationDTO.setApplyFlag(UUID.randomUUID().toString()); // 同一次的申请标识 + final String applyFlag = UUID.randomUUID().toString(); + abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识 final Optional deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName)); final UserDetail user = SecurityUser.getUser(); @@ -106,9 +107,9 @@ public class AbilityCenterControllerV2 { tAbilityApplicationDTO.setInstanceId(abilityBatchApplicationDTO.getInstanceId()); tAbilityApplicationDTO.setUnit(abilityBatchApplicationDTO.getUnit()); tAbilityApplicationDTO.setUser(abilityBatchApplicationDTO.getUser()); - tAbilityApplicationDTO.setResourceId(index.get("resourceId")); + tAbilityApplicationDTO.setResourceId(index.get("resourceId").toString()); tAbilityApplicationDTO.setUser(abilityBatchApplicationDTO.getUser()); - tAbilityApplicationDTO.setSystem(index.get("resourceName")); + tAbilityApplicationDTO.setSystem(index.get("resourceName").toString()); tAbilityApplicationDTO.setEnclosure(abilityBatchApplicationDTO.getEnclosure()); // 附件 tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); tAbilityApplicationDTO.setApproveStatus("审核中"); @@ -178,7 +179,7 @@ public class AbilityCenterControllerV2 { put("tAbilityApplicationDTOList", dtoList); // 归属该部门的申请 put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id put("deptId", deptId); // 归属部门 - put("id", UUID.randomUUID().toString()); //申请id + put("id", applyFlag); //申请id put("creator", user == null ? null : user.getId()); // 创建人 put("userId", user == null ? null : user.getId()); // 创建人 put("basic_facilities", basic_facilities); // 是否为基础设施 diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActRunningService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActRunningService.java index b34b7f14..cffb00d8 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActRunningService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActRunningService.java @@ -26,7 +26,6 @@ import java.util.Map; /** * 运行中的流程 - * */ @Service public class ActRunningService { @@ -43,24 +42,24 @@ public class ActRunningService { * 流程定义列表 */ public PageData> page(Map params) { - String id = (String)params.get("id"); - String definitionKey = (String)params.get("definitionKey"); + String id = (String) params.get("id"); + String definitionKey = (String) params.get("definitionKey"); //分页参数 int curPage = 1; int limit = 10; - if(params.get(Constant.PAGE) != null){ - curPage = Integer.parseInt((String)params.get(Constant.PAGE)); + if (params.get(Constant.PAGE) != null) { + curPage = Integer.parseInt((String) params.get(Constant.PAGE)); } - if(params.get(Constant.LIMIT) != null){ - limit = Integer.parseInt((String)params.get(Constant.LIMIT)); + if (params.get(Constant.LIMIT) != null) { + limit = Integer.parseInt((String) params.get(Constant.LIMIT)); } ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery(); - if (StringUtils.isNotBlank(id)){ + if (StringUtils.isNotBlank(id)) { processInstanceQuery.processInstanceId(id); } - if (StringUtils.isNotBlank(definitionKey)){ + if (StringUtils.isNotBlank(definitionKey)) { processInstanceQuery.processDefinitionKey(definitionKey); } @@ -69,7 +68,7 @@ public class ActRunningService { for (ProcessInstance processInstance : processInstanceList) { objectList.add(processInstanceConvert(processInstance)); } - return new PageData<>(objectList, (int)processInstanceQuery.count()); + return new PageData<>(objectList, (int) processInstanceQuery.count()); } /** @@ -85,7 +84,7 @@ public class ActRunningService { map.put("businessKey", processInstance.getBusinessKey()); map.put("activityId", processInstance.getActivityId()); - ProcessDefinitionEntity definition = (ProcessDefinitionEntity)((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); + ProcessDefinitionEntity definition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); ActivityImpl activity = definition.findActivity(processInstance.getActivityId()); map.put("activityName", activity.getProperty("name")); map.put("suspended", processInstance.isSuspended()); @@ -95,21 +94,23 @@ public class ActRunningService { /** * 删除实例 - * @param id 实例ID + * + * @param id 实例ID */ - public void delete(String id){ + public void delete(String id) { runtimeService.deleteProcessInstance(id, null); } /** * 启动流程实例 + * * @param key 流程定义标识key */ - public ProcessInstanceDTO startProcess(String key){ + public ProcessInstanceDTO startProcess(String key) { String userId = SecurityUser.getUserId().toString(); identityService.setAuthenticatedUserId(userId); - ProcessDefinitionEntity definition = (ProcessDefinitionEntity)repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult(); - if(definition.isSuspended()){ + ProcessDefinitionEntity definition = (ProcessDefinitionEntity) repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult(); + if (definition.isSuspended()) { throw new RenException(ErrorCode.PROCESS_START_ERROR); } ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(key); @@ -134,17 +135,18 @@ public class ActRunningService { /** * 根据流程Key,启动实例 + * * @param processStartDTO * @return */ public ProcessInstanceDTO startOfBusinessKey(ProcessStartDTO processStartDTO) { String userId = SecurityUser.getUserId().toString(); identityService.setAuthenticatedUserId(userId); - ProcessDefinitionEntity definition = (ProcessDefinitionEntity)repositoryService.createProcessDefinitionQuery().processDefinitionKey(processStartDTO.getProcessDefinitionKey()).latestVersion().singleResult(); - if(definition.isSuspended()){ + ProcessDefinitionEntity definition = (ProcessDefinitionEntity) repositoryService.createProcessDefinitionQuery().processDefinitionKey(processStartDTO.getProcessDefinitionKey()).latestVersion().singleResult(); + if (definition.isSuspended()) { throw new RenException(ErrorCode.PROCESS_START_ERROR); } - ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processStartDTO.getProcessDefinitionKey(), processStartDTO.getBusinessKey(),processStartDTO.getVariables()); + ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processStartDTO.getProcessDefinitionKey(), processStartDTO.getBusinessKey(), processStartDTO.getVariables()); ProcessInstanceDTO dto = new ProcessInstanceDTO(); this.convertInstance(processInstance, dto); return dto; diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 921c88cd..c39f021e 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -346,6 +346,7 @@ public class ResourceServiceImpl extends CrudServiceImpl { item.setId(null); item.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag()); + item.setDataResourceId(resourceEntity.getId()); attrDao.insert(item); }); }