Merge branch 'feature/qt' into develop

This commit is contained in:
钱涛 2022-04-06 20:01:14 +08:00
commit 91b7a8ffc6
72 changed files with 6714 additions and 80 deletions

View File

@ -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 {
}

View File

@ -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<SimpleEmployee> simpleEmployees;
//
// /**
// * 薪资档案
// */
// private List<SalaryArchiveDataDTO> salaryArchiveData;
//
// /**
// * 累计情况
// */
// private List<AddUpSituationPO> addUpSituationPOS;
//
// /**
// * 累计专项附加扣除
// */
// private List<AddUpDeductionPO> addUpDeductionPOS;
//
// /**
// * 其他扣除
// */
// private List<OtherDeductionPO> otherDeductionPOS;
//
// /**
// * 社保福利
// */
// private List<Map<String, Object>> welfareData;
//
// /**
// * 考勤数据
// */
// private List<AttendQuoteDataDTO> attendQuoteDataDTOS;
//
// /**
// * 薪资核算结果输入/导入的值
// */
// private List<SalaryAcctResultPO> salaryAcctResultPOS;
//
// public CalculateFormulaVarBO(List<SimpleEmployee> simpleEmployees,
// List<SalaryArchiveDataDTO> salaryArchiveData,
// List<AddUpSituationPO> addUpSituationPOS,
// List<AddUpDeductionPO> addUpDeductionPOS,
// List<OtherDeductionPO> otherDeductionPOS,
// List<Map<String, Object>> welfareData,
// List<AttendQuoteDataDTO> attendQuoteDataDTOS,
// List<SalaryAcctResultPO> 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<String, List<FormulaVarValue>> convert2FormulaVar(SalaryAcctCalculateBO salaryAcctCalculateBO) {
// Map<String, List<FormulaVarValue>> 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<String, List<FormulaVarValue>> resultMap) {
// // key:薪资项目的idvalue:薪资项目的code
// Map<Long, String> salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalaryItemPOS(), SalaryItemPO::getId, SalaryItemPO::getCode);
// // key:employeeId_taxAgentIdvalue:薪资核算结果集合
// Map<String, List<SalaryAcctResultPO>> salaryAcctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS,
// salaryAcctResultPO -> salaryAcctResultPO.getEmployeeId() + "_" + salaryAcctResultPO.getTaxAgentId());
// // 填充到返回结果集中
// salaryAcctResultMap.forEach((key, salaryAcctResultPOS) -> {
// List<FormulaVarValue> 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<String, List<FormulaVarValue>> resultMap) {
// // 调薪计薪规则
// Map<Long, SalarySobAdjustRulePO> salarySobAdjustRulePOMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalarySobAdjustRulePOS(),
// SalarySobAdjustRulePO::getSalaryItemId);
// for (SalaryArchiveDataDTO salaryArchiveDataDTO : salaryArchiveData) {
// for (SalaryArchiveTaxAgentDataDTO salaryArchiveTaxAgentDataDTO : salaryArchiveDataDTO.getTaxAgents()) {
// String key = salaryArchiveDataDTO.getEmployeeId() + "_" + salaryArchiveTaxAgentDataDTO.getTaxAgentId();
// List<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
// // 将薪资档案的值转换成公式中的变量填充到返回结果集中
// formulaVarValues.addAll(handleSalaryArchiveItemVal(salaryAcctCalculateBO, salaryArchiveTaxAgentDataDTO.getSalaryItemValues(), salarySobAdjustRulePOMap));
// }
// }
// }
//
// /**
// * 根据调薪计薪规则处理薪资档案的调薪转换成公式编辑器中的变量
// *
// * @param salaryAcctCalculateBO
// * @param salaryArchiveItemDataList
// * @param salarySobAdjustRulePOMap
// * @return
// */
// private List<FormulaVarValue> handleSalaryArchiveItemVal(SalaryAcctCalculateBO salaryAcctCalculateBO,
// List<SalaryArchiveItemDataDTO> salaryArchiveItemDataList,
// Map<Long, SalarySobAdjustRulePO> salarySobAdjustRulePOMap) {
// // 薪资周期
// LocalDateRange salaryCycle = salaryAcctCalculateBO.getSalarySobCycleDTO().getSalaryCycle();
// // key:薪资项目的idvalue:薪资项目的code
// Map<Long, String> salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryAcctCalculateBO.getSalaryItemPOS(), SalaryItemPO::getId, SalaryItemPO::getCode);
// // 将薪资档案的调薪记录按照薪资项目id聚合(同一个薪资项目可能存在多次调薪按照生效日期对调薪记录排序)
// Map<Long, List<SalaryArchiveItemDataDTO>> 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<FormulaVarValue> formulaVarValues = Lists.newArrayListWithExpectedSize(dataMap.size());
// for (Map.Entry<Long, List<SalaryArchiveItemDataDTO>> 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<SalaryArchiveItemDataDTO> 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<String, List<FormulaVarValue>> resultMap) {
// // key:employeeId_taxAgentIdvalue:累计情况工资薪金的数据
// Map<String, AddUpSituationPO> addUpSituationPOMap = SalaryEntityUtil.convert2Map(addUpSituationPOS,
// addUpSituationPO -> addUpSituationPO.getEmployeeId() + "_" + addUpSituationPO.getTaxAgentId());
// // 累计情况工资薪金可选字段
// List<String> 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<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
// Map<String, String> 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<String, List<FormulaVarValue>> resultMap) {
// // key:employeeId_taxAgentIdvalue:累计专项附加扣除的数据
// Map<String, AddUpDeductionPO> addUpDeductionPOMap = SalaryEntityUtil.convert2Map(addUpDeductionPOS,
// addUpDeductionPO -> addUpDeductionPO.getEmployeeId() + "_" + addUpDeductionPO.getTaxAgentId());
// // 累计专项附加扣除可选字段
// List<String> 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<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
// Map<String, String> 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<String, List<FormulaVarValue>> resultMap) {
// // key:employeeId_taxAgentIdvalue:累计专项附加扣除的数据
// Map<String, OtherDeductionPO> otherDeductionPOMap = SalaryEntityUtil.convert2Map(otherDeductionPOS,
// otherDeductionPO -> otherDeductionPO.getEmployeeId() + "_" + otherDeductionPO.getTaxAgentId());
// // 累计专项附加扣除可选字段
// List<String> 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<FormulaVarValue> formulaVarValues = resultMap.computeIfAbsent(key, k -> Lists.newArrayList());
// Map<String, String> 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<String, List<FormulaVarValue>> resultMap) {
// // 社保福利可选字段
// List<String> fieldNames = Lists.newArrayList(salaryAcctCalculateBO.getWelfareColumns().values());
// // 社保福利数据
// Map<String, List<FormulaVarValue>> tempMap = Maps.newHashMapWithExpectedSize(welfareData.size());
// welfareData.forEach(map -> {
// String key = String.valueOf(map.getOrDefault("employeeId", StringUtils.EMPTY));
// List<FormulaVarValue> 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<FormulaVarValue> 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<String, List<FormulaVarValue>> resultMap) {
// // 考勤引用可选字段
// Set<Long> fieldNames = SalaryEntityUtil.properties(salaryAcctCalculateBO.getAttendQuoteFieldListDTOS(), AttendQuoteFieldListDTO::getId);
// // 考勤引用数据
// Map<Long, List<FormulaVarValue>> tempMap = Maps.newHashMapWithExpectedSize(attendQuoteDataDTOS.size());
// attendQuoteDataDTOS.forEach(attendQuoteDataDTO -> {
// Map<Long, String> attendQuoteDataValueMap = SalaryEntityUtil.convert2Map(attendQuoteDataDTO.getDataValues(), AttendQuoteDataValueDTO::getAttendQuoteFieldId, AttendQuoteDataValueDTO::getDataValue);
// Long key = attendQuoteDataDTO.getEmployeeId();
// List<FormulaVarValue> 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<FormulaVarValue> 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;
// }
//}

View File

