소스 검색

新增统计项目整体概况

Administrator 2 년 전
부모
커밋
fdc52612ec

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/fgw/FgwCommonController.java

@@ -123,4 +123,15 @@ public class FgwCommonController {
     public AjaxResult hbjd() {
         return fgwCommonService.hbjd();
     }
+
+    /**
+     * 统计项目整体概况
+     *
+     * @return
+     */
+    @PostMapping("/xmztgk")
+    @PreAuthorize("@ss.hasPermi('fgw:common:xmztgk')")
+    public AjaxResult xmztgk() {
+        return fgwCommonService.xmztgk();
+    }
 }

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

@@ -53,7 +53,7 @@ public class FgwXmsb extends BaseEntity
 
     /** 项目总投资 */
     @Excel(name = "项目总投资")
-    private String xmztz;
+    private Long xmztz;
 
     /** 上级补助 */
     @Excel(name = "上级补助")
@@ -77,7 +77,7 @@ public class FgwXmsb extends BaseEntity
 
     /** 年度计划完成投资 */
     @Excel(name = "年度计划完成投资")
-    private String ndjh;
+    private Long ndjh;
 
     /** 上级补助资金渠道 */
     @Excel(name = "上级补助资金渠道")
@@ -122,7 +122,7 @@ public class FgwXmsb extends BaseEntity
 
     /** 纳统项目完成投资 */
     @Excel(name = "纳统项目完成投资")
-    private String ntxmtc;
+    private Long ntxmtc;
 
     /** 申报状态 1:申报库 2:项目库 */
     @Excel(name = "申报状态 1:申报库 2:项目库")
@@ -342,15 +342,7 @@ public class FgwXmsb extends BaseEntity
     {
         return jhkgsj;
     }
-    public void setXmztz(String xmztz) 
-    {
-        this.xmztz = xmztz;
-    }
 
