sangwenwei пре 6 месеци
родитељ
комит
1887724642

+ 67 - 55
jeeplus-modules/jeeplus-assess/src/main/java/com/jeeplus/assess/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -843,9 +843,9 @@ public class ReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -855,26 +855,29 @@ public class ReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (ReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            ReimAmountAndFileDto ccpmReimAmountAndFileDto = new ReimAmountAndFileDto();
-                                            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 (ReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            ReimAmountAndFileDto ccpmReimAmountAndFileDto = new ReimAmountAndFileDto();
+//                                            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);
@@ -893,6 +896,8 @@ public class ReimbursementInfoService {
         ReimAmountAndFileDto ccpmReimAmountAndFileDto = new ReimAmountAndFileDto();
         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);
@@ -1676,9 +1681,9 @@ public class ReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -1688,26 +1693,29 @@ public class ReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (ReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            ReimAmountAndFileDto ccpmReimAmountAndFileDto = new ReimAmountAndFileDto();
-                                            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 (ReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            ReimAmountAndFileDto ccpmReimAmountAndFileDto = new ReimAmountAndFileDto();
+//                                            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);
@@ -1890,20 +1898,24 @@ public class ReimbursementInfoService {
                         List<WorkAttachmentInfo> fileList = infoMapper.findReimFiles(id, "invoiceReimbursement");
                         if (CollectionUtil.isNotEmpty(invoiceReimbursements) && CollectionUtil.isNotEmpty(fileList) && map !=null){
                             for (ReimbursementAmountInfo 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);
+                                            }
                                         }
                                     }
                                 }
+
                             }
 
                         }

+ 67 - 55
jeeplus-modules/jeeplus-ccpm/src/main/java/com/jeeplus/ccpm/approvalInfo/service/CcpmReimbursementInfoService.java

@@ -802,9 +802,9 @@ public class CcpmReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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");
 
 
                 // 遍历 fileList 进行处理
@@ -815,26 +815,29 @@ public class CcpmReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (CcpmReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            CcpmReimAmountAndFileDto ccpmReimAmountAndFileDto = new CcpmReimAmountAndFileDto();
-                                            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 (CcpmReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            CcpmReimAmountAndFileDto ccpmReimAmountAndFileDto = new CcpmReimAmountAndFileDto();
+//                                            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);
@@ -855,6 +858,8 @@ public class CcpmReimbursementInfoService {
         CcpmReimAmountAndFileDto ccpmReimAmountAndFileDto = new CcpmReimAmountAndFileDto();
         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);
@@ -1198,9 +1203,9 @@ public class CcpmReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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");
 
 
                 // 遍历 fileList 进行处理
@@ -1211,26 +1216,29 @@ public class CcpmReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (CcpmReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            CcpmReimAmountAndFileDto ccpmReimAmountAndFileDto = new CcpmReimAmountAndFileDto();
-                                            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 (CcpmReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            CcpmReimAmountAndFileDto ccpmReimAmountAndFileDto = new CcpmReimAmountAndFileDto();
+//                                            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);
@@ -1412,20 +1420,24 @@ public class CcpmReimbursementInfoService {
                         List<WorkAttachmentInfo> fileList = infoMapper.findReimFiles(id, "invoiceReimbursement");
                         if (CollectionUtil.isNotEmpty(invoiceReimbursements) && CollectionUtil.isNotEmpty(fileList) && map !=null){
                             for (CcpmReimbursementAmountInfo 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);
+                                            }
                                         }
                                     }
                                 }
+
                             }
 
                         }

+ 67 - 55
jeeplus-modules/jeeplus-centrecareful/src/main/java/com/jeeplus/centrecareful/approvalInfo/service/ZsReimbursementInfoService.java

