|
@@ -661,6 +661,7 @@ public class ZsReimbursementInfoService {
|
|
// 保存基础表信息主键值
|
|
// 保存基础表信息主键值
|
|
reimbursementAmountInfo.setInfoId(dto.getId());
|
|
reimbursementAmountInfo.setInfoId(dto.getId());
|
|
reimbursementAmountInfo.setFileUrl(amountInfo.getUrl());
|
|
reimbursementAmountInfo.setFileUrl(amountInfo.getUrl());
|
|
|
|
+
|
|
//文件类型处理
|
|
//文件类型处理
|
|
List<String> strings = Arrays.asList(amountInfo.getName().split("\\."));
|
|
List<String> strings = Arrays.asList(amountInfo.getName().split("\\."));
|
|
if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
@@ -881,33 +882,10 @@ public class ZsReimbursementInfoService {
|
|
for (WorkAttachmentInfo i : fileList) {
|
|
for (WorkAttachmentInfo i : fileList) {
|
|
if ("invoiceReimbursement".equals(i.getAttachmentFlag())) {
|
|
if ("invoiceReimbursement".equals(i.getAttachmentFlag())) {
|
|
ZsReimbursementAmountInfo invoiceReimbursement = reimbursementMap.get(i.getUrl());
|
|
ZsReimbursementAmountInfo invoiceReimbursement = reimbursementMap.get(i.getUrl());
|
|
-
|
|
|
|
if (invoiceReimbursement != null) {
|
|
if (invoiceReimbursement != null) {
|
|
// 处理有 URL 匹配的文件
|
|
// 处理有 URL 匹配的文件
|
|
processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
|
|
processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
|
|
}
|
|
}
|
|
-// else {
|
|
|
|
-// if (map !=null){
|
|
|
|
-// for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
|
-// for (ZsReimbursementAmountInfo reimbursement : invoiceReimbursements) {
|
|
|
|
-// String key = entry.getKey();
|
|
|
|
-// String value = entry.getValue();
|
|
|
|
-// if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
|
-// ZsReimAmountAndFileDto ccpmReimAmountAndFileDto = new ZsReimAmountAndFileDto();
|
|
|
|
-// BeanUtils.copyProperties(i, ccpmReimAmountAndFileDto);
|
|
|
|
-// BeanUtils.copyProperties(reimbursement, ccpmReimAmountAndFileDto);
|
|
|
|
-// String[] split = reimbursement.getInvoiceDate().split(" ");
|
|
|
|
-// ccpmReimAmountAndFileDto.setInvoiceDate(split[0]);
|
|
|
|
-// ccpmReimAmountAndFileDto.setId(i.getId());
|
|
|
|
-// ccpmReimAmountAndFileDto.setCreateBy(SpringUtil.getBean(IUserApi.class).getById(i.getBy()));
|
|
|
|
-// invoiceReimbursementFiles.add(ccpmReimAmountAndFileDto);
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
} else {
|
|
} else {
|
|
// 处理其他文件
|
|
// 处理其他文件
|
|
processNonInvoiceFiles(i, files);
|
|
processNonInvoiceFiles(i, files);
|
|
@@ -916,6 +894,13 @@ public class ZsReimbursementInfoService {
|
|
}
|
|
}
|
|
dto.setFiles(files);
|
|
dto.setFiles(files);
|
|
List<ZsReimAmountAndFileDto> uniqueFilesList = new ArrayList<>(invoiceReimbursementFiles);
|
|
List<ZsReimAmountAndFileDto> uniqueFilesList = new ArrayList<>(invoiceReimbursementFiles);
|
|
|
|
+ // 按 sort 升序排序
|
|
|
|
+ uniqueFilesList.sort(
|
|
|
|
+ Comparator.comparing(
|
|
|
|
+ ZsReimAmountAndFileDto::getSort,
|
|
|
|
+ Comparator.nullsLast(Integer::compareTo) // null 放到最后
|
|
|
|
+ )
|
|
|
|
+ );
|
|
dto.setInvoiceReimbursementFiles(uniqueFilesList);
|
|
dto.setInvoiceReimbursementFiles(uniqueFilesList);
|
|
}
|
|
}
|
|
return dto;
|
|
return dto;
|