wanghongzhi преди 1 година
родител
ревизия
47a7a31df2
променени са 24 файла, в които са добавени 480 реда и са изтрити 57 реда
  1. 14 0
      src/main/java/com/qdport/controller/FlowableController.java
  2. 2 2
      src/main/java/com/qdport/controller/PolicyCaseController.java
  3. 2 2
      src/main/java/com/qdport/controller/PolicyFileController.java
  4. 5 2
      src/main/java/com/qdport/controller/PolicyShareController.java
  5. 2 2
      src/main/java/com/qdport/controller/PolicyStriveController.java
  6. 2 2
      src/main/java/com/qdport/controller/PolicyTodoController.java
  7. 3 9
      src/main/java/com/qdport/entity/PolicyCase.java
  8. 3 6
      src/main/java/com/qdport/entity/PolicyFile.java
  9. 9 5
      src/main/java/com/qdport/entity/PolicyShare.java
  10. 2 5
      src/main/java/com/qdport/entity/PolicyStrive.java
  11. 3 9
      src/main/java/com/qdport/entity/PolicyTodo.java
  12. 1 1
      src/main/java/com/qdport/service/PolicyCaseService.java
  13. 1 1
      src/main/java/com/qdport/service/PolicyFileService.java
  14. 1 1
      src/main/java/com/qdport/service/PolicyShareService.java
  15. 1 1
      src/main/java/com/qdport/service/PolicyStriveService.java
  16. 1 1
      src/main/java/com/qdport/service/PolicyTodoService.java
  17. 3 3
      src/main/java/com/qdport/service/impl/PolicyCaseServiceImpl.java
  18. 1 1
      src/main/java/com/qdport/service/impl/PolicyFileServiceImpl.java
  19. 1 1
      src/main/java/com/qdport/service/impl/PolicyShareServiceImpl.java
  20. 1 1
      src/main/java/com/qdport/service/impl/PolicyStriveServiceImpl.java
  21. 1 1
      src/main/java/com/qdport/service/impl/PolicyTodoServiceImpl.java
  22. 418 0
      src/main/java/com/qdport/util/HttpClientUtil.java
  23. 2 0
      src/main/resources/application-dev.yml
  24. 1 1
      src/main/resources/application.yml

+ 14 - 0
src/main/java/com/qdport/controller/FlowableController.java

@@ -0,0 +1,14 @@
+package com.qdport.controller;
+
+import io.swagger.annotations.Api;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("qdport-zcgx/flawable")
+@Api(value = "审批流相关", tags = "审批流相关")
+@AllArgsConstructor
+public class FlowableController {
+
+}

+ 2 - 2
src/main/java/com/qdport/controller/PolicyCaseController.java

