退料问题修复

This commit is contained in:
hongchao 2025-08-13 18:51:10 +08:00
parent 9a377f2b65
commit 1fef75868b
3 changed files with 28 additions and 1 deletions

View File

@ -205,4 +205,6 @@ public interface LeaseTaskMapper {
* @return * @return
*/ */
BmProject selectById(LeaseApplyInfo leaseApplyInfo); BmProject selectById(LeaseApplyInfo leaseApplyInfo);
String getAncestors(Long userId);
} }

View File

@ -563,7 +563,29 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
leaseApplyInfo.setUserId(userId == 1 ? null : userId); 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); log.info("用户id为{}",userId);
List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo);
try { try {

View File

@ -1057,4 +1057,7 @@
from bm_project from bm_project
where pro_id = #{projectId} where pro_id = #{projectId}
</select> </select>
<select id="getAncestors" resultType="java.lang.String">
select ancestors from sys_dept where dept_id = #{deptId}
</select>
</mapper> </mapper>