@@ -854,9 +854,9 @@ public class ZsReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -866,26 +866,29 @@ public class ZsReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             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);
-                                            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 (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 {
                         // 处理其他文件
                         processNonInvoiceFiles(i, files);
@@ -905,6 +908,8 @@ public class ZsReimbursementInfoService {
         ZsReimAmountAndFileDto ccpmReimAmountAndFileDto = new ZsReimAmountAndFileDto();
         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);
@@ -1233,9 +1238,9 @@ public class ZsReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -1245,26 +1250,29 @@ public class ZsReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             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);
-                                            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 (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 {
                         // 处理其他文件
                         processNonInvoiceFiles(i, files);
@@ -1446,20 +1454,24 @@ public class ZsReimbursementInfoService {
                         List<WorkAttachmentInfo> fileList = infoMapper.findReimFiles(id, "invoiceReimbursement");
                         if (CollectionUtil.isNotEmpty(invoiceReimbursements) && CollectionUtil.isNotEmpty(fileList) && map !=null){
                             for (ZsReimbursementAmountInfo 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);
+                                            }
                                         }
                                     }
                                 }
+
                             }
 
                         }

+ 67 - 55
jeeplus-modules/jeeplus-consult/src/main/java/com/jeeplus/consultancy/approvalInfo/service/ConsultancyReimbursementInfoService.java

@@ -806,9 +806,9 @@ public class ConsultancyReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -818,26 +818,29 @@ public class ConsultancyReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (ConsultancyReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            ConsultancyReimAmountAndFileDto ccpmReimAmountAndFileDto = new ConsultancyReimAmountAndFileDto();
-                                            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 (ConsultancyReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            ConsultancyReimAmountAndFileDto ccpmReimAmountAndFileDto = new ConsultancyReimAmountAndFileDto();
+//                                            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);
@@ -857,6 +860,8 @@ public class ConsultancyReimbursementInfoService {
         ConsultancyReimAmountAndFileDto ccpmReimAmountAndFileDto = new ConsultancyReimAmountAndFileDto();
         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);
@@ -1184,9 +1189,9 @@ public class ConsultancyReimbursementInfoService {
                     }
                 }
                 //查询数电发票解析后的数据
-                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) {
@@ -1196,26 +1201,29 @@ public class ConsultancyReimbursementInfoService {
                         if (invoiceReimbursement != null) {
                             // 处理有 URL 匹配的文件
                             processMatchingFiles(i, invoiceReimbursement, invoiceReimbursementFiles);
-                        }else {
-                            if (map !=null){
-                                for (Map.Entry<String, String> entry : map.entrySet()) {
-                                    for (ConsultancyReimbursementAmountInfo reimbursement : invoiceReimbursements) {
-                                        String key = entry.getKey();
-                                        String value = entry.getValue();
-                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
-                                            ConsultancyReimAmountAndFileDto ccpmReimAmountAndFileDto = new ConsultancyReimAmountAndFileDto();
-                                            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 (ConsultancyReimbursementAmountInfo reimbursement : invoiceReimbursements) {
+//                                        String key = entry.getKey();
+//                                        String value = entry.getValue();
+//                                        if (reimbursement.getNumber().equals(key) && i.getUrl().equals(value)){
+//                                            ConsultancyReimAmountAndFileDto ccpmReimAmountAndFileDto = new ConsultancyReimAmountAndFileDto();
+//                                            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);
@@ -1398,20 +1406,24 @@ public class ConsultancyReimbursementInfoService {
                         List<WorkAttachmentInfo> fileList = infoMapper.findReimFiles(id, "invoiceReimbursement");
                         if (CollectionUtil.isNotEmpty(invoiceReimbursements) && CollectionUtil.isNotEmpty(fileList) && map !=null){
                             for (ConsultancyReimbursementAmountInfo 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);
+                                            }
                                         }
                                     }
                                 }
+
                             }
 
                         }

+ 70 - 58
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/reimbursementApproval/approvalInfo/service/CwReimbursementInfoService.java

@@ -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);
+                                            }
                                         }
                                     }
                                 }
+
                             }
 
                         }