Browse Source

DeBugDeBugDeBug

buzhanyi 2 năm trước cách đây
mục cha
commit
8720e91b95

+ 7 - 0
purchase-system/src/main/java/com/ozs/plan/service/PlanYearsService.java

@@ -230,6 +230,13 @@ public interface PlanYearsService extends IService<PlanYears> {
      */
     List<PlanQuarterResponseVo> willSendLetter();
 
+    /**
+     * 采购办首页待办事项(发函催告数量)
+     *
+     * @return
+     */
+    Integer willSendLetterNum();
+
     /**
      * 采购管理部门首页待办事项(全部)
      *

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

@@ -1129,20 +1129,31 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
     @Override
     public List<PlanQuarterResponseVo> willSendLetter() {
         LoginUser user = SecurityUtils.getLoginUser();
-        LambdaQueryWrapper<PlanYears> yearsLp = new LambdaQueryWrapper<PlanYears>();
-        yearsLp.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
-        yearsLp.eq(PlanYears::getPurchaseDeptId, user.getDeptId());
-        yearsLp.eq(PlanYears::getSendLetter, "1");
-        List<PlanYears> planYears = planYearsMapper.selectList(yearsLp);
-
         LambdaQueryWrapper<PlanQuarter> quarterLp = new LambdaQueryWrapper<PlanQuarter>();
         quarterLp.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
         quarterLp.eq(PlanQuarter::getPurchaseDeptId, user.getDeptId());
         quarterLp.eq(PlanQuarter::getSendLetter, "1");
         List<PlanQuarter> planQuarters = planQuarterMapper.selectList(quarterLp);
-        //融合一起
-        List<PlanQuarterResponseVo> vos = planComplex(planYears, planQuarters);
-        return vos;
+        //转换返回类Vo
+        List<PlanQuarterResponseVo> quarterRes = quartzServiceImpl.changeTo(planQuarters);
+        return quarterRes;
+    }
+
+    /**
+     * 查询已被催告发函的计划(数量)
+     *
+     * @return
+     */
+    @Override
+    public Integer willSendLetterNum() {
+        //年度计划没有催告,只有临时和季度计划有
+        LoginUser user = SecurityUtils.getLoginUser();
+        LambdaQueryWrapper<PlanQuarter> quarterLp = new LambdaQueryWrapper<PlanQuarter>();
+        quarterLp.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
+        quarterLp.eq(PlanQuarter::getPurchaseDeptId, user.getDeptId());
+        quarterLp.eq(PlanQuarter::getSendLetter, "1");
+        Long aLong = planQuarterMapper.selectCount(quarterLp);
+        return Math.toIntExact(aLong);
     }
 
     public List<PlanQuarterResponseVo> getListByProjectStatus(String projectStatus) {

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

@@ -1896,97 +1896,65 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public AjaxResult procurementOfficeWillManipulateTotalNum() {
         List<StatisticalChartsResVo> result = new ArrayList<>();
         // 采购需求对接,专家意见反馈,采购文件编制审核,采购公告发布,标前质疑投诉,待开标,评标结果公告,流废标处置,标后质疑
-        List<PmDemandResVo> listByStatus = getListByStatus(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        Integer numByStatus = getNumByStatus(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
         StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
+        chartsResVo.setNum(numByStatus);
         chartsResVo.setColumnName("采购需求对接");
-        if (!ObjectUtils.isEmpty(listByStatus)) {
-            chartsResVo.setNum(listByStatus.size());
-        } else {
-            chartsResVo.setNum(0);
-        }
         result.add(chartsResVo);
 
-        List<PmDemandResVo> listByStatus1 = getListByStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
+        Integer numByStatus1 = getNumByStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
         StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
         chartsResVo1.setColumnName("专家意见反馈");
-        if (!ObjectUtils.isEmpty(listByStatus1)) {
-            chartsResVo1.setNum(listByStatus1.size());
-        } else {
-            chartsResVo1.setNum(0);
-        }
+        chartsResVo1.setNum(numByStatus1);
         result.add(chartsResVo1);
 
-        List<PmDemandResVo> listByStatus2 = getListByStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        Integer numByStatus2 = getNumByStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
         StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
         chartsResVo2.setColumnName("采购文件编制审核");
-        if (!ObjectUtils.isEmpty(listByStatus2)) {
-            chartsResVo2.setNum(listByStatus2.size());
-        } else {
-            chartsResVo2.setNum(0);
-        }
+        chartsResVo2.setNum(numByStatus2);
         result.add(chartsResVo2);
-        List<PmDemandResVo> listByStatus3 = getListByStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
+
+        Integer numByStatus3 = getNumByStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
         StatisticalChartsResVo chartsResVo3 = new StatisticalChartsResVo();
         chartsResVo3.setColumnName("采购公告发布");
-        if (!ObjectUtils.isEmpty(listByStatus3)) {
-            chartsResVo3.setNum(listByStatus3.size());
-        } else {
-            chartsResVo3.setNum(0);
-        }
+        chartsResVo3.setNum(numByStatus3);
         result.add(chartsResVo3);
-        List<PmDemandResVo> listByStatus4 = getListByStatus(PmProjectStatus.PRE_BID_QUERY.getCode());
+
+        Integer numByStatus4 = getNumByStatus(PmProjectStatus.PRE_BID_QUERY.getCode());
         StatisticalChartsResVo chartsResVo4 = new StatisticalChartsResVo();
         chartsResVo4.setColumnName("标前质疑投诉");
-        if (!ObjectUtils.isEmpty(listByStatus4)) {
-            chartsResVo4.setNum(listByStatus4.size());
-        } else {
-            chartsResVo4.setNum(0);
-        }
+        chartsResVo4.setNum(numByStatus4);
         result.add(chartsResVo4);
-        List<PmDemandResVo> listByStatus5 = getListByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
+
+        Integer numByStatus5 = getNumByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
         StatisticalChartsResVo chartsResVo5 = new StatisticalChartsResVo();
         chartsResVo5.setColumnName("待开标");
-        if (!ObjectUtils.isEmpty(listByStatus5)) {
-            chartsResVo5.setNum(listByStatus5.size());
-        } else {
-            chartsResVo5.setNum(0);
-        }
+        chartsResVo5.setNum(numByStatus5);
         result.add(chartsResVo5);
-        List<PmDemandResVo> listByStatus6 = getListByStatus(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
+
+        Integer numByStatus6 = getNumByStatus(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
         StatisticalChartsResVo chartsResVo6 = new StatisticalChartsResVo();
         chartsResVo6.setColumnName("评标结果公告");
-        if (!ObjectUtils.isEmpty(listByStatus6)) {
-            chartsResVo6.setNum(listByStatus6.size());
-        } else {
-            chartsResVo6.setNum(0);
-        }
+        chartsResVo6.setNum(numByStatus6);
         result.add(chartsResVo6);
-        List<PmDemandResVo> listByStatus7 = getListByStatus(PmProjectStatus.WASTE_BID_HANDLE.getCode());
+
+        Integer numByStatus7 = getNumByStatus(PmProjectStatus.WASTE_BID_HANDLE.getCode());
         StatisticalChartsResVo chartsResVo7 = new StatisticalChartsResVo();
         chartsResVo7.setColumnName("流废标处置");
-        if (!ObjectUtils.isEmpty(listByStatus7)) {
-            chartsResVo7.setNum(listByStatus7.size());
-        } else {
-            chartsResVo7.setNum(0);
-        }
+        chartsResVo7.setNum(numByStatus7);
         result.add(chartsResVo7);
-        List<PmDemandResVo> listByStatus8 = getListByStatus(PmProjectStatus.POST_BID_QUERY.getCode());
+
+        Integer numByStatus8 = getNumByStatus(PmProjectStatus.POST_BID_QUERY.getCode());
         StatisticalChartsResVo chartsResVo8 = new StatisticalChartsResVo();
         chartsResVo8.setColumnName("标后质疑");
-        if (!ObjectUtils.isEmpty(listByStatus8)) {
-            chartsResVo8.setNum(listByStatus8.size());
-        } else {
-            chartsResVo8.setNum(0);
-        }
-        result.add(chartsResVo8);  //计划数据--发函催告
-        List<PlanQuarterResponseVo> planRes = planYearsService.willSendLetter();
+        chartsResVo8.setNum(numByStatus8);
+        result.add(chartsResVo8);
+
+        //计划数据--发函催告
+        Integer letterNum = planYearsService.willSendLetterNum();
         StatisticalChartsResVo chartsResVo9 = new StatisticalChartsResVo();
         chartsResVo9.setColumnName("发函催告");
-        if (!ObjectUtils.isEmpty(planRes)) {
-            chartsResVo9.setNum(planRes.size());
-        } else {
-            chartsResVo9.setNum(0);
-        }
+        chartsResVo9.setNum(letterNum);
         result.add(chartsResVo9);
 
         StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
@@ -3903,7 +3871,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         if (!ObjectUtils.isEmpty(list) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
             lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
         }
-
+        l.eq(PmAuditDeptRef::getStatus, projectStatus);
         lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
         lw.last(" order by project_status, plan_demand_sub_time");
         List<PmDemand> demandList = this.baseMapper.selectList(lw);
@@ -3915,6 +3883,27 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return pmDemandResponseVoList;
     }
 
+    //查询不同状态下的项目数据的数量
+    public Integer getNumByStatus(String projectStatus) {
+        LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
+        //  4 (合同信息管理)、 0(需求单位管理) 、 5(项目建设管理)  需求单位
+        //  1(需求需求审核) 、2 (任务下达管理)      采购管理部门
+        //  3(采购执行管理)   采购办
+        List<PmAuditDeptRef> list = new ArrayList<>();
+        LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
+        l.eq(PmAuditDeptRef::getDeptId, SecurityUtils.getDeptId());
+        l.eq(PmAuditDeptRef::getRefType, "2");
+        list = pmAuditDeptRefService.list(l);
+        if (!ObjectUtils.isEmpty(list) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+            lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
+        }
+        l.eq(PmAuditDeptRef::getStatus, projectStatus);
+        lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
+        lw.last(" order by project_status, plan_demand_sub_time");
+        Long count = this.baseMapper.selectCount(lw);
+        return Math.toIntExact(count);
+    }
+
     //字段转换and赋值
     public List<PmDemandResVo> demandChangeTo(List<PmDemand> pmDemandList) {
         List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();