相对更新
This commit is contained in:
parent
79f9e010af
commit
83e1cf2805
|
|
@ -0,0 +1,22 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SalarySobDefaultItemBiz {
|
||||
|
||||
|
||||
public List<SalarySobDefaultItemPO> listByIncomeCategory(SalarySobDefaultItemPO build) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySobDefaultItemMapper mapper = sqlSession.getMapper(SalarySobDefaultItemMapper.class);
|
||||
return mapper.listSome(build);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,10 @@ import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
|||
import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.enums.*;
|
||||
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;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
|
|
@ -25,6 +28,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class SalaryItemBO {
|
||||
|
||||
|
||||
/**
|
||||
* 构建薪资项目的查询参数
|
||||
*
|
||||
|
|
@ -39,12 +43,6 @@ public class SalaryItemBO {
|
|||
// .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.getCategory() != null) {
|
||||
// wrapper.eq(SalaryItemPO::getCategory, searchParam.getCategory().getValue());
|
||||
// }
|
||||
// if (searchParam.getItemType() != null) {
|
||||
// wrapper.eq(SalaryItemPO::getItemType, searchParam.getItemType().getValue());
|
||||
// }
|
||||
// if (searchParam.getValueType() != null) {
|
||||
// wrapper.eq(SalaryItemPO::getValueType, searchParam.getValueType().getValue());
|
||||
// }
|
||||
|
|
@ -54,6 +52,9 @@ public class SalaryItemBO {
|
|||
// if (searchParam.getUseDefault() != null) {
|
||||
// wrapper.eq(SalaryItemPO::getUseDefault, searchParam.getUseDefault().getValue());
|
||||
// }
|
||||
// if (searchParam.getDataType() != null) {
|
||||
// wrapper.eq(SalaryItemPO::getDataType, searchParam.getDataType().getValue());
|
||||
// }
|
||||
// wrapper.orderByDesc(SalaryItemPO::getId);
|
||||
// return wrapper;
|
||||
// }
|
||||
|
|
@ -71,21 +72,12 @@ public class SalaryItemBO {
|
|||
}
|
||||
Map<Long, String> formulaMap = SalaryEntityUtil.convert2Map(expressFormulas, ExpressFormula::getId, ExpressFormula::getFormula);
|
||||
return salaryItems.stream().map(salaryItemPO -> {
|
||||
SalaryItemCategoryEnum salaryItemCategoryEnum = SalaryItemCategoryEnum.parseByValue(salaryItemPO.getCategory());
|
||||
SalaryItemTypeEnum salaryItemTypeEnum = SalaryItemTypeEnum.parseByValue(salaryItemPO.getItemType());
|
||||
SalaryRoundingModeEnum salaryRoundingModeEnum = SalaryRoundingModeEnum.parseByValue(salaryItemPO.getRoundingMode());
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemPO.getValueType());
|
||||
SalaryDataSourceEnum salaryDataSourceEnum = SalaryDataSourceEnum.parseByValue(salaryItemPO.getDatasource());
|
||||
SalaryItemListDTO dto = SalaryItemListDTO.builder()
|
||||
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(salaryItemPO.getDataType());
|
||||
return SalaryItemListDTO.builder()
|
||||
.id(salaryItemPO.getId())
|
||||
.name(salaryItemPO.getName())
|
||||
.category(Optional.ofNullable(salaryItemCategoryEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.itemTypeKey(salaryItemTypeEnum)
|
||||
.itemType(Optional.ofNullable(salaryItemTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.useInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
|
||||
.useDefault(salaryItemPO.getUseDefault())
|
||||
.roundingMode(Optional.ofNullable(salaryRoundingModeEnum)
|
||||
|
|
@ -95,19 +87,15 @@ public class SalaryItemBO {
|
|||
.valueType(Optional.ofNullable(salaryValueTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.datasource(Optional.ofNullable(salaryDataSourceEnum)
|
||||
.dataType(Optional.ofNullable(salaryDataTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.formulaId(salaryItemPO.getFormulaId())
|
||||
.formulaContent(formulaMap.getOrDefault(salaryItemPO.getFormulaId(), ""))
|
||||
.taxDeclarationColumn(buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
||||
.description(salaryItemPO.getDescription())
|
||||
.canEdit(Objects.equals(salaryItemPO.getCanEdit(), NumberUtils.INTEGER_ONE))
|
||||
.build();
|
||||
if (Objects.equals(salaryItemPO.getUseInEmployeeSalary(), 1)) {
|
||||
dto.setDatasource(SalaryI18nUtil.getI18nLabel(SalaryDataSourceEnum.SALARY_ARCHIVES.getLabelId(),
|
||||
SalaryDataSourceEnum.SALARY_ARCHIVES.getDefaultLabel()));
|
||||
}
|
||||
return dto;
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
|
|
@ -125,26 +113,55 @@ public class SalaryItemBO {
|
|||
.setSystemType(SalarySystemTypeEnum.parseByValue(salaryItemPO.getSystemType()))
|
||||
.setUseDefault(salaryItemPO.getUseDefault())
|
||||
.setUseInEmployeeSalary(salaryItemPO.getUseInEmployeeSalary())
|
||||
.setCategory(SalaryItemCategoryEnum.parseByValue(salaryItemPO.getCategory()))
|
||||
.setItemType(SalaryItemTypeEnum.parseByValue(salaryItemPO.getItemType()))
|
||||
.setRoundingMode(SalaryRoundingModeEnum.parseByValue(salaryItemPO.getRoundingMode()))
|
||||
.setPattern(salaryItemPO.getPattern())
|
||||
.setValueType(SalaryValueTypeEnum.parseByValue(salaryItemPO.getValueType()))
|
||||
.setDataType(SalaryDataTypeEnum.parseByValue(salaryItemPO.getDataType()))
|
||||
.setFormulaId(salaryItemPO.getFormulaId())
|
||||
.setTaxDeclarationColumn(buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
||||
.setDescription(salaryItemPO.getDescription())
|
||||
.setCanEdit(salaryItemPO.getCanEdit());
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税申报表中的对应字段
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public static String buildTaxDeclarationColumn(String code) {
|
||||
// // 是否是个税申报表(正常工资薪金所得)中的字段
|
||||
// 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.label());
|
||||
// }
|
||||
// }
|
||||
// // 是否是个税申报表(劳务报酬所得)中的字段
|
||||
// for (Field declaredField : TaxDeclarationLaborListDTO.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.label());
|
||||
// }
|
||||
// }
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存参数/更新参数 转换成薪资项目po
|
||||
*
|
||||
* @param saveParam 保存参数/更新参数
|
||||
* @param employeeId 人员id
|
||||
* @param tenantKey 租户key
|
||||
* @return
|
||||
*/
|
||||
public static SalaryItemPO convert2SalaryItemPO(SalaryItemSaveParam saveParam, Long employeeId) {
|
||||
|
||||
String name = saveParam.getName();
|
||||
Date now = new Date();
|
||||
// long id = IdGenerator.generate();
|
||||
SalaryItemPO salaryItemPO = SalaryItemPO.builder()
|
||||
|
|
@ -153,28 +170,24 @@ public class SalaryItemBO {
|
|||
.name(saveParam.getName())
|
||||
.systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
||||
.sysSalaryItemId(NumberUtils.LONG_ZERO)
|
||||
.category(saveParam.getCategory())
|
||||
.itemType(saveParam.getItemType())
|
||||
.useDefault(saveParam.getUseDefault())
|
||||
.useInEmployeeSalary(saveParam.getUseInEmployeeSalary())
|
||||
.roundingMode(Optional.ofNullable(SalaryRoundingModeEnum.parseByValue(saveParam.getRoundingMode())).map(SalaryRoundingModeEnum::getValue).orElse(SalaryRoundingModeEnum.ROUNDING.getValue()))
|
||||
.roundingMode(saveParam.getRoundingMode() == null ? SalaryRoundingModeEnum.ROUNDING.getValue() : saveParam.getRoundingMode())
|
||||
.pattern(Optional.ofNullable(saveParam.getPattern()).orElse(2))
|
||||
.valueType(saveParam.getValueType())
|
||||
.datasource(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.INPUT.getValue()) ? SalaryDataSourceEnum.INPUT_IMPORT.getValue() : SalaryDataSourceEnum.CUSTOM_FORMULA.getValue())
|
||||
.formulaId(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.FORMULA.getValue()) ? Optional.ofNullable(saveParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO) : NumberUtils.LONG_ZERO)
|
||||
.dataType(saveParam.getDataType())
|
||||
.formulaId(saveParam.getValueType() == SalaryValueTypeEnum.FORMULA.getValue() ? Optional.ofNullable(saveParam.getFormulaId()).orElse(NumberUtils.LONG_ZERO) : NumberUtils.LONG_ZERO)
|
||||
.description(saveParam.getDescription())
|
||||
.canEdit(NumberUtils.INTEGER_ONE)
|
||||
.canDelete(NumberUtils.INTEGER_ONE)
|
||||
.creator(employeeId)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
// 开启了"薪资档案引用",取值方式固定为输入,数据来源固定为薪资档案
|
||||
// 开启了"薪资档案引用",取值方式固定为输入
|
||||
if (Objects.equals(saveParam.getUseInEmployeeSalary(), NumberUtils.INTEGER_ONE)) {
|
||||
salaryItemPO.setValueType(SalaryValueTypeEnum.INPUT.getValue());
|
||||
salaryItemPO.setDatasource(SalaryDataSourceEnum.SALARY_ARCHIVES.getValue());
|
||||
salaryItemPO.setFormulaId(NumberUtils.LONG_ZERO);
|
||||
}
|
||||
return salaryItemPO;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ import com.engine.salary.entity.salaryitem.dto.SalaryItemFormDTO;
|
|||
import com.engine.salary.entity.salaryitem.dto.SysSalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.enums.*;
|
||||
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;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -23,24 +26,20 @@ import java.util.stream.Collectors;
|
|||
* @version:v1.0
|
||||
*/
|
||||
public class SysSalaryItemBO {
|
||||
|
||||
// /**
|
||||
// * 查询参数构建queryWrapper
|
||||
// *
|
||||
// * @param searchParam 系统薪资项目列表查询参数
|
||||
// * @return
|
||||
// */
|
||||
/**
|
||||
* 查询参数构建queryWrapper
|
||||
*
|
||||
* @param searchParam 系统薪资项目列表查询参数
|
||||
* @return
|
||||
*/
|
||||
// public static Wrapper<SysSalaryItemPO> buildQueryWrapper(SysSalaryItemSearchParam searchParam) {
|
||||
// LambdaQueryWrapper<SysSalaryItemPO> wrapper = Wrappers.lambdaQuery();
|
||||
// wrapper.eq(SysSalaryItemPO::getTenantKey, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .eq(SysSalaryItemPO::getDeleteType, 0)
|
||||
// .like(SalaryEntityUtil.isNotNullOrEmpty(searchParam.getName()), SysSalaryItemPO::getName, searchParam.getName())
|
||||
// .notIn(SalaryEntityUtil.isNotNullOrEmpty(searchParam.getExcludeIds()), SysSalaryItemPO::getId, searchParam.getExcludeIds());
|
||||
// if (searchParam.getCategory() != null) {
|
||||
// wrapper.eq(SysSalaryItemPO::getCategory, searchParam.getCategory().getValue());
|
||||
// }
|
||||
// if (searchParam.getItemType() != null) {
|
||||
// wrapper.eq(SysSalaryItemPO::getItemType, searchParam.getItemType().getValue());
|
||||
// if (Objects.nonNull(searchParam.getDataType())) {
|
||||
// wrapper.eq(SysSalaryItemPO::getDataType, searchParam.getDataType().getValue());
|
||||
// }
|
||||
// wrapper.orderByDesc(SysSalaryItemPO::getId);
|
||||
// return wrapper;
|
||||
|
|
@ -57,19 +56,12 @@ public class SysSalaryItemBO {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
return sysSalaryItems.stream().map(sysSalaryItemPO -> {
|
||||
SalaryItemCategoryEnum salaryItemCategoryEnum = SalaryItemCategoryEnum.parseByValue(sysSalaryItemPO.getCategory());
|
||||
SalaryItemTypeEnum salaryItemTypeEnum = SalaryItemTypeEnum.parseByValue(sysSalaryItemPO.getItemType());
|
||||
SalaryRoundingModeEnum salaryRoundingModeEnum = SalaryRoundingModeEnum.parseByValue(sysSalaryItemPO.getRoundingMode());
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(sysSalaryItemPO.getValueType());
|
||||
SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(sysSalaryItemPO.getDataType());
|
||||
return SysSalaryItemListDTO.builder()
|
||||
.id(sysSalaryItemPO.getId())
|
||||
.name(sysSalaryItemPO.getName())
|
||||
.category(Optional.ofNullable(salaryItemCategoryEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.itemType(Optional.ofNullable(salaryItemTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.roundingMode(Optional.ofNullable(salaryRoundingModeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
|
|
@ -77,6 +69,10 @@ public class SysSalaryItemBO {
|
|||
.valueType(Optional.ofNullable(salaryValueTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.dataType(Optional.ofNullable(salaryDataTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.taxDeclarationColumn(SalaryItemBO.buildTaxDeclarationColumn(sysSalaryItemPO.getCode()))
|
||||
.build();
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
|
|
@ -96,11 +92,10 @@ public class SysSalaryItemBO {
|
|||
.setSystemType(SalarySystemTypeEnum.parseByValue(sysSalaryItemPO.getSystemType()))
|
||||
.setUseDefault(sysSalaryItemPO.getUseDefault())
|
||||
.setUseInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary())
|
||||
.setCategory(SalaryItemCategoryEnum.parseByValue(sysSalaryItemPO.getCategory()))
|
||||
.setItemType(SalaryItemTypeEnum.parseByValue(sysSalaryItemPO.getItemType()))
|
||||
.setRoundingMode(SalaryRoundingModeEnum.parseByValue(sysSalaryItemPO.getRoundingMode()))
|
||||
.setPattern(sysSalaryItemPO.getPattern())
|
||||
.setValueType(SalaryValueTypeEnum.parseByValue(sysSalaryItemPO.getValueType()))
|
||||
.setDataType(SalaryDataTypeEnum.parseByValue(sysSalaryItemPO.getDataType()))
|
||||
.setFormulaId(sysSalaryItemPO.getFormulaId())
|
||||
.setDescription(sysSalaryItemPO.getDescription());
|
||||
}
|
||||
|
|
@ -133,7 +128,6 @@ public class SysSalaryItemBO {
|
|||
if (sysSalaryItemPO == null) {
|
||||
return null;
|
||||
}
|
||||
Date now = new Date();
|
||||
// long id = IdGenerator.generate();
|
||||
return SalaryItemPO.builder()
|
||||
// .id(id)
|
||||
|
|
@ -141,23 +135,19 @@ public class SysSalaryItemBO {
|
|||
.name(sysSalaryItemPO.getName())
|
||||
.systemType(SalarySystemTypeEnum.SYSTEM.getValue())
|
||||
.sysSalaryItemId(sysSalaryItemPO.getId())
|
||||
.category(sysSalaryItemPO.getCategory())
|
||||
.itemType(sysSalaryItemPO.getItemType())
|
||||
.useDefault(sysSalaryItemPO.getUseDefault())
|
||||
.useInEmployeeSalary(sysSalaryItemPO.getUseInEmployeeSalary())
|
||||
.roundingMode(sysSalaryItemPO.getRoundingMode())
|
||||
.pattern(sysSalaryItemPO.getPattern())
|
||||
.valueType(sysSalaryItemPO.getValueType())
|
||||
.datasource(sysSalaryItemPO.getDatasource())
|
||||
.dataType(sysSalaryItemPO.getDataType())
|
||||
.formulaId(sysSalaryItemPO.getFormulaId())
|
||||
.description(sysSalaryItemPO.getDescription())
|
||||
.canEdit(sysSalaryItemPO.getCanEdit())
|
||||
.canDelete(sysSalaryItemPO.getCanDelete())
|
||||
.creator(employeeId)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryitem.dto;
|
||||
|
||||
import com.engine.salary.enums.*;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
|
@ -67,4 +68,12 @@ public class SalaryItemFormDTO {
|
|||
//是否可以编辑")
|
||||
private Integer canEdit;
|
||||
|
||||
//字段类型
|
||||
private SalaryDataTypeEnum dataType;
|
||||
|
||||
//个税申报表对应字段")
|
||||
private String taxDeclarationColumn;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.cloudstore.eccom.pc.table.WeaTableType;
|
|||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import com.engine.salary.enums.SalaryItemTypeEnum;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -54,21 +53,8 @@ public class SalaryItemListDTO {
|
|||
@SalaryTableColumn(text = "取值方式", width = "10%", column = "valueType",transmethod = "com.engine.salary.transmethod.TransMethod.datasource")
|
||||
private String valueType;
|
||||
|
||||
@SalaryTableColumn(text = "字段类型", width = "10%", column = "itemType",transmethod = "com.engine.salary.transmethod.TransMethod.valueType")
|
||||
private String itemType;
|
||||
|
||||
@SalaryTableColumn(text = "属性", width = "10%", column = "category")
|
||||
private String category;
|
||||
|
||||
//备注
|
||||
@SalaryTableColumn(text = "备注", width = "10%", column = "description")
|
||||
private String description;
|
||||
|
||||
//类型
|
||||
private SalaryItemTypeEnum itemTypeKey;
|
||||
|
||||
//数据来源
|
||||
private String datasource;
|
||||
@SalaryTableColumn(text = "字段类型", width = "10%", column = "itemType",transmethod = "com.engine.salary.transmethod.TransMethod.dataType")
|
||||
private String dataType;
|
||||
|
||||
//公式id
|
||||
private Long formulaId;
|
||||
|
|
@ -76,6 +62,13 @@ public class SalaryItemListDTO {
|
|||
//公式内容
|
||||
private String formulaContent;
|
||||
|
||||
@SalaryTableColumn(text = "个税申报表对应字段", width = "10%", column = "taxDeclarationColumn")
|
||||
private String taxDeclarationColumn;
|
||||
|
||||
//备注
|
||||
@SalaryTableColumn(text = "备注", width = "10%", column = "description")
|
||||
private String description;
|
||||
|
||||
|
||||
//是否可以编辑
|
||||
private boolean canEdit;
|
||||
|
|
|
|||
|
|
@ -36,12 +36,6 @@ public class SysSalaryItemListDTO {
|
|||
@SalaryTableColumn(text = "名称", width = "10%", column = "name")
|
||||
private String name;
|
||||
|
||||
@SalaryTableColumn(text = "属性", width = "10%", column = "category")
|
||||
private String category;
|
||||
|
||||
@SalaryTableColumn(text = "类型", width = "10%", column = "itemType",transmethod = "com.engine.salary.transmethod.TransMethod.valueType")
|
||||
private String itemType;
|
||||
|
||||
@SalaryTableColumn(text = "进位规则", width = "10%", column = "roundingMode",transmethod = "com.engine.salary.transmethod.TransMethod.roundingMode")
|
||||
private String roundingMode;
|
||||
|
||||
|
|
@ -51,6 +45,12 @@ public class SysSalaryItemListDTO {
|
|||
@SalaryTableColumn(text = "取值方式", width = "10%", column = "valueType",transmethod = "com.engine.salary.transmethod.TransMethod.datasource")
|
||||
private String valueType;
|
||||
|
||||
@SalaryTableColumn(text = "字段类型", width = "10%", column = "dataType")
|
||||
private String dataType;
|
||||
|
||||
@SalaryTableColumn(text = "个税申报表对应字段", width = "10%", column = "taxDeclarationColumn")
|
||||
private String taxDeclarationColumn;
|
||||
|
||||
@SalaryTableColumn(text = "操作", width = "20%", column = "operate")
|
||||
private String operate;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.engine.salary.entity.salaryitem.param;
|
||||
|
||||
import com.engine.salary.enums.*;
|
||||
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;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
import com.engine.salary.util.valid.ValidTypeEnum;
|
||||
|
|
@ -46,21 +49,6 @@ public class SalaryItemSaveParam {
|
|||
//薪资档案引用
|
||||
private Integer useInEmployeeSalary;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*
|
||||
* @see SalaryItemCategoryEnum
|
||||
*/
|
||||
@DataCheck(require = true, message = "属性不允许为空")
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* @see SalaryItemTypeEnum
|
||||
*/
|
||||
@DataCheck(require = true, message = "类型不允许为空")
|
||||
private Integer itemType;
|
||||
|
||||
/**
|
||||
* 舍入规则
|
||||
|
|
@ -81,9 +69,18 @@ public class SalaryItemSaveParam {
|
|||
@DataCheck(require = true, message = "取值方式不允许为空")
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
@DataCheck(require = true, message = "字段类型不允许为空")
|
||||
private String dataType;
|
||||
|
||||
|
||||
//公式
|
||||
private Long formulaId;
|
||||
|
||||
//备注
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.engine.salary.entity.salaryitem.param;
|
||||
|
||||
import com.engine.salary.entity.base.BaseQueryParam;
|
||||
import com.engine.salary.enums.SalaryItemCategoryEnum;
|
||||
import com.engine.salary.enums.SalaryItemTypeEnum;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -35,19 +34,6 @@ public class SalaryItemSearchParam extends BaseQueryParam {
|
|||
//备注
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*
|
||||
* @see SalaryItemCategoryEnum
|
||||
*/
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*
|
||||
* @see SalaryItemTypeEnum
|
||||
*/
|
||||
private Integer itemType;
|
||||
|
||||
/**
|
||||
* 是否薪资档案引用
|
||||
|
|
@ -70,11 +56,17 @@ public class SalaryItemSearchParam extends BaseQueryParam {
|
|||
*/
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
private Integer dataType;
|
||||
|
||||
//需要排除的系统薪资项目@see
|
||||
private Collection<Long> excludeIds;
|
||||
|
||||
|
||||
|
||||
public static String makeSqlWhere(SalaryItemSearchParam searchParam) {
|
||||
|
||||
String sqlWhere = " t.delete_type = 0 ";
|
||||
|
|
@ -87,14 +79,6 @@ public class SalaryItemSearchParam extends BaseQueryParam {
|
|||
if (StringUtils.isNotBlank(description)) {
|
||||
sqlWhere += " AND t.description = " + description;
|
||||
}
|
||||
Integer category = searchParam.getCategory();
|
||||
if (category != null) {
|
||||
sqlWhere += " AND t.category = " + category;
|
||||
}
|
||||
Integer itemType = searchParam.getItemType();
|
||||
if (itemType != null) {
|
||||
sqlWhere += " AND t.item_type = " + itemType;
|
||||
}
|
||||
Integer useInEmployeeSalary = searchParam.getUseInEmployeeSalary();
|
||||
if (useInEmployeeSalary != null) {
|
||||
sqlWhere += " AND t.use_in_employee_salary = " + useInEmployeeSalary;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.engine.salary.entity.salaryitem.po;
|
||||
|
||||
import com.engine.salary.enums.*;
|
||||
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;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -10,12 +13,13 @@ import java.util.Collection;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 10/25/21 2:08 PM
|
||||
* @version:v1.0
|
||||
*/
|
||||
* 薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
|
@ -50,20 +54,6 @@ public class SalaryItemPO {
|
|||
*/
|
||||
private Long sysSalaryItemId;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*
|
||||
* @see SalaryItemCategoryEnum
|
||||
*/
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* @see SalaryItemTypeEnum
|
||||
*/
|
||||
private Integer itemType;
|
||||
|
||||
/**
|
||||
* 默认使用。0:默认不适用、1:默认使用
|
||||
*/
|
||||
|
|
@ -86,13 +76,6 @@ public class SalaryItemPO {
|
|||
*/
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*
|
||||
* @see SalaryDataSourceEnum
|
||||
*/
|
||||
private Integer datasource;
|
||||
|
||||
/**
|
||||
* 取值方式
|
||||
*
|
||||
|
|
@ -100,6 +83,13 @@ public class SalaryItemPO {
|
|||
*/
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
|
|
@ -115,11 +105,6 @@ public class SalaryItemPO {
|
|||
*/
|
||||
private Integer canEdit;
|
||||
|
||||
/**
|
||||
* 是否可删除(只是针对薪资账套而言)。0:不可删除、1:可删除
|
||||
*/
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.salaryitem.po;
|
||||
|
||||
import com.engine.salary.enums.*;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -46,20 +47,6 @@ public class SysSalaryItemPO {
|
|||
*/
|
||||
private Integer systemType;
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*
|
||||
* @see SalaryItemCategoryEnum
|
||||
*/
|
||||
private Integer category;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* @see SalaryItemTypeEnum
|
||||
*/
|
||||
private Integer itemType;
|
||||
|
||||
/**
|
||||
* 默认使用。0:默认不适用、1:默认使用
|
||||
*/
|
||||
|
|
@ -82,13 +69,6 @@ public class SysSalaryItemPO {
|
|||
*/
|
||||
private Integer pattern;
|
||||
|
||||
/**
|
||||
* 数据来源
|
||||
*
|
||||
* @see SalaryDataSourceEnum
|
||||
*/
|
||||
private Integer datasource;
|
||||
|
||||
/**
|
||||
* 取值方式
|
||||
*
|
||||
|
|
@ -96,6 +76,13 @@ public class SysSalaryItemPO {
|
|||
*/
|
||||
private Integer valueType;
|
||||
|
||||
/**
|
||||
* 字段类型
|
||||
*
|
||||
* @see SalaryDataTypeEnum
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 公式
|
||||
*/
|
||||
|
|
@ -111,11 +98,6 @@ public class SysSalaryItemPO {
|
|||
*/
|
||||
private Integer canEdit;
|
||||
|
||||
/**
|
||||
* 是否可删除(只是针对薪资账套而言)。0:不可删除、1:可删除
|
||||
*/
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.bo.SalaryItemBO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobEmpFieldDTO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
|
|
@ -9,14 +10,12 @@ import com.engine.salary.entity.salarysob.po.SalarySobEmpFieldPO;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobItemGroupPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.weaver.excel.formula.api.entity.ExpressFormula;
|
||||
import lombok.AllArgsConstructor;
|
||||
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;
|
||||
|
|
@ -88,32 +87,18 @@ public class SalarySobItemAggregateBO {
|
|||
for (int i = 0; i < v.size(); i++) {
|
||||
SalarySobItemPO salarySobItemPO = v.get(i);
|
||||
SalaryItemPO salaryItemPO = salaryItemMap.get(salarySobItemPO.getSalaryItemId());
|
||||
SalaryItemTypeEnum salaryItemTypeEnum = SalaryItemTypeEnum.parseByValue(salaryItemPO.getItemType());
|
||||
SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(salaryItemPO.getValueType());
|
||||
SalaryDataSourceEnum salaryDataSourceEnum = SalaryDataSourceEnum.parseByValue(salaryItemPO.getDatasource());
|
||||
items.add(SalarySobItemDTO.builder()
|
||||
.id(salarySobItemPO.getId())
|
||||
.salarySobId(salarySob.getId())
|
||||
.salaryItemGroupId(k)
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.name(salaryItemPO.getName())
|
||||
.systemType(SalarySystemTypeEnum.parseByValue(salaryItemPO.getSystemType()))
|
||||
.useDefault(salaryItemPO.getUseDefault())
|
||||
.category(SalaryItemCategoryEnum.parseByValue(salaryItemPO.getCategory()))
|
||||
.itemTypeId(salaryItemTypeEnum)
|
||||
.itemType(Optional.ofNullable(salaryItemTypeEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.valueType(salaryValueTypeEnum)
|
||||
.dataSourceId(salaryDataSourceEnum)
|
||||
.dataSource(Optional.ofNullable(salaryDataSourceEnum)
|
||||
.map(e -> SalaryI18nUtil.getI18nLabel(e.getLabelId(), e.getDefaultLabel()))
|
||||
.orElse(StringUtils.EMPTY))
|
||||
.formulaId(salarySobItemPO.getFormulaId())
|
||||
.formulaContent(formulaMap.getOrDefault(salarySobItemPO.getFormulaId(), ""))
|
||||
.taxDeclarationColumn(SalaryItemBO.buildTaxDeclarationColumn(salaryItemPO.getCode()))
|
||||
.sortedIndex(i)
|
||||
.canEdit(salaryItemPO.getCanEdit() == 1)
|
||||
.canDelete(salaryItemPO.getCanDelete() == 1)
|
||||
.canEdit(Objects.equals(salaryItemPO.getCanEdit(), 1))
|
||||
.canDelete(Objects.equals(salarySobItemPO.getCanDelete(), 1))
|
||||
.build());
|
||||
}
|
||||
if (!salarySobItemGroupDTOMap.containsKey(k)) {
|
||||
|
|
@ -140,9 +125,9 @@ public class SalarySobItemAggregateBO {
|
|||
* @return
|
||||
*/
|
||||
private List<SalarySobEmpFieldDTO> buildEmpField(Collection<SalarySobEmpFieldPO> salarySobEmpFields) {
|
||||
// if (CollectionUtils.isEmpty(salarySobEmpFields)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
if (CollectionUtils.isEmpty(salarySobEmpFields)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// Field[] declaredFields = SalaryFormulaEmployeeDTO.class.getDeclaredFields();
|
||||
// Map<String, String> empFieldMap = Maps.newHashMapWithExpectedSize(declaredFields.length);
|
||||
// for (Field declaredField : declaredFields) {
|
||||
|
|
@ -152,17 +137,16 @@ public class SalarySobItemAggregateBO {
|
|||
// SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class);
|
||||
// empFieldMap.put(declaredField.getName(), SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
|
||||
// }
|
||||
// return salarySobEmpFields.stream()
|
||||
// .map(e -> SalarySobEmpFieldDTO.builder()
|
||||
// .id(e.getId())
|
||||
// .salarySobId(e.getSalarySobId())
|
||||
// .fieldId(e.getFieldCode())
|
||||
return salarySobEmpFields.stream()
|
||||
.map(e -> SalarySobEmpFieldDTO.builder()
|
||||
.id(e.getId())
|
||||
.salarySobId(e.getSalarySobId())
|
||||
.fieldId(e.getFieldCode())
|
||||
// .fieldName(empFieldMap.getOrDefault(e.getFieldCode(), ""))
|
||||
// .sortedIndex(e.getSortedIndex())
|
||||
// .canDelete(Objects.equals(e.getCanDelete(), NumberUtils.INTEGER_ONE))
|
||||
// .build())
|
||||
// .collect(Collectors.toList());
|
||||
return null;
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.canDelete(Objects.equals(e.getCanDelete(), NumberUtils.INTEGER_ONE))
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
package com.engine.salary.entity.salarysob.bo;
|
||||
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 薪资账套薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalarySobItemBO {
|
||||
|
||||
/**
|
||||
* 默认包含的员工信息字段转换成薪资账套员工信息字段po
|
||||
*
|
||||
* @param salarySobId 薪资账套id
|
||||
* @param defaultEmpFieldList 默认包含的员工信息字段
|
||||
* @param employeeId 当前登陆人员id
|
||||
* @param tenantKey 当前登陆人员的租户key
|
||||
* @return
|
||||
*/
|
||||
public static List<SalarySobEmpFieldPO> convert2EmpFieldPO(Long salarySobId, List<SalarySobDefaultEmpFieldPO> defaultEmpFieldList, Long employeeId, String tenantKey) {
|
||||
Date now = new Date();
|
||||
return defaultEmpFieldList.stream()
|
||||
.map(field -> new SalarySobEmpFieldPO()
|
||||
// .setId(IdGenerator.generate())
|
||||
.setSalarySobId(salarySobId)
|
||||
.setFieldCode(field.getFieldCode())
|
||||
.setSortedIndex(field.getSortedIndex())
|
||||
.setCanDelete(field.getCanDelete())
|
||||
.setCreator(employeeId)
|
||||
.setCreateTime(now)
|
||||
.setUpdateTime(now)
|
||||
.setDeleteType(0)
|
||||
.setTenantKey(tenantKey))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成薪资账套的薪资项目副本po
|
||||
*
|
||||
* @param salarySobId
|
||||
* @param salarySobDefaultItemGroupPOS
|
||||
* @param salarySobDefaultItemPOS
|
||||
* @param defaultSalaryItemPOS
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
public static Result initSalarySobItem(Long salarySobId,
|
||||
List<SalarySobDefaultItemGroupPO> salarySobDefaultItemGroupPOS,
|
||||
List<SalarySobDefaultItemPO> salarySobDefaultItemPOS,
|
||||
List<SalaryItemPO> defaultSalaryItemPOS,
|
||||
Long employeeId, String tenantKey) {
|
||||
Date now = new Date();
|
||||
// 处理薪资账套默认的薪资项目分类
|
||||
Map<Long, Long> salarySobItemGroupIdMap = Maps.newHashMapWithExpectedSize(salarySobDefaultItemGroupPOS.size());
|
||||
List<SalarySobItemGroupPO> salarySobItemGroups = Lists.newArrayListWithExpectedSize(salarySobDefaultItemGroupPOS.size());
|
||||
for (SalarySobDefaultItemGroupPO salarySobDefaultItemGroupPO : salarySobDefaultItemGroupPOS) {
|
||||
long salarySobItemGroupId = IdGenerator.generate();
|
||||
salarySobItemGroups.add(SalarySobItemGroupPO.builder()
|
||||
.id(salarySobItemGroupId)
|
||||
.name(salarySobDefaultItemGroupPO.getName())
|
||||
.salarySobId(salarySobId)
|
||||
.sortedIndex(salarySobDefaultItemGroupPO.getSortedIndex())
|
||||
.description(salarySobDefaultItemGroupPO.getDescription())
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(tenantKey)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
salarySobItemGroupIdMap.put(salarySobDefaultItemGroupPO.getId(), salarySobItemGroupId);
|
||||
}
|
||||
|
||||
List<SalarySobItemPO> salarySobItems = Lists.newArrayListWithExpectedSize(defaultSalaryItemPOS.size());
|
||||
// 处理薪资账套默认的系统薪资项目
|
||||
Set<Long> sysSalaryItemIds = SalaryEntityUtil.properties(salarySobDefaultItemPOS, SalarySobDefaultItemPO::getSysSalaryItemId);
|
||||
Map<Long, SalaryItemPO> salaryItemPOMap = defaultSalaryItemPOS.stream()
|
||||
.filter(salaryItemPO -> sysSalaryItemIds.contains(salaryItemPO.getSysSalaryItemId()))
|
||||
.collect(Collectors.toMap(SalaryItemPO::getSysSalaryItemId, Function.identity(), (a, b) -> a));
|
||||
for (SalarySobDefaultItemPO salarySobDefaultItemPO : salarySobDefaultItemPOS) {
|
||||
SalaryItemPO salaryItemPO = salaryItemPOMap.get(salarySobDefaultItemPO.getSysSalaryItemId());
|
||||
salarySobItems.add(SalarySobItemPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
.salarySobId(salarySobId)
|
||||
.salarySobItemGroupId(salarySobItemGroupIdMap.getOrDefault(salarySobDefaultItemPO.getSobDefaultItemGroupId(), NumberUtils.LONG_ZERO))
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.formulaId(salaryItemPO.getFormulaId())
|
||||
.sortedIndex(salarySobDefaultItemPO.getSortedIndex())
|
||||
.description(salaryItemPO.getDescription())
|
||||
.canDelete(salarySobDefaultItemPO.getCanDelete())
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(tenantKey)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
}
|
||||
// 处理薪资账套默认的自定义薪资项目(开启了"默认使用")
|
||||
for (int i = 0; i < defaultSalaryItemPOS.size(); i++) {
|
||||
SalaryItemPO salaryItemPO = defaultSalaryItemPOS.get(i);
|
||||
if (sysSalaryItemIds.contains(salaryItemPO.getSysSalaryItemId())) {
|
||||
continue;
|
||||
}
|
||||
salarySobItems.add(SalarySobItemPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
.salarySobId(salarySobId)
|
||||
.salarySobItemGroupId(NumberUtils.LONG_ZERO)
|
||||
.salaryItemId(salaryItemPO.getId())
|
||||
.formulaId(salaryItemPO.getFormulaId())
|
||||
.sortedIndex(i)
|
||||
.description(salaryItemPO.getDescription())
|
||||
.canDelete(NumberUtils.INTEGER_ONE)
|
||||
.creator(employeeId)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.tenantKey(tenantKey)
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.build());
|
||||
}
|
||||
return new Result().setNeedInsertSalarySobItems(salarySobItems).setNeedInsertSalarySobItemGroups(salarySobItemGroups);
|
||||
}
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public static class Result {
|
||||
|
||||
/**
|
||||
* 需要保存的薪资项目
|
||||
*/
|
||||
List<SalarySobItemPO> needInsertSalarySobItems;
|
||||
|
||||
/**
|
||||
* 需要保存的薪资项目分类
|
||||
*/
|
||||
List<SalarySobItemGroupPO> needInsertSalarySobItemGroups;
|
||||
}
|
||||
}
|
||||
|
|
@ -73,6 +73,9 @@ public class SalarySobItemDTO {
|
|||
//公式内容
|
||||
private String formulaContent;
|
||||
|
||||
//个税申报表对应字段
|
||||
private String taxDeclarationColumn;
|
||||
|
||||
//排序字段
|
||||
private Integer sortedIndex;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
package com.engine.salary.entity.salarysob.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
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
|
||||
//hrsa_sob_default_item_group
|
||||
public class SalarySobDefaultItemGroupPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资类型
|
||||
*/
|
||||
private Integer incomeCategory;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_salary_sob_default_item")
|
||||
//hrsa_salary_sob_default_item
|
||||
public class SalarySobDefaultItemPO {
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +41,20 @@ public class SalarySobDefaultItemPO {
|
|||
*/
|
||||
private Long sysSalaryItemId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 薪资账套默认的薪资项目分类id
|
||||
*/
|
||||
private Long sobDefaultItemGroupId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer sortedIndex;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 能否编辑
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ public class SalarySobItemPO {
|
|||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 是否可以删除。0:不可删除、1:可以删除
|
||||
*/
|
||||
private Integer canDelete;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.engine.salary.enums.salaryitem;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @description: 薪资项目的字段类型
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: 2022/3/10 17:16
|
||||
* @version:v1.0
|
||||
*/
|
||||
public enum SalaryDataTypeEnum implements BaseEnum<String> {
|
||||
STRING("string", "字符", 105093),
|
||||
NUMBER("number", "数值", 87625),
|
||||
;
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
SalaryDataTypeEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLabel;
|
||||
}
|
||||
|
||||
public static SalaryDataTypeEnum parseByValue(String value) {
|
||||
for (SalaryDataTypeEnum salaryDataTypeEnum : SalaryDataTypeEnum.values()) {
|
||||
if (Objects.equals(salaryDataTypeEnum.getValue(), value)) {
|
||||
return salaryDataTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
SalaryDataTypeEnum[] enumAry = SalaryDataTypeEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -39,14 +39,7 @@ public interface SalaryItemMapper {
|
|||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryItemPO SalaryItemPO);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param SalaryItemPO 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryItemPO SalaryItemPO);
|
||||
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
|
|
|
|||
|
|
@ -7,23 +7,20 @@
|
|||
<result column="code" property="code"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="sys_salary_item_id" property="sysSalaryItemId"/>
|
||||
<result column="category" property="category"/>
|
||||
<result column="item_type" property="itemType"/>
|
||||
<result column="use_default" property="useDefault"/>
|
||||
<result column="use_in_employee_salary" property="useInEmployeeSalary"/>
|
||||
<result column="rounding_mode" property="roundingMode"/>
|
||||
<result column="pattern" property="pattern"/>
|
||||
<result column="value_type" property="valueType"/>
|
||||
<result column="datasource" property="datasource"/>
|
||||
<result column="formula_id" property="formulaId"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="can_edit" property="canEdit"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="data_type" property="dataType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -35,14 +32,12 @@
|
|||
, t.code
|
||||
, t.system_type
|
||||
, t.sys_salary_item_id
|
||||
, t.category
|
||||
, t.item_type
|
||||
, t.use_default
|
||||
, t.use_in_employee_salary
|
||||
, t.rounding_mode
|
||||
, t.pattern
|
||||
, t.value_type
|
||||
, t.datasource
|
||||
, t.formula_id
|
||||
, t.description
|
||||
, t.can_edit
|
||||
|
|
@ -52,6 +47,7 @@
|
|||
, t.tenant_key
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.data_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -76,15 +72,9 @@
|
|||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_item t
|
||||
WHERE delete_type = 0
|
||||
<if test="canDelete != null and canDelete != ''">
|
||||
AND can_delete = #{canDelete}
|
||||
</if>
|
||||
<if test="canEdit != null and canEdit != ''">
|
||||
AND can_edit = #{canEdit}
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
AND category = #{category}
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
AND code = #{code}
|
||||
</if>
|
||||
|
|
@ -94,9 +84,6 @@
|
|||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="datasource != null and datasource != ''">
|
||||
AND datasource = #{datasource}
|
||||
</if>
|
||||
<if test="deleteType != null and deleteType != ''">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
|
|
@ -106,9 +93,6 @@
|
|||
<if test="formulaId != null and formulaId != ''">
|
||||
AND formula_id = #{formulaId}
|
||||
</if>
|
||||
<if test="itemType != null and itemType != ''">
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
|
|
@ -170,12 +154,6 @@
|
|||
<if test="sysSalaryItemId != null">
|
||||
sys_salary_item_id,
|
||||
</if>
|
||||
<if test="category != null">
|
||||
category,
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
item_type,
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
use_default,
|
||||
</if>
|
||||
|
|
@ -191,9 +169,6 @@
|
|||
<if test="valueType != null">
|
||||
value_type,
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
datasource,
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
formula_id,
|
||||
</if>
|
||||
|
|
@ -203,9 +178,6 @@
|
|||
<if test="canEdit != null">
|
||||
can_edit,
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
|
|
@ -238,12 +210,6 @@
|
|||
<if test="sysSalaryItemId != null">
|
||||
#{sysSalaryItemId},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
#{category},
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
#{itemType},
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
#{useDefault},
|
||||
</if>
|
||||
|
|
@ -259,9 +225,6 @@
|
|||
<if test="valueType != null">
|
||||
#{valueType},
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
#{datasource},
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
#{formulaId},
|
||||
</if>
|
||||
|
|
@ -271,9 +234,6 @@
|
|||
<if test="canEdit != null">
|
||||
#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
#{canDelete},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
|
|
@ -292,35 +252,6 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryitem.po.SalaryItemPO">
|
||||
UPDATE hrsa_salary_item
|
||||
<set>
|
||||
name=#{name},
|
||||
code=#{code},
|
||||
system_type=#{systemType},
|
||||
sys_salary_item_id=#{sysSalaryItemId},
|
||||
category=#{category},
|
||||
item_type=#{itemType},
|
||||
use_default=#{useDefault},
|
||||
use_in_employee_salary=#{useInEmployeeSalary},
|
||||
rounding_mode=#{roundingMode},
|
||||
pattern=#{pattern},
|
||||
value_type=#{valueType},
|
||||
datasource=#{datasource},
|
||||
formula_id=#{formulaId},
|
||||
description=#{description},
|
||||
can_edit=#{canEdit},
|
||||
can_delete=#{canDelete},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryitem.po.SalaryItemPO">
|
||||
|
|
@ -338,12 +269,6 @@
|
|||
<if test="sysSalaryItemId != null">
|
||||
sys_salary_item_id=#{sysSalaryItemId},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
category=#{category},
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
item_type=#{itemType},
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
use_default=#{useDefault},
|
||||
</if>
|
||||
|
|
@ -359,9 +284,6 @@
|
|||
<if test="valueType != null">
|
||||
value_type=#{valueType},
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
datasource=#{datasource},
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
formula_id=#{formulaId},
|
||||
</if>
|
||||
|
|
@ -371,9 +293,6 @@
|
|||
<if test="canEdit != null">
|
||||
can_edit=#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete=#{canDelete},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
|
|
@ -389,6 +308,9 @@
|
|||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="dataType != null">
|
||||
data_type=#{dataType},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -405,47 +327,44 @@
|
|||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_salary_item
|
||||
( name, code, system_type, sys_salary_item_id, category, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, datasource, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key)
|
||||
( name, code, system_type, sys_salary_item_id, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key,data_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.category},
|
||||
#{item.itemType}, #{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.datasource}, #{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey})
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey},#{dataType})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_salary_item
|
||||
(name, code, system_type, sys_salary_item_id, category, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, datasource, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key)
|
||||
(name, code, system_type, sys_salary_item_id, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key,data_type)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select #{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.category},
|
||||
#{item.itemType}, #{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.datasource}, #{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey} from dual
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey,#{dataType}} from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
INSERT INTO hrsa_salary_item
|
||||
(name, code, system_type, sys_salary_item_id, category, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, datasource, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key)
|
||||
(name, code, system_type, sys_salary_item_id, item_type, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key, data_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.category},
|
||||
#{item.itemType}, #{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.datasource}, #{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey})
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey}, #{dataType})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
|
@ -482,12 +401,6 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND category = #{param.category}
|
||||
</if>
|
||||
<if test="param.itemType != null">
|
||||
AND item_type = #{param.itemType}
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
|
|
@ -511,12 +424,6 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND category = #{param.category}
|
||||
</if>
|
||||
<if test="param.itemType != null">
|
||||
AND item_type = #{param.itemType}
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
|
|
@ -540,12 +447,6 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.category != null">
|
||||
AND category = #{param.category}
|
||||
</if>
|
||||
<if test="param.itemType != null">
|
||||
AND item_type = #{param.itemType}
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -6,23 +6,20 @@
|
|||
<result column="name" property="name"/>
|
||||
<result column="code" property="code"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="category" property="category"/>
|
||||
<result column="item_type" property="itemType"/>
|
||||
<result column="use_default" property="useDefault"/>
|
||||
<result column="use_in_employee_salary" property="useInEmployeeSalary"/>
|
||||
<result column="rounding_mode" property="roundingMode"/>
|
||||
<result column="pattern" property="pattern"/>
|
||||
<result column="value_type" property="valueType"/>
|
||||
<result column="datasource" property="datasource"/>
|
||||
<result column="formula_id" property="formulaId"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="can_edit" property="canEdit"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="data_type" property="dataType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -33,23 +30,21 @@
|
|||
, t.name
|
||||
, t.code
|
||||
, t.system_type
|
||||
, t.category
|
||||
, t.item_type
|
||||
, t.use_default
|
||||
, t.use_in_employee_salary
|
||||
, t.rounding_mode
|
||||
, t.pattern
|
||||
, t.value_type
|
||||
, t.datasource
|
||||
, t.formula_id
|
||||
, t.description
|
||||
, t.can_edit
|
||||
, t.can_delete
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.data_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -86,12 +81,6 @@
|
|||
<if test="systemType != null and systemType != ''">
|
||||
AND system_type = #{systemType}
|
||||
</if>
|
||||
<if test="category != null and category != ''">
|
||||
AND category = #{category}
|
||||
</if>
|
||||
<if test="itemType != null and itemType != ''">
|
||||
AND item_type = #{itemType}
|
||||
</if>
|
||||
<if test="useDefault != null and useDefault != ''">
|
||||
AND use_default = #{useDefault}
|
||||
</if>
|
||||
|
|
@ -107,9 +96,6 @@
|
|||
<if test="valueType != null and valueType != ''">
|
||||
AND value_type = #{valueType}
|
||||
</if>
|
||||
<if test="datasource != null and datasource != ''">
|
||||
AND datasource = #{datasource}
|
||||
</if>
|
||||
<if test="formulaId != null and formulaId != ''">
|
||||
AND formula_id = #{formulaId}
|
||||
</if>
|
||||
|
|
@ -119,8 +105,8 @@
|
|||
<if test="canEdit != null and canEdit != ''">
|
||||
AND can_edit = #{canEdit}
|
||||
</if>
|
||||
<if test="canDelete != null and canDelete != ''">
|
||||
AND can_delete = #{canDelete}
|
||||
<if test="dataType != null and dataType != ''">
|
||||
AND data_type = #{dataType}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
|
|
@ -166,12 +152,6 @@
|
|||
<if test="systemType != null">
|
||||
system_type,
|
||||
</if>
|
||||
<if test="category != null">
|
||||
category,
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
item_type,
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
use_default,
|
||||
</if>
|
||||
|
|
@ -187,9 +167,6 @@
|
|||
<if test="valueType != null">
|
||||
value_type,
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
datasource,
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
formula_id,
|
||||
</if>
|
||||
|
|
@ -199,8 +176,8 @@
|
|||
<if test="canEdit != null">
|
||||
can_edit,
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete,
|
||||
<if test="dataType != null">
|
||||
data_type,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
|
|
@ -231,12 +208,6 @@
|
|||
<if test="systemType != null">
|
||||
#{systemType},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
#{category},
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
#{itemType},
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
#{useDefault},
|
||||
</if>
|
||||
|
|
@ -252,9 +223,6 @@
|
|||
<if test="valueType != null">
|
||||
#{valueType},
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
#{datasource},
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
#{formulaId},
|
||||
</if>
|
||||
|
|
@ -264,8 +232,8 @@
|
|||
<if test="canEdit != null">
|
||||
#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
#{canDelete},
|
||||
<if test="dataType != null">
|
||||
#{dataType},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
|
|
@ -292,18 +260,15 @@
|
|||
name=#{name},
|
||||
code=#{code},
|
||||
system_type=#{systemType},
|
||||
category=#{category},
|
||||
item_type=#{itemType},
|
||||
use_default=#{useDefault},
|
||||
use_in_employee_salary=#{useInEmployeeSalary},
|
||||
rounding_mode=#{roundingMode},
|
||||
pattern=#{pattern},
|
||||
value_type=#{valueType},
|
||||
datasource=#{datasource},
|
||||
formula_id=#{formulaId},
|
||||
description=#{description},
|
||||
can_edit=#{canEdit},
|
||||
can_delete=#{canDelete},
|
||||
data_type=#{dataType},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
|
|
@ -327,12 +292,6 @@
|
|||
<if test="systemType != null">
|
||||
system_type=#{systemType},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
category=#{category},
|
||||
</if>
|
||||
<if test="itemType != null">
|
||||
item_type=#{itemType},
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
use_default=#{useDefault},
|
||||
</if>
|
||||
|
|
@ -348,9 +307,6 @@
|
|||
<if test="valueType != null">
|
||||
value_type=#{valueType},
|
||||
</if>
|
||||
<if test="datasource != null">
|
||||
datasource=#{datasource},
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
formula_id=#{formulaId},
|
||||
</if>
|
||||
|
|
@ -360,8 +316,8 @@
|
|||
<if test="canEdit != null">
|
||||
can_edit=#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete=#{canDelete},
|
||||
<if test="dataType != null">
|
||||
data_type=#{dataType},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SalarySobDefaultEmpFieldMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultEmpFieldPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultEmpFieldPO> listSome(SalarySobDefaultEmpFieldPO sobDefaultEmpField);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobDefaultEmpFieldPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param sobDefaultEmpField 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobDefaultEmpFieldPO sobDefaultEmpField);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param sobDefaultEmpField 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobDefaultEmpFieldPO sobDefaultEmpField);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param sobDefaultEmpField 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobDefaultEmpFieldPO sobDefaultEmpField);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param sobDefaultEmpField 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobDefaultEmpFieldPO sobDefaultEmpField);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<?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.salarysob.SalarySobDefaultEmpFieldMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="field_code" property="fieldCode"/>
|
||||
<result column="sorted_index" property="sortedIndex"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<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.field_code
|
||||
, t.sorted_index
|
||||
, t.can_delete
|
||||
, 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_sob_default_emp_field t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_default_emp_field t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_default_emp_field t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="fieldCode != null and fieldCode != ''">
|
||||
AND field_code = #{fieldCode}
|
||||
</if>
|
||||
<if test="sortedIndex != null and sortedIndex != ''">
|
||||
AND sorted_index = #{sortedIndex}
|
||||
</if>
|
||||
<if test="canDelete != null and canDelete != ''">
|
||||
AND can_delete = #{canDelete}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null and updateTime != ''">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleteType != null and deleteType != ''">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">
|
||||
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>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultEmpFieldPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_sob_default_emp_field
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="fieldCode != null">
|
||||
field_code,
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index,
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete,
|
||||
</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="fieldCode != null">
|
||||
#{fieldCode},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
#{sortedIndex},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
#{canDelete},
|
||||
</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.salarysob.po.SalarySobDefaultEmpFieldPO">
|
||||
UPDATE hrsa_sob_default_emp_field
|
||||
<set>
|
||||
field_code=#{fieldCode},
|
||||
sorted_index=#{sortedIndex},
|
||||
can_delete=#{canDelete},
|
||||
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.salarysob.po.SalarySobDefaultEmpFieldPO">
|
||||
UPDATE hrsa_sob_default_emp_field
|
||||
<set>
|
||||
<if test="fieldCode != null">
|
||||
field_code=#{fieldCode},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index=#{sortedIndex},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete=#{canDelete},
|
||||
</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.salarysob.po.SalarySobDefaultEmpFieldPO">
|
||||
UPDATE hrsa_sob_default_emp_field
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SalarySobDefaultItemGroupMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultItemGroupPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultItemGroupPO> listSome(SalarySobDefaultItemGroupPO sobDefaultItemGroup);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobDefaultItemGroupPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param sobDefaultItemGroup 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobDefaultItemGroupPO sobDefaultItemGroup);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param sobDefaultItemGroup 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobDefaultItemGroupPO sobDefaultItemGroup);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param sobDefaultItemGroup 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobDefaultItemGroupPO sobDefaultItemGroup);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param sobDefaultItemGroup 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobDefaultItemGroupPO sobDefaultItemGroup);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
<?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.salarysob.SalarySobDefaultItemGroupMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="income_category" property="incomeCategory"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="sorted_index" property="sortedIndex"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.income_category
|
||||
, t.name
|
||||
, t.sorted_index
|
||||
, t.description
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_default_item_group t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_default_item_group t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_sob_default_item_group t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
AND income_category = #{incomeCategory}
|
||||
</if>
|
||||
<if test="name != null">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
AND sorted_index = #{sortedIndex}
|
||||
</if>
|
||||
<if test="description != null">
|
||||
AND description = #{description}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</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>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_sob_default_item_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
income_category,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</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="incomeCategory != null">
|
||||
#{incomeCategory},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
#{sortedIndex},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO">
|
||||
UPDATE hrsa_sob_default_item_group
|
||||
<set>
|
||||
income_category=#{incomeCategory},
|
||||
name=#{name},
|
||||
sorted_index=#{sortedIndex},
|
||||
description=#{description},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
tenant_key=#{tenantKey},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemGroupPO">
|
||||
UPDATE hrsa_sob_default_item_group
|
||||
<set>
|
||||
<if test="incomeCategory != null">
|
||||
income_category=#{incomeCategory},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="sortedIndex != null">
|
||||
sorted_index=#{sortedIndex},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</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.salarysob.po.SalarySobDefaultItemGroupPO">
|
||||
UPDATE hrsa_sob_default_item_group
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.engine.salary.mapper.salarysob;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SalarySobDefaultItemMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultItemPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalarySobDefaultItemPO> listSome(SalarySobDefaultItemPO salarySobDefaultItem);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalarySobDefaultItemPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param salarySobDefaultItem 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalarySobDefaultItemPO salarySobDefaultItem);
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param salarySobDefaultItem 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalarySobDefaultItemPO salarySobDefaultItem);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param salarySobDefaultItem 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalarySobDefaultItemPO salarySobDefaultItem);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param salarySobDefaultItem 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalarySobDefaultItemPO salarySobDefaultItem);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
<?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.salarysob.SalarySobDefaultItemMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="income_category" property="incomeCategory"/>
|
||||
<result column="sys_salary_item_id" property="sysSalaryItemId"/>
|
||||
<result column="can_edit" property="canEdit"/>
|
||||
<result column="can_delete" property="canDelete"/>
|
||||
<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.income_category
|
||||
, t.sys_salary_item_id
|
||||
, t.can_edit
|
||||
, t.can_delete
|
||||
, 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_sob_default_item t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sob_default_item t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sob_default_item t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="incomeCategory != null and incomeCategory != ''">
|
||||
AND income_category = #{incomeCategory}
|
||||
</if>
|
||||
<if test="sysSalaryItemId != null and sysSalaryItemId != ''">
|
||||
AND sys_salary_item_id = #{sysSalaryItemId}
|
||||
</if>
|
||||
<if test="canEdit != null and canEdit != ''">
|
||||
AND can_edit = #{canEdit}
|
||||
</if>
|
||||
<if test="canDelete != null and canDelete != ''">
|
||||
AND can_delete = #{canDelete}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null and updateTime != ''">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleteType != null and deleteType != ''">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="tenantKey != null and tenantKey != ''">
|
||||
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>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_salary_sob_default_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="incomeCategory != null">
|
||||
income_category,
|
||||
</if>
|
||||
<if test="sysSalaryItemId != null">
|
||||
sys_salary_item_id,
|
||||
</if>
|
||||
<if test="canEdit != null">
|
||||
can_edit,
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete,
|
||||
</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="incomeCategory != null">
|
||||
#{incomeCategory},
|
||||
</if>
|
||||
<if test="sysSalaryItemId != null">
|
||||
#{sysSalaryItemId},
|
||||
</if>
|
||||
<if test="canEdit != null">
|
||||
#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
#{canDelete},
|
||||
</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.salarysob.po.SalarySobDefaultItemPO">
|
||||
UPDATE hrsa_salary_sob_default_item
|
||||
<set>
|
||||
income_category=#{incomeCategory},
|
||||
sys_salary_item_id=#{sysSalaryItemId},
|
||||
can_edit=#{canEdit},
|
||||
can_delete=#{canDelete},
|
||||
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.salarysob.po.SalarySobDefaultItemPO">
|
||||
UPDATE hrsa_salary_sob_default_item
|
||||
<set>
|
||||
<if test="incomeCategory != null">
|
||||
income_category=#{incomeCategory},
|
||||
</if>
|
||||
<if test="sysSalaryItemId != null">
|
||||
sys_salary_item_id=#{sysSalaryItemId},
|
||||
</if>
|
||||
<if test="canEdit != null">
|
||||
can_edit=#{canEdit},
|
||||
</if>
|
||||
<if test="canDelete != null">
|
||||
can_delete=#{canDelete},
|
||||
</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.salarysob.po.SalarySobDefaultItemPO">
|
||||
UPDATE hrsa_salary_sob_default_item
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
/**
|
||||
* @description: 薪资账套默认的员工信息字段
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/13/22 9:52 AM
|
||||
* @version:v1.0
|
||||
*/
|
||||
public interface SalarySobDefaultEmpFieldService {
|
||||
|
||||
/**
|
||||
* 获取所有的薪资账套默认的员工信息字段
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// List<SalarySobDefaultEmpFieldPO> list();
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资账套默认的薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public interface SalarySobDefaultItemService {
|
||||
|
||||
/**
|
||||
* 根据薪资类型查询默认的薪资项目
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<SalarySobDefaultItemPO> listByIncomeCategory(IncomeCategoryEnum incomeCategory);
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ import com.engine.salary.entity.salaryitem.param.SalaryItemSaveParam;
|
|||
import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO;
|
||||
import com.engine.salary.enums.SalaryDataSourceEnum;
|
||||
import com.engine.salary.enums.SalarySystemTypeEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -112,7 +111,7 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98328, "自定义薪资项目的名称不能和系统薪资项目的名称重名"));
|
||||
}
|
||||
// 保存薪资项目
|
||||
SalaryItemPO salaryItemPO = SalaryItemBO.convert2SalaryItemPO(saveParam, Long.valueOf(user.getUID()));
|
||||
SalaryItemPO salaryItemPO = SalaryItemBO.convert2SalaryItemPO(saveParam, (long) user.getUID());
|
||||
salaryItemBiz.insert(salaryItemPO);
|
||||
// todo 记录日志
|
||||
// LoggerContext<SalaryItemPO> loggerContext = new LoggerContext<>();
|
||||
|
|
@ -152,11 +151,6 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
// 更新薪资项目
|
||||
SalaryItemPO newSalaryItemPO = new SalaryItemPO();
|
||||
BeanUtils.copyProperties(salaryItemPO, newSalaryItemPO);
|
||||
// 系统薪资项目的"属性"和"类型"不允许编辑
|
||||
if (Objects.equals(newSalaryItemPO.getSystemType(), SalarySystemTypeEnum.CUSTOM.getValue())) {
|
||||
newSalaryItemPO.setCategory(saveParam.getCategory());
|
||||
newSalaryItemPO.setItemType(saveParam.getItemType());
|
||||
}
|
||||
newSalaryItemPO.setName(saveParam.getName());
|
||||
newSalaryItemPO.setUseDefault(saveParam.getUseDefault());
|
||||
newSalaryItemPO.setUseInEmployeeSalary(saveParam.getUseInEmployeeSalary());
|
||||
|
|
@ -164,12 +158,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
newSalaryItemPO.setPattern(saveParam.getPattern());
|
||||
newSalaryItemPO.setValueType(saveParam.getValueType());
|
||||
newSalaryItemPO.setFormulaId(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.INPUT.getValue()) ? 0L : saveParam.getFormulaId());
|
||||
newSalaryItemPO.setDatasource(Objects.equals(saveParam.getValueType(), SalaryValueTypeEnum.INPUT.getValue()) ? SalaryDataSourceEnum.INPUT_IMPORT.getValue()
|
||||
: SalaryDataSourceEnum.CUSTOM_FORMULA.getValue());
|
||||
newSalaryItemPO.setDescription(saveParam.getDescription());
|
||||
newSalaryItemPO.setUpdateTime(new Date());
|
||||
salaryItemBiz.updateById(newSalaryItemPO);
|
||||
//todo 记录日志
|
||||
// 记录日志
|
||||
// LoggerContext<SalaryItemPO> loggerContext = new LoggerContext<>();
|
||||
// loggerContext.setTargetId(String.valueOf(newSalaryItemPO.getId()));
|
||||
// loggerContext.setTargetName(newSalaryItemPO.getName());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.salary.service.SalarySobDefaultEmpFieldService;
|
||||
|
||||
/**
|
||||
* 薪资账套默认的员工信息字段
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalarySobDefaultEmpFieldServiceImpl implements SalarySobDefaultEmpFieldService {
|
||||
|
||||
// @Autowired
|
||||
// private SalarySobDefaultEmpFieldMapper salarySobDefaultEmpFieldMapper;
|
||||
//
|
||||
// @Override
|
||||
// public List<SalarySobDefaultEmpFieldPO> list() {
|
||||
//
|
||||
// return new LambdaQueryChainWrapper<>(salarySobDefaultEmpFieldMapper)
|
||||
// .eq(SalarySobDefaultEmpFieldPO::getTenantKey, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .eq(SalarySobDefaultEmpFieldPO::getDeleteType, 0)
|
||||
// .list();
|
||||
// }
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobDefaultItemBiz;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobDefaultItemPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.service.SalarySobDefaultItemService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 薪资账套默认的薪资项目
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class SalarySobDefaultItemServiceImpl extends Service implements SalarySobDefaultItemService {
|
||||
|
||||
private SalarySobDefaultItemBiz salarySobDefaultItemMapper = new SalarySobDefaultItemBiz();
|
||||
|
||||
@Override
|
||||
public List<SalarySobDefaultItemPO> listByIncomeCategory(IncomeCategoryEnum incomeCategory) {
|
||||
|
||||
return salarySobDefaultItemMapper.listByIncomeCategory(SalarySobDefaultItemPO.builder().incomeCategory(incomeCategory.getValue()).build());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -122,19 +122,19 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98379, "参数错误,薪资账套不存在或者已被删除"));
|
||||
}
|
||||
//todo
|
||||
// // 删除薪资账套的员工信息字段
|
||||
// salarySobEmpFieldService.deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// // 删除薪资账套的薪资项目副本
|
||||
// deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// // 删除薪资账套的薪资项目分类
|
||||
// getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// 删除薪资账套的员工信息字段
|
||||
getSalarySobEmpFieldService(user).deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// 删除薪资账套的薪资项目副本
|
||||
deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
// 删除薪资账套的薪资项目分类
|
||||
getSalarySobItemGroupService(user).deleteBySalarySobIds(Collections.singleton(saveParam.getSalarySobId()));
|
||||
|
||||
// 处理保存参数
|
||||
SalarySobItemSaveBO.Result result = SalarySobItemSaveBO.handle(saveParam,(long)user.getUID());
|
||||
// 保存薪资账套的员工信息字段
|
||||
// if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobEmpFields())) {
|
||||
// salarySobEmpFieldService.batchSave(result.getNeedInsertSalarySobEmpFields());
|
||||
// }
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobEmpFields())) {
|
||||
getSalarySobEmpFieldService(user).batchSave(result.getNeedInsertSalarySobEmpFields());
|
||||
}
|
||||
// 保存薪资账套的薪资项目副本
|
||||
if (CollectionUtils.isNotEmpty(result.getNeedInsertSalarySobItems())) {
|
||||
batchSave(result.getNeedInsertSalarySobItems());
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ import com.engine.salary.entity.salarysob.param.SalarySobDuplicateParam;
|
|||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.SalarySobDefaultItemService;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.SysSalaryItemService;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.valid.RuntimeTypeEnum;
|
||||
|
|
@ -43,13 +46,16 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
|
||||
// private SalarySobEmpFieldService salarySobEmpFieldService;
|
||||
//
|
||||
// private SalarySobDefaultItemService salarySobDefaultItemService;
|
||||
private SalarySobDefaultItemService salarySobDefaultItemService;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// private SalarySobItemService salarySobItemService;
|
||||
//
|
||||
// private SalaryItemService salaryItemService;
|
||||
private SalaryItemService salaryItemService;
|
||||
//
|
||||
// private SysSalaryItemService sysSalaryItemService;
|
||||
private SysSalaryItemService sysSalaryItemService;
|
||||
//
|
||||
// private SalarySobItemGroupService salarySobItemGroupService;
|
||||
//
|
||||
|
|
@ -154,7 +160,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// // 查询薪资账套默认的员工信息字段
|
||||
// List<SalarySobDefaultEmpFieldPO> salarySobDefaultEmpFieldPOS = salarySobDefaultEmpFieldService.list();
|
||||
// // 转换成薪资账套员工信息字段po
|
||||
// List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = SalarySobItemBO.convert2EmpFieldPO(salarySobPO.getId(), salarySobDefaultEmpFieldPOS);
|
||||
// List<SalarySobEmpFieldPO> salarySobEmpFieldPOS = SalarySobItemBO.convert2EmpFieldPO(salarySobPO.getId(), salarySobDefaultEmpFieldPOS, employeeId, tenantKey);
|
||||
// // 保存
|
||||
// salarySobEmpFieldService.batchSave(salarySobEmpFieldPOS);
|
||||
}
|
||||
|
|
@ -182,13 +188,13 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// .collect(Collectors.toSet());
|
||||
// List<SysSalaryItemPO> needAddSysSalaryItemPOS = sysSalaryItemService.listByIds(needAddSysSalaryItemIds);
|
||||
// // 2.3、需要保存的薪资项目
|
||||
// List<SalaryItemPO> needInsertSalaryItemPOS = SysSalaryItemBO.convert2SalaryItemPO(needAddSysSalaryItemPOS, employeeId, tenantKey);
|
||||
// List<SalaryItemPO> needInsertSalaryItemPOS = SysSalaryItemBO.convert2SalaryItemPO(needAddSysSalaryItemPOS, (long)user.getUID());
|
||||
// if (CollectionUtils.isNotEmpty(needInsertSalaryItemPOS)) {
|
||||
// salaryItemService.batchSave(needInsertSalaryItemPOS);
|
||||
// }
|
||||
//
|
||||
// // 3、查询开启了"默认使用"的自定义薪资项目
|
||||
// List<SalaryItemPO> useDefaultSalaryItemPOS = salaryItemService.listBySystemTypeAndUseDefault(SalarySystemTypeEnum.CUSTOM, NumberUtils.INTEGER_ONE, tenantKey);
|
||||
// List<SalaryItemPO> useDefaultSalaryItemPOS = salaryItemService.listBySystemTypeAndUseDefault(SalarySystemTypeEnum.CUSTOM, NumberUtils.INTEGER_ONE);
|
||||
//
|
||||
// // 4、默认引用的薪资项目(=薪资账套默认引用的系统薪资项目(已添加进薪资项目中的) + 薪资账套默认引用的系统薪资项目(待添加进薪资项目中的) + 自定义薪资项目中开启了"默认使用"的薪资项目)
|
||||
// List<SalaryItemPO> defaultSalaryItemPOS = Lists.newArrayListWithExpectedSize(salaryItemPOS.size() + needInsertSalaryItemPOS.size() + useDefaultSalaryItemPOS.size());
|
||||
|
|
@ -197,7 +203,7 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
// defaultSalaryItemPOS.addAll(useDefaultSalaryItemPOS);
|
||||
//
|
||||
// // 5、保存
|
||||
// List<SalarySobItemPO> salarySobItemPOS = SalarySobItemBO.convert2ItemPO(salarySobPO.getId(), defaultSalaryItemPOS, employeeId, tenantKey);
|
||||
// List<SalarySobItemPO> salarySobItemPOS = SalarySobItemBO.convert2ItemPO(salarySobPO.getId(), defaultSalaryItemPOS, employeeId);
|
||||
// if (CollectionUtils.isNotEmpty(salarySobItemPOS)) {
|
||||
// salarySobItemService.batchSave(salarySobItemPOS);
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package com.engine.salary.transmethod;
|
||||
|
||||
import com.engine.salary.enums.SalaryDataSourceEnum;
|
||||
import com.engine.salary.enums.SalaryValueTypeEnum;
|
||||
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 java.text.ParseException;
|
||||
|
|
@ -94,8 +94,8 @@ public class TransMethod {
|
|||
* @param valueType
|
||||
* @return
|
||||
*/
|
||||
public static String valueType(String valueType) {
|
||||
return SalaryValueTypeEnum.getDefaultLabelByValue(Integer.valueOf(valueType));
|
||||
public static String dataType(String valueType) {
|
||||
return SalaryDataTypeEnum.getDefaultLabelByValue(Integer.valueOf(valueType));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ public class SalarySobController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobBasicForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobBasicSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Long salarySobId;
|
||||
if (saveParam.getId() == null || saveParam.getId() <= 0) {
|
||||
return new ResponseResult<SalarySobBasicSaveParam, Map<String, Object>>().run(getSalarySobWrapper(user)::save, saveParam);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -72,17 +72,15 @@ public class SalaryItemWrapper extends Service {
|
|||
" , t.code" +
|
||||
" , t.system_type" +
|
||||
" , t.sys_salary_item_id" +
|
||||
" , t.category" +
|
||||
" , t.item_type as itemType" +
|
||||
" , t.use_default as useDefault" +
|
||||
" , t.use_in_employee_salary as useInEmployeeSalary" +
|
||||
" , t.rounding_mode as roundingMode" +
|
||||
" , t.pattern" +
|
||||
" , t.value_type as valueType" +
|
||||
" , t.datasource" +
|
||||
" , t.formula_id" +
|
||||
" , t.description" +
|
||||
" , t.can_edit" +
|
||||
" , t.data_type as dataType" +
|
||||
" , t.can_delete";
|
||||
|
||||
String from = "from hrsa_salary_item t";
|
||||
|
|
|
|||
Loading…
Reference in New Issue