package com.changhong.epc.tenant.controller.workFlow; import com.changhong.epc.constter.operationLog.OperationLogConst; import com.changhong.epc.constter.tenant.WorkFlow; import com.changhong.epc.rely.api.epc.admin.InitCompanyApi; import com.changhong.epc.rely.api.service.workFlow.WorkFlowService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeoutException; @RestController @Slf4j public class WorkFlowController implements WorkFlow, OperationLogConst { @Resource(name="workFlowServiceImpl") private WorkFlowService workFlowServicel; @Resource private InitCompanyApi initCompanyApi; /** * 删除流程定义,批量 */ @PostMapping(DEF_DELETE) public Map defineDelete(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.defineDelete(maps); } /** * 部署流程定义 */ @PostMapping(DEF_DEPLOY) public Map definePeploy(@RequestBody Map maps) throws TimeoutException{ maps.remove("tenantID"); return workFlowServicel.definePeploy(maps); } /** * 流程定义分页查询 */ @PostMapping(DEF_SEACHE) public Map defineSeache(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.defineSeache(maps); } /** * 创建流程定义 * @param processBig * @return * @throws TimeoutException */ @PostMapping(DEF_CREATE) public Map defineCreate(@RequestBody Map map) throws TimeoutException{ return workFlowServicel.defineCreate(map); } /** * 退回流程实例 * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_BACK) public Map instBack(@RequestBody Map maps) throws TimeoutException{ Map stringObjectMap = workFlowServicel.instBack(maps); // try { // log.debug("准备记录日志:---------->"); // initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_RETURN); // }catch (Exception e){ // log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage()); // } return stringObjectMap; } /** * 设置代理 * @param processInst * @return * @throws TimeoutException */ @PostMapping(CREATE_AGENT) public Map agentCreat(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.agentCreat(maps); } /** * 创建流程实例 * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_CREATE) public Map instCreat(@RequestBody Map maps) throws TimeoutException{ Map stringObjectMap = workFlowServicel.instCreat(maps); // try { // log.debug("准备记录日志:---------->"); // initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_SUBMIT); // }catch (Exception e){ // log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage()); // } return stringObjectMap; } /** * 撤销流程实例 * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_DRAWBACK) public Map instDrawBack(@RequestBody Map maps) throws TimeoutException{ Map stringObjectMap = workFlowServicel.instDrawBack(maps); // try { // log.debug("准备记录日志:---------->"); // initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),Objects.toString(formData.getDataRowNum(),""),OperationLogConst.OPERATION_RECALL); // }catch (Exception e){ // log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage()); // } return stringObjectMap; } /** * 结束流程实例 * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_OVER) public Map instOver(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instOver(maps); } /** * 设置代办 * @param processInst * @return * @throws TimeoutException */ @PostMapping(CREATE_CHARGE) public Map chargeCreate(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.chargeCreate(maps); } /** * 执行流程实例 * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_FINISH) public Map instFinish(@RequestBody Map maps) throws TimeoutException{ Map stringObjectMap = workFlowServicel.instFinish(maps); // try { // log.debug("准备记录日志:---------->"); // initCompanyApi.addOperationLog(Objects.toString(maps.get("formID"),""),OperationLogConst.OPERATION_APPROVE); // }catch (Exception e){ // log.debug("----------远程调用----------操作日志添加异常:{}",e.getMessage()); // } return stringObjectMap; } /** * 查询流程待办 * @param processInst * @return * @throws TimeoutException */ @PostMapping(SEACHE_HANDLE) public Map instSeacheHandle(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instSeacheHandle(maps); } /** * 流程实例log(参数为空即查询所有) * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_LOG) public Map instLog(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instLog(maps); } /** * 获取所有可退回项目 * @param processInst * @return * @throws TimeoutException */ @PostMapping(GET_BACK) public Map getBack(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.getBack(maps); } /** * 查询代理(参数为空即查询所有信息) * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_AGENT) public Map instAgent(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instAgent(maps); } /** * 查询代理去除流程定义信息 * @param processInst * @return * @throws TimeoutException */ @PostMapping(AGENT_DEFMSG) public Map instAgentDefMsg(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instAgentDefMsg(maps); } /** * 查询流程实例(参数都为空,即查询所有) * @param processInst * @return * @throws TimeoutException */ @PostMapping(INST_SEACHE) public Object instSeache(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.instSeache(maps).get("data"); } /** * 租户注册系统 */ @PostMapping(APP_CREATE) public Map appCreate(@RequestBody Map maps) throws TimeoutException{ return workFlowServicel.appCreate(maps); } }