buzhanyi 2 years ago
parent
commit
665c0cd4b4

+ 131 - 0
purchase-admin/src/main/java/com/ozs/web/controller/statisticalAnalysis/AnalysisController.java

@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 统计分析页面控制层
@@ -126,4 +127,134 @@ public class AnalysisController extends BaseController {
         }
         return pmDemandService.countMajorProject(pmDemandReqVo);
     }
+
+    @ApiOperation(value = "采购任务受领")
+    @PostMapping("/countPurTask")
+    //@PreAuthorize("@ss.hasPermi('statistical:countPurTask')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countPurTask(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.countPurTask(pmDemandReqVo);
+    }
+
+    @ApiOperation(value = "任务受领数量/预算金额(万元)")
+    @PostMapping("/purchaseProjectNumberAnalysis")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectNumberAnalysis')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult purchaseProjectNumberAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        // 需求单位可查看本单位及其下属单位的统计数据
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
+            return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
+        }
+        List<Map<String, String>> map = pmDemandService.purchaseProjectNumberAnalysis(pmDemandReqVo);
+        return success(map);
+    }
+
+    @ApiOperation(value = "采购方式分布")
+    @PostMapping("/countByPurchaseMode")
+    //@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseMode')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countByPurchaseMode(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        //按照采购方式统计所有的项目
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseMode(pmDemandReqVo);
+        return AjaxResult.success(resVos);
+    }
+
+    @ApiOperation(value = "任务金额分布")
+    @PostMapping("/countByEvaluation")
+    //@PreAuthorize("@ss.hasPermi('statistical:countByEvaluation')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countByEvaluation(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        //按照概算金额统计所有的项目
+        //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        List<StatisticalChartsResVo> resVos = pmDemandService.countByEvaluation(pmDemandReqVo);
+        return AjaxResult.success(resVos);
+    }
+
+    @ApiOperation(value = "任务执行进度")
+    @PostMapping("/purchaseProjectExecute")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult purchaseProjectExecute(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        // 需求单位可查看本单位及其下属单位的统计数据
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        List<StatisticalChartsResVo> resVos = pmDemandService.purchaseProjectExecute(pmDemandReqVo);
+        return AjaxResult.success(resVos);
+    }
+
+    @ApiOperation(value = "新完成采购任务数量")
+    @PostMapping("/purchaseTaskFinish")
+    //@PreAuthorize("@ss.hasPermi('statistical:purchaseTaskFinish')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult purchaseTaskFinish(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        // 需求单位可查看本单位及其下属单位的统计数据
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
+            return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
+        }
+        List<Map<String, Integer>> map = pmDemandService.purchaseTaskFinish(pmDemandReqVo);
+        return success(map);
+    }
+
+    @ApiOperation(value = "各阶段采购任务数量分布")
+    @PostMapping("/countEveryStatusNum")
+    //@PreAuthorize("@ss.hasPermi('statistical:countEveryStatusNum')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countEveryStatusNum(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.countEveryStatusNum(pmDemandReqVo);
+    }
+
+    @ApiOperation(value = "滞后直接原因")
+    @PostMapping("/exceedReasonZj")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult exceedReasonZj(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        //按照滞后时长统计项目数量
+        //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.exceedReasonZj(pmDemandReqVo);
+    }
+
+    @ApiOperation(value = "重大规划采购任务专项计划管理情况")
+    @PostMapping("/countMajorProjectCGB")
+    //@PreAuthorize("@ss.hasPermi('statistical:countMajorProject')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countMajorProjectCGB(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.countMajorProjectCGB(pmDemandReqVo);
+    }
+
+    @ApiOperation(value = "新增执行滞后采购任务数量分析")
+    @PostMapping("/countMajorProjectNumCGB")
+    //@PreAuthorize("@ss.hasPermi('statistical:countMajorProject')")
+    @Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
+    public AjaxResult countMajorProjectNumCGB(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
+            return error("登录账号的单位 不能为空!");
+        }
+        return pmDemandService.countMajorProjectNumCGB(pmDemandReqVo);
+    }
+
+
 }

