|
@@ -7,6 +7,7 @@ import com.ims.eval.config.ImaConfig;
|
|
|
import com.ims.eval.entity.DeptAssessmentDeclaration;
|
|
|
import com.ims.eval.entity.custom.DoAction;
|
|
|
import com.ims.eval.entity.custom.IsOkAction;
|
|
|
+import com.ims.eval.entity.custom.RevocAtion;
|
|
|
import com.ims.eval.entity.custom.TodoTask;
|
|
|
import com.ims.eval.entity.flow.FlowResult;
|
|
|
import com.ims.eval.schedule.ScoreCalculationSchedule;
|
|
@@ -111,6 +112,34 @@ public class WorkflowServiceImpl {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 流程撤回
|
|
|
+ * @param doAction
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public JSONObject revocAtion(RevocAtion doAction, 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"));
|
|
|
+ Map<String, String> map = new LinkedHashMap<>();
|
|
|
+ map.put("instanceId", doAction.getInstanceId());
|
|
|
+ map.put("defId", doAction.getDefId());
|
|
|
+ map.put("action", doAction.getAction());
|
|
|
+ map.put("opinion", doAction.getOpinion());
|
|
|
+ HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/instance/doAction", HttpMethod.GET, param, String.class);
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
+ FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
|
|
|
+ return JSON.parseObject(responseEntity2.getBody());
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取待办任务
|
|
|
*
|
|
|
* @param todoTask
|
|
@@ -152,6 +181,52 @@ public class WorkflowServiceImpl {
|
|
|
|
|
|
|
|
|
/**
|
|
|
+ * 获取待办任务
|
|
|
+ *
|
|
|
+ * @param todoTask
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public FlowResult todoTaskList2(TodoTask todoTask, 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"));
|
|
|
+// MultiValueMap<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(todoTask), LinkedMultiValueMap.class);
|
|
|
+ Map<String, String> map = new LinkedHashMap<>();
|
|
|
+ map.put("iamCode", todoTask.getIamCode());
|
|
|
+ map.put("order", todoTask.getOrder());
|
|
|
+ map.put("sort", todoTask.getSort());
|
|
|
+ map.put("offset", todoTask.getOffset());
|
|
|
+ map.put("limit", todoTask.getLimit());
|
|
|
+ HttpEntity<Map> param = new HttpEntity<>(map, headers);
|
|
|
+ ResponseEntity<String> responseEntity2 = restTemplate.exchange(imaConfig.getFlowUrl() + "/bpm/my/todoTaskList", HttpMethod.POST, param, String.class);
|
|
|
+ log.info("\n code:{}\n header:{}\n body:{}\n", responseEntity2.getStatusCodeValue(), responseEntity2.getHeaders(), responseEntity2.getBody());
|
|
|
+ //
|
|
|
+ if (200 == responseEntity2.getStatusCodeValue()) {
|
|
|
+ FlowResult result = JSON.parseObject(responseEntity2.getBody()).toJavaObject(FlowResult.class);
|
|
|
+ if (result.getIsOk()) {
|
|
|
+ List<JSONObject> ds = new ArrayList<>();
|
|
|
+ for (int i = 0; i < result.getRows().size(); i++) {
|
|
|
+ String typeId = result.getRows().getJSONObject(i).get("typeId").toString();
|
|
|
+ if (!"440219646351376385".equals(typeId) && !"443254180359700481".equals(typeId)) {
|
|
|
+ ds.add(result.getRows().getJSONObject(i));
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.getRows().removeAll(ds);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
* 检查当前数据(对应的用户)是或否存在代办
|
|
|
*
|
|
|
* @param instId
|