Administrator před 2 roky
rodič
revize
4915f193b5
18 změnil soubory, kde provedl 514 přidání a 57 odebrání
  1. 62 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/fgw/FgwCommonController.java
  2. 13 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwFj.java
  3. 13 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwJzqk.java
  4. 20 5
      ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwXmsb.java
  5. 5 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwFjMapper.java
  6. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwJzqkMapper.java
  7. 8 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwXmsbMapper.java
  8. 18 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwCommonService.java
  9. 7 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwJzqkService.java
  10. 6 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwShyjService.java
  11. 2 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwXmsbService.java
  12. 126 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwCommonServiceImpl.java
  13. 73 24
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwJzqkServiceImpl.java
  14. 58 21
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwShyjServiceImpl.java
  15. 42 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwXmsbServiceImpl.java
  16. 17 2
      ruoyi-system/src/main/resources/mapper/system/fgw/FgwFjMapper.xml
  17. 23 1
      ruoyi-system/src/main/resources/mapper/system/fgw/FgwJzqkMapper.xml
  18. 20 1
      ruoyi-system/src/main/resources/mapper/system/fgw/FgwXmsbMapper.xml

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

@@ -0,0 +1,62 @@
+package com.ruoyi.web.controller.fgw;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.fgw.FgwShyj;
+import com.ruoyi.system.domain.projectV2.ZsyzShyj;
+import com.ruoyi.system.service.fgw.IFgwCommonService;
+import com.ruoyi.system.service.fgw.IFgwShyjService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @Author: tjf
+ * @Date: 2023/3/23 8:58
+ * @Describe:
+ */
+@RestController
+@RequestMapping("/fgw/common")
+public class FgwCommonController {
+    @Autowired
+    private IFgwShyjService fgwShyjService;
+    @Autowired
+    private IFgwCommonService fgwCommonService;
+
+    /**
+     * 招商中心项目审核/驳回接口
+     * 参数是审核建议
+     *
+     * @return
+     */
+    @PostMapping("/xmsh")
+    @PreAuthorize("@ss.hasPermi('fgw:common:xmsh')")
+    public AjaxResult xssh(@RequestBody FgwShyj fgwShyj) {
+        //所有审核需要往审核意见表插入数据
+        return fgwShyjService.xssh(fgwShyj);
+    }
+
+    /**
+     * 首页统计
+     *
+     * @return
+     */
+    @PostMapping("/census")
+    @PreAuthorize("@ss.hasPermi('fgw:common:census')")
+    public AjaxResult census() {
+        return fgwCommonService.index();
+    }
+
+    /**
+     * 本周汇报进度
+     *
+     * @return
+     */
+    @PostMapping("/hbjd")
+    @PreAuthorize("@ss.hasPermi('fgw:common:hbjd')")
+    public AjaxResult hbjd() {
+        return fgwCommonService.hbjd();
+    }
+}

+ 13 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwFj.java

@@ -29,6 +29,10 @@ public class FgwFj extends BaseEntity
     /** 附件名称 */
     @Excel(name = "附件名称")
     private String fjName;
+    /**
+     * 目标数据源id
+     */
+    private Long sourceId;
 
     /** 附件地址 */
     @Excel(name = "附件地址")
@@ -38,7 +42,15 @@ public class FgwFj extends BaseEntity
     @Excel(name = "附件类型 1: 节能审查 2: 用地预审与选址意见书 3:核准/备案 4:建议书批复 5:可研批复 6:初步设计批复 7:环境影响评价 8:生态红线不可避让论证 9: 建设用地规划许可证 10:建设工程规划许可证 11:农用地转用和土地征收批复 12:划拨决定书 13:土地出让合同 14:不动产权证 15: 工程招投标 16: 施工许可证 17: 竣工资料 18:进展情况 ")
     private String type;
 
