From 9d223c7a0688dad28cba7248f173291f55c6f892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 6 Apr 2022 20:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E7=AE=97=E5=9F=BA=E7=A1=80=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/salary/web/SalaryAcctController.java | 8 + .../salaryacct/bo/CalculateFormulaVarBO.java | 442 +++++++++++++++ .../salaryacct/bo/ExpressFormulaBO.java | 131 +++++ .../salaryacct/bo/SalaryAcctCalculateBO.java | 115 ++++ .../bo/SalaryAcctCalculatePriorityBO.java | 225 ++++++++ .../salaryacct/bo/SalaryAcctCheckBO.java | 81 +++ .../bo/SalaryAcctConsolidatedTaxBO.java | 91 +++ .../salaryacct/bo/SalaryAcctEmployeeBO.java | 123 +++++ .../salaryacct/bo/SalaryAcctFormulaBO.java | 91 +++ .../salaryacct/bo/SalaryAcctRecordBO.java | 138 +++++ .../salaryacct/bo/SalaryAcctResultBO.java | 521 ++++++++++++++++++ .../entity/salaryacct/bo/SalaryCheckBO.java | 231 ++++++++ .../salaryacct/bo/SalaryCheckResultBO.java | 93 ++++ .../dto/ConsolidatedTaxDetailDTO.java | 27 + .../dto/SalaryAccEmployeeListDTO.java | 109 ++++ .../dto/SalaryAccResultListDTO.java | 39 ++ .../entity/salaryacct/dto/SalaryAcctDTO.java | 24 + .../dto/SalaryAcctEmpSearchConditionDTO.java | 60 ++ .../dto/SalaryAcctEmployeeCountDTO.java | 23 + .../dto/SalaryAcctEmployeeInfoDTO.java | 27 + .../dto/SalaryAcctImportFieldDTO.java | 42 ++ .../salaryacct/dto/SalaryAcctProgressDTO.java | 65 +++ .../dto/SalaryAcctRecordFormDTO.java | 60 ++ .../dto/SalaryAcctRecordListDTO.java | 105 ++++ .../dto/SalaryAcctResultDetailDTO.java | 60 ++ .../SalaryAcctResultSearchConditionDTO.java | 72 +++ .../dto/SalaryCheckResultListDTO.java | 66 +++ .../dto/SalaryCheckResultRecordCountDTO.java | 21 + .../dto/SalaryCheckResultRecordListDTO.java | 62 +++ .../dto/SalaryComparisonResultListDTO.java | 32 ++ .../param/SalaryAcctCalculateParam.java | 33 ++ .../param/SalaryAcctCheckParam.java | 39 ++ .../SalaryAcctEmpCheckTaxAgentParam.java | 24 + .../SalaryAcctEmpRefreshTaxAgentParam.java | 24 + .../param/SalaryAcctEmployeeAddParam.java | 25 + .../param/SalaryAcctEmployeeDeleteParam.java | 26 + .../param/SalaryAcctEmployeeQueryParam.java | 52 ++ .../param/SalaryAcctEmployeeSaveParam.java | 36 ++ .../param/SalaryAcctImportTemplateParam.java | 36 ++ .../param/SalaryAcctRecordQueryParam.java | 32 ++ .../param/SalaryAcctRecordReAccountParam.java | 24 + .../param/SalaryAcctRecordSaveParam.java | 37 ++ .../param/SalaryAcctResultQueryParam.java | 49 ++ .../param/SalaryAcctResultSaveParam.java | 45 ++ .../param/SalaryCheckResultExportParam.java | 34 ++ .../param/SalaryCheckResultQueryParam.java | 33 ++ .../SalaryCheckResultRecordQueryParam.java | 33 ++ .../SalaryComparisonResultExportParam.java | 24 + .../SalaryComparisonResultQueryParam.java | 23 + .../salaryacct/po/ExcelAcctResultPO.java | 88 +++ .../salaryacct/po/SalaryAcctEmployeePO.java | 81 +++ .../salaryacct/po/SalaryAcctRecordPO.java | 102 ++++ .../salaryacct/po/SalaryAcctResultPO.java | 88 +++ .../salaryacct/po/SalaryAcctResultTempPO.java | 95 ++++ .../po/SalaryCheckResultDetailTempPO.java | 85 +++ .../salaryacct/po/SalaryCheckResultPO.java | 73 +++ .../po/SalaryCheckResultRecordPO.java | 83 +++ .../salarysob/dto/SalarySobListDTO.java | 2 +- .../SalaryAcctRecordStatusEnum.java | 13 +- .../archive/SalaryArchiveItemMapper.xml | 12 +- .../salaryacct/SalaryAcctRecordMapper.java | 73 +++ .../salaryacct/SalaryAcctRecordMapper.xml | 282 ++++++++++ .../service/SalaryAcctEmployeeService.java | 229 ++++++++ .../service/SalaryAcctRecordService.java | 160 ++++++ .../service/SalaryAcctResultService.java | 134 +++++ .../impl/SalaryAcctRecordServiceImpl.java | 449 +++++++++++++++ .../transmethod/TaxRateTransMethod.java | 2 +- .../salary/transmethod/TransMethod.java | 41 ++ .../engine/salary/util/SalaryDateUtil.java | 192 ++++++- .../engine/salary/util/db/SqlProxyHandle.java | 98 ++-- .../salary/web/SalaryAcctController.java | 390 +++++++++++++ .../wrapper/SalaryAcctRecordWrapper.java | 209 +++++++ 72 files changed, 6714 insertions(+), 80 deletions(-) create mode 100644 src/com/api/salary/web/SalaryAcctController.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/ExpressFormulaBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCheckBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctConsolidatedTaxBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctFormulaBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCheckBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/bo/SalaryCheckResultBO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/ConsolidatedTaxDetailDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAccResultListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmpSearchConditionDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeCountDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeInfoDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctImportFieldDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctProgressDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordFormDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordCountDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctCalculateParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctCheckParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpCheckTaxAgentParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpRefreshTaxAgentParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeDeleteParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeSaveParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctImportTemplateParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordReAccountParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordSaveParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultSaveParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultExportParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultRecordQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultExportParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultQueryParam.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/ExcelAcctResultPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java create mode 100644 src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java create mode 100644 src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml create mode 100644 src/com/engine/salary/service/SalaryAcctEmployeeService.java create mode 100644 src/com/engine/salary/service/SalaryAcctRecordService.java create mode 100644 src/com/engine/salary/service/SalaryAcctResultService.java create mode 100644 src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java create mode 100644 src/com/engine/salary/web/SalaryAcctController.java create mode 100644 src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java diff --git a/src/com/api/salary/web/SalaryAcctController.java b/src/com/api/salary/web/SalaryAcctController.java new file mode 100644 index 000000000..7d8be0bcf --- /dev/null +++ b/src/com/api/salary/web/SalaryAcctController.java @@ -0,0 +1,8 @@ +package com.api.salary.web; + +import javax.ws.rs.Path; + +@Path("/bs/hrmsalary/salaryacct") +public class SalaryAcctController extends com.engine.salary.web.SalaryAcctController { + +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java new file mode 100644 index 000000000..b88b346ca --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/CalculateFormulaVarBO.java @@ -0,0 +1,442 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.framework.util.JsonUtil; +//import com.weaver.hrm.salary.annotation.SalaryFormulaVar; +//import com.weaver.hrm.salary.common.LocalDateRange; +//import com.weaver.hrm.salary.constant.SalaryFormulaFieldConstant; +//import com.weaver.hrm.salary.entity.datacollection.dto.AttendQuoteDataDTO; +//import com.weaver.hrm.salary.entity.datacollection.dto.AttendQuoteDataValueDTO; +//import com.weaver.hrm.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; +//import com.weaver.hrm.salary.entity.datacollection.po.AddUpDeductionPO; +//import com.weaver.hrm.salary.entity.datacollection.po.AddUpSituationPO; +//import com.weaver.hrm.salary.entity.datacollection.po.OtherDeductionPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultPO; +//import com.weaver.hrm.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; +//import com.weaver.hrm.salary.entity.salaryarchive.dto.SalaryArchiveItemDataDTO; +//import com.weaver.hrm.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAdjustRulePO; +//import com.weaver.hrm.salary.enums.SalaryFormulaReferenceEnum; +//import com.weaver.hrm.salary.enums.salarysob.SalarySobAdjustRuleTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import lombok.Data; +//import lombok.experimental.Accessors; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.commons.lang3.math.NumberUtils; +// +//import java.lang.reflect.Field; +//import java.math.BigDecimal; +//import java.math.RoundingMode; +//import java.time.temporal.ChronoUnit; +//import java.util.*; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算-将数据转换成公式中的变量 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/25/22 7:29 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//public class CalculateFormulaVarBO { +// +// /** +// * 员工信息 +// */ +// private List simpleEmployees; +// +// /** +// * 薪资档案 +// */ +// private List salaryArchiveData; +// +// /** +// * 累计情况 +// */ +// private List addUpSituationPOS; +// +// /** +// * 累计专项附加扣除 +// */ +// private List addUpDeductionPOS; +// +// /** +// * 其他扣除 +// */ +// private List otherDeductionPOS; +// +// /** +// * 社保福利 +// */ +// private List> welfareData; +// +// /** +// * 考勤数据 +// */ +// private List attendQuoteDataDTOS; +// +// /** +// * 薪资核算结果(输入/导入的值) +// */ +// private List salaryAcctResultPOS; +// +// public CalculateFormulaVarBO(List simpleEmployees, +// List salaryArchiveData, +// List addUpSituationPOS, +// List addUpDeductionPOS, +// List otherDeductionPOS, +// List> welfareData, +// List attendQuoteDataDTOS, +// List salaryAcctResultPOS) { +// this.simpleEmployees = simpleEmployees; +// this.salaryArchiveData = salaryArchiveData; +// this.addUpSituationPOS = addUpSituationPOS; +// this.addUpDeductionPOS = addUpDeductionPOS; +// this.otherDeductionPOS = otherDeductionPOS; +// this.welfareData = welfareData; +// this.attendQuoteDataDTOS = attendQuoteDataDTOS; +// this.salaryAcctResultPOS = salaryAcctResultPOS; +// } +// +// /** +// * 将查询到的数据转换成公式变量 +// * +// * @param salaryAcctCalculateBO 核算参数 +// * @return +// */ +// public Map> convert2FormulaVar(SalaryAcctCalculateBO salaryAcctCalculateBO) { +// Map> resultMap = Maps.newHashMapWithExpectedSize(salaryAcctCalculateBO.getSalaryAcctEmployeePOS().size()); +// // 处理薪资核算结果 +// handleSalaryAcctResult(salaryAcctCalculateBO, resultMap); +// // 处理薪资档案 +// handleSalaryArchiveData(salaryAcctCalculateBO, resultMap); +// // 处理往期累计情况 +// handleAddUpSituation(resultMap); +// // 处理累计专项附加扣除 +// handleAddUpDeduction(resultMap); +// // 处理其他扣除 +// handleOtherDeduction(resultMap); +// // 处理社保福利 +// handleWelfareData(salaryAcctCalculateBO, resultMap); +// // 处理考勤数据 +// handleAttendQuoteData(salaryAcctCalculateBO, resultMap); +// return resultMap; +// } +// +// /** +// * 处理薪资核算结果 +// * +// * @param salaryAcctCalculateBO 薪资核算参数 +// * @param resultMap 返回结果集 +// */ +// private void handleSalaryAcctResult(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(salaryAcctResultPOS, +// 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.SALARY_ITEM.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + salaryItemCodeMap.getOrDefault(salaryAcctResultPO.getSalaryItemId(), StringUtils.EMPTY); +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(salaryAcctResultPO.getResultValue()); +// }) +// .collect(Collectors.toList())); +// }); +// } +// +// /** +// * 处理薪资档案(会涉及调薪计薪规则) +// * +// * @param salaryAcctCalculateBO 薪资核算参数 +// * @param resultMap 返回结果集 +// */ +// private void handleSalaryArchiveData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map> resultMap) { +// // 调薪计薪规则 +// Map salarySobAdjustRulePOMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalarySobAdjustRulePOS(), +// SalarySobAdjustRulePO::getSalaryItemId); +// for (SalaryArchiveDataDTO salaryArchiveDataDTO : salaryArchiveData) { +// for (SalaryArchiveTaxAgentDataDTO salaryArchiveTaxAgentDataDTO : salaryArchiveDataDTO.getTaxAgents()) { +// String key = salaryArchiveDataDTO.getEmployeeId() + "_" + salaryArchiveTaxAgentDataDTO.getTaxAgentId(); +// List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// // 将薪资档案的值转换成公式中的变量,填充到返回结果集中 +// formulaVarValues.addAll(handleSalaryArchiveItemVal(salaryAcctCalculateBO, salaryArchiveTaxAgentDataDTO.getSalaryItemValues(), salarySobAdjustRulePOMap)); +// } +// } +// } +// +// /** +// * 根据调薪计薪规则处理薪资档案的调薪,转换成公式编辑器中的变量 +// * +// * @param salaryAcctCalculateBO +// * @param salaryArchiveItemDataList +// * @param salarySobAdjustRulePOMap +// * @return +// */ +// private List handleSalaryArchiveItemVal(SalaryAcctCalculateBO salaryAcctCalculateBO, +// List salaryArchiveItemDataList, +// Map salarySobAdjustRulePOMap) { +// // 薪资周期 +// LocalDateRange salaryCycle = salaryAcctCalculateBO.getSalarySobCycleDTO().getSalaryCycle(); +// // key:薪资项目的id、value:薪资项目的code +// Map salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalaryItemPOS(), SalaryItemPO::getId, SalaryItemPO::getCode); +// // 将薪资档案的调薪记录按照薪资项目id聚合(同一个薪资项目可能存在多次调薪,按照生效日期对调薪记录排序) +// Map> dataMap = salaryArchiveItemDataList.stream() +// .collect(Collectors.groupingBy(SalaryArchiveItemDataDTO::getSalaryItemId, +// Collectors.collectingAndThen(Collectors.toList(), salaryArchiveItemDataDTOS -> salaryArchiveItemDataDTOS.stream() +// .sorted(Comparator.comparing(salaryArchiveItemDataDTO -> salaryArchiveItemDataDTO.getEffectiveDateRange().getFromDate())) +// .collect(Collectors.toList())))); +// // 将薪资档案的值转换成公式编辑器中的变量 +// List formulaVarValues = Lists.newArrayListWithExpectedSize(dataMap.size()); +// for (Map.Entry> entry : dataMap.entrySet()) { +// String value; +// // 获取薪资项目的调薪规则 +// SalarySobAdjustRulePO salaryAdjustmentRulePO = salarySobAdjustRulePOMap.get(entry.getKey()); +// if (entry.getValue().size() > 2) { +// // 如果薪资项目在薪资周期内经历了多次调薪,则默认分段计薪 +// value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.PARTITION, entry.getValue()); +// } else if (salaryAdjustmentRulePO == null || entry.getValue().size() < 2) { +// // 如果薪资项目没有设置调薪计薪规则,默认取薪资周期内薪资档案中最新的值 +// // 如果薪资项目在薪资周期内没有调薪,默认取薪资周期内薪资档案中最新的值 +// value = calculateBySalarySobAdjustRule(salaryCycle, SalarySobAdjustRuleTypeEnum.USE_AFTER_ADJUSTMENT, entry.getValue()); +// } else { +// // 如果薪资项目在薪资周期内只有一次调薪,则根据调薪计薪规则处理 +// SalarySobAdjustRuleTypeEnum adjustRuleTypeEnum = salaryAdjustmentRulePO.getDayOfMonth() < entry.getValue().get(0).getEffectiveDateRange().getEndDate().getDayOfMonth() +// ? SalarySobAdjustRuleTypeEnum.parseByValue(salaryAdjustmentRulePO.getAfterAdjustmentType()) +// : SalarySobAdjustRuleTypeEnum.parseByValue(salaryAdjustmentRulePO.getBeforeAdjustmentType()); +// // 根据调薪计薪规则处理薪资档案的调薪 +// value = calculateBySalarySobAdjustRule(salaryCycle, adjustRuleTypeEnum, entry.getValue()); +// } +// String fieldId = SalaryFormulaReferenceEnum.SALARY_ARCHIVES.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + salaryItemCodeMap.getOrDefault(entry.getKey(), StringUtils.EMPTY); +// formulaVarValues.add(new FormulaVarValue().setFieldId(fieldId).setFieldValue(value)); +// } +// return formulaVarValues; +// } +// +// /** +// * 根据调薪计薪规则计算调薪后的值 +// * +// * @param adjustRuleTypeEnum +// * @param salaryArchiveItemDataDTOS +// * @return +// */ +// private String calculateBySalarySobAdjustRule(LocalDateRange salaryCycle, +// SalarySobAdjustRuleTypeEnum adjustRuleTypeEnum, +// List salaryArchiveItemDataDTOS) { +// if (Objects.isNull(adjustRuleTypeEnum)) { +// return StringUtils.EMPTY; +// } +// String value; +// switch (adjustRuleTypeEnum) { +// case AVERAGE: +// // 可能存在多次调薪 +// // = (第一段的值+第二段的值+……)/n +// value = String.valueOf(salaryArchiveItemDataDTOS.stream() +// .mapToDouble(salaryArchiveItemDataDTO -> SalaryEntityUtil.empty2Zero(salaryArchiveItemDataDTO.getValue()).doubleValue()) +// .average().orElse(NumberUtils.DOUBLE_ZERO)); +// break; +// case PARTITION: +// // 可能存在多次调薪 +// // = (第一段的值*第一段的自然日+第二段的值*第二段的自然日+……)/薪资所属月自然日 +// BigDecimal valueSum = BigDecimal.ZERO; +// for (int i = 0; i < salaryArchiveItemDataDTOS.size(); i++) { +// SalaryArchiveItemDataDTO dataDTO = salaryArchiveItemDataDTOS.get(i); +// BigDecimal dayDiff = new BigDecimal(dataDTO.getEffectiveDateRange().getFromDate().until(dataDTO.getEffectiveDateRange().getEndDate(), ChronoUnit.DAYS)); +// // 最后一段日期范围需要加一 +// if (Objects.equals(i, salaryArchiveItemDataDTOS.size() - 1)) { +// dayDiff = dayDiff.add(BigDecimal.ONE); +// } +// valueSum = valueSum.add(SalaryEntityUtil.empty2Zero(dataDTO.getValue()).multiply(dayDiff)); +// } +// value = valueSum.divide(new BigDecimal(salaryCycle.getFromDate().until(salaryCycle.getEndDate(), ChronoUnit.DAYS)).add(BigDecimal.ONE), 2, RoundingMode.HALF_UP).toPlainString(); +// break; +// case USE_BEFORE_ADJUSTMENT: +// // = 调薪前工资 +// value = salaryArchiveItemDataDTOS.get(0).getValue(); +// break; +// case USE_AFTER_ADJUSTMENT: +// // = 调薪后工资 +// value = salaryArchiveItemDataDTOS.get(salaryArchiveItemDataDTOS.size() - 1).getValue(); +// break; +// default: +// value = "0"; +// break; +// } +// return value; +// } +// +// /** +// * 处理累计情况(工资、薪金) +// * +// * @param resultMap 返回结果集 +// */ +// private void handleAddUpSituation(Map> resultMap) { +// // key:employeeId_taxAgentId、value:累计情况(工资、薪金)的数据 +// Map addUpSituationPOMap = SalaryEntityUtil.convert2Map(addUpSituationPOS, +// addUpSituationPO -> addUpSituationPO.getEmployeeId() + "_" + addUpSituationPO.getTaxAgentId()); +// // 累计情况(工资、薪金)可选字段 +// List fieldNames = Lists.newArrayList(); +// Field[] declaredFields = AddUpSituationPO.class.getDeclaredFields(); +// for (Field declaredField : declaredFields) { +// if (declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// fieldNames.add(declaredField.getName()); +// } +// } +// // 填充到返回结果集中 +// addUpSituationPOMap.forEach((key, addUpSituationPO) -> { +// List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// Map map = JsonUtil.parseMap(addUpSituationPO, String.class); +// formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { +// String fieldId = SalaryFormulaReferenceEnum.ADD_UP_SITUATION.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + fieldName; +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(map.getOrDefault(fieldName, StringUtils.EMPTY)); +// }).collect(Collectors.toList())); +// }); +// } +// +// /** +// * 处理累计专项附加扣除 +// * +// * @param resultMap 返回结果集 +// */ +// private void handleAddUpDeduction(Map> resultMap) { +// // key:employeeId_taxAgentId、value:累计专项附加扣除的数据 +// Map addUpDeductionPOMap = SalaryEntityUtil.convert2Map(addUpDeductionPOS, +// addUpDeductionPO -> addUpDeductionPO.getEmployeeId() + "_" + addUpDeductionPO.getTaxAgentId()); +// // 累计专项附加扣除可选字段 +// List fieldNames = Lists.newArrayList(); +// Field[] declaredFields = AddUpDeductionPO.class.getDeclaredFields(); +// for (Field declaredField : declaredFields) { +// if (declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// fieldNames.add(declaredField.getName()); +// } +// } +// // 填充到返回结果集中 +// addUpDeductionPOMap.forEach((key, addUpDeductionPO) -> { +// List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// Map map = JsonUtil.parseMap(addUpDeductionPO, String.class); +// formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { +// String fieldId = SalaryFormulaReferenceEnum.ADD_UP_DEDUCTIONS.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + fieldName; +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(map.getOrDefault(fieldName, StringUtils.EMPTY)); +// }).collect(Collectors.toList())); +// }); +// } +// +// /** +// * 处理其他扣除 +// * +// * @param resultMap 返回结果集 +// */ +// private void handleOtherDeduction(Map> resultMap) { +// // key:employeeId_taxAgentId、value:累计专项附加扣除的数据 +// Map otherDeductionPOMap = SalaryEntityUtil.convert2Map(otherDeductionPOS, +// otherDeductionPO -> otherDeductionPO.getEmployeeId() + "_" + otherDeductionPO.getTaxAgentId()); +// // 累计专项附加扣除可选字段 +// List fieldNames = Lists.newArrayList(); +// Field[] declaredFields = OtherDeductionPO.class.getDeclaredFields(); +// for (Field declaredField : declaredFields) { +// if (declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// fieldNames.add(declaredField.getName()); +// } +// } +// // 填充到返回结果集中 +// otherDeductionPOMap.forEach((key, otherDeductionPO) -> { +// List formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// Map map = JsonUtil.parseMap(otherDeductionPO, String.class); +// formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { +// String fieldId = SalaryFormulaReferenceEnum.OTHER_DEDUCTION.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + fieldName; +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(map.getOrDefault(fieldName, StringUtils.EMPTY)); +// }).collect(Collectors.toList())); +// }); +// } +// +// /** +// * 处理社保福利数据 +// * +// * @param resultMap 返回结果集 +// */ +// private void handleWelfareData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map> resultMap) { +// // 社保福利可选字段 +// List fieldNames = Lists.newArrayList(salaryAcctCalculateBO.getWelfareColumns().values()); +// // 社保福利数据 +// Map> tempMap = Maps.newHashMapWithExpectedSize(welfareData.size()); +// welfareData.forEach(map -> { +// String key = String.valueOf(map.getOrDefault("employeeId", StringUtils.EMPTY)); +// List formulaVarValues = tempMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { +// String fieldId = SalaryFormulaReferenceEnum.WELFARE.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + fieldName; +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(String.valueOf(map.getOrDefault(fieldName, StringUtils.EMPTY))); +// }).collect(Collectors.toList())); +// }); +// // 填充到返回结果集中 +// for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) { +// List formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(), +// k -> Lists.newArrayList()); +// formulaVarValues.addAll(tempMap.getOrDefault(String.valueOf(salaryAcctEmployeePO.getEmployeeId()), Collections.emptyList())); +// } +// } +// +// /** +// * 处理考勤引用数据 +// * +// * @param salaryAcctCalculateBO +// * @param resultMap +// */ +// private void handleAttendQuoteData(SalaryAcctCalculateBO salaryAcctCalculateBO, Map> resultMap) { +// // 考勤引用可选字段 +// Set fieldNames = SalaryEntityUtil.properties(salaryAcctCalculateBO.getAttendQuoteFieldListDTOS(), AttendQuoteFieldListDTO::getId); +// // 考勤引用数据 +// Map> tempMap = Maps.newHashMapWithExpectedSize(attendQuoteDataDTOS.size()); +// attendQuoteDataDTOS.forEach(attendQuoteDataDTO -> { +// Map attendQuoteDataValueMap = SalaryEntityUtil.convert2Map(attendQuoteDataDTO.getDataValues(), AttendQuoteDataValueDTO::getAttendQuoteFieldId, AttendQuoteDataValueDTO::getDataValue); +// Long key = attendQuoteDataDTO.getEmployeeId(); +// List formulaVarValues = tempMap.computeIfAbsent(key, k -> Lists.newArrayList()); +// formulaVarValues.addAll(fieldNames.stream().map(fieldName -> { +// String fieldId = SalaryFormulaReferenceEnum.ATTEND.getValue() +// + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR +// + fieldName; +// return new FormulaVarValue().setFieldId(fieldId).setFieldValue(attendQuoteDataValueMap.getOrDefault(fieldName, StringUtils.EMPTY)); +// }).collect(Collectors.toList())); +// }); +// // 填充到返回结果集中 +// for (SalaryAcctEmployeePO salaryAcctEmployeePO : salaryAcctCalculateBO.getSalaryAcctEmployeePOS()) { +// List formulaVarValues = resultMap.computeIfAbsent(salaryAcctEmployeePO.getEmployeeId() + "_" + salaryAcctEmployeePO.getTaxAgentId(), +// k -> Lists.newArrayList()); +// formulaVarValues.addAll(tempMap.getOrDefault(salaryAcctEmployeePO.getEmployeeId(), Collections.emptyList())); +// } +// } +// +// @Data +// @Accessors(chain = true) +// public static class FormulaVarValue { +// +// /** +// * 公式变量id +// */ +// private String fieldId; +// +// /** +// * 公式变量的值 +// */ +// private String fieldValue; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/ExpressFormulaBO.java b/src/com/engine/salary/entity/salaryacct/bo/ExpressFormulaBO.java new file mode 100644 index 000000000..3a5226323 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/ExpressFormulaBO.java @@ -0,0 +1,131 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.alibaba.fastjson.JSON; +//import com.alibaba.fastjson.JSONArray; +//import com.alibaba.fastjson.JSONObject; +//import com.weaver.excel.formula.api.entity.ExpressFormula; +//import com.weaver.excel.formula.api.entity.FormulaVar; +//import com.weaver.hrm.salary.constant.SalaryFormulaFieldConstant; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultPO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.enums.SalaryFormulaReferenceEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.curator.shaded.com.google.common.collect.Maps; +// +//import java.math.BigDecimal; +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.Objects; +//import java.util.regex.Matcher; +//import java.util.regex.Pattern; +// +///** +// * @description: 薪资核算公式 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 6/2/22 10:33 PM +// * @version:v1.0 +// */ +//public class ExpressFormulaBO { +// +// /** +// * 公式中变量的fieldId的正则表达式 +// */ +// private static final String SALARY_REGEX = "(\\w+)" + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + "(\\w+)"; +// +// /** +// * 解析公式中变量的fieldId的正则表达式 +// */ +// private static final Pattern SALARY_PATTERN = Pattern.compile(SALARY_REGEX); +// +// /** +// * 解析公式中的变量 +// * +// * @param expressFormulas 公式详情 +// * @return +// */ +// public static Map> buildFormulaVar(List expressFormulas) { +// if (CollectionUtils.isEmpty(expressFormulas)) { +// return Collections.emptyMap(); +// } +// Map> resultMap = Maps.newHashMapWithExpectedSize(expressFormulas.size()); +// for (ExpressFormula expressFormula : expressFormulas) { +// if (StringUtils.isEmpty(expressFormula.getParameter())) { +// continue; +// } +// JSONObject paramJson = JSON.parseObject(expressFormula.getParameter()); +// if (paramJson != null) { +// JSONArray paramArray = paramJson.getJSONArray("formulavars"); +// if (paramArray != null) { +// List formulaVars = paramArray.toJavaList(FormulaVar.class); +// resultMap.put(expressFormula.getId(), formulaVars); +// } +// } +// } +// return resultMap; +// } +// +// /** +// * 给公式中的变量填入值 +// * +// * @param expressFormulas +// * @param salaryItems +// * @param acctResults +// * @return +// */ +// public static Map> buildFormulaVar4Check(List expressFormulas, List salaryItems, List acctResults) { +// if (CollectionUtils.isEmpty(expressFormulas)) { +// return Collections.emptyMap(); +// } +// Map salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId, SalaryItemPO::getCode); +// Map acctResultMap = SalaryEntityUtil.convert2Map(acctResults, e -> salaryItemCodeMap.getOrDefault(e.getSalaryItemId(), ""), SalaryAcctResultPO::getResultValue); +// Map> formulaVarMap = buildFormulaVar(expressFormulas); +// formulaVarMap.forEach((k, v) -> { +// for (FormulaVar formulaVar : v) { +// Matcher matcher = SALARY_PATTERN.matcher(formulaVar.getFieldId()); +// if (matcher.find()) { +// SalaryFormulaReferenceEnum referenceEnum = SalaryFormulaReferenceEnum.parseByValue(matcher.group(1)); +// if (referenceEnum == SalaryFormulaReferenceEnum.SALARY_ITEM) { +// formulaVar.setContent(acctResultMap.getOrDefault(matcher.group(2), "")); +// } +// } +// } +// }); +// return formulaVarMap; +// } +// +// /** +// * 给公式中的变量填入值 +// * +// * @param expressFormula 公式 +// * @param formulaVarValueMap 公式变量的值 +// * @return +// */ +// public static List buildFormulaVar4Accounting(ExpressFormula expressFormula, Map formulaVarValueMap) { +// List formulaVars = Collections.emptyList(); +// // 公式异常 +// if (Objects.isNull(expressFormula) || StringUtils.isEmpty(expressFormula.getParameter())) { +// return Collections.emptyList(); +// } +// JSONObject paramJson = JSON.parseObject(expressFormula.getParameter()); +// if (paramJson != null) { +// JSONArray paramArray = paramJson.getJSONArray("formulavars"); +// if (paramArray != null) { +// formulaVars = paramArray.toJavaList(FormulaVar.class); +// for (FormulaVar formulaVar : formulaVars) { +// // 公式变量的值 +// String formulaVarValue = formulaVarValueMap.getOrDefault(formulaVar.getFieldId(), StringUtils.EMPTY); +// // 如果公式的返回值类型为number,公式中的变量的值如果为空,公式运行的时候会报错,所以需要替换成0 +// if (StringUtils.isEmpty(formulaVarValue) && "number".equals(expressFormula.getReturnType())) { +// formulaVarValue = BigDecimal.ZERO.toPlainString(); +// } +// formulaVar.setContent(formulaVarValue); +// } +// } +// } +// return formulaVars; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java new file mode 100644 index 000000000..687aae4f2 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculateBO.java @@ -0,0 +1,115 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.weaver.excel.formula.api.entity.ExpressFormula; +//import com.weaver.hrm.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobCycleDTO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobAdjustRulePO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobItemPO; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.util.List; +//import java.util.Map; +//import java.util.concurrent.BlockingDeque; +//import java.util.concurrent.CountDownLatch; +// +///** +// * @description: 薪资核算 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/25/22 6:03 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//public class SalaryAcctCalculateBO { +// +// /** +// * 当前薪资核算记录 +// */ +// private SalaryAcctRecordPO salaryAcctRecordPO; +// +// /** +// * 当前薪资核算记录的薪资周期、考勤周期…… +// */ +// private SalarySobCycleDTO salarySobCycleDTO; +// +// /** +// * 相同税款所属期内其他薪资核算记录(薪资类型为工资薪金的账套的) +// */ +// private List otherSalaryAcctRecordPOS; +// +// /** +// * 当前薪资核算记录所用的薪资账套下的薪资项目 +// */ +// private List salarySobItemPOS; +// +// /** +// * 本次运算的薪资项目(已排好运算优先级) +// */ +// private List> salaryItemIdWithPriorityList; +// +// /** +// * 本次运算涉及的所有公式 +// */ +// private List expressFormulas; +// +// /** +// * 租户下所有的薪资项目 +// */ +// private List salaryItemPOS; +// +// /** +// * 当前薪资核算所用账套设置的调薪计薪规则 +// */ +// private List salarySobAdjustRulePOS; +// +// /** +// * 社保福利字段 +// */ +// private Map welfareColumns; +// +// /** +// * 考勤引用字段 +// */ +// private List attendQuoteFieldListDTOS; +// +// /** +// * 本次运算的薪资核算人员 +// */ +// private List salaryAcctEmployeePOS; +// +// /** +// * 核算结果临时表中的key +// */ +// private String calculateKey; +// +// /** +// * 监视子线程运算结果 +// */ +// private CountDownLatch childMonitor; +// +// /** +// * 所有子线程的运算结果 +// */ +// private BlockingDeque results; +// +// @Data +// @AllArgsConstructor +// public static class Result { +// +// /** +// * 子线程是否运算成功 +// */ +// private boolean status; +// +// /** +// * 子线程元算失败的错误信息 +// */ +// private String errMsg; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java new file mode 100644 index 000000000..0d712c2ef --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCalculatePriorityBO.java @@ -0,0 +1,225 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.weaver.excel.formula.api.entity.ExpressFormula; +//import com.weaver.excel.formula.api.entity.FormulaVar; +//import com.weaver.hrm.salary.constant.SalaryFormulaFieldConstant; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobItemPO; +//import com.weaver.hrm.salary.enums.SalaryFormulaReferenceEnum; +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.curator.shaded.com.google.common.collect.Maps; +// +//import java.util.*; +//import java.util.regex.Matcher; +//import java.util.regex.Pattern; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算-薪资项目运算优先级 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2/7/22 2:49 PM +// * @version:v1.0 +// */ +//public class SalaryAcctCalculatePriorityBO { +// +// /** +// * 公式中变量的fieldId的正则表达式 +// */ +// private static final String SALARY_REGEX = "(\\w+)" + SalaryFormulaFieldConstant.FIELD_ID_SEPARATOR + "(\\w+)"; +// +// /** +// * 解析公式中变量的fieldId的正则表达式 +// */ +// private static final Pattern SALARY_PATTERN = Pattern.compile(SALARY_REGEX); +// +// /** +// * 计算优先级 +// * +// * @param salarySobItems +// * @param salaryItems +// * @param expressFormulas +// * @return 根据计算优先级已经排好序,集合中是薪资账套中的薪资项目 +// */ +// public static List> calculatePriority(List salarySobItems, +// List salaryItems, +// List expressFormulas) { +// // 公式详情 +// Map> formulaIdKeyMap = ExpressFormulaBO.buildFormulaVar(expressFormulas); +// // key:薪资项目的id,value:薪资项目的po +// Map salaryItemPOMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); +// // key:薪资项目的code,value:薪资项目的po +// Map codeKeySalaryItemPOMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getCode); +// // key:薪资项目的id,value:薪资账套下的薪资项目副本的po +// Map salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemId); +// Map salaryItemIdWithPriorityMap = Maps.newHashMapWithExpectedSize(salarySobItems.size()); +// for (SalarySobItemPO salarySobItem : salarySobItems) { +// calculate(salarySobItem.getSalaryItemId(), salaryItemPOMap, codeKeySalaryItemPOMap, salaryItemIdKeySalarySobItemPOMap, formulaIdKeyMap, salaryItemIdWithPriorityMap, null); +// } +// return SalaryEntityUtil.group2Map(salaryItemIdWithPriorityMap.values(), SalaryItemIdWithPriority::getPriority).values().stream() +// .sorted(Comparator.comparingInt(list -> list.get(0).getPriority())) +// .map(list -> SalaryEntityUtil.properties(list, SalaryItemIdWithPriority::getSalaryItemId, Collectors.toList())) +// .collect(Collectors.toList()); +// } +// +// +// /** +// * 计算薪资账套中的薪资项目的计算优先级 +// * +// * @param currentSalaryItemId +// * @param salaryItemPOMap +// * @param salaryItemIdKeySalarySobItemPOMap +// * @param codeKeySalaryItemPOMap +// * @param formulaIdKeyMap +// * @param salaryItemIdWithPriorityMap +// * @param pre +// */ +// private static void calculate(Long currentSalaryItemId, +// Map salaryItemPOMap, +// Map codeKeySalaryItemPOMap, +// Map salaryItemIdKeySalarySobItemPOMap, +// Map> formulaIdKeyMap, +// Map salaryItemIdWithPriorityMap, +// SalaryItemIdWithPriority pre) { +// List salaryItemIds = Lists.newArrayList(); +// // 获取公式详情 +// List formulaVars; +// if (salaryItemIdKeySalarySobItemPOMap.containsKey(currentSalaryItemId)) { +// // 如果薪资项目在薪资账套中有副本,则取薪资账套中设置的公式 +// SalarySobItemPO salarySobItemPO = salaryItemIdKeySalarySobItemPOMap.get(currentSalaryItemId); +// formulaVars = formulaIdKeyMap.getOrDefault(salarySobItemPO.getFormulaId(), Collections.emptyList()); +// } else { +// // 如果薪资项目在薪资账套中没有有副本,则取薪资项目中设置的公式 +// SalaryItemPO salaryItemPO = salaryItemPOMap.get(currentSalaryItemId); +// formulaVars = formulaIdKeyMap.getOrDefault(salaryItemPO.getFormulaId(), Collections.emptyList()); +// } +// // 解析公式详情中的变量,找出引用了哪些其他的薪资项目(需要先计算出引用的薪资项目才能计算当前的薪资项目) +// for (FormulaVar formulaVar : formulaVars) { +// String fieldId = formulaVar.getFieldId(); +// if (StringUtils.isEmpty(fieldId)) { +// continue; +// } +// Matcher matcher = SALARY_PATTERN.matcher(fieldId); +// if (matcher.find()) { +// SalaryFormulaReferenceEnum referenceEnum = SalaryFormulaReferenceEnum.parseByValue(matcher.group(1)); +// if (referenceEnum == SalaryFormulaReferenceEnum.SALARY_ITEM) { +// SalaryItemPO salaryItemPO = codeKeySalaryItemPOMap.get(matcher.group(2)); +// if (salaryItemPO == null) { +// continue; +// } +// salaryItemIds.add(salaryItemPO.getId()); +// } +// } +// } +// if (CollectionUtils.isEmpty(salaryItemIds)) { +// SalaryItemIdWithPriority current = salaryItemIdWithPriorityMap.computeIfAbsent(currentSalaryItemId, k -> SalaryItemIdWithPriority.builder() +// .priority(0) +// .salaryItemId(currentSalaryItemId) +// .preList(Collections.emptyList()) +// .build()); +// addPre(current, pre, salaryItemPOMap); +// updatePriority(current); +// return; +// } +// for (Long salaryItemId : salaryItemIds) { +// SalaryItemIdWithPriority current = salaryItemIdWithPriorityMap.computeIfAbsent(currentSalaryItemId, k -> SalaryItemIdWithPriority.builder() +// .priority(1) +// .salaryItemId(currentSalaryItemId) +// .preList(Collections.emptyList()) +// .build()); +// addPre(current, pre, salaryItemPOMap); +// updatePriority(current); +// calculate(salaryItemId, salaryItemPOMap, codeKeySalaryItemPOMap, salaryItemIdKeySalarySobItemPOMap, formulaIdKeyMap, salaryItemIdWithPriorityMap, current); +// } +// } +// +// /** +// * 薪资项目被哪些薪资项目引用 +// * +// * @param current +// * @param pre +// */ +// private static void addPre(SalaryItemIdWithPriority current, SalaryItemIdWithPriority pre, Map salaryItemPOMap) { +// if (pre == null) { +// return; +// } +// checkLoop(current, pre, salaryItemPOMap); +// if (CollectionUtils.isEmpty(current.getPreList())) { +// current.setPreList(Lists.newArrayList(pre)); +// } else { +// boolean isExist = current.getPreList().stream().anyMatch(e -> Objects.equals(e.getSalaryItemId(), pre.getSalaryItemId())); +// if (!isExist) { +// current.getPreList().add(pre); +// } +// } +// } +// +// /** +// * 检查薪资项目之间是否存在相互引用 +// * +// * @param current +// */ +// private static void checkLoop(SalaryItemIdWithPriority current, SalaryItemIdWithPriority pre, Map salaryItemPOMap) { +// if (Objects.equals(pre.getSalaryItemId(), current.getSalaryItemId())) { +// SalaryItemPO preSalaryItemPO = salaryItemPOMap.get(pre.getSalaryItemId()); +// SalaryItemPO currentSalaryItemPO = salaryItemPOMap.get(current.getSalaryItemId()); +// String errMsg = SalaryI18nUtil.getI18nLabel(101426, "{0}和{1}的公式中存在相互引用") +// .replace("{0}", Optional.ofNullable(preSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) +// .replace("{1}", Optional.ofNullable(currentSalaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)); +// throw new SalaryRunTimeException(errMsg); +// } +// if (CollectionUtils.isEmpty(pre.getPreList())) { +// return; +// } +// for (SalaryItemIdWithPriority salaryItemIdWithPriority : pre.getPreList()) { +// checkLoop(current, salaryItemIdWithPriority, salaryItemPOMap); +// } +// } +// +// /** +// * 更新薪资账套中的薪资项目的计算优先级 +// * +// * @param current +// */ +// private static void updatePriority(SalaryItemIdWithPriority current) { +// List preList = current.getPreList(); +// if (CollectionUtils.isEmpty(preList)) { +// return; +// } +// preList.stream() +// .filter(e -> e.getPriority() <= current.getPriority()) +// .forEach(e -> e.setPriority(current.getPriority() + 1)); +// } +// +// +// @Data +// @Builder +// @NoArgsConstructor +// @AllArgsConstructor +// private static class SalaryItemIdWithPriority { +// +// /** +// * 薪资账套中的薪资项目的计算优先级(数字越小,计算优先级越高,从0开始计算) +// */ +// private Integer priority; +// +// /** +// * 薪资项目的id +// */ +// private Long salaryItemId; +// +// /** +// * 当前层级中的上层 +// */ +// private List preList; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCheckBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCheckBO.java new file mode 100644 index 000000000..d14a592f7 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctCheckBO.java @@ -0,0 +1,81 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.weaver.excel.formula.api.entity.ExpressFormula; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobCheckRulePO; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.experimental.Accessors; +// +//import java.util.List; +//import java.util.concurrent.BlockingDeque; +//import java.util.concurrent.CountDownLatch; +// +///** +// * @description: 薪资核算-校验 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2/7/22 11:06 AM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//public class SalaryAcctCheckBO { +// +// /** +// * 当前薪资核算记录 +// */ +// private SalaryAcctRecordPO salaryAcctRecordPO; +// +// /** +// * 本次运算所用的薪资账套下的校验规则 +// */ +// private List salarySobCheckRulePOS; +// +// /** +// * 本次运算涉及的所有公式 +// */ +// private List expressFormulas; +// +// /** +// * 租户下所有的薪资项目 +// */ +// private List salaryItemPOS; +// +// /** +// * 本次运算的薪资核算人员 +// */ +// private List salaryAcctEmployeePOS; +// +// /** +// * 核算结果临时表中的key +// */ +// private String calculateKey; +// +// /** +// * 监视子线程运算结果 +// */ +// private CountDownLatch childMonitor; +// +// /** +// * 所有子线程的运算结果 +// */ +// private BlockingDeque results; +// +// @Data +// @AllArgsConstructor +// public static class Result { +// +// /** +// * 子线程是否运算成功 +// */ +// private boolean status; +// +// /** +// * 子线程元算失败的错误信息 +// */ +// private String errMsg; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctConsolidatedTaxBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctConsolidatedTaxBO.java new file mode 100644 index 000000000..33bb0a0d5 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctConsolidatedTaxBO.java @@ -0,0 +1,91 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.weaver.hrm.salary.constant.TaxDeclarationDataIndexConstant; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctResultPO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import org.apache.commons.lang3.StringUtils; +// +//import java.math.BigDecimal; +//import java.util.List; +//import java.util.Objects; +//import java.util.Optional; +// +//public class SalaryAcctConsolidatedTaxBO { +// +// /** +// * 处理合并计税的字段的值 +// * +// * @param resultValue 本次薪资核算的结果 +// * @param salaryItem 当前正在核算的薪资项目 +// * @param salaryItems 系统内所有的薪资项目 +// * @param salaryAcctResults 其他设计合并计税的薪资核算结果 +// * @return +// */ +// public static String handleConsolidatedTaxValue(String resultValue, +// SalaryItemPO salaryItem, +// List salaryItems, +// List salaryAcctResults) { +// // 社保福利的当月值都是0 +// List welfareDataIndexList = Lists.newArrayList(TaxDeclarationDataIndexConstant.ENDOWMENT_INSURANCE, +// TaxDeclarationDataIndexConstant.MEDICAL_INSURANCE, +// TaxDeclarationDataIndexConstant.UNEMPLOYMENT_INSURANCE, +// TaxDeclarationDataIndexConstant.HOUSING_PROVIDENT_FUND, +// TaxDeclarationDataIndexConstant.SOCIAL_SECURITY_TOTAL, +// TaxDeclarationDataIndexConstant.ACCUMULATION_FUND_TOTAL, +// TaxDeclarationDataIndexConstant.SPECIAL_DEDUCTION); +// if (welfareDataIndexList.contains(salaryItem.getCode())) { +// return BigDecimal.ZERO.toPlainString(); +// } +// // 专项附加扣除的当月值都是0 +// List speAddiDeductionDataIndexList = Lists.newArrayList(TaxDeclarationDataIndexConstant.ADD_UP_CHILD_EDUCATION, +// TaxDeclarationDataIndexConstant.ADD_UP_HOUSING_LOAN_INTEREST, +// TaxDeclarationDataIndexConstant.ADD_UP_HOUSING_RENT, +// TaxDeclarationDataIndexConstant.ADD_UP_CONTINUING_EDUCATION, +// TaxDeclarationDataIndexConstant.ADD_UP_SUPPORT_ELDERLY, +// TaxDeclarationDataIndexConstant.ADD_UP_ILLNESS_MEDICAL); +// if (speAddiDeductionDataIndexList.contains(salaryItem.getCode())) { +// return BigDecimal.ZERO.toPlainString(); +// } +// // 本月(次)减除费用也是0 +// if (TaxDeclarationDataIndexConstant.SUBTRACTION.equals(salaryItem.getCode())) { +// return BigDecimal.ZERO.toPlainString(); +// } +// // 当前累计减除费用、当前累计专项扣除合计、当前累计专项附加扣除合计 +// if (TaxDeclarationDataIndexConstant.ADD_UP_SUBTRACTION.equals(salaryItem.getCode()) +// || TaxDeclarationDataIndexConstant.ADD_UP_SPECIAL_DEDUCTION.equals(salaryItem.getCode()) +// || TaxDeclarationDataIndexConstant.ADD_UP_SPE_ADDI_DEDUCTION.equals(salaryItem.getCode())) { +// return salaryAcctResults.stream() +// .filter(e -> Objects.equals(e.getSalaryItemId(), salaryItem.getId())) +// .map(SalaryAcctResultPO::getResultValue) +// .findFirst() +// .orElse(""); +// } +// // 当前累计收入 = 累计值 + 本次收入 + 上几次收入 +// if (TaxDeclarationDataIndexConstant.ADD_UP_INCOME.equals(salaryItem.getCode())) { +// Optional optional = salaryItems.stream().filter(e -> StringUtils.equals(e.getCode(), "income")).map(SalaryItemPO::getId).findAny(); +// if (!optional.isPresent()) { +// return ""; +// } +// BigDecimal income = salaryAcctResults.stream() +// .filter(e -> Objects.equals(e.getSalaryItemId(), optional.get())) +// .map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue())) +// .reduce(BigDecimal.ZERO, BigDecimal::add); +// return new BigDecimal(resultValue).add(income).toPlainString(); +// } +// // 当前累计已扣缴税额合计 = 累计值 + 上几次预扣预缴个税 +// if (TaxDeclarationDataIndexConstant.ADD_UP_ADVANCE_TAX.equals(salaryItem.getCode())) { +// Optional optional = salaryItems.stream().filter(e -> StringUtils.equals(e.getCode(), "refundedOrSupplementedTax")).map(SalaryItemPO::getId).findAny(); +// if (!optional.isPresent()) { +// return ""; +// } +// BigDecimal refundedOrSupplementedTax = salaryAcctResults.stream() +// .filter(e -> Objects.equals(e.getSalaryItemId(), optional.get())) +// .map(e -> SalaryEntityUtil.empty2Zero(e.getResultValue())) +// .reduce(BigDecimal.ZERO, BigDecimal::add); +// return new BigDecimal(resultValue).add(refundedOrSupplementedTax).toPlainString(); +// } +// return resultValue; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java new file mode 100644 index 000000000..62d6e9e3f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java @@ -0,0 +1,123 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.google.common.collect.Sets; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAccEmployeeListDTO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO; +//import com.weaver.hrm.salary.entity.salaryarchive.dto.SalaryArchiveTaxAgentDataDTO; +//import com.weaver.hrm.salary.entity.salaryarchive.po.TaxAgentPO; +//import com.weaver.hrm.salary.util.SalaryDateUtil; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.StringUtils; +// +//import java.time.LocalDateTime; +//import java.util.*; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算人员 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/21/22 4:20 PM +// * @version:v1.0 +// */ +//public class SalaryAcctEmployeeBO { +// +// /** +// * 将薪资核算人员po转换成薪资核算人员列表dto +// * +// * @param salaryAccountingEmployees +// * @param taxAgents +// * @param simpleEmployees +// * @return +// */ +// public static List convert2EmployeeListDTO(List salaryAccountingEmployees, +// List taxAgents, +// List simpleEmployees) { +// if (CollectionUtils.isEmpty(salaryAccountingEmployees)) { +// return Collections.emptyList(); +// } +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); +// Map simpleEmployeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getId); +// return salaryAccountingEmployees.stream() +// .map(e -> { +// SimpleEmployee simpleEmployee = simpleEmployeeMap.get(e.getEmployeeId()); +// if (simpleEmployee == null) { +// return SalaryAccEmployeeListDTO.builder() +// .id(e.getId()) +// .employeeId(e.getId()) +// .taxAgentId(e.getTaxAgentId()) +// .taxAgentName(taxAgentNameMap.getOrDefault(e.getTaxAgentId(), StringUtils.EMPTY)) +// .build(); +// } +// return SalaryAccEmployeeListDTO.builder() +// .id(e.getId()) +// .employeeId(simpleEmployee.getEmployeeId()) +// .employeeName(simpleEmployee.getUsername()) +// .taxAgentId(e.getTaxAgentId()) +// .taxAgentName(taxAgentNameMap.getOrDefault(e.getTaxAgentId(), StringUtils.EMPTY)) +// .departmentId(simpleEmployee.getDepartment().getId()) +// .departmentName(simpleEmployee.getDepartment().getName()) +// .status(simpleEmployee.getStatus().getDescription()) +// .mobile(simpleEmployee.getMobile()) +// .jobNum(simpleEmployee.getJobNum()) +// .hireDate(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getHiredate())) +// .dismissDate("") +// .build(); +// }).collect(Collectors.toList()); +// } +// +// /** +// * 转换成薪资核算人员的po +// * +// * @param employeeIds +// * @param salaryAcctRecord +// * @param salaryArchiveTaxAgentData +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public static List convert2EmployeePO(Collection employeeIds, +// SalaryAcctRecordPO salaryAcctRecord, +// List salaryArchiveTaxAgentData, +// Long employeeId, String tenantKey) { +// if (CollectionUtils.isEmpty(employeeIds)) { +// return Collections.emptyList(); +// } +// List resultList = Lists.newArrayList(); +// Map>> empIdKeyTaxAgentMap = SalaryEntityUtil.group2Map(salaryArchiveTaxAgentData, SalaryArchiveDataDTO::getEmployeeId, SalaryArchiveDataDTO::getTaxAgents); +// LocalDateTime now = LocalDateTime.now(); +// for (Long id : employeeIds) { +// Set taxAgentIds = Sets.newHashSet(); +// Set> taxAgentSet = empIdKeyTaxAgentMap.getOrDefault(id, Collections.emptySet()); +// for (List taxAgents : taxAgentSet) { +// taxAgentIds.addAll(SalaryEntityUtil.properties(taxAgents, SalaryArchiveTaxAgentDataDTO::getTaxAgentId)); +// } +// if (CollectionUtils.isEmpty(taxAgentIds)) { +// taxAgentIds.add(0L); +// } +// for (Long taxAgentId : taxAgentIds) { +// SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder() +// .id(IdGenerator.generate()) +// .salaryAcctRecordId(salaryAcctRecord.getId()) +// .salarySobId(salaryAcctRecord.getSalarySobId()) +// .salaryMonth(salaryAcctRecord.getSalaryMonth()) +// .employeeId(id) +// .taxAgentId(taxAgentId) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .deleteType(0) +// .tenantKey(tenantKey) +// .build(); +// resultList.add(salaryAcctEmployee); +// } +// } +// return resultList; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctFormulaBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctFormulaBO.java new file mode 100644 index 000000000..6b290c9ee --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctFormulaBO.java @@ -0,0 +1,91 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.weaver.framework.util.JsonUtil; +//import com.weaver.hrm.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.enums.SalaryRoundingModeEnum; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.util.SalaryDateUtil; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import com.weaver.teams.api.user.Sex; +//import com.weaver.teams.domain.position.SimplePosition; +//import com.weaver.teams.domain.user.Grade; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.lang3.StringUtils; +// +//import java.math.BigDecimal; +//import java.math.RoundingMode; +//import java.util.Collections; +//import java.util.Map; +//import java.util.Objects; +//import java.util.Optional; +// +///** +// * @description: 薪资核算公式变量 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/8/21 3:40 PM +// * @version:v1.0 +// */ +//public class SalaryAcctFormulaBO { +// +// /** +// * 对核算结果做舍入操作 +// * +// * @param value +// * @param salaryItem +// * @return +// */ +// public static String roundResultValue(String value, SalaryItemPO salaryItem) { +// // 值为空,不需要四舍五入 +// if (StringUtils.isEmpty(value) || salaryItem == null) { +// return StringUtils.EMPTY; +// } +// // 薪资项目字段类型为string,无需四舍五入 +// SalaryDataTypeEnum dataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItem.getDataType()); +// if (dataTypeEnum == SalaryDataTypeEnum.STRING) { +// return value; +// } +// BigDecimal bigDecimalValue = SalaryEntityUtil.empty2Zero(value); +// RoundingMode roundingMode = RoundingMode.HALF_UP; +// if (Objects.equals(salaryItem.getRoundingMode(), SalaryRoundingModeEnum.ROUND_UP.getValue())) { +// roundingMode = RoundingMode.UP; +// } +// if (Objects.equals(salaryItem.getRoundingMode(), SalaryRoundingModeEnum.ROUND_DOWN.getValue())) { +// roundingMode = RoundingMode.DOWN; +// } +// return bigDecimalValue.setScale(salaryItem.getPattern(), roundingMode).toPlainString(); +// } +// +// /** +// * 变量中的人员信息 +// * +// * @param simpleEmployee +// * @return +// */ +// public static Map convert2FormulaEmployee(SimpleEmployee simpleEmployee) { +// if (simpleEmployee == null) { +// return Collections.emptyMap(); +// } +// String sexName = Optional.ofNullable(simpleEmployee.getSex()) +// .map(sex -> sex == Sex.male ? SalaryI18nUtil.getI18nLabel(102440, "男") +// : SalaryI18nUtil.getI18nLabel(102442, "女")) +// .orElse(StringUtils.EMPTY); +// SalaryFormulaEmployeeDTO formulaEmployee = SalaryFormulaEmployeeDTO.builder() +// .employeeId(simpleEmployee.getEmployeeId()) +// .username(simpleEmployee.getUsername()) +// .email(simpleEmployee.getEmail()) +// .mobile(simpleEmployee.getMobile()) +// .telephone(simpleEmployee.getTelephone()) +// .sex(sexName) +// .status(simpleEmployee.getStatus().getDescription()) +// .departmentName(simpleEmployee.getDepartment().getName()) +// .positionName(Optional.ofNullable(simpleEmployee.getPosition()).map(SimplePosition::getName).orElse("")) +// .gradeName(Optional.ofNullable(simpleEmployee.getGrade()).map(Grade::getName).orElse("")) +// .hireDate(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getHiredate())) +// .birthday(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getBirthdayDate())) +// .build(); +// return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class); +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java new file mode 100644 index 000000000..7a571d64a --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -0,0 +1,138 @@ +package com.engine.salary.entity.salaryacct.bo; + +import com.engine.salary.constant.SalaryDefaultTenantConstant; +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; +import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordListDTO; +import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @description: 薪资核算 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/1/21 2:10 PM + * @version:v1.0 + */ +public class SalaryAcctRecordBO { + + /** + * 将薪资核算记录po转换成薪资核算记录列表dto + * + * @param salaryAcctRecordPOS + * @param salarySobs + * @param employeeComInfos + * @param salaryAcctEmployeeCountDTOS + * @return + */ + public static List convert2ListDTO(List salaryAcctRecordPOS, + List salarySobs, + List employeeComInfos, + List salaryAcctEmployeeCountDTOS) { + if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { + return Collections.emptyList(); + } + Map salarySobMap = SalaryEntityUtil.convert2Map(salarySobs, SalarySobPO::getId); + Map usernameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); + Map empSizeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeeCountDTOS, SalaryAcctEmployeeCountDTO::getSalaryAcctRecordId, SalaryAcctEmployeeCountDTO::getCountBySalaryAcctRecordId); + return salaryAcctRecordPOS.stream() + .map(salaryAcctRecordPO -> { + SalarySobPO salarySobPO = salarySobMap.get(salaryAcctRecordPO.getSalarySobId()); + SalaryAcctRecordStatusEnum salaryAcctRecordStatusEnum = SalaryAcctRecordStatusEnum.parseByValue(salaryAcctRecordPO.getStatus()); + return SalaryAcctRecordListDTO.builder() + .id(salaryAcctRecordPO.getId()) + .salarySobName(Optional.ofNullable(salarySobPO).map(SalarySobPO::getName).orElse(StringUtils.EMPTY)) + .salaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString()) + .taxCycle(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getTaxCycle()).toString()) + .status(Optional.ofNullable(salaryAcctRecordStatusEnum) + .map(o -> SalaryI18nUtil.getI18nLabel(o.getLabelId(), o.getDefaultLabel())) + .orElse(StringUtils.EMPTY)) + .acctTimes(salaryAcctRecordPO.getAcctTimes()) + .acctTimesViable(salaryAcctRecordPO.getAcctTimes() >= 1) + .employeeSize(empSizeMap.getOrDefault(salaryAcctRecordPO.getId(), NumberUtils.LONG_ZERO)) + .accountantName(usernameMap.getOrDefault(salaryAcctRecordPO.getCreator(), StringUtils.EMPTY)) + .updateTime(SalaryDateUtil.getFormatLocalDateTime(salaryAcctRecordPO.getUpdateTime())) + .description(salaryAcctRecordPO.getDescription()) + .build(); + }).collect(Collectors.toList()); + } + + /** + * 将薪资核算保存参数转换成薪资核算记录po + * + * @param saveParam + * @param salarySobCycle + * @param acctTimes + * @param employeeId + * @return + */ + public static SalaryAcctRecordPO convert2PO(SalaryAcctRecordSaveParam saveParam, + SalarySobCycleDTO salarySobCycle, + int acctTimes,Long employeeId) { + Date now = new Date(); + return new SalaryAcctRecordPO() +// .setId(IdGenerator.generate()) + .setSalaryMonth(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))) + .setTaxCycle(SalaryDateUtil.localDateToDate(salarySobCycle.getTaxCycle().atDay(1))) + .setSalarySobId(saveParam.getSalarySobId()) + .setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()) + .setAcctTimes(acctTimes + 1) + .setDescription(saveParam.getDescription()) + .setDeleteType(NumberUtils.INTEGER_ZERO) + .setCreator(employeeId) + .setCreateTime(now) + .setUpdateTime(now) + .setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + } + + /** + * 重新计算薪资核算记录的核算次数 + * + * @param deletedSalaryAcctRecordPOS 已经删除的薪资核算记录 + * @param toUpdateAcctTimesRecordPOS 待更新核算次数的薪资核算记录 + * @return + */ + public static List updateAcctTimes(List deletedSalaryAcctRecordPOS, + List toUpdateAcctTimesRecordPOS) { + if (CollectionUtils.isEmpty(toUpdateAcctTimesRecordPOS)) { + return Collections.emptyList(); + } + Date now = new Date(); + List resultList = Lists.newArrayListWithExpectedSize(toUpdateAcctTimesRecordPOS.size()); + // 已经删除的薪资核算记录id + Set deletedSalaryAcctRecordIds = SalaryEntityUtil.properties(deletedSalaryAcctRecordPOS, SalaryAcctRecordPO::getId); + // 已经删除的薪资核算记录组成的key集合(薪资账套id+薪资所属月) + Set deletedKeySet = SalaryEntityUtil.properties(deletedSalaryAcctRecordPOS, salaryAcctRecordPO -> + salaryAcctRecordPO.getSalarySobId() + SalaryDateUtil.getFormatYearMonth(salaryAcctRecordPO.getSalaryMonth())); + // 按照(薪资账套id+薪资所属月)作为key聚合而成的待更新核算次数的薪资核算记录map + Map> toUpdateAcctTimesRecordPOMap = SalaryEntityUtil.group2Map(toUpdateAcctTimesRecordPOS, salaryAcctRecordPO -> + salaryAcctRecordPO.getSalarySobId() + SalaryDateUtil.getFormatYearMonth(salaryAcctRecordPO.getSalaryMonth())); + for (String key : deletedKeySet) { + List salaryAcctRecordPOS = toUpdateAcctTimesRecordPOMap.getOrDefault(key, Collections.emptyList()) + .stream() + .filter(salaryAcctRecordPO -> !deletedSalaryAcctRecordIds.contains(salaryAcctRecordPO.getId())) + .sorted(Comparator.comparingLong(salaryAcctRecordPO -> SalaryDateUtil.localDateTime2EpochMilli(salaryAcctRecordPO.getCreateTime()))) + .collect(Collectors.toList()); + int acctTimes = 1; + for (SalaryAcctRecordPO salaryAcctRecordPO : salaryAcctRecordPOS) { + salaryAcctRecordPO.setAcctTimes(acctTimes++); + salaryAcctRecordPO.setUpdateTime(now); + resultList.add(salaryAcctRecordPO); + } + } + return resultList; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java new file mode 100644 index 000000000..2968253b1 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -0,0 +1,521 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.google.common.collect.Maps; +//import com.weaver.common.component.constant.WeaAlignEnum; +//import com.weaver.common.component.form.WeaForm; +//import com.weaver.common.component.form.item.WeaFormItem; +//import com.weaver.common.component.form.item.WeaFormItemType; +//import com.weaver.common.component.form.layout.WeaFormLayout; +//import com.weaver.common.component.table.WeaTable; +//import com.weaver.common.component.table.column.WeaTableColumn; +//import com.weaver.common.component.table.type.WeaTableTypeEnum; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.common.i18n.label.SystemEnv; +//import com.weaver.hrm.salary.annotation.SalaryFormulaVar; +//import com.weaver.hrm.salary.common.WeaTableColumnWapper; +//import com.weaver.hrm.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctEmployeeInfoDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; +//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; +//import com.weaver.hrm.salary.entity.salaryacct.po.*; +//import com.weaver.hrm.salary.entity.salaryarchive.po.TaxAgentPO; +//import com.weaver.hrm.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO; +//import com.weaver.hrm.salary.entity.salaryitem.po.SalaryItemPO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobEmpFieldDTO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobItemDTO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobItemGroupDTO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobEmpFieldPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobItemPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobPO; +//import com.weaver.hrm.salary.enums.salaryitem.SalaryDataTypeEnum; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.commons.lang3.math.NumberUtils; +//import org.springframework.beans.BeanUtils; +// +//import java.lang.reflect.Field; +//import java.time.LocalDateTime; +//import java.util.*; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算结果 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/6/21 7:05 PM +// * @version:v1.0 +// */ +//public class SalaryAcctResultBO { +// +// /** +// * 数据类型的后悔标识 +// * 为了展示千分位,薪资核算结果列表、线上线下对比结果列表需要返回给前端列表字段的数据类型,字段索引+后缀标识 +// */ +// private static final String DATA_TYPE_SUFFIX = "_type"; +// +// /** +// * 构建薪资核算结果列表的表头 +// * +// * @param salarySobItemAggregateDTO +// * @return +// */ +// public static List buildTableColumns4ComparisonResult(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Set excludeSalaryItemIds) { +// List columns = Lists.newArrayList(); +// // 员工信息字段 +// for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { +// columns.add(new WeaTableColumnWapper(salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), salarySobEmpFieldDTO.getFieldId())); +// } +// // 薪资项目分组下的薪资项目 +// for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { +// if (CollectionUtils.isEmpty(salarySobItemGroupDTO.getItems())) { +// continue; +// } +// for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { +// if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { +// continue; +// } +// columns.add(new WeaTableColumnWapper(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), "" + salarySobItemDTO.getSalaryItemId())); +// } +// } +// // 没有分类的薪资项目 +// for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { +// if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { +// continue; +// } +// columns.add(new WeaTableColumnWapper(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), "" + salarySobItemDTO.getSalaryItemId())); +// } +// return columns; +// } +// +// /** +// * 构建薪资核算结果列表的表头 +// * +// * @param salarySobItemAggregateDTO +// * @return +// */ +// public static List buildTableColumns(SalarySobItemAggregateDTO salarySobItemAggregateDTO) { +// List columns = Lists.newArrayList(); +// // 员工信息字段 +// for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { +// columns.add(new WeaTableColumnWapper(salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), salarySobEmpFieldDTO.getFieldId())); +// } +// // 薪资项目分组下的薪资项目 +// for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { +// if (CollectionUtils.isEmpty(salarySobItemGroupDTO.getItems())) { +// continue; +// } +// WeaTableColumnWapper weaTableColumnWapper = new WeaTableColumnWapper(salarySobItemGroupDTO.getName(), +// String.valueOf(salarySobItemGroupDTO.getId()), "150", WeaAlignEnum.LEFT.getStringVal(), String.valueOf(salarySobItemGroupDTO.getId())); +// List childrenColumns = Lists.newArrayList(); +// for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { +// childrenColumns.add(new WeaTableColumnWapper(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), "" + salarySobItemDTO.getSalaryItemId())); +// } +// weaTableColumnWapper.setChildren(childrenColumns); +// columns.add(weaTableColumnWapper); +// } +// // 没有分类的薪资项目 +// for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { +// columns.add(new WeaTableColumnWapper(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "150", +// WeaAlignEnum.LEFT.getStringVal(), WeaAlignEnum.LEFT.getStringVal(), "" + salarySobItemDTO.getSalaryItemId())); +// } +// return columns; +// } +// +// /** +// * 转船成薪资核算结果列表的表格数据 +// * +// * @param salaryItems +// * @param salarySobEmpFields +// * @param simpleEmployees +// * @param salaryAcctEmployees +// * @param salaryAccountingResults +// * @param taxAgents +// * @param consolidatedTaxSalaryAcctEmpIds +// * @return +// */ +// public static List> buildTableData(List salaryItems, +// List salarySobEmpFields, +// List simpleEmployees, +// List salaryAcctEmployees, +// List salaryAccountingResults, +// List taxAgents, +// Set consolidatedTaxSalaryAcctEmpIds, +// Map customParameters) { +// if (CollectionUtils.isEmpty(salaryAcctEmployees)) { +// return Collections.emptyList(); +// } +// Map employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// Map> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getEmployeeId); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); +// return salaryAcctEmployees.stream().map(e -> { +// Map resultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(e.getEmployeeId(), Collections.emptyList()), +// SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); +// // 薪资项目的值 +// Map map = SalaryEntityUtil.convert2Map(salaryItems, o -> "" + o.getId(), o -> resultValueMap.getOrDefault(o.getId(), StringUtils.EMPTY)); +// // 薪资项目的字段类型(前端依据这个判断是否需要展示千分位) +// Map dataTypeMap = SalaryEntityUtil.convert2Map(salaryItems, salaryItemPO -> salaryItemPO.getId() + DATA_TYPE_SUFFIX, SalaryItemPO::getDataType); +// map.putAll(dataTypeMap); +// // 人员信息字段的值 +// Map fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId())); +// for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) { +// map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode())); +// // 员工信息字段的字段类型 +// map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue()); +// } +// // 主键id +// map.put("id", e.getId()); +// // 个税扣缴义务人 +// String taxAgentName = taxAgentNameMap.getOrDefault(e.getTaxAgentId(), StringUtils.EMPTY); +// map.put("taxAgentName", taxAgentName); +// // 是否属于"合并计税"的标记 +// map.put("consolidatedTaxation", StringUtils.isNotEmpty(taxAgentName) && consolidatedTaxSalaryAcctEmpIds.contains(e.getId())); +// // 个税扣缴义务人的字段类型 +// map.put("taxAgentName" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue()); +// // 公式详情 +// map.put("customParameters", customParameters); +// return map; +// }).collect(Collectors.toList()); +// } +// +// /** +// * 转转成薪资核算线下对比结果 +// * +// * @param salaryItems +// * @param salarySobEmpFields +// * @param simpleEmployees +// * @param salaryAcctEmployees +// * @param salaryAcctResultPOS +// * @param excelAcctResultPOS +// * @param taxAgents +// * @param consolidatedTaxSalaryAcctEmpIds +// * @return +// */ +// public static List> buildComparisonTableData(List salaryItems, +// List salarySobEmpFields, +// List simpleEmployees, +// List salaryAcctEmployees, +// List salaryAcctResultPOS, +// List excelAcctResultPOS, +// List taxAgents, +// Map customParameters, +// Set consolidatedTaxSalaryAcctEmpIds, +// Set includeSalaryItemIds) { +// if (CollectionUtils.isEmpty(simpleEmployees)) { +// return Collections.emptyList(); +// } +// Map> excelResultMap = SalaryEntityUtil.group2Map(excelAcctResultPOS, ExcelAcctResultPO::getSalaryAcctEmpId); +// Map> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctEmpId); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName); +// Map employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId); +// List> resultList = Lists.newArrayListWithExpectedSize(salaryAcctEmployees.size()); +// for (SalaryAcctEmployeePO salaryAcctEmployee : salaryAcctEmployees) { +// // 线下值和系统值之间是否存在差异 +// boolean different = false; +// Map map = Maps.newHashMap(); +// // 员工信息字段的值 +// Map fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId())); +// for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) { +// map.put(salarySobEmpField.getFieldCode(), fieldValueMap.get(salarySobEmpField.getFieldCode())); +// // 员工信息字段的字段类型 +// map.put(salarySobEmpField.getFieldCode() + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue()); +// } +// // 系统值 +// Map acctResultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(salaryAcctEmployee.getId(), Collections.emptyList()), +// SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); +// // 线下值 +// Map excelResultValueMap = SalaryEntityUtil.convert2Map(excelResultMap.getOrDefault(salaryAcctEmployee.getId(), Collections.emptyList()), +// ExcelAcctResultPO::getSalaryItemId, ExcelAcctResultPO::getResultValue); +// // 薪资项目字段的值 +// for (SalaryItemPO salaryItem : salaryItems) { +// Map temp = Maps.newHashMap(); +// // 系统值 +// String acctResultValue = acctResultValueMap.get(salaryItem.getId()); +// // 线下值 +// String excelResultValue = excelResultValueMap.get(salaryItem.getId()); +// temp.put("acctResultValue", acctResultValue); +// temp.put("excelResultValue", excelResultValue); +// map.put(String.valueOf(salaryItem.getId()), temp); +// // 薪资项目字段的字段类型 +// map.put(salaryItem.getId() + DATA_TYPE_SUFFIX, salaryItem.getDataType()); +// SalaryDataTypeEnum dataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItem.getDataType()); +// if (dataTypeEnum == SalaryDataTypeEnum.STRING) { +// if (!StringUtils.equals(acctResultValue, excelResultValue)) { +// different = true; +// includeSalaryItemIds.add(salaryItem.getId()); +// } +// } else { +// if (SalaryEntityUtil.empty2Zero(acctResultValue).compareTo(SalaryEntityUtil.empty2Zero(excelResultValue)) != 0) { +// different = true; +// includeSalaryItemIds.add(salaryItem.getId()); +// } +// } +// } +// // 主键id +// map.put("id", salaryAcctEmployee.getId()); +// // 个税扣缴义务人 +// String taxAgentName = taxAgentNameMap.getOrDefault(salaryAcctEmployee.getTaxAgentId(), StringUtils.EMPTY); +// map.put("taxAgentName", taxAgentName); +// // 个税扣缴义务人的字段类型 +// map.put("taxAgentName" + DATA_TYPE_SUFFIX, SalaryDataTypeEnum.STRING.getValue()); +// // 是否属于"合并计税"的标记 +// map.put("consolidatedTaxation", StringUtils.isNotEmpty(taxAgentName) && consolidatedTaxSalaryAcctEmpIds.contains(salaryAcctEmployee.getId())); +// // 薪资项目的公式详情(前端需要展示) +// map.put("customParameters", customParameters); +// // 是否存在差异的标记 +// map.put("different", different); +// resultList.add(map); +// } +// return resultList; +// } +// +// /** +// * 转换成薪资核算结果详情dto +// * +// * @param simpleEmployee +// * @param taxAgentPO +// * @param salaryAcctEmployee +// * @param salarySobEmpFields +// * @param salarySobItemPOS +// * @param salaryItems +// * @param salaryAcctResults +// * @return +// */ +// public static SalaryAcctResultDetailDTO convert2DetailDTO(SimpleEmployee simpleEmployee, +// TaxAgentPO taxAgentPO, +// SalaryAcctEmployeePO salaryAcctEmployee, +// List salarySobEmpFields, +// List salarySobItemPOS, +// List salaryItems, +// List salaryAcctResults) { +// // 员工信息字段 +// Map employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee); +// // 个税扣缴义务人 +// employeeFieldValueMap.put("taxAgentName", Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY)); +// Map employeeFieldNameMap = buildEmployeeFieldName(); +// List employeeInfos = salarySobEmpFields.stream() +// .map(e -> SalaryAcctEmployeeInfoDTO.builder() +// .fieldName(employeeFieldNameMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY)) +// .fieldValue(employeeFieldValueMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY)) +// .build()) +// .collect(Collectors.toList()); +// // 薪资项目的值 +// Map resultValueMap = SalaryEntityUtil.convert2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue); +// Map salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId); +// // 公式项的值(不根据salaryItemPO的valueType判断是因为薪资项目的valueType属性改变后并不会同步更新薪资账套中的薪资项目的formulaId字段) +// List formulaItems = salarySobItemPOS.stream() +// .filter(salarySobItemPO -> salarySobItemPO.getFormulaId() > 0) +// .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap)) +// .collect(Collectors.toList()); +// // 输入/导入项目的值 +// List inputItems = salarySobItemPOS.stream() +// .filter(salarySobItemPO -> salarySobItemPO.getFormulaId() <= 0) +// .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap)) +// .collect(Collectors.toList()); +// return SalaryAcctResultDetailDTO.builder() +// .id(salaryAcctEmployee.getId()) +// .employeeId(salaryAcctEmployee.getEmployeeId()) +// .employeeInfos(employeeInfos) +// .formulaItems(formulaItems) +// .inputItems(inputItems) +// .build(); +// } +// +// /** +// * 转换成薪资核算结果详情dto +// * +// * @param salarySobItemPO +// * @param salaryItemPO +// * @param resultValueMap +// * @return +// */ +// private static SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO convert2SalaryAcctResultDetailItemDTO(SalarySobItemPO salarySobItemPO, +// SalaryItemPO salaryItemPO, +// Map resultValueMap) { +// // 薪资项目的数据类型 +// return SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO.builder() +// .salaryItemId(salarySobItemPO.getSalaryItemId()) +// .salaryItemName(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getName).orElse(StringUtils.EMPTY)) +// .resultValue(resultValueMap.getOrDefault(salarySobItemPO.getSalaryItemId(), StringUtils.EMPTY)) +// .dataType(Optional.ofNullable(salaryItemPO).map(SalaryItemPO::getDataType).orElse(SalaryDataTypeEnum.NUMBER.getValue())) +// .build(); +// } +// +// /** +// * 薪资核算结果保存参数转换成薪资核算结果po +// * +// * @param saveParam 前端保存参数 +// * @param salaryAcctEmployee 薪资核算人员po +// * @param employeeId 当前登陆人员id +// * @param tenantKey 租户key +// * @return +// */ +// public static List convert2PO(SalaryAcctResultSaveParam saveParam, +// SalaryAcctEmployeePO salaryAcctEmployee, +// Long employeeId, String tenantKey) { +// if (CollectionUtils.isEmpty(saveParam.getItems())) { +// return Collections.emptyList(); +// } +// LocalDateTime now = LocalDateTime.now(); +// return saveParam.getItems().stream() +// .map(e -> SalaryAcctResultPO.builder() +// .id(IdGenerator.generate()) +// .salarySobId(salaryAcctEmployee.getSalarySobId()) +// .salaryItemId(e.getSalaryItemId()) +// .salaryAcctRecordId(salaryAcctEmployee.getSalaryAcctRecordId()) +// .salaryAcctEmpId(salaryAcctEmployee.getId()) +// .employeeId(salaryAcctEmployee.getEmployeeId()) +// .taxAgentId(salaryAcctEmployee.getTaxAgentId()) +// .resultValue(e.getResultValue()) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .deleteType(NumberUtils.INTEGER_ZERO) +// .tenantKey(tenantKey) +// .build()) +// .collect(Collectors.toList()); +// } +// +// public static Map buildEmployeeFieldName() { +// Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields(); +// Map employeeFieldNameMap = Maps.newHashMapWithExpectedSize(declaredFields.length); +// for (Field declaredField : declaredFields) { +// if (!declaredField.isAnnotationPresent(SalaryFormulaVar.class)) { +// continue; +// } +// SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class); +// employeeFieldNameMap.put(declaredField.getName(), SystemEnv.getHtmlLabelName(annotation.labelId(), annotation.defaultLabel())); +// } +// return employeeFieldNameMap; +// } +// +// public static ConsolidatedTaxDetailDTO convert2ConsolidatedTaxDetailDTO(SimpleEmployee simpleEmployee, +// TaxAgentPO taxAgent, +// List salarySobEmpFields, +// List salaryItems, +// List salaryAcctEmployees, +// List salarySobs, +// List salaryAcctRecords, +// List salaryAcctResults) { +// return ConsolidatedTaxDetailDTO.builder() +// .employeeInfo(buildConsolidatedTaxationEmpInfo(simpleEmployee, taxAgent, salarySobEmpFields)) +// .salaryAcctResult(buildConsolidatedTaxationAcctResult(salaryItems, salaryAcctEmployees, salarySobs, salaryAcctRecords, salaryAcctResults)) +// .build(); +// } +// +// /** +// * 合并计税详情-员工信息 +// * +// * @param simpleEmployee +// * @param salarySobEmpFields +// * @return +// */ +// private static WeaForm buildConsolidatedTaxationEmpInfo(SimpleEmployee simpleEmployee, TaxAgentPO taxAgent, List salarySobEmpFields) { +// Map employeeFieldNameMap = buildEmployeeFieldName(); +// Map fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee); +// fieldValueMap.put("taxAgentName", taxAgent.getName()); +// Map data = Maps.newHashMap(); +// Map items = Maps.newHashMap(); +// List> layout = Lists.newArrayList(); +// List temp = Lists.newArrayList(); +// for (SalarySobEmpFieldPO field : salarySobEmpFields) { +// // 字段属性 +// WeaFormItem weaFormItem = new WeaFormItem(WeaFormItemType.INPUT); +// weaFormItem.setReadOnly(true); +// weaFormItem.setValue(fieldValueMap.getOrDefault(field.getFieldCode(), "")); +// items.put(field.getFieldCode(), weaFormItem); +// // 字段布局 +// if (temp.size() == 3) { +// layout.add(new ArrayList<>(temp)); +// temp = Lists.newArrayList(); +// } +// WeaFormLayout weaFormLayout = new WeaFormLayout(field.getFieldCode(), employeeFieldNameMap.getOrDefault(field.getFieldCode(), ""), new String[]{field.getFieldCode()}); +// temp.add(weaFormLayout); +// // 字段的值 +// data.put(field.getFieldCode(), weaFormItem.getValue()); +// } +// if (CollectionUtils.isNotEmpty(temp)) { +// layout.add(new ArrayList<>(temp)); +// } +// WeaForm weaForm = new WeaForm(); +// weaForm.setData(data); +// weaForm.setItems(items); +// weaForm.setLayout(layout); +// return weaForm; +// } +// +// +// /** +// * 合并计税详情-核算结果列表 +// * +// * @param salaryItems +// * @param salaryAcctResults +// * @return +// */ +// private static WeaTable> buildConsolidatedTaxationAcctResult(List salaryItems, +// List salaryAcctEmployees, +// List salarySobs, +// List salaryAcctRecords, +// List salaryAcctResults) { +// // 薪资核算人员 +// Map salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getId); +// // 薪资账套 +// Map salarySobNameMap = SalaryEntityUtil.convert2Map(salarySobs, SalarySobPO::getId, SalarySobPO::getName); +// // 薪资核算记录 +// Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId); +// // 薪资核算结果 +// Map> salaryAcctResultMap = SalaryEntityUtil.group2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryAcctEmpId); +// List weaTableColumns = Lists.newArrayList(new WeaTableColumn("核算批次", "salarySobName")); +// weaTableColumns.addAll(salaryItems.stream() +// .map(e -> new WeaTableColumn(e.getName(), "" + e.getId(), false)) +// .collect(Collectors.toList())); +// WeaTable> weaTable = new WeaTable<>(); +// weaTable.setTableType(WeaTableTypeEnum.NONE); +// weaTable.setCurrent(0); +// weaTable.setPageSize(salaryAcctResultMap.size()); +// weaTable.setTotal(salaryAcctResultMap.size()); +// weaTable.setColumns(weaTableColumns); +// if (CollectionUtils.isEmpty(salaryAcctResults)) { +// return weaTable; +// } +// List> data = Lists.newArrayList(); +// salaryAcctResultMap.forEach((k, v) -> { +// // 薪资核算的结果 +// Map valueMap = SalaryEntityUtil.convert2Map(v, e -> "" + e.getSalaryItemId(), SalaryAcctResultPO::getResultValue); +// // 核算批次 +// SalaryAcctEmployeePO salaryAcctEmployeePO = salaryAcctEmployeeMap.get(k); +// SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordMap.get(salaryAcctEmployeePO.getSalaryAcctRecordId()); +// String salarySobName = salarySobNameMap.getOrDefault(salaryAcctRecordPO.getSalarySobId(), ""); +// valueMap.put("salarySobName", "第" + salaryAcctRecordPO.getAcctTimes() + "次(" + salarySobName + ")"); +// data.add(valueMap); +// }); +// weaTable.setData(data); +// weaTable.setDisplayData(data); +// return weaTable; +// } +// +// /** +// * 薪资核算结果临时存储转成薪资核算结果po +// * +// * @param temps +// * @return +// */ +// public static List convert2ResultPO(Collection temps) { +// if (CollectionUtils.isEmpty(temps)) { +// return Collections.emptyList(); +// } +// return temps.stream().map(e -> { +// SalaryAcctResultPO salaryAcctResult = new SalaryAcctResultPO(); +// BeanUtils.copyProperties(e, salaryAcctResult); +// return salaryAcctResult; +// }).collect(Collectors.toList()); +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckBO.java new file mode 100644 index 000000000..c59364b26 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckBO.java @@ -0,0 +1,231 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.google.common.collect.Lists; +//import com.weaver.common.distribution.genid.IdGenerator; +//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctCheckParam; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryCheckResultDetailTempPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryCheckResultPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryCheckResultRecordPO; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import lombok.Data; +//import org.apache.commons.collections4.CollectionUtils; +// +//import java.time.LocalDateTime; +//import java.util.Collection; +//import java.util.List; +//import java.util.Map; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算校验 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/17/21 4:31 PM +// * @version:v1.0 +// */ +//public class SalaryCheckBO { +// +// /** +// * 原来的校验异常 +// */ +// private Collection oldCheckResults; +// +// /** +// * 原来的校验异常明细 +// */ +// private Collection oldCheckResultRecords; +// +// /** +// * 新的校验异常明细的临时存储数据 +// */ +// private Collection salaryCheckResultDetailTemps; +// +// public SalaryCheckBO(Collection oldCheckResults, +// Collection oldCheckResultRecords, +// Collection salaryCheckResultDetailTemps) { +// this.oldCheckResults = oldCheckResults; +// this.oldCheckResultRecords = oldCheckResultRecords; +// this.salaryCheckResultDetailTemps = salaryCheckResultDetailTemps; +// } +// +// /** +// * 处理校验异常明细的临时存储数据 +// * +// * @param checkParam +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// public Result handleSalaryCheckResultDetailTemp(SalaryAcctCheckParam checkParam, Long employeeId, String tenantKey) { +// Result result = new Result(); +// Map oldCheckResultMap = SalaryEntityUtil.convert2Map(oldCheckResults, SalaryCheckResultPO::getSalaryCheckRuleId); +// Map> checkRuleIdKeyTempMap = SalaryEntityUtil +// .group2Map(salaryCheckResultDetailTemps, SalaryCheckResultDetailTempPO::getSalaryCheckRuleId); +// if (CollectionUtils.isEmpty(checkParam.getIds())) { +// // 如果校验全部人员 +// handleAllCheck(checkParam, checkRuleIdKeyTempMap, result, employeeId, tenantKey); +// } else { +// // 如果校验部分人员 +// handlePartCheck(checkParam, oldCheckResultMap, checkRuleIdKeyTempMap, result, employeeId, tenantKey); +// } +// return result; +// } +// +// /** +// * 校验全部人员 +// * +// * @param checkParam +// * @param checkRuleIdKeyTempMap +// * @param result +// * @param employeeId +// * @param tenantKey +// */ +// private void handleAllCheck(SalaryAcctCheckParam checkParam, +// Map> checkRuleIdKeyTempMap, +// Result result, Long employeeId, String tenantKey) { +// LocalDateTime now = LocalDateTime.now(); +// checkRuleIdKeyTempMap.forEach((checkRuleId, salaryCheckResultDetailTempPOS) -> { +// // 校验异常 +// SalaryCheckResultPO salaryCheckResultPO = SalaryCheckResultPO.builder() +// .id(IdGenerator.generate()) +// .salaryAcctRecordId(checkParam.getSalaryAcctRecordId()) +// .salaryCheckRuleId(checkRuleId) +// .formulaId(salaryCheckResultDetailTempPOS.get(0).getFormulaId()) +// .ignoreType(0) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .tenantKey(tenantKey) +// .deleteType(0) +// .build(); +// result.getNeedInsertCheckResults().add(salaryCheckResultPO); +// // 校验异常明细 +// for (SalaryCheckResultDetailTempPO salaryCheckResultDetailTempPO : salaryCheckResultDetailTempPOS) { +// SalaryCheckResultRecordPO salaryCheckResultRecordPO = convert2CheckResultRecordPO(salaryCheckResultPO.getId(), +// salaryCheckResultDetailTempPO, now, employeeId, tenantKey); +// result.getNeedInsertCheckResultRecords().add(salaryCheckResultRecordPO); +// } +// }); +// } +// +// /** +// * 校验部分人员 +// * +// * @param checkParam +// * @param oldCheckResultMap +// * @param checkRuleIdKeyTempMap +// * @param result +// * @param employeeId +// * @param tenantKey +// */ +// private void handlePartCheck(SalaryAcctCheckParam checkParam, +// Map oldCheckResultMap, +// Map> checkRuleIdKeyTempMap, +// Result result, Long employeeId, String tenantKey) { +// LocalDateTime now = LocalDateTime.now(); +// checkRuleIdKeyTempMap.forEach((checkRuleId, salaryCheckResultDetailTempPOS) -> { +// // 校验异常 +// SalaryCheckResultPO salaryCheckResultPO = oldCheckResultMap.computeIfAbsent(checkRuleId, +// k -> SalaryCheckResultPO.builder() +// .id(IdGenerator.generate()) +// .salaryAcctRecordId(checkParam.getSalaryAcctRecordId()) +// .salaryCheckRuleId(k) +// .formulaId(salaryCheckResultDetailTempPOS.get(0).getFormulaId()) +// .ignoreType(0) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .tenantKey(tenantKey) +// .deleteType(0) +// .build()); +// // 校验异常明细 +// for (SalaryCheckResultDetailTempPO salaryCheckResultDetailTempPO : salaryCheckResultDetailTempPOS) { +// SalaryCheckResultRecordPO salaryCheckResultRecordPO = convert2CheckResultRecordPO(salaryCheckResultPO.getId(), +// salaryCheckResultDetailTempPO, now, employeeId, tenantKey); +// result.getNeedInsertCheckResultRecords().add(salaryCheckResultRecordPO); +// } +// }); +// // 需要删除的校验异常明细(属于本次校验人员的校验异常明细需要删除) +// List needDeleteCheckResultRecordIds = oldCheckResultRecords.stream() +// .filter(e -> checkParam.getIds().contains(e.getSalaryAcctEmpId())) +// .map(SalaryCheckResultRecordPO::getId) +// .collect(Collectors.toList()); +// result.getNeedDeleteCheckResultRecordIds().addAll(needDeleteCheckResultRecordIds); +// // 需要删除的异常异常(校验异常下已经没有校验异常明细时需要删除) +// Map> oldCheckResultRecordMap = SalaryEntityUtil +// .group2Map(oldCheckResultRecords, SalaryCheckResultRecordPO::getCheckResultId); +// oldCheckResultRecordMap.forEach((checkResultId, salaryCheckResultRecordPOS) -> { +// // 本次校验是否生成了校验异常明细 +// SalaryCheckResultPO checkResultPO = oldCheckResultMap.get(checkResultId); +// boolean hasSalaryCheckResultRecord = checkRuleIdKeyTempMap.containsKey(checkResultPO.getSalaryCheckRuleId()); +// // 原来的校验异常明细中是否包含其他人员的(非本次校验的人员) +// boolean hasOtherSalaryAcctEmployee = salaryCheckResultRecordPOS.stream().anyMatch(e -> !checkParam.getIds().contains(e.getSalaryAcctEmpId())); +// // 原来校验异常明细不包含其他人员,本次校验也没有生成新的校验异常明细,那么就需要删除校验异常 +// if (!hasOtherSalaryAcctEmployee && !hasSalaryCheckResultRecord) { +// result.getNeedDeleteCheckResultIds().add(checkResultId); +// } +// }); +// } +// +// /** +// * 转换成校验异常明细po +// * +// * @param checkResultId +// * @param salaryCheckResultDetailTempPO +// * @param now +// * @param employeeId +// * @param tenantKey +// * @return +// */ +// private SalaryCheckResultRecordPO convert2CheckResultRecordPO(Long checkResultId, +// SalaryCheckResultDetailTempPO salaryCheckResultDetailTempPO, +// LocalDateTime now, +// Long employeeId, +// String tenantKey) { +// return SalaryCheckResultRecordPO.builder() +// .id(IdGenerator.generate()) +// .checkResultId(checkResultId) +// .salaryAcctRecordId(salaryCheckResultDetailTempPO.getSalaryAcctRecordId()) +// .salaryCheckRuleId(salaryCheckResultDetailTempPO.getSalaryCheckRuleId()) +// .formulaId(salaryCheckResultDetailTempPO.getFormulaId()) +// .salaryAcctEmpId(salaryCheckResultDetailTempPO.getSalaryAcctEmpId()) +// .employeeId(salaryCheckResultDetailTempPO.getEmployeeId()) +// .creator(employeeId) +// .createTime(now) +// .updateTime(now) +// .tenantKey(tenantKey) +// .deleteType(0) +// .build(); +// } +// +// @Data +// public static class Result { +// +// /** +// * 需要删除的校验异常 +// */ +// private Collection needDeleteCheckResultIds; +// +// /** +// * 需要重新保存的校验异常 +// */ +// private Collection needInsertCheckResults; +// +// /** +// * 需要删除的校验异常明细 +// */ +// private Collection needDeleteCheckResultRecordIds; +// +// /** +// * 需要重新保存的校验异常明细 +// */ +// private Collection needInsertCheckResultRecords; +// +// private Result() { +// this.needDeleteCheckResultIds = Lists.newArrayList(); +// this.needInsertCheckResults = Lists.newArrayList(); +// this.needDeleteCheckResultRecordIds = Lists.newArrayList(); +// this.needInsertCheckResultRecords = Lists.newArrayList(); +// } +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckResultBO.java new file mode 100644 index 000000000..34b4f3267 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryCheckResultBO.java @@ -0,0 +1,93 @@ +//package com.engine.salary.entity.salaryacct.bo; +// +//import com.weaver.excel.formula.api.entity.ExpressFormula; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryCheckResultListDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryCheckResultRecordCountDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryCheckResultRecordListDTO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryCheckResultPO; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryCheckResultRecordPO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobCheckRulePO; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.teams.domain.user.SimpleEmployee; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.StringUtils; +//import org.apache.commons.lang3.math.NumberUtils; +// +//import java.util.Collections; +//import java.util.List; +//import java.util.Map; +//import java.util.stream.Collectors; +// +///** +// * @description: 薪资核算校验结果 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/7/21 1:52 PM +// * @version:v1.0 +// */ +//public class SalaryCheckResultBO { +// +// /** +// * 转换成校验异常列表dto +// * +// * @param salaryCheckResults +// * @param salarySobCheckRules +// * @param expressFormulas +// * @param salaryCheckResultRecordCountDTOS +// * @return +// */ +// public static List convert2ListDTO(List salaryCheckResults, +// List salarySobCheckRules, +// List expressFormulas, +// List salaryCheckResultRecordCountDTOS) { +// if (CollectionUtils.isEmpty(salaryCheckResults)) { +// return Collections.emptyList(); +// } +// Map formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula); +// Map checkRuleMap = SalaryEntityUtil.convert2Map(salarySobCheckRules, SalarySobCheckRulePO::getId, SalarySobCheckRulePO::getName); +// Map ckResultRecordCountMap = SalaryEntityUtil.convert2Map(salaryCheckResultRecordCountDTOS, SalaryCheckResultRecordCountDTO::getSalaryCheckResultId, +// SalaryCheckResultRecordCountDTO::getCountBySalaryCheckResultId); +// return salaryCheckResults.stream() +// .map(e -> SalaryCheckResultListDTO.builder() +// .id(e.getId()) +// .checkRuleId(e.getSalaryCheckRuleId()) +// .checkRuleName(checkRuleMap.getOrDefault(e.getSalaryCheckRuleId(), StringUtils.EMPTY)) +// .employeeSize(ckResultRecordCountMap.getOrDefault(e.getId(), NumberUtils.LONG_ZERO)) +// .formulaId(e.getFormulaId()) +// .formulaContent(formulaMap.getOrDefault(e.getFormulaId(), StringUtils.EMPTY)) +// .build()) +// .collect(Collectors.toList()); +// } +// +// /** +// * 转换成校验异常明细列表dto +// * +// * @param salaryCheckResultRecords +// * @param salarySobCheckRules +// * @param expressFormulas +// * @param simpleEmployees +// * @return +// */ +// public static List convert2RecordListDTO(List salaryCheckResultRecords, +// List salarySobCheckRules, +// List expressFormulas, +// List simpleEmployees) { +// if (CollectionUtils.isEmpty(salaryCheckResultRecords)) { +// return Collections.emptyList(); +// } +// Map formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula); +// Map checkRuleMap = SalaryEntityUtil.convert2Map(salarySobCheckRules, SalarySobCheckRulePO::getId, SalarySobCheckRulePO::getName); +// Map employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId, SimpleEmployee::getName); +// return salaryCheckResultRecords.stream() +// .map(e -> SalaryCheckResultRecordListDTO.builder() +// .id(e.getId()) +// .checkRuleId(e.getSalaryCheckRuleId()) +// .checkRuleName(checkRuleMap.getOrDefault(e.getSalaryCheckRuleId(), "")) +// .formulaId(e.getFormulaId()) +// .formulaContent(formulaMap.getOrDefault(e.getFormulaId(), "")) +// .employeeId(e.getEmployeeId()) +// .employeeName(employeeMap.getOrDefault(e.getEmployeeId(), "")) +// .build()) +// .collect(Collectors.toList()); +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/ConsolidatedTaxDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/ConsolidatedTaxDetailDTO.java new file mode 100644 index 000000000..0a47df4a8 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/ConsolidatedTaxDetailDTO.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 合并计税详情 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class ConsolidatedTaxDetailDTO { + + //员工信息") + private Object employeeInfo; + + //合并计税详情") + private Object salaryAcctResult; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java new file mode 100644 index 000000000..15d41ea9f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java @@ -0,0 +1,109 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.weaver.common.component.table.type.WeaTableTypeEnum; +//import com.weaver.hrm.salary.annotation.SalaryTable; +//import com.weaver.hrm.salary.annotation.SalaryTableColumn; +//import com.weaver.hrm.salary.annotation.SalaryTableOperate; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * @description: 薪资核算人员列表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/3/21 3:30 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@SalaryTable( +// value = { +// @SalaryTableOperate(index = 0, text = "删除", labelId = 87061) +// }, +// tableType = WeaTableTypeEnum.CHECKBOX, pageUid = "salaryAccEmployeeList" +//) +//@ApiModel("薪资核算人员列表") +//public class SalaryAccEmployeeListDTO { +// +// @ApiModelProperty("主键id") +// private Long id; +// +// @ApiModelProperty("人员id") +// private Long employeeId; +// +// @SalaryTableColumn( +// label = "姓名", +// labelId = 85429, +// width = "10%" +// ) +// @ApiModelProperty("姓名") +// private String employeeName; +// +// @ApiModelProperty("个税扣缴义务人id") +// private Long taxAgentId; +// +// @SalaryTableColumn( +// label = "个税扣缴义务人", +// labelId = 86184, +// width = "20%" +// ) +// @ApiModelProperty("个税扣缴义务人") +// private String taxAgentName; +// +// @ApiModelProperty("部门id") +// private Long departmentId; +// +// @SalaryTableColumn( +// label = "部门", +// labelId = 86185, +// width = "20%" +// ) +// @ApiModelProperty("部门") +// private String departmentName; +// +// @SalaryTableColumn( +// label = "手机号", +// labelId = 86186, +// width = "10%" +// ) +// @ApiModelProperty("手机号") +// private String mobile; +// +// @SalaryTableColumn( +// label = "工号", +// labelId = 86317, +// width = "10%" +// ) +// @ApiModelProperty("工号") +// private String jobNum; +// +// @SalaryTableColumn( +// label = "员工状态", +// labelId = 86187, +// width = "10%" +// ) +// @ApiModelProperty("员工状态") +// private String status; +// +// @SalaryTableColumn( +// label = "入职日期", +// labelId = 86319, +// width = "10%" +// ) +// @ApiModelProperty("入职日期") +// private String hireDate; +// +//// @SalaryTableColumn( +//// label = "离职日期", +//// labelId = 95228, +//// width = "10%" +//// ) +//// @ApiModelProperty("离职日期") +// private String dismissDate; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccResultListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccResultListDTO.java new file mode 100644 index 000000000..4912b4ebb --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccResultListDTO.java @@ -0,0 +1,39 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.fasterxml.jackson.databind.annotation.JsonSerialize; +//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +//import com.weaver.hrm.salary.common.WeaTableColumnWapper; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import java.util.List; +//import java.util.Map; +// +///** +// * @description: 核算结果列表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/6/21 6:53 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("核算结果列表") +//public class SalaryAccResultListDTO { +// +// @ApiModelProperty("动态表头") +// private List columns; +// +// @ApiModelProperty("列表数据") +// private List> data; +// +// @JsonSerialize(using = ToStringSerializer.class) +// @ApiModelProperty("列表总数") +// private Long total; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctDTO.java new file mode 100644 index 000000000..5b149d213 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctDTO.java @@ -0,0 +1,24 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * @description: 薪资核算 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/16/21 8:40 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//public class SalaryAcctDTO { +// +// @ApiModelProperty("是否正在核算") +// private boolean acctInProgress; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmpSearchConditionDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmpSearchConditionDTO.java new file mode 100644 index 000000000..770399e3b --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmpSearchConditionDTO.java @@ -0,0 +1,60 @@ +package com.engine.salary.entity.salaryacct.dto; + +import com.engine.salary.common.LocalDateRange; + +/** + * 薪资核算人员确认高级搜索 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryAcctEmpSearchConditionDTO { + +// @SalarySearchCondition( +// label = "姓名", +// labelId = 85429, +// needQuickSearch = true, +// quickSearchKey = "employeeName", +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "employeeName") +// ) + private String employeeName; + +// @SalarySearchCondition( +// label = "个税扣缴义务人", +// labelId = 86184, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgentId") +// ) + private Long taxAgentId; + +// @SalarySearchCondition( +// label = "部门", +// labelId = 86185, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, +// browserType = "department", name = "departmentIds", browserModule = "hrmsalary", browserMultiple = true) +// ) + private Long departmentIds; + +// @SalarySearchCondition( +// label = "岗位", +// labelId = 90633, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, +// browserType = "position", name = "positionIds", browserModule = "hrmsalary", browserMultiple = true) +// ) + private Long positionIds; + +// @SalarySearchCondition( +// label = "状态", +// labelId = 91075, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, optionsEnum = SalaryEmployeeStatusEnum.class, name = "status") +// ) + private String status; + +// @SalarySearchCondition( +// label = "离职日期", +// labelId = 95228, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "dismissDate", isRange = true) +// ) + private LocalDateRange dismissDate; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeCountDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeCountDTO.java new file mode 100644 index 000000000..44dd1d937 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeCountDTO.java @@ -0,0 +1,23 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 薪资核算人员的数量 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +public class SalaryAcctEmployeeCountDTO { + +// @ApiModelProperty("薪资核算记录id") + private Long salaryAcctRecordId; + +// @ApiModelProperty("薪资核算人员的数量") + private Long countBySalaryAcctRecordId; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeInfoDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeInfoDTO.java new file mode 100644 index 000000000..12e2e694d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctEmployeeInfoDTO.java @@ -0,0 +1,27 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 员工信息字段 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctEmployeeInfoDTO { + + //字段名称 + private String fieldName; + + //字段值 + private String fieldValue; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctImportFieldDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctImportFieldDTO.java new file mode 100644 index 000000000..963f3e53b --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctImportFieldDTO.java @@ -0,0 +1,42 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import java.util.Collection; +// +///** +// * @description: 薪资核算导入时生成导入模板的薪资项目 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/13/21 4:26 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//public class SalaryAcctImportFieldDTO { +// +// @ApiModelProperty("公式项") +// private Collection formulaItems; +// +// @ApiModelProperty("输入项") +// private Collection inputItems; +// +// @Data +// @Builder +// @NoArgsConstructor +// @AllArgsConstructor +// public static class ImportFieldDTO { +// +// @ApiModelProperty("薪资项目id") +// private Long salaryItemId; +// +// @ApiModelProperty("薪资项目名称") +// private String salaryItemName; +// } +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctProgressDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctProgressDTO.java new file mode 100644 index 000000000..7258b40a4 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctProgressDTO.java @@ -0,0 +1,65 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @description: 核算进度 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/13/21 1:34 PM + * @version:v1.0 + */ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctProgressDTO implements Serializable { + + /** + * 当前步骤名称 + */ + private String title; + + /** + * 当前步骤名称的labelId + */ + private Long titleLabelId; + + /** + * 全部数量 + */ + private Integer totalQuantity; + + /** + * 已计算数量 + */ + private Integer calculatedQuantity; + + /** + * 进度百分比 + */ + private BigDecimal progress; + + /** + * true:计算正常、false:计算出错 + */ + private boolean status; + + /** + * 计算出错时的错误信息 + */ + private String message; + + /** + * 是否存在校验异常 + */ + private boolean checkStatus; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordFormDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordFormDTO.java new file mode 100644 index 000000000..fa23ef134 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordFormDTO.java @@ -0,0 +1,60 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.weaver.common.component.form.item.WeaFormItemType; +//import com.weaver.hrm.salary.annotation.SalaryForm; +//import com.weaver.hrm.salary.annotation.SalaryFormItem; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobCycleDTO; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.NoArgsConstructor; +//import lombok.experimental.Accessors; +// +///** +// * @description: 薪资核算基本信息详情 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/6/21 9:32 AM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("薪资核算基本信息") +//public class SalaryAcctRecordFormDTO { +// +// @ApiModelProperty("主键id") +// private Long id; +// +// @SalaryForm( +// label = "薪资所属月", +// labelId = 87614, +// items = @SalaryFormItem(itemType = WeaFormItemType.DATEPICKER, required = true) +// ) +// @ApiModelProperty("薪资所属月") +// private String salaryMonth; +// +// @ApiModelProperty("薪资账套id") +// private Long salarySobId; +// +// @SalaryForm( +// label = "核算账套", +// labelId = 95824, +// items = @SalaryFormItem(itemType = WeaFormItemType.SELECT, required = true) +// ) +// @ApiModelProperty("薪资账套名称") +// private String salarySobName; +// +// @SalaryForm( +// label = "备注", +// labelId = 84961, +// items = @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "30") +// ) +// @ApiModelProperty("备注") +// private String description; +// +// @ApiModelProperty("周期提示信息") +// private SalarySobCycleDTO cycleInfo; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java new file mode 100644 index 000000000..05cd17d8c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java @@ -0,0 +1,105 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 薪资核算列表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//@SalaryTable( +// value = { +// @SalaryTableOperate(index = 0, text = "核算", labelId = 94146), +// @SalaryTableOperate(index = 1, text = "归档", labelId = 92144), +// @SalaryTableOperate(index = 2, text = "查看", labelId = 90821, outer = false), +// @SalaryTableOperate(index = 3, text = "删除", labelId = 87061, outer = false), +// @SalaryTableOperate(index = 4, text = "操作日志", labelId = 87775, outer = false), +// @SalaryTableOperate(index = 5, text = "重新核算", labelId = 98820) +// }, tableType = WeaTableTypeEnum.NONE, pageUid = "salaryAcctRecordList" +//) +public class SalaryAcctRecordListDTO { + + //主键id") + private Long id; + +// @SalaryTableColumn( +// label = "薪资账套", +// labelId = 87889, +// width = "20%" +// ) + //薪资账套") + private String salarySobName; + +// @SalaryTableColumn( +// label = "薪资所属月", +// labelId = 87614, +// width = "10%" +// ) + //薪资所属月") + private String salaryMonth; + + //核算次数") + private Integer acctTimes; + + //核算次数是否显示") + private boolean acctTimesViable; + +// @SalaryTableColumn( +// label = "税款所属期", +// labelId = 86176, +// width = "10%" +// ) + //税款所属期") + private String taxCycle; + +// @SalaryTableColumn( +// label = "状态", +// labelId = 91075, +// width = "10%" +// ) + //状态") + private String status; + +// @SalaryTableColumn( +// label = "核算人数", +// labelId = 91819, +// width = "10%" +// ) + //核算人数") + private Long employeeSize; + +// @SalaryTableColumn( +// label = "核算人", +// labelId = 91818, +// width = "10%" +// ) + //核算人") + private String accountantName; + +// @SalaryTableColumn( +// label = "最后操作时间", +// labelId = 91817, +// width = "20%" +// ) + //最后操作时间") + private String updateTime; + +// @SalaryTableColumn( +// label = "备注", +// labelId = 84961, +// width = "20%" +// ) + //备注") + private String description; + +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java new file mode 100644 index 000000000..935023060 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultDetailDTO.java @@ -0,0 +1,60 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @description: 薪资核算结果详情 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/9/21 5:13 PM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//薪资核算结果详情") +public class SalaryAcctResultDetailDTO { + + /** + * SalaryAcctEmployee的id + */ + //薪资核算结果id") + private Long id; + + //员工信息") + private Long employeeId; + + //员工信息") + private List employeeInfos; + + //公式项") + private List formulaItems; + + //输入项") + private List inputItems; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class SalaryAcctResultDetailItemDTO { + + //薪资项目id") + private Long salaryItemId; + + //薪资项目名称") + private String salaryItemName; + + //核算结果的值") + private String resultValue; + + //数据类型:number、string") + private String dataType; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java new file mode 100644 index 000000000..57bbd85ad --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctResultSearchConditionDTO.java @@ -0,0 +1,72 @@ +package com.engine.salary.entity.salaryacct.dto; + +import com.engine.salary.common.LocalDateRange; + +import java.util.Collection; + +/** + * @description: 薪资核算结果高级搜索 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/9/21 5:06 PM + * @version:v1.0 + */ +public class SalaryAcctResultSearchConditionDTO { + +// @SalarySearchCondition( +// label = "姓名", +// labelId = 85429, +// needQuickSearch = true, +// quickSearchKey = "employeeName", +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.INPUT, name = "employeeName") +// ) + private String employeeName; + +// @SalarySearchCondition( +// label = "个税扣缴义务人", +// labelId = 86184, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, name = "taxAgentId") +// ) + private Long taxAgentId; + +// @SalarySearchCondition( +// label = "部门", +// labelId = 86185, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, +// browserType = "department", name = "departmentIds", browserModule = "hrmsalary", browserMultiple = true) +// ) + private Collection departmentIds; + +// @SalarySearchCondition( +// label = "岗位", +// labelId = 90633, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER, +// browserType = "position", name = "positionIds", browserModule = "hrmsalary", browserMultiple = true) +// ) + private Collection positionIds; + +// @SalarySearchCondition( +// label = "状态", +// labelId = 91075, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.SELECT, optionsEnum = SalaryEmployeeStatusEnum.class, name = "status") +// ) + private String status; + +// @SalarySearchCondition( +// label = "离职日期", +// labelId = 95228, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.DATEPICKER, name = "dismissDate", isRange = true) +// ) + private LocalDateRange dismissDate; + +// @SalarySearchCondition( +// label = "合并计税", +// labelId = 93289, +// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.RADIO, name = "consolidatedTaxation", options = "listTaxationOption()") +// ) + private String consolidatedTaxation; +// +// public List listTaxationOption() { +// return Collections.singletonList(new WeaSearchConditionOption("1", "是")); +// } +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultListDTO.java new file mode 100644 index 000000000..d32d309fa --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultListDTO.java @@ -0,0 +1,66 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.weaver.common.component.table.type.WeaTableTypeEnum; +//import com.weaver.hrm.salary.annotation.SalaryTable; +//import com.weaver.hrm.salary.annotation.SalaryTableColumn; +//import com.weaver.hrm.salary.annotation.SalaryTableOperate; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * @description: 薪资核算校验结果列表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/7/21 1:21 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("薪资核算校验结果列表") +//@SalaryTable( +// value = { +// @SalaryTableOperate(index = 0, text = "忽略", labelId = 92457), +// @SalaryTableOperate(index = 1, text = "查看明细", labelId = 86358) +// }, tableType = WeaTableTypeEnum.CHECKBOX, pageUid = "salaryCheckResultList" +//) +//public class SalaryCheckResultListDTO { +// +// @ApiModelProperty("主键id") +// private Long id; +// +// @ApiModelProperty("校验规则id") +// private Long checkRuleId; +// +// @SalaryTableColumn( +// label = "异常所属规则名称", +// labelId = 92455, +// width = "30%" +// ) +// @ApiModelProperty("异常所属规则名称") +// private String checkRuleName; +// +// @SalaryTableColumn( +// label = "异常人数", +// labelId = 92456, +// width = "20%" +// ) +// @ApiModelProperty("异常人数") +// private Long employeeSize; +// +// @ApiModelProperty("校验规则公式id") +// private Long formulaId; +// +// @SalaryTableColumn( +// label = "校验规则", +// labelId = 86126, +// width = "50%" +// ) +// @ApiModelProperty("校验规则公式内容") +// private String formulaContent; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordCountDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordCountDTO.java new file mode 100644 index 000000000..e06fa54eb --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordCountDTO.java @@ -0,0 +1,21 @@ +package com.engine.salary.entity.salaryacct.dto; + +import lombok.Data; + +/** + * 薪资核算结果校验异常的明细数量 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalaryCheckResultRecordCountDTO { + + //"薪资核算结果校验异常id + private Long salaryCheckResultId; + + //"薪资核算结果校验异常的明细数量 + private Long countBySalaryCheckResultId; +} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordListDTO.java new file mode 100644 index 000000000..7d42e00f2 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryCheckResultRecordListDTO.java @@ -0,0 +1,62 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.weaver.hrm.salary.annotation.SalaryTable; +//import com.weaver.hrm.salary.annotation.SalaryTableColumn; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +///** +// * @description: 校验结果具体人员列表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/7/21 1:29 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@SalaryTable( +// pageUid = "salaryCheckResultRecordList" +//) +//public class SalaryCheckResultRecordListDTO { +// +// @ApiModelProperty("主键id") +// private Long id; +// +// @ApiModelProperty("校验规则id") +// private Long checkRuleId; +// +// @SalaryTableColumn( +// label = "异常所属规则名称", +// labelId = 92455, +// width = "30%" +// ) +// @ApiModelProperty("异常所属规则名称") +// private String checkRuleName; +// +// @ApiModelProperty("校验规则公式id") +// private Long formulaId; +// +// @SalaryTableColumn( +// label = "校验规则", +// labelId = 86126, +// width = "50%" +// ) +// @ApiModelProperty("校验规则公式内容") +// private String formulaContent; +// +// @ApiModelProperty("人员id") +// private Long employeeId; +// +// @SalaryTableColumn( +// label = "姓名", +// labelId = 85429, +// width = "20%" +// ) +// @ApiModelProperty("人员姓名") +// private String employeeName; +//} diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java new file mode 100644 index 000000000..302f7ec2d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java @@ -0,0 +1,32 @@ +//package com.engine.salary.entity.salaryacct.dto; +// +//import com.weaver.common.component.table.column.WeaTableColumn; +//import com.weaver.common.component.table.page.Page; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.NoArgsConstructor; +//import lombok.experimental.Accessors; +// +//import java.util.List; +//import java.util.Map; +// +///** +// * @description: 薪资核算线下对比结果列表 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2/15/22 1:55 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//@NoArgsConstructor +//@AllArgsConstructor +//public class SalaryComparisonResultListDTO { +// +// @ApiModelProperty("列表的表头") +// private List weaTableColumns; +// +// @ApiModelProperty("列表数据") +// private Page> data; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCalculateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCalculateParam.java new file mode 100644 index 000000000..5a34fe533 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCalculateParam.java @@ -0,0 +1,33 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * 薪资核算的参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctCalculateParam { + + /** + * 不是employeeId而是salaryAcctEmpId + */ + //核算人员的id") + private Collection ids; + + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCheckParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCheckParam.java new file mode 100644 index 000000000..c5afc087c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctCheckParam.java @@ -0,0 +1,39 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Data; +//import lombok.NoArgsConstructor; +//import lombok.experimental.Accessors; +// +//import javax.validation.constraints.NotNull; +//import java.util.Collection; +// +///** +// * @description: 薪资核算结果的校验参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/16/21 6:45 PM +// * @version:v1.0 +// */ +//@Data +//@Accessors(chain = true) +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("薪资核算结果的校验参数") +//public class SalaryAcctCheckParam { +// +// /** +// * 不是employeeId而是salaryAcctEmpId +// */ +// @ApiModelProperty("核算人员的id") +// private Collection ids; +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpCheckTaxAgentParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpCheckTaxAgentParam.java new file mode 100644 index 000000000..cd275e413 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpCheckTaxAgentParam.java @@ -0,0 +1,24 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 检查薪资核算人员的个税扣缴义务人 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/13/22 4:03 PM +// * @version:v1.0 +// */ +//@Data +//public class SalaryAcctEmpCheckTaxAgentParam { +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpRefreshTaxAgentParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpRefreshTaxAgentParam.java new file mode 100644 index 000000000..daefb3338 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmpRefreshTaxAgentParam.java @@ -0,0 +1,24 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 刷新薪资核算人员的个税扣缴义务人 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/13/22 4:05 PM +// * @version:v1.0 +// */ +//@Data +//public class SalaryAcctEmpRefreshTaxAgentParam { +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java new file mode 100644 index 000000000..15bf4c09c --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeAddParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +import java.util.Collection; + +/** + * @description: 薪资核算人员-从环比上月减少添加 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 1/26/22 3:39 PM + * @version:v1.0 + */ +@Data +public class SalaryAcctEmployeeAddParam { + + //薪资核算记录id + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; + + //薪资核算记录人员id + @DataCheck(require = true,message = "参数错误,薪资核算人员不能为空") + private Collection ids; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeDeleteParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeDeleteParam.java new file mode 100644 index 000000000..df60a56ef --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeDeleteParam.java @@ -0,0 +1,26 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +import java.util.Collection; + +/** + * 薪资核算人员删除参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalaryAcctEmployeeDeleteParam { + + //薪资核算记录的id + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; + + //薪资核算人员的id + @DataCheck(require = true,message = "参数错误,薪资核算人员不能为空") + private Collection ids; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java new file mode 100644 index 000000000..fbb812d53 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeQueryParam.java @@ -0,0 +1,52 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; + +/** + * 薪资核算人员列表查询条件 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctEmployeeQueryParam extends BaseQueryParam { + + //薪资核算记录id") + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; + + //人员姓名") + private String employeeName; + + //个税扣缴义务人") + private Long taxAgentId; + + //部门") + private Collection departmentIds; + + //岗位") + private Collection positionIds; + + //状态") + private SalaryEmployeeStatusEnum status; + + //离职日期") + private LocalDateRange dismissDate; + + //薪资核算人员列表主键id") + private Collection ids; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeSaveParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeSaveParam.java new file mode 100644 index 000000000..5926e8a21 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctEmployeeSaveParam.java @@ -0,0 +1,36 @@ +package com.engine.salary.entity.salaryacct.param; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * @description: 添加核算人员参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/8/21 8:26 PM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctEmployeeSaveParam { + + /** + * 参数错误,薪资核算记录ID不能为空 + */ +// @NotNull(message = "LABEL:99845") + //薪资核算id") + private Long salaryAcctRecordId; + + /** + * 参数错误,人员不能为空 + */ +// @NotEmpty(message = "LABEL:99848") + //人员id") + private Collection employeeIds; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctImportTemplateParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctImportTemplateParam.java new file mode 100644 index 000000000..ae3379adc --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctImportTemplateParam.java @@ -0,0 +1,36 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Getter; +//import lombok.NoArgsConstructor; +//import lombok.Setter; +// +//import javax.validation.constraints.NotEmpty; +//import java.util.Collection; +// +///** +// * @description: 薪资核算导入数据时下载导入模板的参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/13/21 4:41 PM +// * @version:v1.0 +// */ +//@Getter +//@Setter +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("薪资核算导入数据时下载导入模板的参数") +//public class SalaryAcctImportTemplateParam extends SalaryAcctResultQueryParam { +// +// /** +// * 薪资项目id不能为空 +// */ +// @NotEmpty(message = "LABEL:93297") +// @ApiModelProperty("薪资项目id") +// private Collection salaryItemIds; +// +// @ApiModelProperty("是否导出数据") +// private String importType; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java new file mode 100644 index 000000000..52d24983f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java @@ -0,0 +1,32 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * @description: 薪资核算列表查询参数 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/1/21 1:41 PM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctRecordQueryParam extends BaseQueryParam { + + //核算年月范围起") + private YearMonth startMonth; + + //核算年月范围止") + private YearMonth endMonth; + + //账套名称") + private String name; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordReAccountParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordReAccountParam.java new file mode 100644 index 000000000..c21faabaa --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordReAccountParam.java @@ -0,0 +1,24 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 重新核算 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/13/22 4:08 PM +// * @version:v1.0 +// */ +//@Data +//public class SalaryAcctRecordReAccountParam { +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordSaveParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordSaveParam.java new file mode 100644 index 000000000..f4c5e1a90 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordSaveParam.java @@ -0,0 +1,37 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.YearMonth; + +/** + * 薪资核算基本信息保存参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//薪资核算基本信息保存参数 +public class SalaryAcctRecordSaveParam { + + //薪资所属月 + @DataCheck(require = true, message = "薪资所属月格式错误") + private YearMonth salaryMonth; + + @DataCheck(require = true, message = "薪资账套ID不允许为空") + //薪资账套id + private Long salarySobId; + + //备注 + @DataCheck(max = 80, message = "备注不能超过80个字符") + private String description; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java new file mode 100644 index 000000000..a73ebed6d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultQueryParam.java @@ -0,0 +1,49 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.common.BaseQueryParam; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.enums.salarysob.SalaryEmployeeStatusEnum; +import com.engine.salary.util.valid.DataCheck; +import lombok.Data; + +import java.util.Collection; + +/** + * 薪资核算结果查询参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +public class SalaryAcctResultQueryParam extends BaseQueryParam { + + //薪资核算记录id + @DataCheck(require = true,message = "参数错误,薪资核算记录ID不能为空") + private Long salaryAcctRecordId; + + //人员姓名 + private String employeeName; + + //个税扣缴义务人 + private Long taxAgentId; + + //部门 + private Collection departmentIds; + + //岗位 + private Collection positionIds; + + //状态 + private SalaryEmployeeStatusEnum status; + + //离职日期 + private LocalDateRange dismissDate; + + //是否合并计税 + private String consolidatedTaxation; + + //列表主键id + private Collection ids; +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultSaveParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultSaveParam.java new file mode 100644 index 000000000..9692d6b12 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctResultSaveParam.java @@ -0,0 +1,45 @@ +package com.engine.salary.entity.salaryacct.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Collection; + +/** + * 薪资核算结果保存参数 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SalaryAcctResultSaveParam { + + //薪资核算人员的id + @DataCheck(require = true,message = "参数错误,薪资核算人员不能为空") + private Long salaryAcctEmpId; + + //各个薪资项目的值 + @DataCheck(require = true,message = "薪资项目的值的集合不能为空") + private Collection items; + + @Data + @Builder + @NoArgsConstructor + @AllArgsConstructor + public static class SalaryAcctResultDetailItemParam { + + //薪资项目的id + private Long salaryItemId; + + //核算结果的值 + private String resultValue; + } +} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultExportParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultExportParam.java new file mode 100644 index 000000000..4e263511d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultExportParam.java @@ -0,0 +1,34 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import javax.validation.constraints.NotNull; +//import java.util.Collection; +// +///** +// * @description: 薪资核算校验异常导出参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 1/4/22 3:29 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//public class SalaryCheckResultExportParam { +// +// @ApiModelProperty("指定导出的id") +// private Collection ids; +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录的id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultQueryParam.java new file mode 100644 index 000000000..63ab9181e --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultQueryParam.java @@ -0,0 +1,33 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import com.weaver.hrm.salary.common.BaseQueryParam; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 校验结果列表查询参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/8/21 1:43 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("校验结果列表查询参数") +//public class SalaryCheckResultQueryParam extends BaseQueryParam { +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算的id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultRecordQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultRecordQueryParam.java new file mode 100644 index 000000000..b9e67471e --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryCheckResultRecordQueryParam.java @@ -0,0 +1,33 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import com.weaver.hrm.salary.common.BaseQueryParam; +//import io.swagger.annotations.ApiModel; +//import io.swagger.annotations.ApiModelProperty; +//import lombok.AllArgsConstructor; +//import lombok.Builder; +//import lombok.Data; +//import lombok.NoArgsConstructor; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 校验结果明细列表查询参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 12/8/21 1:44 PM +// * @version:v1.0 +// */ +//@Data +//@Builder +//@NoArgsConstructor +//@AllArgsConstructor +//@ApiModel("校验结果明细列表查询参数") +//public class SalaryCheckResultRecordQueryParam extends BaseQueryParam { +// +// /** +// * 核算异常的id不能为空 +// */ +// @NotNull(message = "LABEL:99849") +// @ApiModelProperty("校验结果id") +// private Long checkResultId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultExportParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultExportParam.java new file mode 100644 index 000000000..5d43e14a7 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultExportParam.java @@ -0,0 +1,24 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +// +//import javax.validation.constraints.NotNull; +// +///** +// * @description: 薪资核算线下对比结果导入模板导出参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2/15/22 4:04 PM +// * @version:v1.0 +// */ +//@Data +//public class SalaryComparisonResultExportParam { +// +// /** +// * 参数错误,薪资核算记录ID不能为空 +// */ +// @NotNull(message = "LABEL:99845") +// @ApiModelProperty("薪资核算记录id") +// private Long salaryAcctRecordId; +//} diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultQueryParam.java new file mode 100644 index 000000000..eb796b7d3 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryComparisonResultQueryParam.java @@ -0,0 +1,23 @@ +//package com.engine.salary.entity.salaryacct.param; +// +//import io.swagger.annotations.ApiModelProperty; +//import lombok.Data; +//import lombok.EqualsAndHashCode; +// +///** +// * @description: 薪资核算线下对比结果查询参数 +// * @author: xiajun +// * @modified By: xiajun +// * @date: Created in 2/15/22 11:34 AM +// * @version:v1.0 +// */ +//@Data +//@EqualsAndHashCode(callSuper = true) +//public class SalaryComparisonResultQueryParam extends SalaryAcctResultQueryParam { +// +// @ApiModelProperty("仅显示有差异的人员") +// private boolean onlyDiffEmployee; +// +// @ApiModelProperty("仅显示有差异的薪资项目") +// private boolean onlyDiffSalaryItem; +//} diff --git a/src/com/engine/salary/entity/salaryacct/po/ExcelAcctResultPO.java b/src/com/engine/salary/entity/salaryacct/po/ExcelAcctResultPO.java new file mode 100644 index 000000000..fc966ab40 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/ExcelAcctResultPO.java @@ -0,0 +1,88 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @description: 线下excel核算的结果 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/14/21 2:33 PM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//hrsa_excel_acct_result +public class ExcelAcctResultPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资账套id + */ + private Long salarySobId; + + /** + * 薪资项目id + */ + private Long salaryItemId; + + /** + * 薪资核算的id + */ + private Long salaryAcctRecordId; + + /** + * 薪资核算人员id + */ + private Long salaryAcctEmpId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + /** + * 计算后的值 + */ + private String resultValue; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java new file mode 100644 index 000000000..1ae56ced2 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -0,0 +1,81 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +/** + * @description: 薪资核算人员 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/3/21 3:22 PM + * @version:v1.0 + */ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +//hrsa_salary_acct_emp") +public class SalaryAcctEmployeePO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资核算的id + */ + private Long salaryAcctRecordId; + + /** + * 薪资账套id + */ + private Long salarySobId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + /** + * 薪资所属月 + */ + private LocalDate salaryMonth; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java new file mode 100644 index 000000000..9c239617f --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctRecordPO.java @@ -0,0 +1,102 @@ +package com.engine.salary.entity.salaryacct.po; + +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.util.Collection; +import java.util.Date; + +/** + * 薪资核算表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +@Builder +//hrsa_salary_acct_record +public class SalaryAcctRecordPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资所属月 + */ + private Date salaryMonth; + + /** + * 税款所属期 + */ + private Date taxCycle; + + /** + * 薪资账套id + */ + private Long salarySobId; + + /** + * 核算状态 + * @see SalaryAcctRecordStatusEnum + */ + private Integer status; + + /** + * 本次核算是账套(salarySobId)在本月(salaryMonth)的第几次核算 + */ + private Integer acctTimes; + + /** + * 备注 + */ + private String description; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + //查询条件------------------------------- + Collection ids; + + //薪资账套id + Collection salarySobIds; + + //税款所属期 + LocalDateRange salaryMonths; + + //税款所属期 + LocalDateRange taxCycleDateRange; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java new file mode 100644 index 000000000..7c350ff84 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultPO.java @@ -0,0 +1,88 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @description: 薪资核算结果 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 11/30/21 1:39 PM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//value = "hrsa_salary_acct_result") +public class SalaryAcctResultPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资账套id + */ + private Long salarySobId; + + /** + * 薪资项目id + */ + private Long salaryItemId; + + /** + * 薪资核算的id + */ + private Long salaryAcctRecordId; + + /** + * 薪资核算人员id + */ + private Long salaryAcctEmpId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + /** + * 计算后的值 + */ + private String resultValue; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java new file mode 100644 index 000000000..ea9985c26 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctResultTempPO.java @@ -0,0 +1,95 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @description: 薪资核算结果临时存储 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/27/21 10:05 AM + * @version:v1.0 + */ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +//value = "hrsa_acct_result_temp") +public class SalaryAcctResultTempPO { + + /** + * 主键id + */ + private Long id; + + /** + * 核算生成的key + */ + private String calculateKey; + + /** + * 薪资账套id + */ + private Long salarySobId; + + /** + * 薪资项目id + */ + private Long salaryItemId; + + /** + * 薪资核算的id + */ + private Long salaryAcctRecordId; + + /** + * 薪资核算人员id + */ + private Long salaryAcctEmpId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + /** + * 计算后的值 + */ + private String resultValue; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java new file mode 100644 index 000000000..08d73b41d --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java @@ -0,0 +1,85 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @description: 核算结果的校验结果明细临时存储 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/27/21 3:41 PM + * @version:v1.0 + */ +@Data +@Builder +@Accessors(chain = true) +@NoArgsConstructor +@AllArgsConstructor +//value = "hrsa_ck_result_detail_temp") +public class SalaryCheckResultDetailTempPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资核算id + */ + private Long salaryAcctRecordId; + + /** + * 校验规则id + */ + private Long salaryCheckRuleId; + + /** + * 公式id + */ + private Long formulaId; + + /** + * 薪资核算人员id + */ + private Long salaryAcctEmpId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 校验时生成的key + */ + private String calculateKey; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java new file mode 100644 index 000000000..f8f8da978 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java @@ -0,0 +1,73 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @description: 薪资核算校验异常结果 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/7/21 10:44 AM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//value = "hrsa_check_result") +public class SalaryCheckResultPO { + + /** + * 主键id + */ + private Long id; + + /** + * 薪资核算id + */ + private Long salaryAcctRecordId; + + /** + * 校验规则id + */ + private Long salaryCheckRuleId; + + /** + * 公式id + */ + private Long formulaId; + + /** + * 是否忽略。0:未忽略、1:已忽略 + */ + private Integer ignoreType; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java new file mode 100644 index 000000000..b57210197 --- /dev/null +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java @@ -0,0 +1,83 @@ +package com.engine.salary.entity.salaryacct.po; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; + +/** + * @description: 薪资核算校验异常结果明细 + * @author: xiajun + * @modified By: xiajun + * @date: Created in 12/7/21 10:47 AM + * @version:v1.0 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +//value = "hrsa_check_result_record") +public class SalaryCheckResultRecordPO { + + /** + * 主键id + */ + private Long id; + + /** + * 校验异常结果id + */ + private Long checkResultId; + + /** + * 薪资核算id + */ + private Long salaryAcctRecordId; + + /** + * 校验规则id + */ + private Long salaryCheckRuleId; + + /** + * 公式id + */ + private Long formulaId; + + /** + * 薪资核算人员id + */ + private Long salaryAcctEmpId; + + /** + * 人员id + */ + private Long employeeId; + + /** + * 租户key + */ + private String tenantKey; + + /** + * 创建人id + */ + private Long creator; + + /** + * 是否删除 + */ + private Integer deleteType; + + /** + * 创建时间 + */ + private LocalDateTime createTime; + + /** + * 更新时间 + */ + private LocalDateTime updateTime; +} diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobListDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobListDTO.java index b3c87b400..22f8b9244 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobListDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobListDTO.java @@ -40,7 +40,7 @@ public class SalarySobListDTO { @SalaryTableColumn(text = "账套名称", width = "10%", column = "name") private String name; - @SalaryTableColumn(text = "薪资周期", width = "10%", column = "salaryCycle") + @SalaryTableColumn(text = "薪资周期", width = "10%", column = "salaryCycle",transmethod = "com.engine.salary.transmethod.buildSalaryCycle") private String salaryCycle; @SalaryTableColumn(text = "启用", width = "10%", column = "disable") diff --git a/src/com/engine/salary/enums/salaryaccounting/SalaryAcctRecordStatusEnum.java b/src/com/engine/salary/enums/salaryaccounting/SalaryAcctRecordStatusEnum.java index f25c5ebb4..c8e56cb1d 100644 --- a/src/com/engine/salary/enums/salaryaccounting/SalaryAcctRecordStatusEnum.java +++ b/src/com/engine/salary/enums/salaryaccounting/SalaryAcctRecordStatusEnum.java @@ -5,12 +5,13 @@ import com.engine.salary.enums.BaseEnum; import java.util.Objects; /** - * @description: 薪资核算的状态 - * @author: xiajun - * @modified By: xiajun - * @date: Created in 12/1/21 3:57 PM - * @version:v1.0 - */ + * 薪资核算的状态 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ public enum SalaryAcctRecordStatusEnum implements BaseEnum { NOT_ARCHIVED(1, "未归档", 91870), diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml index 62ebf73ee..8ed59dd0d 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveItemMapper.xml @@ -438,7 +438,7 @@ LEFT JOIN hrmresource o ON o.id = t1.operator LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id WHERE - t1. t1.delete_type = 0 + t1.delete_type = 0 AND e.status != '7' AND t1.salary_item_id IN @@ -473,7 +473,7 @@ t1.adjust_reason, t2.name AS adjust_item, t1.item_value AS adjust_after, - o.username AS operator, + o.lastname AS operator, t1.operate_time, t1.description, t1.salary_archive_id, @@ -485,7 +485,7 @@ LEFT JOIN hrmresource o ON o.id = t1.operator LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id WHERE - t1. t1.delete_type = 0 + t1.delete_type = 0 AND e.status != '7' AND t1.salary_item_id IN @@ -580,7 +580,7 @@ t1.adjust_reason, t2.name AS adjust_item, t1.item_value AS adjust_after, - o.username AS operator, + o.lastname AS operator, t1.operate_time, t1.description, t1.salary_archive_id, @@ -592,7 +592,7 @@ LEFT JOIN hrmresource o ON o.id = t1.operator LEFT JOIN hrsa_salary_item t2 ON t2.id = t1.salary_item_id WHERE - t1. t1.delete_type = 0 + t1.delete_type = 0 AND e.status != '7' AND t1.salary_item_id IN @@ -686,7 +686,7 @@ t1.adjust_reason, t2.name AS adjust_item, t1.item_value AS adjust_after, - o.username AS operator, + o.lastname AS operator, t1.operate_time, t1.description, t1.salary_archive_id, diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java new file mode 100644 index 000000000..5136fa419 --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.salaryacct; + +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface SalaryAcctRecordMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(SalaryAcctRecordPO salaryAcctRecord); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + SalaryAcctRecordPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param salaryAcctRecord 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(SalaryAcctRecordPO salaryAcctRecord); + + /** + * 修改,修改所有字段 + * + * @param salaryAcctRecord 修改的记录 + * @return 返回影响行数 + */ + int update(SalaryAcctRecordPO salaryAcctRecord); + + /** + * 修改,忽略null字段 + * + * @param salaryAcctRecord 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(SalaryAcctRecordPO salaryAcctRecord); + + /** + * 删除记录 + * + * @param salaryAcctRecord 待删除的记录 + * @return 返回影响行数 + */ + int delete(SalaryAcctRecordPO salaryAcctRecord); + + /** + * 批量删除 + * + * @param ids + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml new file mode 100644 index 000000000..b37737fcb --- /dev/null +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctRecordMapper.xml @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + t + . + id + , t.salary_month + , t.tax_cycle + , t.salary_sob_id + , t.status + , t.acct_times + , t.description + , t.creator + , t.create_time + , t.update_time + , t.delete_type + , t.tenant_key + + + + + + + + + + + + + + + INSERT INTO hrsa_salary_acct_record + + + + id, + + + salary_month, + + + tax_cycle, + + + salary_sob_id, + + + status, + + + acct_times, + + + description, + + + creator, + + + create_time, + + + update_time, + + + delete_type, + + + tenant_key, + + + + + #{id}, + + + #{salaryMonth}, + + + #{taxCycle}, + + + #{salarySobId}, + + + #{status}, + + + #{acctTimes}, + + + #{description}, + + + #{creator}, + + + #{createTime}, + + + #{updateTime}, + + + #{deleteType}, + + + #{tenantKey}, + + + + + + + UPDATE hrsa_salary_acct_record + + salary_month=#{salaryMonth}, + tax_cycle=#{taxCycle}, + salary_sob_id=#{salarySobId}, + status=#{status}, + acct_times=#{acctTimes}, + description=#{description}, + creator=#{creator}, + create_time=#{createTime}, + update_time=#{updateTime}, + delete_type=#{deleteType}, + tenant_key=#{tenantKey}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_acct_record + + + salary_month=#{salaryMonth}, + + + tax_cycle=#{taxCycle}, + + + salary_sob_id=#{salarySobId}, + + + status=#{status}, + + + acct_times=#{acctTimes}, + + + description=#{description}, + + + creator=#{creator}, + + + create_time=#{createTime}, + + + update_time=#{updateTime}, + + + delete_type=#{deleteType}, + + + tenant_key=#{tenantKey}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_salary_acct_record + SET delete_type=1 + WHERE id = #{id} + AND delete_type = 0 + + + + UPDATE hrsa_salary_acct_record + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/SalaryAcctEmployeeService.java b/src/com/engine/salary/service/SalaryAcctEmployeeService.java new file mode 100644 index 000000000..b73a20967 --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctEmployeeService.java @@ -0,0 +1,229 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; +import com.engine.salary.entity.salaryacct.param.*; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; + +import java.util.Collection; +import java.util.List; + +/** + * 薪资核算人员 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalaryAcctEmployeeService { + + /** + * 根据薪资核算记录id统计薪资核算人员的数量 + * + * @param salaryAcctRecordIds 薪资核算记录的id + * @return + */ + List countBySalaryAcctRecordId(Collection salaryAcctRecordIds); + + /** + * 根据主键id获取单个薪资核算人员 + * + * @param id 主键id + * @return + */ + SalaryAcctEmployeePO getById(Long id); + + /** + * 根据主键id查询薪资核算人员 + * + * @param ids 主键id + * @return + */ + List listByIds(Collection ids); + + /** + * 根据薪资核算记录id查询薪资核算人员 + * + * @param salaryAcctRecordId 薪资核算记录id + * @return + */ + List listBySalaryAcctRecordId(Long salaryAcctRecordId); + + /** + * 根据薪资核算记录id查询薪资核算人员 + * + * @param salaryAcctRecordIds 薪资核算记录id + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 根据薪资核算记录id、个税扣缴义务人id查询薪资核算人员 + * + * @param salaryAcctRecordId 薪资核算记录id + * @param taxAgentId 个税扣缴义务人id + * @return + */ + List listBySalaryAcctRecordIdAndTaxAgentId(Long salaryAcctRecordId, Long taxAgentId); + + /** + * 根据薪资核算记录id、主键id查询薪资核算人员 + * + * @param salaryAcctRecordId 薪资核算记录id + * @param ids 主键id + * @return + */ + List listBySalaryAcctRecordIdAndIds(Long salaryAcctRecordId, Collection ids); + + /** + * 根据薪资核算记录id、人员id查询薪资核算人员 + * + * @param salaryAcctRecordId 薪资核算记录id + * @param employeeIds 人员id + * @return + */ + List listBySalaryAcctRecordIdAndEmployeeIds(Long salaryAcctRecordId, Collection employeeIds); + + /** + * 根据薪资核算记录id、人员id查询薪资核算人员 + * + * @param salaryAcctRecordIds 薪资核算记录id + * @param employeeIds 人员id + * @return + */ + List listBySalaryAcctRecordIdsAndEmployeeIds(Collection salaryAcctRecordIds, Collection employeeIds); + + /** + * 根据薪资核算记录id、人员id、个税扣缴义务人id查询薪资核算人员 + * + * @param salaryAcctRecordIds 薪资核算记录id + * @param employeeId 人员id + * @param taxAgentId 个税扣缴义务人 + * @return + */ + List listByRecordIdsAndEmpIdAndTaxAgentId(Collection salaryAcctRecordIds, Long employeeId, Long taxAgentId); + + /** + * 根据列表查询条件查询薪资核算人员(分页) + * + * @param queryParam 列表查询条件 + * @return + */ +// Page listPageByParam(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 根据列表查询条件查询薪资核算人员 + * + * @param queryParam 列表查询条件 + * @return + */ + List listByParam(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 根据薪资核算结果列表的列表查询条件查询薪资核算人员(分页) + * + * @param queryParam 薪资核算结果列表的列表查询条件 + * @return + */ +// Page listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam); + + /** + * 根据薪资核算结果列表的列表查询条件查询薪资核算人员 + * + * @param queryParam 薪资核算结果列表的列表查询条件 + * @return + */ + List listByResultQueryParam(SalaryAcctResultQueryParam queryParam); + + /** + * 根据列表查询条件查询同比减少的薪资核算人员(分页) + * + * @param queryParam 列表查询条件 + * @return + */ +// Page listPageByParam4Reduce(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 根据列表查询条件查询同比减少的薪资核算人员 + * + * @param queryParam 列表查询条件 + * @return + */ + List listByParam4Reduce(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 根据列表查询条件查询合并计税的薪资核算人员(分页) + * + * @param queryParam 列表查询条件 + * @return + */ +// Page listPageByParam4ConsolidatedTax(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 根据列表查询条件查询合并计税的薪资核算人员 + * + * @param queryParam 列表查询条件 + * @return + */ + List listByParam4ConsolidatedTax(SalaryAcctEmployeeQueryParam queryParam); + + /** + * 添加薪资核算人员 + * + * @param saveParam 保存参数 + * @param employeeId 人员id + */ + void save(SalaryAcctEmployeeSaveParam saveParam, Long employeeId); + + /** + * 从环比上月减少添加薪资核算人员 + * + * @param param + * @param employeeId + */ + void addFromReduce(SalaryAcctEmployeeAddParam param, Long employeeId); + + /** + * 批量保存 + * + * @param salaryAcctEmployeePOS 薪资核算人员 + */ + void batchSave(Collection salaryAcctEmployeePOS); + + /** + * 薪资核算记录(会删除薪资核算结果、校验异常明细、线下对比导入结果) + * + * @param ids + */ + void deleteByIds(Collection ids); + + /** + * 根据参数删除薪资核算人员 + * + * @param deleteParam 删除参数 + */ + void deleteByParam(SalaryAcctEmployeeDeleteParam deleteParam); + + /** + * 根据薪资核算记录id删除薪资核算人员 + * + * @param salaryAcctRecordIds 薪资核算记录id + */ + void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 根据薪资核算记录id初始化薪资核算人员 + * + * @param salaryAcctRecordPO 薪资核算记录 + */ + void initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecordPO); + + /** + * 刷新薪资核算人员的个税扣缴义务人 + * + * @param salaryAcctRecordId 薪资核算记录 + * @param employeeId 人员id + */ + void refresh(Long salaryAcctRecordId, Long employeeId); +} diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java new file mode 100644 index 000000000..a14e96bd8 --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -0,0 +1,160 @@ +package com.engine.salary.service; + +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; + +import java.util.Collection; +import java.util.List; + +/** + * 薪资核算记录 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalaryAcctRecordService { + + /** + * 根据主键id获取单条薪资核算记录 + * + * @param id 主键id + * @return + */ + SalaryAcctRecordPO getById(Long id); + + /** + * 根据主键id查询薪资核算记录 + * + * @param ids 主键id + * @return + */ + List listByIds(Collection ids); + + /** + * 根据薪资账套id、薪资所属月查询薪资核算记录 + * + * @param salarySobIds 薪资账套id + * @param salaryMonthDateRange 薪资所属月的时间范围 + * @return + */ + List listBySalarySobIdsAndSalaryMonth(Collection salarySobIds, LocalDateRange salaryMonthDateRange); + + /** + * 根据薪资账套id、税款所属期查询薪资核算记录 + * + * @param salarySobIds 薪资账套id + * @param taxCycleDateRange 税款所属期的时间范围 + * @return + */ + List listBySalarySobIdsAndTaxCycle(Collection salarySobIds, LocalDateRange taxCycleDateRange); + + /** + * 根据薪资所属月查询薪资核算记录 + * + * @param salaryMonthDateRange 薪资所属月的时间范围 + * @return + */ + List listBySalaryMonth(LocalDateRange salaryMonthDateRange); + + /** + * 根据列表查询条件查询薪资核算记录(分页) + * + * @param queryParam 列表查询条件 + * @param tenantKey 租户key + * @return + */ +// Page listPageByParam(SalaryAcctRecordQueryParam queryParam); + + /** + * 根据id查询同一个账套上一个月的薪资核算记录 + * + * @param id 薪资核算记录id + * @return + */ + List listById4LastSalaryMonth(Long id); + + /** + * 根据薪资账套ID查询薪资核算记录 + * + * @param salarySobIds 薪资账套id + * @param tenantKey 租户key + * @return + */ + List listBySalarySobIds(Collection salarySobIds); + + /** + * 根据id查询其他合并计税的薪资核算记录 + * + * @param id 薪资核算记录的id + * @return + */ + List listById4OtherConsolidatedTax(Long id); + + /** + * 薪资核算记录所用的薪资账套薪资周期、考勤周期…… + * + * @param id 薪资核算记录的id + * @param tenantKey 租户key + * @return + */ + SalarySobCycleDTO getSalarySobCycleById(Long id); + + /** + * 保存 + * + * @param saveParam 保存参数 + * @param employeeId 人员id + * @return + */ + Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId); + + /** + * 更新薪资核算记录的状态 + * + * @param ids 主键id + * @param status 薪资核算记录的状态 + */ + void updateStatusByIds(Collection ids, SalaryAcctRecordStatusEnum status); + + /** + * 根据主键id删除 + * + * @param ids 薪资核算记录的id + */ + void deleteByIds(Collection ids); + + /** + * 归档 + * + * @param id 薪资核算记录的id + */ + void file(Long id); + + /** + * 重新核算(并不是重新执行公式,而是变更薪资核算记录状态为未归档,并且撤回生成的工资单) + * + * @param id 薪资核算记录的id + */ + void reCalculate(Long id); + + /** + * 判断是否存在合并计税 + * + * @param id 薪资核算记录的id + * @return 0:不存在、1:存在 + */ + Integer hasConsolidatedTax(Long id); + + /** + * 查询操作日志中的操作对象名称 + * + * @param id 薪资核算记录的id + * @return + */ + String getLogTargetNameById(Long id); +} diff --git a/src/com/engine/salary/service/SalaryAcctResultService.java b/src/com/engine/salary/service/SalaryAcctResultService.java new file mode 100644 index 000000000..70e209c8f --- /dev/null +++ b/src/com/engine/salary/service/SalaryAcctResultService.java @@ -0,0 +1,134 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO; +import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO; +import com.engine.salary.entity.salaryacct.param.SalaryAcctCalculateParam; +import com.engine.salary.entity.salaryacct.param.SalaryAcctResultQueryParam; +import com.engine.salary.entity.salaryacct.param.SalaryAcctResultSaveParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +/** + * 薪资核算结果 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public interface SalaryAcctResultService { + + /** + * 根据薪资核算记录的id查询薪资核算结果 + * + * @param salaryAcctRecordIds 薪资核算记录的id + * @return + */ + List listBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 根据薪资核算人员的主键id查询薪资核算结果 + * + * @param salaryAcctEmployeeId 薪资核算人员的主键id + * @return + */ + List listBySalaryAcctEmployeeId(Long salaryAcctEmployeeId); + + /** + * 根据薪资核算人员的主键id查询薪资核算结果 + * + * @param salaryAcctEmployeeIds 薪资核算人员的主键id + * @return + */ + List listBySalaryAcctEmployeeIds(Collection salaryAcctEmployeeIds); + + /** + * 根据薪资核算id、人员id查询薪资核算结果 + * + * @param salaryAcctRecordIds 薪资核算记录id + * @param employeeIds 人员id + * @return + */ + List listBySalaryAcctRecordIdsAndEmployeeIds(Collection salaryAcctRecordIds, Collection employeeIds); + + /** + * 根据薪资核算人员的主键id查询薪资核算结果 + * + * @param salaryAcctEmployeeId 薪资核算人员的主键id + * @return + */ + SalaryAcctResultDetailDTO getBySalaryAcctEmployeeId(Long salaryAcctEmployeeId); + + /** + * 根据薪资核算结果列表查询条件查询薪资核算结果(分页) + * + * @param queryParam 列表查询条件 + * @return + */ +// Page> listPageByParam(SalaryAcctResultQueryParam queryParam); + + /** + * 根据薪资核算结果列表查询条件查询薪资核算结果 + * + * @param queryParam 列表查询条件 + * @return + */ + List> listByParam(SalaryAcctResultQueryParam queryParam); + + /** + * 获取合并计税详情 + * + * @param salaryAcctEmployeeId 薪资核算人员 + * @return + */ + ConsolidatedTaxDetailDTO getConsolidatedTaxDetail(Long salaryAcctEmployeeId); + + /** + * 保存 + * + * @param saveParam 保存参数 + * @param employeeId 人员id + */ + void save(SalaryAcctResultSaveParam saveParam, Long employeeId); + + /** + * 批量保存 + * + * @param salaryAcctResultPOS 薪资核算结果 + */ + void batchSave(Collection salaryAcctResultPOS); + + /** + * 根据薪资核算人员id删除薪资核算结果 + * + * @param salaryAcctEmployeeIds 薪资核算人员id + */ + void deleteBySalaryAcctEmployeeIds(Collection salaryAcctEmployeeIds); + + /** + * 根据薪资核算人员id、薪资项目id删除薪资核算结果 + * + * @param salaryAcctEmployeeIds 薪资核算人员id + * @param salaryItemIds 薪资项目id + */ + void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection salaryAcctEmployeeIds, Collection salaryItemIds); + + /** + * 根据薪资核算记录id删除薪资核算结果 + * + * @param salaryAcctRecordIds 薪资核算记录id + */ + void deleteBySalaryAcctRecordIds(Collection salaryAcctRecordIds); + + /** + * 薪资核算 + * + * @param calculateParam + * @param simpleEmployee + */ + void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee); +} diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java new file mode 100644 index 000000000..765a03698 --- /dev/null +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -0,0 +1,449 @@ +package com.engine.salary.service.impl; + +import com.engine.core.impl.Service; +import com.engine.salary.common.LocalDateRange; +import com.engine.salary.entity.salaryacct.bo.SalaryAcctRecordBO; +import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; +import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; +import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +import com.engine.salary.enums.salarysob.IncomeCategoryEnum; +import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper; +import com.engine.salary.service.SalaryAcctEmployeeService; +import com.engine.salary.service.SalaryAcctRecordService; +import com.engine.salary.service.SalaryAcctResultService; +import com.engine.salary.service.SalarySobService; +import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.SqlProxyHandle; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 薪资核算 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRecordService { + + + private SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + + private SalarySobService salarySobService; + + private SalaryAcctEmployeeService salaryAcctEmployeeService; + + private SalaryAcctResultService salaryAcctResultService; + +// private SalaryCheckResultService salaryCheckResultService; +// +// private SalaryCheckResultDetailService salaryCheckResultDetailService; +// +// private SalaryComparisonResultService salaryComparisonResultService; +// +// private SalarySendService salarySendService; +// +// private LoggerTemplate salaryAcctRecordLoggerTemplate; +// +// private TaxDeclarationService taxDeclarationService; + + + @Override + public SalaryAcctRecordPO getById(Long id) { + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.getById(id); + } + + @Override + public List listByIds(Collection ids) { + if (CollectionUtils.isEmpty(ids)) { + return Collections.emptyList(); + } + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().ids(ids).build()); + } + + @Override + public List listBySalarySobIdsAndSalaryMonth(Collection salarySobIds, LocalDateRange salaryMonthDateRange) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return Collections.emptyList(); + } + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salarySobIds(salarySobIds).salaryMonths(salaryMonthDateRange).build()); + } + + @Override + public List listBySalarySobIdsAndTaxCycle(Collection salarySobIds, LocalDateRange taxCycleDateRange) { + if (CollectionUtils.isEmpty(salarySobIds)) { + return Collections.emptyList(); + } + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salarySobIds(salarySobIds).taxCycleDateRange(taxCycleDateRange).build()); + } + + @Override + public List listBySalaryMonth(LocalDateRange salaryMonthDateRange) { + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build()); + } + +// @Override +// public Page listPageByParam(SalaryAcctRecordQueryParam queryParam, String tenantKey) { +// // 分页参数 +// Page page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); +// // 构建queryWrapper +// LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery(); +// queryWrapper.eq(SalaryAcctRecordPO::getTenantKey, tenantKey); +// queryWrapper.eq(SalaryAcctRecordPO::getDeleteType, 0); +// if (StringUtils.isNotEmpty(queryParam.getName())) { +// // 根据查询条件中的薪资账套名称查询薪资账套 +// List salarySobPOS = salarySobService.listByNameLike(queryParam.getName(), tenantKey); +// if (CollectionUtils.isEmpty(salarySobPOS)) { +// return page; +// } +// // 过滤薪资账套 +// Set salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId); +// queryWrapper.in(SalaryAcctRecordPO::getSalarySobId, salarySobIds); +// } +// if (Objects.nonNull(queryParam.getStartMonth())) { +// queryWrapper.ge(SalaryAcctRecordPO::getSalaryMonth, queryParam.getStartMonth().atDay(1)); +// } +// if (Objects.nonNull(queryParam.getEndMonth())) { +// queryWrapper.le(SalaryAcctRecordPO::getSalaryMonth, queryParam.getEndMonth().atEndOfMonth()); +// } +// queryWrapper.orderByDesc(SalaryAcctRecordPO::getId); +// // 查询薪资核算记录 +// return salaryAcctRecordMapper.selectPage(page, queryWrapper); +// } + + @Override + public List listById4LastSalaryMonth(Long id) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getById(id); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + + //上个月日期 + Date salaryMonth = salaryAcctRecordPO.getSalaryMonth(); + Calendar prevMonth = Calendar.getInstance(); + prevMonth.setTime(salaryMonth); + prevMonth.set(Calendar.MONTH, prevMonth.get(Calendar.MONTH) - 1); + + // 查询上个月的核算记录 + LocalDateRange salaryMonthDateRange = SalaryDateUtil.localDate2Range(prevMonth.getTime()); + return listBySalarySobIdsAndSalaryMonth(Collections.singleton(salaryAcctRecordPO.getSalarySobId()), + salaryMonthDateRange); + } + + @Override + public List listBySalarySobIds(Collection salarySobIds) { + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salarySobIds(salarySobIds).build()); + } + + @Override + public List listById4OtherConsolidatedTax(Long id) { + SalaryAcctRecordPO salaryAcctRecordPO = getById(id); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 查询所有薪资类型为工资薪金的账套 + List salarySobPOS = salarySobService.listByIncomeCategory(IncomeCategoryEnum.WAGES_AND_SALARIES); + // 如果薪资账套的薪资类型不是工资薪金的,代表不存在合并计税 + boolean isWageSalarySob = salarySobPOS.stream().anyMatch(salarySobPO -> Objects.equals(salarySobPO.getId(), salaryAcctRecordPO.getSalarySobId())); + if (!isWageSalarySob) { + return Collections.emptyList(); + } + // 查询相同税款所属期内的薪资类型为工资薪金的账套的所有核算记录 + Set salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId); + LocalDateRange taxCycleDateRange = SalaryDateUtil.localDate2Range(salaryAcctRecordPO.getTaxCycle()); + List salaryAcctRecordPOS = listBySalarySobIdsAndSalaryMonth(salarySobIds, taxCycleDateRange); + // 除开本次薪资核算记录之外的其他薪资核算记录 + return salaryAcctRecordPOS.stream().filter(po -> !Objects.equals(po.getId(), salaryAcctRecordPO.getId())).collect(Collectors.toList()); + } + + @Override + public SalarySobCycleDTO getSalarySobCycleById(Long id) { + // 查询薪资核算 + SalaryAcctRecordPO salaryAcctRecordPO = getById(id); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 查询薪资核算所用薪资账套的薪资周期、考勤周期…… + return salarySobService.getSalarySobCycle(salaryAcctRecordPO.getSalarySobId(), SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth())); + + } + + @Override + public Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId) { + // 薪资所属月所在年的日期范围(第一天~最后一天) + LocalDateRange yearRange = SalaryDateUtil.localDate2YearRange(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1))); + if (Objects.isNull(yearRange)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + // 查询薪资所属月所在年的所有薪资核算记录 + List salaryAcctRecordPOS = listBySalaryMonth(yearRange); + // 如果某个月(薪资所属月)还未申报,不可以新建之后月份的薪资核算 + SalaryAcctRecordPO notDeclared = salaryAcctRecordPOS.stream() + .filter(salaryAcctRecordPO -> !Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) + && salaryAcctRecordPO.getSalaryMonth().before(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(notDeclared)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98751, "{0}的薪资核算结果还未申报,不能新建{1}的薪资核算") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(notDeclared.getSalaryMonth()).toString()) + .replace("{1}", saveParam.getSalaryMonth().toString())); + } + // 如果某个月(薪资所属月)已经归档了,不可以新建之前月份的薪资核算 + SalaryAcctRecordPO hasArchived = salaryAcctRecordPOS.stream() + .filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.ARCHIVED.getValue()) + && salaryAcctRecordPO.getSalaryMonth().before(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(hasArchived)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98752, "{0}的薪资核算结果已经归档,不能新建{1}的薪资核算") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasArchived.getSalaryMonth()).toString()) + .replace("{1}", saveParam.getSalaryMonth().toString())); + } + // 如果某个月(薪资所属月)已经申报了,不可以新建本月以及之前月份的薪资核算 + SalaryAcctRecordPO hasDeclared = salaryAcctRecordPOS.stream() + .filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue()) + && salaryAcctRecordPO.getSalaryMonth().before(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)))) + .findAny() + .orElse(null); + if (Objects.nonNull(hasDeclared)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98753, "{0}的薪资核算结果已经申报,不能新建{1}的薪资核算") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(hasDeclared.getSalaryMonth()).toString()) + .replace("{1}", saveParam.getSalaryMonth().toString())); + } + // 计算当前所选的薪资账套是当前薪资所属月的核算次数 + long acctTimes = salaryAcctRecordPOS.stream() + .filter(salaryAcctRecordPO -> Objects.equals(salaryAcctRecordPO.getSalarySobId(), saveParam.getSalarySobId()) + && salaryAcctRecordPO.getSalaryMonth().equals(SalaryDateUtil.localDateToDate(saveParam.getSalaryMonth().atDay(1)))) + .count(); + // 查询税款所属期 + SalarySobCycleDTO salarySobCycleDTO = salarySobService.getSalarySobCycle(saveParam.getSalarySobId(), saveParam.getSalaryMonth()); + // 转换成po + SalaryAcctRecordPO salaryAcctRecordPO = SalaryAcctRecordBO.convert2PO(saveParam, salarySobCycleDTO, (int) acctTimes, employeeId); + // 保存薪资核算记录 + SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class); + salaryAcctRecordMapper.insertIgnoreNull(salaryAcctRecordPO); + // 初始化薪资核算人员 + salaryAcctEmployeeService.initBySalaryAcctRecord(salaryAcctRecordPO); + // 记录日志 +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); +// loggerContext.setTargetName(targetName); +// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98768, "新建薪资核算")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98768, "新建薪资核算") + ": " + targetName); +// loggerContext.setNewValues(salaryAcctRecordPO); +// salaryAcctRecordLoggerTemplate.write(loggerContext); + // 返回薪资核算记录id + return salaryAcctRecordPO.getId(); + } + + @Override + public void updateStatusByIds(Collection ids, SalaryAcctRecordStatusEnum status) { + // 查询薪资核算记录 + List salaryAcctRecordPOS = listByIds(ids); + if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 更新薪资核算记录的状态 + Date now = new Date(); + salaryAcctRecordPOS.forEach(salaryAcctRecordPO -> { + salaryAcctRecordPO.setStatus(status.getValue()); + salaryAcctRecordPO.setUpdateTime(now); + salaryAcctRecordMapper.updateIgnoreNull(salaryAcctRecordPO); + }); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByIds(Collection ids) { + // 查询薪资核算记录 + List salaryAcctRecordPOS = listByIds(ids); + if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + ids = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId); + // 只有未归档的薪资核算记录才允许删除 + boolean hasArchived = salaryAcctRecordPOS.stream().anyMatch(salaryAcctRecordPO -> !Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())); + if (hasArchived) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98748, "只有未归档的薪资核算记录才允许删除")); + } + // 查询账套(记录日志用) + Set salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId); + List salarySobPOS = salarySobService.listByIds(salarySobIds); + Map salarySobPOMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getId); + // 删除薪资核算记录 + salaryAcctRecordMapper.deleteByIds(ids); + //todo 删除薪资核算人员 +// salaryAcctEmployeeService.deleteBySalaryAcctRecordIds(ids); +// // 删除薪资核算结果 +// salaryAcctResultService.deleteBySalaryAcctRecordIds(ids); +// // 删除校验异常 +// salaryCheckResultService.deleteBySalaryAcctRecordIds(ids); +// // 删除校验异常明细 +// salaryCheckResultDetailService.deleteBySalaryAcctRecordIds(ids); +// // 删除线下导入结果 +// salaryComparisonResultService.deleteBySalaryAcctRecordIds(ids); + + // 变更核算次数 + List toUpdateAcctTimesRecordPOS = listBySalarySobIds(salarySobIds); + toUpdateAcctTimesRecordPOS = SalaryAcctRecordBO.updateAcctTimes(salaryAcctRecordPOS, toUpdateAcctTimesRecordPOS); + for (SalaryAcctRecordPO salaryAcctRecordPO : toUpdateAcctTimesRecordPOS) { + salaryAcctRecordMapper.updateIgnoreNull(salaryAcctRecordPO); + } + + // 记录日志 +// salaryAcctRecordPOS.forEach(salaryAcctRecordPO -> { +// SalarySobPO salarySobPO = salarySobPOMap.get(salaryAcctRecordPO.getSalarySobId()); +// String targetName = salarySobPO.getName() + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); +// loggerContext.setTargetName(targetName); +// loggerContext.setOperateType(OperateTypeEnum.DELETE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98821, "删除薪资核算")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98821, "删除薪资核算") + ":" + targetName); +// loggerContext.setNewValues(salaryAcctRecordPO); +// salaryAcctRecordLoggerTemplate.write(loggerContext); +// }); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void file(Long salaryAcctRecordId) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + //todo 如果存在未忽略的校验异常,不允许归档 +// List salaryCheckResultPOS = salaryCheckResultService.listBySalaryAcctRecordIdAndIgnoreType(salaryAcctRecordId, NumberUtils.INTEGER_ZERO); +// if (CollectionUtils.isNotEmpty(salaryCheckResultPOS)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98784, "核算结果尚未通过校验规则,请确认是否需要忽略校验异常后再归档")); +// } + // 查询薪资核算结果 + List salaryAcctResultPOS = salaryAcctResultService.listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecordId)); + if (CollectionUtils.isEmpty(salaryAcctResultPOS)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99691, "尚未核算,请先核算后再归档")); + } + // 更新薪资核算记录的状态 + salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.ARCHIVED.getValue()); + salaryAcctRecordPO.setUpdateTime(new Date()); + salaryAcctRecordMapper.updateIgnoreNull(salaryAcctRecordPO); + //todo 生成工资单 +// salarySendService.generateSalaryBill(salaryAcctRecordId, employeeId, tenantKey); + // 记录日志 +// String targetName = getLogTargetNameById(salaryAcctRecordId); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); +// loggerContext.setTargetName(targetName); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98817, "薪资核算归档")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98817, "薪资核算归档") + ": " + targetName); +// loggerContext.setNewValues(salaryAcctRecordPO); +// salaryAcctRecordLoggerTemplate.write(loggerContext); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void reCalculate(Long salaryAcctRecordId) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getById(salaryAcctRecordId); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 如果薪资核算记录还未归档,不允许重新核算 + if (Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98819, "薪资核算结果还未归档,可直接核算")); + } + // 薪资所属月所在年的日期范围(第一天~最后一天) + LocalDateRange yearRange = SalaryDateUtil.localDate2YearRange(salaryAcctRecordPO.getSalaryMonth()); + if (Objects.isNull(yearRange)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + } + // 查询薪资所属月所在年的所有薪资核算记录 + List salaryAcctRecordPOS = listBySalaryMonth(yearRange); + // 如果已经存在之后月份的薪资核算记录了,就不允许重新核算本月了 + SalaryAcctRecordPO afterSalaryAcctRecordPO = salaryAcctRecordPOS.stream() + .filter(po -> po.getSalaryMonth().compareTo(salaryAcctRecordPO.getSalaryMonth()) > 0) + .findAny() + .orElse(null); + if (Objects.nonNull(afterSalaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(105826, "已经存在{0}的薪资核算记录了,不能重新核算{1}的薪资了") + .replace("{0}", SalaryDateUtil.localDate2YearMonth(afterSalaryAcctRecordPO.getSalaryMonth()).toString()) + .replace("{1}", SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString())); + } + // 更新薪资核算记录的状态 + salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); + salaryAcctRecordPO.setUpdateTime(new Date()); + salaryAcctRecordMapper.updateIgnoreNull(salaryAcctRecordPO); + //todo 撤回工资单 +// salarySendService.revokeSalaryBill(salaryAcctRecordId); + //todo 删除个税申报表(个税申报表、个税申报表详情、往期累计情况) +// taxDeclarationService.deleteBySalaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()), tenantKey); + // 记录日志 +// String targetName = getLogTargetNameById(salaryAcctRecordPO.getId(), tenantKey); +// LoggerContext loggerContext = new LoggerContext<>(); +// loggerContext.setTargetId("" + salaryAcctRecordPO.getId()); +// loggerContext.setTargetName(targetName); +// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue()); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(98820, "重新核算")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(98820, "重新核算") + ": " + targetName); +// loggerContext.setNewValues(salaryAcctRecordPO); +// salaryAcctRecordLoggerTemplate.write(loggerContext); + } + + @Override + public Integer hasConsolidatedTax(Long id) { + // 查询合并计税的其他薪资核算记录 + List otherSalaryAcctRecordPOS = listById4OtherConsolidatedTax(id); + if (CollectionUtils.isEmpty(otherSalaryAcctRecordPOS)) { + return NumberUtils.INTEGER_ZERO; + } + // 查询本次核算的薪资核算人员 + List salaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordId(id); + // 查询其他核算记录中的薪资核算人员 + Set otherSalaryAcctRecordIds = SalaryEntityUtil.properties(otherSalaryAcctRecordPOS, SalaryAcctRecordPO::getId); + List otherSalaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordIds(otherSalaryAcctRecordIds); + // 有其他核算记录,需要进一步判断本次核算的人员中是否存在合并计税 + Set keySet = SalaryEntityUtil.properties(otherSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId()); + boolean hasConsolidatedTax = salaryAcctEmployeePOS.stream().anyMatch(salaryAcctEmployeePO -> keySet.contains(salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId())); + if (hasConsolidatedTax) { + return NumberUtils.INTEGER_ONE; + } + return NumberUtils.INTEGER_ZERO; + } + + @Override + public String getLogTargetNameById(Long id) { + // 查询薪资核算记录 + SalaryAcctRecordPO salaryAcctRecordPO = getById(id); + if (Objects.isNull(salaryAcctRecordPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); + } + // 查询账套 + SalarySobPO salarySobPO = salarySobService.getById(salaryAcctRecordPO.getSalarySobId()); + if (Objects.isNull(salarySobPO)) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "薪资账套不存在或已被删除")); + } + return salarySobPO.getName() + SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()); + } +} diff --git a/src/com/engine/salary/transmethod/TaxRateTransMethod.java b/src/com/engine/salary/transmethod/TaxRateTransMethod.java index c2ea334f0..f9c8144a0 100644 --- a/src/com/engine/salary/transmethod/TaxRateTransMethod.java +++ b/src/com/engine/salary/transmethod/TaxRateTransMethod.java @@ -26,7 +26,7 @@ public class TaxRateTransMethod { /** * @description :操作的显示隐藏 */ - public static ArrayList getOpratePopedomWithType(String type) throws Exception { + public static ArrayList getOpratePopedomWithType(String type) { ArrayList returnList = new ArrayList(); String edit = "true"; String delete = "true"; diff --git a/src/com/engine/salary/transmethod/TransMethod.java b/src/com/engine/salary/transmethod/TransMethod.java index b77571151..f261cddaf 100644 --- a/src/com/engine/salary/transmethod/TransMethod.java +++ b/src/com/engine/salary/transmethod/TransMethod.java @@ -1,15 +1,19 @@ package com.engine.salary.transmethod; +import com.engine.salary.enums.SalaryCycleTypeEnum; import com.engine.salary.enums.SalaryDataSourceEnum; import com.engine.salary.enums.datacollection.AttendQuoteFieldSourceTypeEnum; import com.engine.salary.enums.datacollection.AttendQuoteFieldTypeEnum; import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.enums.sicategory.RententionRuleEnum; +import com.engine.salary.util.SalaryI18nUtil; +import org.apache.commons.lang3.StringUtils; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Objects; public class TransMethod { @@ -98,4 +102,41 @@ public class TransMethod { return SalaryDataTypeEnum.getDefaultLabelByValue(Integer.valueOf(valueType)); } + public static String buildSalaryCycle(String cycleType,Integer salaryCycleFromDay) { + String salaryCycleStr; + SalaryCycleTypeEnum salaryCycleTypeEnum = SalaryCycleTypeEnum.parseByValue(Integer.parseInt(cycleType)); + if (salaryCycleTypeEnum == null) { + return StringUtils.EMPTY; + } + switch (salaryCycleTypeEnum) { + case BEFORE_LAST_MONTH: + salaryCycleStr = Objects.equals(salaryCycleFromDay, 1) ? SalaryI18nUtil.getI18nLabel(98395, "上上月1号——上上月最后一天") + : SalaryI18nUtil.getI18nLabel(98399, "上上月{0}号——上月{1}号") + .replace("{0}", "" + salaryCycleFromDay) + .replace("{1}", "" + (salaryCycleFromDay - 1)); + break; + case LAST_MONTH: + salaryCycleStr = Objects.equals(salaryCycleFromDay, 1) ? SalaryI18nUtil.getI18nLabel(98396, "上月1号——上月最后一天") + : SalaryI18nUtil.getI18nLabel(98400, "上月{0}号——本月{1}号") + .replace("{0}", "" + salaryCycleFromDay) + .replace("{1}", "" + (salaryCycleFromDay - 1)); + break; + case THIS_MONTH: + salaryCycleStr = Objects.equals(salaryCycleFromDay, 1) ? SalaryI18nUtil.getI18nLabel(98397, "上月1号——上月最后一天") + : SalaryI18nUtil.getI18nLabel(98401, "本月{0}号——下月{1}号") + .replace("{0}", "" + salaryCycleFromDay) + .replace("{1}", "" + (salaryCycleFromDay - 1)); + break; + case NEXT_MONTH: + salaryCycleStr = Objects.equals(salaryCycleFromDay, 1) ? SalaryI18nUtil.getI18nLabel(98398, "下月1号——下月最后一天") + : SalaryI18nUtil.getI18nLabel(98402, "下月{0}号——下下月{1}号") + .replace("{0}", "" + salaryCycleFromDay) + .replace("{1}", "" + (salaryCycleFromDay - 1)); + break; + default: + salaryCycleStr = ""; + } + return salaryCycleStr; + } + } diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index cf0e2d598..f1995f281 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -1,5 +1,6 @@ package com.engine.salary.util; +import com.engine.salary.common.LocalDateRange; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; @@ -12,6 +13,7 @@ import java.time.*; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -65,6 +67,13 @@ public class SalaryDateUtil { return localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli(); } + public static Long localDateTime2EpochMilli(Date localDateTime) { + if (localDateTime == null) { + return NumberUtils.LONG_ZERO; + } + return localDateTime.getTime(); + } + public static String getFormatYearMonth(LocalDate localDate) { if (localDate == null) { return StringUtils.EMPTY; @@ -77,6 +86,19 @@ public class SalaryDateUtil { } } + + public static String getFormatYearMonth(Date localDate) { + if (localDate == null) { + return StringUtils.EMPTY; + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(MONTH_FORMATTER_PATTERN); + return simpleDateFormat.format(localDate); + } catch (Exception e) { + log.warn("格式化月份错误", e); + return StringUtils.EMPTY; + } + } public static String getFormatLocalDate(LocalDate localDate) { if (localDate == null) { return StringUtils.EMPTY; @@ -113,6 +135,19 @@ public class SalaryDateUtil { } } + public static String getFormatLocalDateTime(Date localDateTime) { + if (localDateTime == null) { + return StringUtils.EMPTY; + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_FORMATTER_PATTERN); + return simpleDateFormat.format(localDateTime); + } catch (Exception e) { + log.warn("格式化日期错误", e); + return StringUtils.EMPTY; + } + } + public static LocalDateTime dateToLocalDateTime(Date date) { Instant instant = date.toInstant(); ZoneId zone = ZoneId.systemDefault(); @@ -135,32 +170,68 @@ public class SalaryDateUtil { return getFormatLocalDate(localDateTime); } - public static YearMonth localDate2YearMonth(LocalDate localDate) { + public static YearMonth localDate2YearMonth(Date localDate) { if (localDate == null) { return null; } - return YearMonth.of(localDate.getYear(), localDate.getMonthValue()); + Calendar c = Calendar.getInstance(); + c.setTime(localDate); + int year = c.get(Calendar.YEAR); + int month = c.get(Calendar.MONTH) + 1; + return YearMonth.of(year, month); } -// public static LocalDateRange localDate2Range(LocalDate localDate) { -// if (localDate == null) { -// return null; -// } -// return LocalDateRange.builder() -// .fromDate(localDate.with(TemporalAdjusters.firstDayOfMonth())) -// .endDate(localDate.with(TemporalAdjusters.lastDayOfMonth())) -// .build(); -// } -// -// public static LocalDateRange localDate2YearRange(LocalDate localDate) { -// if (localDate == null) { -// return null; -// } -// return LocalDateRange.builder() -// .fromDate(localDate.with(TemporalAdjusters.firstDayOfYear())) -// .endDate(localDate.with(TemporalAdjusters.lastDayOfYear())) -// .build(); -// } + public static LocalDateRange localDate2Range(Date localDate) { + if (localDate == null) { + return null; + } + return LocalDateRange.builder() + .fromDate(getFirstDayDateOfMonth(localDate)) + .endDate(getLastDayOfMonth(localDate)) + .build(); + } + + public static LocalDateRange localDate2YearRange(Date localDate) { + if (localDate == null) { + return null; + } + return LocalDateRange.builder() + .fromDate(getFirstDayDateOfYear(localDate)) + .endDate(getLastDayOfYear(localDate)) + .build(); + } + + public static Date getFirstDayDateOfMonth(final Date date) { + final Calendar cal = Calendar.getInstance(); + cal.setTime(date); + final int last = cal.getActualMinimum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, last); + return cal.getTime(); + } + + public static Date getLastDayOfMonth(final Date date) { + final Calendar cal = Calendar.getInstance(); + cal.setTime(date); + final int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, last); + return cal.getTime(); + } + + public static Date getFirstDayDateOfYear(final Date date) { + final Calendar cal = Calendar.getInstance(); + cal.setTime(date); + final int last = cal.getActualMinimum(Calendar.DAY_OF_YEAR); + cal.set(Calendar.DAY_OF_YEAR, last); + return cal.getTime(); + } + + public static Date getLastDayOfYear(final Date date) { + final Calendar cal = Calendar.getInstance(); + cal.setTime(date); + final int last = cal.getActualMaximum(Calendar.DAY_OF_YEAR); + cal.set(Calendar.DAY_OF_YEAR, last); + return cal.getTime(); + } public static String getMonthBegin(String specifiedDay) { int year; @@ -234,4 +305,83 @@ public class SalaryDateUtil { } + + /** + * LocalDate转YearMonth + * @param localDate + * @return + */ + public static YearMonth toYearMonth(LocalDate localDate){ + Objects.requireNonNull(localDate, "localDate"); + return YearMonth.of(localDate.getYear(), localDate.getMonthValue()); + } + + + + /** + * YearMonth转Date + * 注意dayOfMonth范围:1到31之间,最大值根据月份确定特殊情况,如2月闰年29,非闰年28 + * 如果要转换为当月最后一天,可以使用下面方法:toDateEndOfMonth(YearMonth) + * @param yearMonth + * @param dayOfMonth + * @return + */ + public static Date toDate(YearMonth yearMonth, int dayOfMonth) { + Objects.requireNonNull(yearMonth, "yearMonth"); + return localDateToDate(yearMonth.atDay(dayOfMonth)); + } + + /** + * YearMonth转Date,转换为当月第一天 + * @param yearMonth + * @return + */ + public static Date toDateStartOfMonth(YearMonth yearMonth) { + return toDate(yearMonth, 1); + } + + /** + * YearMonth转Date,转换为当月最后一天 + * @param yearMonth + * @return + */ + public static Date toDateEndOfMonth(YearMonth yearMonth) { + Objects.requireNonNull(yearMonth, "yearMonth"); + return localDateToDate(yearMonth.atEndOfMonth()); + } + + + /** + * YearMonth转LocalDate + * 注意dayOfMonth范围:1到31之间,最大值根据月份确定特殊情况,如2月闰年29,非闰年28 + * 如果要转换为当月最后一天,可以使用下面方法:toLocalDateEndOfMonth(YearMonth) + * @param yearMonth + * @param dayOfMonth + * @return + */ + public static LocalDate toLocalDate(YearMonth yearMonth, int dayOfMonth) { + Objects.requireNonNull(yearMonth, "yearMonth"); + return yearMonth.atDay(dayOfMonth); + } + + /** + * YearMonth转LocalDate,转换为当月第一天 + * @param yearMonth + * @return + */ + public static LocalDate toLocalDateStartOfMonth(YearMonth yearMonth) { + return toLocalDate(yearMonth, 1); + } + + /** + * YearMonth转LocalDate,转换为当月最后一天 + * @param yearMonth + * @return + */ + public static LocalDate toLocalDateEndOfMonth(YearMonth yearMonth) { + Objects.requireNonNull(yearMonth, "yearMonth"); + return yearMonth.atEndOfMonth(); + } + + } diff --git a/src/com/engine/salary/util/db/SqlProxyHandle.java b/src/com/engine/salary/util/db/SqlProxyHandle.java index c985f2ef9..00b938a4c 100644 --- a/src/com/engine/salary/util/db/SqlProxyHandle.java +++ b/src/com/engine/salary/util/db/SqlProxyHandle.java @@ -1,5 +1,5 @@ /** - * + * */ package com.engine.salary.util.db; @@ -14,59 +14,67 @@ import java.lang.reflect.Proxy; * @author zhangjian * @date 2017-8-25 下午5:41:17 */ -public class SqlProxyHandle implements InvocationHandler{ - private Class clazz; - private boolean isAutoCommit = true; - private SqlSession session; +public class SqlProxyHandle implements InvocationHandler { + private Class clazz; + private boolean isAutoCommit = true; + private SqlSession session; + public SqlProxyHandle(Class clazz) { this.clazz = clazz; } - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Exception { - if(isAutoCommit) { - this.session = MyBatisFactory.sqlSessionFactory.openSession(); - } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Exception { + if (this.session == null) { + this.session = MyBatisFactory.sqlSessionFactory.openSession(); + } // System.out.println(MyBatisFactory.getSql(this.clazz, method.getName(), args[0])); - try{ - Object target = session.getMapper(clazz); - return method.invoke(target, args); - } finally { - if(isAutoCommit) { - session.commit(); - session.close(); - } - } - } - public Object getProxy() { - if(!isAutoCommit) - this.session = MyBatisFactory.sqlSessionFactory.openSession(); + try { + Object target = session.getMapper(clazz); + return method.invoke(target, args); + } finally { + if (isAutoCommit) { + session.commit(); + session.close(); + } + } + } + + public Object getProxy() { + if (!isAutoCommit) + this.session = MyBatisFactory.sqlSessionFactory.openSession(); ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class[] interfaces = new Class[1]; interfaces[0] = this.clazz; return Proxy.newProxyInstance(loader, interfaces, this); } - public Object getProxy(boolean isAutoCommit) { - this.isAutoCommit = isAutoCommit; + + public Object getProxy(boolean isAutoCommit) { + this.isAutoCommit = isAutoCommit; return this.getProxy(); } - public void commit(){ - if(this.session != null) { - this.session.commit(); - this.session.close(); - } - } - public void rollback(){ - if(this.session != null) { - this.session.rollback(); - this.session.close(); - } - } - public static T getProxy(Class clazz) { - SqlProxyHandle handle = new SqlProxyHandle(clazz); - return (T) handle.getProxy(); - } - public static T getProxy(Class clazz, boolean isAutoSubmit) { - SqlProxyHandle handle = new SqlProxyHandle(clazz); - return (T) handle.getProxy(isAutoSubmit); - } + + public void commit() { + if (this.session != null) { + this.session.commit(); + this.session.close(); + } + } + + public void rollback() { + if (this.session != null) { + this.session.rollback(); + this.session.close(); + } + } + + public static T getProxy(Class clazz) { + SqlProxyHandle handle = new SqlProxyHandle(clazz); + return (T) handle.getProxy(); + } + + public static T getProxy(Class clazz, boolean isAutoSubmit) { + SqlProxyHandle handle = new SqlProxyHandle(clazz); + return (T) handle.getProxy(isAutoSubmit); + } } diff --git a/src/com/engine/salary/web/SalaryAcctController.java b/src/com/engine/salary/web/SalaryAcctController.java new file mode 100644 index 000000000..a7c90fdc4 --- /dev/null +++ b/src/com/engine/salary/web/SalaryAcctController.java @@ -0,0 +1,390 @@ +package com.engine.salary.web; + +/** + * 薪资核算 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public class SalaryAcctController { + +// private SalaryAcctRecordWrapper salaryAcctRecordWrapper; +// private SalaryAcctEmployeeWrapper salaryAcctEmployeeWrapper; +// private SalaryAcctResultWrapper salaryAcctResultWrapper; +// private SalaryAcctCheckResultWrapper salaryAcctCheckResultWrapper; +// private SalaryComparisonResultWrapper salaryComparisonResultWrapper; +// private SalaryAcctExcelWrapper salaryAcctExcelWrapper; +// private SalaryAcctExcelService salaryAcctExcelService; +// private SalaryBatchService salaryBatchService; +// +// /**********************************薪资核算记录相关 start*********************************/ +// +// @PostMapping("/list") +// @ApiOperation("薪资核算列表") +// @WeaPermission +// public WeaResult> listSalaryAccounting(@RequestBody @Validated SalaryAcctRecordQueryParam queryParam) { +// WeaTable weaTable = salaryAcctRecordWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @GetMapping("/getForm") +// @ApiOperation("薪资核算详情") +// @WeaPermission +// public WeaResult getForm(@RequestParam(value = "id", required = false) Long id) { +// WeaForm weaForm = salaryAcctRecordWrapper.getForm(id, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaForm); +// } +// +// @GetMapping("/getSalarySobCycle") +// @ApiOperation(("获取薪资核算的薪资周期、考勤周期等")) +// @WeaPermission +// public WeaResult getSalarySobCycle(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { +// SalarySobCycleDTO salarySobCycle = salaryAcctRecordWrapper.getSalarySobCycleById(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(salarySobCycle); +// } +// +// @PostMapping("/basic/save") +// @ApiOperation("保存薪资核算的基本信息") +// @WeaPermission +// public WeaResult saveBasic(@RequestBody @Validated SalaryAcctRecordSaveParam saveParam) { +// Long salaryAcctRecordId = salaryAcctRecordWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(salaryAcctRecordId); +// } +// +// @PostMapping("/delete") +// @ApiOperation("删除薪资核算记录") +// @WeaPermission +// public WeaResult deleteSalaryAcctRecord(@RequestBody Collection ids) { +// salaryAcctRecordWrapper.delete(ids, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/file") +// @ApiOperation("归档薪资核算记录") +// @WeaPermission +// public WeaResult fileSalaryAcctRecord(@RequestParam(value = "id") Long id) { +// salaryAcctRecordWrapper.file(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/reAccounting") +// @ApiOperation("重新核算") +// @WeaPermission +// public WeaResult reAccounting(@RequestBody @Validated SalaryAcctRecordReAccountParam param) { +// salaryAcctRecordWrapper.reCalculate(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @GetMapping("/hasConsolidatedTax") +// @ApiOperation("判断是否存在合并计税") +// @WeaPermission +// public WeaResult hasConsolidatedTax(@RequestParam(value = "id") Long id) { +// Integer result = salaryAcctRecordWrapper.hasConsolidatedTax(id, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(result); +// } +// +// /**********************************薪资核算记录相关 end*********************************/ +// +// +// /**********************************薪资核算人员相关 start*********************************/ +// +// @PostMapping("/acctemployee/list") +// @ApiOperation("薪资核算人员确认列表") +// @WeaPermission +// public WeaResult> listSalaryAccountingEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { +// WeaTable weaTable = salaryAcctEmployeeWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @PostMapping("/reducedemployee/list") +// @ApiOperation("薪资核算环比上期减少人员列表") +// @WeaPermission +// public WeaResult> listReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { +// WeaTable weaTable = salaryAcctEmployeeWrapper.listPage4Reduce(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @GetMapping("/acctemployee/getSearchCondition") +// @ApiOperation("薪资核算人员高级搜索") +// @WeaPermission +// public WeaResult getAcctEmpSearchCondition() { +// WeaSearchCondition searchCondition = salaryAcctEmployeeWrapper.getCondition(TenantContext.getCurrentTenantKey()); +// return WeaResult.success(searchCondition); +// } +// +// @PostMapping("/acctemployee/save") +// @ApiOperation("添加薪资核算人员") +// @WeaPermission +// public WeaResult saveSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeSaveParam saveParam) { +// salaryAcctEmployeeWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctemployee/delete") +// @ApiOperation("删除薪资核算人员") +// @WeaPermission +// public WeaResult deleteSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeDeleteParam deleteParam) { +// salaryAcctEmployeeWrapper.delete(deleteParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctemployee/checkTaxAgent") +// @ApiOperation("检查薪资核算人员的个税扣缴义务人") +// @WeaPermission +// public WeaResult checkTaxAgent(@RequestBody @Validated SalaryAcctEmpCheckTaxAgentParam param) { +// salaryAcctEmployeeWrapper.checkTaxAgent(param.getSalaryAcctRecordId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctemployee/refreshTaxAgent") +// @ApiOperation("刷新薪资核算人员的个税扣缴义务人") +// @WeaPermission +// public WeaResult refreshTaxAgent(@RequestBody @Validated SalaryAcctEmpRefreshTaxAgentParam param) { +// salaryAcctEmployeeWrapper.refreshTaxAgent(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctemployee/addFromReduce") +// @ApiOperation("从环比上月减少添加薪资核算人员") +// @WeaPermission +// public WeaResult addFromReduce(@RequestBody @Validated SalaryAcctEmployeeAddParam param) { +// salaryAcctEmployeeWrapper.addFromReduce(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctemployee/export") +// @ApiOperation("导出人员范围") +// @WeaPermission +// public WeaResult> exportSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportSalaryAcctEmployee(queryParam, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// @PostMapping("/reducedemployee/export") +// @ApiOperation("导出环比减少人员") +// @WeaPermission +// public WeaResult> exportReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportReducedEmployee(queryParam, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// /**********************************薪资核算人员相关 end*********************************/ +// +// /**********************************薪资核算结果 start*********************************/ +// +// @PostMapping("/acctresult/list") +// @ApiOperation(("薪资核算结果列表")) +// @WeaPermission +// public WeaResult>> listSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) { +// WeaTable> weaTable = salaryAcctResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @GetMapping("/acctresult/getSearchCondition") +// @ApiOperation(("获取薪资核算结果高级搜索")) +// @WeaPermission +// public WeaResult getSalaryAcctResultSearchCondition() { +// WeaSearchCondition searchCondition = salaryAcctResultWrapper.getSearchCondition(TenantContext.getCurrentTenantKey()); +// return WeaResult.success(searchCondition); +// } +// +// @GetMapping("/acctresult/detail") +// @ApiOperation(("薪资核算结果详情")) +// @WeaPermission +// public WeaResult getSalaryAcctResultDetail(@RequestParam(value = "id") Long id) { +// SalaryAcctResultDetailDTO dto = salaryAcctResultWrapper.getForm(id, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(dto); +// } +// +// @GetMapping("/acctresult/getConsolidatedTaxDetail") +// @ApiOperation(("薪资核算合并计税详情")) +// @WeaPermission +// public WeaResult getConsolidatedTaxDetail(@RequestParam(value = "salaryAcctEmpId") Long salaryAcctEmpId) { +// ConsolidatedTaxDetailDTO dto = salaryAcctResultWrapper.getConsolidatedTaxDetail(salaryAcctEmpId, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(dto); +// } +// +// @PostMapping("/acctresult/save") +// @ApiOperation(("编辑薪资核算结果")) +// @WeaPermission +// public WeaResult saveSalaryAcctResult(@RequestBody @Validated SalaryAcctResultSaveParam saveParam) { +// salaryAcctResultWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctresult/accounting") +// @ApiOperation("薪资核算") +// @WeaPermission +// public WeaResult accounting(@RequestBody @Validated SalaryAcctCalculateParam acctParam) { +// salaryAcctResultWrapper.calculate(acctParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(""); +// } +// +// @PostMapping("/acctresult/export") +// @ApiOperation("导出核算结果") +// @WeaPermission +// public WeaResult> exportSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportSalaryAcctResult(queryParam, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// @GetMapping("/acctresult/importField") +// @ApiOperation("导入核算结果前生成导入模板时可选的薪资项目") +// @WeaPermission +// public WeaResult getImportField(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { +// SalaryAcctImportFieldDTO importField = salaryAcctExcelService.getImportField(salaryAcctRecordId, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(importField); +// } +// +// @PostMapping("/acctresult/importtemplate/export") +// @ApiOperation("导出导入模板") +// @WeaPermission +// public WeaResult> exportImportTemplate(@RequestBody @Validated SalaryAcctImportTemplateParam param) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportImportTemplate(param, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// @GetMapping("/acctresult/importParams") +// @ApiOperation("获取导入核算结果的导入参数") +// @WeaPermission +// public WeaResult getAcctResultImportParams() { +// return WeaResult.success(salaryBatchService.buildImportParam("importSalaryAcctResult", +// "importSalaryAcctResult", +// "薪资核算结果", +// null, +// null)); +// } +// +// /**********************************薪资核算结果 end*********************************/ +// +// /**********************************检验异常 start*********************************/ +// +// @GetMapping("/checkresult/getCount") +// @ApiOperation(("获取校验结果(异常)总数")) +// @WeaPermission +// public WeaResult getCheckResultCount(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { +// Integer salaryCheckResultCount = salaryAcctCheckResultWrapper.countBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(salaryCheckResultCount); +// } +// +// @PostMapping("/checkresult/list") +// @ApiOperation("校验结果列表") +// @WeaPermission +// public WeaResult> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) { +// WeaTable weaTable = salaryAcctCheckResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @PostMapping("/checkresultdetail/list") +// @ApiOperation("校验结果明细列表") +// @WeaPermission +// public WeaResult> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) { +// WeaTable weaTable = salaryAcctCheckResultWrapper.listPage4CheckResultRecord(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @PostMapping("/checkresult/ignore") +// @ApiOperation("校验结果列表") +// @WeaPermission +// public WeaResult ignoreCheckResult(@RequestParam(value = "id") Long id) { +// salaryAcctCheckResultWrapper.ignoreById(id, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/checkresult/ignoreAll") +// @ApiOperation("校验结果列表") +// @WeaPermission +// public WeaResult ignoreAllCheckResult(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { +// salaryAcctCheckResultWrapper.ignoreBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/acctresult/check") +// @ApiOperation(("薪资核算结果校验")) +// @WeaPermission +// public WeaResult check(@RequestBody @Validated SalaryAcctCheckParam checkParam) { +// salaryAcctResultWrapper.check(checkParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey()); +// return WeaResult.success(null); +// } +// +// @PostMapping("/checkresult/export") +// @ApiOperation("校验异常导出") +// @WeaPermission +// public WeaResult> exportCheckResult(@RequestBody @Validated SalaryCheckResultExportParam exportParam) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportCheckResult(exportParam, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// @PostMapping("/checkresultRecord/export") +// @ApiOperation("校验异常明细导出") +// @WeaPermission +// public WeaResult> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportCheckResultDetail(checkResultId, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// /**********************************检验异常 end*********************************/ +// +// /**********************************线下对比 start*********************************/ +// +// @PostMapping("/comparisonresult/list") +// @ApiOperation("线上线下对比结果列表") +// @WeaPermission +// public WeaResult>> listComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) { +// WeaTable> weaTable = salaryComparisonResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); +// return WeaResult.success(weaTable); +// } +// +// @GetMapping("/comparisonresult/importParams") +// @ApiOperation("获取导入核算结果的导入参数") +// @WeaPermission +// public WeaResult getComparisonResultImportParams() { +// return WeaResult.success(salaryBatchService.buildImportParam("importExcelAcctResult", +// "importExcelAcctResult", +// "线下核算结果", +// null, +// null)); +// } +// +// @PostMapping("/comparisonresult/export") +// @ApiOperation("导出线上线下对比结果") +// @WeaPermission +// public WeaResult> exportComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) { +// SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); +// String tenantKey = TenantContext.getCurrentTenantKey(); +// String eteamsId = TenantRpcContext.getEteamsId(); +// Map map = salaryAcctExcelWrapper.exportComparisonResult(queryParam, simpleEmployee, tenantKey, eteamsId); +// return WeaResult.success(map); +// } +// +// @PostMapping("/comparisonresult/importtemplate/export") +// @ApiOperation("线下对比结果导入模板导出") +// @WeaPermission +// public WeaResult> exportComparisonResultTemplate(@RequestBody @Validated SalaryComparisonResultExportParam exportParam) { +// String tenantKey = TenantContext.getCurrentTenantKey(); +// Map map = salaryAcctExcelWrapper.exportComparisonResultTemplate(exportParam, tenantKey); +// return WeaResult.success(map); +// } + + /**********************************线下对比 end*********************************/ +} diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java new file mode 100644 index 000000000..f1f887f1a --- /dev/null +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -0,0 +1,209 @@ +//package com.engine.salary.wrapper; +// +//import com.engine.core.impl.Service; +//import com.weaver.common.cache.tablecache.impl.ComInfoCache; +//import com.weaver.common.component.form.WeaForm; +//import com.weaver.common.component.form.item.WeaFormOption; +//import com.weaver.common.component.table.WeaTable; +//import com.weaver.common.component.table.page.Page; +//import com.weaver.common.component.table.permission.Permission; +//import com.weaver.common.hrm.cache.HrmEmployeeComInfo; +//import com.weaver.hrm.salary.entity.salaryacct.bo.SalaryAcctRecordBO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctEmployeeCountDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO; +//import com.weaver.hrm.salary.entity.salaryacct.dto.SalaryAcctRecordListDTO; +//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; +//import com.weaver.hrm.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; +//import com.weaver.hrm.salary.entity.salaryacct.po.SalaryAcctRecordPO; +//import com.weaver.hrm.salary.entity.salarysob.dto.SalarySobCycleDTO; +//import com.weaver.hrm.salary.entity.salarysob.po.SalarySobPO; +//import com.weaver.hrm.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; +//import com.weaver.hrm.salary.exception.SalaryRunTimeException; +//import com.weaver.hrm.salary.service.SalaryAcctEmployeeService; +//import com.weaver.hrm.salary.service.SalaryAcctRecordService; +//import com.weaver.hrm.salary.service.SalarySobService; +//import com.weaver.hrm.salary.util.SalaryDateUtil; +//import com.weaver.hrm.salary.util.SalaryEntityUtil; +//import com.weaver.hrm.salary.util.SalaryFormatUtil; +//import com.weaver.hrm.salary.util.SalaryI18nUtil; +//import org.apache.commons.collections4.CollectionUtils; +//import org.apache.commons.lang3.math.NumberUtils; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import java.util.*; +//import java.util.stream.Collectors; +// +///** +// * 薪资核算记录 +// *

Copyright: Copyright (c) 2022

+// *

Company: 泛微软件

+// * +// * @author qiantao +// * @version 1.0 +// **/ +//public class SalaryAcctRecordWrapper extends Service { +// +// @Autowired +// private SalaryAcctRecordService salaryAcctRecordService; +// @Autowired +// private SalarySobService salarySobService; +// @Autowired +// private SalaryAcctEmployeeService salaryAcctEmployeeService; +// @Autowired +// private ComInfoCache comInfoCache; +// +// public WeaTable listPage(SalaryAcctRecordQueryParam queryParam, String tenantKey) { +// // 查询薪资核算记录(分页) +// Page page = salaryAcctRecordService.listPageByParam(queryParam, tenantKey); +// Page dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount()); +// if (CollectionUtils.isNotEmpty(page.getRecords())) { +// // 查询薪资账套 +// Set salarySobIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getSalarySobId); +// List salarySobPOS = salarySobService.listByIds(salarySobIds, tenantKey); +// // 查询薪资核算记录的创建人员的人员信息 +// List employeeIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getCreator, Collectors.toList()); +// List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds); +// // 查询薪资核算人数的数量 +// Set salaryAcctRecordIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getId); +// List salaryAcctEmployeeCountDTOS = salaryAcctEmployeeService.countBySalaryAcctRecordId(salaryAcctRecordIds, tenantKey); +// // 转换成列表dto +// List salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(page.getRecords(), salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS); +// dtoPage.setRecords(salaryAcctRecordListDTOS); +// } +// WeaTable weaTable = SalaryFormatUtil.getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage); +// // 只有未归档时可以"核算"、"删除"、"归档" +// // 归档后、申报后可以"查看"、"重新核算" +// for (int i = 0; i < page.getRecords().size(); i++) { +// SalaryAcctRecordPO salaryAcctRecord = page.getRecords().get(i); +// List permissions = weaTable.getOperatesPermission().get(i); +// for (int j = 0; j < permissions.size(); j++) { +// Permission permission = permissions.get(j); +// if ((j == 0 || j == 1 || j == 3) && !Objects.equals(salaryAcctRecord.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { +// permission.setVisible(false); +// permission.setDisabled(false); +// } +// if ((j == 2 || j == 5) && Objects.equals(salaryAcctRecord.getStatus(), SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue())) { +// permission.setVisible(false); +// permission.setDisabled(false); +// } +// } +// } +// return weaTable; +// } +// +// /** +// * 薪资核算记录详情 +// * +// * @param id 薪资核算记录id +// * @param tenantKey 租户key +// * @return +// */ +// public WeaForm getForm(Long id, String tenantKey) { +// SalaryAcctRecordFormDTO formDTO = new SalaryAcctRecordFormDTO(); +// // 查询所有启用的薪资账套 +// List salarySobPOS = salarySobService.listByDisable(NumberUtils.INTEGER_ZERO, tenantKey); +// // 薪资核算详情表单中"薪资账套"的下拉选择项 +// List weaFormOptions = CollectionUtils.emptyIfNull(salarySobPOS).stream() +// .map(salarySobPO -> new WeaFormOption("" + salarySobPO.getId(), salarySobPO.getName())) +// .collect(Collectors.toList()); +// if (Objects.nonNull(id)) { +// // 查询薪资核算 +// SalaryAcctRecordPO salaryAcctRecordPO = salaryAcctRecordService.getById(id, tenantKey); +// if (Objects.isNull(salaryAcctRecordPO)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除")); +// } +// // 查询薪资账套 +// SalarySobPO salarySobPO = salarySobService.getById(salaryAcctRecordPO.getSalarySobId(), tenantKey); +// if (Objects.isNull(salarySobPO)) { +// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "薪资账套不存在或已被删除")); +// } +// // 转换成薪资核算记录详情dto +// formDTO.setId(salaryAcctRecordPO.getId()) +// .setSalarySobId(salarySobPO.getId()) +// .setSalarySobName(salarySobPO.getName()) +// .setSalaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString()) +// .setDescription(salaryAcctRecordPO.getDescription()); +// } +// // 转换成前端所需的数据格式 +// WeaForm weaForm = SalaryFormatUtil.getInstance().buildForm(SalaryAcctRecordFormDTO.class, formDTO); +// weaForm.getItems().forEach((k, v) -> { +// if (Objects.equals(k, "salarySobName")) { +// v.setOptions(weaFormOptions); +// } +// // 薪资核算详情表单的薪资所属月只选择年月 +// if (Objects.equals(k, "salaryMonth")) { +// Map otherParams = new HashMap<>(); +// otherParams.put("type", "month"); +// v.setOtherParams(otherParams); +// } +// }); +// return weaForm; +// } +// +// /** +// * 薪资核算记录所用的薪资账套薪资周期、考勤周期…… +// * +// * @param id 薪资核算记录的id +// * @param tenantKey 租户key +// * @return +// */ +// public SalarySobCycleDTO getSalarySobCycleById(Long id, String tenantKey) { +// return salaryAcctRecordService.getSalarySobCycleById(id, tenantKey); +// } +// +// /** +// * 保存 +// * +// * @param saveParam 保存参数 +// * @param employeeId 人员id +// * @param tenantKey 租户key +// * @return +// */ +// public Long save(SalaryAcctRecordSaveParam saveParam, Long employeeId, String tenantKey) { +// return salaryAcctRecordService.save(saveParam, employeeId, tenantKey); +// } +// +// /** +// * 删除 +// * +// * @param ids 薪资核算记录的id +// * @param tenantKey 租户key +// */ +// public void delete(Collection ids, String tenantKey) { +// salaryAcctRecordService.deleteByIds(ids, tenantKey); +// } +// +// /** +// * 归档 +// * +// * @param id 薪资核算记录的id +// * @param employeeId 人员id +// * @param tenantKey 租户key +// */ +// public void file(Long id, Long employeeId, String tenantKey) { +// salaryAcctRecordService.file(id, employeeId, tenantKey); +// } +// +// /** +// * 重新归档 +// * +// * @param id 薪资核算记录的id +// * @param employeeId 人员id +// * @param tenantKey 租户key +// */ +// public void reCalculate(Long id, Long employeeId, String tenantKey) { +// salaryAcctRecordService.reCalculate(id, employeeId, tenantKey); +// } +// +// /** +// * 判断是否存在合并计税 +// * +// * @param id 主键id +// * @param tenantKey 租户key +// * @return +// */ +// public Integer hasConsolidatedTax(Long id, String tenantKey) { +// return salaryAcctRecordService.hasConsolidatedTax(id, tenantKey); +// } +//}