@ -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<Long, List<FormulaVar>> buildFormulaVar(List<ExpressFormula> expressFormulas) {
// if (CollectionUtils.isEmpty(expressFormulas)) {
// return Collections.emptyMap();
// }
// Map<Long, List<FormulaVar>> 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<FormulaVar> formulaVars = paramArray.toJavaList(FormulaVar.class);
// resultMap.put(expressFormula.getId(), formulaVars);
// }
// }
// }
// return resultMap;
// }
//
// /**
// * 给公式中的变量填入值
// *
// * @param expressFormulas
// * @param salaryItems
// * @param acctResults
// * @return
// */
// public static Map<Long, List<FormulaVar>> buildFormulaVar4Check(List<ExpressFormula> expressFormulas, List<SalaryItemPO> salaryItems, List<SalaryAcctResultPO> acctResults) {
// if (CollectionUtils.isEmpty(expressFormulas)) {
// return Collections.emptyMap();
// }
// Map<Long, String> salaryItemCodeMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId, SalaryItemPO::getCode);
// Map<String, String> acctResultMap = SalaryEntityUtil.convert2Map(acctResults, e -> salaryItemCodeMap.getOrDefault(e.getSalaryItemId(), ""), SalaryAcctResultPO::getResultValue);
// Map<Long, List<FormulaVar>> 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<FormulaVar> buildFormulaVar4Accounting(ExpressFormula expressFormula, Map<String, String> formulaVarValueMap) {
// List<FormulaVar> 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;
// }
//}

View File

@ -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<SalaryAcctRecordPO> otherSalaryAcctRecordPOS;
//
// /**
// * 当前薪资核算记录所用的薪资账套下的薪资项目
// */
// private List<SalarySobItemPO> salarySobItemPOS;
//
// /**
// * 本次运算的薪资项目已排好运算优先级
// */
// private List<List<Long>> salaryItemIdWithPriorityList;
//
// /**
// * 本次运算涉及的所有公式
// */
// private List<ExpressFormula> expressFormulas;
//
// /**
// * 租户下所有的薪资项目
// */
// private List<SalaryItemPO> salaryItemPOS;
//
// /**
// * 当前薪资核算所用账套设置的调薪计薪规则
// */
// private List<SalarySobAdjustRulePO> salarySobAdjustRulePOS;
//
// /**
// * 社保福利字段
// */
// private Map<String, String> welfareColumns;
//
// /**
// * 考勤引用字段
// */
// private List<AttendQuoteFieldListDTO> attendQuoteFieldListDTOS;
//
// /**
// * 本次运算的薪资核算人员
// */
// private List<SalaryAcctEmployeePO> salaryAcctEmployeePOS;
//
// /**
// * 核算结果临时表中的key
// */
// private String calculateKey;
//
// /**
// * 监视子线程运算结果
// */
// private CountDownLatch childMonitor;
//
// /**
// * 所有子线程的运算结果
// */
// private BlockingDeque<Result> results;
//
// @Data
// @AllArgsConstructor
// public static class Result {
//
// /**
// * 子线程是否运算成功
// */
// private boolean status;
//
// /**
// * 子线程元算失败的错误信息
// */
// private String errMsg;
// }
//}

View File

@ -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<List<Long>> calculatePriority(List<SalarySobItemPO> salarySobItems,
// List<SalaryItemPO> salaryItems,
// List<ExpressFormula> expressFormulas) {
// // 公式详情
// Map<Long, List<FormulaVar>> formulaIdKeyMap = ExpressFormulaBO.buildFormulaVar(expressFormulas);
// // key薪资项目的idvalue薪资项目的po
// Map<Long, SalaryItemPO> salaryItemPOMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
// // key薪资项目的codevalue薪资项目的po
// Map<String, SalaryItemPO> codeKeySalaryItemPOMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getCode);
// // key薪资项目的idvalue薪资账套下的薪资项目副本的po
// Map<Long, SalarySobItemPO> salaryItemIdKeySalarySobItemPOMap = SalaryEntityUtil.convert2Map(salarySobItems, SalarySobItemPO::getSalaryItemId);
// Map<Long, SalaryItemIdWithPriority> 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<Long, SalaryItemPO> salaryItemPOMap,
// Map<String, SalaryItemPO> codeKeySalaryItemPOMap,
// Map<Long, SalarySobItemPO> salaryItemIdKeySalarySobItemPOMap,
// Map<Long, List<FormulaVar>> formulaIdKeyMap,
// Map<Long, SalaryItemIdWithPriority> salaryItemIdWithPriorityMap,
// SalaryItemIdWithPriority pre) {
// List<Long> salaryItemIds = Lists.newArrayList();
// // 获取公式详情
// List<FormulaVar> 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<Long, SalaryItemPO> 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<Long, SalaryItemPO> 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<SalaryItemIdWithPriority> 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<SalaryItemIdWithPriority> preList;
// }
//}

View File

@ -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<SalarySobCheckRulePO> salarySobCheckRulePOS;
//
// /**
// * 本次运算涉及的所有公式
// */
// private List<ExpressFormula> expressFormulas;
//
// /**
// * 租户下所有的薪资项目
// */
// private List<SalaryItemPO> salaryItemPOS;
//
// /**
// * 本次运算的薪资核算人员
// */
// private List<SalaryAcctEmployeePO> salaryAcctEmployeePOS;
//
// /**
// * 核算结果临时表中的key
// */
// private String calculateKey;
//
// /**
// * 监视子线程运算结果
// */
// private CountDownLatch childMonitor;
//
// /**
// * 所有子线程的运算结果
// */
// private BlockingDeque<Result> results;
//
// @Data
// @AllArgsConstructor
// public static class Result {
//
// /**
// * 子线程是否运算成功
// */
// private boolean status;
//
// /**
// * 子线程元算失败的错误信息
// */
// private String errMsg;
// }
//}

View File

@ -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<SalaryItemPO> salaryItems,
// List<SalaryAcctResultPO> salaryAcctResults) {
// // 社保福利的当月值都是0
// List<String> 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<String> 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<Long> 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<Long> 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;
// }
//}

View File

@ -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<SalaryAccEmployeeListDTO> convert2EmployeeListDTO(List<SalaryAcctEmployeePO> salaryAccountingEmployees,
// List<TaxAgentPO> taxAgents,
// List<SimpleEmployee> simpleEmployees) {
// if (CollectionUtils.isEmpty(salaryAccountingEmployees)) {
// return Collections.emptyList();
// }
// Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
// Map<Long, SimpleEmployee> 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<SalaryAcctEmployeePO> convert2EmployeePO(Collection<Long> employeeIds,
// SalaryAcctRecordPO salaryAcctRecord,
// List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
// Long employeeId, String tenantKey) {
// if (CollectionUtils.isEmpty(employeeIds)) {
// return Collections.emptyList();
// }
// List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
// Map<Long, Set<List<SalaryArchiveTaxAgentDataDTO>>> empIdKeyTaxAgentMap = SalaryEntityUtil.group2Map(salaryArchiveTaxAgentData, SalaryArchiveDataDTO::getEmployeeId, SalaryArchiveDataDTO::getTaxAgents);
// LocalDateTime now = LocalDateTime.now();
// for (Long id : employeeIds) {
// Set<Long> taxAgentIds = Sets.newHashSet();
// Set<List<SalaryArchiveTaxAgentDataDTO>> taxAgentSet = empIdKeyTaxAgentMap.getOrDefault(id, Collections.emptySet());
// for (List<SalaryArchiveTaxAgentDataDTO> 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;
// }
//}

View File

@ -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<String, String> 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);
// }
//}

View File

@ -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<SalaryAcctRecordListDTO> convert2ListDTO(List<SalaryAcctRecordPO> salaryAcctRecordPOS,
List<SalarySobPO> salarySobs,
List<DataCollectionEmployee> employeeComInfos,
List<SalaryAcctEmployeeCountDTO> salaryAcctEmployeeCountDTOS) {
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {
return Collections.emptyList();
}
Map<Long, SalarySobPO> salarySobMap = SalaryEntityUtil.convert2Map(salarySobs, SalarySobPO::getId);
Map<Long, String> usernameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
Map<Long, Long> 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<SalaryAcctRecordPO> updateAcctTimes(List<SalaryAcctRecordPO> deletedSalaryAcctRecordPOS,
List<SalaryAcctRecordPO> toUpdateAcctTimesRecordPOS) {
if (CollectionUtils.isEmpty(toUpdateAcctTimesRecordPOS)) {
return Collections.emptyList();
}
Date now = new Date();
List<SalaryAcctRecordPO> resultList = Lists.newArrayListWithExpectedSize(toUpdateAcctTimesRecordPOS.size());
// 已经删除的薪资核算记录id
Set<Long> deletedSalaryAcctRecordIds = SalaryEntityUtil.properties(deletedSalaryAcctRecordPOS, SalaryAcctRecordPO::getId);
// 已经删除的薪资核算记录组成的key集合薪资账套id+薪资所属月
Set<String> deletedKeySet = SalaryEntityUtil.properties(deletedSalaryAcctRecordPOS, salaryAcctRecordPO ->
salaryAcctRecordPO.getSalarySobId() + SalaryDateUtil.getFormatYearMonth(salaryAcctRecordPO.getSalaryMonth()));
// 按照薪资账套id+薪资所属月作为key聚合而成的待更新核算次数的薪资核算记录map
Map<String, List<SalaryAcctRecordPO>> toUpdateAcctTimesRecordPOMap = SalaryEntityUtil.group2Map(toUpdateAcctTimesRecordPOS, salaryAcctRecordPO ->
salaryAcctRecordPO.getSalarySobId() + SalaryDateUtil.getFormatYearMonth(salaryAcctRecordPO.getSalaryMonth()));
for (String key : deletedKeySet) {
List<SalaryAcctRecordPO> 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;
}
}

View File

@ -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<WeaTableColumn> buildTableColumns4ComparisonResult(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Set<Long> excludeSalaryItemIds) {
// List<WeaTableColumn> 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<WeaTableColumn> buildTableColumns(SalarySobItemAggregateDTO salarySobItemAggregateDTO) {
// List<WeaTableColumn> 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<WeaTableColumnWapper> 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<Map<String, Object>> buildTableData(List<SalaryItemPO> salaryItems,
// List<SalarySobEmpFieldPO> salarySobEmpFields,
// List<SimpleEmployee> simpleEmployees,
// List<SalaryAcctEmployeePO> salaryAcctEmployees,
// List<SalaryAcctResultPO> salaryAccountingResults,
// List<TaxAgentPO> taxAgents,
// Set<Long> consolidatedTaxSalaryAcctEmpIds,
// Map<Long, String> customParameters) {
// if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
// return Collections.emptyList();
// }
// Map<Long, SimpleEmployee> employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId);
// Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAccountingResults, SalaryAcctResultPO::getEmployeeId);
// Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
// return salaryAcctEmployees.stream().map(e -> {
// Map<Long, Object> resultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(e.getEmployeeId(), Collections.emptyList()),
// SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
// // 薪资项目的值
// Map<String, Object> map = SalaryEntityUtil.convert2Map(salaryItems, o -> "" + o.getId(), o -> resultValueMap.getOrDefault(o.getId(), StringUtils.EMPTY));
// // 薪资项目的字段类型前端依据这个判断是否需要展示千分位
// Map<String, String> dataTypeMap = SalaryEntityUtil.convert2Map(salaryItems, salaryItemPO -> salaryItemPO.getId() + DATA_TYPE_SUFFIX, SalaryItemPO::getDataType);
// map.putAll(dataTypeMap);
// // 人员信息字段的值
// Map<String, String> 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<Map<String, Object>> buildComparisonTableData(List<SalaryItemPO> salaryItems,
// List<SalarySobEmpFieldPO> salarySobEmpFields,
// List<SimpleEmployee> simpleEmployees,
// List<SalaryAcctEmployeePO> salaryAcctEmployees,
// List<SalaryAcctResultPO> salaryAcctResultPOS,
// List<ExcelAcctResultPO> excelAcctResultPOS,
// List<TaxAgentPO> taxAgents,
// Map<Long, String> customParameters,
// Set<Long> consolidatedTaxSalaryAcctEmpIds,
// Set<Long> includeSalaryItemIds) {
// if (CollectionUtils.isEmpty(simpleEmployees)) {
// return Collections.emptyList();
// }
// Map<Long, List<ExcelAcctResultPO>> excelResultMap = SalaryEntityUtil.group2Map(excelAcctResultPOS, ExcelAcctResultPO::getSalaryAcctEmpId);
// Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryAcctEmpId);
// Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId, TaxAgentPO::getName);
// Map<Long, SimpleEmployee> employeeMap = SalaryEntityUtil.convert2Map(simpleEmployees, SimpleEmployee::getEmployeeId);
// List<Map<String, Object>> resultList = Lists.newArrayListWithExpectedSize(salaryAcctEmployees.size());
// for (SalaryAcctEmployeePO salaryAcctEmployee : salaryAcctEmployees) {
// // 线下值和系统值之间是否存在差异
// boolean different = false;
// Map<String, Object> map = Maps.newHashMap();
// // 员工信息字段的值
// Map<String, String> 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<Long, String> acctResultValueMap = SalaryEntityUtil.convert2Map(acctResultMap.getOrDefault(salaryAcctEmployee.getId(), Collections.emptyList()),
// SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
// // 线下值
// Map<Long, String> excelResultValueMap = SalaryEntityUtil.convert2Map(excelResultMap.getOrDefault(salaryAcctEmployee.getId(), Collections.emptyList()),
// ExcelAcctResultPO::getSalaryItemId, ExcelAcctResultPO::getResultValue);
// // 薪资项目字段的值
// for (SalaryItemPO salaryItem : salaryItems) {
// Map<String, Object> 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<SalarySobEmpFieldPO> salarySobEmpFields,
// List<SalarySobItemPO> salarySobItemPOS,
// List<SalaryItemPO> salaryItems,
// List<SalaryAcctResultPO> salaryAcctResults) {
// // 员工信息字段
// Map<String, String> employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee);
// // 个税扣缴义务人
// employeeFieldValueMap.put("taxAgentName", Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY));
// Map<String, String> employeeFieldNameMap = buildEmployeeFieldName();
// List<SalaryAcctEmployeeInfoDTO> 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<Long, String> resultValueMap = SalaryEntityUtil.convert2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
// Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
// // 公式项的值不根据salaryItemPO的valueType判断是因为薪资项目的valueType属性改变后并不会同步更新薪资账套中的薪资项目的formulaId字段
// List<SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO> formulaItems = salarySobItemPOS.stream()
// .filter(salarySobItemPO -> salarySobItemPO.getFormulaId() > 0)
// .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap))
// .collect(Collectors.toList());
// // 输入/导入项目的值
// List<SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO> 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<Long, String> 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<SalaryAcctResultPO> 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<String, String> buildEmployeeFieldName() {
// Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields();
// Map<String, String> 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<SalarySobEmpFieldPO> salarySobEmpFields,
// List<SalaryItemPO> salaryItems,
// List<SalaryAcctEmployeePO> salaryAcctEmployees,
// List<SalarySobPO> salarySobs,
// List<SalaryAcctRecordPO> salaryAcctRecords,
// List<SalaryAcctResultPO> 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<SalarySobEmpFieldPO> salarySobEmpFields) {
// Map<String, String> employeeFieldNameMap = buildEmployeeFieldName();
// Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee);
// fieldValueMap.put("taxAgentName", taxAgent.getName());
// Map<String, Object> data = Maps.newHashMap();
// Map<String, WeaFormItem> items = Maps.newHashMap();
// List<List<WeaFormLayout>> layout = Lists.newArrayList();
// List<WeaFormLayout> 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<Map<String, Object>> buildConsolidatedTaxationAcctResult(List<SalaryItemPO> salaryItems,
// List<SalaryAcctEmployeePO> salaryAcctEmployees,
// List<SalarySobPO> salarySobs,
// List<SalaryAcctRecordPO> salaryAcctRecords,
// List<SalaryAcctResultPO> salaryAcctResults) {
// // 薪资核算人员
// Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getId);
// // 薪资账套
// Map<Long, String> salarySobNameMap = SalaryEntityUtil.convert2Map(salarySobs, SalarySobPO::getId, SalarySobPO::getName);
// // 薪资核算记录
// Map<Long, SalaryAcctRecordPO> salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecords, SalaryAcctRecordPO::getId);
// // 薪资核算结果
// Map<Long, List<SalaryAcctResultPO>> salaryAcctResultMap = SalaryEntityUtil.group2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryAcctEmpId);
// List<WeaTableColumn> weaTableColumns = Lists.newArrayList(new WeaTableColumn("核算批次", "salarySobName"));
// weaTableColumns.addAll(salaryItems.stream()
// .map(e -> new WeaTableColumn(e.getName(), "" + e.getId(), false))
// .collect(Collectors.toList()));
// WeaTable<Map<String, Object>> 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<Map<String, Object>> data = Lists.newArrayList();
// salaryAcctResultMap.forEach((k, v) -> {
// // 薪资核算的结果
// Map<String, Object> 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<SalaryAcctResultPO> convert2ResultPO(Collection<SalaryAcctResultTempPO> 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());
// }
//}

View File

@ -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<SalaryCheckResultPO> oldCheckResults;
//
// /**
// * 原来的校验异常明细
// */
// private Collection<SalaryCheckResultRecordPO> oldCheckResultRecords;
//
// /**
// * 新的校验异常明细的临时存储数据
// */
// private Collection<SalaryCheckResultDetailTempPO> salaryCheckResultDetailTemps;
//
// public SalaryCheckBO(Collection<SalaryCheckResultPO> oldCheckResults,
// Collection<SalaryCheckResultRecordPO> oldCheckResultRecords,
// Collection<SalaryCheckResultDetailTempPO> 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<Long, SalaryCheckResultPO> oldCheckResultMap = SalaryEntityUtil.convert2Map(oldCheckResults, SalaryCheckResultPO::getSalaryCheckRuleId);
// Map<Long, List<SalaryCheckResultDetailTempPO>> 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<Long, List<SalaryCheckResultDetailTempPO>> 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<Long, SalaryCheckResultPO> oldCheckResultMap,
// Map<Long, List<SalaryCheckResultDetailTempPO>> 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<Long> needDeleteCheckResultRecordIds = oldCheckResultRecords.stream()
// .filter(e -> checkParam.getIds().contains(e.getSalaryAcctEmpId()))
// .map(SalaryCheckResultRecordPO::getId)
// .collect(Collectors.toList());
// result.getNeedDeleteCheckResultRecordIds().addAll(needDeleteCheckResultRecordIds);
// // 需要删除的异常异常校验异常下已经没有校验异常明细时需要删除
// Map<Long, List<SalaryCheckResultRecordPO>> 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<Long> needDeleteCheckResultIds;
//
// /**
// * 需要重新保存的校验异常
// */
// private Collection<SalaryCheckResultPO> needInsertCheckResults;
//
// /**
// * 需要删除的校验异常明细
// */
// private Collection<Long> needDeleteCheckResultRecordIds;
//
// /**
// * 需要重新保存的校验异常明细
// */
// private Collection<SalaryCheckResultRecordPO> needInsertCheckResultRecords;
//
// private Result() {
// this.needDeleteCheckResultIds = Lists.newArrayList();
// this.needInsertCheckResults = Lists.newArrayList();
// this.needDeleteCheckResultRecordIds = Lists.newArrayList();
// this.needInsertCheckResultRecords = Lists.newArrayList();
// }
// }
//}

View File

@ -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<SalaryCheckResultListDTO> convert2ListDTO(List<SalaryCheckResultPO> salaryCheckResults,
// List<SalarySobCheckRulePO> salarySobCheckRules,
// List<ExpressFormula> expressFormulas,
// List<SalaryCheckResultRecordCountDTO> salaryCheckResultRecordCountDTOS) {
// if (CollectionUtils.isEmpty(salaryCheckResults)) {
// return Collections.emptyList();
// }
// Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
// Map<Long, String> checkRuleMap = SalaryEntityUtil.convert2Map(salarySobCheckRules, SalarySobCheckRulePO::getId, SalarySobCheckRulePO::getName);
// Map<Long, Long> 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<SalaryCheckResultRecordListDTO> convert2RecordListDTO(List<SalaryCheckResultRecordPO> salaryCheckResultRecords,
// List<SalarySobCheckRulePO> salarySobCheckRules,
// List<ExpressFormula> expressFormulas,
// List<SimpleEmployee> simpleEmployees) {
// if (CollectionUtils.isEmpty(salaryCheckResultRecords)) {
// return Collections.emptyList();
// }
// Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
// Map<Long, String> checkRuleMap = SalaryEntityUtil.convert2Map(salarySobCheckRules, SalarySobCheckRulePO::getId, SalarySobCheckRulePO::getName);
// Map<Long, String> 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());
// }
//}

View File

@ -0,0 +1,27 @@
package com.engine.salary.entity.salaryacct.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 合并计税详情
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ConsolidatedTaxDetailDTO {
//员工信息")
private Object employeeInfo;
//合并计税详情")
private Object salaryAcctResult;
}

View File

@ -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;
//}

View File

@ -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<WeaTableColumnWapper> columns;
//
// @ApiModelProperty("列表数据")
// private List<Map<String, Object>> data;
//
// @JsonSerialize(using = ToStringSerializer.class)
// @ApiModelProperty("列表总数")
// private Long total;
//}

View File

@ -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;
//}

View File

@ -0,0 +1,60 @@
package com.engine.salary.entity.salaryacct.dto;
import com.engine.salary.common.LocalDateRange;
/**
* 薪资核算人员确认高级搜索
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -0,0 +1,23 @@
package com.engine.salary.entity.salaryacct.dto;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 薪资核算人员的数量
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Accessors(chain = true)
public class SalaryAcctEmployeeCountDTO {
// @ApiModelProperty("薪资核算记录id")
private Long salaryAcctRecordId;
// @ApiModelProperty("薪资核算人员的数量")
private Long countBySalaryAcctRecordId;
}

View File

@ -0,0 +1,27 @@
package com.engine.salary.entity.salaryacct.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 员工信息字段
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryAcctEmployeeInfoDTO {
//字段名称
private String fieldName;
//字段值
private String fieldValue;
}

View File

@ -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<ImportFieldDTO> formulaItems;
//
// @ApiModelProperty("输入项")
// private Collection<ImportFieldDTO> inputItems;
//
// @Data
// @Builder
// @NoArgsConstructor
// @AllArgsConstructor
// public static class ImportFieldDTO {
//
// @ApiModelProperty("薪资项目id")
// private Long salaryItemId;
//
// @ApiModelProperty("薪资项目名称")
// private String salaryItemName;
// }
//}

View File

@ -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;
}

View File

@ -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;
//}

View File

@ -0,0 +1,105 @@
package com.engine.salary.entity.salaryacct.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 薪资核算列表
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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<SalaryAcctEmployeeInfoDTO> employeeInfos;
//公式项")
private List<SalaryAcctResultDetailItemDTO> formulaItems;
//输入项")
private List<SalaryAcctResultDetailItemDTO> inputItems;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SalaryAcctResultDetailItemDTO {
//薪资项目id")
private Long salaryItemId;
//薪资项目名称")
private String salaryItemName;
//核算结果的值")
private String resultValue;
//数据类型numberstring")
private String dataType;
}
}

View File

@ -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<Long> departmentIds;
// @SalarySearchCondition(
// label = "岗位",
// labelId = 90633,
// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.BROWSER,
// browserType = "position", name = "positionIds", browserModule = "hrmsalary", browserMultiple = true)
// )
private Collection<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;
// @SalarySearchCondition(
// label = "合并计税",
// labelId = 93289,
// items = @SalarySearchConditionItem(itemType = WeaSearchConditionItemType.RADIO, name = "consolidatedTaxation", options = "listTaxationOption()")
// )
private String consolidatedTaxation;
//
// public List<WeaSearchConditionOption> listTaxationOption() {
// return Collections.singletonList(new WeaSearchConditionOption("1", ""));
// }
}

View File

@ -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;
//}

View File

@ -0,0 +1,21 @@
package com.engine.salary.entity.salaryacct.dto;
import lombok.Data;
/**
* 薪资核算结果校验异常的明细数量
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
public class SalaryCheckResultRecordCountDTO {
//"薪资核算结果校验异常id
private Long salaryCheckResultId;
//"薪资核算结果校验异常的明细数量
private Long countBySalaryCheckResultId;
}

View File

@ -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;
//}

View File

@ -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<WeaTableColumn> weaTableColumns;
//
// @ApiModelProperty("列表数据")
// private Page<Map<String, Object>> data;
//}

View File

@ -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;
/**
* 薪资核算的参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SalaryAcctCalculateParam {
/**
* 不是employeeId而是salaryAcctEmpId
*/
//核算人员的id")
private Collection<Long> ids;
@DataCheck(require = true,message = "参数错误薪资核算记录ID不能为空")
private Long salaryAcctRecordId;
}

View File

@ -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<Long> ids;
//
// /**
// * 参数错误薪资核算记录ID不能为空
// */
// @NotNull(message = "LABEL:99845")
// @ApiModelProperty("薪资核算记录id")
// private Long salaryAcctRecordId;
//}

View File

@ -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;
//}

View File

@ -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;
//}

View File

@ -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<Long> ids;
}

View File

@ -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;
/**
* 薪资核算人员删除参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<Long> ids;
}

View File

@ -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;
/**
* 薪资核算人员列表查询条件
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<Long> departmentIds;
//岗位")
private Collection<Long> positionIds;
//状态")
private SalaryEmployeeStatusEnum status;
//离职日期")
private LocalDateRange dismissDate;
//薪资核算人员列表主键id")
private Collection<Long> ids;
}

View File

@ -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<Long> employeeIds;
}

View File

@ -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<Long> salaryItemIds;
//
// @ApiModelProperty("是否导出数据")
// private String importType;
//}

View File

@ -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;
}

View File

@ -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;
//}

View File

@ -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;
/**
* 薪资核算基本信息保存参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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;
/**
* 薪资核算结果查询参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<Long> departmentIds;
//岗位
private Collection<Long> positionIds;
//状态
private SalaryEmployeeStatusEnum status;
//离职日期
private LocalDateRange dismissDate;
//是否合并计税
private String consolidatedTaxation;
//列表主键id
private Collection<Long> ids;
}

View File

@ -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;
/**
* 薪资核算结果保存参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<SalaryAcctResultDetailItemParam> items;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class SalaryAcctResultDetailItemParam {
//薪资项目的id
private Long salaryItemId;
//核算结果的值
private String resultValue;
}
}

View File

@ -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<Long> ids;
//
// /**
// * 参数错误薪资核算记录ID不能为空
// */
// @NotNull(message = "LABEL:99845")
// @ApiModelProperty("薪资核算记录的id")
// private Long salaryAcctRecordId;
//}

View File

@ -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;
//}

View File

@ -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;
//}

View File

@ -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;
//}

View File

@ -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;
//}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
/**
* 薪资核算表
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<Long> ids;
//薪资账套id
Collection<Long> salarySobIds;
//税款所属期
LocalDateRange salaryMonths;
//税款所属期
LocalDateRange taxCycleDateRange;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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")

View File

@ -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
*/
* 薪资核算的状态
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public enum SalaryAcctRecordStatusEnum implements BaseEnum<Integer> {
NOT_ARCHIVED(1, "未归档", 91870),

View File

@ -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'
<if test="salaryItemIds != null and salaryItemIds.size()>0">
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'
<if test="salaryItemIds != null and salaryItemIds.size()>0">
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'
<if test="salaryItemIds != null and salaryItemIds.size()>0">
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,

View File

@ -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<SalaryAcctRecordPO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<SalaryAcctRecordPO> 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<Long> ids);
}

View File

@ -0,0 +1,282 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">
<result column="id" property="id"/>
<result column="salary_month" property="salaryMonth"/>
<result column="tax_cycle" property="taxCycle"/>
<result column="salary_sob_id" property="salarySobId"/>
<result column="status" property="status"/>
<result column="acct_times" property="acctTimes"/>
<result column="description" property="description"/>
<result column="creator" property="creator"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
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
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_acct_record t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_acct_record t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap"
parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">
SELECT
<include refid="baseColumns"/>
FROM hrsa_salary_acct_record t
WHERE delete_type = 0
<if test="id != null">
AND id = #{id}
</if>
<if test="salaryMonth != null">
AND salary_month = #{salaryMonth}
</if>
<if test="taxCycle != null">
AND tax_cycle = #{taxCycle}
</if>
<if test="salarySobId != null">
AND salary_sob_id = #{salarySobId}
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="acctTimes != null">
AND acct_times = #{acctTimes}
</if>
<if test="description != null">
AND description = #{description}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<if test="salarySobIds != null and salarySobIds.size()>0">
AND salary_sob_id IN
<foreach collection="salarySobIds" open="(" item="salarySobId" separator="," close=")">
#{salarySobId}
</foreach>
</if>
<if test="salaryMonths != null">
AND (salary_month BETWEEN #{salaryMonths.fromDate} AND #{salaryMonths.endDate})
</if>
<if test="taxCycleDateRange != null">
AND (tax_cycle BETWEEN #{staxCycleDateRange.fromDate} AND #{taxCycleDateRange.endDate})
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO"
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
>
INSERT INTO hrsa_salary_acct_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="salaryMonth != null">
salary_month,
</if>
<if test="taxCycle != null">
tax_cycle,
</if>
<if test="salarySobId != null">
salary_sob_id,
</if>
<if test="status != null">
status,
</if>
<if test="acctTimes != null">
acct_times,
</if>
<if test="description != null">
description,
</if>
<if test="creator != null">
creator,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id},
</if>
<if test="salaryMonth != null">
#{salaryMonth},
</if>
<if test="taxCycle != null">
#{taxCycle},
</if>
<if test="salarySobId != null">
#{salarySobId},
</if>
<if test="status != null">
#{status},
</if>
<if test="acctTimes != null">
#{acctTimes},
</if>
<if test="description != null">
#{description},
</if>
<if test="creator != null">
#{creator},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="deleteType != null">
#{deleteType},
</if>
<if test="tenantKey != null">
#{tenantKey},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">
UPDATE hrsa_salary_acct_record
<set>
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},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">
UPDATE hrsa_salary_acct_record
<set>
<if test="salaryMonth != null">
salary_month=#{salaryMonth},
</if>
<if test="taxCycle != null">
tax_cycle=#{taxCycle},
</if>
<if test="salarySobId != null">
salary_sob_id=#{salarySobId},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="acctTimes != null">
acct_times=#{acctTimes},
</if>
<if test="description != null">
description=#{description},
</if>
<if test="creator != null">
creator=#{creator},
</if>
<if test="createTime != null">
create_time=#{createTime},
</if>
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="deleteType != null">
delete_type=#{deleteType},
</if>
<if test="tenantKey != null">
tenant_key=#{tenantKey},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO">
UPDATE hrsa_salary_acct_record
SET delete_type=1
WHERE id = #{id}
AND delete_type = 0
</delete>
<update id="deleteByIds">
UPDATE hrsa_salary_acct_record
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

View File

@ -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;
/**
* 薪资核算人员
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public interface SalaryAcctEmployeeService {
/**
* 根据薪资核算记录id统计薪资核算人员的数量
*
* @param salaryAcctRecordIds 薪资核算记录的id
* @return
*/
List<SalaryAcctEmployeeCountDTO> countBySalaryAcctRecordId(Collection<Long> salaryAcctRecordIds);
/**
* 根据主键id获取单个薪资核算人员
*
* @param id 主键id
* @return
*/
SalaryAcctEmployeePO getById(Long id);
/**
* 根据主键id查询薪资核算人员
*
* @param ids 主键id
* @return
*/
List<SalaryAcctEmployeePO> listByIds(Collection<Long> ids);
/**
* 根据薪资核算记录id查询薪资核算人员
*
* @param salaryAcctRecordId 薪资核算记录id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordId(Long salaryAcctRecordId);
/**
* 根据薪资核算记录id查询薪资核算人员
*
* @param salaryAcctRecordIds 薪资核算记录id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
/**
* 根据薪资核算记录id个税扣缴义务人id查询薪资核算人员
*
* @param salaryAcctRecordId 薪资核算记录id
* @param taxAgentId 个税扣缴义务人id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordIdAndTaxAgentId(Long salaryAcctRecordId, Long taxAgentId);
/**
* 根据薪资核算记录id主键id查询薪资核算人员
*
* @param salaryAcctRecordId 薪资核算记录id
* @param ids 主键id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordIdAndIds(Long salaryAcctRecordId, Collection<Long> ids);
/**
* 根据薪资核算记录id人员id查询薪资核算人员
*
* @param salaryAcctRecordId 薪资核算记录id
* @param employeeIds 人员id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordIdAndEmployeeIds(Long salaryAcctRecordId, Collection<Long> employeeIds);
/**
* 根据薪资核算记录id人员id查询薪资核算人员
*
* @param salaryAcctRecordIds 薪资核算记录id
* @param employeeIds 人员id
* @return
*/
List<SalaryAcctEmployeePO> listBySalaryAcctRecordIdsAndEmployeeIds(Collection<Long> salaryAcctRecordIds, Collection<Long> employeeIds);
/**
* 根据薪资核算记录id人员id个税扣缴义务人id查询薪资核算人员
*
* @param salaryAcctRecordIds 薪资核算记录id
* @param employeeId 人员id
* @param taxAgentId 个税扣缴义务人
* @return
*/
List<SalaryAcctEmployeePO> listByRecordIdsAndEmpIdAndTaxAgentId(Collection<Long> salaryAcctRecordIds, Long employeeId, Long taxAgentId);
/**
* 根据列表查询条件查询薪资核算人员分页
*
* @param queryParam 列表查询条件
* @return
*/
// Page<SalaryAcctEmployeePO> listPageByParam(SalaryAcctEmployeeQueryParam queryParam);
/**
* 根据列表查询条件查询薪资核算人员
*
* @param queryParam 列表查询条件
* @return
*/
List<SalaryAcctEmployeePO> listByParam(SalaryAcctEmployeeQueryParam queryParam);
/**
* 根据薪资核算结果列表的列表查询条件查询薪资核算人员分页
*
* @param queryParam 薪资核算结果列表的列表查询条件
* @return
*/
// Page<SalaryAcctEmployeePO> listPageByResultQueryParam(SalaryAcctResultQueryParam queryParam);
/**
* 根据薪资核算结果列表的列表查询条件查询薪资核算人员
*
* @param queryParam 薪资核算结果列表的列表查询条件
* @return
*/
List<SalaryAcctEmployeePO> listByResultQueryParam(SalaryAcctResultQueryParam queryParam);
/**
* 根据列表查询条件查询同比减少的薪资核算人员分页
*
* @param queryParam 列表查询条件
* @return
*/
// Page<SalaryAcctEmployeePO> listPageByParam4Reduce(SalaryAcctEmployeeQueryParam queryParam);
/**
* 根据列表查询条件查询同比减少的薪资核算人员
*
* @param queryParam 列表查询条件
* @return
*/
List<SalaryAcctEmployeePO> listByParam4Reduce(SalaryAcctEmployeeQueryParam queryParam);
/**
* 根据列表查询条件查询合并计税的薪资核算人员分页
*
* @param queryParam 列表查询条件
* @return
*/
// Page<SalaryAcctEmployeePO> listPageByParam4ConsolidatedTax(SalaryAcctEmployeeQueryParam queryParam);
/**
* 根据列表查询条件查询合并计税的薪资核算人员
*
* @param queryParam 列表查询条件
* @return
*/
List<SalaryAcctEmployeePO> 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<SalaryAcctEmployeePO> salaryAcctEmployeePOS);
/**
* 薪资核算记录会删除薪资核算结果校验异常明细线下对比导入结果
*
* @param ids
*/
void deleteByIds(Collection<Long> ids);
/**
* 根据参数删除薪资核算人员
*
* @param deleteParam 删除参数
*/
void deleteByParam(SalaryAcctEmployeeDeleteParam deleteParam);
/**
* 根据薪资核算记录id删除薪资核算人员
*
* @param salaryAcctRecordIds 薪资核算记录id
*/
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
/**
* 根据薪资核算记录id初始化薪资核算人员
*
* @param salaryAcctRecordPO 薪资核算记录
*/
void initBySalaryAcctRecord(SalaryAcctRecordPO salaryAcctRecordPO);
/**
* 刷新薪资核算人员的个税扣缴义务人
*
* @param salaryAcctRecordId 薪资核算记录
* @param employeeId 人员id
*/
void refresh(Long salaryAcctRecordId, Long employeeId);
}