-    public void setId(Long id) 
+    public Long getSourceId() {
+        return sourceId;
+    }
+
+    public void setSourceId(Long sourceId) {
+        this.sourceId = sourceId;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 13 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/fgw/FgwJzqk.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.domain.fgw;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -53,7 +55,17 @@ public class FgwJzqk extends BaseEntity
     @Excel(name = "汇报时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date hbTime;
 
-    public void setId(Long id) 
+    private List<FgwFj> fjList;
+
+    public List<FgwFj> getFjList() {
+        return fjList;
+    }
+
+    public void setFjList(List<FgwFj> fjList) {
+        this.fjList = fjList;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

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

@@ -1,6 +1,8 @@
 package com.ruoyi.system.domain.fgw;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
@@ -119,19 +121,32 @@ public class FgwXmsb extends BaseEntity
     @Excel(name = "纳统项目完成投资")
     private String ntxmtc;
 
-    /** 申报状态 1:正常 2:暂缓 */
-    @Excel(name = "申报状态 1:正常 2:暂缓")
+    /** 申报状态 1:申报库 2:项目库 */
+    @Excel(name = "申报状态 1:申报库 2:项目库")
     private String type;
 
     /** 项目进度  */
-    @Excel(name = "项目进度 ")
+    @Excel(name = "项目进度 1:基本信息 2:前期工作手续")
     private String progress;
 
     /** 状态  */
-    @Excel(name = "状态 ")
+    @Excel(name = " 项目状态 1:待审核 2:已通过 3:被退回 ")
     private String status;
 
-    public void setId(Long id) 
+    /**
+     * 前期工作手续附件
+     */
+    private List<FgwFj> fjList;
+
+    public List<FgwFj> getFjList() {
+        return fjList;
+    }
+
+    public void setFjList(List<FgwFj> fjList) {
+        this.fjList = fjList;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwFjMapper.java

@@ -20,6 +20,9 @@ public interface FgwFjMapper
      */
     public FgwFj selectFgwFjById(Long id);
 
+    public List<FgwFj> selectFgwFjByXmId(Long id);
+    public List<FgwFj> selectFgwFjBySourceId(Long id);
+
     /**
      * 查询发改委_附件列表
      * 
@@ -52,6 +55,8 @@ public interface FgwFjMapper
      */
     public int deleteFgwFjById(Long id);
 
+    public int deleteFgwFjByXmId(Long id);
+
     /**
      * 批量删除发改委_附件
      * 

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwJzqkMapper.java

@@ -27,6 +27,7 @@ public interface FgwJzqkMapper
      * @return 发改委_进展情况集合
      */
     public List<FgwJzqk> selectFgwJzqkList(FgwJzqk fgwJzqk);
+    public List<FgwJzqk> selectFgwJzqkTj(FgwJzqk fgwJzqk);
 
     /**
      * 新增发改委_进展情况

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/fgw/FgwXmsbMapper.java

@@ -27,6 +27,7 @@ public interface FgwXmsbMapper
      * @return 发改委_申报_主集合
      */
     public List<FgwXmsb> selectFgwXmsbList(FgwXmsb fgwXmsb);
+    public List<FgwXmsb> selectFgwXmsbListTj(FgwXmsb fgwXmsb);
 
     /**
      * 新增发改委_申报_主
@@ -44,6 +45,13 @@ public interface FgwXmsbMapper
      */
     public int updateFgwXmsb(FgwXmsb fgwXmsb);
 
+    /**
+     * 修改项目进度
+     * @param fgwXmsb
+     * @return
+     */
+    public int updateFgwXmsbStatus(FgwXmsb fgwXmsb);
+
     /**
      * 删除发改委_申报_主
      * 

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

@@ -0,0 +1,18 @@
+package com.ruoyi.system.service.fgw;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+
+/**
+ * @Author: tjf
+ * @Date: 2023/3/23 15:34
+ * @Describe:
+ */
+public interface IFgwCommonService {
+    AjaxResult index();
+
+    /**
+     * 本周汇报进度
+     * @return
+     */
+    AjaxResult hbjd();
+}

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwJzqkService.java

@@ -28,6 +28,13 @@ public interface IFgwJzqkService
      */
     public List<FgwJzqk> selectFgwJzqkList(FgwJzqk fgwJzqk);
 
+    /**
+     * 统计本周汇报进度
+     * @param fgwJzqk
+     * @return
+     */
+    public List<FgwJzqk> selectFgwJzqkTj(FgwJzqk fgwJzqk);
+
     /**
      * 新增发改委_进展情况
      * 

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/fgw/IFgwShyjService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.system.service.fgw;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.fgw.FgwShyj;
 
 import java.util.List;
@@ -60,4 +61,9 @@ public interface IFgwShyjService
      * @return 结果
      */
     public int deleteFgwShyjById(Long id);
+
+    /**
+     * 发改委审核
+     */
+    public AjaxResult xssh(FgwShyj fgwShyj);
 }

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

@@ -27,6 +27,8 @@ public interface IFgwXmsbService
      * @return 发改委_申报_主集合
      */
     public List<FgwXmsb> selectFgwXmsbList(FgwXmsb fgwXmsb);
+    //统计多少合格的项目
+    public List<FgwXmsb> selectFgwXmsbListTj(FgwXmsb fgwXmsb);
 
     /**
      * 新增发改委_申报_主

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

@@ -0,0 +1,126 @@
+package com.ruoyi.system.service.impl.fgw;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+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.service.fgw.IFgwCommonService;
+import com.ruoyi.system.service.fgw.IFgwJzqkService;
+import com.ruoyi.system.service.fgw.IFgwXmsbService;
+import com.ruoyi.system.service.projectV2.IZsyzSbbzbService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.ruoyi.common.constant.CommonConstants.THR;
+
+/**
+ * @Author: tjf
+ * @Date: 2023/3/23 15:34
+ * @Describe:
+ */
+@Service
+public class FgwCommonServiceImpl implements IFgwCommonService {
+
+    @Autowired
+    private IFgwXmsbService fgwXmsbService;
+
+    @Autowired
+    private IZsyzSbbzbService zsyzSbbzbService;
+
+    @Autowired
+    private IFgwJzqkService fgwJzqkService;
+
+    /**
+     * 首页统计
+     *
+     * @return
+     */
+    @Override
+    public AjaxResult index() {
+        Map<String, Object> map = new HashMap<>();
+
+        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));
+            if (collect != null && collect.size() > 0) {
+                List<FgwXmsb> fgwXmsbsWt = collect.get(THR);
+                if (fgwXmsbsWt != null && fgwXmsbsWt.size() > 0) {
+                    map.put("wtxm", fgwXmsbsWt.size());
+
+                }
+            }
+            map.put("zfxm", fgwXmsbs.size());
+        }
+        ZsyzSbbzb zsyzSbbzb = new ZsyzSbbzb();
+
+        List<ZsyzSbbzb> zsyzSbbzbs = zsyzSbbzbService.selectZsyzSbbzbList(zsyzSbbzb);
+        if (zsyzSbbzbs != null && zsyzSbbzbs.size() > 0) {
+            map.put("zsxm", zsyzSbbzbs.size());
+        }
+
+        return AjaxResult.success(map);
+    }
+
+    /**
+     * 本周汇报进度
+     *
+     * @return
+     */
+    @Override
+    public AjaxResult hbjd() {
+        //获取当前周的开始时间
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTimeZone(TimeZone.getTimeZone("GMT+8"));
+        //start of the week
+        if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+            calendar.add(Calendar.DAY_OF_YEAR, -1);
+        }
+        calendar.add(Calendar.DAY_OF_WEEK, -(calendar.get(Calendar.DAY_OF_WEEK) - 2));
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        String startTime = conversion(calendar.getTimeInMillis());
+        FgwJzqk fgwJzqk = new FgwJzqk();
+        Map<String, Object> params = new HashMap<>();
+        params.put("beginTime", startTime);
+        params.put("endTime", DateUtils.getNowDate());
+        fgwJzqk.setParams(params);
+        List<FgwJzqk> fgwJzqks = fgwJzqkService.selectFgwJzqkTj(fgwJzqk);
+        Map<String, Object> map = new HashMap<>();
+        map.put("yhb", 0);
+        map.put("whb", 0);
+        if (fgwJzqks != null && fgwJzqks.size() > 0) {
+            map.put("yhb", fgwJzqks.size());
+        }
+        //查询所有项目总数
+        FgwXmsb fgwXmsb = new FgwXmsb();
+        List<FgwXmsb> fgwXmsbs = fgwXmsbService.selectFgwXmsbListTj(fgwXmsb);
+        if (fgwXmsbs != null && fgwXmsbs.size() > 0) {
+            Long yhb = (Long) map.get("yhb");
+            long whb = fgwXmsbs.size() - yhb;
+            map.put("whb", whb);
+        }
+        return AjaxResult.success(map);
+    }
+
+
+    /**
+     * 传入时间戳获取日期格式时间
+     *
+     * @param time
+     * @return String
+     * @author xyl
+     * @date 2023/1/4 13:24
+     */
+    public static String conversion(Long time) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return sdf.format(time);
+    }
+}

