| | |
| | | |
| | | // 保存详情数据 |
| | | for (ServiceFunddetailVO serviceFunddetailVO : serviceFunddetails) { |
| | | // 2026-10-15:附件文件名规范二次校验(与前端 fileNameCheck 同口径;只校验本次变更的附件,历史附件放行) |
| | | java.util.Set<String> existingNames = new java.util.HashSet<>(); |
| | | if (serviceFunddetailVO.getId() != null) { |
| | | ServiceFunddetail oldDetail = serviceFunddetailMapper.selectById(serviceFunddetailVO.getId()); |
| | | if (oldDetail != null) { |
| | | existingNames.addAll(com.ruoyi.project.common.AttachmentNameValidator |
| | | .collectNames(oldDetail.getInvoicefiles())); |
| | | existingNames.addAll(com.ruoyi.project.common.AttachmentNameValidator |
| | | .collectNames(oldDetail.getAnnexfiles())); |
| | | } |
| | | } |
| | | String invoiceJson = CollectionUtils.isEmpty(serviceFunddetailVO.getInvoicefilesList()) |
| | | ? serviceFunddetailVO.getInvoicefiles() |
| | | : JSON.toJSONString(serviceFunddetailVO.getInvoicefilesList()); |
| | | String annexJson = CollectionUtils.isEmpty(serviceFunddetailVO.getAnnexfilesList()) |
| | | ? serviceFunddetailVO.getAnnexfiles() |
| | | : JSON.toJSONString(serviceFunddetailVO.getAnnexfilesList()); |
| | | String nameError = com.ruoyi.project.common.AttachmentNameValidator |
| | | .checkJsonListForUpdate(existingNames, invoiceJson, annexJson); |
| | | if (nameError != null) { |
| | | throw new BaseException("附件文件名不符合要求,无法保存:" + nameError); |
| | | } |
| | | //去掉身份证的首尾空格 |
| | | if (StringUtils.isNotEmpty(serviceFunddetailVO.getIdcardno())) { |
| | | serviceFunddetailVO.setIdcardno(serviceFunddetailVO.getIdcardno().trim()); |