能力资源上架 通过后

This commit is contained in:
wangliwen 2022-04-29 12:00:17 +08:00
parent 828d6baae4
commit dec5ac235f
1 changed files with 28 additions and 3 deletions

View File

@ -52,7 +52,15 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A
@Override @Override
public void notify(DelegateExecution execution) throws Exception { public void notify(DelegateExecution execution) throws Exception {
logger.error("----------------------进入审批通过节点---------------------------");
final String eventName = execution.getEventName();
switch (eventName) {
case EVENTNAME_TAKE: {
endTake(execution.getVariables());
}
break;
}
} }
@Override @Override
@ -71,9 +79,9 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A
case EVENTNAME_CREATE: // 创建当前审批节点事件 case EVENTNAME_CREATE: // 创建当前审批节点事件
create(delegateTask, roleDTO); create(delegateTask, roleDTO);
break; break;
case EVENTNAME_COMPLETE: // case EVENTNAME_COMPLETE:
complete(delegateTask); // complete(delegateTask);
break; // break;
default: default:
logger.error("未处理该事件:" + eventName); logger.error("未处理该事件:" + eventName);
} }
@ -99,8 +107,25 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A
return false; return false;
} }
/**
* 进入最后结束节点
*
* @param kv
*/
private void endTake(Map<String, Object> kv) { // 进入最后结束节点
Gson gson = new Gson();
JsonElement jsonElement = gson.toJsonTree(kv);
TResourceMountApplyDTO resourceMountApplyDTO = gson.fromJson(jsonElement, TResourceMountApplyDTO.class);
ResourceDTO re = resourceMountApplyDTO.getResourceDTO();
if (re != null) {
re.setDelFlag(0);
resourceService.update(re);
}
}
/** /**
* 流程结束推送 * 流程结束推送
*
* @param delegateTask * @param delegateTask
*/ */
private void complete(DelegateTask delegateTask) { private void complete(DelegateTask delegateTask) {