薪酬系统-多语言,薪资项目默认系统分组适配多语言逻辑
This commit is contained in:
parent
735f3870fa
commit
b27a378baa
|
|
@ -409,12 +409,16 @@ public class SalaryAcctResultBO {
|
|||
for(SalarySobItemGroupPO groupPO : salarySobItemGroupPOS){
|
||||
List<SalarySobItemPO> groupItems = salarySobItemPOMap.getOrDefault(groupPO.getId(),Collections.emptyList());
|
||||
if(CollectionUtils.isNotEmpty(groupItems)){
|
||||
//获取name(多语言)
|
||||
String name = "";
|
||||
name = groupPO.getLabelId() != null ? SalaryI18nUtil.getI18nLabel(user.getLanguage(),groupPO.getLabelId(),groupPO.getName()) : groupPO.getName();
|
||||
|
||||
List<SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemDTO> items = groupItems.stream()
|
||||
.map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user))
|
||||
.collect(Collectors.toList());
|
||||
itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder()
|
||||
.salarySobItemGroupId(groupPO.getId())
|
||||
.salarySobItemGroupName(groupPO.getName())
|
||||
.salarySobItemGroupName(name)
|
||||
.salaryItems(items)
|
||||
.sortedIndex(groupPO.getSortedIndex()).build() );
|
||||
}
|
||||
|
|
@ -427,7 +431,7 @@ public class SalaryAcctResultBO {
|
|||
.collect(Collectors.toList());
|
||||
itemsByGroup.add(SalaryAcctResultDetailDTO.SalaryAcctResultDetailItemByGroupDTO.builder()
|
||||
.salarySobItemGroupId(0L)
|
||||
.salarySobItemGroupName("未分类")
|
||||
.salarySobItemGroupName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 388970,"未分类"))
|
||||
.salaryItems(items)
|
||||
.sortedIndex(itemsByGroup.size()).build());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.sf.cglib.asm.$AnnotationVisitor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
|
|
@ -89,13 +90,18 @@ public class SalarySobItemAggregateBO {
|
|||
List<SalarySobItemDTO> itemsWithoutGroup = Lists.newArrayList();
|
||||
// 薪资账套的薪资项目分类po转换成dto
|
||||
List<SalarySobItemGroupDTO> salarySobItemGroupDTOS = salarySobItemGroups.stream()
|
||||
.map(e -> SalarySobItemGroupDTO.builder()
|
||||
.id(e.getId())
|
||||
.salarySobId(e.getSalarySobId())
|
||||
.name(e.getName())
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.itemHide(e.getItemHide())
|
||||
.build())
|
||||
.map(e -> {
|
||||
//获取name(多语言)
|
||||
String name = "";
|
||||
name = e.getLabelId() != null ? SalaryI18nUtil.getI18nLabel(user.getLanguage(), e.getLabelId(), e.getName()) : e.getName();
|
||||
return SalarySobItemGroupDTO.builder()
|
||||
.id(e.getId())
|
||||
.salarySobId(e.getSalarySobId())
|
||||
.name(name)
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.itemHide(e.getItemHide())
|
||||
.build();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, SalarySobItemGroupDTO> salarySobItemGroupDTOMap = SalaryEntityUtil.convert2Map(salarySobItemGroupDTOS, SalarySobItemGroupDTO::getId);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public class SalarySobItemBO {
|
|||
salarySobItemGroups.add(SalarySobItemGroupPO.builder()
|
||||
.id(salarySobItemGroupId)
|
||||
.name(salarySobDefaultItemGroupPO.getName())
|
||||
.labelId(salarySobDefaultItemGroupPO.getLabelId())
|
||||
.salarySobId(salarySobId)
|
||||
.sortedIndex(salarySobDefaultItemGroupPO.getSortedIndex())
|
||||
.description(salarySobDefaultItemGroupPO.getDescription())
|
||||
|
|
|
|||
|
|
@ -40,6 +40,11 @@ public class SalarySobDefaultItemGroupPO {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 多语言label_id
|
||||
*/
|
||||
private Integer labelId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ public class SalarySobItemGroupPO {
|
|||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 多语言label_id
|
||||
*/
|
||||
private Integer labelId;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="label_id" property="labelId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.label_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="item_hide" property="itemHide"/>
|
||||
<result column="label_id" property="labelId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
, t.creator
|
||||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.label_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
|
|
@ -111,6 +113,7 @@
|
|||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, h.item_hide
|
||||
, t.label_id
|
||||
from hrsa_salary_sob_item_group t LEFT JOIN hrsa_salary_item_hide h ON t.id=h.salary_item_id
|
||||
where t.delete_type=0
|
||||
<if test="id != null">
|
||||
|
|
|
|||
|
|
@ -439,9 +439,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//获取name(多语言)
|
||||
String groupName = "";
|
||||
groupName = groupPO.getLabelId() != null ? SalaryI18nUtil.getI18nLabel(user.getLanguage(), groupPO.getLabelId(), groupPO.getName()) : groupPO.getName();
|
||||
|
||||
itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder()
|
||||
.salarySobItemGroupId(groupPO.getId())
|
||||
.salarySobItemGroupName(groupPO.getName())
|
||||
.salarySobItemGroupName(groupName)
|
||||
.salaryItems(items)
|
||||
.sortedIndex(groupPO.getSortedIndex()).build() );
|
||||
}
|
||||
|
|
@ -465,7 +469,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder()
|
||||
.salarySobItemGroupId(0L)
|
||||
.salarySobItemGroupName("未分类")
|
||||
.salarySobItemGroupName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 388970,"未分类"))
|
||||
.salaryItems(items)
|
||||
.sortedIndex(itemsByGroup.size()).build());
|
||||
}
|
||||
|
|
@ -544,9 +548,13 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//获取name(多语言)
|
||||
String groupName = "";
|
||||
groupName = groupPO.getLabelId() != null ? SalaryI18nUtil.getI18nLabel(user.getLanguage(), groupPO.getLabelId(), groupPO.getName()) : groupPO.getName();
|
||||
|
||||
itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder()
|
||||
.salarySobItemGroupId(groupPO.getId())
|
||||
.salarySobItemGroupName(groupPO.getName())
|
||||
.salarySobItemGroupName(groupName)
|
||||
.salaryItems(items)
|
||||
.sortedIndex(groupPO.getSortedIndex()).build() );
|
||||
}
|
||||
|
|
@ -570,7 +578,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
itemsByGroup.add(SalaryAcctImportFieldDTO.ImportFieldByGroupDTO.builder()
|
||||
.salarySobItemGroupId(0L)
|
||||
.salarySobItemGroupName("未分类")
|
||||
.salarySobItemGroupName(SalaryI18nUtil.getI18nLabel(user.getLanguage(), 388970,"未分类"))
|
||||
.salaryItems(items)
|
||||
.sortedIndex(itemsByGroup.size()).build());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
List<Long> hideGroupIDs = getSalarySobItemHideService(user).listHideGroupBysalarySobId(SalarySobItemHidePO.builder().salarySobId(salaryAcctEmployeePO.getSalarySobId()).isGroup(1).build());
|
||||
// 过滤关闭显示的薪资项目分类
|
||||
salarySobItemGroupPOS = salarySobItemGroupPOS.stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList());
|
||||
|
||||
// 获取薪资项目分类ID
|
||||
List<Long> salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList());
|
||||
//加上未分类
|
||||
|
|
|
|||
Loading…
Reference in New Issue