Bläddra i källkod

添加已办接口

全业务考评 10 månader sedan
förälder
incheckning
923853b2bd

+ 37 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/WorkflowController.java

@@ -137,6 +137,43 @@ public class WorkflowController {
 
 
 
+	/**
+	 * 根据任务id;获取任务信息
+	 * @param taskId
+	 * @return
+	 */
+	@PostMapping(value = "getTaskData")
+	public R getOpinion(@RequestParam(value = "taskId", required = false) String taskId) {
+		JSONObject json = null;
+		try {
+			json = workflowServiceImpl.getTaskData(taskId,request);
+		} catch (Exception e) {
+			log.error("错误",e);
+			return R.error().customError("获取任务信息见失败");
+		}
+		return R.ok().data(json);
+	}
+
+
+	/**
+	 * 获取已办列表
+	 * @param offset
+	 * @return
+	 */
+	@PostMapping(value = "getAppRoveList")
+	public R getOpinion(@RequestParam(value = "offset") Integer offset,
+						@RequestParam(value = "limit") Integer limit) {
+		JSONObject json = null;
+		try {
+			json = workflowServiceImpl.getAppRoveList(offset,limit,request);
+		} catch (Exception e) {
+			log.error("错误",e);
+			return R.error().customError("获取已办列表");
+		}
+		return R.ok().data(json);
+	}
+
+
 
 
 

+ 53 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/custom/impl/WorkflowServiceImpl.java

@@ -391,6 +391,59 @@ public class WorkflowServiceImpl {
 	}
 
 
+
+	public JSONObject getTaskData(String taskId,HttpServletRequest request) {
+
+		HttpHeaders headers = new HttpHeaders();
+		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
+		headers.add("code", request.getHeader("code"));
+		headers.setContentType(MediaType.MULTIPART_FORM_DATA);
+		MultiValueMap<String, Object> map= new LinkedMultiValueMap<String, Object>();
+
+		map.add("taskId", taskId);
+
+		HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
+		//  执行HTTP请求
+		ResponseEntity<String> responseEntity2  = restTemplate.postForEntity(imaConfig.getFlowUrl() + "/bpm/task/getTaskData", requestEntity, String.class);
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		//
+		if (200 == responseEntity2.getStatusCodeValue()) {
+			return JSON.parseObject(responseEntity2.getBody());
+		}
+		return null;
+
+	}
+
+
+	public JSONObject getAppRoveList(int offset,int limit,HttpServletRequest request) {
+
+		HttpHeaders headers = new HttpHeaders();
+		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
+		headers.add("Blade-Auth", request.getHeader("Blade-Auth"));
+		headers.add("code", request.getHeader("code"));
+		headers.setContentType(MediaType.MULTIPART_FORM_DATA);
+		MultiValueMap<String, Object> map= new LinkedMultiValueMap<String, Object>();
+
+
+		map.add("offset", (offset-1)*limit);
+		map.add("limit", limit);
+
+
+		HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
+		//  执行HTTP请求
+		ResponseEntity<String> responseEntity2  = restTemplate.postForEntity(imaConfig.getFlowUrl() + "/bpm/my/approveList", requestEntity, String.class);
+		log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
+		//
+		if (200 == responseEntity2.getStatusCodeValue()) {
+			return JSON.parseObject(responseEntity2.getBody());
+		}
+		return null;
+
+	}
+
+
+
 	private boolean updateWorkflowState(String instId, String defKey, String bizKey, String taskName, String destination) {
 
 		switch (defKey) {