View File

@ -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;
/**
* 薪资核算记录
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public interface SalaryAcctRecordService {
/**
* 根据主键id获取单条薪资核算记录
*
* @param id 主键id
* @return
*/
SalaryAcctRecordPO getById(Long id);
/**
* 根据主键id查询薪资核算记录
*
* @param ids 主键id
* @return
*/
List<SalaryAcctRecordPO> listByIds(Collection<Long> ids);
/**
* 根据薪资账套id薪资所属月查询薪资核算记录
*
* @param salarySobIds 薪资账套id
* @param salaryMonthDateRange 薪资所属月的时间范围
* @return
*/
List<SalaryAcctRecordPO> listBySalarySobIdsAndSalaryMonth(Collection<Long> salarySobIds, LocalDateRange salaryMonthDateRange);
/**
* 根据薪资账套id税款所属期查询薪资核算记录
*
* @param salarySobIds 薪资账套id
* @param taxCycleDateRange 税款所属期的时间范围
* @return
*/
List<SalaryAcctRecordPO> listBySalarySobIdsAndTaxCycle(Collection<Long> salarySobIds, LocalDateRange taxCycleDateRange);
/**
* 根据薪资所属月查询薪资核算记录
*
* @param salaryMonthDateRange 薪资所属月的时间范围
* @return
*/
List<SalaryAcctRecordPO> listBySalaryMonth(LocalDateRange salaryMonthDateRange);
/**
* 根据列表查询条件查询薪资核算记录分页
*
* @param queryParam 列表查询条件
* @param tenantKey 租户key
* @return
*/
// Page<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam);
/**
* 根据id查询同一个账套上一个月的薪资核算记录
*
* @param id 薪资核算记录id
* @return
*/
List<SalaryAcctRecordPO> listById4LastSalaryMonth(Long id);
/**
* 根据薪资账套ID查询薪资核算记录
*
* @param salarySobIds 薪资账套id
* @param tenantKey 租户key
* @return
*/
List<SalaryAcctRecordPO> listBySalarySobIds(Collection<Long> salarySobIds);
/**
* 根据id查询其他合并计税的薪资核算记录
*
* @param id 薪资核算记录的id
* @return
*/
List<SalaryAcctRecordPO> 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<Long> ids, SalaryAcctRecordStatusEnum status);
/**
* 根据主键id删除
*
* @param ids 薪资核算记录的id
*/
void deleteByIds(Collection<Long> 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);
}

