专项附加扣除业务线bug修复

This commit is contained in:
Harryxzy 2025-09-09 18:44:18 +08:00
parent d738497ab2
commit 83297993cd
1 changed files with 8 additions and 3 deletions

View File

@ -471,15 +471,20 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd
SpecialAddDeductionBiz SpecialAddDeductionBiz = new SpecialAddDeductionBiz();
Long currentEmployeeId = (long) user.getUID();
// 获取所有个税扣缴义务人
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList =
getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
// Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList =
// getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA);
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAuth(param);
SpecialAddDeductionPO byId = SpecialAddDeductionBiz.getById(specialAddDeductionParam.getId());
if (byId == null) {
throw new SalaryRunTimeException("该数据不存在!");
}
//管理员可以编辑该扣缴义务人数据其他人可以编辑本人数据
boolean canEdit = byId.getEmployeeId().equals((long) user.getUID())
|| taxAgentList.stream().anyMatch(t -> Objects.equals(t.getTaxAgentId(), byId.getTaxAgentId()));
|| taxAgentList.stream().anyMatch(t -> Objects.equals(t.getId(), byId.getTaxAgentId()));
if (!canEdit) {
//没有编辑权限
throw new SalaryRunTimeException("该个税扣缴义务人无权限编辑此数据!");