Browse Source

发改委预警与超期统计、列表

LIVE_YE 2 năm trước cách đây
mục cha
commit
bef1f6647f

+ 25 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fgw/FgwXmsbController.java

@@ -59,6 +59,31 @@ public class FgwXmsbController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 项目预警列表
+     */
+    @GetMapping("/xmyj/list")
+    @PreAuthorize("@ss.hasPermi('fgw:xmsb:xmyj:list')")
+    public TableDataInfo xmyjList(FgwXmsb fgwXmsb)
+    {
+        startPage();
+        List<FgwXmsb> list = fgwXmsbService.xmyjList(fgwXmsb);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 超期项目列表
+     */
+    @GetMapping("/cqxm/list")
+    @PreAuthorize("@ss.hasPermi('fgw:xmsb:cqxm:list')")
+    public TableDataInfo cqxmList(FgwXmsb fgwXmsb)
+    {
+        startPage();
+        List<FgwXmsb> list = fgwXmsbService.cqxmList(fgwXmsb);
+        return getDataTable(list);
+    }
+
     /**
      * 导出发改委_申报_主列表
      */

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

@@ -20,7 +20,7 @@ spring:
     basename: i18n/messages
   profiles:
     active: druid
-#    active: prod
+    #active: prod
   # 文件上传
   servlet:
      multipart:

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwXmsb.java

@@ -146,6 +146,16 @@ public class FgwXmsb extends BaseEntity
      */
     private String psnr;
 
+    private List<Long> idList;
+
+    public List<Long> getIdList() {
+        return idList;
+    }
+
+    public void setIdList(List<Long> idList) {
+        this.idList = idList;
+    }
+
     public String getPsnr() {
         return psnr;
     }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwDbdMapper.java

@@ -61,4 +61,8 @@ public interface FgwDbdMapper
     public int deleteFgwDbdByIds(Long[] ids);
 
     void updateFgwDbdByDbnrId(@Param("xmId") Long id, @Param("type")String type);
+
+    List<FgwDbd> selectFgwDbdYjxmNum();
+
+    List<FgwDbd> selectFgwDbdCqxmNum();
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwXmsbService.java

@@ -66,4 +66,8 @@ public interface IFgwXmsbService
     List<FgwXmsb> ldpsList(FgwXmsb fgwXmsb);
 
     AjaxResult selectFgwXmsbListAll(FgwXmsb fgwXmsb);
+
+    List<FgwXmsb> xmyjList(FgwXmsb fgwXmsb);
+
+    List<FgwXmsb> cqxmList(FgwXmsb fgwXmsb);
 }

+ 35 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwCommonServiceImpl.java

@@ -2,9 +2,12 @@ package com.ruoyi.system.service.impl.fgw;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.fgw.FgwDbd;
 import com.ruoyi.system.domain.fgw.FgwJzqk;
 import com.ruoyi.system.domain.fgw.FgwXmsb;
 import com.ruoyi.system.domain.projectV2.ZsyzSbbzb;
+import com.ruoyi.system.mapper.fgw.FgwDbdMapper;
 import com.ruoyi.system.service.fgw.IFgwCommonService;
 import com.ruoyi.system.service.fgw.IFgwJzqkService;
 import com.ruoyi.system.service.fgw.IFgwXmsbService;
@@ -34,6 +37,8 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
 
     @Autowired
     private IFgwJzqkService fgwJzqkService;