View File

@ -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;
/**
* 薪资核算结果
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
public interface SalaryAcctResultService {
/**
* 根据薪资核算记录的id查询薪资核算结果
*
* @param salaryAcctRecordIds 薪资核算记录的id
* @return
*/
List<SalaryAcctResultPO> listBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
/**
* 根据薪资核算人员的主键id查询薪资核算结果
*
* @param salaryAcctEmployeeId 薪资核算人员的主键id
* @return
*/
List<SalaryAcctResultPO> listBySalaryAcctEmployeeId(Long salaryAcctEmployeeId);
/**
* 根据薪资核算人员的主键id查询薪资核算结果
*
* @param salaryAcctEmployeeIds 薪资核算人员的主键id
* @return
*/
List<SalaryAcctResultPO> listBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds);
/**
* 根据薪资核算id人员id查询薪资核算结果
*
* @param salaryAcctRecordIds 薪资核算记录id
* @param employeeIds 人员id
* @return
*/
List<SalaryAcctResultPO> listBySalaryAcctRecordIdsAndEmployeeIds(Collection<Long> salaryAcctRecordIds, Collection<Long> employeeIds);
/**
* 根据薪资核算人员的主键id查询薪资核算结果
*
* @param salaryAcctEmployeeId 薪资核算人员的主键id
* @return
*/
SalaryAcctResultDetailDTO getBySalaryAcctEmployeeId(Long salaryAcctEmployeeId);
/**
* 根据薪资核算结果列表查询条件查询薪资核算结果分页
*
* @param queryParam 列表查询条件
* @return
*/
// Page<Map<String, Object>> listPageByParam(SalaryAcctResultQueryParam queryParam);
/**
* 根据薪资核算结果列表查询条件查询薪资核算结果
*
* @param queryParam 列表查询条件
* @return
*/
List<Map<String, Object>> 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<SalaryAcctResultPO> salaryAcctResultPOS);
/**
* 根据薪资核算人员id删除薪资核算结果
*
* @param salaryAcctEmployeeIds 薪资核算人员id
*/
void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds);
/**
* 根据薪资核算人员id薪资项目id删除薪资核算结果
*
* @param salaryAcctEmployeeIds 薪资核算人员id
* @param salaryItemIds 薪资项目id
*/
void deleteByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds);
/**
* 根据薪资核算记录id删除薪资核算结果
*
* @param salaryAcctRecordIds 薪资核算记录id
*/
void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);
/**
* 薪资核算
*
* @param calculateParam
* @param simpleEmployee
*/
void calculate(SalaryAcctCalculateParam calculateParam, DataCollectionEmployee simpleEmployee);
}

