fix(bpm): 修复报销单据中部门名称为空时的空指针异常
- 在获取 paymentCompanyName 时,增加对 deptMap 中值的空值检查 - 避免在 deptMap 中不存在对应部门时抛出空指针异常 - 优化代码的健壮性和异常处理
This commit is contained in:
parent
87420cb376
commit
535bacddb6
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user