+ 73 - 24
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwJzqkServiceImpl.java

@@ -1,8 +1,12 @@
 package com.ruoyi.system.service.impl.fgw;
 
 import java.util.List;
+
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.fgw.FgwFj;
 import com.ruoyi.system.domain.fgw.FgwJzqk;
+import com.ruoyi.system.mapper.fgw.FgwFjMapper;
 import com.ruoyi.system.mapper.fgw.FgwJzqkMapper;
 import com.ruoyi.system.service.fgw.IFgwJzqkService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,87 +15,132 @@ import org.springframework.stereotype.Service;
 
 /**
  * 发改委_进展情况Service业务层处理
- * 
+ *
  * @author boman
  * @date 2023-03-22
  */
 @Service
-public class FgwJzqkServiceImpl implements IFgwJzqkService
-{
+public class FgwJzqkServiceImpl implements IFgwJzqkService {
     @Autowired
     private FgwJzqkMapper fgwJzqkMapper;
 
+    @Autowired
+    private FgwFjMapper fgwFjMapper;
+
     /**
      * 查询发改委_进展情况
-     * 
+     *
      * @param id 发改委_进展情况主键
      * @return 发改委_进展情况
      */
     @Override
-    public FgwJzqk selectFgwJzqkById(Long id)
-    {
-        return fgwJzqkMapper.selectFgwJzqkById(id);
+    public FgwJzqk selectFgwJzqkById(Long id) {
+        FgwJzqk fgwJzqk = fgwJzqkMapper.selectFgwJzqkById(id);
+        if (fgwJzqk != null) {
+            List<FgwFj> fgwFjs = fgwFjMapper.selectFgwFjBySourceId(fgwJzqk.getId());
+            if (fgwFjs != null && fgwFjs.size() > 0) {
+                fgwJzqk.setFjList(fgwFjs);
+            }
+        }
+        return fgwJzqk;
     }
 
     /**
      * 查询发改委_进展情况列表
-     * 
+     *
      * @param fgwJzqk 发改委_进展情况
      * @return 发改委_进展情况
      */
     @Override
-    public List<FgwJzqk> selectFgwJzqkList(FgwJzqk fgwJzqk)
-    {
-        return fgwJzqkMapper.selectFgwJzqkList(fgwJzqk);
+    public List<FgwJzqk> selectFgwJzqkList(FgwJzqk fgwJzqk) {
+        List<FgwJzqk> fgwJzqks = fgwJzqkMapper.selectFgwJzqkList(fgwJzqk);
+        if (fgwJzqks != null && fgwJzqks.size() > 0) {
+            for (FgwJzqk jzqk : fgwJzqks) {
+                if (fgwJzqk != null) {
+                    List<FgwFj> fgwFjs = fgwFjMapper.selectFgwFjBySourceId(jzqk.getId());
+                    if (fgwFjs != null && fgwFjs.size() > 0) {
+                        jzqk.setFjList(fgwFjs);
+                    }
+                }
+            }
+        }
+        return fgwJzqks;
+    }
+
+    /**
+     * 统计本周汇报进度
+     * @param fgwJzqk
+     * @return
+     */
+    @Override
+    public List<FgwJzqk> selectFgwJzqkTj(FgwJzqk fgwJzqk) {
+        return  fgwJzqkMapper.selectFgwJzqkTj(fgwJzqk);
     }
 
     /**
      * 新增发改委_进展情况
-     * 
+     *
      * @param fgwJzqk 发改委_进展情况
      * @return 结果
      */
     @Override
-    public int insertFgwJzqk(FgwJzqk fgwJzqk)
-    {
+    public int insertFgwJzqk(FgwJzqk fgwJzqk) {
+        fgwJzqk.setHbTime(DateUtils.getNowDate());
+        fgwJzqk.setDeptId(SecurityUtils.getDeptId());
+        int i = fgwJzqkMapper.insertFgwJzqk(fgwJzqk);
+        fgwJzqk.setDeptId(SecurityUtils.getDeptId());
         fgwJzqk.setCreateTime(DateUtils.getNowDate());
-        return fgwJzqkMapper.insertFgwJzqk(fgwJzqk);
+        List<FgwFj> fjList = fgwJzqk.getFjList();
+        if (fjList != null && fjList.size() > 0) {
+            for (FgwFj fgwFj : fjList) {
+                fgwFj.setType("18");
+                fgwFj.setSourceId(fgwJzqk.getId());
+                fgwFjMapper.insertFgwFj(fgwFj);
+            }
+        }
+        return i;
     }
 
     /**
      * 修改发改委_进展情况
-     * 
+     *
      * @param fgwJzqk 发改委_进展情况
      * @return 结果
      */
     @Override
-    public int updateFgwJzqk(FgwJzqk fgwJzqk)
-    {
+    public int updateFgwJzqk(FgwJzqk fgwJzqk) {
         fgwJzqk.setUpdateTime(DateUtils.getNowDate());
+        List<FgwFj> fjList = fgwJzqk.getFjList();
+        fgwFjMapper.deleteFgwFjByXmId(fgwJzqk.getXmId());
+        if (fjList != null && fjList.size() > 0) {
+            for (FgwFj fgwFj : fjList) {
+                fgwFj.setType("18");
+                fgwFj.setSourceId(fgwJzqk.getId());
+                fgwFjMapper.insertFgwFj(fgwFj);
+            }
+        }
         return fgwJzqkMapper.updateFgwJzqk(fgwJzqk);
     }
 
     /**
      * 批量删除发改委_进展情况
-     * 
+     *
      * @param ids 需要删除的发改委_进展情况主键
      * @return 结果
      */
     @Override
-    public int deleteFgwJzqkByIds(Long[] ids)
-    {
+    public int deleteFgwJzqkByIds(Long[] ids) {
         return fgwJzqkMapper.deleteFgwJzqkByIds(ids);
     }
 
     /**
      * 删除发改委_进展情况信息
-     * 
+     *
      * @param id 发改委_进展情况主键
      * @return 结果
      */
     @Override
-    public int deleteFgwJzqkById(Long id)
-    {
+    public int deleteFgwJzqkById(Long id) {
         return fgwJzqkMapper.deleteFgwJzqkById(id);
     }
 }

+ 58 - 21
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/fgw/FgwShyjServiceImpl.java

@@ -1,97 +1,134 @@
 package com.ruoyi.system.service.impl.fgw;
 
 import java.util.List;
+
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.fgw.FgwShyj;
+import com.ruoyi.system.domain.fgw.FgwXmsb;
 import com.ruoyi.system.mapper.fgw.FgwShyjMapper;
+import com.ruoyi.system.mapper.fgw.FgwXmsbMapper;
 import com.ruoyi.system.service.fgw.IFgwShyjService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import static com.ruoyi.common.constant.CommonConstants.THR;
+import static com.ruoyi.common.constant.CommonConstants.TWO;
+
 
 /**
  * 发改委_审核意见Service业务层处理
- * 
+ *
  * @author boman
  * @date 2023-03-22
  */
 @Service
-public class FgwShyjServiceImpl implements IFgwShyjService
-{
+public class FgwShyjServiceImpl implements IFgwShyjService {
     @Autowired
     private FgwShyjMapper fgwShyjMapper;
 
+    @Autowired
+    private FgwXmsbMapper fgwXmsbMapper;
+
     /**
      * 查询发改委_审核意见
-     * 
+     *
      * @param id 发改委_审核意见主键
      * @return 发改委_审核意见
      */
     @Override
-    public FgwShyj selectFgwShyjById(Long id)
-    {
+    public FgwShyj selectFgwShyjById(Long id) {
         return fgwShyjMapper.selectFgwShyjById(id);
     }
 
     /**
      * 查询发改委_审核意见列表
-     * 
+     *
      * @param fgwShyj 发改委_审核意见
      * @return 发改委_审核意见
      */
     @Override
-    public List<FgwShyj> selectFgwShyjList(FgwShyj fgwShyj)
-    {
+    public List<FgwShyj> selectFgwShyjList(FgwShyj fgwShyj) {
         return fgwShyjMapper.selectFgwShyjList(fgwShyj);
     }
 
     /**
      * 新增发改委_审核意见
-     * 
+     *
      * @param fgwShyj 发改委_审核意见
      * @return 结果
      */
     @Override
-    public int insertFgwShyj(FgwShyj fgwShyj)
-    {
+    public int insertFgwShyj(FgwShyj fgwShyj) {
         fgwShyj.setCreateTime(DateUtils.getNowDate());
+        fgwShyj.setDeptId(SecurityUtils.getDeptId());
         return fgwShyjMapper.insertFgwShyj(fgwShyj);
     }
 
     /**
      * 修改发改委_审核意见
-     * 
+     *
      * @param fgwShyj 发改委_审核意见
      * @return 结果
      */
     @Override
-    public int updateFgwShyj(FgwShyj fgwShyj)
-    {
+    public int updateFgwShyj(FgwShyj fgwShyj) {
         fgwShyj.setUpdateTime(DateUtils.getNowDate());
         return fgwShyjMapper.updateFgwShyj(fgwShyj);
     }
 
     /**
      * 批量删除发改委_审核意见
-     * 
+     *
      * @param ids 需要删除的发改委_审核意见主键
      * @return 结果
      */
     @Override
-    public int deleteFgwShyjByIds(Long[] ids)
-    {
+    public int deleteFgwShyjByIds(Long[] ids) {
         return fgwShyjMapper.deleteFgwShyjByIds(ids);
     }
 
     /**
      * 删除发改委_审核意见信息
-     * 
+     *
      * @param id 发改委_审核意见主键
      * @return 结果
      */
     @Override
-    public int deleteFgwShyjById(Long id)
-    {
+    public int deleteFgwShyjById(Long id) {
         return fgwShyjMapper.deleteFgwShyjById(id);
     }
+
+    /**
+     * 发改委审核
+     *
+     * @param fgwShyj
+     * @return
+     */
+    @Override
+    public AjaxResult xssh(FgwShyj fgwShyj) {
+        //获取审核意见
+        String shjg = fgwShyj.getShjg();
+        //查询项目当前状态
+        FgwXmsb fgwXmsb = fgwXmsbMapper.selectFgwXmsbById(fgwShyj.getXmId());
+        if (TWO.equals(fgwXmsb.getStatus())) {
+            return AjaxResult.error("当前项目已审核");
+        }
+        if (TWO.equals(shjg)) {
+            //审核通过修改项目状态
+            fgwXmsb.setStatus(TWO);
+            fgwXmsb.setType(TWO);
+        } else if (THR.equals(shjg)) {
+            fgwXmsb.setStatus(THR);
+        }
+        //修改主表状态
+        fgwXmsbMapper.updateFgwXmsbStatus(fgwXmsb);
+        fgwShyj.setCreateTime(DateUtils.getNowDate());
+        fgwShyj.setDeptId(SecurityUtils.getDeptId());
+        fgwShyj.setShrxm(SecurityUtils.getUsername());
+        fgwShyj.setShsj(DateUtils.getNowDate());
+        fgwShyjMapper.insertFgwShyj(fgwShyj);
+        return AjaxResult.success();
+    }
 }

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

@@ -2,12 +2,17 @@ package com.ruoyi.system.service.impl.fgw;
 
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.fgw.FgwFj;
 import com.ruoyi.system.domain.fgw.FgwXmsb;
+import com.ruoyi.system.mapper.fgw.FgwFjMapper;
 import com.ruoyi.system.mapper.fgw.FgwXmsbMapper;
 import com.ruoyi.system.service.fgw.IFgwXmsbService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import static com.ruoyi.common.constant.CommonConstants.ONE;
+import static com.ruoyi.common.constant.CommonConstants.TWO;
+
 
 /**
  * 发改委_申报_主Service业务层处理
@@ -20,6 +25,8 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
 {
     @Autowired
     private FgwXmsbMapper fgwXmsbMapper;
+    @Autowired
+    private FgwFjMapper fgwFjMapper;
 
     /**
      * 查询发改委_申报_主
@@ -30,7 +37,13 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
     @Override
     public FgwXmsb selectFgwXmsbById(Long id)
     {
-        return fgwXmsbMapper.selectFgwXmsbById(id);
+        FgwXmsb fgwXmsb = fgwXmsbMapper.selectFgwXmsbById(id);
+        List<FgwFj> fgwFjs = fgwFjMapper.selectFgwFjByXmId(fgwXmsb.getId());
+        if (fgwFjs != null && fgwFjs.size() > 0){
+            fgwXmsb.setFjList(fgwFjs);
+        }
+        return fgwXmsb;
+
     }
 
     /**
@@ -45,6 +58,17 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
         return fgwXmsbMapper.selectFgwXmsbList(fgwXmsb);
     }
 
+    /**
+     * 统计合格项目
+     * @param fgwXmsb
+     * @return
+     */
+    @Override
+    public List<FgwXmsb> selectFgwXmsbListTj(FgwXmsb fgwXmsb) {
+        fgwXmsbMapper.selectFgwXmsbListTj(fgwXmsb);
+        return null;
+    }
+
     /**
      * 新增发改委_申报_主
      * 
@@ -68,6 +92,23 @@ public class FgwXmsbServiceImpl implements IFgwXmsbService
     public int updateFgwXmsb(FgwXmsb fgwXmsb)
     {
         fgwXmsb.setUpdateTime(DateUtils.getNowDate());
+        String progress = fgwXmsb.getProgress();
+        String status = fgwXmsb.getStatus();
+        if (ONE.equals(progress) && TWO.equals(status)){
+            //修改主表项目进入前期工作手续 待审核
+            fgwXmsb.setProgress(TWO);
+            fgwXmsb.setStatus(ONE);
+        }
+        //修改主表项目进入待审核
+        fgwXmsb.setStatus(ONE);
+        List<FgwFj> fjList = fgwXmsb.getFjList();
+        fgwFjMapper.deleteFgwFjByXmId(fgwXmsb.getId());
+        if (fjList != null && fjList.size() > 0){
+            //删除之前的
+            for (FgwFj fgwFj : fjList) {
+                fgwFjMapper.insertFgwFj(fgwFj);
+            }
+        }
         return fgwXmsbMapper.updateFgwXmsb(fgwXmsb);
     }
 

+ 17 - 2
ruoyi-system/src/main/resources/mapper/system/fgw/FgwFjMapper.xml

@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="xmId"    column="xm_id"    />
         <result property="xmbh"    column="xmbh"    />
+        <result property="sourceId"    column="source_id"    />
         <result property="fjName"    column="fj_name"    />
         <result property="path"    column="path"    />
         <result property="type"    column="type"    />
@@ -15,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFgwFjVo">
-        select id, xm_id, xmbh, fj_name, path, type, remark from fgw_fj
+        select id, xm_id, xmbh,source_id, fj_name, path, type, remark from fgw_fj
     </sql>
 
     <select id="selectFgwFjList" parameterType="FgwFj" resultMap="FgwFjResult">
@@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>  
             <if test="xmId != null "> and xm_id = #{xmId}</if>
             <if test="xmbh != null  and xmbh != ''"> and xmbh = #{xmbh}</if>
+            <if test="sourceId != null  "> and source_id = #{sourceId}</if>
             <if test="fjName != null  and fjName != ''"> and fj_name like concat('%', #{fjName}, '%')</if>
             <if test="path != null  and path != ''"> and path = #{path}</if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
@@ -33,12 +35,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFgwFjVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectFgwFjByXmId" parameterType="Long" resultMap="FgwFjResult">
+        <include refid="selectFgwFjVo"/>
+        where xm_id = #{id}
+    </select>
+    <select id="selectFgwFjBySourceId" parameterType="Long" resultMap="FgwFjResult">
+        <include refid="selectFgwFjVo"/>
+        where source_id = #{id}  and type = '18'
+    </select>
+
     <insert id="insertFgwFj" parameterType="FgwFj" useGeneratedKeys="true" keyProperty="id">
         insert into fgw_fj
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="xmId != null">xm_id,</if>
             <if test="xmbh != null">xmbh,</if>
+            <if test="sourceId != null">source_id,</if>
             <if test="fjName != null and fjName != ''">fj_name,</if>
             <if test="path != null">path,</if>
             <if test="type != null">type,</if>
@@ -47,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="xmId != null">#{xmId},</if>
             <if test="xmbh != null">#{xmbh},</if>
+            <if test="sourceId != null">#{sourceId},</if>
             <if test="fjName != null and fjName != ''">#{fjName},</if>
             <if test="path != null">#{path},</if>
             <if test="type != null">#{type},</if>
@@ -77,4 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+    <delete id="deleteFgwFjByXmId" parameterType="Long">
+                delete from fgw_fj where xm_id = #{id}
+    </delete>
 </mapper>

+ 23 - 1
ruoyi-system/src/main/resources/mapper/system/fgw/FgwJzqkMapper.xml

@@ -36,6 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="jzqk != null  and jzqk != ''"> and jzqk = #{jzqk}</if>
             <if test="sgll != null  and sgll != ''"> and sgll = #{sgll}</if>
             <if test="hbTime != null "> and hb_time = #{hbTime}</if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(hb_time,'%Y%m') = date_format(#{params.beginTime},'%Y%m')
+            </if>
         </where>
     </select>
     
@@ -43,7 +46,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFgwJzqkVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectFgwJzqkTj" parameterType="FgwJzqk" resultMap="FgwJzqkResult">
+        <include refid="selectFgwJzqkVo"/>
+        <where>
+            <if test="xmId != null "> and xm_id = #{xmId}</if>
+            <if test="xmbh != null  and xmbh != ''"> and xmbh = #{xmbh}</if>
+            <if test="xmmc != null  and xmmc != ''"> and xmmc = #{xmmc}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="jzqk != null  and jzqk != ''"> and jzqk = #{jzqk}</if>
+            <if test="sgll != null  and sgll != ''"> and sgll = #{sgll}</if>
+            <if test="hbTime != null "> and hb_time = #{hbTime}</if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(hb_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(hb_time,'%Y%m%d') &lt;= date_format(#{params.endTime},'%Y%m%d')
+            </if>
+        </where>
+    </select>
+
     <insert id="insertFgwJzqk" parameterType="FgwJzqk" useGeneratedKeys="true" keyProperty="id">
         insert into fgw_jzqk
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 20 - 1
ruoyi-system/src/main/resources/mapper/system/fgw/FgwXmsbMapper.xml

@@ -74,6 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(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')
+            </if>
         </where>
     </select>
     
@@ -81,7 +87,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFgwXmsbVo"/>
         where id = #{id}
     </select>
-        
+    <select id="selectFgwXmsbListTj" parameterType="FgwXmsb" resultMap="FgwXmsbResult">
+        <include refid="selectFgwXmsbVo"/>
+        <where>
+           ( (progress = '1' and status = '2') or (progress &gt; 1))
+        </where>
+    </select>
+
     <insert id="insertFgwXmsb" parameterType="FgwXmsb" useGeneratedKeys="true" keyProperty="id">
         insert into fgw_xmsb
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -192,6 +204,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
         where id = #{id}
     </update>
+    <update id="updateFgwXmsbStatus" parameterType="FgwXmsb">
+        update fgw_xmsb
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="status != null">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
 
     <delete id="deleteFgwXmsbById" parameterType="Long">
         delete from fgw_xmsb where id = #{id}