解决冲突

This commit is contained in:
Harryxzy 2025-06-12 13:32:53 +08:00
parent 4b9e75e306
commit 4cbf022a34
1 changed files with 38 additions and 39 deletions

View File

@ -32,7 +32,6 @@ import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.page.SalaryPageUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import weaver.hrm.User; import weaver.hrm.User;
import weaver.wechat.util.Utils; import weaver.wechat.util.Utils;
@ -211,44 +210,44 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees);
} }
/** // /**
* 根据权限范围过滤 // * 根据权限范围过滤
* // *
* @param taxDeclarationPO // * @param taxDeclarationPO
* @param taxDeclarationEmployeeDTOS // * @param taxDeclarationEmployeeDTOS
* @return // * @return
*/ // */
private List<TaxDeclarationEmployeeDTO> filterByAuthority(TaxDeclarationPO taxDeclarationPO, List<TaxDeclarationEmployeeDTO> taxDeclarationEmployeeDTOS) { // private List<TaxDeclarationEmployeeDTO> filterByAuthority(TaxDeclarationPO taxDeclarationPO, List<TaxDeclarationEmployeeDTO> taxDeclarationEmployeeDTOS) {
long employeeId = user.getUID(); // long employeeId = user.getUID();
if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) { // if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) {
return Collections.emptyList(); // return Collections.emptyList();
} // }
// 判断是否开启了分权 // // 判断是否开启了分权
Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); // Boolean openDevolution = getTaxAgentService(user).isOpenDevolution();
// 是否是总管理员 // // 是否是总管理员
Boolean isChief = getTaxAgentService(user).isChief(employeeId); // Boolean isChief = getTaxAgentService(user).isChief(employeeId);
if (BooleanUtils.isFalse(openDevolution) || isChief) { // if (BooleanUtils.isFalse(openDevolution) || isChief) {
return taxDeclarationEmployeeDTOS; // return taxDeclarationEmployeeDTOS;
} // }
// 查询权限范围内的人员 // // 查询权限范围内的人员
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); // List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId);
Set<String> simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId()); // Set<String> simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId());
// 查询权限范围内的外部人员 // // 查询权限范围内的外部人员
// List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey); // // List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey);
// Set<String> extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId()); // // Set<String> extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId());
// 根据权限范围过滤 // // 根据权限范围过滤
return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> { // return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> {
if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()) // if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())
&& simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { // && simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) {
return true; // return true;
} // }
// if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) // // if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
// && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { // // && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) {
// return true; // // return true;
// } // // }
return false; // return false;
}).collect(Collectors.toList()); // }).collect(Collectors.toList());
} // }
@Override @Override