Browse Source

完善热力图,修改部分bug

Peach 2 năm trước cách đây
mục cha
commit
44eb936906

+ 7 - 6
guanshi-system/src/main/java/com/ruoyi/system/controller/RestZbGcController.java

@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
@@ -17,9 +18,9 @@ public class RestZbGcController {
 
 
     @GetMapping("/selectAllSumPriceByMon")
-    public AjaxResult selectAllSumPriceByMon(){
+    public AjaxResult selectAllSumPriceByMon(@RequestParam("key")String key){
 
-        return AjaxResult.success(zbGcService.selectAllSumPriceByMon());
+        return AjaxResult.success(zbGcService.selectAllSumPriceByMon(key==""?null:key));
     }
 
     @GetMapping("/getAllCount")
@@ -34,13 +35,13 @@ public class RestZbGcController {
         return AjaxResult.success(zbGcService.getCleanCake());
     }
     @GetMapping("/getTypeByMon")
-    public AjaxResult getTypeByMon(){
-        return AjaxResult.success(zbGcService.getTypeByMon());
+    public AjaxResult getTypeByMon(@RequestParam("key")String key){
+        return AjaxResult.success(zbGcService.getTypeByMon(key==""?null:key));
     }
 
     @GetMapping("/getCountByDepType")
-    public AjaxResult getCountByDepType(){
-        return AjaxResult.success(zbGcService.getCountByDepType());
+    public AjaxResult getCountByDepType(@RequestParam("key")String key){
+        return AjaxResult.success(zbGcService.getCountByDepType(key==""?null:key));
     }
 
     @GetMapping("/getSumPriceByAddr")

+ 20 - 5
guanshi-system/src/main/java/com/ruoyi/system/mapper/ZbGcMapper.java

@@ -24,6 +24,13 @@ public interface ZbGcMapper
      */
     public Integer selectAllCount();
 
+    /**
+     * 查询招标网工程类爬虫未处理总数
+     *
+     * @return 招标网工程类爬虫脏数据总数
+     */
+
+    public Integer selectAllIsDirty();
 
     /**
      * 查询招标网工程类爬虫未处理总数
@@ -49,6 +56,14 @@ public interface ZbGcMapper
     public List<Map<String,Integer>> selectAllDoneByType();
 
 
+    /**
+     * 按照标书类型查询招标网工程类模糊数据爬虫总数
+     *
+     * @return 分类招标网工程类爬虫数
+     */
+    public List<Map<String,Integer>> selectAllDirtyByType();
+
+
     /**
      * 查询招标网工程类爬虫中标金额总数
      *
@@ -62,7 +77,7 @@ public interface ZbGcMapper
      *
      * @return 招标网工程类爬虫中标总数
      */
-    public List<Map<String,Integer>> selectAllCountJGByMon();
+    public List<Map<String,Integer>> selectAllCountJGByMon(@Param("searchKey") String key);
 
 
     /**
@@ -70,12 +85,12 @@ public interface ZbGcMapper
      *
      * @return 招标网工程类爬虫公告总数
      */
-    public List<Map<String,Integer>> selectAllCountGGByMon();
+    public List<Map<String,Integer>> selectAllCountGGByMon(@Param("searchKey") String key);
 
 
-    public List<Map<String,Integer>> selectAllZBCountByDepDateOne();
+    public List<Map<String,Integer>> selectAllZBCountByDepDateOne(@Param("searchKey") String key);
 
-    public List<Map<String,Integer>> selectAllZBCountByDepDateTwo();
+    public List<Map<String,Integer>> selectAllZBCountByDepDateTwo(@Param("searchKey") String key);
 
     public List<String> selectAddrBySearchKey();
 
@@ -86,7 +101,7 @@ public interface ZbGcMapper
      *
      * @return 招标网工程类爬虫中标金额总数
      */
-    public List<Map<String,BigDecimal>> selectAllSumPriceByMon();
+    public List<Map<String,BigDecimal>> selectAllSumPriceByMon(@Param("searchKey") String key);
 
 
     /**

+ 3 - 3
guanshi-system/src/main/java/com/ruoyi/system/service/IZbGcService.java

@@ -23,15 +23,15 @@ public interface IZbGcService
      *
      * @return 招标网工程类爬虫中标金额总数
      */
-    public List<Map<String,BigDecimal>> selectAllSumPriceByMon();
+    public List<Map<String,BigDecimal>> selectAllSumPriceByMon(String key);
 
     public Map<String,Integer> getAllCount();
 
     public List<Map<String,Integer>> getCleanCake();
 
-    public  Map<String,List<Map<String, Integer>>> getCountByDepType();
+    public  Map<String,List<Map<String, Integer>>> getCountByDepType(String key);
 
-    public  Map<String,List<Map<String, Integer>>> getTypeByMon();
+    public  Map<String,List<Map<String, Integer>>> getTypeByMon(String key);
 
 
 

+ 13 - 8
guanshi-system/src/main/java/com/ruoyi/system/service/impl/ZbGcServiceImpl.java

@@ -30,8 +30,8 @@ public class ZbGcServiceImpl implements IZbGcService
 
 
     @Override
-    public List<Map<String,BigDecimal>> selectAllSumPriceByMon() {
-        return zbGcMapper.selectAllSumPriceByMon();
+    public List<Map<String,BigDecimal>> selectAllSumPriceByMon(String key) {
+        return zbGcMapper.selectAllSumPriceByMon(key);
     }
 
     @Override
@@ -39,6 +39,7 @@ public class ZbGcServiceImpl implements IZbGcService
         HashMap<String,Integer> hashMap=new HashMap();
         hashMap.put("clean",zbGcMapper.selectAllCount());
         hashMap.put("noClean", zbGcMapper.selectAllIsNull());
+        hashMap.put("dirty", zbGcMapper.selectAllIsDirty());
 
         return hashMap;
     }
@@ -54,23 +55,27 @@ public class ZbGcServiceImpl implements IZbGcService
             list.add(zb);
         }
 
+        for (Map<String, Integer> zb:zbGcMapper.selectAllDirtyByType()){
+            list.add(zb);
+        }
         return list;
 
+
     }
 
     @Override
-    public Map<String,List<Map<String, Integer>>> getCountByDepType() {
+    public Map<String,List<Map<String, Integer>>> getCountByDepType(String key) {
         Map<String,List<Map<String, Integer>>> map=new HashMap<>();
-        map.put("gs",zbGcMapper.selectAllZBCountByDepDateOne());
-        map.put("dw",zbGcMapper.selectAllZBCountByDepDateTwo());
+        map.put("gs",zbGcMapper.selectAllZBCountByDepDateOne(key));
+        map.put("dw",zbGcMapper.selectAllZBCountByDepDateTwo(key));
         return map;
     }
 
     @Override
-    public Map<String,List<Map<String, Integer>>> getTypeByMon() {
+    public Map<String,List<Map<String, Integer>>> getTypeByMon(String key) {
         Map<String,List<Map<String, Integer>>> map=new HashMap<>();
-        map.put("gg",zbGcMapper.selectAllCountGGByMon());
-        map.put("jg",zbGcMapper.selectAllCountJGByMon());
+        map.put("gg",zbGcMapper.selectAllCountGGByMon(key));
+        map.put("jg",zbGcMapper.selectAllCountJGByMon(key));
         return map;
     }
 

+ 42 - 10
guanshi-system/src/main/resources/mapper/system/ZbGcMapper.xml

@@ -52,6 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT count(id) as 'count' FROM zb_gc WHERE regex=-1
     </select>
 
+    <select id="selectAllIsDirty"  resultType="Integer">
+        SELECT count(id) as 'count' FROM zb_gc WHERE regex=3
+    </select>
+
     <select id="selectAllNotDoneByType"  resultType="Map">
         SELECT type,count(id) as 'count' FROM zb_gc WHERE regex is not null and regex =-1 GROUP BY type
     </select>
@@ -60,21 +64,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT type,count(id) as 'count' FROM zb_gc WHERE regex is not null  GROUP BY type
     </select>
 
+    <select id="selectAllDirtyByType"  resultType="Map">
+        SELECT type,count(id) as 'count' FROM zb_gc WHERE regex is not null and regex =3 GROUP BY type
+    </select>
+
     <select id="selectAllSumPrice" resultType="BigDecimal">
         SELECT sum(price) as 'sum' FROM zb_gc WHERE regex =1 and type='中标结果公示'
     </select>
 
-    <select id="selectAllCountJGByMon" resultType="Map">
-        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc  WHERE regex =1 and type='中标结果公示' and time>'2021-06'  group by DATE_FORMAT(time,'%Y-%m')
+    <select id="selectAllCountJGByMon" parameterType="String" resultType="Map">
+        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc
+
+        where
+            regex =1 and
+            type='中标结果公示' and
+        time <![CDATA[>]]> '2021-06'
+            <if test="searchKey != null  and searchKey != ''"> and search_key = #{searchKey}</if>
+        group by DATE_FORMAT(time,'%Y-%m')
     </select>
 
-    <select id="selectAllCountGGByMon" resultType="Map">
-        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告'  and time>'2021-06' group by DATE_FORMAT(time,'%Y-%m')
+    <select id="selectAllCountGGByMon" parameterType="String" resultType="Map">
+        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc
+      where
+            regex =1 and
+            type='招标公告' and  time <![CDATA[>]]> '2021-06'
+            <if test="searchKey != null  and searchKey != ''"> and search_key = #{searchKey}</if>
+        group by DATE_FORMAT(time,'%Y-%m')
     </select>
 
 
-    <select id="selectAllSumPriceByMon" resultType="map">
-        select DATE_FORMAT(time,'%Y-%m') as 'mon',COALESCE(sum(price),0) as 'price' from zb_gc WHERE regex =1 and type='中标结果公示'  group by DATE_FORMAT(time,'%Y-%m')
+    <select id="selectAllSumPriceByMon" parameterType="String" resultType="map">
+        select DATE_FORMAT(time,'%Y-%m') as 'mon',COALESCE(sum(price),0) as 'price' from zb_gc
+
+        WHERE regex =1 and type='中标结果公示'
+        <if test="searchKey != null  and searchKey != ''"> and search_key = #{searchKey}</if>
+        group by DATE_FORMAT(time,'%Y-%m')
     </select>
 
     <select id="selectAllJGCountByDep" resultType="Map">
@@ -92,12 +116,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select  COALESCE(sum(price),0) as 'value',REPLACE(search_key,' 工程','') as 'name'  from zb_gc WHERE regex =1 and search_key=#{key}
     </select>
 
-    <select id="selectAllZBCountByDepDateOne" resultType="map">
-        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=1   group by DATE_FORMAT(time,'%Y-%m')
+    <select id="selectAllZBCountByDepDateOne" parameterType="String"  resultType="map">
+        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc
+
+        WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=1
+        <if test="searchKey != null  and searchKey != ''"> and search_key = #{searchKey}</if>
+        group by DATE_FORMAT(time,'%Y-%m')
     </select>
 
-    <select id="selectAllZBCountByDepDateTwo" resultType="map">
-        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=2   group by DATE_FORMAT(time,'%Y-%m')
+    <select id="selectAllZBCountByDepDateTwo" parameterType="String"  resultType="map">
+        select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc
+
+        WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=2
+        <if test="searchKey != null  and searchKey != ''"> and search_key = #{searchKey}</if>
+        group by DATE_FORMAT(time,'%Y-%m')
     </select>
 
     <select id="selectZbGcById" parameterType="Long" resultMap="ZbGcResult">