فهرست منبع

Merge branch 'master' into prod

buzhanyi 2 سال پیش
والد
کامیت
fbe612ad71

+ 15 - 0
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -424,6 +424,21 @@ public class PmPurchaseExecutionController extends BaseController {
         return success(set);
     }
 
+    @ApiOperation(value = "获取回避单位下拉列表(抽取专家时,显示与项目类型和专家类型相符的部门)", notes = "查询条件:采购品种")
+    @PostMapping("/getExpertUnitListBC")
+    @Log(title = ModularConstans.professional, businessType = BusinessType.QUERY)
+    public AjaxResult getExpertUnitListBC(@RequestBody BaseUnitInformation unitInformation) {
+        List<BaseUnitInformation> baseUnitInformationList = baseExpertService.getBaseUnitInformationListBC(unitInformation);
+        if (ObjectUtils.isEmpty(baseUnitInformationList)) {
+            return error("专家单位列表是空的");
+        }
+        Set<String> set = new HashSet<>();
+        for (BaseUnitInformation baseUnitInformation : baseUnitInformationList) {
+            set.add(baseUnitInformation.getUnitName());
+        }
+        return success(set);
+    }
+
     /**
      * 抽取专家
      */

+ 6 - 0
purchase-system/src/main/java/com/ozs/base/domain/BaseUnitInformation.java

