From c0dbce4786308bcf6bd8a524be72774c5e5b62f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Feb 2025 11:27:13 +0800 Subject: [PATCH 01/35] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E5=88=86?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/AddUpDeductionRecordDTO.java | 4 ++ .../dto/AddUpSituationRecordDTO.java | 6 +- .../salary/service/AddUpDeductionService.java | 3 +- .../impl/AddUpDeductionServiceImpl.java | 16 +---- .../impl/AddUpSituationServiceImpl.java | 10 +-- .../service/impl/SalaryItemServiceImpl.java | 22 +++--- .../impl/SalarySobItemServiceImpl.java | 18 ++--- .../impl/TaxDeclarationDetailServiceImpl.java | 68 +------------------ .../impl/TaxDeclarationServiceImpl.java | 21 +++--- .../salary/wrapper/AddUpDeductionWrapper.java | 4 +- .../salary/wrapper/TaxAgentWrapper.java | 2 - 11 files changed, 39 insertions(+), 135 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java index 4de554f12..2c34eaef4 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; +import java.util.Set; @Data @@ -18,6 +19,7 @@ import java.util.Date; @AllArgsConstructor //数据采集-累计专项附加扣除记录 @SalaryTable(pageId = "a4f85287-3354-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX) +@Auth(page = "addUpDeduction") public class AddUpDeductionRecordDTO { //主键id @@ -124,4 +126,6 @@ public class AddUpDeductionRecordDTO { @Encrypt private String addUpInfantCare; + private Set opts; + } diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java index e8c2fd0aa..5a9686b89 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java @@ -1,10 +1,7 @@ package com.engine.salary.entity.datacollection.dto; import com.cloudstore.eccom.pc.table.WeaTableType; -import com.engine.salary.annotation.Encrypt; -import com.engine.salary.annotation.SalaryTable; -import com.engine.salary.annotation.SalaryTableColumn; -import com.engine.salary.annotation.TableTitle; +import com.engine.salary.annotation.*; import com.engine.salary.util.excel.ExcelProperty; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; @@ -28,6 +25,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor @SalaryTable(pageId = "a5f85287-3354-4275-adn9-7d06e54y6rj8",tableType = WeaTableType.CHECKBOX) +@Auth(page = "addUpSituation") public class AddUpSituationRecordDTO { @SalaryTableColumn(column = "id", display = false) diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 244658450..514564b4b 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -44,11 +44,10 @@ public interface AddUpDeductionService { /** * 下载模板 - * @param isChief * @param queryParam * @return */ - XSSFWorkbook downloadTemplate(boolean isChief,AddUpDeductionQueryParam queryParam); + XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam); /** diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 969c1064b..2f79bb800 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -26,8 +26,6 @@ import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; -import com.engine.salary.entity.taxagent.bo.TaxAgentBO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -947,18 +945,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public PageInfo recordListPage(AddUpDeductionQueryParam queryParam) { - long employeeId = (long) user.getUID(); - - Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId); - if (needAuth) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) { - return new PageInfo<>(AddUpDeductionRecordDTO.class); - } - queryParam.setTaxAgentIds(taxAgentIdsAsAdmin); - } - List list = getAddUpDeductionMapper().recordList(queryParam); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.DATA_OPT, AddUpDeductionRecordDTO.class); PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpDeductionRecordDTO.class); encryptUtil.decryptList(page.getList(), AddUpDeductionRecordDTO.class); return page; @@ -1060,7 +1048,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } @Override - public XSSFWorkbook downloadTemplate(boolean isChief, AddUpDeductionQueryParam queryParam) { + public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) { String sheetName = SalaryI18nUtil.getI18nLabel(101603, "累计专项附加扣除导入模板"); String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86317, "工号"), SalaryI18nUtil.getI18nLabel(86318, "证件号码"), SalaryI18nUtil.getI18nLabel(86319, "入职日期"), SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"), SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"), SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"), SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"), SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"), SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"), SalaryI18nUtil.getI18nLabel(105142, "累计婴幼儿照护")}; diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index ebc4a01ab..04caffe35 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -349,7 +349,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation * @return */ private List> getExcelRowDetailList(AddUpSituationQueryParam param) { - long employeeId = user.getUID(); //excel标题 List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利", @@ -358,15 +357,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 List list = biz.recordList(param); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, AddUpSituationRecordDTO.class); - // 开启了分权 - if (getTaxAgentService(user).isOpenDevolution() || !getTaxAgentService(user).isChief(employeeId)) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - list = list.stream().filter(f -> - // 作为管理员 - taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - ).collect(Collectors.toList()); - } final List> dataRowList = Optional.ofNullable(list) .map(List::stream) .map(operatorStream -> operatorStream.map(dto -> { diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 298bb2ebe..bbcbb459e 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -1,6 +1,5 @@ package com.engine.salary.service.impl; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; @@ -20,6 +19,7 @@ import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig; import com.engine.salary.entity.salaryitem.param.*; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.param.SalarySobQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; @@ -34,6 +34,8 @@ import com.engine.salary.enums.sicategory.SharedTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryitem.SalaryItemMapper; 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.vo.UploadConfigResponse; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -112,6 +114,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService return SqlProxyHandle.getProxy(SalaryItemMapper.class); } + public AuthService getAuthService(User user) { + return ServiceUtil.getService(AuthServiceImpl.class, user); + } + @Override public SalaryItemPO getById(Long id) { return salaryItemBiz.getById(id); @@ -448,16 +454,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService @Override public List> getSalarySobBySalaryItem(Long salaryItemId) { - // 查询所有启用的薪资账套 - List salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId)); - Set salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId); - List salarySobs = getSalarySobService(user).listByIds(salarySobIds); - // 获取能够管理的义务人 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); - if (!isChief) { - Set taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()), TaxAgentPO::getId); - salarySobs = salarySobs.stream().filter(sob -> CollectionUtil.intersection(taxAgentIds, sob.getTaxAgentIds()).size() > 0).collect(Collectors.toList()); - } + // 查询所有管理的薪资账套 + SalarySobQueryParam salarySobQueryParam = new SalarySobQueryParam(); + salarySobQueryParam.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + List salarySobs = getSalarySobService(user).listAuth(salarySobQueryParam); return salarySobs.stream().map(m -> { Map map = new HashMap<>(); map.put("id", String.valueOf(m.getId())); diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 99177af16..ee8d70180 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -2,30 +2,29 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.SalarySobBiz; import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; -import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.config.FormluaConfig; import com.engine.salary.entity.salaryformula.po.FormulaPO; import com.engine.salary.entity.salaryformula.po.FormulaVar; -import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig; -import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; @@ -234,13 +233,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Set backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); salaryItemIds.addAll(backCalcItemIds); - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - final Set ids = new HashSet(); - if (needAuth) { - Set collect = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); - ids.addAll(collect); - } - List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> Boolean.FALSE.equals(needAuth) || getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Set ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); + List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList()); //获取系统值 List salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll(); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java index a21906a39..d0937e392 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java @@ -4,7 +4,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; import com.engine.salary.entity.taxdeclaration.dto.*; @@ -27,7 +26,6 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.BooleanUtils; import weaver.hrm.User; import java.util.*; @@ -204,66 +202,13 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); } - /** - * 根据权限范围过滤 - * - * @param taxDeclarationPO - * @param taxDeclarationEmployeeDTOS - * @return - */ - private List filterByAuthority(TaxDeclarationPO taxDeclarationPO, List taxDeclarationEmployeeDTOS) { - long employeeId = user.getUID(); - if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) { - return Collections.emptyList(); - } - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief(employeeId); - if (BooleanUtils.isFalse(openDevolution) || isChief) { - return taxDeclarationEmployeeDTOS; - } - // 查询权限范围内的人员 - List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); - Set simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId()); - // 查询权限范围内的外部人员 -// List extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey); -// Set extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId()); - // 根据权限范围过滤 - return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> { - if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()) - && simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { - return true; - } -// if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) -// && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { -// return true; -// } - return false; - }).collect(Collectors.toList()); - } - @Override public PageInfo listDtoPageByParam4Wage(TaxDeclarationDetailListQueryParam queryParam) { - // 查询个税申报主表 - TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); // 查询个税申报表明细的人员 - PageInfo employeeIdPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); -// if (BooleanUtils.isTrue(openDevolution) && !isChief) { -// List taxDeclarationEmployeeDTOS = getTaxDeclarationDetailMapper().list4EmployeeId(queryParam.getTaxDeclarationId()); -// // 根据权限过滤 -// taxDeclarationEmployeeDTOS = filterByAuthority(taxDeclarationPO, taxDeclarationEmployeeDTOS); -// employeeIdPage.setTotal(taxDeclarationEmployeeDTOS.size()); -// employeeIdPage.setList(SalaryPageUtil.subList((int) employeeIdPage.getPageNum(), (int) employeeIdPage.getPageSize(), taxDeclarationEmployeeDTOS)); -// } else { - employeeIdPage = listPage4EmployeeIdByParam(queryParam); -// } + PageInfo employeeIdPage = listPage4EmployeeIdByParam(queryParam); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclarationWageListDTO.class); dtoPage.setTotal(employeeIdPage.getTotal()); if (CollectionUtils.isNotEmpty(employeeIdPage.getList())) { @@ -279,15 +224,6 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla .map(TaxDeclarationEmployeeDTO::getEmployeeId) .collect(Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询人员薪资(身份证号码等) -// List simpleUserInfos = salaryEmployeeService.listByEmployeeIds(simpleEmployeeIds, tenantKey); - // 查询外部人员 -// Set extEmployeeIds = employeeIdPage.getRecords().stream() -// .filter(taxDeclarationEmployeeDTO -> Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) -// .map(TaxDeclarationEmployeeDTO::getEmployeeId) -// .collect(Collectors.toSet()); -// List extEmployees = extEmployeeService.listByIds(extEmployeeIds, tenantKey); - // 转换成列表dto List taxDeclarationWageListDTOS = TaxDeclarationDetailBO.convert2ListDTO4Wage(taxDeclarationDetailPOS, employeeIdPage.getList(), simpleEmployees); dtoPage.setList(taxDeclarationWageListDTOS); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 2c748f59a..231456f4f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; @@ -366,19 +367,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration public boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId) { // 判断是否开启了分权 Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 判断是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief(employeeId); - if (openDevolution && !isChief) { - // 查询负责管理的个税扣缴义务人 - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); - if (CollectionUtils.isEmpty(taxAgentPOS)) { - return false; - } - Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); - return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId()); - } - // 查询个税申报表 - return true; + // 获取所有个税扣缴义务人 + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + Collection taxAgentList = getTaxAgentService(user).listAuth(param); + + Set taxAgentIds = SalaryEntityUtil.properties(taxAgentList, TaxAgentPO::getId); + return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId()); } @Override diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index a4e3bf86f..7bceb9672 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -126,9 +126,7 @@ public class AddUpDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) { - // 构建异步导出参数 - boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); - return getAddUpDeductionService(user).downloadTemplate(isChief, queryParam); + return getAddUpDeductionService(user).downloadTemplate(queryParam); } diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index e528bbb77..2849139c3 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -116,8 +116,6 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo> list(TaxAgentQueryParam queryParam) { - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); // 是否开启分权 boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution(); From a688ca8b5294151f36d742e4ede7f2659deba8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Feb 2025 14:23:58 +0800 Subject: [PATCH 02/35] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E5=88=86?= =?UTF-8?q?=E6=9D=83;=20=E8=B0=83=E8=96=AA=E8=AE=B0=E5=BD=95=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/SalaryItemAdjustRecordListDTO.java | 3 ++ .../service/impl/SIAccountServiceImpl.java | 50 ------------------- .../service/impl/SIExportServiceImpl.java | 19 +------ .../service/impl/SISchemeServiceImpl.java | 20 ++++---- .../impl/SalaryArchiveItemServiceImpl.java | 24 +++------ .../impl/SalarySobItemServiceImpl.java | 13 ++--- 6 files changed, 27 insertions(+), 102 deletions(-) diff --git a/src/com/engine/salary/entity/salaryarchive/dto/SalaryItemAdjustRecordListDTO.java b/src/com/engine/salary/entity/salaryarchive/dto/SalaryItemAdjustRecordListDTO.java index ede032ccb..db2b4cb2b 100644 --- a/src/com/engine/salary/entity/salaryarchive/dto/SalaryItemAdjustRecordListDTO.java +++ b/src/com/engine/salary/entity/salaryarchive/dto/SalaryItemAdjustRecordListDTO.java @@ -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") diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 895446f5d..54c15e545 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -398,19 +398,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Long employeeId = (long) user.getUID(); Map datas = new HashMap<>(); - // 分权逻辑 - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - List 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 datas = new HashMap<>(); - // 分权逻辑 - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - List 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 datas = new HashMap<>(); queryParam.setPageSize(10000000); - // 分权逻辑 - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - List 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 datas = new HashMap<>(); queryParam.setPageSize(10000000); - // 分权逻辑 - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - List 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()); diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index c0f281ae9..27b51eb3f 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -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 extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param); accountExportPOS.addAll(extAccountExportPOS); - // 分权逻辑 - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); - List 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); //非系统人员核算明细 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 11dc2a7c0..48111689d 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -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 getForm(Map params) { Map 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 taxAgentEmployeeDTOS = getTaxAgentService().listTaxAgentAndEmployee(currentEmployeeId); -// Set employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId); - Set taxAgentIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getTaxAgentId); - List list = getSocialSchemeMapper().queryEmployeeList(param); - return list.stream().filter(f -> taxAgentIds.contains(f.getPaymentOrganization())).collect(Collectors.toList()); - } - - return getSocialSchemeMapper().queryEmployeeList(param); + List list = getSocialSchemeMapper().queryEmployeeList(param); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, InsuranceArchivesEmployeePO.class); + return list; } @Override diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 9e353083e..0f69eb7d4 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -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 salaryItemList = getCanAdjustSalaryItems(); List salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList()); - // 获取记录 - long currentEmployeeId = user.getUID(); - //是否开启分权 - Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId); - if (needAuth) { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId); - List taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList()); - - if (CollectionUtils.isEmpty(taxAgentIds)) { -// return new PageInfo(); - } - - List salaryArchives = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentIds(taxAgentIds).build()); - List salaryArchiveIds = SalaryEntityUtil.properties(salaryArchives, SalaryArchivePO::getId, Collectors.toList()); - queryParam.setSalaryArchiveIds(salaryArchiveIds); - } + //分权 + SalaryArchiveQueryParam archiveQueryParam = new SalaryArchiveQueryParam(); + archiveQueryParam.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + List salaryArchiveIds = getSalaryArchiveService(user).list(archiveQueryParam).stream().map(SalaryArchiveListDTO::getId).collect(Collectors.toList()); + queryParam.setSalaryArchiveIds(salaryArchiveIds); List employeeList = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -718,6 +709,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi ; }) .collect(Collectors.toList()); + SalaryI18nUtil.i18nList(listResult); List listAll = salaryArchiveItemMapper.salaryItemAdjustRecordList(SalaryItemAdjustRecordQueryParam.builder().build(), salaryItemIds); diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index ee8d70180..9f68de3ae 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -180,15 +180,12 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Set backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); salaryItemIds.addAll(backCalcItemIds); - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - final Set ids = new HashSet(); - if (needAuth) { - Set 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 ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); List 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()); //获取系统值 From 9c6e7f46b5cfb4dfc8355dfba91074301b57482a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 13 Feb 2025 15:17:06 +0800 Subject: [PATCH 03/35] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E5=88=86?= =?UTF-8?q?=E6=9D=83;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryStatisticsPushServiceImpl.java | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java index 25f724899..9f37a181f 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsPushServiceImpl.java @@ -108,12 +108,9 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt private List> buildReportIdsOptions(Long employeeId) { List> reportIdsOptions = new ArrayList<>(); List reportPOS = getSalaryStatisticsReportService(user).listAll(); - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth) { - // 只能够分享创建人是本人的报表 - reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList()); - } - reportPOS.forEach( po -> { + // 只能够分享创建人是本人的报表 + reportPOS = reportPOS.stream().filter(po -> po.getCreator().compareTo(employeeId) == 0).collect(Collectors.toList()); + reportPOS.forEach(po -> { Map option = new HashMap<>(); option.put("id", po.getId().toString()); option.put("reportName", po.getReportName()); @@ -129,10 +126,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt if (Objects.isNull(salaryStatisticsPushPO)) { throw new SalaryRunTimeException("该分享记录不存在"); } - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - if (needAuth && salaryStatisticsPushPO.getCreator().compareTo(Long.valueOf(user.getUID())) != 0) { - throw new SalaryRunTimeException("无权查看该分享记录"); - } SalaryStatisticsPushDetail result = new SalaryStatisticsPushDetail(); result.setDetailForm(buildDetailForm(salaryStatisticsPushPO)); result.setDetailTable(buildDetailTable(param)); @@ -279,10 +272,10 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt List salaryStatisticsPushDetailPOS = getSalaryStatisticsPushDetailService(user).queryPushDetailPOByBatchIds(batchId); salaryStatisticsPushDetailPOS.stream().filter(po -> Objects.equals(po.getPushStatus(), "true") && !(Objects.equals(po.getRebackStatus(), "true")) && Objects.equals(uid, po.getEmployeeId())) .collect(Collectors.toList()).forEach(e -> { - e.setViewStatus("true"); - e.setUpdateTime(new Date()); - getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e); - }); + e.setViewStatus("true"); + e.setUpdateTime(new Date()); + getSalaryStatisticsPushDetailService(user).updateIgnoreNull(e); + }); } // @Override @@ -342,7 +335,6 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt } - // public CancleMessageEntity buildCancelMessageEntity(SalaryStatisticsPushDetailPO po, Long employeeId, String tenantKey) { // SalaryStatisticsPushPO pushPO = salaryStatisticsPushMapper.selectById(po.getBatchId()); // CancleMessageEntity cancleMessageEntity = new CancleMessageEntity(); @@ -650,7 +642,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); List salaryStatisticsPushPOS; if (needAuth) { - salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator(Long.valueOf(user.getUID())).build()); + salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().creator((long) user.getUID()).build()); } else { salaryStatisticsPushPOS = getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().build()); } @@ -729,7 +721,7 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt return Collections.emptyList(); } List pushList = new ArrayList<>(); - List> partition = Lists.partition((List)batchIds, 1000); + List> partition = Lists.partition((List) batchIds, 1000); partition.forEach(ids -> { pushList.addAll(getSalaryStatisticsPushMapper().listSome(SalaryStatisticsPushPO.builder().ids(ids).build())); }); @@ -739,13 +731,13 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt @Override public List getPushListByReportIdAndIds(Long reportId, List ids) { List pushList = getSalaryStatisticsPushMapper().listByReportIdAndIds(reportId.toString(), ids); - pushList = pushList.stream().filter( push -> { + pushList = pushList.stream().filter(push -> { return Arrays.asList(push.getReportIds().split(",")).contains(reportId.toString()); }).collect(Collectors.toList()); return pushList; } - List filterReportByTime(List pushList){ + List filterReportByTime(List pushList) { // 报表分享时间校验 String formatLocalDateTime = SalaryDateUtil.getFormatLocalDate(LocalDateTime.now()); List result = pushList.stream().filter(pushPO -> { @@ -763,14 +755,14 @@ public class SalaryStatisticsPushServiceImpl extends Service implements SalarySt List successPushDetailList = getSalaryStatisticsPushDetailService(user).getSuccessPushDetailListByReceiver(uid); // 根据报表id,分享批次id查询分享批次信息 List batchIds = successPushDetailList.stream().map(SalaryStatisticsPushDetailPO::getBatchId).collect(Collectors.toList()); - List pushList= getPushListByReportIdAndIds(reportId,batchIds); + List pushList = getPushListByReportIdAndIds(reportId, batchIds); if (CollectionUtils.isEmpty(pushList)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"暂无权限查看该报表")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "暂无权限查看该报表")); } // 校验是否在分享的有效时间内 pushList = filterReportByTime(pushList); if (CollectionUtils.isEmpty(pushList)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"该报表的分享不在有效期内,无法查看")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该报表的分享不在有效期内,无法查看")); } return pushList; } From 3d0aff3f1dada957803d77c6f685fd028e054dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 14 Feb 2025 14:05:18 +0800 Subject: [PATCH 04/35] =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=AE=A1=E7=90=86=E4=B8=9A=E5=8A=A1=E7=BA=BF?= =?UTF-8?q?=E5=88=86=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/RemoteExcelServiceImpl.java | 8 +++++--- .../salary/service/impl/SalaryArchiveItemServiceImpl.java | 8 ++++++-- src/com/engine/salary/wrapper/SalaryArchiveWrapper.java | 8 +------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java index b0424ad47..04b20f202 100644 --- a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java @@ -17,8 +17,10 @@ import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxrate.TaxRateBase; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salaryformula.ReferenceTypeEnum; import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.enums.salaryformula.SalarySQLReferenceEnum; @@ -365,9 +367,9 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic } else { salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); } - Set taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()) - .stream().map(TaxAgentPO::getId) - .collect(Collectors.toSet()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Set taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); return salaryItems.stream() //薪资项目取消过滤档案,使得导入功能一页面为准 // .filter(e -> e.getUseInEmployeeSalary() == 0) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 0f69eb7d4..c5c9879e8 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -19,6 +19,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; @@ -631,8 +632,11 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi */ @Override public List getCanAdjustSalaryItems() { - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); - List taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList()); + + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Collection taxAgentList = getTaxAgentService(user).listAuth(param); + List taxAgentIds = SalaryEntityUtil.properties(taxAgentList, TaxAgentPO::getId, Collectors.toList()); List canAdjustSalaryItems = salaryItemMapper.getCanAdjustSalaryItems(); canAdjustSalaryItems = canAdjustSalaryItems.stream() diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index effea20b0..8a8b87e51 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -4,9 +4,9 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.component.SalaryWeaTable; import com.engine.salary.config.SalaryElogConfig; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO; import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO; @@ -147,12 +147,6 @@ public class SalaryArchiveWrapper extends Service { // 获取所有可被引用的薪资项目 List salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); - Set userTaxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()) - .stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); - salaryItems = salaryItems.stream() - .filter(po -> getSalaryItemService(user).filterInRange(userTaxAgentIds, po)) - .collect(Collectors.toList()); - //整合所有的显示列(固定列+薪资项目动态列) List> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE); From 32be67e022e755256ddfb1f4bb52c3e758fbc61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 14 Feb 2025 14:50:54 +0800 Subject: [PATCH 05/35] =?UTF-8?q?=E6=9B=BF=E6=8D=A2listAllTaxAgents?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/RemoteExcelServiceImpl.java | 6 ++++-- .../salary/service/impl/SalaryArchiveServiceImpl.java | 9 +++++---- .../engine/salary/wrapper/SalaryArchiveItemWrapper.java | 6 +----- src/com/engine/salary/wrapper/SalarySobItemWrapper.java | 9 ++++++--- src/com/engine/salary/wrapper/TaxAgentWrapper.java | 6 ++++-- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java index 04b20f202..e40399497 100644 --- a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java @@ -399,8 +399,10 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic } else { salaryItems = getSalaryItemService(user).listByIds(salaryItemIds); } - Set taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()) - .stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); + + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Set taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); return salaryItems.stream() .filter(e -> e.getUseInEmployeeSalary() == 1) .filter(e-> getSalaryItemService(user).filterInRange(taxAgentIds, e)) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 06dbfe8d3..96e0e8659 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -22,6 +22,7 @@ import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentEmpChangePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; @@ -313,11 +314,11 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe return; } // 当前可以管辖的人员 - Collection taxAgentList = new ArrayList<>(); if (currentEmployeeId != 1L) { - taxAgentList = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId); - Collection finalTaxAgentList = taxAgentList; - taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> finalTaxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + Collection taxAgentList =getTaxAgentService(user).listAuth(param); + taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> taxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList()); if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) { return; } diff --git a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java index 4ff541091..d53341ea3 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveItemWrapper.java @@ -12,7 +12,6 @@ import com.engine.salary.entity.salaryarchive.dto.SingleSalaryItemAdjustRecordLi import com.engine.salary.entity.salaryarchive.param.*; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; -import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.auth.AuthFilterTypeEnum; @@ -102,11 +101,8 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt columns.add(SalaryI18nUtil.getI18nLabel(85434, "调整后")); // 获取所有可被引用的薪资项目 List salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems(); - Set taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()) - .stream().map(TaxAgentPO::getId) - .collect(Collectors.toSet()); + List> salaryItems = salaryItemList.stream() - .filter(po -> getSalaryItemService(user).filterInRange(taxAgentIds, po)) .map(m -> { Map salaryItemMap = new LinkedHashMap<>(); salaryItemMap.put("id", String.valueOf(m.getId())); diff --git a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java index 07006c6a4..d8bece097 100644 --- a/src/com/engine/salary/wrapper/SalarySobItemWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobItemWrapper.java @@ -15,7 +15,9 @@ import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.service.*; import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryEntityUtil; @@ -77,9 +79,10 @@ public class SalarySobItemWrapper extends Service { List salaryItemList = getSalaryItemService(user).listByParam(queryParam); - Set taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()) - .stream().map(TaxAgentPO::getId) - .collect(Collectors.toSet()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Set taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); + salaryItemList = salaryItemList.stream() .filter(po -> getSalaryItemService(user).filterInRange(taxAgentIds, po)) .collect(Collectors.toList()); diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 2849139c3..2ea504ee9 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentAdminPO; import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO; 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.salarysob.TargetTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; @@ -446,11 +447,12 @@ public class TaxAgentWrapper extends Service { */ public String syncRange() { long currentEmployeeId = (long) user.getUID(); - List taxAgentIds = this.getTaxAgentService(user).listAllTaxAgents(currentEmployeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - String index = SalaryCacheKey.TAX_AGENT_MANAGE_RANGE_SYNC + "-" + currentEmployeeId; String syncRange = Util.null2String(Util_DataCache.getObjVal(index)); if (StringUtils.isEmpty(syncRange)) { + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + List taxAgentIds = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); getTaxAgentManageRangeService(user).syncManageRange(taxAgentIds, index); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(135788, "人员范围同步过于频繁,请稍后再试")); From 05690a81fae7ca9a6169726cedf8851ec0bf5740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 14 Feb 2025 15:13:40 +0800 Subject: [PATCH 06/35] =?UTF-8?q?=E6=9B=BF=E6=8D=A2listAllTaxAgentsAsAdmin?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 5 +++- .../service/impl/SISchemeServiceImpl.java | 20 ++++------------ .../impl/SalaryArchiveServiceImpl.java | 14 +++++------ .../impl/SpecialAddDeductionServiceImpl.java | 21 ----------------- .../impl/TaxDeclarationServiceImpl.java | 23 ++----------------- .../wrapper/SalaryArchiveTaxAgentWrapper.java | 7 +++++- .../salary/wrapper/SalarySobWrapper.java | 17 ++++++-------- 7 files changed, 31 insertions(+), 76 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 54c15e545..c3b3a4a5f 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -32,6 +32,7 @@ import com.engine.salary.entity.siexport.param.InsuranceExportParam; import com.engine.salary.entity.siexport.po.AccountExportPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; @@ -1488,7 +1489,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public Collection getAdminTaxAgentList() { - return getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + return getTaxAgentService(user).listAuth(param); } @Override diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 48111689d..cef8f80b8 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1012,7 +1012,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { singleAccount.add(cellData); } - isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree, param); + isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, taxAgentManageRangeEmployeeTree, param); if (isError) { errorCount += 1; // 添加错误数据 @@ -1071,7 +1071,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public boolean singleAccountCheck(List> singleAccount, Map welfareMap, List insuranceArchivesAccountPOS, List employeeByIds, List> excelComments, int i, Map schemeNameIdMap, - Map paymentNameIdMap, Long creator, int index, Boolean openDevolution, + Map paymentNameIdMap, Long creator, int index, List taxAgentManageRangeEmployeeTree, SIArchiveImportParam param) { boolean isError = false; String runStatus = param.getRunStatus(); @@ -2086,19 +2086,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //获取所有福利类型的id-name结合 Map schemeNameIdMap = schemeNameIdMap(); Map welfareMap = welfareMap(); + // 获取所有个税扣缴义务人的名称和id的map - Map paymentNameIdMap; - - //分权 -// Boolean openDevolution = getTaxAgentService().isOpenDevolution(); - // 流程处理,默认不开启分权 - Boolean openDevolution = false; - if (openDevolution) { - paymentNameIdMap = getTaxAgentService().listAllTaxAgentsAsAdmin((long) user.getUID()).stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId)); - } else { - - paymentNameIdMap = getTaxAgentService().listAll().stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId)); - } + Map paymentNameIdMap = getTaxAgentService().listAll().stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId)); //获取所有个税扣缴义务人树型 List taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree(); @@ -2156,7 +2146,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { singleAccount.add(cellData); } - isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree, param); + isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, taxAgentManageRangeEmployeeTree, param); if (isError) { errorCount += 1; // 添加错误数据 diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 96e0e8659..f4fdc079b 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -362,13 +362,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe throw new SalaryRunTimeException("不允许删除薪资档案,请先开启删除档案规则配置!"); } List salaryArchiveList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(salaryArchiveIds).build()); - - //查询当前登录人员管理的个税扣缴义务人 - List canDeleteTaxAgentIds = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()) - .stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - boolean err = salaryArchiveList.stream().anyMatch(po -> !canDeleteTaxAgentIds.contains(po.getTaxAgentId())); - if (CollectionUtils.isEmpty(salaryArchiveList) || err) { - throw new SalaryRunTimeException("薪资档案不存在,或没有权限删除该薪资档案!"); + if (CollectionUtils.isEmpty(salaryArchiveList)) { + throw new SalaryRunTimeException("薪资档案不存在"); + } + //权限,可操作的档案 + salaryArchiveList = getAuthService(user).auth(salaryArchiveList, AuthFilterTypeEnum.ADMIN_DATA, SalaryArchivePO.class); + if (CollectionUtils.isEmpty(salaryArchiveList)) { + throw new SalaryRunTimeException("没有权限删除该薪资档案!"); } Optional fixedList = salaryArchiveList.stream().filter(archive -> !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.PENDING.getValue()) && !StringUtils.equals(archive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())).findFirst(); diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 0cadab86e..ed7102c46 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -18,7 +18,6 @@ import com.engine.salary.entity.datacollection.param.SpecialAddDeductionParam; import com.engine.salary.entity.datacollection.param.SpecialAddDeductionQueryParam; import com.engine.salary.entity.datacollection.param.SpecialAddDeductionRecordDeleteParam; import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -130,26 +129,6 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd return page; } - private void putQueryRange(SpecialAddDeductionQueryParam queryParam) { - Long employeeId = (long) user.getUID(); - List taxAgentIdsAsAdmin = getTaxAgentService(user) - .listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId) - .collect(Collectors.toList()); - if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) { - // 不是个税扣缴义务人管理员,限定搜索范围为当前登录人 - List taxAgentIdsAsEmployee = getTaxAgentService(user) - .listAllTaxAgentsAsRange(Collections.singletonList(employeeId)) - .stream().filter(t -> t.getEmployeeId().equals(employeeId)) - .map(TaxAgentEmployeeTaxAgentDTO::getTaxAgentIds) - .flatMap(Collection::stream) - .collect(Collectors.toList()); - queryParam.setTaxAgentIds(taxAgentIdsAsEmployee); - queryParam.setEmployeeId(employeeId); - } else { - //管理员设置相应的个税扣缴义务人来筛选 - queryParam.setTaxAgentIds(taxAgentIdsAsAdmin); - } - } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 231456f4f..e4ade6241 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -36,7 +36,6 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.BooleanUtils; import weaver.general.BaseBean; import weaver.hrm.User; @@ -156,33 +155,15 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration @Override public void save(TaxDeclarationSaveParam saveParam) { - long currentEmployeeId = user.getUID(); - - // 个税扣缴义务人id - Set taxAgentIds; - Long taxAgentId = saveParam.getTaxAgentId(); if (taxAgentId == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "请选择要申报的扣缴义务人!")); } - if (taxAgentId != null) { - taxAgentIds = Collections.singleton(taxAgentId); - } else { - //管理的扣缴义务人一次性申报逻辑 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - if (BooleanUtils.isFalse(openDevolution)) { - taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAll(), TaxAgentPO::getId); - } else { - taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId), TaxAgentPO::getId); - } - } + // 个税扣缴义务人id + Set taxAgentIds = Collections.singleton(taxAgentId); - // 检查是否具有权限 - if (CollectionUtils.isEmpty(taxAgentIds)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "对不起,您不具备任何个税扣缴义务人的管理权限")); - } // 查询个税扣缴义务人 List taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds); diff --git a/src/com/engine/salary/wrapper/SalaryArchiveTaxAgentWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveTaxAgentWrapper.java index 44146d169..a0c4f3200 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveTaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveTaxAgentWrapper.java @@ -10,8 +10,10 @@ import com.engine.salary.entity.salaryarchive.param.SingleTaxAgentAdjustRecordQu import com.engine.salary.entity.salaryarchive.param.TaxAgentAdjustRecordQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO; import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; 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.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.SalaryArchiveTaxAgentService; @@ -88,7 +90,10 @@ public class SalaryArchiveTaxAgentWrapper extends Service { private Map buildTaxAgentForm(Date effectiveTime, String adjustReason, String adjustBefore, Long adjustAfter) { // 个税扣缴义务人下拉列表 - Collection taxAgentList = getTaxAgentService(user).listAllTaxAgentsAsAdmin((long)user.getUID()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + Collection taxAgentList = getTaxAgentService(user).listAuth(param); + Map map = new HashMap<>(); map.put("adjustReasonList", SalaryArchiveTaxAgentAdjustReasonEnum.getList()); map.put("taxAgentList", taxAgentList); diff --git a/src/com/engine/salary/wrapper/SalarySobWrapper.java b/src/com/engine/salary/wrapper/SalarySobWrapper.java index 97a016cfe..68722cffa 100644 --- a/src/com/engine/salary/wrapper/SalarySobWrapper.java +++ b/src/com/engine/salary/wrapper/SalarySobWrapper.java @@ -1,6 +1,5 @@ package com.engine.salary.wrapper; -import cn.hutool.core.collection.CollectionUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; @@ -16,10 +15,13 @@ import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobDefaultBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.salarysob.IncomeCategoryEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.*; +import com.engine.salary.service.auth.AuthService; +import com.engine.salary.service.auth.AuthServiceImpl; import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -68,6 +70,9 @@ public class SalarySobWrapper extends Service { return ServiceUtil.getService(SalarySobItemServiceImpl.class, user); } + public AuthService getAuthService(User user) { + return ServiceUtil.getService(AuthServiceImpl.class, user); + } /** * 薪资账套列表 @@ -285,15 +290,7 @@ public class SalarySobWrapper extends Service { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除")); } - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - if (!openDevolution) { - return true; - } - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); - Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); - Collection intersection = CollectionUtil.intersection(taxAgentIds, salarySobPO.getTaxAgentIds()); - return intersection.size() > 0; + return getAuthService(user).auth(salarySobPO, AuthFilterTypeEnum.DATA_OPT, SalarySobPO.class); } public List listByTaxAgent(SalarySobQueryParam param) { From 22077f431e75dcec2b311120a2cf7c9aed4bf99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Feb 2025 09:49:01 +0800 Subject: [PATCH 07/35] =?UTF-8?q?=E6=9D=83=E9=99=90=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaxAgentServiceImpl.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index 5443c1b45..0051bd7b8 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -313,21 +313,9 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { @Override public Collection listAllTaxAgentsAsAdmin(Long employeeId) { - List taxAgents = getTaxAgentMapper().listAll(); - // 是否开启分权 - boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution(); - if (!isOpenDevolution) { - return taxAgents; - } - List taxAgentIds = taxAgents.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - List enableTaxAgentIds = Lists.newArrayList(); - // 1.判断自己是否是管理员, 如果是管理员,就是能够查看所属个税扣缴义务人 - List taxAgentAdminList = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds); - // 是管理员的列表 - List adminTaxAgentIds = taxAgentAdminList.stream().filter(f -> f.getEmployeeId().equals(employeeId)).map(TaxAgentAdminPO::getTaxAgentId).collect(Collectors.toList()); - - enableTaxAgentIds.addAll(adminTaxAgentIds); - return taxAgents.stream().filter(f -> enableTaxAgentIds.contains(f.getId())).collect(Collectors.toList()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + return listAuth(param); } @Override @@ -493,8 +481,6 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { } // 删除管理员 getTaxAgentAdminService(user).deleteByTaxAgentIds(ids); - // 删除分管理员和对应管理范围 -// todo taxAgentSubAdminService.deleteByTaxAgentIds(ids); // 删除人员范围 getTaxAgentManageRangeService(user).deleteByTaxAgentIds(ids); From 291cd426fec77d3de7f6f8f2a9c43dbcd846f953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Feb 2025 15:54:35 +0800 Subject: [PATCH 08/35] =?UTF-8?q?=E5=85=AC=E5=BC=8F=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96=E4=B8=8A=E6=9C=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryacct/bo/CalculateFormulaVarBO.java | 31 ++++++++++++++++++- .../SalaryFormulaReferenceEnum.java | 1 + .../service/SalaryAcctResultService.java | 18 +++++++++-- .../salary/service/impl/PushServiceImpl.java | 4 +-- .../service/impl/RemoteExcelServiceImpl.java | 3 ++ .../impl/SalaryAcctCalculateServiceImpl.java | 7 ++++- .../impl/SalaryAcctResultServiceImpl.java | 19 +++++++++++- 7 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index f14966bc5..806ceadd6 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -101,6 +101,11 @@ public class CalculateFormulaVarBO { */ private List> variableArchiveList; + /** + * 上月核算结果 + */ + List lastMonthResultPOS; + public CalculateFormulaVarBO(List simpleEmployees, List salaryArchiveData, List addUpSituationPOS, @@ -109,7 +114,8 @@ public class CalculateFormulaVarBO { List> welfareData, List attendQuoteDataDTOS, List salaryAcctResultPOS, - List> variableArchiveList) { + List> variableArchiveList, + List lastMonthResultPOS) { this.simpleEmployees = simpleEmployees; this.salaryArchiveData = salaryArchiveData; this.addUpSituationPOS = addUpSituationPOS; @@ -119,6 +125,7 @@ public class CalculateFormulaVarBO { this.attendQuoteDataDTOS = attendQuoteDataDTOS; this.salaryAcctResultPOS = salaryAcctResultPOS; this.variableArchiveList = variableArchiveList; + this.lastMonthResultPOS = lastMonthResultPOS; } /** @@ -147,7 +154,10 @@ public class CalculateFormulaVarBO { handleAttendQuoteData(salaryAcctCalculateBO, resultMap); //处理核算人员信息 handleSalaryAcctEmployee(salaryAcctCalculateBO, resultMap); + //处理人员信息 handleSimpleEmployees(resultMap); + //处理上月薪资核算结果 + handleLastMonthResult(salaryAcctCalculateBO, resultMap); return resultMap; } @@ -231,6 +241,25 @@ public class CalculateFormulaVarBO { }); } + private void handleLastMonthResult(SalaryAcctCalculateBO salaryAcctCalculateBO, Map> resultMap) { + // key:薪资项目的id、value:薪资项目的code + Map salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalaryItemPOS(), SalaryItemPO::getId, SalaryItemPO::getCode); + // key:employeeId_taxAgentId、value:薪资核算结果集合 + Map> salaryAcctResultMap = SalaryEntityUtil.group2Map(lastMonthResultPOS, + salaryAcctResultPO -> salaryAcctResultPO.getEmployeeId() + "_" + salaryAcctResultPO.getTaxAgentId()); + // 填充到返回结果集中 + salaryAcctResultMap.forEach((key, salaryAcctResultPOS) -> { + List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); + formulaVarValues.addAll(salaryAcctResultPOS.stream() + .map(salaryAcctResultPO -> { + String fieldId = SalaryFormulaReferenceEnum.LAST_MONTH_CALC.getValue() + + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + + salaryItemCodeMap.getOrDefault(salaryAcctResultPO.getSalaryItemId(), StringUtils.EMPTY); + return new FormulaVarValue().setFieldId(fieldId).setFieldValue(salaryAcctResultPO.getResultValue()); + }) + .collect(Collectors.toList())); + }); + } /** * 处理薪资档案(会涉及调薪计薪规则)+处理核算日期 diff --git a/src/com/engine/salary/enums/salaryformula/SalaryFormulaReferenceEnum.java b/src/com/engine/salary/enums/salaryformula/SalaryFormulaReferenceEnum.java index da3b76213..eafb0e32e 100644 --- a/src/com/engine/salary/enums/salaryformula/SalaryFormulaReferenceEnum.java +++ b/src/com/engine/salary/enums/salaryformula/SalaryFormulaReferenceEnum.java @@ -17,6 +17,7 @@ public enum SalaryFormulaReferenceEnum implements BaseEnum { SALARY_ITEM("salaryItem", "薪资项目", 84960), // SALARY_ITEM_OF_HISTORY("salaryItemOfHistory", "历史台账薪资项目", 85364), + LAST_MONTH_CALC("lastMonthCalc", "上月核算", 257728), EMPLOYEE_INFO("employeeInfo", "员工基本信息", 85366), SALARY_ARCHIVES("salaryArchives", "薪资档案", 85368), ATTEND("attend", "考勤引用", 85367), diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java index ea6c2fe30..ac7309950 100644 --- a/src/com/engine/salary/service/SalaryAcctResultService.java +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.util.page.PageInfo; import java.util.Collection; +import java.util.Date; import java.util.List; import java.util.Map; @@ -159,6 +160,7 @@ public interface SalaryAcctResultService { /** * 锁定单元格 + * * @param param */ void lock(SalaryAcctResultLockParam param); @@ -179,8 +181,8 @@ public interface SalaryAcctResultService { void batchUpdateOriginResultValue(List salaryAcctResultValues); /** - * @description 薪资回算 * @return void + * @description 薪资回算 * @author Harryxzy * @date 2022/11/24 20:26 */ @@ -196,8 +198,8 @@ public interface SalaryAcctResultService { List listBySalaryAcctRecordIdsAndSalaryItemIds(Collection salaryAcctRecordIds, Collection salaryItemIds); /** - * @description 根据薪资核算人员id、薪资项目id获取薪资核算结果 * @return List + * @description 根据薪资核算人员id、薪资项目id获取薪资核算结果 * @author Harryxzy * @date 2022/12/26 22:24 */ @@ -207,6 +209,7 @@ public interface SalaryAcctResultService { /** * 检查当前用户是否有查看权限 + * * @param salaryAcctRecordId * @return */ @@ -214,7 +217,18 @@ public interface SalaryAcctResultService { /** * 薪资核算结果批量更新 + * * @param param */ void batchUpdate(SalaryAcctResultBatchUpdateParam param); + + /** + * 查询指定账套月份的数据 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ + List listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List employeeIds); } diff --git a/src/com/engine/salary/service/impl/PushServiceImpl.java b/src/com/engine/salary/service/impl/PushServiceImpl.java index 9eabd3c7b..214eae1a3 100644 --- a/src/com/engine/salary/service/impl/PushServiceImpl.java +++ b/src/com/engine/salary/service/impl/PushServiceImpl.java @@ -289,7 +289,7 @@ public class PushServiceImpl extends Service implements PushService { List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); - CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>()); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>(),new ArrayList<>()); Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); @@ -403,7 +403,7 @@ public class PushServiceImpl extends Service implements PushService { List salaryAcctEmployeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getId, Collectors.toList()); List salaryAcctResultPOS = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); - CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>()); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), salaryAcctResultPOS, new ArrayList<>(), new ArrayList<>()); Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); List pushSettingPOS = getPushSettingMapper().listSome(PushSettingPO.builder().able(1).build()); diff --git a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java index e40399497..8a447abba 100644 --- a/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/RemoteExcelServiceImpl.java @@ -143,6 +143,7 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic if (referenceEnum != null) { switch (referenceEnum) { case SALARY_ITEM: + case LAST_MONTH_CALC: case ISSUED: vars = salaryItem2FormulaVar(referenceEnum, extendParam); break; @@ -241,6 +242,8 @@ public class RemoteExcelServiceImpl extends Service implements RemoteExcelServic if (ReferenceTypeEnum.FORMULA.equals(referenceTypeEnum)) { result.put(SalaryFormulaReferenceEnum.SALARY_ITEM.getDefaultLabel(), salaryItem2FormulaVar(SalaryFormulaReferenceEnum.SALARY_ITEM, null)); + result.put(SalaryFormulaReferenceEnum.LAST_MONTH_CALC.getDefaultLabel(), + salaryItem2FormulaVar(SalaryFormulaReferenceEnum.LAST_MONTH_CALC, null)); result.put(SalaryFormulaReferenceEnum.ISSUED.getDefaultLabel(), salaryItem2FormulaVar(SalaryFormulaReferenceEnum.ISSUED, null)); result.put(SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getDefaultLabel(), diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index 8b30ec9bc..81fae4808 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -27,6 +27,7 @@ import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum; import com.engine.salary.formlua.entity.standard.ExcelResult; import com.engine.salary.service.*; import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum; +import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; @@ -189,9 +190,13 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc List otherSalaryAcctEmployeePOS = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIdsAndEmployeeIds(otherSalaryAcctRecordIds, employeeIds); Map> otherSalaryAcctEmployeePOMap = SalaryEntityUtil.group2Map(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId()); sw.stop(); + // 查询上个薪资所属月核算人员薪资数据 + sw.start("查询上个薪资所属月核算人员薪资数据"); + List lastMonthResultPOS = getSalaryAcctResultService(user).listBySobSalaryMonth(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth().minusMonths(1), 1), salaryAcctCalculateBO.getSalarySobPO().getId(), employeeIds); + sw.stop(); // 10、转换成公式编辑器中的变量 sw.start("转换成公式编辑器中的变量"); - CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList); + CalculateFormulaVarBO calculateFormulaVarBO = new CalculateFormulaVarBO(simpleEmployees, salaryArchiveData, addUpSituationPOS, addUpDeductionPOS, otherDeductionPOS, welfareData, attendQuoteDataDTOS, salaryAcctResultPOS, variableArchiveList,lastMonthResultPOS); Map> formulaVarMap = calculateFormulaVarBO.convert2FormulaVar(salaryAcctCalculateBO); sw.stop(); sw.start("数据结构准备"); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index d2784f8cb..aacf3381f 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.hrmelog.entity.dto.LoggerContext; @@ -192,6 +193,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe private VariableItemService getVariableItemService(User user) { return ServiceUtil.getService(VariableItemServiceImpl.class, user); } + private SalaryApprovalRuleService getSalaryApprovalRuleService(User user) { return ServiceUtil.getService(SalaryApprovalRuleServiceImpl.class, user); } @@ -917,7 +919,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + calculateParam.getSalaryAcctRecordId(), true); //更新薪资核算记录最后操作日期 - getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(),new Date()); + getSalaryAcctRecordService(user).updateDate(salaryAcctRecordPO.getId(), new Date()); stopWatch.stop(); log.info(stopWatch.prettyPrint()); @@ -1244,4 +1246,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe } } + + @Override + public List listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List employeeIds) { + List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listSome(SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryMonth).build()); + List recordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, Collectors.toList()); + + SalaryAcctResultPO resultParam = SalaryAcctResultPO.builder().salaryAcctRecordIds(recordIds).build(); + if(CollUtil.isNotEmpty(employeeIds)){ + resultParam.setEmployeeIds(employeeIds); + } + List salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(resultParam); + + encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); + return salaryAcctResultPOS; + } } \ No newline at end of file From 85eaa6e2a2987917d14b1a665fb97c1d9fc93968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 17 Feb 2025 16:34:35 +0800 Subject: [PATCH 09/35] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8A=E6=9C=88=E6=95=B0=E6=8D=AE=E6=97=B6=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=80=BC=E6=B7=B7=E4=B9=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryAcctResultServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index aacf3381f..94e9897f4 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1252,6 +1252,10 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listSome(SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryMonth).build()); List recordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, Collectors.toList()); + if(CollUtil.isEmpty(recordIds)){ + return new ArrayList<>(); + } + SalaryAcctResultPO resultParam = SalaryAcctResultPO.builder().salaryAcctRecordIds(recordIds).build(); if(CollUtil.isNotEmpty(employeeIds)){ resultParam.setEmployeeIds(employeeIds); From cac3c11fa3943bfba5ad940a9473e775da998c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Feb 2025 10:07:01 +0800 Subject: [PATCH 10/35] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=8A=E6=9C=88=E6=95=B0=E6=8D=AE=E5=8F=98=E9=87=8F=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E1000=E5=8F=AF=E8=83=BD=E5=B8=A6=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryAcctResultServiceImpl.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 94e9897f4..51fa669c3 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -1252,15 +1252,21 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listSome(SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryMonth).build()); List recordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, Collectors.toList()); - if(CollUtil.isEmpty(recordIds)){ + if (CollUtil.isEmpty(recordIds)) { return new ArrayList<>(); } - + List salaryAcctResultPOS = new ArrayList<>(); SalaryAcctResultPO resultParam = SalaryAcctResultPO.builder().salaryAcctRecordIds(recordIds).build(); - if(CollUtil.isNotEmpty(employeeIds)){ - resultParam.setEmployeeIds(employeeIds); + if (CollUtil.isNotEmpty(employeeIds)) { + List> partition = Lists.partition(employeeIds, 500); + for (List ids : partition){ + resultParam.setEmployeeIds(ids); + List acctResultPOS = getSalaryAcctResultMapper().listSome(resultParam); + salaryAcctResultPOS.addAll(acctResultPOS); + } + } else { + salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(resultParam); } - List salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(resultParam); encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class); return salaryAcctResultPOS; From d22083351243715e3e948ffc7cc9bc4a5957303b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 19 Feb 2025 16:38:49 +0800 Subject: [PATCH 11/35] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=9D=9E=E7=B3=BB=E7=BB=9F=E4=BA=BA=E5=91=98=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/report/wrapper/SalaryStatisticsReportWrapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java index c385a5b21..7d0d48d53 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsReportWrapper.java @@ -439,7 +439,7 @@ public class SalaryStatisticsReportWrapper extends Service { Map countResultMap = (Map) result.get("countResult"); List> list = page.getList(); // 获取数据 - List> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue()))).collect(Collectors.toList()); + List> records = list.stream().map(m -> m.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue() == null ? "" : e.getValue()))).collect(Collectors.toList()); records.add(countResultMap); List rows = new ArrayList<>(); From 2f9822aeef87aa62584d386aad8509528b174cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Feb 2025 10:53:27 +0800 Subject: [PATCH 12/35] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E6=A1=A3=E6=A1=88=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SIArchivesServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index e159edcda..c77ff7375 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -1584,14 +1584,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService List> records = new ArrayList<>(); Map socialSchemePOMap = encryptUtil.decryptList(this.getSocialByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesSocialSchemePO.class) - .stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getId, Function.identity())); + .stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getId, Function.identity(), (a, b) -> a)); Map fundSchemePOMap = encryptUtil.decryptList(this.getFundByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS), InsuranceArchivesFundSchemePO.class) - .stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getId, Function.identity())); + .stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getId, Function.identity(), (a, b) -> a)); List otherByEmployeeList = this.getOtherByEmployeeIdAndPayOrg(insuranceArchivesEmployeePOS); encryptUtil.decryptList(otherByEmployeeList, InsuranceArchivesOtherSchemePO.class); Map otherSchemePOMap = otherByEmployeeList - .stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getId, Function.identity())); + .stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getId, Function.identity(), (a, b) -> a)); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getSocialId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getFundId()); From 93b98ce5837ae500dc862913ab8a7064ac9f4829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 20 Feb 2025 10:54:52 +0800 Subject: [PATCH 13/35] =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/WEB-INF/prop/hrmSalary.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/WEB-INF/prop/hrmSalary.properties b/resource/WEB-INF/prop/hrmSalary.properties index e8125608b..cf2bf7de5 100644 --- a/resource/WEB-INF/prop/hrmSalary.properties +++ b/resource/WEB-INF/prop/hrmSalary.properties @@ -1,5 +1,5 @@ log=false defaultCloseNonStandard149=true AESEncryptScrect=990EB004A1C862721C1513AE90038C9E -version=2.19.1.2501.01 +version=3.0.0.2502.01 openFormulaForcedEditing=false \ No newline at end of file From bf57c66fc1cb29c399af2f7749376ded18b6647f Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 26 Feb 2025 15:13:39 +0800 Subject: [PATCH 14/35] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=AE=9A=E8=96=AA?= =?UTF-8?q?=E8=B6=85=E8=BF=871000=E6=97=A5=E5=BF=97=E6=8A=A5=E9=94=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryArchiveServiceImpl.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index f4fdc079b..65c200b7b 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -1099,9 +1099,13 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe return StringUtils.EMPTY; } // 从待定薪到停薪 - getSalaryArchiveMapper().deletePendingTodo(ids); + List> partition = Lists.partition((List) ids, 800); + partition.forEach(getSalaryArchiveMapper()::deletePendingTodo); // 记录日志 - List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + List newList = new ArrayList<>(); + partition.forEach(part -> { + newList.addAll(getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build())); + }); String operatedesc = SalaryI18nUtil.getI18nLabel(0, "删除待办"); recordLog(oldList, newList, operatedesc); @@ -1131,11 +1135,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } // 从待定薪到定薪 - List> partition = Lists.partition((List) ids, 1000); + List> partition = Lists.partition((List) ids, 800); partition.forEach(getSalaryArchiveMapper()::gotoFixed); // 记录日志 - List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + List newList = new ArrayList<>(); + partition.forEach(part -> { + newList.addAll(getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build())); + }); String operateDesc = SalaryI18nUtil.getI18nLabel(0, "设为发薪员工"); recordLog(salaryArchiveList, newList, operateDesc); @@ -1201,10 +1208,14 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe } // 从待停薪到停薪 - getSalaryArchiveMapper().gotoStop(ids); + List> partition = Lists.partition((List) ids, 800); + partition.forEach(getSalaryArchiveMapper()::gotoStop); // 记录日志 - List newList = getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(ids).build()); + List newList = new ArrayList<>(); + partition.forEach(part -> { + newList.addAll( getSalaryArchiveMapper().listSome(SalaryArchivePO.builder().ids(part).build())); + }); String operatedesc = SalaryI18nUtil.getI18nLabel(0, "停薪"); recordLog(oldList, newList, operatedesc); From 1b7735230167c363bdec49f3304ffb4b222a94ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Feb 2025 10:29:11 +0800 Subject: [PATCH 15/35] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=86=B2=E7=AA=81?= =?UTF-8?q?=EF=BC=8C=E7=A6=81=E7=94=A8map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/entity/salaryacct/bo/CalculateFormulaVarBO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java index 806ceadd6..cd66dd76c 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -282,7 +282,7 @@ public class CalculateFormulaVarBO { } private void handleVariableArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map> resultMap) { - Map> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentId", "").toString() + "-" + map.getOrDefault("employeeId", "").toString()); + Map> variableArchiveMap = SalaryEntityUtil.convert2Map(variableArchiveList, map -> map.getOrDefault("taxAgentIds", "").toString() + "-" + map.getOrDefault("employeeId", "").toString()); // 填充到返回结果集中 for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) { List formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(), From 7382345dd5b0b3b5ba64d155d8d7805bf7528ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Feb 2025 15:47:59 +0800 Subject: [PATCH 16/35] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=80=E5=B7=AE?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIRecessionServiceImpl.java | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java index e620c082e..29d56344d 100644 --- a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java @@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON; import com.api.formmode.mybatis.util.SqlProxyHandle; 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.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; @@ -14,9 +14,10 @@ import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; import com.engine.salary.entity.siaccount.param.RecessionParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ProjectTypeEnum; @@ -25,11 +26,14 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; +import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIRecessionService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.auth.AuthService; +import com.engine.salary.service.auth.AuthServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -69,6 +73,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic private SIAccountService getSIAccountService(User user) { return ServiceUtil.getService(SIAccountServiceImpl.class, user); } + private InsuranceAccountBatchMapper getInsuranceAccountBatchMapper() { return MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class); } @@ -81,6 +86,14 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private InsuranceBaseInfoMapper getInsuranceBaseInfoMapper() { + return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class); + } + + public AuthService getAuthService(User user) { + return ServiceUtil.getService(AuthServiceImpl.class, user); + } + @Override public void save(RecessionParam param, Long employeeId) { @@ -102,11 +115,11 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic partitionEmpIds.forEach(p -> { detailPOS.addAll( getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder() - .paymentStatus(PaymentStatusEnum.COMMON.getValue()) - .recessionMonthList(param.getRecessionMonthList()) - .employeeIds(p) - .paymentOrganization(param.getPaymentOrganization()) - .build()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .recessionMonthList(param.getRecessionMonthList()) + .employeeIds(p) + .paymentOrganization(param.getPaymentOrganization()) + .build()) ); }); @@ -208,7 +221,6 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic } - private void recessionBaseBuild(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO, DataCollectionEmployee employee) { InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), Long.valueOf(param.getPaymentOrganization())); temp.setPaymentStatus(PaymentStatusEnum.RECESSION.getValue()); @@ -253,6 +265,7 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString()); temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString()); } + private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) { //退差社保个人缴费 String socialPerJson = insuranceAccountDetailPO.getSocialPerJson(); @@ -396,15 +409,12 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic @Override public PageInfo getEmployeeListByTaxAgent(HrmQueryParam param) { - // 当前登录人员 - Long currentEmployeeId = (long) user.getUID(); - - List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(currentEmployeeId); - Set employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId); - List empIds = new ArrayList(employeeIds); + List list = getInsuranceBaseInfoMapper().listAll(); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.ADMIN_DATA, InsuranceArchivesBaseInfoPO.class); + List employeeIds = SalaryEntityUtil.properties(list, InsuranceArchivesBaseInfoPO::getEmployeeId, Collectors.toList()); List resultData = new ArrayList<>(); if (employeeIds.size() > 0) { - List> partition = Lists.partition(empIds, 1000); + List> partition = Lists.partition(employeeIds, 1000); partition.forEach(p -> { param.setIds(p); resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param)); From cb38a3fa9b201ebeefa937ec53a136974b08c9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 27 Feb 2025 17:44:23 +0800 Subject: [PATCH 17/35] =?UTF-8?q?=E6=B5=AE=E5=8A=A8=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/VariableArchiveServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/service/impl/VariableArchiveServiceImpl.java b/src/com/engine/salary/service/impl/VariableArchiveServiceImpl.java index ce3544cb6..d06b252f1 100644 --- a/src/com/engine/salary/service/impl/VariableArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/VariableArchiveServiceImpl.java @@ -175,6 +175,7 @@ public class VariableArchiveServiceImpl extends Service implements VariableArchi map.put("idNo", e.getIdNo()); map.put("companystartdate", e.getCompanystartdate()); map.put("dismissdate", e.getDismissdate()); + map.put("opts", e.getOpts()); // 浮动薪资项目动态 Optional> optionalItem = variableArchiveItemData.stream().filter(f -> f.get("variableArchiveId").toString().equals(e.getId().toString())).findFirst(); From ef28618db4a3a5d6a19fb413d6bcc60675e072c3 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 4 Mar 2025 16:48:00 +0800 Subject: [PATCH 18/35] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E5=A2=9E=E5=87=8F=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsuranceAccountDetailMapper.java | 8 + .../InsuranceAccountDetailMapper.xml | 24 ++ .../siarchives/InsuranceBaseInfoMapper.java | 2 + .../siarchives/InsuranceBaseInfoMapper.xml | 12 + .../salary/service/SIAccountService.java | 4 + .../service/impl/SIAccountServiceImpl.java | 222 ++++++++++++++++-- .../salary/web/SIAccountController.java | 32 +++ 7 files changed, 290 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java index 2a05a0c72..faf48f4bc 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java @@ -192,4 +192,12 @@ public interface InsuranceAccountDetailMapper { * 获取补差数据(账单月份+人员id+个税扣缴义务人) */ List queryBalanceList(InsuranceAccountDetailPO po); + + /** + * 根据id删除 + * @param ids + */ + void deleteByIds(@Param("ids")List ids); + + void deleteByEmpIds(@Param("employeeIds")List deleteEmployeeIds, @Param("billMonth") String billMonth, @Param("paymentOrganization") Long paymentOrganization); } diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index f5b88a501..0f0f382cc 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -553,6 +553,7 @@ SELECT t.id,t.employee_id,t.social_per_json,t.social_com_json, diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java index 898d55471..4e933213d 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java @@ -20,6 +20,8 @@ public interface InsuranceBaseInfoMapper { */ List listAll(); + List listByEmployeeIds(@Param("employeeIds")Collection employeeIds); + /** * 查询对应id集合的记录 * diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml index 33ceb8af1..d42fc0d04 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml @@ -43,6 +43,18 @@ WHERE delete_type = 0 + +