|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+package com.ruoyi.web.controller.oa;
|
|
|
2
|
+
|
|
|
3
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
4
|
+import com.ruoyi.common.utils.http.HttpUtils;
|
|
|
5
|
+import org.springframework.http.HttpHeaders;
|
|
|
6
|
+import org.springframework.http.MediaType;
|
|
|
7
|
+import org.springframework.http.ResponseEntity;
|
|
|
8
|
+import org.springframework.web.bind.annotation.*;
|
|
|
9
|
+
|
|
|
10
|
+import java.io.UnsupportedEncodingException;
|
|
|
11
|
+import java.net.URLEncoder;
|
|
|
12
|
+import java.nio.charset.StandardCharsets;
|
|
|
13
|
+
|
|
|
14
|
+
|
|
|
15
|
+/**
|
|
|
16
|
+ * cmc招标采购Controller
|
|
|
17
|
+ *
|
|
|
18
|
+ * @author cmc
|
|
|
19
|
+ * @date 2024-04-07
|
|
|
20
|
+ */
|
|
|
21
|
+@RestController
|
|
|
22
|
+@RequestMapping("/oa/bid")
|
|
|
23
|
+public class CmcBidController extends BaseController
|
|
|
24
|
+{
|
|
|
25
|
+ /**
|
|
|
26
|
+ * 查询cmc招标采购列表
|
|
|
27
|
+ */
|
|
|
28
|
+ @GetMapping("/list")
|
|
|
29
|
+ public ResponseEntity<String> list(@RequestParam(value = "keywords", required = false) String keywords,
|
|
|
30
|
+ @RequestParam(value = "type", required = false) String type,
|
|
|
31
|
+ @RequestParam(value = "time", required = false) String time,
|
|
|
32
|
+ @RequestParam(value = "stime", required = false) String stime,
|
|
|
33
|
+ @RequestParam(value = "endtime", required = false) String endtime,
|
|
|
34
|
+ @RequestParam(value = "page", required = false) String page,
|
|
|
35
|
+ @RequestParam(value = "mod", required = false) String mod) throws UnsupportedEncodingException {
|
|
|
36
|
+ String encodedKeywords = URLEncoder.encode(keywords == null ? "" : keywords, StandardCharsets.UTF_8.name());
|
|
|
37
|
+ String html = HttpUtils.sendGet("https://search.bidcenter.com.cn/search", "type=" + (type == null ? "" : type)
|
|
|
38
|
+ + "&time=" + (time == null ? "" : time)
|
|
|
39
|
+ + "&stime=" + (stime == null ? "" : stime)
|
|
|
40
|
+ + "&endtime=" + (endtime == null ? "" : endtime)
|
|
|
41
|
+ + "&page=" + (page == null ? "" : page)
|
|
|
42
|
+ + "&mod=" + (mod == null ? "0" : mod)
|
|
|
43
|
+ + "&keywords=" + encodedKeywords, StandardCharsets.UTF_8.name());
|
|
|
44
|
+ return ResponseEntity.ok()
|
|
|
45
|
+ .header(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML_VALUE + ";charset=UTF-8")
|
|
|
46
|
+ .body(html);
|
|
|
47
|
+ }
|
|
|
48
|
+
|
|
|
49
|
+}
|