fix(bpm): 修复报销单据中部门名称为空时的空指针异常

- 在获取 paymentCompanyName 时,增加对 deptMap 中值的空值检查
- 避免在 deptMap 中不存在对应部门时抛出空指针异常
- 优化代码的健壮性和异常处理
This commit is contained in:
aikai 2025-07-11 17:11:55 +08:00
parent 87420cb376
commit 535bacddb6

View File

@ -362,7 +362,8 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
List<ReimbursementDTO> reimbursementDTOS = BeanUtils.toBean(reimbursements, ReimbursementDTO.class);
BpmOAReimbursementRespVO bpmOAReimbursementRespVO = BeanUtils.toBean(reimbursementDO, BpmOAReimbursementRespVO.class);
bpmOAReimbursementRespVO.setPaymentCompanyName(deptMap.get(reimbursementDO.getPaymentCompany()).getName());
DeptRespDTO deptRespDTO = deptMap.get(reimbursementDO.getPaymentCompany());
bpmOAReimbursementRespVO.setPaymentCompanyName(deptRespDTO == null ? null : deptRespDTO.getName());
bpmOAReimbursementRespVO.setReimbursements(BpmOAReimbursementConvert.INSTANCE.convertList(reimbursementDTOS, deptMap)); //拼接数据
return bpmOAReimbursementRespVO;