+ 14 - 0
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanQuarterServiceImpl.java

@@ -613,6 +613,7 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
     @Override
     @Transactional
     public AjaxResult importPlanYearsData(List<Long> planYearIds) {
+        Date now = new Date();
         StringBuilder sb = new StringBuilder("项目【'");
         for (Long yearId : planYearIds) {
             PlanQuarter byPlanYearId = planQuarterMapper.getByPlanYearId(yearId);
@@ -626,6 +627,19 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                 quarter.setPlanType(0);
                 quarter.setProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
                 planQuarterMapper.insert(quarter);
+                //项目上传附件和审核文件进行同步
+                LambdaQueryWrapper<SysFileRef> lw = new LambdaQueryWrapper<>();
+                lw.eq(SysFileRef::getRedId, years.getPlanYearId());
+                lw.in(SysFileRef::getType, Arrays.asList(SysFileRefEnum.PLAN_YEAR.getType(), SysFileRefEnum.PLAN_YEAR_EXAMINE.getType()));
+                List<SysFileRef> fileRefs = sysFileRefMapper.selectList(lw);
+                for (SysFileRef fileRef : fileRefs) {
+                    fileRef.setId(null);
+                    fileRef.setRedId(quarter.getPlanPracticalId());
+                    fileRef.setType(SysFileRefEnum.PLAN_YEAR.getType());
+                    fileRef.setCreateTime(now);
+                    fileRef.setCreated(SecurityUtils.getUserId() + "");
+                }
+
             }
         }
         sb.append("】已存在,请勿选择。");

+ 5 - 0
purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmDemandReqVo.java

@@ -143,4 +143,9 @@ public class PmDemandReqVo extends PageVo {
      * 要查询的需求id集合
      */
     List<Long> demandIdAll;
+    /**
+     * 所属采购服务站数量
+     */
+    private List<String> serviceList;
+
 }

+ 5 - 0
purchase-system/src/main/java/com/ozs/pm/mapper/PmCallQuestionHisMapper.java

@@ -18,4 +18,9 @@ public interface PmCallQuestionHisMapper extends BaseMapper<PmCallQuestionHis> {
      * 取出所有的需求id
      */
     List<Long> selectDemandIdAll();
+
+    /**
+     * 取出质疑为‘是’的所有的需求id
+     */
+    List<Long> selectDemandIdAllWith();
 }

+ 74 - 2
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java

