buzhanyi преди 2 години
родител
ревизия
6ca2b0fb78

+ 22 - 0
purchase-admin/src/main/java/com/ozs/web/controller/home/SystemHomepageController.java

@@ -98,6 +98,14 @@ public class SystemHomepageController extends BaseController {
         return planYearsService.demandUnitWillManipulateTotal();
     }
 
+    @ApiOperation(value = "需求单位首页待办事项(数量)")
+    @GetMapping("/demandUnit/will/totalNum")
+    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
+    public AjaxResult demandUnitWillManipulateTotalNum() {
+        return planYearsService.demandUnitWillManipulateTotalNum();
+    }
+
+
     @ApiOperation(value = "需求单位首页待办事项(计划待提交)")
     @GetMapping("/demandUnit/will/planWaitCommit")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
@@ -137,6 +145,13 @@ public class SystemHomepageController extends BaseController {
         return planYearsService.purchasingManagementWillManipulateTotal();
     }
 
+    @ApiOperation(value = "采购管理部门首页待办事项(数量)")
+    @GetMapping("/purchasingManagement/will/totalNum")
+    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
+    public AjaxResult purchasingManagementWillManipulateTotalNum() {
+        return planYearsService.purchasingManagementWillManipulateTotalNum();
+    }
+
     @ApiOperation(value = "采购管理部门首页待办事项(计划待审核)")
     @GetMapping("/purchasingManagement/will/planWaitExamine")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
@@ -168,6 +183,13 @@ public class SystemHomepageController extends BaseController {
         return pmDemandService.procurementOfficeWillManipulateTotal();
     }
 
+    @ApiOperation(value = "采购办首页待办事项(数量)")
+    @GetMapping("/procurementOffice/will/totalNum")
+    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
+    public AjaxResult procurementOfficeWillManipulateTotalNum() {
+        return pmDemandService.procurementOfficeWillManipulateTotalNum();
+    }
+
     @ApiOperation(value = "采购办首页待办事项(采购需求对接)")
     @GetMapping("/procurementOffice/will/purchaseDemandDocking")
     @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)

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

