2022-03-21 09:33:21 +08:00
|
|
|
package com.engine.salary.entity.salaryitem.bo;
|
|
|
|
|
|
2022-07-27 16:56:13 +08:00
|
|
|
import com.engine.salary.annotation.SalaryTableColumn;
|
2022-03-21 09:33:21 +08:00
|
|
|
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
2022-04-14 20:46:17 +08:00
|
|
|
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
2022-03-21 20:09:10 +08:00
|
|
|
import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
|
|
|
|
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
2023-06-01 17:52:31 +08:00
|
|
|
import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO;
|
2022-03-21 09:33:21 +08:00
|
|
|
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
|
|
|
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
2022-07-27 16:56:13 +08:00
|
|
|
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
2023-01-30 17:32:58 +08:00
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationAnnualListDTO;
|
2022-07-27 16:56:13 +08:00
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO;
|
|
|
|
|
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO;
|
2022-03-24 16:59:52 +08:00
|
|
|
import com.engine.salary.enums.SalaryRoundingModeEnum;
|
|
|
|
|
import com.engine.salary.enums.SalarySystemTypeEnum;
|
|
|
|
|
import com.engine.salary.enums.SalaryValueTypeEnum;
|
|
|
|
|
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
2022-03-21 20:09:10 +08:00
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
2022-03-21 09:33:21 +08:00
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
2022-04-14 20:46:17 +08:00
|
|
|
import weaver.conn.util.IdGenerator;
|
2022-06-23 18:05:48 +08:00
|
|
|
import weaver.general.BaseBean;
|
2022-03-21 09:33:21 +08:00
|
|
|
|
2022-07-27 16:56:13 +08:00
|
|
|
import java.lang.reflect.Field;
|
2022-03-21 20:09:10 +08:00
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
2022-03-21 09:33:21 +08:00
|
|
|
|
|
|
|
|
/**
|
2022-04-14 20:46:17 +08:00
|
|
|
* 薪资项目
|
|
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
2022-03-21 09:33:21 +08:00
|
|
|
public class SalaryItemBO {
|
|
|
|
|
|
2022-06-23 18:05:48 +08:00
|
|
|
private static final BaseBean baseBean = new BaseBean();
|
|
|
|
|
|
|
|
|
|
//强制开启账套的公式配置
|
|
|
|
|
private static final Boolean openFormulaForcedEditing = "true".equals(baseBean.getPropValue("hrmSalary", "openFormulaForcedEditing"));
|
|
|
|
|
|
|
|
|
|
|
2022-03-24 16:59:52 +08:00
|
|
|
|
2022-03-21 09:33:21 +08:00
|
|
|
/**
|
|
|
|
|
* 构建薪资项目的查询参数
|
|
|
|
|
*
|
|
|
|
|
* @param searchParam
|
|
|
|
|
* @param tenantKey
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2022-03-17 15:14:35 +08:00
|
|
|
// public static Wrapper<SalaryItemPO> buildQueryWrapper(SalaryItemSearchParam searchParam, String tenantKey) {
|
|
|
|
|
// LambdaQueryWrapper<SalaryItemPO> wrapper = Wrappers.<SalaryItemPO>lambdaQuery();
|
|
|
|
|
// wrapper.eq(SalaryItemPO::getTenantKey, tenantKey)
|
|
|
|
|
// .eq(SalaryItemPO::getDeleteType, 0)
|
|
|
|
|
// .like(!SalaryEntityUtil.isNullOrEmpty(searchParam.getName()), SalaryItemPO::getName, searchParam.getName())
|
|
|
|
|
// .like(!SalaryEntityUtil.isNullOrEmpty(searchParam.getDescription()), SalaryItemPO::getDescription, searchParam.getDescription())
|
|
|
|
|
// .notIn(SalaryEntityUtil.isNotNullOrEmpty(searchParam.getExcludeIds()), SalaryItemPO::getId, searchParam.getExcludeIds());
|
|
|
|
|
// if (searchParam.getValueType() != null) {
|
|
|
|
|
// wrapper.eq(SalaryItemPO::getValueType, searchParam.getValueType().getValue());
|
|
|
|
|
// }
|
|
|
|
|
// if (searchParam.getUseInEmployeeSalary() != null) {
|
|
|
|
|
// wrapper.eq(SalaryItemPO::getUseInEmployeeSalary, searchParam.getUseInEmployeeSalary().getValue());
|
|
|
|
|
// }
|
|
|
|
|
// if (searchParam.getUseDefault() != null) {
|
|
|
|
|
// wrapper.eq(SalaryItemPO::getUseDefault, searchParam.getUseDefault().getValue());
|
|
|
|
|
// }
|
2022-03-24 16:59:52 +08:00
|
|
|
// if (searchParam.getDataType() != null) {
|
|
|
|
|
// wrapper.eq(SalaryItemPO::getDataType, searchParam.getDataType().getValue());
|
|
|
|
|
// }
|
2022-03-17 15:14:35 +08:00
|
|
|
// wrapper.orderByDesc(SalaryItemPO::getId);
|
|
|
|
|
// return wrapper;
|
|
|
|
|
// }
|
2022-03-21 09:33:21 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 薪资项目po转换成薪资项目列表dto
|
|
|
|
|
*
|
|
|
|
|
* @param salaryItems 薪资项目po
|
|
|
|
|
* @param expressFormulas 公式详情
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2022-07-27 16:56:13 +08:00
|
|
|
public static List<SalaryItemListDTO> convert2ListDTO(Collection<SalaryItemPO> salaryItems, List<ExpressFormula> expressFormulas,List<SysSalaryItemPO> sysSalaryItemPOS) {
|
2022-03-21 20:09:10 +08:00
|
|
|
if (CollectionUtils.isEmpty(salaryItems)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
2022-07-27 16:56:13 +08:00
|
|
|
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
2022-03-21 20:09:10 +08:00
|
|
|
return salaryItems.stream().map(salaryItemPO -> {
|
|
|
|
|
SalaryRoundingModeEnum salaryRoundingModeEnum = SalaryRoundingModeEnum.parseByValue(salaryItemPO.getRoundingMode());
|
|
|
|
|
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemPO.getValueType());
|
2022-03-24 16:59:52 +08:00
|
|
|
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItemPO.getDataType());
|
|
|
|
|
return SalaryItemListDTO.builder()
|
2022-03-21 20:09:10 +08:00
|
|
|
.id(salaryItemPO.getId())
|
2023-02-17 10:54:18 +08:00
|
|
|
.code(salaryItemPO.getCode())
|
2022-03-21 20:09:10 +08:00
|
|
|
.name(salaryItemPO.getName())
|
2022-07-27 16:56:13 +08:00
|
|
|
.systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY))
|
2022-03-21 20:09:10 +08:00
|
|
|
.useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
|
|
|
|
|
.useDefault(salaryItemPO.getUseDefault())
|
2023-07-14 11:34:53 +08:00
|
|
|
.hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault())
|
2022-03-21 20:09:10 +08:00
|
|
|
.roundingMode(Optional.ofNullable(salaryRoundingModeEnum)
|
|
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
|
|
|
|
.pattern(salaryItemPO.getPattern())
|
|
|
|
|
.valueType(Optional.ofNullable(salaryValueTypeEnum)
|
|
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
2022-03-24 16:59:52 +08:00
|
|
|
.dataType(Optional.ofNullable(salaryDataTypeEnum)
|
2022-03-21 20:09:10 +08:00
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
|
|
|
|
.formulaId(salaryItemPO.getFormulaId())
|
|
|
|
|
.formulaContent(formulaMap.getOrDefault(salaryItemPO.getFormulaId(), ""))
|
2022-03-24 16:59:52 +08:00
|
|
|
.taxDeclarationColumn(buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
2023-05-31 09:55:24 +08:00
|
|
|
.sortedIndex(salaryItemPO.getSortedIndex())
|
2022-03-21 20:09:10 +08:00
|
|
|
.description(salaryItemPO.getDescription())
|
2022-05-13 11:22:10 +08:00
|
|
|
.canDelete(true)
|
2022-06-23 18:05:48 +08:00
|
|
|
.canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE))
|
2024-01-02 16:37:07 +08:00
|
|
|
.width(salaryItemPO.getWidth())
|
2022-03-21 20:09:10 +08:00
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
}
|
2022-03-21 09:33:21 +08:00
|
|
|
|
2023-06-01 17:52:31 +08:00
|
|
|
/**
|
|
|
|
|
* 薪资项目po转换成薪资账套中薪资项目列表dto
|
|
|
|
|
*
|
|
|
|
|
* @param salaryItems 薪资项目po
|
|
|
|
|
* @param expressFormulas 公式详情
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static List<SalaryItemSobListDTO> convert2itemSobListDTO(Collection<SalaryItemPO> salaryItems, List<ExpressFormula> expressFormulas, List<SysSalaryItemPO> sysSalaryItemPOS) {
|
|
|
|
|
if (CollectionUtils.isEmpty(salaryItems)) {
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
|
|
|
|
Map<Long, String> sysSalaryItemNameMap = SalaryEntityUtil.convert2Map(sysSalaryItemPOS, SysSalaryItemPO::getId, SysSalaryItemPO::getName);
|
|
|
|
|
return salaryItems.stream().map(salaryItemPO -> {
|
|
|
|
|
SalaryRoundingModeEnum salaryRoundingModeEnum = SalaryRoundingModeEnum.parseByValue(salaryItemPO.getRoundingMode());
|
|
|
|
|
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemPO.getValueType());
|
|
|
|
|
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItemPO.getDataType());
|
|
|
|
|
return SalaryItemSobListDTO.builder()
|
|
|
|
|
.id(salaryItemPO.getId())
|
|
|
|
|
.code(salaryItemPO.getCode())
|
|
|
|
|
.name(salaryItemPO.getName())
|
|
|
|
|
.systemName(sysSalaryItemNameMap.getOrDefault(salaryItemPO.getSysSalaryItemId(), StringUtils.EMPTY))
|
|
|
|
|
.useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
|
|
|
|
|
.useDefault(salaryItemPO.getUseDefault())
|
2023-07-18 11:00:13 +08:00
|
|
|
.hideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault())
|
2023-07-25 16:46:57 +08:00
|
|
|
.roundingMode(salaryItemPO.getRoundingMode())
|
|
|
|
|
.roundingModeShowValue(Optional.ofNullable(salaryRoundingModeEnum)
|
2023-06-01 17:52:31 +08:00
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
|
|
|
|
.pattern(salaryItemPO.getPattern())
|
2023-07-25 16:46:57 +08:00
|
|
|
.valueType(salaryItemPO.getValueType())
|
|
|
|
|
.valueTypeShowValue(Optional.ofNullable(salaryValueTypeEnum)
|
2023-06-01 17:52:31 +08:00
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
2023-07-25 16:46:57 +08:00
|
|
|
.dataType(salaryItemPO.getDataType())
|
|
|
|
|
.dataTypeShowValue(Optional.ofNullable(salaryDataTypeEnum)
|
2023-06-01 17:52:31 +08:00
|
|
|
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
|
|
|
|
.orElse(StringUtils.EMPTY))
|
2023-06-07 12:23:05 +08:00
|
|
|
.formulaId(salaryItemPO.getFormulaId())
|
|
|
|
|
.formulaContent(formulaMap.getOrDefault(salaryItemPO.getFormulaId(),""))
|
2023-07-26 13:43:53 +08:00
|
|
|
.originFormulaContent(salaryValueTypeEnum.getValue() == SalaryValueTypeEnum.FORMULA.getValue() ? formulaMap.getOrDefault(salaryItemPO.getFormulaId(),"") : "")
|
|
|
|
|
.originSqlContent(salaryValueTypeEnum.getValue() == SalaryValueTypeEnum.SQL.getValue() ? formulaMap.getOrDefault(salaryItemPO.getFormulaId(),"") : "")
|
2023-06-01 17:52:31 +08:00
|
|
|
.taxDeclarationColumn(buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
2023-06-08 15:30:52 +08:00
|
|
|
.canDelete(true)
|
|
|
|
|
.canEdit(openFormulaForcedEditing ||Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE))
|
2023-06-01 17:52:31 +08:00
|
|
|
.sortedIndex(salaryItemPO.getSortedIndex())
|
|
|
|
|
.description(salaryItemPO.getDescription())
|
|
|
|
|
.salaryItemType(salaryItemPO.getUseInEmployeeSalary() == 0 ? "薪资项目" : "档案字段")
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-03-21 20:09:10 +08:00
|
|
|
/**
|
|
|
|
|
* 转换成薪资项目详情dto
|
|
|
|
|
*
|
|
|
|
|
* @param salaryItemPO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SalaryItemFormDTO convert2FormDTO(SalaryItemPO salaryItemPO) {
|
|
|
|
|
return new SalaryItemFormDTO()
|
|
|
|
|
.setId(salaryItemPO.getId())
|
|
|
|
|
.setName(salaryItemPO.getName())
|
2022-03-24 19:42:03 +08:00
|
|
|
.setSystemType(salaryItemPO.getSystemType())
|
2022-03-21 20:09:10 +08:00
|
|
|
.setUseDefault(salaryItemPO.getUseDefault())
|
2023-07-18 11:00:13 +08:00
|
|
|
.setHideDefault(salaryItemPO.getHideDefault() == null ? 0 : salaryItemPO.getHideDefault())
|
2022-03-21 20:09:10 +08:00
|
|
|
.setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
|
2022-03-24 19:42:03 +08:00
|
|
|
.setRoundingMode(salaryItemPO.getRoundingMode())
|
2022-03-21 20:09:10 +08:00
|
|
|
.setPattern(salaryItemPO.getPattern())
|
2022-03-24 19:42:03 +08:00
|
|
|
.setValueType(salaryItemPO.getValueType())
|
|
|
|
|
.setDataType(salaryItemPO.getDataType())
|
2022-03-21 20:09:10 +08:00
|
|
|
.setFormulaId(salaryItemPO.getFormulaId())
|
2022-03-24 16:59:52 +08:00
|
|
|
.setTaxDeclarationColumn(buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
2022-03-21 20:09:10 +08:00
|
|
|
.setDescription(salaryItemPO.getDescription())
|
2022-11-15 09:59:40 +08:00
|
|
|
.setCanEdit(salaryItemPO.getCanEdit())
|
|
|
|
|
.setTaxAgentIds(salaryItemPO.getTaxAgentIds())
|
2023-06-01 17:52:31 +08:00
|
|
|
.setSharedType(salaryItemPO.getSharedType())
|
2024-01-02 16:37:07 +08:00
|
|
|
.setSortedIndex(salaryItemPO.getSortedIndex())
|
|
|
|
|
.setWidth(salaryItemPO.getWidth());
|
2022-03-21 20:09:10 +08:00
|
|
|
}
|
2022-03-21 09:33:21 +08:00
|
|
|
|
2022-03-24 16:59:52 +08:00
|
|
|
/**
|
|
|
|
|
* 个税申报表中的对应字段
|
|
|
|
|
*
|
|
|
|
|
* @param code
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String buildTaxDeclarationColumn(String code) {
|
2022-07-27 16:56:13 +08:00
|
|
|
// 是否是个税申报表(正常工资薪金所得)中的字段
|
|
|
|
|
for (Field declaredField : TaxDeclarationWageListDTO.class.getDeclaredFields()) {
|
|
|
|
|
if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals(code, declaredField.getName())) {
|
|
|
|
|
SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class);
|
|
|
|
|
return SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 是否是个税申报表(劳务报酬所得)中的字段
|
|
|
|
|
for (Field declaredField : TaxDeclarationLaborListDTO.class.getDeclaredFields()) {
|
|
|
|
|
if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 时间紧迫,临时处理
|
|
|
|
|
if (Objects.equals(code, declaredField.getName()) || Objects.equals(code, declaredField.getName() + "4")) {
|
|
|
|
|
SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class);
|
|
|
|
|
return SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text());
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-30 17:32:58 +08:00
|
|
|
|
|
|
|
|
// 是否是个税申报表(全年一次性奖金)中的字段
|
|
|
|
|
for (Field declaredField : TaxDeclarationAnnualListDTO.class.getDeclaredFields()) {
|
|
|
|
|
if (!declaredField.isAnnotationPresent(SalaryTableColumn.class)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 时间紧迫,临时处理
|
|
|
|
|
if (Objects.equals(code, declaredField.getName()) || Objects.equals(code, declaredField.getName() + "2")) {
|
|
|
|
|
SalaryTableColumn annotation = declaredField.getAnnotation(SalaryTableColumn.class);
|
|
|
|
|
return SalaryI18nUtil.getI18nLabel((int) annotation.labelId(), annotation.text());
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-24 16:59:52 +08:00
|
|
|
return StringUtils.EMPTY;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-21 09:33:21 +08:00
|
|
|
/**
|
|
|
|
|
* 保存参数/更新参数 转换成薪资项目po
|
|
|
|
|
*
|
|
|
|
|
* @param saveParam 保存参数/更新参数
|
|
|
|
|
* @param employeeId 人员id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static SalaryItemPO convert2SalaryItemPO(SalaryItemSaveParam saveParam, Long employeeId) {
|
|
|
|
|
Date now = new Date();
|
2022-05-13 11:22:10 +08:00
|
|
|
long id = dm.jdbc.util.IdGenerator.generate();
|
2022-03-21 09:33:21 +08:00
|
|
|
SalaryItemPO salaryItemPO = SalaryItemPO.builder()
|
2022-05-13 11:22:10 +08:00
|
|
|
.id(id)
|
2022-04-14 20:46:17 +08:00
|
|
|
.code(IdGenerator.getUUID())
|
2022-03-21 09:33:21 +08:00
|
|
|
.name(saveParam.getName())
|
|
|
|
|
.systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
|
|
|
|
.sysSalaryItemId(NumberUtils.LONG_ZERO)
|
|
|
|
|
.useDefault(saveParam.getUseDefault())
|
|
|
|
|
.useInEmployeeSalary(saveParam.getUseInEmployeeSalary())
|
2023-07-14 11:34:53 +08:00
|
|
|
.hideDefault(saveParam.getHideDefault())
|
2022-03-24 16:59:52 +08:00
|
|
|
.roundingMode(saveParam.getRoundingMode() == null ? SalaryRoundingModeEnum.ROUNDING.getValue() : saveParam.getRoundingMode())
|
2022-03-21 09:33:21 +08:00
|
|
|
.pattern(Optional.ofNullable(saveParam.getPattern()).orElse(2))
|
2022-03-22 21:01:38 +08:00
|
|
|
.valueType(saveParam.getValueType())
|
2022-03-24 16:59:52 +08:00
|
|
|
.dataType(saveParam.getDataType())
|
2022-06-14 16:05:47 +08:00
|
|
|
.formulaId(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.INPUT.getValue()) ? NumberUtils.LONG_ZERO : Optional.ofNullable(saveParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO))
|
2022-03-21 09:33:21 +08:00
|
|
|
.description(saveParam.getDescription())
|
|
|
|
|
.canEdit(NumberUtils.INTEGER_ONE)
|
|
|
|
|
.creator(employeeId)
|
|
|
|
|
.deleteType(NumberUtils.INTEGER_ZERO)
|
|
|
|
|
.createTime(now)
|
|
|
|
|
.updateTime(now)
|
|
|
|
|
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
2022-11-11 13:59:37 +08:00
|
|
|
.sharedType(Optional.ofNullable(saveParam.getSharedType()).orElse(0))
|
|
|
|
|
.taxAgentIds(saveParam.getTaxAgentIds())
|
2023-05-31 09:55:24 +08:00
|
|
|
.sortedIndex(saveParam.getSortedIndex())
|
2024-01-02 16:37:07 +08:00
|
|
|
.width(saveParam.getWidth())
|
2022-03-21 09:33:21 +08:00
|
|
|
.build();
|
2022-03-24 16:59:52 +08:00
|
|
|
// 开启了"薪资档案引用",取值方式固定为输入
|
2023-02-17 10:54:18 +08:00
|
|
|
// if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) {
|
|
|
|
|
// salaryItemPO.setValueType(SalaryValueTypeEnum.INPUT.getValue());
|
|
|
|
|
// salaryItemPO.setFormulaId(NumberUtils.LONG_ZERO);
|
|
|
|
|
// }
|
2022-03-21 09:33:21 +08:00
|
|
|
return salaryItemPO;
|
|
|
|
|
}
|
|
|
|
|
}
|