@@ -29,6 +29,12 @@ public class BaseUnitInformation {
     @TableField("unit_name")
     private String unitName;
 
+    /**
+     * 采购品种
+     */
+    @ApiModelProperty(value = "采购品种")
+    private String varietyPurchase;
+
     /**
      * 创建人
      */

+ 8 - 0
purchase-system/src/main/java/com/ozs/base/mapper/BaseExpertMapper.java

@@ -22,4 +22,12 @@ public interface BaseExpertMapper extends BaseMapper<BaseExpert> {
     Map<String, String> getExpertNameList(@Param("expertList") List<Long> expertList);
 
     List<PmDemandExpertRef> getExpertIdList(@Param("demandId") Long demandId);
+
+    /**
+     * 根据采购品种查询
+     *
+     * @param unitInformation
+     * @return
+     */
+    List<BaseUnitInformation> selectByUnitInformationBC(BaseUnitInformation unitInformation);
 }

+ 3 - 1
purchase-system/src/main/java/com/ozs/base/service/BaseExpertService.java

@@ -9,7 +9,7 @@ import com.ozs.common.core.domain.AjaxResult;
 
 import java.util.List;
 
-public interface BaseExpertService  extends IService<BaseExpert> {
+public interface BaseExpertService extends IService<BaseExpert> {
     int insertExpert(BaseExpertVo baseExpertVo);
 
     int updateSupplierType(BaseExpert baseExpert);
@@ -19,4 +19,6 @@ public interface BaseExpertService  extends IService<BaseExpert> {
     AjaxResult selectExtractionExpert(BaseExpertVo baseExpertVo);
 
     List<BaseUnitInformation> getBaseUnitInformationList();
+
+    List<BaseUnitInformation> getBaseUnitInformationListBC(BaseUnitInformation unitInformation);
 }

+ 13 - 0
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -63,6 +63,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
             if (baseUnitInformationList.size() <= 0) {
                 BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
                 baseUnitInformation.setUnitName(baseExpertVo.getUnitInformation());
+                baseUnitInformation.setVarietyPurchase(baseExpertVo.getVarietyPurchase());
                 baseUnitInformation.setCreated(baseExpertVo.getExpertName());
                 baseUnitInformation.setCreateTime(new Date());
                 Integer i = baseExpertMapper.insertBaseUnitInformation(baseUnitInformation);
@@ -186,6 +187,18 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
         return baseUnitInformationList;
     }
 
+    /**
+     * 根据采购品种查询
+     *
+     * @param unitInformation
+     * @return
+     */
+    @Override
+    public List<BaseUnitInformation> getBaseUnitInformationListBC(BaseUnitInformation unitInformation) {
+        List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformationBC(unitInformation);
+        return baseUnitInformationList;
+    }
+
     private List<PmDemandResVo> changTo(List<PmDemand> pmDemandList) {
         List<PmDemandResVo> pmDemandResponseVoList = new ArrayList<>();
         //获取字典数据

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

@@ -408,6 +408,14 @@ public interface IPmDemandService extends IService<PmDemand> {
      */
     public Integer getNumByStatus(String projectStatus);
 
+    /**
+     * 查询不同状态下的项目数据的数量(采购办首页)
+     *
+     * @param projectStatus
+     * @return
+     */
+    public Integer getNumByStatusCGB(String projectStatus);
+
     /**
      * 指定部门--以及子单位的超额项目
      *

+ 240 - 27
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -124,6 +124,7 @@ import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -582,19 +583,59 @@ 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::getDeptId).collect(Collectors.toList());
+                    // 如果有上级单位存在,将本单位剔除
+                    SysDept sysDept = deptMapper.selectDeptById(sysUser.getDeptId());
+                    //本单位所有参与审核的项目id
+                    List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+                    //替身,取交集用
+                    List<Long> refListL = refList;
+
+                    //上级参与审核的项目
+                    List<Long> refListf = new ArrayList<>();
+                    LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>();
+                    List<PmAuditDeptRef> listf = new ArrayList<>();
+                    if (sysDept.getParentId() != 0) {
+                        LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>();
+                        lf.eq(PmAuditDeptRef::getDeptId, sysDept.getParentId());
+                        lf.eq(PmAuditDeptRef::getRefType, "2");
+                        listf = pmAuditDeptRefService.list(lf);
+                        //上级参与审核的项目id
+                        refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+                    }
+                    //取集合交集,交集中的是上级处理,本单位不处理
+                    if (!ObjectUtils.isEmpty(refListf)) {
+                        refListL.retainAll(refListf);
+                        Iterator<Long> it = refList.iterator();
+                        while (it.hasNext()) {
+                            //只留下本单位要处理的项目
+                            if (refListL.contains(it.next())) {
+                                it.remove();
+                            }
+                        }
+                    }
+                    //为空就返回空
+                    if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+                        lw.in(PmDemand::getDemandId, -1);
+                    } else if (!ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+                        lw.in(PmDemand::getDemandId, refList);
+                    }
+                }
             } else {
                 lw.eq(PmDemand::getPurchaseDeptId, SecurityUtils.getDeptId());
             }
@@ -1143,6 +1184,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     if (baseUnitInformationList.size() <= 0) {
                         BaseUnitInformation baseUnitInformation = new BaseUnitInformation();
                         baseUnitInformation.setUnitName(baseExpert.getUnitInformation());
+                        baseUnitInformation.setVarietyPurchase(baseExpert.getVarietyPurchase());
                         baseUnitInformation.setCreated(baseExpert.getExpertName());
                         baseUnitInformation.setCreateTime(new Date());
                         Integer i = baseExpertMapper.insertBaseUnitInformation(baseUnitInformation);
@@ -1850,55 +1892,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);
     }
 
@@ -1917,7 +1959,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();
@@ -1944,55 +1986,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);
@@ -3996,12 +4038,69 @@ 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();
+        SysDept sysDept = deptMapper.selectDeptById(deptId);
+
+        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);
+        //本单位所有参与审核的项目id
+        List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        //替身,取交集用
+        List<Long> refListL = refList;
+
+        //上级参与审核的项目
+        List<Long> refListf = new ArrayList<>();
+        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>();
+        List<PmAuditDeptRef> listf = new ArrayList<>();
+        if (sysDept.getParentId() != 0) {
+            LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>();
+            lf.eq(PmAuditDeptRef::getDeptId, sysDept.getParentId());
+            lf.eq(PmAuditDeptRef::getRefType, "2");
+            listf = pmAuditDeptRefService.list(lf);
+            //上级参与审核的项目id
+            refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        }
+        //取集合交集,交集中的是上级处理,本单位不处理
+        if (!ObjectUtils.isEmpty(refListf)) {
+            refListL.retainAll(refListf);
+            Iterator<Long> it = refList.iterator();
+            while (it.hasNext()) {
+                //只留下本单位要处理的项目
+                if (refListL.contains(it.next())) {
+                    it.remove();
+                }
+            }
+        }
+
+        lw.in(PmDemand::getProjectStatus, projectStatus);
+        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());
@@ -4016,6 +4115,64 @@ 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();
+        SysDept sysDept = deptMapper.selectDeptById(deptId);
+
+        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);
+        //本单位所有参与审核的项目id
+        List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        //替身,取交集用
+        List<Long> refListL = refList;
+
+        //上级参与审核的项目
+        List<Long> refListf = new ArrayList<>();
+        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>();
+        List<PmAuditDeptRef> listf = new ArrayList<>();
+        if (sysDept.getParentId() != 0) {
+            LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>();
+            lf.eq(PmAuditDeptRef::getDeptId, sysDept.getParentId());
+            lf.eq(PmAuditDeptRef::getRefType, "2");
+            listf = pmAuditDeptRefService.list(lf);
+            //上级参与审核的项目id
+            refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        }
+        //取集合交集,交集中的是上级处理,本单位不处理
+        if (!ObjectUtils.isEmpty(refListf)) {
+            refListL.retainAll(refListf);
+            Iterator<Long> it = refList.iterator();
+            while (it.hasNext()) {
+                //只留下本单位要处理的项目
+                if (refListL.contains(it.next())) {
+                    it.remove();
+                }
+            }
+        }
+        //为空就返回空
+        if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+            lw.in(PmDemand::getDemandId, -1);
+        } else if (!ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+            lw.in(PmDemand::getDemandId, refList);
+        }
+        lw.in(PmDemand::getProjectStatus, projectStatus);
+        lw.last(" order by project_status, plan_demand_sub_time");
+        return this.baseMapper.selectList(lw);
+    }
+
     //数据转换
     @Override
     public List<PmDemandResVo> listToVoList(List<PmDemand> demandList) {
@@ -4048,6 +4205,62 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return Math.toIntExact(count);
     }
 
+    /**
+     * 查询不同状态下的项目数据的数量(采购办首页)
+     * 采购执行管理中,本单位超额项目交给上级处理,本单位不处理。
+     */
+    @Override
+    public Integer getNumByStatusCGB(String projectStatus) {
+        //登录用户的部门
+        Long deptId = SecurityUtils.getDeptId();
+        SysDept sysDept = deptMapper.selectDeptById(deptId);
+
+        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);
+        //本单位所有参与审核的项目id
+        List<Long> refList = list.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        //替身,取交集用
+        List<Long> refListL = refList;
+
+        //上级参与审核的项目
+        List<Long> refListf = new ArrayList<>();
+        LambdaQueryWrapper<PmDemand> lwf = new LambdaQueryWrapper<PmDemand>();
+        List<PmAuditDeptRef> listf = new ArrayList<>();
+        if (sysDept.getParentId() != 0) {
+            LambdaQueryWrapper<PmAuditDeptRef> lf = new LambdaQueryWrapper<>();
+            lf.eq(PmAuditDeptRef::getDeptId, sysDept.getParentId());
+            lf.eq(PmAuditDeptRef::getRefType, "2");
+            listf = pmAuditDeptRefService.list(lf);
+            //上级参与审核的项目id
+            refListf = listf.stream().map(PmAuditDeptRef::getRefId).collect(Collectors.toList());
+        }
+        //取集合交集,交集中的是上级处理,本单位不处理
+        if (!ObjectUtils.isEmpty(refListf)) {
+            refListL.retainAll(refListf);
+            Iterator<Long> it = refList.iterator();
+            while (it.hasNext()) {
+                //只留下本单位要处理的项目
+                if (refListL.contains(it.next())) {
+                    it.remove();
+                }
+            }
+        }
+        //为空就返回空
+        if (ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+            lw.in(PmDemand::getDemandId, -1);
+        } else if (!ObjectUtils.isEmpty(refList) && !SysUser.isAdmin(SecurityUtils.getUserId())) {
+            lw.in(PmDemand::getDemandId, refList);
+        }
+        lw.eq(PmDemand::getProjectStatus, projectStatus);
+        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<>();

+ 16 - 0
purchase-system/src/main/resources/mapper/base/BaseExpertMapper.xml

@@ -138,6 +138,9 @@
             <if test="unitName != null and unitName != '' ">
                 unit_name,
             </if>
+            <if test="varietyPurchase != null and varietyPurchase != '' ">
+                variety_purchase,
+            </if>
             <if test="created != null and created != '' ">
                 created,
             </if>
@@ -149,6 +152,9 @@
             <if test="unitName != null and unitName != ''">
                 #{unitName},
             </if>
+            <if test="varietyPurchase != null and varietyPurchase != '' ">
+                #{varietyPurchase},
+            </if>
             <if test="created != null and created != ''">
                 #{created},
             </if>
@@ -170,4 +176,14 @@
         </foreach>
 
     </select>
+
+    <select id="selectByUnitInformationBC" resultType="com.ozs.base.domain.BaseUnitInformation"
+            parameterType="com.ozs.base.domain.BaseUnitInformation">
+        select * from base_unit_information
+        <where>
+            <if test="varietyPurchase != null and varietyPurchase != ''">
+                variety_purchase = #{varietyPurchase}
+            </if>
+        </where>
+    </select>
 </mapper>