@@ -216,6 +216,13 @@ public interface PlanYearsService extends IService<PlanYears> {
      */
     AjaxResult demandUnitWillManipulateTotal();
 
+    /**
+     * 需求单位首页待办事项(数量)
+     *
+     * @return
+     */
+    AjaxResult demandUnitWillManipulateTotalNum();
+
     /**
      * 采购办首页待办事项(发函催告)
      *
@@ -230,6 +237,13 @@ public interface PlanYearsService extends IService<PlanYears> {
      */
     AjaxResult purchasingManagementWillManipulateTotal();
 
+    /**
+     * 采购管理部门首页待办事项(数量
+     *
+     * @return
+     */
+    AjaxResult purchasingManagementWillManipulateTotalNum();
+
     /**
      * 通过年度ID,查询季度、临时计划详情,通过季度、临时计划ID查询项目
      *

+ 103 - 1
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -844,6 +844,58 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         return AjaxResult.success(homeRes);
     }
 
+    /**
+     * 需求单位待办事项
+     */
+    @Override
+    public AjaxResult demandUnitWillManipulateTotalNum() {
+        List<StatisticalChartsResVo> result = new ArrayList<>();
+        //计划待提交,需求待提交,合同待填制,项目建设待完成
+        List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
+        List<PmDemandResVo> demandRes = demandService.demandWaitCommit();
+        List<PmDemandResVo> pmDemandResVos = demandService.contractWaitFilled();
+        List<PmDemandResVo> pmDemandResVos1 = demandService.projectWaitFinish();
+        StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
+        chartsResVo.setColumnName("计划待提交");
+        if (!ObjectUtils.isEmpty(planRes)) {
+            chartsResVo.setNum(planRes.size());
+        } else {
+            chartsResVo.setNum(0);
+        }
+        result.add(chartsResVo);
+        StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
+        chartsResVo1.setColumnName("需求待提交");
+        if (!ObjectUtils.isEmpty(demandRes)) {
+            chartsResVo1.setNum(demandRes.size());
+        } else {
+            chartsResVo1.setNum(0);
+        }
+        result.add(chartsResVo1);
+        StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
+        chartsResVo2.setColumnName("合同待填制");
+        if (!ObjectUtils.isEmpty(pmDemandResVos)) {
+            chartsResVo2.setNum(pmDemandResVos.size());
+        } else {
+            chartsResVo2.setNum(0);
+        }
+        result.add(chartsResVo2);
+        StatisticalChartsResVo chartsResVo3 = new StatisticalChartsResVo();
+        chartsResVo3.setColumnName("项目建设待完成");
+        if (!ObjectUtils.isEmpty(pmDemandResVos1)) {
+            chartsResVo3.setNum(pmDemandResVos1.size());
+        } else {
+            chartsResVo3.setNum(0);
+        }
+        result.add(chartsResVo3);
+
+        StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
+        chartsResVoT.setColumnName("全部");
+        chartsResVoT.setNum(willTotal(result));
+        result.add(chartsResVoT);
+
+        return AjaxResult.success(result);
+    }
+
     @Override
     public AjaxResult purchasingManagementWillManipulateTotal() {
         List<HomeToDoQueryResVo> homeRes = new ArrayList<>();
@@ -871,6 +923,56 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         return AjaxResult.success(homeRes);
     }
 
+    @Override
+    public AjaxResult purchasingManagementWillManipulateTotalNum() {
+        List<StatisticalChartsResVo> result = new ArrayList<>();
+        //计划待审核,需求待审核,任务待下达
+        List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAIEXAMINE.getCode());
+        List<PmDemandResVo> demandRes = demandService.demandWaitExamine();
+        List<PmDemandResVo> demandResVos = demandService.taskWaitRelease();
+
+        StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
+        chartsResVo.setColumnName("计划待审核");
+        if (!ObjectUtils.isEmpty(planRes)) {
+            chartsResVo.setNum(planRes.size());
+        } else {
+            chartsResVo.setNum(0);
+        }
+        result.add(chartsResVo);
+        StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
+        chartsResVo1.setColumnName("需求待审核");
+        if (!ObjectUtils.isEmpty(demandRes)) {
+            chartsResVo1.setNum(demandRes.size());
+        } else {
+            chartsResVo1.setNum(0);
+        }
+        result.add(chartsResVo1);
+        StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
+        chartsResVo2.setColumnName("任务待下达");
+        if (!ObjectUtils.isEmpty(demandResVos)) {
+            chartsResVo2.setNum(demandResVos.size());
+        } else {
+            chartsResVo2.setNum(0);
+        }
+        result.add(chartsResVo2);
+
+        StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
+        chartsResVoT.setColumnName("全部");
+        chartsResVoT.setNum(willTotal(result));
+        result.add(chartsResVoT);
+        return AjaxResult.success(result);
+    }
+
+    public Integer willTotal(List<StatisticalChartsResVo> result) {
+        Integer re = 0;
+        if (!ObjectUtils.isEmpty(result)) {
+            for (StatisticalChartsResVo resVo : result) {
+                re += resVo.getNum();
+            }
+        }
+        return re;
+    }
+
     /**
      * 通过年度ID,查询季度、临时计划详情,通过季度、临时计划ID查询项目
      *
@@ -1046,7 +1148,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         LambdaQueryWrapper<PlanQuarter> quarterLp = new LambdaQueryWrapper<PlanQuarter>();
         quarterLp.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
         quarterLp.eq(PlanQuarter::getProjectStatus, projectStatus);
-        yearsLp.eq(PlanYears::getPurchaseDeptId, user.getDeptId());
+        quarterLp.eq(PlanQuarter::getPurchaseDeptId, user.getDeptId());
         List<PlanQuarter> planQuarters = planQuarterMapper.selectList(quarterLp);
         //融合一起
         List<PlanQuarterResponseVo> vos = planComplex(planYears, planQuarters);

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

@@ -195,6 +195,13 @@ public interface IPmDemandService extends IService<PmDemand> {
      */
     AjaxResult procurementOfficeWillManipulateTotal();
 
