|
@@ -0,0 +1,47 @@
|
|
1
|
+/*
|
|
2
|
+ * The Hefei JingTong RDC(Research and Development Centre) Group.
|
|
3
|
+ * __________________
|
|
4
|
+ *
|
|
5
|
+ * Copyright 2015-2021
|
|
6
|
+ * All Rights Reserved.
|
|
7
|
+ *
|
|
8
|
+ * NOTICE: All information contained herein is, and remains
|
|
9
|
+ * the property of JingTong Company and its suppliers,
|
|
10
|
+ * if any.
|
|
11
|
+ */
|
|
12
|
+
|
|
13
|
+package com.srm.bpm.logic.service.impl;
|
|
14
|
+
|
|
15
|
+import java.util.List;
|
|
16
|
+
|
|
17
|
+import org.springframework.http.ResponseEntity;
|
|
18
|
+import org.springframework.stereotype.Service;
|
|
19
|
+
|
|
20
|
+import com.alibaba.fastjson.JSON;
|
|
21
|
+import com.alibaba.fastjson.JSONObject;
|
|
22
|
+import com.srm.bpm.facde.RestTemplateUtil;
|
|
23
|
+import com.srm.bpm.logic.dto.FlowMsgDTO;
|
|
24
|
+import com.srm.bpm.logic.service.PushMsgLogic;
|
|
25
|
+import com.srm.common.data.rest.R;
|
|
26
|
+import com.srm.config.BpmConfig;
|
|
27
|
+
|
|
28
|
+import lombok.RequiredArgsConstructor;
|
|
29
|
+import lombok.extern.slf4j.Slf4j;
|
|
30
|
+
|
|
31
|
+@Service
|
|
32
|
+@RequiredArgsConstructor
|
|
33
|
+@Slf4j
|
|
34
|
+public class PushMsgLogicImpl implements PushMsgLogic {
|
|
35
|
+ private final RestTemplateUtil restTemplateUtil;
|
|
36
|
+ private final BpmConfig bpmConfig;
|
|
37
|
+
|
|
38
|
+ @Override
|
|
39
|
+ public void push(List<FlowMsgDTO> allMsg) {
|
|
40
|
+ JSONObject data = new JSONObject();
|
|
41
|
+ data.put("msg", JSON.toJSON(allMsg));
|
|
42
|
+ log.info("回调返回的数据:{}", allMsg);
|
|
43
|
+ final ResponseEntity<R> post = restTemplateUtil.post(bpmConfig.getPushmsgUrl(), data, "1");
|
|
44
|
+ log.info("回调返回的数据:{}", post);
|
|
45
|
+ }
|
|
46
|
+}
|
|
47
|
+
|