|
@@ -383,13 +383,20 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
@Override
|
|
|
public IPage<PmDemandResVo> selectPmDemandList(PmDemandReqVo pmDemandReqVo, int reqType) {
|
|
|
LambdaQueryWrapper<PmDemand> lw = new LambdaQueryWrapper<>();
|
|
|
-
|
|
|
- LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
|
|
|
- l.eq(PmAuditDeptRef::getDeptId, pmDemandReqVo.getDeptId());
|
|
|
- l.eq(PmAuditDeptRef::getRefType, "2");
|
|
|
- List<PmAuditDeptRef> list = pmAuditDeptRefService.list(l);
|
|
|
- if (!ObjectUtils.isEmpty(list) && !pmDemandReqVo.getUserId().equals(Integer.parseInt("1"))) {
|
|
|
- lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ // 4 (合同信息管理)、 0(需求单位管理) 、 5(项目建设管理) 需求单位
|
|
|
+ // 1(需求需求审核) 、2 (任务下达管理) 采购管理部门
|
|
|
+ // 3(采购执行管理) 采购办
|
|
|
+
|
|
|
+ if (Arrays.asList(1, 2, 3).contains(reqType)) {
|
|
|
+ LambdaQueryWrapper<PmAuditDeptRef> l = new LambdaQueryWrapper<>();
|
|
|
+ l.eq(PmAuditDeptRef::getDeptId, pmDemandReqVo.getDeptId());
|
|
|
+ l.eq(PmAuditDeptRef::getRefType, "2");
|
|
|
+ List<PmAuditDeptRef> list = pmAuditDeptRefService.list(l);
|
|
|
+ if (!ObjectUtils.isEmpty(list) && !pmDemandReqVo.getUserId().equals(Integer.parseInt("1"))) {
|
|
|
+ lw.in(PmDemand::getDemandId, list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -748,7 +755,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean reviewTo(PmDemandReqVo pmDemandReqVo) {
|
|
|
- PmDemand pmDemand = this.getById(pmDemandReqVo.getDemandId());
|
|
|
+ PmDemand pmDemand = this.getById(pmDemandReqVo.getDemandId());
|
|
|
|
|
|
PmDemand pmDemandUpdate = new PmDemand();
|
|
|
pmDemandUpdate.setDemandId(pmDemand.getDemandId());
|