|
@@ -0,0 +1,68 @@
|
|
|
+package com.ruoyi.web.controller.qdtl;
|
|
|
+
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.map.MapUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.http.HttpUtil;
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.qdtl.domain.TlArea;
|
|
|
+import com.ruoyi.qdtl.domain.TlAreaMonitor;
|
|
|
+import com.ruoyi.qdtl.domain.TlMonitor;
|
|
|
+import com.ruoyi.qdtl.service.ITlAreaService;
|
|
|
+import com.ruoyi.qdtl.service.ITlMonitorService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 监控设备管理Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2022-03-02
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/qdtl/common")
|
|
|
+public class TlCommonController extends BaseController
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * 查询监控设备管理列表
|
|
|
+ */
|
|
|
+ @PostMapping("/http")
|
|
|
+ public AjaxResult list(@RequestBody JSONObject jsonObject) {
|
|
|
+ String url = jsonObject.getStr("url");
|
|
|
+ String method = jsonObject.getStr("method");
|
|
|
+ if (StrUtil.isBlank(method)) {
|
|
|
+ method = "post";
|
|
|
+ }
|
|
|
+ String params = jsonObject.getStr("params");
|
|
|
+ String result = "";
|
|
|
+ if ("post".equals(method)) {
|
|
|
+ result = HttpUtil.post(url, params);
|
|
|
+ } else if ("get".equals(method)) {
|
|
|
+ result = HttpUtil.get(url);
|
|
|
+ }
|
|
|
+
|
|
|
+ return AjaxResult.success("请求成功",result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|