|
@@ -369,9 +369,11 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
FinanceInvoiceDTO financeInvoiceDTO = financeInvoiceMapper.queryById(id);
|
|
|
if(ObjectUtil.isNotEmpty(financeInvoiceDTO) && "1".equals(financeInvoiceDTO.getRedInvoiceFlag()) ){
|
|
|
//此处为红冲数据 需要获取发票号
|
|
|
- FinanceInvoiceDTO redCwFinanceInvoiceDTO = financeInvoiceMapper.queryById(financeInvoiceDTO.getRedInvoiceRelevancyId());
|
|
|
- String invoiceNumberStr = financeInvoiceMapper.getInvoiceNumberStr(redCwFinanceInvoiceDTO.getId());
|
|
|
- financeInvoiceDTO.setInvoiceNumberStr(invoiceNumberStr);
|
|
|
+ if(StringUtils.isNotBlank(financeInvoiceDTO.getRedInvoiceRelevancyId())){
|
|
|
+ FinanceInvoiceDTO redCwFinanceInvoiceDTO = financeInvoiceMapper.queryById(financeInvoiceDTO.getRedInvoiceRelevancyId());
|
|
|
+ String invoiceNumberStr = financeInvoiceMapper.getInvoiceNumberStr(redCwFinanceInvoiceDTO.getId());
|
|
|
+ financeInvoiceDTO.setInvoiceNumberStr(invoiceNumberStr);
|
|
|
+ }
|
|
|
}
|
|
|
// 查询附件信息
|
|
|
List<WorkAttachmentInfo> fileList = workContractInfoMapper.findDtos(id);
|
|
@@ -581,9 +583,15 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
i.setDelFlag(0);
|
|
|
i.setUrl(item.getUrl());
|
|
|
//文件类型处理
|
|
|
- List<String> strings = Arrays.asList(item.getName().split("\\."));
|
|
|
- if (CollectionUtil.isNotEmpty(strings)) {
|
|
|
- i.setType(strings.get(1));
|
|
|
+ String fileName = item.getName();
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
+ // 检查文件名是否有后缀
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
+ } else {
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
+ i.setType("");
|
|
|
}
|
|
|
i.setAttachmentId(id);
|
|
|
i.setAttachmentName(item.getName());
|