Bladeren bron

补充字段

buzhanyi 2 jaren geleden
bovenliggende
commit
e787c0ce92

+ 4 - 0
purchase-system/src/main/java/com/ozs/home/domain/vo/HomeToDoQueryResVo.java

@@ -126,4 +126,8 @@ public class HomeToDoQueryResVo implements Serializable {
      */
     @ApiModelProperty("项目状态名称")
     private String projectStatusName;
+    /**
+     * 项目是否滞后
+     */
+    private String isExceedProject;
 }

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

@@ -638,6 +638,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
                 break;
             }
         }
+        thresholdTime.setYear(date.getYear());
         double surplus = thresholdTime.getTime() - date.getTime();
         //少于一周便提醒
         if (surplus < remindTine && surplus > 0) {

+ 9 - 28
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -841,14 +841,13 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         //计划待提交,需求待提交,合同待填制,项目建设待完成
         List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
         List<PmDemandResVo> demandRes = demandService.demandWaitCommit();
-        List<PmDemandResVo> demandRes1 = demandService.contractWaitFilled();
-        List<PmDemandResVo> demandRes2 = demandService.projectWaitFinish();
+        demandRes.addAll(demandService.contractWaitFilled());
+        demandRes.addAll(demandService.projectWaitFinish());
         //转为首页table展示数据
         if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
             for (PlanQuarterResponseVo planVo : planRes) {
                 HomeToDoQueryResVo home = new HomeToDoQueryResVo();
                 BeanUtils.copyProperties(planVo, home);
-
                 homeRes.add(home);
             }
         }
@@ -859,20 +858,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 homeRes.add(home);
             }
         }
-        if (!ObjectUtils.isEmpty(demandRes1) && demandRes1.size() > 0) {
-            for (PmDemandResVo demandResVo : demandRes1) {
-                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
-                BeanUtils.copyProperties(demandResVo, home);
-                homeRes.add(home);
-            }
-        }
-        if (!ObjectUtils.isEmpty(demandRes2) && demandRes2.size() > 0) {
-            for (PmDemandResVo demandResVo : demandRes2) {
-                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
-                BeanUtils.copyProperties(demandResVo, home);
-                homeRes.add(home);
-            }
-        }
+
         return AjaxResult.success(homeRes);
     }
 
@@ -882,7 +868,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         //计划待审核,需求待审核,任务待下达
         List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAIEXAMINE.getCode());
         List<PmDemandResVo> demandRes = demandService.demandWaitExamine();
-        List<PmDemandResVo> demandRes1 = demandService.taskWaitRelease();
+        demandRes.addAll(demandService.taskWaitRelease());
         //转为首页table展示数据
         if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
             for (PlanQuarterResponseVo planVo : planRes) {
@@ -898,13 +884,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 homeRes.add(home);
             }
         }
-        if (!ObjectUtils.isEmpty(demandRes1) && demandRes1.size() > 0) {
-            for (PmDemandResVo demandResVo : demandRes1) {
-                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
-                BeanUtils.copyProperties(demandResVo, home);
-                homeRes.add(home);
-            }
-        }
+
         return AjaxResult.success(homeRes);
     }
 
@@ -1087,9 +1067,10 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         //提报时间的结束时间阈值
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date thresholdTime = dateFormat.parse(thresholdMap.get("起止时间结束"));
-
-        double surplus = thresholdTime.getTime() - System.currentTimeMillis();
-        //少于设定阈值便提醒
+        Date date = new Date();
+        thresholdTime.setYear(date.getYear());
+        double surplus = thresholdTime.getTime() - date.getTime();
+        //少于设定天数便提醒
         if (surplus < remindTime && surplus > 0) {
             //剩余天数(向上取整)
             int i = new Double(Math.ceil(surplus / 1000 / 60 / 60 / 24)).intValue();

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

@@ -239,4 +239,9 @@ public class PmDemandResVo extends BaseEntity
      * 待办事项提示信息
      */
     private String tipsMessage;
+    /**
+     * 项目是否滞后 1为滞后
+     */
+    private String isExceedProject;
+
 }

