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<String, Object> defineDelete(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.defineDelete(maps);
|
}
|
|
/**
|
* 部署流程定义
|
*/
|
@PostMapping(DEF_DEPLOY)
|
public Map<String, Object> definePeploy(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
maps.remove("tenantID");
|
return workFlowServicel.definePeploy(maps);
|
}
|
|
/**
|
* 流程定义分页查询
|
*/
|
@PostMapping(DEF_SEACHE)
|
public Map<String, Object> defineSeache(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.defineSeache(maps);
|
}
|
|
/**
|
* 创建流程定义
|
* @param processBig
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(DEF_CREATE)
|
public Map<String, Object> defineCreate(@RequestBody Map<String,Object> map) throws TimeoutException{
|
return workFlowServicel.defineCreate(map);
|
}
|
|
/**
|
* 退回流程实例
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_BACK)
|
public Map<String, Object> instBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
Map<String, Object> 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<String, Object> agentCreat(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.agentCreat(maps);
|
}
|
|
/**
|
* 创建流程实例
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_CREATE)
|
public Map<String, Object> instCreat(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
Map<String, Object> 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<String, Object> instDrawBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
Map<String, Object> 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<String, Object> instOver(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instOver(maps);
|
}
|
|
/**
|
* 设置代办
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(CREATE_CHARGE)
|
public Map<String, Object> chargeCreate(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.chargeCreate(maps);
|
}
|
|
/**
|
* 执行流程实例
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_FINISH)
|
public Map<String, Object> instFinish(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
Map<String, Object> 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<String, Object> instSeacheHandle(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instSeacheHandle(maps);
|
}
|
|
/**
|
* 流程实例log(参数为空即查询所有)
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_LOG)
|
public Map<String, Object> instLog(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instLog(maps);
|
}
|
|
/**
|
* 获取所有可退回项目
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(GET_BACK)
|
public Map<String, Object> getBack(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.getBack(maps);
|
}
|
|
/**
|
* 查询代理(参数为空即查询所有信息)
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_AGENT)
|
public Map<String, Object> instAgent(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instAgent(maps);
|
}
|
|
/**
|
* 查询代理去除流程定义信息
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(AGENT_DEFMSG)
|
public Map<String, Object> instAgentDefMsg(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instAgentDefMsg(maps);
|
}
|
|
/**
|
* 查询流程实例(参数都为空,即查询所有)
|
* @param processInst
|
* @return
|
* @throws TimeoutException
|
*/
|
@PostMapping(INST_SEACHE)
|
public Object instSeache(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.instSeache(maps).get("data");
|
}
|
|
/**
|
* 租户注册系统
|
*/
|
@PostMapping(APP_CREATE)
|
public Map<String, Object> appCreate(@RequestBody Map<String,Object> maps) throws TimeoutException{
|
return workFlowServicel.appCreate(maps);
|
}
|
|
}
|