|
@@ -852,41 +852,28 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
|
|
|
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();
|
|
|
+ Integer numByProjectStatus = getNumByProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
|
|
|
+ Integer numByStatus = demandService.getNumByStatus(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode());
|
|
|
+ Integer numByStatus1 = demandService.getNumByStatus(PmProjectStatus.CONTRACT_WAIT_FILL.getCode());
|
|
|
+ Integer numByStatus2 = demandService.getNumByStatus(PmProjectStatus.UNDER_CONSTRUCTION.getCode());
|
|
|
StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
|
|
|
chartsResVo.setColumnName("计划待提交");
|
|
|
- if (!ObjectUtils.isEmpty(planRes)) {
|
|
|
- chartsResVo.setNum(planRes.size());
|
|
|
- } else {
|
|
|
- chartsResVo.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo.setNum(numByProjectStatus);
|
|
|
result.add(chartsResVo);
|
|
|
+
|
|
|
StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
|
|
|
chartsResVo1.setColumnName("需求待提交");
|
|
|
- if (!ObjectUtils.isEmpty(demandRes)) {
|
|
|
- chartsResVo1.setNum(demandRes.size());
|
|
|
- } else {
|
|
|
- chartsResVo1.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo1.setNum(numByStatus);
|
|
|
result.add(chartsResVo1);
|
|
|
+
|
|
|
StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
|
|
|
chartsResVo2.setColumnName("合同待填制");
|
|
|
- if (!ObjectUtils.isEmpty(pmDemandResVos)) {
|
|
|
- chartsResVo2.setNum(pmDemandResVos.size());
|
|
|
- } else {
|
|
|
- chartsResVo2.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo2.setNum(numByStatus1);
|
|
|
result.add(chartsResVo2);
|
|
|
+
|
|
|
StatisticalChartsResVo chartsResVo3 = new StatisticalChartsResVo();
|
|
|
chartsResVo3.setColumnName("项目建设待完成");
|
|
|
- if (!ObjectUtils.isEmpty(pmDemandResVos1)) {
|
|
|
- chartsResVo3.setNum(pmDemandResVos1.size());
|
|
|
- } else {
|
|
|
- chartsResVo3.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo3.setNum(numByStatus2);
|
|
|
result.add(chartsResVo3);
|
|
|
|
|
|
StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
|
|
@@ -902,8 +889,9 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
|
|
|
List<HomeToDoQueryResVo> homeRes = new ArrayList<>();
|
|
|
//计划待审核,需求待审核,任务待下达
|
|
|
List<PlanQuarterResponseVo> planRes = getListByProjectStatus(ProjectStatus.PLANWAIEXAMINE.getCode());
|
|
|
- List<PmDemandResVo> demandRes = demandService.demandWaitExamine();
|
|
|
+ List<PmDemand> demandRes = demandService.demandWaitExamine();
|
|
|
demandRes.addAll(demandService.taskWaitRelease());
|
|
|
+ List<PmDemandResVo> vos = demandService.listToVoList(demandRes);
|
|
|
//转为首页table展示数据
|
|
|
if (!ObjectUtils.isEmpty(planRes) && planRes.size() > 0) {
|
|
|
for (PlanQuarterResponseVo planVo : planRes) {
|
|
@@ -913,7 +901,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
|
|
|
}
|
|
|
}
|
|
|
if (!ObjectUtils.isEmpty(demandRes) && demandRes.size() > 0) {
|
|
|
- for (PmDemandResVo demandResVo : demandRes) {
|
|
|
+ for (PmDemandResVo demandResVo : vos) {
|
|
|
HomeToDoQueryResVo home = new HomeToDoQueryResVo();
|
|
|
home.setEvaluation(BigDecimal.valueOf(demandResVo.getEvaluation()));
|
|
|
BeanUtils.copyProperties(demandResVo, home);
|
|
@@ -928,33 +916,23 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
|
|
|
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();
|
|
|
+ Integer status = getNumByProjectStatus(ProjectStatus.PLANWAIEXAMINE.getCode());
|
|
|
+ Integer numByStatus = demandService.getNumByStatus(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode());
|
|
|
+ Integer numByStatus1 = demandService.getNumByStatus(PmProjectStatus.TASK_WAIT_RELEASE.getCode());
|
|
|
|
|
|
StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
|
|
|
chartsResVo.setColumnName("计划待审核");
|
|
|
- if (!ObjectUtils.isEmpty(planRes)) {
|
|
|
- chartsResVo.setNum(planRes.size());
|
|
|
- } else {
|
|
|
- chartsResVo.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo.setNum(status);
|
|
|
result.add(chartsResVo);
|
|
|
+
|
|
|
StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
|
|
|
chartsResVo1.setColumnName("需求待审核");
|
|
|
- if (!ObjectUtils.isEmpty(demandRes)) {
|
|
|
- chartsResVo1.setNum(demandRes.size());
|
|
|
- } else {
|
|
|
- chartsResVo1.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo1.setNum(numByStatus);
|
|
|
result.add(chartsResVo1);
|
|
|
+
|
|
|
StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
|
|
|
chartsResVo2.setColumnName("任务待下达");
|
|
|
- if (!ObjectUtils.isEmpty(demandResVos)) {
|
|
|
- chartsResVo2.setNum(demandResVos.size());
|
|
|
- } else {
|
|
|
- chartsResVo2.setNum(0);
|
|
|
- }
|
|
|
+ chartsResVo2.setNum(numByStatus1);
|
|
|
result.add(chartsResVo2);
|
|
|
|
|
|
StatisticalChartsResVo chartsResVoT = new StatisticalChartsResVo();
|
|
@@ -1174,6 +1152,24 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
|
|
|
return vos;
|
|
|
}
|
|
|
|
|
|
+ //计划待提交、计划待审核的数量
|
|
|
+ public Integer getNumByProjectStatus(String projectStatus) {
|
|
|
+ LoginUser user = SecurityUtils.getLoginUser();
|
|
|
+ LambdaQueryWrapper<PlanYears> yearsLp = new LambdaQueryWrapper<PlanYears>();
|
|
|
+ yearsLp.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
|
|
|
+ yearsLp.eq(PlanYears::getProjectStatus, projectStatus);
|
|
|
+ yearsLp.eq(PlanYears::getPurchaseDeptId, user.getDeptId());
|
|
|
+ Long count = planYearsMapper.selectCount(yearsLp);
|
|
|
+
|
|
|
+ LambdaQueryWrapper<PlanQuarter> quarterLp = new LambdaQueryWrapper<PlanQuarter>();
|
|
|
+ quarterLp.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
|
|
|
+ quarterLp.eq(PlanQuarter::getProjectStatus, projectStatus);
|
|
|
+ quarterLp.eq(PlanQuarter::getPurchaseDeptId, user.getDeptId());
|
|
|
+ Long aLong = planQuarterMapper.selectCount(quarterLp);
|
|
|
+ //融合一起
|
|
|
+ return Math.toIntExact(count) + Math.toIntExact(aLong);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 年度计划与季度数据一起
|
|
|
*
|