+ 28 - 0
purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/StatisticalChartsResVo.java

@@ -0,0 +1,28 @@
+package com.ozs.pm.doman.vo.responseVo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author buzhanyi
+ * 统计图数据
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class StatisticalChartsResVo {
+
+    /**
+     * 字段名称
+     */
+    private String columnName;
+    /**
+     * 对应的数量
+     */
+    private String num;
+    /**
+     * 总金额
+     */
+    private String evaluationTotal;
+}

+ 21 - 1
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.base.domain.vo.BaseExpertVo;
 import com.ozs.pm.doman.PmDemand;
 import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
+import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -13,7 +14,7 @@ import java.util.Map;
 
 /**
  * 采购需求Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2023-01-16
  */
@@ -36,8 +37,27 @@ public interface PmDemandMapper extends BaseMapper<PmDemand>
 
     /**
      * 统计分析-采购项目信息统计
+     *
      * @param pmDemandReqVo
      * @return
      */
     Map<String, Integer> purchaseProjectStatistical(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 按照项目属性统计所有的项目
+     *
+     * @return
+     */
+    List<StatisticalChartsResVo> countByProjectAttr();
+
+    /**
+     * 按照概算金额统计所有的项目
+     *
+     * @return
+     */
+    StatisticalChartsResVo countByEvaluationLt(Integer evaluation);
+
+    StatisticalChartsResVo countByEvaluationBet(@Param("evaluation") Integer evaluation, @Param("evaluationEnd") Integer evaluationEnd);
+
+    StatisticalChartsResVo countByEvaluationGt(Integer evaluation);
 }

+ 18 - 0
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -9,6 +9,7 @@ import com.ozs.pm.doman.PmDemand;
 import com.ozs.pm.doman.vo.requestVo.*;
 import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
 import com.ozs.pm.doman.vo.responseVo.PmFlowChartResVo;
+import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
 import com.ozs.system.domain.SysFileRef;
 
 import java.util.List;
@@ -217,8 +218,25 @@ public interface IPmDemandService extends IService<PmDemand> {
 
     /**
      * 统计分析-采购项目信息统计
+     *
      * @param pmDemandReqVo
      * @return
      */
     Map<String, Integer> purchaseProjectStatistical(PmDemandReqVo pmDemandReqVo);
+
+    /**
+     * 统计分析-按照项目属性统计所有的项目
+     *
+     * @param
+     * @return
+     */
+    List<StatisticalChartsResVo> countByProjectAttr();
+
+    /**
+     * 统计分析-按照概算金额统计所有的项目
+     *
+     * @param
+     * @return
+     */
+    List<StatisticalChartsResVo> countByEvaluation();
 }

+ 51 - 1
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -1302,9 +1302,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         demandRes.addAll(getListByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode()));
         demandRes.addAll(getListByStatus(PmProjectStatus.WAIT_BID_ANNOUNCEMENT.getCode()));
         demandRes.addAll(getListByStatus(PmProjectStatus.BIDDING_PUBLICITY.getCode()));
+
         //计划数据--发函催告
         List<PlanQuarterResponseVo> planRes = planYearsService.willSendLetter();
         //转为首页table展示数据
+        if (!ObjectUtils.isEmpty(demandRes) && demandRes.size() > 0) {
+            for (PmDemandResVo demandResVoVo : demandRes) {
+                HomeToDoQueryResVo home = new HomeToDoQueryResVo();
+                BeanUtils.copyProperties(demandResVoVo, home);
+                homeRes.add(home);
+            }
+        }
         if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
             for (PlanQuarterResponseVo planVo : planRes) {
                 HomeToDoQueryResVo home = new HomeToDoQueryResVo();
@@ -1326,6 +1334,46 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return map;
     }
 