View File

@ -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;
/**
* 薪资核算
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<SalaryAcctRecordPO> listByIds(Collection<Long> 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<SalaryAcctRecordPO> listBySalarySobIdsAndSalaryMonth(Collection<Long> 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<SalaryAcctRecordPO> listBySalarySobIdsAndTaxCycle(Collection<Long> 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<SalaryAcctRecordPO> listBySalaryMonth(LocalDateRange salaryMonthDateRange) {
SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class);
return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
}
// @Override
// public Page<SalaryAcctRecordPO> listPageByParam(SalaryAcctRecordQueryParam queryParam, String tenantKey) {
// // 分页参数
// Page<SalaryAcctRecordPO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
// // 构建queryWrapper
// LambdaQueryWrapper<SalaryAcctRecordPO> queryWrapper = Wrappers.lambdaQuery();
// queryWrapper.eq(SalaryAcctRecordPO::getTenantKey, tenantKey);
// queryWrapper.eq(SalaryAcctRecordPO::getDeleteType, 0);
// if (StringUtils.isNotEmpty(queryParam.getName())) {
// // 根据查询条件中的薪资账套名称查询薪资账套
// List<SalarySobPO> salarySobPOS = salarySobService.listByNameLike(queryParam.getName(), tenantKey);
// if (CollectionUtils.isEmpty(salarySobPOS)) {
// return page;
// }
// // 过滤薪资账套
// Set<Long> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> listBySalarySobIds(Collection<Long> salarySobIds) {
SalaryAcctRecordMapper salaryAcctRecordMapper = SqlProxyHandle.getProxy(SalaryAcctRecordMapper.class);
return salaryAcctRecordMapper.listSome(SalaryAcctRecordPO.builder().salarySobIds(salarySobIds).build());
}
@Override
public List<SalaryAcctRecordPO> listById4OtherConsolidatedTax(Long id) {
SalaryAcctRecordPO salaryAcctRecordPO = getById(id);
if (Objects.isNull(salaryAcctRecordPO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
}
// 查询所有薪资类型为工资薪金的账套
List<SalarySobPO> 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<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
LocalDateRange taxCycleDateRange = SalaryDateUtil.localDate2Range(salaryAcctRecordPO.getTaxCycle());
List<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> 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<Long> ids, SalaryAcctRecordStatusEnum status) {
// 查询薪资核算记录
List<SalaryAcctRecordPO> 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<Long> ids) {
// 查询薪资核算记录
List<SalaryAcctRecordPO> 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<Long> salarySobIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getSalarySobId);
List<SalarySobPO> salarySobPOS = salarySobService.listByIds(salarySobIds);
Map<Long, SalarySobPO> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> 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<SalaryCheckResultPO> salaryCheckResultPOS = salaryCheckResultService.listBySalaryAcctRecordIdAndIgnoreType(salaryAcctRecordId, NumberUtils.INTEGER_ZERO);
// if (CollectionUtils.isNotEmpty(salaryCheckResultPOS)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98784, "核算结果尚未通过校验规则,请确认是否需要忽略校验异常后再归档"));
// }
// 查询薪资核算结果
List<SalaryAcctResultPO> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> 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<SalaryAcctRecordPO> otherSalaryAcctRecordPOS = listById4OtherConsolidatedTax(id);
if (CollectionUtils.isEmpty(otherSalaryAcctRecordPOS)) {
return NumberUtils.INTEGER_ZERO;
}
// 查询本次核算的薪资核算人员
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordId(id);
// 查询其他核算记录中的薪资核算人员
Set<Long> otherSalaryAcctRecordIds = SalaryEntityUtil.properties(otherSalaryAcctRecordPOS, SalaryAcctRecordPO::getId);
List<SalaryAcctEmployeePO> otherSalaryAcctEmployeePOS = salaryAcctEmployeeService.listBySalaryAcctRecordIds(otherSalaryAcctRecordIds);
// 有其他核算记录需要进一步判断本次核算的人员中是否存在合并计税
Set<String> 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());
}
}

View File

@ -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";

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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> T getProxy(Class<T> clazz) {
SqlProxyHandle handle = new SqlProxyHandle(clazz);
return (T) handle.getProxy();
}
public static <T> T getProxy(Class<T> 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> T getProxy(Class<T> clazz) {
SqlProxyHandle handle = new SqlProxyHandle(clazz);
return (T) handle.getProxy();
}
public static <T> T getProxy(Class<T> clazz, boolean isAutoSubmit) {
SqlProxyHandle handle = new SqlProxyHandle(clazz);
return (T) handle.getProxy(isAutoSubmit);
}
}

View File

@ -0,0 +1,390 @@
package com.engine.salary.web;
/**
* 薪资核算
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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<WeaTable<SalaryAcctRecordListDTO>> listSalaryAccounting(@RequestBody @Validated SalaryAcctRecordQueryParam queryParam) {
// WeaTable<SalaryAcctRecordListDTO> weaTable = salaryAcctRecordWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @GetMapping("/getForm")
// @ApiOperation("薪资核算详情")
// @WeaPermission
// public WeaResult<WeaForm> 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<SalarySobCycleDTO> getSalarySobCycle(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) {
// SalarySobCycleDTO salarySobCycle = salaryAcctRecordWrapper.getSalarySobCycleById(salaryAcctRecordId, TenantContext.getCurrentTenantKey());
// return WeaResult.success(salarySobCycle);
// }
//
// @PostMapping("/basic/save")
// @ApiOperation("保存薪资核算的基本信息")
// @WeaPermission
// public WeaResult<Long> saveBasic(@RequestBody @Validated SalaryAcctRecordSaveParam saveParam) {
// Long salaryAcctRecordId = salaryAcctRecordWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(salaryAcctRecordId);
// }
//
// @PostMapping("/delete")
// @ApiOperation("删除薪资核算记录")
// @WeaPermission
// public WeaResult<Object> deleteSalaryAcctRecord(@RequestBody Collection<Long> ids) {
// salaryAcctRecordWrapper.delete(ids, TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/file")
// @ApiOperation("归档薪资核算记录")
// @WeaPermission
// public WeaResult<Object> fileSalaryAcctRecord(@RequestParam(value = "id") Long id) {
// salaryAcctRecordWrapper.file(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/reAccounting")
// @ApiOperation("重新核算")
// @WeaPermission
// public WeaResult<Object> reAccounting(@RequestBody @Validated SalaryAcctRecordReAccountParam param) {
// salaryAcctRecordWrapper.reCalculate(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @GetMapping("/hasConsolidatedTax")
// @ApiOperation("判断是否存在合并计税")
// @WeaPermission
// public WeaResult<Integer> 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<WeaTable<SalaryAccEmployeeListDTO>> listSalaryAccountingEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
// WeaTable<SalaryAccEmployeeListDTO> weaTable = salaryAcctEmployeeWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @PostMapping("/reducedemployee/list")
// @ApiOperation("薪资核算环比上期减少人员列表")
// @WeaPermission
// public WeaResult<WeaTable<SalaryAccEmployeeListDTO>> listReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
// WeaTable<SalaryAccEmployeeListDTO> weaTable = salaryAcctEmployeeWrapper.listPage4Reduce(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @GetMapping("/acctemployee/getSearchCondition")
// @ApiOperation("薪资核算人员高级搜索")
// @WeaPermission
// public WeaResult<WeaSearchCondition> getAcctEmpSearchCondition() {
// WeaSearchCondition searchCondition = salaryAcctEmployeeWrapper.getCondition(TenantContext.getCurrentTenantKey());
// return WeaResult.success(searchCondition);
// }
//
// @PostMapping("/acctemployee/save")
// @ApiOperation("添加薪资核算人员")
// @WeaPermission
// public WeaResult<Object> saveSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeSaveParam saveParam) {
// salaryAcctEmployeeWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctemployee/delete")
// @ApiOperation("删除薪资核算人员")
// @WeaPermission
// public WeaResult<Object> deleteSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeDeleteParam deleteParam) {
// salaryAcctEmployeeWrapper.delete(deleteParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctemployee/checkTaxAgent")
// @ApiOperation("检查薪资核算人员的个税扣缴义务人")
// @WeaPermission
// public WeaResult<Object> checkTaxAgent(@RequestBody @Validated SalaryAcctEmpCheckTaxAgentParam param) {
// salaryAcctEmployeeWrapper.checkTaxAgent(param.getSalaryAcctRecordId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctemployee/refreshTaxAgent")
// @ApiOperation("刷新薪资核算人员的个税扣缴义务人")
// @WeaPermission
// public WeaResult<Object> refreshTaxAgent(@RequestBody @Validated SalaryAcctEmpRefreshTaxAgentParam param) {
// salaryAcctEmployeeWrapper.refreshTaxAgent(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctemployee/addFromReduce")
// @ApiOperation("从环比上月减少添加薪资核算人员")
// @WeaPermission
// public WeaResult<Object> addFromReduce(@RequestBody @Validated SalaryAcctEmployeeAddParam param) {
// salaryAcctEmployeeWrapper.addFromReduce(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctemployee/export")
// @ApiOperation("导出人员范围")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportSalaryAcctEmployee(queryParam, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// @PostMapping("/reducedemployee/export")
// @ApiOperation("导出环比减少人员")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportReducedEmployee(queryParam, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// /**********************************薪资核算人员相关 end*********************************/
//
// /**********************************薪资核算结果 start*********************************/
//
// @PostMapping("/acctresult/list")
// @ApiOperation(("薪资核算结果列表"))
// @WeaPermission
// public WeaResult<WeaTable<Map<String, Object>>> listSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) {
// WeaTable<Map<String, Object>> weaTable = salaryAcctResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @GetMapping("/acctresult/getSearchCondition")
// @ApiOperation(("获取薪资核算结果高级搜索"))
// @WeaPermission
// public WeaResult<WeaSearchCondition> getSalaryAcctResultSearchCondition() {
// WeaSearchCondition searchCondition = salaryAcctResultWrapper.getSearchCondition(TenantContext.getCurrentTenantKey());
// return WeaResult.success(searchCondition);
// }
//
// @GetMapping("/acctresult/detail")
// @ApiOperation(("薪资核算结果详情"))
// @WeaPermission
// public WeaResult<SalaryAcctResultDetailDTO> getSalaryAcctResultDetail(@RequestParam(value = "id") Long id) {
// SalaryAcctResultDetailDTO dto = salaryAcctResultWrapper.getForm(id, TenantContext.getCurrentTenantKey());
// return WeaResult.success(dto);
// }
//
// @GetMapping("/acctresult/getConsolidatedTaxDetail")
// @ApiOperation(("薪资核算合并计税详情"))
// @WeaPermission
// public WeaResult<ConsolidatedTaxDetailDTO> getConsolidatedTaxDetail(@RequestParam(value = "salaryAcctEmpId") Long salaryAcctEmpId) {
// ConsolidatedTaxDetailDTO dto = salaryAcctResultWrapper.getConsolidatedTaxDetail(salaryAcctEmpId, TenantContext.getCurrentTenantKey());
// return WeaResult.success(dto);
// }
//
// @PostMapping("/acctresult/save")
// @ApiOperation(("编辑薪资核算结果"))
// @WeaPermission
// public WeaResult<Object> saveSalaryAcctResult(@RequestBody @Validated SalaryAcctResultSaveParam saveParam) {
// salaryAcctResultWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctresult/accounting")
// @ApiOperation("薪资核算")
// @WeaPermission
// public WeaResult<String> accounting(@RequestBody @Validated SalaryAcctCalculateParam acctParam) {
// salaryAcctResultWrapper.calculate(acctParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey());
// return WeaResult.success("");
// }
//
// @PostMapping("/acctresult/export")
// @ApiOperation("导出核算结果")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportSalaryAcctResult(queryParam, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// @GetMapping("/acctresult/importField")
// @ApiOperation("导入核算结果前生成导入模板时可选的薪资项目")
// @WeaPermission
// public WeaResult<SalaryAcctImportFieldDTO> 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<Map<String, Object>> exportImportTemplate(@RequestBody @Validated SalaryAcctImportTemplateParam param) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportImportTemplate(param, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// @GetMapping("/acctresult/importParams")
// @ApiOperation("获取导入核算结果的导入参数")
// @WeaPermission
// public WeaResult<ExcelImportParam> getAcctResultImportParams() {
// return WeaResult.success(salaryBatchService.buildImportParam("importSalaryAcctResult",
// "importSalaryAcctResult",
// "薪资核算结果",
// null,
// null));
// }
//
// /**********************************薪资核算结果 end*********************************/
//
// /**********************************检验异常 start*********************************/
//
// @GetMapping("/checkresult/getCount")
// @ApiOperation(("获取校验结果(异常)总数"))
// @WeaPermission
// public WeaResult<Integer> getCheckResultCount(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) {
// Integer salaryCheckResultCount = salaryAcctCheckResultWrapper.countBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey());
// return WeaResult.success(salaryCheckResultCount);
// }
//
// @PostMapping("/checkresult/list")
// @ApiOperation("校验结果列表")
// @WeaPermission
// public WeaResult<WeaTable<SalaryCheckResultListDTO>> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) {
// WeaTable<SalaryCheckResultListDTO> weaTable = salaryAcctCheckResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @PostMapping("/checkresultdetail/list")
// @ApiOperation("校验结果明细列表")
// @WeaPermission
// public WeaResult<WeaTable<SalaryCheckResultRecordListDTO>> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) {
// WeaTable<SalaryCheckResultRecordListDTO> weaTable = salaryAcctCheckResultWrapper.listPage4CheckResultRecord(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @PostMapping("/checkresult/ignore")
// @ApiOperation("校验结果列表")
// @WeaPermission
// public WeaResult<Object> ignoreCheckResult(@RequestParam(value = "id") Long id) {
// salaryAcctCheckResultWrapper.ignoreById(id, TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/checkresult/ignoreAll")
// @ApiOperation("校验结果列表")
// @WeaPermission
// public WeaResult<Object> ignoreAllCheckResult(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) {
// salaryAcctCheckResultWrapper.ignoreBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/acctresult/check")
// @ApiOperation(("薪资核算结果校验"))
// @WeaPermission
// public WeaResult<Object> check(@RequestBody @Validated SalaryAcctCheckParam checkParam) {
// salaryAcctResultWrapper.check(checkParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
// @PostMapping("/checkresult/export")
// @ApiOperation("校验异常导出")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportCheckResult(@RequestBody @Validated SalaryCheckResultExportParam exportParam) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportCheckResult(exportParam, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// @PostMapping("/checkresultRecord/export")
// @ApiOperation("校验异常明细导出")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportCheckResultDetail(checkResultId, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// /**********************************检验异常 end*********************************/
//
// /**********************************线下对比 start*********************************/
//
// @PostMapping("/comparisonresult/list")
// @ApiOperation("线上线下对比结果列表")
// @WeaPermission
// public WeaResult<WeaTable<Map<String, Object>>> listComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) {
// WeaTable<Map<String, Object>> weaTable = salaryComparisonResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
// return WeaResult.success(weaTable);
// }
//
// @GetMapping("/comparisonresult/importParams")
// @ApiOperation("获取导入核算结果的导入参数")
// @WeaPermission
// public WeaResult<ExcelImportParam> getComparisonResultImportParams() {
// return WeaResult.success(salaryBatchService.buildImportParam("importExcelAcctResult",
// "importExcelAcctResult",
// "线下核算结果",
// null,
// null));
// }
//
// @PostMapping("/comparisonresult/export")
// @ApiOperation("导出线上线下对比结果")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) {
// SimpleEmployee simpleEmployee = UserContext.getCurrentUser();
// String tenantKey = TenantContext.getCurrentTenantKey();
// String eteamsId = TenantRpcContext.getEteamsId();
// Map<String, Object> map = salaryAcctExcelWrapper.exportComparisonResult(queryParam, simpleEmployee, tenantKey, eteamsId);
// return WeaResult.success(map);
// }
//
// @PostMapping("/comparisonresult/importtemplate/export")
// @ApiOperation("线下对比结果导入模板导出")
// @WeaPermission
// public WeaResult<Map<String, Object>> exportComparisonResultTemplate(@RequestBody @Validated SalaryComparisonResultExportParam exportParam) {
// String tenantKey = TenantContext.getCurrentTenantKey();
// Map<String, Object> map = salaryAcctExcelWrapper.exportComparisonResultTemplate(exportParam, tenantKey);
// return WeaResult.success(map);
// }
/**********************************线下对比 end*********************************/
}

