Commit a6d31a0c authored by chenhao's avatar chenhao

添加获取流程信息的代码

parent 4a242fb2
......@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW-CJHENHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
......@@ -62,12 +62,12 @@ public interface WorkflowFeignService {
JSONObject getTasksNoAuth(@RequestParam(value="processDefinitionKey", required=false) String processDefinitionKey,
@RequestParam(value="userId", required=false) String userId) ;
/**
* 流程实例-分页
* 流程信息
* @param processDefinitionKey
* @param userId
* @return
*/
@RequestMapping(value = "/activitiHistory/processes", method = RequestMethod.GET)
JSONObject getInstance(@RequestParam(value="name", required=false) String name) ;
@RequestMapping(value = "/activitiHistory/processes/historytasks/list/{processInstanceId}", method = RequestMethod.GET)
JSONObject queryHistoryTaskListByProcessId(@PathVariable("processInstanceId") String processInstanceId);
}
......@@ -101,9 +101,5 @@ public class FailureDetails extends BaseEntity {
*/
@TableField("process_id")
private String processId;
@TableField ("current_role")
private String currentRole;
}
......@@ -183,5 +183,10 @@ public class FailureDetailsController extends BaseController {
String userId = getUserInfo().getUserId();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForPage(page,userId));
}*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
......@@ -35,6 +37,8 @@ import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import rx.internal.util.LinkedArrayList;
/**
* 服务实现类
*
......@@ -214,7 +218,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public boolean excuteTask(Long sequenceNbr, ReginParams userInfo, String condition) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
conditionMap.put("condition", Integer.parseInt(condition));
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
try {
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
......@@ -356,8 +360,23 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Object getCurrentProcessHistoryTask(Long id) {
FailureDetailsDto failureDetailsDto = this.queryBySeq(id);
String processId = failureDetailsDto.getProcessId();
return logger;
JSONObject object= workflowFeignService.queryHistoryTaskListByProcessId(processId);
JSONArray datArray=null;
if(ObjectUtils.isNotEmpty(object)) {
datArray=object.getJSONArray("data");
}
List<Object> list = new ArrayList<Object>();
if(datArray!=null) {
datArray.stream().forEach(i->{
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
//从流程记录表中拿到处理人的名称
detail.replace("operator", null);
list.add(object);
}
});
}
return list;
}
public static String buildOrderNo() {
......
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