-    public String getXmztz() 
-    {
-        return xmztz;
-    }
     public void setSjbz(String sjbz) 
     {
         this.sjbz = sjbz;
@@ -396,16 +388,16 @@ public class FgwXmsb extends BaseEntity
     {
         return rz;
     }
-    public void setNdjh(String ndjh) 
-    {
-        this.ndjh = ndjh;
-    }
 
-    public String getNdjh() 
-    {
+    public Long getNdjh() {
         return ndjh;
     }
-    public void setSjbzzjqd(String sjbzzjqd) 
+
+    public void setNdjh(Long ndjh) {
+        this.ndjh = ndjh;
+    }
+
+    public void setSjbzzjqd(String sjbzzjqd)
     {
         this.sjbzzjqd = sjbzzjqd;
     }
@@ -486,16 +478,24 @@ public class FgwXmsb extends BaseEntity
     {
         return ntsj;
     }
-    public void setNtxmtc(String ntxmtc) 
-    {
-        this.ntxmtc = ntxmtc;
+
+    public Long getXmztz() {
+        return xmztz;
     }
 
-    public String getNtxmtc() 
-    {
+    public void setXmztz(Long xmztz) {
+        this.xmztz = xmztz;
+    }
+
+    public Long getNtxmtc() {
         return ntxmtc;
     }
-    public void setType(String type) 
+
+    public void setNtxmtc(Long ntxmtc) {
+        this.ntxmtc = ntxmtc;
+    }
+
+    public void setType(String type)
     {
         this.type = type;
     }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwCommonService.java

@@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
  */
 public interface IFgwCommonService {
     AjaxResult index();
+    AjaxResult xmztgk();
 
     /**
      * 本周汇报进度

+ 31 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwCommonServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service.impl.fgw;
 
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -63,9 +64,9 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
         FgwXmsb xmsb = new FgwXmsb();
         List<FgwXmsb> fgwXmsbs = fgwXmsbService.selectFgwXmsbList(xmsb);
         if (fgwXmsbs != null && fgwXmsbs.size() > 0) {
-            Map<String, List<FgwXmsb>> collect = fgwXmsbs.stream().collect(Collectors.groupingBy(FgwXmsb::getStatus));
+            Map<String, List<FgwXmsb>> collect = fgwXmsbs.stream().collect(Collectors.groupingBy(FgwXmsb::getIsWt));
             if (collect != null && collect.size() > 0) {
-                List<FgwXmsb> fgwXmsbsWt = collect.get(THR);
+                List<FgwXmsb> fgwXmsbsWt = collect.get("Y");
                 if (fgwXmsbsWt != null && fgwXmsbsWt.size() > 0) {
                     map.put("wtxm", fgwXmsbsWt.size());
                 }
@@ -117,6 +118,34 @@ public class FgwCommonServiceImpl implements IFgwCommonService {
         return AjaxResult.success(map);
     }
 
+    /**
+     * 项目整体概况
+     * @return
+     */
+    @Override
+    @DataScope(deptAlias = "d")
+    public AjaxResult xmztgk() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("xmzs", 0);
+        map.put("xmztz", 0);
+        map.put("jstz", 0);
+        map.put("nttz", 0);
+
+        FgwXmsb xmsb = new FgwXmsb();
+        xmsb.setType(TWO);
+        List<FgwXmsb> fgwXmsbs = fgwXmsbService.selectFgwXmsbList(xmsb);
+        if (fgwXmsbs != null && fgwXmsbs.size() > 0){
+            map.put("xmzs", fgwXmsbs.size());
+            long xmztz = fgwXmsbs.stream().mapToLong(FgwXmsb::getXmztz).sum();
+            long jstz = fgwXmsbs.stream().mapToLong(FgwXmsb::getNdjh).sum();
+            long nttz = fgwXmsbs.stream().mapToLong(FgwXmsb::getNtxmtc).sum();
+            map.put("xmztz", xmztz);
+            map.put("jstz", jstz);
+            map.put("nttz", nttz);
+        }
+        return AjaxResult.success(map);
+    }
+
     /**
      * 本周汇报进度
      *

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

@@ -66,6 +66,7 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService {
      * @return 发改委_申报_主
      */
     @Override
+    @DataScope(deptAlias = "d")
     public List<FgwXmsb> selectFgwXmsbList(FgwXmsb fgwXmsb) {
         return fgwXmsbMapper.selectFgwXmsbList(fgwXmsb);
     }

+ 36 - 35
ruoyi-system/src/main/resources/mapper/system/fgw/FgwXmsbMapper.xml

@@ -55,55 +55,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectFgwXmsbList" parameterType="FgwXmsb" resultMap="FgwXmsbResult">
-        <include refid="selectFgwXmsbVo"/>
+        select d.id, d.xmmc, d.xmbh,d.nkgsj,d.jgsj,d.njgsj,d.nttz,d.xmbq,d.is_js,d.is_wt,d.wt_type, d.xmdw, d.qtzrdw, d.qtsld, d.gmnr, d.jhkgsj, d.xmztz, d.sjbz, d.sczbj, d.zxz, d.ppp, d.rz, d.ndjh, d.sjbzzjqd, d.rzqd, d.dq, d.jsdw, d.js_dept_id, d.dept_id,d.dept_name, d.user_id, d.kgsj, d.ntsj, d.ntxmtc, d.type, d.progress, d.status, d.create_by, d.create_time, d.update_by, d.update_time, d.remark,d.psnr from fgw_xmsb d
+
         <where>
 
             <if test="idList != null  and idList.size() > 0">
-                and id in
+                and d.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>
-            <if test="qtzrdw != null  and qtzrdw != ''"> and qtzrdw = #{qtzrdw}</if>
-            <if test="qtsld != null  and qtsld != ''"> and qtsld = #{qtsld}</if>
-            <if test="gmnr != null  and gmnr != ''"> and gmnr = #{gmnr}</if>
-            <if test="jhkgsj != null "> and jhkgsj = #{jhkgsj}</if>
-            <if test="xmztz != null  and xmztz != ''"> and xmztz = #{xmztz}</if>
-            <if test="sjbz != null  and sjbz != ''"> and sjbz = #{sjbz}</if>
-            <if test="sczbj != null  and sczbj != ''"> and sczbj = #{sczbj}</if>
-            <if test="zxz != null  and zxz != ''"> and zxz = #{zxz}</if>
-            <if test="ppp != null  and ppp != ''"> and ppp = #{ppp}</if>
-            <if test="rz != null  and rz != ''"> and rz = #{rz}</if>
-            <if test="ndjh != null  and ndjh != ''"> and ndjh = #{ndjh}</if>
-            <if test="sjbzzjqd != null  and sjbzzjqd != ''"> and sjbzzjqd = #{sjbzzjqd}</if>
-            <if test="rzqd != null  and rzqd != ''"> and rzqd = #{rzqd}</if>
-            <if test="dq != null  and dq != ''"> and dq = #{dq}</if>
-            <if test="jsdw != null  and jsdw != ''"> and jsdw = #{jsdw}</if>
-            <if test="jsDeptId != null "> and js_dept_id = #{jsDeptId}</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="deptName != null "> and dept_name = #{deptName}</if>
-            <if test="userId != null "> and user_id = #{userId}</if>
-            <if test="kgsj != null "> and kgsj = #{kgsj}</if>
-            <if test="ntsj != null "> and ntsj = #{ntsj}</if>
-            <if test="ntxmtc != null  and ntxmtc != ''"> and ntxmtc = #{ntxmtc}</if>
-            <if test="type != null  and type != ''"> and type = #{type}</if>
-            <if test="progress != null  and progress != ''"> and progress = #{progress}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="isWt != null  and isWt != ''"> and is_wt = #{isWt}</if>
-            <if test="wtType != null  and wtType != ''"> and wt_type = #{wtType}</if>
+            <if test="xmmc != null  and xmmc != ''"> and d.xmmc = #{xmmc}</if>
+            <if test="xmbh != null  and xmbh != ''"> and d.xmbh = #{xmbh}</if>
+            <if test="xmdw != null  and xmdw != ''"> and d.xmdw = #{xmdw}</if>
+            <if test="qtzrdw != null  and qtzrdw != ''"> and d.qtzrdw = #{qtzrdw}</if>
+            <if test="qtsld != null  and qtsld != ''"> and d.qtsld = #{qtsld}</if>
+            <if test="gmnr != null  and gmnr != ''"> and d.gmnr = #{gmnr}</if>
+            <if test="jhkgsj != null "> and d.jhkgsj = #{jhkgsj}</if>
+            <if test="xmztz != null  and xmztz != ''"> and d.xmztz = #{xmztz}</if>
+            <if test="sjbz != null  and sjbz != ''"> and d.sjbz = #{sjbz}</if>
+            <if test="sczbj != null  and sczbj != ''"> and d.sczbj = #{sczbj}</if>
+            <if test="zxz != null  and zxz != ''"> and d.zxz = #{zxz}</if>
+            <if test="ppp != null  and ppp != ''"> and d.ppp = #{ppp}</if>
+            <if test="rz != null  and rz != ''"> and d.rz = #{rz}</if>
+            <if test="ndjh != null  and ndjh != ''"> and d.ndjh = #{ndjh}</if>
+            <if test="sjbzzjqd != null  and sjbzzjqd != ''"> and d.sjbzzjqd = #{sjbzzjqd}</if>
+            <if test="rzqd != null  and rzqd != ''"> and d.rzqd = #{rzqd}</if>
+            <if test="dq != null  and dq != ''"> and d.dq = #{dq}</if>
+            <if test="jsdw != null  and jsdw != ''"> and d.jsdw = #{jsdw}</if>
+            <if test="jsDeptId != null "> and d.js_dept_id = #{jsDeptId}</if>
+            <if test="deptId != null "> and d.dept_id = #{deptId}</if>
+            <if test="deptName != null "> and d.dept_name = #{deptName}</if>
+            <if test="userId != null "> and d.user_id = #{userId}</if>
+            <if test="kgsj != null "> and d.kgsj = #{kgsj}</if>
+            <if test="ntsj != null "> and d.ntsj = #{ntsj}</if>
+            <if test="ntxmtc != null  and ntxmtc != ''"> and d.ntxmtc = #{ntxmtc}</if>
+            <if test="type != null  and type != ''"> and d.type = #{type}</if>
+            <if test="progress != null  and progress != ''"> and d.progress = #{progress}</if>
+            <if test="status != null  and status != ''"> and d.status = #{status}</if>
+            <if test="isWt != null  and isWt != ''"> and d.is_wt = #{isWt}</if>
+            <if test="wtType != null  and wtType != ''"> and d.wt_type = #{wtType}</if>
             <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
-                AND date_format(create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+                AND date_format(d.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
             </if>
             <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
-                AND date_format(create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+                AND date_format(d.create_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
             </if>
         </where>
         ${params.dataScope}
-        order by create_time desc
+        order by d.create_time desc
     </select>
     
     <select id="selectFgwXmsbById" parameterType="Long" resultMap="FgwXmsbResult">