@@ -88,7 +88,7 @@ public class PolicyCaseController extends QdportController {
      */
     @GetMapping("{id}")
     @ApiOperation(value = "详情", notes = "id")
-    public R<PolicyCaseVO> get(@PathVariable("id") Long id) {
+    public R<PolicyCaseVO> get(@PathVariable("id") String id) {
         PolicyCase entity = policyCaseService.getById(id);
         PolicyCaseVO vo = PolicyCaseWrapper.build().entityVO(entity);
 
@@ -226,7 +226,7 @@ public class PolicyCaseController extends QdportController {
     @PostMapping("/remove")
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam(name = "ids") String ids) {
-        List<Long> idList = Func.toLongList(ids);
+        List<String> idList = Func.toStrList(ids);
         policyCaseService.delete(idList);
         return R.success("删除成功");
     }

+ 2 - 2
src/main/java/com/qdport/controller/PolicyFileController.java

@@ -46,7 +46,7 @@ public class PolicyFileController extends QdportController {
     */
     @GetMapping("{id}")
     @ApiOperation(value = "详情", notes = "id")
-    public R<PolicyFileVO> get(@PathVariable("id") Long id){
+    public R<PolicyFileVO> get(@PathVariable("id") String id){
         PolicyFile entity = policyFileService.getById(id);
         return R.data(PolicyFileWrapper.build().entityVO(entity));
     }
@@ -76,7 +76,7 @@ public class PolicyFileController extends QdportController {
     @PostMapping("/remove")
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam(name = "ids") String ids){
-         List<Long> idList = Func.toLongList(ids);
+         List<String> idList = Func.toStrList(ids);
         policyFileService.delete(idList);
         return R.success("删除成功");
     }

+ 5 - 2
src/main/java/com/qdport/controller/PolicyShareController.java

@@ -12,6 +12,7 @@ import com.qdport.service.impl.PolicySystemService;
 import com.qdport.util.StringUtil;
 import com.qdport.vo.PolicyFileVO;
 import com.qdport.vo.PolicyShareVO;
+import com.qdport.workflow.process.controller.feign.IWfProcessClient;
 import com.qdport.wrapper.PolicyShareWrapper;
 import com.qdport.modules.system.entity.SysUser;
 import com.qdport.modules.system.service.TSysUserService;
@@ -47,6 +48,7 @@ public class PolicyShareController extends QdportController {
     private final PolicySystemService policySystemService;
     private final PolicyFileService policyFileService;
     private final PolicyTodoService policyTodoService;
+    private IWfProcessClient wfProcessClient;
 
     /**
      * 分页
@@ -73,7 +75,7 @@ public class PolicyShareController extends QdportController {
      */
     @GetMapping("{id}")
     @ApiOperation(value = "详情", notes = "id")
-    public R<PolicyShareVO> get(@PathVariable("id") Long id) {
+    public R<PolicyShareVO> get(@PathVariable("id") String id) {
         PolicyShare entity = policyShareService.getById(id);
         PolicyShareVO vo = PolicyShareWrapper.build().entityVO(entity);
 
@@ -120,6 +122,7 @@ public class PolicyShareController extends QdportController {
             vo.setStatus(QDPortEnum.POLICY_SHARE_STATUS_APPROVE.getValue());
             policyShareService.update(vo);
         }
+//        wfProcessClient.startProcessByKey()
 
         policyTodoService.save(vo);
         return R.success("新增并且提交成功");
@@ -201,7 +204,7 @@ public class PolicyShareController extends QdportController {
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     @Transactional(rollbackFor = Exception.class)
     public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam(name = "ids") String ids) {
-        List<Long> idList = Func.toLongList(ids);
+        List<String> idList = Func.toStrList(ids);
         policyShareService.delete(idList);
         return R.success("删除成功");
     }

+ 2 - 2
src/main/java/com/qdport/controller/PolicyStriveController.java

@@ -78,7 +78,7 @@ public class PolicyStriveController extends QdportController {
      */
     @GetMapping("{id}")
     @ApiOperation(value = "详情", notes = "id")
-    public R<PolicyStriveVO> get(@PathVariable("id") Long id) {
+    public R<PolicyStriveVO> get(@PathVariable("id") String id) {
         PolicyStrive entity = policyStriveService.getById(id);
 
         PolicyStriveVO vo = PolicyStriveWrapper.build().entityVO(entity);
@@ -228,7 +228,7 @@ public class PolicyStriveController extends QdportController {
     @PostMapping("/remove")
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam(name = "ids") String ids) {
-        List<Long> idList = Func.toLongList(ids);
+        List<String> idList = Func.toStrList(ids);
         policyStriveService.delete(idList);
         return R.success("删除成功");
     }

+ 2 - 2
src/main/java/com/qdport/controller/PolicyTodoController.java

@@ -59,7 +59,7 @@ public class PolicyTodoController extends QdportController {
     */
     @GetMapping("{id}")
     @ApiOperation(value = "详情", notes = "id")
-    public R<PolicyTodoVO> get(@PathVariable("id") Long id){
+    public R<PolicyTodoVO> get(@PathVariable("id") String id){
         PolicyTodo entity = policyTodoService.getById(id);
         return R.data(PolicyTodoWrapper.build().entityVO(entity));
     }
@@ -89,7 +89,7 @@ public class PolicyTodoController extends QdportController {
     @PostMapping("/remove")
     @ApiOperation(value = "逻辑删除", notes = "传入ids")
     public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam(name = "ids") String ids){
-         List<Long> idList = Func.toLongList(ids);
+         List<String> idList = Func.toStrList(ids);
         policyTodoService.delete(idList);
         return R.success("删除成功");
     }

+ 3 - 9
src/main/java/com/qdport/entity/PolicyCase.java

@@ -28,24 +28,18 @@ public class PolicyCase implements Serializable {
 	/**
 	* id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "id")
 	@TableId(
 			value = "id",
-			type = IdType.ASSIGN_ID
+			type = IdType.ASSIGN_UUID
 	)
-	private Long id;
+	private String id;
 
 	/**
 	* 政策争取id
 	*/
     @ApiModelProperty(value = "政策争取id")
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
-	private Long striveId;
+	private String striveId;
 
 	/**
 	* 案例分享编号

+ 3 - 6
src/main/java/com/qdport/entity/PolicyFile.java

@@ -27,15 +27,12 @@ public class PolicyFile implements Serializable {
 	/**
 	* id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "id")
 	@TableId(
 			value = "id",
-			type = IdType.ASSIGN_ID
+			type = IdType.ASSIGN_UUID
 	)
-	private Long id;
+	private String id;
 	@ApiModelProperty(value = "文件名称")
 	private String fileName;
 	@ApiModelProperty(value = "文件类型")
@@ -58,7 +55,7 @@ public class PolicyFile implements Serializable {
 			using = ToStringSerializer.class
 	)
 	@ApiModelProperty(value = "关联id")
-	private Long refId;
+	private String refId;
 	@ApiModelProperty(value = "关联类型")
 	private String refType;
 

+ 9 - 5
src/main/java/com/qdport/entity/PolicyShare.java

@@ -28,15 +28,12 @@ public class PolicyShare implements Serializable {
 	/**
 	* id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "id")
 	@TableId(
 			value = "id",
-			type = IdType.ASSIGN_ID
+			type = IdType.ASSIGN_UUID
 	)
-	private Long id;
+	private String id;
 
 	/**
 	* 政策分享编号
@@ -154,4 +151,11 @@ public class PolicyShare implements Serializable {
 
 	@ApiModelProperty(value = "解读内容")
 	private String decodeContent;
+
+	@ApiModelProperty(value = "流程任务id")
+	private String processTaskId;
+	@ApiModelProperty(value = "流程实例id")
+	private String processInstanceId;
+	@ApiModelProperty(value = "流程模板id")
+	private String processDefinitionId;
 }

+ 2 - 5
src/main/java/com/qdport/entity/PolicyStrive.java

@@ -28,15 +28,12 @@ public class PolicyStrive implements Serializable {
 	/**
 	* id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "id")
 	@TableId(
 			value = "id",
-			type = IdType.ASSIGN_ID
+			type = IdType.ASSIGN_UUID
 	)
-	private Long id;
+	private String id;
 
 	/**
 	* 政策分享编号

+ 3 - 9
src/main/java/com/qdport/entity/PolicyTodo.java

@@ -27,24 +27,18 @@ public class PolicyTodo implements Serializable {
 	/**
 	* id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "id")
 	@TableId(
 			value = "id",
-			type = IdType.ASSIGN_ID
+			type = IdType.ASSIGN_UUID
 	)
-	private Long id;
+	private String id;
 
 	/**
 	* 关联id
 	*/
-	@JsonSerialize(
-			using = ToStringSerializer.class
-	)
     @ApiModelProperty(value = "关联id")
-	private Long refId;
+	private String refId;
 
 	/**
 	* 关联类型

+ 1 - 1
src/main/java/com/qdport/service/PolicyCaseService.java

@@ -20,5 +20,5 @@ public interface PolicyCaseService  extends IService<PolicyCase> {
 
     void update(PolicyCaseVO vo);
 
-    void delete(List<Long> idList);
+    void delete(List<String> idList);
 }

+ 1 - 1
src/main/java/com/qdport/service/PolicyFileService.java

@@ -20,7 +20,7 @@ public interface PolicyFileService  extends IService<PolicyFile> {
 
     void update(PolicyFileVO vo);
 
-    void delete(List<Long> idList);
+    void delete(List<String> idList);
 
     List<PolicyFileVO> getFileList(String refId, String refType);
 }

+ 1 - 1
src/main/java/com/qdport/service/PolicyShareService.java

@@ -23,6 +23,6 @@ public interface PolicyShareService  extends IService<PolicyShare> {
 
     void updateById(PolicyShareVO vo);
 
-    void delete(List<Long> idList);
+    void delete(List<String> idList);
 
 }

+ 1 - 1
src/main/java/com/qdport/service/PolicyStriveService.java

@@ -22,5 +22,5 @@ public interface PolicyStriveService  extends IService<PolicyStrive> {
 
     void updateById(PolicyStriveVO vo);
 
-    void delete(List<Long> idList);
+    void delete(List<String> idList);
 }

+ 1 - 1
src/main/java/com/qdport/service/PolicyTodoService.java

@@ -32,6 +32,6 @@ public interface PolicyTodoService extends IService<PolicyTodo> {
 
     void update(PolicyTodoVO vo);
 
-    void delete(List<Long> idList);
+    void delete(List<String> idList);
 
 }

+ 3 - 3
src/main/java/com/qdport/service/impl/PolicyCaseServiceImpl.java

@@ -72,7 +72,7 @@ public class PolicyCaseServiceImpl extends ServiceImpl<PolicyCaseMapper, PolicyC
         if (!striveWrapper.isEmptyOfEntity()) {
             List<PolicyStrive> striveList = policyStriveService.list(striveWrapper);
             if (!striveList.isEmpty()) {
-                List<Long> idList = striveList.stream().map(PolicyStrive::getId).collect(Collectors.toList());
+                List<String> idList = striveList.stream().map(PolicyStrive::getId).collect(Collectors.toList());
                 wrapper.in("STRIVE_ID", idList);
             }
         }
@@ -105,9 +105,9 @@ public class PolicyCaseServiceImpl extends ServiceImpl<PolicyCaseMapper, PolicyC
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void delete(List<Long> idList) {
+    public void delete(List<String> idList) {
         removeByIds(idList);
-        for (Long id : idList) {
+        for (String id : idList) {
             PolicyStrive strive = new PolicyStrive();
             strive.setId(id);
             strive.setIsCase(0);

+ 1 - 1
src/main/java/com/qdport/service/impl/PolicyFileServiceImpl.java

@@ -59,7 +59,7 @@ public class PolicyFileServiceImpl extends ServiceImpl<PolicyFileMapper, PolicyF
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void delete(List<Long> idList) {
+    public void delete(List<String> idList) {
         removeByIds(idList);
     }
 

+ 1 - 1
src/main/java/com/qdport/service/impl/PolicyShareServiceImpl.java

@@ -103,7 +103,7 @@ public class PolicyShareServiceImpl extends ServiceImpl<PolicyShareMapper, Polic
     }
 
     @Override
-    public void delete(List<Long> idList) {
+    public void delete(List<String> idList) {
         removeByIds(idList);
 
         QueryWrapper<PolicyFile> fileWrapper = new QueryWrapper<>();

+ 1 - 1
src/main/java/com/qdport/service/impl/PolicyStriveServiceImpl.java

@@ -123,7 +123,7 @@ public class PolicyStriveServiceImpl extends ServiceImpl<PolicyStriveMapper, Pol
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void delete(List<Long> idList) {
+    public void delete(List<String> idList) {
         removeByIds(idList);
     }
 

+ 1 - 1
src/main/java/com/qdport/service/impl/PolicyTodoServiceImpl.java

@@ -121,7 +121,7 @@ public class PolicyTodoServiceImpl extends ServiceImpl<PolicyTodoMapper, PolicyT
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void delete(List<Long> idList) {
+    public void delete(List<String> idList) {
         removeByIds(idList);
     }
 

+ 418 - 0
src/main/java/com/qdport/util/HttpClientUtil.java

@@ -0,0 +1,418 @@
+package com.qdport.util;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.text.MessageFormat;
+import java.util.Map;
+
+public class HttpClientUtil {
+    /***
+     * 向指定URL发送POST方法的请求
+     *
+     * @param apiUrl
+     * @param data
+     * @return
+     */
+    public static JSONObject sendPOST(String apiUrl, String data) throws Exception{
+        StringBuffer strBuffer = null;
+        JSONObject obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("POST");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+            // 连接会话
+            httpURLConnection.connect();
+            // 建立输入流,向指向的URL传入参数
+            DataOutputStream dos = new DataOutputStream(httpURLConnection.getOutputStream());
+            // 设置请求参数
+            dos.write(data.getBytes("UTF-8"));
+            dos.flush();
+            dos.close();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+            obj = new JSONObject();
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONObject.parseObject(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("POST请求失败,失败原因: Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static JSONObject sendPOST(String apiUrl) throws Exception {
+        StringBuffer strBuffer = null;
+        JSONObject obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("POST");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+            obj = new JSONObject();
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONObject.parseObject(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("POST请求失败,失败原因: Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static JSONObject sendPOSTWithHeader(String apiUrl, String data, Map<String, String> map) throws Exception {
+        StringBuffer strBuffer = null;
+        JSONObject obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("POST");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+            map.forEach(httpURLConnection::setRequestProperty);
+            // 连接会话
+            httpURLConnection.connect();
+            // 建立输入流,向指向的URL传入参数
+            DataOutputStream dos = new DataOutputStream(httpURLConnection.getOutputStream());
+            // 设置请求参数
+            dos.write(data.getBytes("UTF-8"));
+            dos.flush();
+            dos.close();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+            obj = new JSONObject();
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONObject.parseObject(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("POST请求失败,失败原因: Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static String sendOaGET_USERNAME(String apiUrl) throws Exception{
+        StringBuffer strBuffer = null;
+        String obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("GET");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+
+            httpURLConnection.setRequestProperty("Accept-Charset", "utf-8");
+            httpURLConnection.setRequestProperty("contentType", "utf-8");
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = strBuffer.toString();
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("GET请求失败,失败信息:Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static JSONArray sendGETWithHeader_Arr(String apiUrl, Map<String, String> map) throws Exception{
+        StringBuffer strBuffer = null;
+        JSONArray obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("GET");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+
+            httpURLConnection.setRequestProperty("Accept-Charset", "utf-8");
+            httpURLConnection.setRequestProperty("contentType", "utf-8");
+            map.forEach(httpURLConnection::setRequestProperty);
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONArray.parseArray(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("GET请求失败,失败信息:Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static JSONObject sendGETWithHeader_Obj(String apiUrl, Map<String, String> map) throws Exception{
+        StringBuffer strBuffer = null;
+        JSONObject obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("GET");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+
+            httpURLConnection.setRequestProperty("Accept-Charset", "utf-8");
+            httpURLConnection.setRequestProperty("contentType", "utf-8");
+            map.forEach(httpURLConnection::setRequestProperty);
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONObject.parseObject(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("GET请求失败,失败信息:Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+
+    public static void sendGETWithHeader_OutputStream(String apiUrl, Map<String, String> map,
+                                                      HttpServletRequest request, HttpServletResponse response, String fileName)throws Exception {
+        int byteread = 0;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("GET");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/octet-stream");
+            httpURLConnection.setRequestProperty("Accept-Charset", "utf-8");
+            httpURLConnection.setRequestProperty("contentType", "utf-8");
+            map.forEach(httpURLConnection::setRequestProperty);
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+
+                InputStream inStream = httpURLConnection.getInputStream();
+                response.setContentType("application/pdf");
+                response.setCharacterEncoding("UTF-8");
+                if (request.getHeader("User-Agent").toLowerCase().indexOf("firefox") > 0) {
+                    fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1");// firefox浏览器
+                } else {
+                    fileName = URLEncoder.encode(fileName, "UTF-8");// 其他浏览器包括IE浏览器和google浏览器
+                }
+                response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
+
+                byte[] buffer = new byte[1204];
+                while ((byteread = inStream.read(buffer)) != -1) {
+                    response.getOutputStream().write(buffer, 0, byteread);
+                }
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("GET请求失败,失败信息:Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    /***
+     * 向指定URL发送GET方法的请求
+     *
+     * @return
+     */
+    public static JSONObject sendGET(String apiUrl) throws Exception{
+        StringBuffer strBuffer = null;
+        JSONObject obj = null;
+        try {
+            // 建立连接
+            URL url = new URL(apiUrl);
+            HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
+            // 需要输出
+            httpURLConnection.setDoOutput(true);
+            // 需要输入
+            httpURLConnection.setDoInput(true);
+            // 不允许缓存
+            httpURLConnection.setUseCaches(false);
+
+            httpURLConnection.setRequestMethod("GET");
+            // 设置Headers
+            httpURLConnection.setRequestProperty("Content-Type", "application/json");
+
+            httpURLConnection.setRequestProperty("Accept-Charset", "utf-8");
+            httpURLConnection.setRequestProperty("contentType", "utf-8");
+            // 连接会话
+            httpURLConnection.connect();
+            // 获得响应状态
+            int http_StatusCode = httpURLConnection.getResponseCode();
+            String http_ResponseMessage = httpURLConnection.getResponseMessage();
+
+            if (HttpURLConnection.HTTP_OK == http_StatusCode) {
+                strBuffer = new StringBuffer();
+                String readLine = new String();
+                BufferedReader responseReader = new BufferedReader(
+                        new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
+                while ((readLine = responseReader.readLine()) != null) {
+                    strBuffer.append(readLine);
+                }
+                responseReader.close();
+                obj = JSONObject.parseObject(strBuffer.toString());
+            } else {
+                throw new RuntimeException(
+                        MessageFormat.format("GET请求失败,失败信息:Http状态码 = {0} , {1}", http_StatusCode,
+                                http_ResponseMessage));
+            }
+        } catch (Exception e) {
+            throw e;
+        }
+        return obj;
+    }
+}

+ 2 - 0
src/main/resources/application-dev.yml

@@ -90,3 +90,5 @@ flowable:
     enabled: false
   custom-mybatis-x-m-l-mappers:
     - com/qdport/workflow/process/mapper/WfProcessDefinition.xml
+
+

+ 1 - 1
src/main/resources/application.yml

@@ -76,7 +76,7 @@ qdport:
     support-text-plain: false
   #xss配置
   xss:
-    enabled: true
+    enabled: false
     skip-url:
       - /qdport-chat/weixin
   #多租户配置