Commit 4ab78d56 authored by lisong's avatar lisong

更新流程日志查询

parent b1e659f4
...@@ -11,5 +11,5 @@ import java.util.Map; ...@@ -11,5 +11,5 @@ import java.util.Map;
@Repository @Repository
public interface PipeMapper extends BaseMapper<Pipe> { public interface PipeMapper extends BaseMapper<Pipe> {
Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> page,@Param("sequenceNbr") Long sequenceNbr, @Param("type") String type, @Param("tableName")String tableName ); Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> page,@Param("instanceId") Long instanceId);
} }
...@@ -8,5 +8,5 @@ public interface IPipeService { ...@@ -8,5 +8,5 @@ public interface IPipeService {
void addPipeMessage(String jsonMessage, Long projectId); void addPipeMessage(String jsonMessage, Long projectId);
Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> mapPage, Long sequenceNbr, String type); Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> mapPage, Long instanceId);
} }
...@@ -8,11 +8,9 @@ ...@@ -8,11 +8,9 @@
il.rec_user_name userName, il.rec_user_name userName,
il.rec_date as date il.rec_date as date
FROM FROM
${tableName} AS temp tz_ugp_initiation_log AS il
LEFT JOIN tz_ugp_initiation_log AS il ON temp.instance_id = il.instance_id
WHERE WHERE
temp.sequence_nbr = #{sequenceNbr} il.instanceId = #{instanceId}
and il.type = #{type}
ORDER BY ORDER BY
il.rec_date il.rec_date
......
...@@ -185,12 +185,11 @@ public class PipeController extends BaseController { ...@@ -185,12 +185,11 @@ public class PipeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getOperationalLogs") @GetMapping(value = "/getOperationalLogs")
@ApiOperation(httpMethod = "GET", value = "通用流程操作日志查询", notes = "通用流程操作日志查询") @ApiOperation(httpMethod = "GET", value = "通用流程操作日志查询", notes = "通用流程操作日志查询")
public ResponseModel<Object> getOperationalLogs(@RequestParam("sequenceNbr") Long sequenceNbr, public ResponseModel<Object> getOperationalLogs(@RequestParam("instanceId") Long instanceId,
@RequestParam("type") String type,
@RequestParam("current") int current, @RequestParam("current") int current,
@RequestParam("size") int size) { @RequestParam("size") int size) {
Page<Map<String, Object>> mapPage = new Page(current, size); Page<Map<String, Object>> mapPage = new Page(current, size);
Page<Map<String, Object>> operationalLogs = pipeService.getOperationalLogs(mapPage, sequenceNbr, type); Page<Map<String, Object>> operationalLogs = pipeService.getOperationalLogs(mapPage, instanceId);
return ResponseHelper.buildResponse(operationalLogs); return ResponseHelper.buildResponse(operationalLogs);
} }
...@@ -202,71 +201,5 @@ public class PipeController extends BaseController { ...@@ -202,71 +201,5 @@ public class PipeController extends BaseController {
return ResponseHelper.buildResponse("https://img0.baidu.com/it/u=887570163,3972811143&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500"); return ResponseHelper.buildResponse("https://img0.baidu.com/it/u=887570163,3972811143&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500");
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test")
@ApiOperation(httpMethod = "GET", value = "通用流程操作日志查询", notes = "通用流程操作日志查询")
public ResponseModel<Object> test(@RequestParam("id") String instanceId) {
try {
AjaxResult ajaxResult1 = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult1.get("data")));
String instanceId1 = ((Map)ajaxResult1.get("data")).get("id").toString();
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test1")
@ApiOperation(httpMethod = "GET", value = "通用流程操作日志查询", notes = "通用流程操作日志查询")
public ResponseModel<Object> test1(@RequestParam("id") String instanceId) {
try {
//执行流程
TaskResultDTO dto1 = new TaskResultDTO();
dto1.setResult("1");
dto1.setResultCode("condition");
dto1.setTaskId(instanceId);
// HashMap<String, Object> var = new HashMap<>();
// var.put("condition", 0);
// dto1.setVariable(var);
AjaxResult ajaxResult1 = Workflow.taskClient.getTask(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult1.get("data")));
String instanceId1 = ((Map)ajaxResult1.get("data")).get("id").toString();
AjaxResult ajaxResult = Workflow.taskClient.completeByTask(instanceId1, dto1);
if (ObjectUtils.isEmpty(ajaxResult)){
}
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/test2")
@ApiOperation(httpMethod = "GET", value = "通用流程操作日志查询", notes = "通用流程操作日志查询")
public ResponseModel<Object> test2(@RequestParam("id") String instanceId) {
try {
ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
dto.setProcessDefinitionKey("rengongchuliliucheng");
dto.setBusinessKey("1");
HashMap<String, Object> map = new HashMap<>();
map.put("type" , 2);
map.put("condition" , 1);
dto.setVariables(map);
AjaxResult ajaxResult = Workflow.taskClient.startByVariable(dto);
if (ObjectUtils.isEmpty(ajaxResult)){
}
} catch (Exception e) {
e.printStackTrace();
}
return ResponseHelper.buildResponse(null);
}
} }
...@@ -42,17 +42,7 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp ...@@ -42,17 +42,7 @@ public class IPipeServiceImpl extends BaseService<PipeDto, Pipe, PipeMapper> imp
} }
@Override @Override
public Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> mapPage, Long sequenceNbr, String type) { public Page<Map<String, Object>> getOperationalLogs(Page<Map<String, Object>> mapPage, Long instanceId) {
if (type.equals(ProcessTypeEnum.问题处理.getType())) { return pipeMapper.getOperationalLogs(mapPage, instanceId);
return pipeMapper.getOperationalLogs(mapPage, sequenceNbr, type, ProcessTypeEnum.问题处理.getTableName());
} else if (type.equals(ProcessTypeEnum.项目立项.getType())) {
return pipeMapper.getOperationalLogs(mapPage, sequenceNbr, type, ProcessTypeEnum.项目立项.getTableName());
} else if (type.equals(ProcessTypeEnum.项目结项.getType())) {
return pipeMapper.getOperationalLogs(mapPage, sequenceNbr, type, ProcessTypeEnum.项目结项.getTableName());
} else if (type.equals(ProcessTypeEnum.人工处理.getType())) {
return pipeMapper.getOperationalLogs(mapPage, sequenceNbr, type, ProcessTypeEnum.人工处理.getTableName());
} else {
return null;
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment