修复新建工资单模板时没有模板id,导致添加薪资项目时取到了其他模板的重命名的信息。

This commit is contained in:
Harryxzy 2024-01-26 14:56:58 +08:00
parent 2aa4ed05d8
commit 5e9956fbbf
1 changed files with 8 additions and 4 deletions

View File

@ -363,10 +363,14 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
public List<SalaryTemplateSalaryItemSetListDTO> getSalaryItemSetContainHide(Long salarySobId, Long salaryTemplateId, boolean isReplenish) {
SalarySobItemAggregateDTO salarySobItemAggregate = getSalarySobItemService(user).getAggregateBySalarySobId(salarySobId);
// 获取工资单薪资项目展示名信息
List<SalaryBillItemNamePO> billItemNameList = getSalaryBillItemNameService(user).ListByTemplateAndType(
SalaryBillItemNamePO.builder().salaryTemplateId(salaryTemplateId)
.salaryBillType(isReplenish ? 1 : 0)
.build());
List<SalaryBillItemNamePO> billItemNameList = Collections.emptyList();
if (salaryTemplateId != null) {
billItemNameList = getSalaryBillItemNameService(user).ListByTemplateAndType(
SalaryBillItemNamePO.builder().salaryTemplateId(salaryTemplateId)
.salaryBillType(isReplenish ? 1 : 0)
.build());
}
Map<Long, String> itemShowNameMap = SalaryEntityUtil.convert2Map(billItemNameList, SalaryBillItemNamePO::getSalaryItemId, SalaryBillItemNamePO::getSalaryItemShowName);
List<SalaryTemplateSalaryItemSetListDTO> salaryTemplateSalaryItemSetListDTOS = SalaryTemplateBO.convertSalarySobItemAggregateToSalaryItemSet(salarySobItemAggregate, new Long(user.getUID()), isReplenish);