|
@@ -582,19 +582,29 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
@Override
|
|
|
public IPage<PmDemandResVo> selectPmDemandList(PmDemandReqVo pmDemandReqVo, int reqType) {
|
|
|
LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<>();
|
|
|
- // 4 (合同信息管理)、 0(需求单位管理) 、 5(项目建设管理) 需求单位
|
|
|
- // 1(需求需求审核) 、2 (任务下达管理) 采购管理部门
|
|
|
- // 3(采购执行管理) 采购办
|
|
|
+ SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
|
|
|
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 (!pmDemandReqVo.getIsAdmin()) {
|
|
|
- if (Arrays.asList(1, 2, 3).contains(reqType)) {
|
|
|
+ if (Arrays.asList(1, 2).contains(reqType)) {
|
|
|
if (!ObjectUtils.isEmpty(list)) {
|
|
|
lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
}
|
|
|
+ //采购执行管理中,本单位超额项目交给上级处理,本单位不处理。
|
|
|
+ } else if (3 == reqType) {
|
|
|
+ if (!ObjectUtils.isEmpty(list)) {
|
|
|
+ //查出审核此项目的单位
|
|
|
+ List<Long> longList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
|
|
|
+ // 如果有上级单位存在,将本单位剔除
|
|
|
+ SysDept sysDept = deptMapper.selectDeptById(sysUser.getDeptId());
|
|
|
+ if (longList.contains(sysDept.getParentId())) {
|
|
|
+ longList.remove(sysUser.getDeptId());
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
} else {
|
|
|
lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
|
}
|
|
@@ -1851,55 +1861,55 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> purchaseDemandDocking() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> expertFeedback() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> procurementDocumentsReview() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> procurementAnnouncement() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> preBidQuery() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.PRE_BID_QUERY.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.PRE_BID_QUERY.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> waitOpenBid() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.WAIT_OPEN_BID.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> bidResultAnnouncement() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> wasteBidHandle() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.WASTE_BID_HANDLE.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.WASTE_BID_HANDLE.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<PmDemandResVo> postBidQuery() {
|
|
|
- List<PmDemand> byStatus = getListByStatus(PmProjectStatus.POST_BID_QUERY.getCode());
|
|
|
+ List<PmDemand> byStatus = getListByStatusCGB(PmProjectStatus.POST_BID_QUERY.getCode());
|
|
|
return listToVoList(byStatus);
|
|
|
}
|
|
|
|
|
@@ -1918,7 +1928,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
projectStatus.add(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
|
|
|
projectStatus.add(PmProjectStatus.WASTE_BID_HANDLE.getCode());
|
|
|
projectStatus.add(PmProjectStatus.POST_BID_QUERY.getCode());
|
|
|
- demandRes = listToVoList(getListByStatusTotal(projectStatus));
|
|
|
+ demandRes = listToVoList(getListByStatusTotalCGB(projectStatus));
|
|
|
|
|
|
//计划数据--发函催告
|
|
|
List<PlanQuarterResponseVo> planRes = planYearsService.willSendLetter();
|
|
@@ -1945,55 +1955,55 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
public AjaxResult procurementOfficeWillManipulateTotalNum() {
|
|
|
List<StatisticalChartsResVo> result = new ArrayList<>();
|
|
|
// 采购需求对接,专家意见反馈,采购文件编制审核,采购公告发布,标前质疑投诉,待开标,评标结果公告,流废标处置,标后质疑
|
|
|
- Integer numByStatus = getNumByStatus(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
|
|
|
+ Integer numByStatus = getNumByStatusCGB(PmProjectStatus.PURCHASE_DEMAND_DOCKING.getCode());
|
|
|
StatisticalChartsResVo chartsResVo = new StatisticalChartsResVo();
|
|
|
chartsResVo.setNum(numByStatus);
|
|
|
chartsResVo.setColumnName("采购需求对接");
|
|
|
result.add(chartsResVo);
|
|
|
|
|
|
- Integer numByStatus1 = getNumByStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
+ Integer numByStatus1 = getNumByStatusCGB(PmProjectStatus.EXPERT_FEEDBACK.getCode());
|
|
|
StatisticalChartsResVo chartsResVo1 = new StatisticalChartsResVo();
|
|
|
chartsResVo1.setColumnName("专家意见反馈");
|
|
|
chartsResVo1.setNum(numByStatus1);
|
|
|
result.add(chartsResVo1);
|
|
|
|
|
|
- Integer numByStatus2 = getNumByStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
|
|
|
+ Integer numByStatus2 = getNumByStatusCGB(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
|
|
|
StatisticalChartsResVo chartsResVo2 = new StatisticalChartsResVo();
|
|
|
chartsResVo2.setColumnName("采购文件编制审核");
|
|
|
chartsResVo2.setNum(numByStatus2);
|
|
|
result.add(chartsResVo2);
|
|
|
|
|
|
- Integer numByStatus3 = getNumByStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
|
|
|
+ Integer numByStatus3 = getNumByStatusCGB(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
|
|
|
StatisticalChartsResVo chartsResVo3 = new StatisticalChartsResVo();
|
|
|
chartsResVo3.setColumnName("采购公告发布");
|
|
|
chartsResVo3.setNum(numByStatus3);
|
|
|
result.add(chartsResVo3);
|
|
|
|
|
|
- Integer numByStatus4 = getNumByStatus(PmProjectStatus.PRE_BID_QUERY.getCode());
|
|
|
+ Integer numByStatus4 = getNumByStatusCGB(PmProjectStatus.PRE_BID_QUERY.getCode());
|
|
|
StatisticalChartsResVo chartsResVo4 = new StatisticalChartsResVo();
|
|
|
chartsResVo4.setColumnName("标前质疑投诉");
|
|
|
chartsResVo4.setNum(numByStatus4);
|
|
|
result.add(chartsResVo4);
|
|
|
|
|
|
- Integer numByStatus5 = getNumByStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
|
|
|
+ Integer numByStatus5 = getNumByStatusCGB(PmProjectStatus.WAIT_OPEN_BID.getCode());
|
|
|
StatisticalChartsResVo chartsResVo5 = new StatisticalChartsResVo();
|
|
|
chartsResVo5.setColumnName("待开标");
|
|
|
chartsResVo5.setNum(numByStatus5);
|
|
|
result.add(chartsResVo5);
|
|
|
|
|
|
- Integer numByStatus6 = getNumByStatus(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
|
|
|
+ Integer numByStatus6 = getNumByStatusCGB(PmProjectStatus.BID_RESULT_ANNOUNCEMENT.getCode());
|
|
|
StatisticalChartsResVo chartsResVo6 = new StatisticalChartsResVo();
|
|
|
chartsResVo6.setColumnName("评标结果公告");
|
|
|
chartsResVo6.setNum(numByStatus6);
|
|
|
result.add(chartsResVo6);
|
|
|
|
|
|
- Integer numByStatus7 = getNumByStatus(PmProjectStatus.WASTE_BID_HANDLE.getCode());
|
|
|
+ Integer numByStatus7 = getNumByStatusCGB(PmProjectStatus.WASTE_BID_HANDLE.getCode());
|
|
|
StatisticalChartsResVo chartsResVo7 = new StatisticalChartsResVo();
|
|
|
chartsResVo7.setColumnName("流废标处置");
|
|
|
chartsResVo7.setNum(numByStatus7);
|
|
|
result.add(chartsResVo7);
|
|
|
|
|
|
- Integer numByStatus8 = getNumByStatus(PmProjectStatus.POST_BID_QUERY.getCode());
|
|
|
+ Integer numByStatus8 = getNumByStatusCGB(PmProjectStatus.POST_BID_QUERY.getCode());
|
|
|
StatisticalChartsResVo chartsResVo8 = new StatisticalChartsResVo();
|
|
|
chartsResVo8.setColumnName("标后质疑");
|
|
|
chartsResVo8.setNum(numByStatus8);
|
|
@@ -3997,12 +4007,50 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
return this.baseMapper.selectList(lw);
|
|
|
}
|
|
|
|
|
|
- //查询不同状态下的项目数据
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询不同状态下的项目数据(采购办)
|
|
|
+ * 采购执行管理中,本单位超额项目交给上级处理,本单位不处理。
|
|
|
+ *
|
|
|
+ * @param projectStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<PmDemand> getListByStatusCGB(String projectStatus) {
|
|
|
+ //登录用户的部门
|
|
|
+ Long deptId = SecurityUtils.getDeptId();
|
|
|
+ LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
|
|
|
+ //需求待提交时不用查审核
|
|
|
+ List<PmAuditDeptRef> list = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
|
|
|
+ l.eq(PmAuditDeptRef::getDeptId, deptId);
|
|
|
+ l.eq(PmAuditDeptRef::getRefType, "2");
|
|
|
+ list = pmAuditDeptRefService.list(l);
|
|
|
+ if (!ObjectUtils.isEmpty(list) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
+ //查出审核此项目的单位
|
|
|
+ List<Long> longList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
|
|
|
+ // 如果有上级单位存在,将本单位剔除
|
|
|
+ SysDept sysDept = deptMapper.selectDeptById(deptId);
|
|
|
+ if (longList.contains(sysDept.getParentId())) {
|
|
|
+ longList.remove(deptId);
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getProjectStatus, projectStatus);
|
|
|
+ lw.eq(PmDemand::getPurchaseDeptId, deptId);
|
|
|
+ lw.last(" order by project_status, plan_demand_sub_time");
|
|
|
+ return this.baseMapper.selectList(lw);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询不同状态下的项目数据
|
|
|
+ * 待办事项--全部
|
|
|
+ *
|
|
|
+ * @param projectStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public List<PmDemand> getListByStatusTotal(List<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());
|
|
@@ -4017,6 +4065,39 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
return this.baseMapper.selectList(lw);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询不同状态下的项目数据(采购办)
|
|
|
+ * 采购执行管理中,本单位超额项目交给上级处理,本单位不处理。
|
|
|
+ * 待办事项--全部
|
|
|
+ *
|
|
|
+ * @param projectStatus
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<PmDemand> getListByStatusTotalCGB(List<String> projectStatus) {
|
|
|
+ //登录用户的部门
|
|
|
+ Long deptId = SecurityUtils.getDeptId();
|
|
|
+ LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
|
|
|
+ List<PmAuditDeptRef> list = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
|
|
|
+ l.eq(PmAuditDeptRef::getDeptId, deptId);
|
|
|
+ l.eq(PmAuditDeptRef::getRefType, "2");
|
|
|
+ list = pmAuditDeptRefService.list(l);
|
|
|
+ if (!ObjectUtils.isEmpty(list) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
+ //查出审核此项目的单位
|
|
|
+ List<Long> longList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
|
|
|
+ // 如果有上级单位存在,将本单位剔除
|
|
|
+ SysDept sysDept = deptMapper.selectDeptById(deptId);
|
|
|
+ if (longList.contains(sysDept.getParentId())) {
|
|
|
+ longList.remove(deptId);
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getProjectStatus, projectStatus);
|
|
|
+ lw.eq(PmDemand::getPurchaseDeptId, deptId);
|
|
|
+ lw.last(" order by project_status, plan_demand_sub_time");
|
|
|
+ return this.baseMapper.selectList(lw);
|
|
|
+ }
|
|
|
+
|
|
|
//数据转换
|
|
|
@Override
|
|
|
public List<PmDemandResVo> listToVoList(List<PmDemand> demandList) {
|
|
@@ -4049,6 +4130,38 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
return Math.toIntExact(count);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询不同状态下的项目数据的数量(采购办首页)
|
|
|
+ * 采购执行管理中,本单位超额项目交给上级处理,本单位不处理。
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Integer getNumByStatusCGB(String projectStatus) {
|
|
|
+ //登录用户的部门
|
|
|
+ Long deptId = SecurityUtils.getDeptId();
|
|
|
+ LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<PmDemand>();
|
|
|
+ ///需求待提交时不用查审核
|
|
|
+ List<PmAuditDeptRef> list = new ArrayList<>();
|
|
|
+ LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
|
|
|
+ l.eq(PmAuditDeptRef::getDeptId, deptId);
|
|
|
+ l.eq(PmAuditDeptRef::getRefType, "2");
|
|
|
+ list = pmAuditDeptRefService.list(l);
|
|
|
+ if (!ObjectUtils.isEmpty(list) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
|
|
|
+ //查出审核此项目的单位
|
|
|
+ List<Long> longList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
|
|
|
+ // 如果有上级单位存在,将本单位剔除
|
|
|
+ SysDept sysDept = deptMapper.selectDeptById(deptId);
|
|
|
+ if (longList.contains(sysDept.getParentId())) {
|
|
|
+ longList.remove(deptId);
|
|
|
+ }
|
|
|
+ lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ lw.eq(PmDemand::getProjectStatus, projectStatus);
|
|
|
+ lw.eq(PmDemand::getPurchaseDeptId, deptId);
|
|
|
+ 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<>();
|