diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java index 664757fe..845188c8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/mapper/LeaseTaskMapper.java @@ -205,4 +205,6 @@ public interface LeaseTaskMapper { * @return */ BmProject selectById(LeaseApplyInfo leaseApplyInfo); + + String getAncestors(Long userId); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java index a63b8f27..2ae5c3b8 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseTaskServiceImpl.java @@ -563,7 +563,29 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService { Long userId = SecurityUtils.getLoginUser().getUserid(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); leaseApplyInfo.setUserId(userId == 1 ? null : userId); - leaseApplyInfo.setDeptId((userId == 1 || deptId == 101) ? null : deptId); + if(userId == 1 || deptId == 101){ + leaseApplyInfo.setDeptId(null); + }else{ + //判断祖籍有没有101 + String ancestors = mapper.getAncestors(deptId); + boolean contains101 = false; + if (ancestors != null && !ancestors.isEmpty()) { + String[] parts = ancestors.split(","); + for (String part : parts) { + if ("101".equals(part.trim())) { + contains101 = true; + break; + } + } + } + if(contains101){ + leaseApplyInfo.setDeptId(null); + }else{ + leaseApplyInfo.setDeptId(deptId); + } + } + +// leaseApplyInfo.setDeptId((userId == 1 || deptId == 101) ? null : deptId); log.info("用户id为{}",userId); List list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo); try { diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml index 7430aa4e..7cc8d644 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/lease/LeaseTaskMapper.xml @@ -1057,4 +1057,7 @@ from bm_project where pro_id = #{projectId} +