|
@@ -39,6 +39,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -1093,12 +1094,6 @@ public class CwReimbursementInfoService {
|
|
|
reimbursementMap.put(invoiceReimbursement.getFileUrl(), invoiceReimbursement);
|
|
|
}
|
|
|
}
|
|
|
- //查询数电发票解析后的数据
|
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
- strings.add(id);
|
|
|
- Map<String, String> map = SpringUtil.getBean(IWorkAttachmentApi.class).disposeElectronicEngineeringInvoiceNumber(strings, "3");
|
|
|
-
|
|
|
-
|
|
|
|
|
|
for (WorkAttachmentInfo i : fileList) {
|
|
|
if ("invoiceReimbursement".equals(i.getAttachmentFlag())) {
|
|
@@ -1107,26 +1102,34 @@ public class CwReimbursementInfoService {
|
|
|
if (invoiceReimbursement != null) {
|
|
|
// 处理有 URL 匹配的文件
|
|
|
processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
|
|
|
- }else {
|
|
|
- if (map !=null){
|
|
|
- for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
- for (CwReimbursementAmountInfo reimbursement : invoiceReimbursements) {
|
|
|
- String key = entry.getKey();
|
|
|
- String value = entry.getValue();
|
|
|
- if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
- CwReimAmountAndFileDto ccpmReimAmountAndFileDto = new CwReimAmountAndFileDto();
|
|
|
- BeanUtils.copyProperties(i, ccpmReimAmountAndFileDto);
|
|
|
- BeanUtils.copyProperties(reimbursement, ccpmReimAmountAndFileDto);
|
|
|
- ccpmReimAmountAndFileDto.setId(i.getId());
|
|
|
- ccpmReimAmountAndFileDto.setCreateBy(SpringUtil.getBean(IUserApi.class).getById(i.getBy()));
|
|
|
- invoiceReimbursementFiles.add(ccpmReimAmountAndFileDto);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
+// else {
|
|
|
+// //查询数电发票解析后的数据
|
|
|
+// ArrayList<String> strings = new ArrayList<>();
|
|
|
+// strings.add(id);
|
|
|
+// Map<String, String> map = SpringUtil.getBean(IWorkAttachmentApi.class).disposeElectronicEngineeringInvoiceNumber(strings, "3");
|
|
|
+//
|
|
|
+// if (map !=null){
|
|
|
+// for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
+// for (CwReimbursementAmountInfo reimbursement : invoiceReimbursements) {
|
|
|
+// String key = entry.getKey();
|
|
|
+// String value = entry.getValue();
|
|
|
+// if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
+// CwReimAmountAndFileDto ccpmReimAmountAndFileDto = new CwReimAmountAndFileDto();
|
|
|
+// 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 {
|
|
|
// 处理其他文件
|
|
|
processNonInvoiceFiles(i, files);
|
|
@@ -1145,6 +1148,8 @@ public class CwReimbursementInfoService {
|
|
|
CwReimAmountAndFileDto ccpmReimAmountAndFileDto = new CwReimAmountAndFileDto();
|
|
|
BeanUtils.copyProperties(i, ccpmReimAmountAndFileDto);
|
|
|
BeanUtils.copyProperties(invoiceReimbursement, ccpmReimAmountAndFileDto);
|
|
|
+ String[] split = invoiceReimbursement.getInvoiceDate().split(" ");
|
|
|
+ ccpmReimAmountAndFileDto.setInvoiceDate(split[0]);
|
|
|
ccpmReimAmountAndFileDto.setId(i.getId());
|
|
|
ccpmReimAmountAndFileDto.setCreateBy(SpringUtil.getBean(IUserApi.class).getById(i.getBy()));
|
|
|
invoiceReimbursementFiles.add(ccpmReimAmountAndFileDto);
|
|
@@ -1628,9 +1633,9 @@ public class CwReimbursementInfoService {
|
|
|
}
|
|
|
|
|
|
//查询数电发票解析后的数据
|
|
|
- ArrayList<String> strings = new ArrayList<>();
|
|
|
- strings.add(id);
|
|
|
- Map<String, String> map = SpringUtil.getBean(IWorkAttachmentApi.class).disposeElectronicEngineeringInvoiceNumber(strings, "3");
|
|
|
+// ArrayList<String> strings = new ArrayList<>();
|
|
|
+// strings.add(id);
|
|
|
+// Map<String, String> map = SpringUtil.getBean(IWorkAttachmentApi.class).disposeElectronicEngineeringInvoiceNumber(strings, "3");
|
|
|
|
|
|
|
|
|
for (WorkAttachmentInfo i : fileList) {
|
|
@@ -1640,26 +1645,29 @@ public class CwReimbursementInfoService {
|
|
|
if (invoiceReimbursement != null) {
|
|
|
// 处理有 URL 匹配的文件
|
|
|
processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
|
|
|
- }else {
|
|
|
- if (map !=null){
|
|
|
- for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
- for (CwReimbursementAmountInfo reimbursement : invoiceReimbursements) {
|
|
|
- String key = entry.getKey();
|
|
|
- String value = entry.getValue();
|
|
|
- if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
- CwReimAmountAndFileDto ccpmReimAmountAndFileDto = new CwReimAmountAndFileDto();
|
|
|
- BeanUtils.copyProperties(i, ccpmReimAmountAndFileDto);
|
|
|
- BeanUtils.copyProperties(reimbursement, ccpmReimAmountAndFileDto);
|
|
|
- ccpmReimAmountAndFileDto.setId(i.getId());
|
|
|
- ccpmReimAmountAndFileDto.setCreateBy(SpringUtil.getBean(IUserApi.class).getById(i.getBy()));
|
|
|
- invoiceReimbursementFiles.add(ccpmReimAmountAndFileDto);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
+// else {
|
|
|
+// if (map !=null){
|
|
|
+// for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
+// for (CwReimbursementAmountInfo reimbursement : invoiceReimbursements) {
|
|
|
+// String key = entry.getKey();
|
|
|
+// String value = entry.getValue();
|
|
|
+// if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
+// CwReimAmountAndFileDto ccpmReimAmountAndFileDto = new CwReimAmountAndFileDto();
|
|
|
+// 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 {
|
|
|
// 处理其他文件
|
|
|
processNonInvoiceFiles(i, files);
|
|
@@ -1841,20 +1849,24 @@ public class CwReimbursementInfoService {
|
|
|
List<WorkAttachmentInfo> fileList = infoMapper.findReimFiles(id, "invoiceReimbursement");
|
|
|
if (CollectionUtil.isNotEmpty(invoiceReimbursements) && CollectionUtil.isNotEmpty(fileList) && map !=null){
|
|
|
for (CwReimbursementAmountInfo amountInfo : invoiceReimbursements) {
|
|
|
- for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
- for (WorkAttachmentInfo i : fileList) {
|
|
|
- String key = entry.getKey();
|
|
|
- String value = entry.getValue();
|
|
|
- if (amountInfo.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
- amountInfo.setFileUrl(i.getUrl());
|
|
|
- amountInfo.setFileType(i.getType());
|
|
|
- amountInfo.setAttachmentFlag("invoiceReimbursement");
|
|
|
- amountInfo.setAttachmentName(i.getName());
|
|
|
- amountInfo.setFileSize(i.getFileSize());
|
|
|
- amountInfoMapper.updateById(amountInfo);
|
|
|
+ if (StringUtils.isBlank(amountInfo.getFileUrl())){
|
|
|
+ for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
|
+ for (WorkAttachmentInfo i : fileList) {
|
|
|
+ String key = entry.getKey();
|
|
|
+ String value = entry.getValue();
|
|
|
+ if (amountInfo.getNumber().equals(key) && i.getUrl().equals(value)){
|
|
|
+ amountInfo.setFileUrl(i.getUrl());
|
|
|
+ String type = i.getName().substring(i.getName().lastIndexOf(".") + 1);
|
|
|
+ amountInfo.setFileType(type);
|
|
|
+ amountInfo.setAttachmentFlag("invoiceReimbursement");
|
|
|
+ amountInfo.setAttachmentName(i.getName());
|
|
|
+ amountInfo.setFileSize(i.getFileSize());
|
|
|
+ amountInfoMapper.updateById(amountInfo);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|