联特工资单发生校验修改

This commit is contained in:
Harryxzy 2025-05-16 11:13:46 +08:00
parent ec0905d514
commit a711c2f557
1 changed files with 18 additions and 2 deletions

View File

@ -190,16 +190,32 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
}
// 校验cbs是否已经推送
List<Long> checkIds = new ArrayList<>();
if (CollectionUtils.isEmpty(ids)) {
SalarySendInfoQueryParam queryParam = new SalarySendInfoQueryParam();
queryParam.setSalarySendId(salarySend.getId());
queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()));
List<SalarySendInfoListDTO> list = getSalarySendInfoMapper().list(queryParam);
if (CollectionUtils.isNotEmpty(list)) {
checkIds.addAll(list.stream().map(SalarySendInfoListDTO::getId).collect(Collectors.toList()));
}
} else {
checkIds.addAll(ids);
}
List<Long> salaryCbsIdList = getSalaryCbsService(user).listBySalaryAcctRecordId(salarySend.getSalaryAccountingId()).stream().map(SalaryCbsPO::getId).collect(Collectors.toList());
List<SalaryCbsInfoPO> salaryCbsInfoList = getSalaryCbsInfoService(user).listByCbsIds(salaryCbsIdList);
if (CollectionUtils.isEmpty(salaryCbsInfoList)) {
throw new SalaryRunTimeException("cbs数据暂不存在");
}
List<Long> pushedEmpIds = salaryCbsInfoList.stream()
.filter(salaryCbsInfoPO -> salaryCbsInfoPO.getPushStatus() != null && salaryCbsInfoPO.getPushStatus().equals(NumberUtils.INTEGER_ONE))
.filter(salaryCbsInfoPO ->{
return (salaryCbsInfoPO.getPushStatus() != null && salaryCbsInfoPO.getPushStatus().equals(NumberUtils.INTEGER_ONE))
|| (!NumberUtils.isCreatable(salaryCbsInfoPO.getPushValue()))
|| (NumberUtils.isCreatable(salaryCbsInfoPO.getPushValue()) && new BigDecimal(salaryCbsInfoPO.getPushValue()).compareTo(new BigDecimal("0")) == 0);
})
.map(SalaryCbsInfoPO::getEmployeeId)
.collect(Collectors.toList());
List<List<Long>> partition = Lists.partition(ids, 500);
List<List<Long>> partition = Lists.partition(checkIds, 500);
List<SalarySendInfoListDTO> sendInfoList = new ArrayList<>();
for (List<Long> idsPart : partition) {
sendInfoList.addAll(getSalarySendInfoMapper().list(SalarySendInfoQueryParam.builder().ids(idsPart).build()));