diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java index b3880a3e..20bbcc25 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java @@ -81,6 +81,9 @@ public class AbilityCenterController { tAbilityApplicationDTO.setUser(abilityBatchApplicationDTO.getUser()); tAbilityApplicationDTO.setSystem(index.get("resourceName")); tAbilityApplicationDTO.setEnclosure(abilityBatchApplicationDTO.getEnclosure()); // 附件 + tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId()); + tAbilityApplicationDTO.setApproveStatus("审核中"); + tAbilityApplicationDTO.setDelFlag(0); // 仿照请求接口 /processForm/tabilityapplication ValidatorUtils.validateEntity(tAbilityApplicationDTO, AddGroup.class, DefaultGroup.class); tAbilityApplicationService.save(tAbilityApplicationDTO); // 写能力申请数据 diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java index 19b22051..48fcc350 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityApplicationDTO.java @@ -42,6 +42,12 @@ public class TAbilityApplicationDTO implements Serializable { @ApiModelProperty(value = "用户id") private String userId; + @ApiModelProperty(value = "审核状态:审核中,通过,不通过") + private String approveStatus; + + @ApiModelProperty(value = "删除标记:0:正常使用;1:已删除;9:其他") + private Integer delFlag; + @ApiModelProperty(value = "附件") private String enclosure; diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java index 1ec3aaff..e5d54d1b 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dto/TAbilityBatchApplicationDTO.java @@ -39,6 +39,12 @@ public class TAbilityBatchApplicationDTO implements Serializable { @ApiModelProperty(value = "用户id") private String userId; + @ApiModelProperty(value = "审核状态:审核中,通过,不通过") + private String approveStatus; + + @ApiModelProperty(value = "删除标记:0:正常使用;1:已删除;9:其他") + private Integer delFlag; + @ApiModelProperty(value = "附件") private String enclosure; } diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java index dbb30d6e..5ceb42dc 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/entity/TAbilityApplicationEntity.java @@ -67,6 +67,15 @@ public class TAbilityApplicationEntity { */ private String userId; + /** + * 审核状态:审核中,通过,不通过 + */ + private String approveStatus; + + /** + * 删除标记:0:正常使用;1:已删除;9:其他 + */ + private Integer delFlag; /** * 附件 diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java index ef2b3809..82b6acbd 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/listener/CorrectionListener.java @@ -3,6 +3,7 @@ package io.renren.modules.processForm.listener; import com.google.gson.Gson; import com.google.gson.JsonElement; import io.renren.modules.processForm.dto.TAbilityApplicationDTO; +import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.resource.dto.ResourceDTO; import io.renren.modules.resource.service.ResourceService; import io.renren.modules.sys.dto.SysDeptDTO; @@ -49,6 +50,8 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti @Autowired private ResourceService resourceService; + @Autowired + private TAbilityApplicationService tAbilityApplicationService; @Override public void notify(DelegateTask delegateTask) { @@ -65,12 +68,14 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti @Override public void notify(DelegateExecution delegateExecution) throws Exception { -// logger.error("事件:" + delegateExecution.getEventName()); -// delegateExecution.getVariableNames().stream().forEach(index -> logger.error("variable:" + index)); -// delegateExecution.getVariables().values().stream().filter(index -> index != null).forEach(value -> logger.error(value.toString())); -// // taskService.setAssignee(delegateExecution.getProcessInstanceId(), "1516307964617076737");// 可以设置 -// -// logger.error("修改审批人成功!" + delegateExecution.getCurrentActivityId() + " " + delegateExecution.getProcessInstanceId() + " " + delegateExecution.getProcessBusinessKey()); + logger.error("----------------------进入部门审批结束节点---------------------------"); + delegateExecution.getProcessBusinessKey(); + final String eventName = delegateExecution.getEventName(); + switch (eventName) { + case EVENTNAME_END: + endTake(delegateExecution.getVariables()); + break; + } } @Override @@ -89,6 +94,24 @@ public class CorrectionListener implements TaskListener, ExecutionListener, Acti logger.error("异常", delegateExecution); } + + /** + * 结束审批 + * + * @param kv + */ + private void endTake(Map kv) { // 进入最后结束节点 + Gson gson = new Gson(); + JsonElement jsonElement = gson.toJsonTree(kv); + TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class); + if (abilityApplicationDTO != null) { + abilityApplicationDTO.setDelFlag(0); + abilityApplicationDTO.setApproveStatus("通过"); + tAbilityApplicationService.update(abilityApplicationDTO); + logger.error("审批通过!申请id:" + abilityApplicationDTO.getId()); + } + } + /** * 节点创建时动态分配资源部门审核人 * 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 e1b18c03..d090cd7c 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 @@ -77,7 +77,10 @@ public class ResourceServiceImpl extends CrudServiceImpltrue - - - - - src/main/resources