业务线分权;

调薪记录多语言;
This commit is contained in:
钱涛 2025-02-13 14:23:58 +08:00
parent c0dbce4786
commit a688ca8b52
6 changed files with 27 additions and 102 deletions

View File

@ -1,6 +1,7 @@
package com.engine.salary.entity.salaryarchive.dto;
import com.engine.salary.annotation.Encrypt;
import com.engine.salary.annotation.I18n;
import com.engine.salary.annotation.TableTitle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
@ -42,6 +43,7 @@ public class SalaryItemAdjustRecordListDTO {
private String username;
@TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName")
@I18n
private String departmentName;
@TableTitle(title = "员工状态", dataIndex = "employeeStatus", key = "employeeStatus")
@ -66,6 +68,7 @@ public class SalaryItemAdjustRecordListDTO {
private Date effectiveTime;
@TableTitle(title = "操作人", dataIndex = "operator", key = "operator")
@I18n
private String operator;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

View File

@ -398,19 +398,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
Long employeeId = (long) user.getUID();
Map<String, Object> datas = new HashMap<>();
// 分权逻辑
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgents)) {
//防止普通用户查询
queryParam.setTaxAgents(Collections.singletonList(-1L));
} else {
queryParam.setTaxAgents(taxAgents);
}
}
//退差列表
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
@ -458,19 +445,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
Long employeeId = (long) user.getUID();
Map<String, Object> datas = new HashMap<>();
// 分权逻辑
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgents)) {
//防止普通用户查询
queryParam.setTaxAgents(Collections.singletonList(-1L));
} else {
queryParam.setTaxAgents(taxAgents);
}
}
//补差列表
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());
@ -4223,18 +4197,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
Long employeeId = (long) user.getUID();
Map<String, Object> datas = new HashMap<>();
queryParam.setPageSize(10000000);
// 分权逻辑
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgents)) {
//防止普通用户查询
queryParam.setTaxAgents(Collections.singletonList(-1L));
} else {
queryParam.setTaxAgents(taxAgents);
}
}
//退差列表
queryParam.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue());
@ -4261,18 +4223,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
Long employeeId = (long) user.getUID();
Map<String, Object> datas = new HashMap<>();
queryParam.setPageSize(10000000);
// 分权逻辑
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgents)) {
//防止普通用户查询
queryParam.setTaxAgents(Collections.singletonList(-1L));
} else {
queryParam.setTaxAgents(taxAgents);
}
}
//补差列表
queryParam.setPaymentStatus(PaymentStatusEnum.BALANCE.getValue());

View File

@ -5,8 +5,8 @@ import com.alibaba.fastjson.TypeReference;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.hrmelog.entity.dto.LoggerContext;
import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam;
@ -39,11 +39,10 @@ import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import org.springframework.beans.BeanUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import weaver.general.BaseBean;
import weaver.hrm.User;
@ -176,20 +175,6 @@ public class SIExportServiceImpl extends Service implements SIExportService {
//非系统人员核算明细
List<AccountExportPO> extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param);
accountExportPOS.addAll(extAccountExportPOS);
// 分权逻辑
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID());
List<Long> taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(taxAgents)) {
//防止普通用户查询
accountExportPOS = new ArrayList<>();
param = new InsuranceExportParam();
} else {
accountExportPOS.stream().filter(f -> taxAgents.contains(f.getPaymentOrganization())).collect(Collectors.toList());
param.setTaxAgents(taxAgents);
}
}
} else {
accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param);
//非系统人员核算明细

View File

@ -28,7 +28,6 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemePO;
import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO;
import com.engine.salary.entity.sischeme.vo.SISchemeTableVO;
import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO;
import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO;
import com.engine.salary.entity.taxagent.param.TaxAgentManageRangeSaveParam;
import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam;
@ -54,6 +53,8 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.sys.SalarySysConfMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.*;
import com.engine.salary.service.auth.AuthService;
import com.engine.salary.service.auth.AuthServiceImpl;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.entity.vo.OrderRuleVO;
import com.engine.salary.sys.enums.OpenEnum;
@ -179,6 +180,10 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
return MapperProxyFactory.getProxy(EmployMapper.class);
}
public AuthService getAuthService(User user) {
return ServiceUtil.getService(AuthServiceImpl.class, user);
}
@Override
public Map<String, Object> getForm(Map<String, Object> params) {
Map<String, Object> apidatas = new HashMap<>(16);
@ -356,16 +361,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
param.setOrderRule(orderRule);
Boolean needAuth = getTaxAgentService().isNeedAuth(currentEmployeeId);
if (needAuth) {
List<TaxAgentEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService().listTaxAgentAndEmployee(currentEmployeeId);
// Set<Long> employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId);
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getTaxAgentId);
List<InsuranceArchivesEmployeePO> list = getSocialSchemeMapper().queryEmployeeList(param);
return list.stream().filter(f -> taxAgentIds.contains(f.getPaymentOrganization())).collect(Collectors.toList());
}
return getSocialSchemeMapper().queryEmployeeList(param);
List<InsuranceArchivesEmployeePO> list = getSocialSchemeMapper().queryEmployeeList(param);
list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, InsuranceArchivesEmployeePO.class);
return list;
}
@Override

View File

@ -12,6 +12,7 @@ import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
import com.engine.salary.entity.salaryarchive.param.*;
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
@ -20,6 +21,7 @@ import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
@ -678,22 +680,11 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
// 获取所有可被引用的薪资项目
List<SalaryItemPO> salaryItemList = getCanAdjustSalaryItems();
List<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
// 获取记录
long currentEmployeeId = user.getUID();
//是否开启分权
Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
if (needAuth) {
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId);
List<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
if (CollectionUtils.isEmpty(taxAgentIds)) {
// return new PageInfo<SalaryItemAdjustRecordListDTO>();
}
List<SalaryArchivePO> salaryArchives = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentIds(taxAgentIds).build());
List<Long> salaryArchiveIds = SalaryEntityUtil.properties(salaryArchives, SalaryArchivePO::getId, Collectors.toList());
queryParam.setSalaryArchiveIds(salaryArchiveIds);
}
//分权
SalaryArchiveQueryParam archiveQueryParam = new SalaryArchiveQueryParam();
archiveQueryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
List<Long> salaryArchiveIds = getSalaryArchiveService(user).list(archiveQueryParam).stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList());
queryParam.setSalaryArchiveIds(salaryArchiveIds);
List<DataCollectionEmployee> employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
Map<Long, DataCollectionEmployee> employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId);
@ -718,6 +709,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
;
})
.collect(Collectors.toList());
SalaryI18nUtil.i18nList(listResult);
List<SalaryItemAdjustRecordListDTO> listAll = salaryArchiveItemMapper.salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds);

View File

@ -180,15 +180,12 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
Set<Long> backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId);
salaryItemIds.addAll(backCalcItemIds);
Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID());
final Set<Long> ids = new HashSet<Long>();
if (needAuth) {
Set<Long> collect = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
.stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
ids.addAll(collect);
}
//账套项目分权
TaxAgentQueryParam param = TaxAgentQueryParam.builder().build();
param.setFilterType(AuthFilterTypeEnum.QUERY_DATA);
Set<Long> ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet());
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream()
.filter(po -> Boolean.FALSE.equals(needAuth) || getSalaryItemService(user).filterInRange(ids, po))
.filter(po -> getSalaryItemService(user).filterInRange(ids, po))
.collect(Collectors.toList());
//获取系统值