Forráskód Böngészése

专家抽取历史--指定部门以及子单位的超额项目

buzhanyi 2 éve
szülő
commit
ba23966f4c

+ 4 - 5
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -13,6 +13,7 @@ import com.ozs.base.domain.vo.BaseExpertVo;
 import com.ozs.base.mapper.BaseExpertMapper;
 import com.ozs.base.service.BaseExpertService;
 import com.ozs.common.core.domain.AjaxResult;
+import com.ozs.common.core.domain.entity.SysUser;
 import com.ozs.common.core.domain.model.LoginUser;
 import com.ozs.common.enums.*;
 import com.ozs.common.utils.PageUtils;
@@ -106,11 +107,9 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
         //PmDemandExpertRef项目专家关联表
         List<PmDemandExpertRef> list1 = expertRefMapper.selectList(new LambdaQueryWrapper<>());
         List<Long> collect = list1.stream().map(PmDemandExpertRef::getDemandId).collect(Collectors.toList());
-        if (loginUser.getUsername().equals("admin")) {
-            dp.in(PmDemand::getDemandId, collect);
-        } else {
-            dp.in(PmDemand::getDemandId, collect);
-            dp.eq(PmDemand::getPurchaseDeptId, loginUser.getDeptId());
+        if (!SysUser.isAdmin(loginUser.getUserId())) {
+            //指定部门--以及子单位的超额数据
+            dp.in(PmDemand::getDemandId, pmDemandService.isQueryZD(Math.toIntExact(loginUser.getDeptId())));
         }
         // 查询抽取过专家的项目列表
         List<PmDemand> pmDemandList = pmDemandService.list(dp);

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

@@ -408,4 +408,11 @@ public interface IPmDemandService extends IService<PmDemand> {
      */
     public Integer getNumByStatus(String projectStatus);
 
+    /**
+     * 指定部门--以及子单位的超额项目
+     *
+     * @param queryZd
+     * @return
+     */
+    public List<Long> isQueryZD(Integer queryZd);
 }

+ 2 - 1
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -4204,7 +4204,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         return decimalFormat.format(d1 / d2);
     }
 
-    //查询本单位还是本单位及子孙级----要查询子单位的超额数据
+    //查询本单位及本级一下全部
     public List<Long> isQueryAll(Integer queryAll) {
         List<Long> deptList = new ArrayList<>();
         Long deptId = SecurityUtils.getDeptId();
@@ -4222,6 +4222,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
     //查询本单位还是本单位及子孙级----要查询子单位的超额数据
+    @Override
     public List<Long> isQueryZD(Integer queryZd) {
         //指定部门--以及子单位的超额数据
         List<Long> demandId = new ArrayList<>();