+    /**
+     * 采购管理部门首页待办事项(数量)
+     *
+     * @return
+     */
+    AjaxResult procurementOfficeWillManipulateTotalNum();
+
     /**
      * 统计分析-采购项目信息统计
      *

+ 121 - 11
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -333,9 +333,9 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     vo.setTaskReleaseFileInfos(taskReleaseFileInfos);
                 }
             } else if ("4".equals(detailType)) { //中标信息
-                setPmPurchaseExecutionResVo(vo,pmDemand);
+                setPmPurchaseExecutionResVo(vo, pmDemand);
             } else if ("5".equals(detailType)) { //合同信息
-                setPmPurchaseExecutionResVo(vo,pmDemand);
+                setPmPurchaseExecutionResVo(vo, pmDemand);
                 LambdaQueryWrapper<PmContractInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                 lambdaQueryWrapper.eq(PmContractInfo::getDemandId, demandId);
                 PmContractInfo pmContractInfo = pmContractInfoService.getOne(lambdaQueryWrapper);
@@ -384,7 +384,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         vo.setPurchaseTaskDocumentNumber(pmDemand.getPurchaseTaskDocumentNumber());
         //专家意见反馈
         LambdaQueryWrapper<PmExpertFeedback> pmExpertFeedbackLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmExpertFeedbackLambdaQueryWrapper.eq(PmExpertFeedback::getDemandId,demandId);
+        pmExpertFeedbackLambdaQueryWrapper.eq(PmExpertFeedback::getDemandId, demandId);
         PmExpertFeedback pmExpertFeedback = pmExpertFeedbackService.getOne(pmExpertFeedbackLambdaQueryWrapper);
         if (!ObjectUtils.isEmpty(pmExpertFeedback)) {
             PmExpertFeedbackResVo pmExpertFeedbackResVo = new PmExpertFeedbackResVo();
@@ -556,6 +556,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         vo.setPmPurchaseExecutionResVo(pmPurchaseExecutionResVo);
 
     }
+
     /**
      * 查询采购需求列表
      *
@@ -1890,6 +1891,121 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return AjaxResult.success(homeRes);
     }
 
+    @Override
+    public AjaxResult procurementOfficeWillManipulateTotalNum() {
+        List<StatisticalChartsResVo> result = new ArrayList<>();
+        // 采购需求对接,专家意见反馈,采购文件编制审核,采购公告发布,标前质疑投诉,待开标,评标结果公告,流废标处置,标后质疑
+        List<PmDemandResVo> listByStatus = getListByStatus(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
+        StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
+        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());
+        StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
+        chartsResVo1.setColumnName("专家意见反馈");
+        if (!ObjectUtils.isEmpty(listByStatus1)) {
+            chartsResVo1.setNum(listByStatus1.size());
+        } else {
+            chartsResVo1.setNum(0);
+        }
+        result.add(chartsResVo1);
+
+        List<PmDemandResVo> listByStatus2 = getListByStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
+        StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
+        chartsResVo2.setColumnName("采购文件编制审核");
+        if (!ObjectUtils.isEmpty(listByStatus2)) {
+            chartsResVo2.setNum(listByStatus2.size());
+        } else {
+            chartsResVo2.setNum(0);
+        }
+        result.add(chartsResVo2);
+        List<PmDemandResVo> listByStatus3 = getListByStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
+        StatisticalChartsResVo chartsResVo3 = new StatisticalChartsResVo();
+        chartsResVo3.setColumnName("采购公告发布");
+        if (!ObjectUtils.isEmpty(listByStatus3)) {
+            chartsResVo3.setNum(listByStatus3.size());
+        } else {
+            chartsResVo3.setNum(0);
+        }
+        result.add(chartsResVo3);
+        List<PmDemandResVo> listByStatus4 = getListByStatus(PmProjectStatus.PRE_BID_QUERY.getCode());
+        StatisticalChartsResVo chartsResVo4 = new StatisticalChartsResVo();
+        chartsResVo4.setColumnName("标前质疑投诉");
+        if (!ObjectUtils.isEmpty(listByStatus4)) {
+            chartsResVo4.setNum(listByStatus4.size());
+        } else {
+            chartsResVo4.setNum(0);
+        }
+        result.add(chartsResVo4);
+        List<PmDemandResVo> listByStatus5 = getListByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
+        StatisticalChartsResVo chartsResVo5 = new StatisticalChartsResVo();
+        chartsResVo5.setColumnName("待开标");
+        if (!ObjectUtils.isEmpty(listByStatus5)) {
+            chartsResVo5.setNum(listByStatus5.size());
+        } else {
+            chartsResVo5.setNum(0);
+        }
+        result.add(chartsResVo5);
+        List<PmDemandResVo> listByStatus6 = getListByStatus(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
+        StatisticalChartsResVo chartsResVo6 = new StatisticalChartsResVo();
+        chartsResVo6.setColumnName("评标结果公告");
+        if (!ObjectUtils.isEmpty(listByStatus6)) {
+            chartsResVo6.setNum(listByStatus6.size());
+        } else {
+            chartsResVo6.setNum(0);
+        }
+        result.add(chartsResVo6);
+        List<PmDemandResVo> listByStatus7 = getListByStatus(PmProjectStatus.WASTE_BID_HANDLE.getCode());
+        StatisticalChartsResVo chartsResVo7 = new StatisticalChartsResVo();
+        chartsResVo7.setColumnName("流废标处置");
+        if (!ObjectUtils.isEmpty(listByStatus7)) {
+            chartsResVo7.setNum(listByStatus7.size());
+        } else {
+            chartsResVo7.setNum(0);
+        }
+        result.add(chartsResVo7);
+        List<PmDemandResVo> listByStatus8 = getListByStatus(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();
+        StatisticalChartsResVo chartsResVo9 = new StatisticalChartsResVo();
+        chartsResVo9.setColumnName("发函催告");
+        if (!ObjectUtils.isEmpty(planRes)) {
+            chartsResVo9.setNum(planRes.size());
+        } else {
+            chartsResVo9.setNum(0);
+        }
+        result.add(chartsResVo9);
+
+        StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
+        chartsResVoT.setColumnName("全部");
+        chartsResVoT.setNum(willTotal(result));
+        result.add(chartsResVoT);
+
+        return AjaxResult.success(result);
+    }
+
+    public Integer willTotal(List<StatisticalChartsResVo> result) {
+        Integer re = 0;
+        if (!ObjectUtils.isEmpty(result)) {
+            for (StatisticalChartsResVo resVo : result) {
+                re += resVo.getNum();
+            }
+        }
+        return re;
+    }
+
     /**
      * 统计分析-采购项目信息统计
      *
@@ -3785,14 +3901,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         l.eq(PmAuditDeptRef::getDeptId, SecurityUtils.getDeptId());
         l.eq(PmAuditDeptRef::getRefType, "2");
         list = pmAuditDeptRefService.list(l);
-        if (!user.getUserId().toString().equals("1")) {
-            if (Arrays.asList(1, 2, 3).contains(0)) {
-                if (!ObjectUtils.isEmpty(list) && !SecurityUtils.getUserId().equals(Integer.parseInt("1"))) {
-                    lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
-                }
-            } else {
-                lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
-            }
+        if (!ObjectUtils.isEmpty(list) && !SecurityUtils.getUserId().equals(Integer.parseInt("1"))) {
+            lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
         }
         lw.eq(PmDemand::getProjectStatus, projectStatus);
         lw.last(" order by project_status, plan_demand_sub_time");