修复无分类

This commit is contained in:
Harryxzy 2023-06-20 17:27:18 +08:00
parent d60d24ea2e
commit e7edb9040c
5 changed files with 44 additions and 4 deletions

View File

@ -133,4 +133,5 @@ public interface SalaryAcctResultMapper {
*/
void batchUpdateOriginResultValue(@Param("collection") List<SalaryAcctResultPO> subSalaryAcctResultValues);
List<Long> getAcctEmpIsExist(@Param("empIds")List<Long> empIds);
}

View File

@ -436,6 +436,17 @@
</foreach>
)
</select>
<select id="getAcctEmpIsExist" resultType="java.lang.Long">
select distinct salary_acct_emp_id
from hrsa_salary_acct_result
where 1=1
<if test="empIds != null and empIds.size()>0">
AND salary_acct_emp_id IN
<foreach collection="empIds" open="(" item="salaryAcctEmpId" separator="," close=")">
#{salaryAcctEmpId}
</foreach>
</if>
</select>
<insert id="batchInsert">
INSERT INTO hrsa_salary_acct_result( salary_sob_id, salary_acct_emp_id, salary_acct_record_id, employee_id,

View File

@ -406,11 +406,16 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
List<Long> salaryAcctEmployeeIds = salaryAcctEmployeeList.stream().map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
if( NumberUtils.isCreatable(dimension.getDimCode()) ){
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listByAcctEmployeeIdsAndSalaryItemIds(salaryAcctEmployeeIds,Collections.singleton(Long.valueOf(dimension.getDimCode())));
List<Long> finalSalaryAcctEmpIds = getSalaryAcctResultService(user).listAcctEmpIdByAcctEmpId(salaryAcctEmployeeIds);
Map<Long, List<SalaryAcctResultPO>> salaryAcctEmpResultMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId);
salaryAcctEmpResultMap.forEach((k, v) -> {
Map<String, String> collect = v.stream().collect(Collectors.toMap(p -> Util.null2String(p.getSalaryItemId()), p -> Util.null2o(p.getResultValue()), (key1, key2) -> key2));
resultMap.put(k, collect);
});
salaryAcctEmployeeIds.stream().forEach(id -> {
if(!resultMap.containsKey(id) && finalSalaryAcctEmpIds.contains(id))
resultMap.put(id,Collections.emptyMap());
});
}

View File

@ -198,4 +198,6 @@ public interface SalaryAcctResultService {
* @date 2022/12/26 22:24
*/
List<SalaryAcctResultPO> listByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmpIds, Collection<Long> salaryItemIds);
List<Long> listAcctEmpIdByAcctEmpId(List<Long> salaryAcctEmployeeIds);
}

View File

@ -962,11 +962,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public List<SalaryAcctResultPO> listByAcctEmployeeIdsAndSalaryItemIds(Collection<Long> salaryAcctEmployeeIds, Collection<Long> salaryItemIds) {
SalaryAcctResultPO build = SalaryAcctResultPO.builder().salaryAcctEmpIds(salaryAcctEmployeeIds).salaryItemIds(salaryItemIds).build();
List<SalaryAcctResultPO> list = getSalaryAcctResultMapper().listSome(build);
if(CollectionUtils.isEmpty(salaryAcctEmployeeIds)){
return Collections.emptyList();
}
List<List<Long>> partition = Lists.partition((List<Long>)salaryAcctEmployeeIds, 200);
List<SalaryAcctResultPO> result = new ArrayList<>();
partition.forEach(empIds -> {
SalaryAcctResultPO build = SalaryAcctResultPO.builder().salaryAcctEmpIds(empIds).salaryItemIds(salaryItemIds).build();
result.addAll(getSalaryAcctResultMapper().listSome(build));
});
// 数据解密
encryptUtil.decryptList(list, SalaryAcctResultPO.class);
return list;
encryptUtil.decryptList(result, SalaryAcctResultPO.class);
return result;
}
@Override
@ -978,6 +986,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
}
}
@Override
public List<Long> listAcctEmpIdByAcctEmpId(List<Long> salaryAcctEmployeeIds) {
if(CollectionUtils.isEmpty(salaryAcctEmployeeIds)){
return Collections.emptyList();
}
List<List<Long>> partition = Lists.partition((List<Long>)salaryAcctEmployeeIds, 1000);
List<Long> result = new ArrayList<>();
partition.forEach(empIds -> {
result.addAll(getSalaryAcctResultMapper().getAcctEmpIsExist(empIds));
});
return result;
}
private Set<Long> canLockSalaryItemIds(Long salarySobId) {
// 值可以锁定的薪资项目
Set<Long> salaryItemIds = Sets.newHashSet();