+    @Override
+    public List<StatisticalChartsResVo> countByProjectAttr() {
+        List<StatisticalChartsResVo> resVos = pmDemandMapper.countByProjectAttr();
+        for (StatisticalChartsResVo chartsResVo : resVos) {
+            for (PmProjectStatus value : PmProjectStatus.values()) {
+                if (value.getCode().equals(chartsResVo.getColumnName())) {
+                    chartsResVo.setColumnName(value.getInfo());
+                    break;
+                }
+            }
+        }
+        return resVos;
+    }
+
+    @Override
+    public List<StatisticalChartsResVo> countByEvaluation() {
+        List<StatisticalChartsResVo> resVos = new ArrayList<>();
+        //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
+        StatisticalChartsResVo resVo = pmDemandMapper.countByEvaluationLt(100);
+        resVo.setColumnName("100万以下采购任务");
+        resVos.add(resVo);
+        StatisticalChartsResVo resVo1 = pmDemandMapper.countByEvaluationBet(100, 500);
+        resVo1.setColumnName("100至500万元采购任务");
+        resVos.add(resVo1);
+        StatisticalChartsResVo resVo2 = pmDemandMapper.countByEvaluationBet(500, 1000);
+        resVo2.setColumnName("500至1000万元采购任务");
+        resVos.add(resVo2);
+        StatisticalChartsResVo resVo3 = pmDemandMapper.countByEvaluationBet(1000, 5000);
+        resVo3.setColumnName("1000至5000万元采购任务");
+        resVos.add(resVo3);
+        StatisticalChartsResVo resVo4 = pmDemandMapper.countByEvaluationBet(5000, 10000);
+        resVo4.setColumnName("5000至1亿元采购任务");
+        resVos.add(resVo4);
+        StatisticalChartsResVo resVo5 = pmDemandMapper.countByEvaluationGt(10000);
+        resVo5.setColumnName("1亿元及以上采购任务");
+        resVos.add(resVo5);
+        return resVos;
+    }
+
+
     //查询不同状态下的项目数据
     public List<PmDemandResVo> getListByStatus(String projectStatus) {
         LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
@@ -1404,9 +1452,11 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     break;
                 }
             }
-
             try {
                 vo.setTipsMessage(pmDemandGetTips(vo.getPlanDeliverTime()));
+                if (vo.getTipsMessage().contains("超过")) {
+                    vo.setIsExceedProject("1");
+                }
             } catch (ParseException e) {
                 e.printStackTrace();
             }

+ 31 - 3
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -25,7 +25,35 @@
         </if>
     </select>
 
-    <select id="purchaseProjectStatistical" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo" resultType="java.util.Map">
-        select * from pm_demand
+    <select id="purchaseProjectStatistical" parameterType="com.ozs.pm.doman.vo.requestVo.PmDemandReqVo"
+            resultType="java.util.Map">
+        select *
+        from pm_demand
     </select>
-</mapper>
+
+    <select id="countByProjectAttr" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        SELECT project_status columnName, COUNT(demand_id) num, SUM(evaluation) evaluationTotal
+        FROM `pm_demand`
+        GROUP BY project_status
+    </select>
+
+    <select id="countByEvaluationLt" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
+        FROM `pm_demand`
+        WHERE evaluation &lt; #{evaluation}
+    </select>
+
+    <select id="countByEvaluationBet" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
+        SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
+        FROM `pm_demand`
+        WHERE evaluation BETWEEN #{evaluation} and #{evaluationEnd}
+    </select>
+    <select id="countByEvaluationGt" resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo"
+            parameterType="java.lang.Integer">
+        SELECT COUNT(demand_id) num, SUM(evaluation) evaluationTotal
+        FROM `pm_demand`
+        WHERE evaluation &gt; #{evaluation}
+    </select>
+
+
+</mapper>