View File

@ -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;
//
///**
// * 薪资核算记录
// * <p>Copyright: Copyright (c) 2022</p>
// * <p>Company: 泛微软件</p>
// *
// * @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<SalaryAcctRecordListDTO> listPage(SalaryAcctRecordQueryParam queryParam, String tenantKey) {
// // 查询薪资核算记录分页
// Page<SalaryAcctRecordPO> page = salaryAcctRecordService.listPageByParam(queryParam, tenantKey);
// Page<SalaryAcctRecordListDTO> dtoPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
// if (CollectionUtils.isNotEmpty(page.getRecords())) {
// // 查询薪资账套
// Set<Long> salarySobIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getSalarySobId);
// List<SalarySobPO> salarySobPOS = salarySobService.listByIds(salarySobIds, tenantKey);
// // 查询薪资核算记录的创建人员的人员信息
// List<Object> employeeIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getCreator, Collectors.toList());
// List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds);
// // 查询薪资核算人数的数量
// Set<Long> salaryAcctRecordIds = SalaryEntityUtil.properties(page.getRecords(), SalaryAcctRecordPO::getId);
// List<SalaryAcctEmployeeCountDTO> salaryAcctEmployeeCountDTOS = salaryAcctEmployeeService.countBySalaryAcctRecordId(salaryAcctRecordIds, tenantKey);
// // 转换成列表dto
// List<SalaryAcctRecordListDTO> salaryAcctRecordListDTOS = SalaryAcctRecordBO.convert2ListDTO(page.getRecords(), salarySobPOS, employeeComInfos, salaryAcctEmployeeCountDTOS);
// dtoPage.setRecords(salaryAcctRecordListDTOS);
// }
// WeaTable<SalaryAcctRecordListDTO> weaTable = SalaryFormatUtil.<SalaryAcctRecordListDTO>getInstance().buildTable(SalaryAcctRecordListDTO.class, dtoPage);
// // 只有未归档时可以"核算""删除""归档"
// // 归档后申报后可以"查看""重新核算"
// for (int i = 0; i < page.getRecords().size(); i++) {
// SalaryAcctRecordPO salaryAcctRecord = page.getRecords().get(i);
// List<Permission> 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<SalarySobPO> salarySobPOS = salarySobService.listByDisable(NumberUtils.INTEGER_ZERO, tenantKey);
// // 薪资核算详情表单中"薪资账套"的下拉选择项
// List<WeaFormOption> 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.<SalaryAcctRecordFormDTO>getInstance().buildForm(SalaryAcctRecordFormDTO.class, formDTO);
// weaForm.getItems().forEach((k, v) -> {
// if (Objects.equals(k, "salarySobName")) {
// v.setOptions(weaFormOptions);
// }
// // 薪资核算详情表单的薪资所属月只选择年月
// if (Objects.equals(k, "salaryMonth")) {
// Map<String, Object> 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<Long> 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);
// }
//}