@@ -196,6 +196,14 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     StatisticalChartsResVo majorProjectByStatusThisMonthFi(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 本月度完成重大规划采购任务数量(采购办)
+     *
+     * @param
+     * @return
+     */
+    StatisticalChartsResVo majorProjectByStatusThisMonthFiCGB(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
     /**
      * 本季度完成重大规划采购任务数量
      *
@@ -204,6 +212,14 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     StatisticalChartsResVo majorProjectByStatusThisQuaFi(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 本季度完成重大规划采购任务数量(采购办)
+     *
+     * @param
+     * @return
+     */
+    StatisticalChartsResVo majorProjectByStatusThisQuaFiCGB(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
     /**
      * 本年度完成重大规划采购任务数量
      *
@@ -212,6 +228,14 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     StatisticalChartsResVo majorProjectByStatusThisYearFi(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 本年度完成重大规划采购任务数量(采购办)
+     *
+     * @param
+     * @return
+     */
+    StatisticalChartsResVo majorProjectByStatusThisYearFiCGB(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
     /**
      * 上年度结转:上年度“需求待提交”之后,“合同待填制”之前状态的项目属性为重大规划任务项目的数据
      *
@@ -281,7 +305,7 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      * @param pmDemandReqVo
      * @return
      */
-    Map<String, Integer> purchaseProjectExecuteNormalPropulsion(@Param("vo") PmDemandReqVo pmDemandReqVo);
+    StatisticalChartsResVo purchaseProjectExecuteNormalPropulsion(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
     /**
      * 项目执行进度统计--未完成采购任务,预算金额
@@ -289,7 +313,7 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      * @param pmDemandReqVo
      * @return
      */
-    Map<String, Integer> purchaseProjectExecuteIncomplete(@Param("vo") PmDemandReqVo pmDemandReqVo);
+    StatisticalChartsResVo purchaseProjectExecuteIncomplete(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
     /**
      * 查询数据库年份最小值
@@ -346,14 +370,32 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     List<Map<String, Integer>> selectPurchaseTaskFinishMonth(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 任务数量趋势分析:按照月、季度、年统计“项目属性”字段中“重大规划”属性的项目
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
     List<StatisticalChartsResVo> countProjectMajorByYear(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
     StatisticalChartsResVo countProjectMajorByQuarter(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
     List<StatisticalChartsResVo> countProjectMajorByMonth(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 统计本年度滞后的重大项目--暂未使用
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
     StatisticalChartsResVo countMajorProjectExceed(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 统计上年度滞后的重大项目--暂未使用
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
     StatisticalChartsResVo countMajorProjectLastYear(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
     /**
@@ -474,6 +516,14 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     StatisticalChartsResVo selectTBThisYear(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 本年度提报
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    StatisticalChartsResVo selectFInishAll(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
     /**
      * 正常推进周期内的采购任务
      *
@@ -490,4 +540,26 @@ public interface PmDemandMapper extends BaseMapper<PmDemand> {
      */
     StatisticalChartsResVo countProjectExceedAndStatus(@Param("vo") PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 所属采购机构数量--根据招标代理机构管理中的白名单数据显示
+     *
+     * @return
+     */
+    StatisticalChartsResVo countBaseAgencyWithWhite();
+
+    /**
+     * 新受领集中采购数量--状态为“任务待下达”之后的数据
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    StatisticalChartsResVo JZCGnum(@Param("vo") PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 上年度结转任务数量
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    StatisticalChartsResVo countProjecReaAndStatus(@Param("vo") PmDemandReqVo pmDemandReqVo);
 }

+ 32 - 1
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -255,6 +255,13 @@ public interface IPmDemandService extends IService<PmDemand> {
      */
     AjaxResult countMajorProject(PmDemandReqVo pmDemandReqVo);
 
+    /**
+     * 重大规划采购任务专项计划管理情况(采购办)
+     *
+     * @return
+     */
+    AjaxResult countMajorProjectCGB(PmDemandReqVo pmDemandReqVo);
+
     /**
      * 任务数量趋势分析
      *
@@ -283,7 +290,7 @@ public interface IPmDemandService extends IService<PmDemand> {
      * @param pmDemandReqVo
      * @return
      */
-    Map<String, Integer> purchaseProjectExecute(PmDemandReqVo pmDemandReqVo);
+    List<StatisticalChartsResVo> purchaseProjectExecute(PmDemandReqVo pmDemandReqVo);
 
     /**
      * 已完成项目数量统计
@@ -348,4 +355,28 @@ public interface IPmDemandService extends IService<PmDemand> {
      * @return
      */
     AjaxResult exceedReason(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 滞后直接原因
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    AjaxResult exceedReasonZj(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 所属采购服务站数量
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    AjaxResult countPurTask(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 新增执行滞后采购任务数量分析
+     *
+     * @param pmDemandReqVo
+     * @return
+     */
+    AjaxResult countMajorProjectNumCGB(PmDemandReqVo pmDemandReqVo);
 }

+ 5 - 0
purchase-system/src/main/java/com/ozs/pm/service/PmCallQuestionHisService.java

@@ -17,4 +17,9 @@ public interface PmCallQuestionHisService extends IService<PmCallQuestionHis> {
      * 取出所有的需求id
      */
     public List<Long> selectDemandIdAll();
+
+    /**
+     * 取出质疑为‘是’的所有的需求id
+     */
+    public List<Long> selectDemandIdAllWith();
 }

+ 6 - 0
purchase-system/src/main/java/com/ozs/pm/service/impl/PmCallQuestionHisServiceImpl.java

@@ -25,4 +25,10 @@ public class PmCallQuestionHisServiceImpl extends ServiceImpl<PmCallQuestionHisM
     public List<Long> selectDemandIdAll() {
         return this.questionHisMapper.selectDemandIdAll();
     }
+
+    @Override
+    public List<Long> selectDemandIdAllWith() {
+        return this.questionHisMapper.selectDemandIdAllWith();
+    }
+
 }

+ 193 - 8
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -20,6 +20,7 @@ import com.ozs.base.service.BaseNoticeTypeService;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
+import com.ozs.common.core.domain.entity.SysDictType;
 import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.enums.BidWinningStatus;
 import com.ozs.common.enums.ExpertType;
@@ -102,6 +103,7 @@ import com.ozs.system.domain.SysFileRef;
 import com.ozs.system.domain.vo.SysRegionVO;
 import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
 import com.ozs.system.mapper.SysDeptMapper;
+import com.ozs.system.mapper.SysDictDataMapper;
 import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.ISysDictDataService;
 import com.ozs.system.service.ISysDictTypeService;
@@ -233,7 +235,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
                 //project_type,evaluation 从原来计划里取
                 ProvisionalPlan provisionalPlan = provisionalPlanMapper.seletById(pmDemand.getPlanId());
-                if(provisionalPlan !=null) {
+                if (provisionalPlan != null) {
                     vo.setProjectType(provisionalPlan.getProjectType());
                     vo.setEvaluation(provisionalPlan.getEvaluation().doubleValue());
                 }
@@ -2246,6 +2248,93 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return AjaxResult.success(resVos);
     }
 
+    @Override
+    public AjaxResult countMajorProjectCGB(PmDemandReqVo pmDemandReqVo) {
+        //是-1就是查询自己及子孙级以下,否则只查询指定部门
+        pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
+        //本月度新受领重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
+        StatisticalChartsResVo resVo = pmDemandMapper.majorProjectByStatusThisMonthNew(pmDemandReqVo);
+        resVo.setColumnName("本月度新受领重大规划采购任务数量");
+        resVos.add(resVo);
+        //本季度新受领重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
+        StatisticalChartsResVo resVo2 = pmDemandMapper.majorProjectByStatusThisQuaNew(pmDemandReqVo);
+        resVo2.setColumnName("本季度新受领重大规划采购任务数量");
+        resVos.add(resVo2);
+        //本年度新受领重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
+        StatisticalChartsResVo resVo3 = pmDemandMapper.majorProjectByStatusThisYearNew(pmDemandReqVo);
+        resVo3.setColumnName("本年度新受领重大规划采购任务数量");
+        resVos.add(resVo3);
+        //上年度结转重大规划采购任务累计项目数量
+        List<String> yearLastZ = new ArrayList<>();
+        yearLastZ.add(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        yearLastZ.add(PmProjectStatus.EXPERT_FEEDBACK.getCode());
+        yearLastZ.add(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        yearLastZ.add(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
+        yearLastZ.add(PmProjectStatus.PRE_BID_QUERY.getCode());
+        yearLastZ.add(PmProjectStatus.WAIT_OPEN_BID.getCode());
+        yearLastZ.add(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
+        yearLastZ.add(PmProjectStatus.WASTE_BID_HANDLE.getCode());
+        yearLastZ.add(PmProjectStatus.POST_BID_QUERY.getCode());
+        yearLastZ.add(PmProjectStatus.WASTE_BID_RETURN.getCode());
+        pmDemandReqVo.setProjectStatusList(yearLastZ);
+        StatisticalChartsResVo resVo7 = pmDemandMapper.majorProjectByStatusLastYear(pmDemandReqVo);
+        resVo7.setColumnName("上年度结转和本年度新提报重大规划采购任务累计项目数量");
+        //上年度结转和本月度新受领重大规划采购任务累计项目数量预算金额
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
+        StatisticalChartsResVo resVo4 = pmDemandMapper.majorProjectByStatusThisMonthFiCGB(pmDemandReqVo);
+        resVo4.setColumnName("上年度结转和本月度新受领重大规划采购任务累计项目数量预算金额(万元)");
+        resVo4.setNum(resVo4.getNum() + resVo7.getNum());
+        resVo4.setEvaluationTotal(resVo4.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVos.add(resVo4);
+        //上年度结转和本季度新受领重大规划采购任务累计项目数量预算金额
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
+        StatisticalChartsResVo resVo5 = pmDemandMapper.majorProjectByStatusThisQuaFiCGB(pmDemandReqVo);
+        resVo5.setColumnName("上年度结转和本季度新受领重大规划采购任务累计项目数量预算金额(万元)");
+        resVo5.setNum(resVo5.getNum() + resVo7.getNum());
+        resVo5.setEvaluationTotal(resVo5.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVos.add(resVo5);
+        //上年度结转和本年度新受领重大规划采购任务累计项目数量预算金额
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
+        StatisticalChartsResVo resVo6 = pmDemandMapper.majorProjectByStatusThisYearFiCGB(pmDemandReqVo);
+        resVo6.setColumnName("上年度结转和本年度新受领重大规划采购任务累计项目数量预算金额(万元)");
+        resVo6.setNum(resVo6.getNum() + resVo7.getNum());
+        resVo6.setEvaluationTotal(resVo6.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVos.add(resVo6);
+        //本月度完成重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
+        StatisticalChartsResVo resVoA = pmDemandMapper.majorProjectByStatusThisMonthFi(pmDemandReqVo);
+        resVoA.setColumnName("本月度完成重大规划采购任务数量");
+        resVos.add(resVoA);
+        //本季度完成重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
+        StatisticalChartsResVo resVoB = pmDemandMapper.majorProjectByStatusThisQuaFi(pmDemandReqVo);
+        resVoB.setColumnName("本季度完成重大规划采购任务数量");
+        resVos.add(resVoB);
+        //本年度完成重大规划采购任务数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
+        StatisticalChartsResVo resVoC = pmDemandMapper.majorProjectByStatusThisYearFi(pmDemandReqVo);
+        resVoC.setColumnName("本年度完成重大规划采购任务数量");
+        resVos.add(resVoC);
+        //今年以来累计完成数量
+        pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
+        StatisticalChartsResVo resVo8 = pmDemandMapper.majorProjectByStatusToThisYear(pmDemandReqVo);
+        resVo8.setColumnName("今年以来累计完成数量");
+        resVos.add(resVo8);
+        //正常推进周期内的重大规划采购任务数量
+        StatisticalChartsResVo resVo9 = pmDemandMapper.majorProjectByStatusWei(pmDemandReqVo);
+        resVo9.setColumnName("正常推进周期内的重大规划采购任务数量");
+        resVos.add(resVo9);
+        //执行滞后的重大规划采购任务数量
+        StatisticalChartsResVo resVo10 = pmDemandMapper.majorProjectByStatusChao(pmDemandReqVo);
+        resVo10.setColumnName("执行滞后的重大规划采购任务数量");
+        resVos.add(resVo10);
+        return AjaxResult.success(resVos);
+    }
+
     /**
      * 通过计划ID查询项目数据
      *
@@ -2268,17 +2357,24 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return
      */
     @Override
-    public Map<String, Integer> purchaseProjectExecute(PmDemandReqVo pmDemandReqVo) {
+    public List<StatisticalChartsResVo> purchaseProjectExecute(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
         //是-1就是查询自己及子孙级以下,否则只查询指定部门
         pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
-        Map<String, Integer> mapReturn = new HashMap<>();
+        //累计完成采购任务数量    预算金额(万元)        合同金额(万元)
+        StatisticalChartsResVo tThisYear = pmDemandMapper.selectFInishAll(pmDemandReqVo);
+        tThisYear.setColumnName("累计完成采购任务数量");
+        resVos.add(tThisYear);
         // 正常推进项目数量、预算金额
-        Map<String, Integer> mapNormalPropulsion = pmDemandMapper.purchaseProjectExecuteNormalPropulsion(pmDemandReqVo);
+        StatisticalChartsResVo mapNormalPropulsion = pmDemandMapper.purchaseProjectExecuteNormalPropulsion(pmDemandReqVo);
+        mapNormalPropulsion.setColumnName("正常推进项目数量");
+        resVos.add(mapNormalPropulsion);
         // 未完成采购任务,预算金额
-        Map<String, Integer> mapIncomplete = pmDemandMapper.purchaseProjectExecuteIncomplete(pmDemandReqVo);
-        mapReturn.putAll(mapNormalPropulsion);
-        mapReturn.putAll(mapIncomplete);
-        return mapReturn;
+        StatisticalChartsResVo mapIncomplete = pmDemandMapper.purchaseProjectExecuteIncomplete(pmDemandReqVo);
+        mapIncomplete.setColumnName("未完成采购任务");
+        resVos.add(mapIncomplete);
+
+        return resVos;
     }
 
     /**
@@ -3359,6 +3455,95 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return AjaxResult.success(resVos);
     }
 
+    @Override
+    public AjaxResult exceedReasonZj(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
+        //是-1就是查询自己及子孙级以下,否则只查询指定部门
+        pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
+        //统计超过计划完成采购时间的项目中,处在各阶段的数据包括以下内容:
+        //1、需求编制对接数量/涉及金额:状态为“采购需求对接”的数量及预算金额
+        List<String> xqdj = new ArrayList<>();
+        xqdj.add(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        pmDemandReqVo.setProjectStatusList(xqdj);
+        StatisticalChartsResVo resVo = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo.setColumnName("需求编制对接数量");
+        resVos.add(resVo);
+        //2、采购文件编制审核数量/涉及金额:状态为“采购文件编制审核“的数量及预算金额
+        List<String> wjsh = new ArrayList<>();
+        wjsh.add(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        pmDemandReqVo.setProjectStatusList(wjsh);
+        StatisticalChartsResVo resVo2 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo2.setColumnName("采购文件编制审核数量");
+        resVos.add(resVo2);
+        //3、质疑、投诉、复议、信访举报数量/涉及金额:按钮”质疑投诉”进行质疑过的项目及预算金额
+        List<Long> demandIdAll = questionHisService.selectDemandIdAll();
+        pmDemandReqVo.setDemandIdAll(demandIdAll);
+        StatisticalChartsResVo resVo3 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo3.setColumnName("质疑、投诉、复议、信访举报数量");
+        resVos.add(resVo3);
+        //5、其他原因项目数量/涉及金额:统计“专家意见反馈”、“采购公告发布”、”待开标“、”评标结果公告“、“标后质疑”状态的数据
+        List<String> qtyy = new ArrayList<>();
+        qtyy.add(PmProjectStatus.EXPERT_FEEDBACK.getCode());
+        qtyy.add(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
+        qtyy.add(PmProjectStatus.WAIT_OPEN_BID.getCode());
+        qtyy.add(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
+        qtyy.add(PmProjectStatus.POST_BID_QUERY.getCode());
+        pmDemandReqVo.setProjectStatusList(qtyy);
+        StatisticalChartsResVo resVo5 = pmDemandMapper.countProjectExceedAndStatus(pmDemandReqVo);
+        resVo5.setColumnName("其他原因项目数量");
+        resVos.add(resVo5);
+        return AjaxResult.success(resVos);
+    }
+
+    @Override
+    public AjaxResult countPurTask(PmDemandReqVo pmDemandReqVo) {
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
+        //是-1就是查询自己及子孙级以下,否则只查询指定部门
+        pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
+        //1、所属采购服务站数量
+        //查询现有的采购服务站
+        SysDictData dictData = new SysDictData();
+        dictData.setDictType("purchase_services");
+        List<SysDictData> servicesData = dictDataService.selectDictDataList(dictData);
+        StatisticalChartsResVo resVo = new StatisticalChartsResVo();
+        resVo.setColumnName("所属采购服务站数量");
+        resVo.setNum(servicesData.size());
+        resVos.add(resVo);
+        //2、所属采购机构--根据招标代理机构管理中的白名单数据显示
+        StatisticalChartsResVo resVo2 = pmDemandMapper.countBaseAgencyWithWhite();
+        resVo2.setColumnName("所属采购机构");
+        resVos.add(resVo2);
+        //3、新受领集中采购数量--状态为“任务待下达”之后的数据
+        List<Long> demandIdAll = questionHisService.selectDemandIdAll();
+        pmDemandReqVo.setDemandIdAll(demandIdAll);
+        StatisticalChartsResVo resVo3 = pmDemandMapper.JZCGnum(pmDemandReqVo);
+        resVo3.setColumnName("新受领集中采购数量");
+        resVos.add(resVo3);
+        //4、上年度结转任务数量  上年度“任务待下达”之后,“合同待填制”之前的状态的数据
+        List<String> snzj = new ArrayList<>();
+        snzj.add(PmProjectStatus.TASK_WAIT_RELEASE.getCode());
+        snzj.add(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        snzj.add(PmProjectStatus.EXPERT_FEEDBACK.getCode());
+        snzj.add(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        snzj.add(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
+        snzj.add(PmProjectStatus.PRE_BID_QUERY.getCode());
+        snzj.add(PmProjectStatus.WAIT_OPEN_BID.getCode());
+        snzj.add(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
+        snzj.add(PmProjectStatus.WASTE_BID_HANDLE.getCode());
+        pmDemandReqVo.setProjectStatusList(snzj);
+        StatisticalChartsResVo resVo4 = pmDemandMapper.countProjecReaAndStatus(pmDemandReqVo);
+        resVo4.setColumnName("上年度结转任务数量");
+        resVos.add(resVo4);
+        return AjaxResult.success(resVos);
+    }
+
+    @Override
+    public AjaxResult countMajorProjectNumCGB(PmDemandReqVo pmDemandReqVo) {
+        //新增执行滞后采购任务数量分析 所有的超过计划完成采购时间的数据w
+
+        return null;
+    }
+
     //查询不同状态下的项目数据
     public List<PmDemandResVo> getListByStatus(String projectStatus) {
         LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();

+ 10 - 0
purchase-system/src/main/resources/mapper/pm/PmCallQuestionHisMapper.xml

@@ -4,6 +4,16 @@
 
 
     <select id="selectDemandIdAll" resultType="java.lang.Long">
+        select demand_id
+        FROM pm_bid_failure
+        GROUP BY demand_id
+    </select>
 
+    <select id="selectDemandIdAllWith" resultType="java.lang.Long">
+        select demand_id
+        FROM pm_bid_failure
+        WHERE call_question = '是'
+        GROUP BY demand_id
     </select>
+
 </mapper>

+ 83 - 9
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -338,6 +338,24 @@
         AND YEAR(create_time ) = YEAR(now())
         AND project_status &lt; #{vo.projectStatus}
     </select>
+    <select id="majorProjectByStatusThisMonthFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        <include refid="majorProjectByStatus"></include>
+        AND MONTH(create_time ) = MONTH(now())
+        AND project_status &gt; #{vo.projectStatus}
+    </select>
+    <select id="majorProjectByStatusThisQuaFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        <include refid="majorProjectByStatus"></include>
+        AND QUARTER(create_time ) = QUARTER(now())
+        AND project_status &gt; #{vo.projectStatus}
+    </select>
+    <select id="majorProjectByStatusThisYearFiCGB" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        <include refid="majorProjectByStatus"></include>
+        AND YEAR(create_time ) = YEAR(now())
+        AND project_status &gt; #{vo.projectStatus}
+    </select>
     <select id="majorProjectByStatusLastYear" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
             resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
         <include refid="majorProjectByStatus"></include>
@@ -483,8 +501,8 @@
 
     <!-- 正常推进项目 -->
     <select id="purchaseProjectExecuteNormalPropulsion" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
-            resultType="java.util.Map">
-        select count(demand_id) countNormalPropulsion, ifnull(sum(evaluation), 0) evaluationNormalPropulsion
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        select count(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -492,14 +510,14 @@
             #{item}
         </foreach>
         AND project_status !=21
-        and (real_demand_commit_time > plan_demand_sub_time
-        or real_purchase_finish_time > plan_purchase_finish_time
-        or real_deliver_time > plan_deliver_time)
+        and (real_demand_commit_time &lt; plan_demand_sub_time
+        or real_purchase_finish_time &lt; plan_purchase_finish_time
+        or real_deliver_time &lt; plan_deliver_time)
     </select>
 
     <select id="purchaseProjectExecuteIncomplete" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
-            resultType="java.util.Map">
-        select count(demand_id) countIncomplete, ifnull(sum(evaluation), 0) evaluationIncomplete
+            resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        select count(demand_id) num, ifnull(sum(evaluation), 0) evaluationTotal
         from pm_demand
         where purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -887,9 +905,29 @@
         AND YEAR(d.create_time) = YEAR(NOW())
     </select>
 
+    <select id="selectFInishAll" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
+        SELECT YEAR(NOW()) columnName, de.num,de.evaluationTotal,ifnull(sum(c.contract_amount), 0)
+        evaluationContractTotal
+        FROM pm_demand d, pm_contract_info c,
+        (SELECT COUNT(demand_id) num ,ifnull(sum(evaluation), 0) evaluationTotal FROM pm_demand WHERE purchase_dept_id
+        in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND project_status &gt; 17 ) de
+        WHERE d.demand_id = c.demand_id and purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND d.project_status &gt; 17
+    </select>
+
     <select id="selectCCThisYear" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
             parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
-        SELECT YEAR(NOW()) columnName,ifnull(demand_id, 0) num,ifnull(sum(evaluation), 0) evaluationTotal
+        SELECT YEAR(NOW()) columnName,ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
         FROM pm_demand
         WHERE purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -901,7 +939,7 @@
     </select>
 
     <sql id="countProjectExceedAndStatus">
-        SELECT ifnull(demand_id, 0) num,ifnull(sum(evaluation), 0) evaluationTotal
+        SELECT ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
         FROM pm_demand
         WHERE purchase_dept_id in
         <foreach collection="vo.deptList" item="item" index="index"
@@ -928,5 +966,41 @@
         </if>
     </select>
 
+    <select id="countBaseAgencyWithWhite" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        SELECT ifnull(COUNT(id), 0) num
+        FROM base_agency
+        WHERE status = 0
+    </select>
+
+    <select id="JZCGnum" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
+        SELECT YEAR(NOW()) columnName,ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
+        FROM pm_demand
+        WHERE purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND project_status &gt; 8
+        AND YEAR(create_time) = YEAR(NOW())
+    </select>
+
+    <select id="countProjecReaAndStatus" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo">
+        SELECT ifnull(COUNT(demand_id), 0) num,ifnull(sum(evaluation), 0) evaluationTotal
+        FROM pm_demand
+        WHERE purchase_dept_id in
+        <foreach collection="vo.deptList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        AND project_status in
+        <foreach collection="vo.projectStatusList" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item}
+        </foreach>
+        and YEAR(create_time) = YEAR(NOW())-1
+    </select>
+
 
 </mapper>