+    @Autowired
+    private FgwDbdMapper fgwDbdMapper;
 
     /**
      * 首页统计
@@ -48,6 +53,12 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
         map.put("xmk", 0);
         map.put("zfxm", 0);
         map.put("zsxm", 0);
+        //领导批示项目
+        map.put("psxm", 0);
+        //预警项目
+        map.put("yjxm", 0);
+        //超期项目
+        map.put("cqxm", 0);
 
         FgwXmsb xmsb = new FgwXmsb();
         List<FgwXmsb> fgwXmsbs = fgwXmsbService.selectFgwXmsbList(xmsb);
@@ -71,7 +82,28 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
                 }
             }
             map.put("zfxm", fgwXmsbs.size());
+            //领导批示
+            int psxm = 0;
+            for (FgwXmsb fgwXmsb : fgwXmsbs) {
+                if(StringUtils.isNotEmpty(fgwXmsb.getPsnr())){
+                    psxm++;
+                }
+            }
+            map.put("psxm", psxm);
+
+        }
+        //预警项目
+        List<FgwDbd> fgwDbdList = fgwDbdMapper.selectFgwDbdYjxmNum();
+        if(fgwDbdList != null && fgwDbdList.size() > 0){
+            map.put("yjxm", fgwDbdList.size());
         }
+
+        //超期项目
+        List<FgwDbd> fgwDbdListCq = fgwDbdMapper.selectFgwDbdCqxmNum();
+        if(fgwDbdListCq != null && fgwDbdListCq.size() > 0){
+            map.put("cqxm", fgwDbdListCq.size());
+        }
+
         ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
 
         List<ZsyzSbbzb> zsyzSbbzbs = zsyzSbbzbService.selectZsyzSbbzbList(zsyzSbbzb);
@@ -79,6 +111,9 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
             map.put("zsxm", zsyzSbbzbs.size());
         }
 
+
+
+
         return AjaxResult.success(map);
     }
 

+ 26 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwXmsbServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service.impl.fgw;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -177,4 +178,29 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
 
         return AjaxResult.success(map);
     }
+
+    @Override
+    public List<FgwXmsb> xmyjList(FgwXmsb fgwXmsb) {
+        List<FgwDbd> fgwDbdList = fgwDbdMapper.selectFgwDbdYjxmNum();
+        List<FgwXmsb> fgwXmsbList = new ArrayList<>();
+        if(fgwDbdList.size()>0){
+            List<Long> xmidList = fgwDbdList.stream().map(FgwDbd::getXmId).collect(Collectors.toList());
+            fgwXmsb.setIdList(xmidList);
+            fgwXmsbList = fgwXmsbMapper.selectFgwXmsbList(fgwXmsb);
+        }
+
+        return fgwXmsbList;
+    }
+
+    @Override
+    public List<FgwXmsb> cqxmList(FgwXmsb fgwXmsb) {
+        List<FgwDbd> fgwDbdListCq = fgwDbdMapper.selectFgwDbdCqxmNum();
+        List<FgwXmsb> fgwXmsbList = new ArrayList<>();
+        if(fgwDbdListCq.size()>0){
+            List<Long> xmidList = fgwDbdListCq.stream().map(FgwDbd::getXmId).collect(Collectors.toList());
+            fgwXmsb.setIdList(xmidList);
+            fgwXmsbList = fgwXmsbMapper.selectFgwXmsbList(fgwXmsb);
+        }
+        return fgwXmsbList;
+    }
 }

+ 24 - 1
ruoyi-system/src/main/resources/mapper/system/fgw/FgwDbdMapper.xml

@@ -112,7 +112,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             fgw_dbd
         where id = #{id}
     </select>
-        
+    <select id="selectFgwDbdYjxmNum" resultMap="FgwDbdResult">
+        SELECT
+        xm_id
+        FROM
+        fgw_dbd
+        WHERE
+        DATEDIFF(NOW(), yqwcsj) &gt;= - 3
+        AND DATEDIFF(NOW(), yqwcsj) &lt;=0
+        and is_wc = 'N'
+        GROUP BY
+        xm_id
+    </select>
+    <select id="selectFgwDbdCqxmNum" resultMap="FgwDbdResult">
+        SELECT
+            xm_id
+        FROM
+            fgw_dbd
+        WHERE
+            DATEDIFF(NOW(), yqwcsj) &gt;0
+          and is_wc = 'N'
+        GROUP BY
+            xm_id
+    </select>
+
     <insert id="insertFgwDbd" parameterType="FgwDbd" useGeneratedKeys="true" keyProperty="id">
         insert into fgw_dbd
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 10 - 2
ruoyi-system/src/main/resources/mapper/system/fgw/FgwXmsbMapper.xml

@@ -48,7 +48,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectFgwXmsbList" parameterType="FgwXmsb" resultMap="FgwXmsbResult">
         <include refid="selectFgwXmsbVo"/>
-        <where>  
+        <where>
+
+            <if test="idList != null  and idList.size() > 0">
+                and id in
+                <foreach collection="idList" item="id" open="(" close=")" separator="," >
+                    #{id}
+                </foreach>
+            </if>
+
             <if test="xmmc != null  and xmmc != ''"> and xmmc = #{xmmc}</if>
             <if test="xmbh != null  and xmbh != ''"> and xmbh = #{xmbh}</if>
             <if test="xmdw != null  and xmdw != ''"> and xmdw = #{xmdw}</if>
@@ -101,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="ldpsList" resultMap="FgwXmsbResult" parameterType="FgwXmsb">
         <include refid="selectFgwXmsbVo"/>
         <where>
-            psnr is not null
+            psnr is not null and psnr != ''
             <if test="xmmc != null  and xmmc != ''"> and xmmc = #{xmmc}</if>
             <if test="xmbh != null  and xmbh != ''"> and xmbh = #{xmbh}</if>
             <if test="xmdw != null  and xmdw != ''"> and xmdw = #{xmdw}</if>

+ 1 - 1
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzLdpsMapper.xml

@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectZsyzLdpsList" parameterType="ZsyzLdps" resultMap="ZsyzLdpsResult">
         <include refid="selectZsyzLdpsVo"/>
         <where>
-            psnr is not null
+            psnr is not null and psnr != ''
             <if test="xmId != null "> and xm_id = #{xmId}</if>
             <if test="xmbh != null  and xmbh != ''"> and xmbh = #{xmbh}</if>
             <if test="psnr != null  and psnr != ''"> and psnr = #{psnr}</if>