Min пре 11 месеци
родитељ
комит
12fc8c2927

+ 35 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportLogController.java

@@ -107,6 +107,7 @@ public class ReportLogController {
         titleList.add("姓名");
         titleList.add("工号");
         titleList.add("工作日期");
+        titleList.add("填报时间");
         titleList.add("项目名称");
         titleList.add("项目编号");
         titleList.add("审核通过时间");
@@ -138,6 +139,13 @@ public class ReportLogController {
             item.add(String.valueOf(df.format(reportLog.getCreateDate())));
             String ids = reportLog.getReportIds();
             String[] split = ids.split(",");
+            List<Integer> subReportIdList = Arrays.asList(split).stream().map(id -> Integer.valueOf(id)).collect(Collectors.toList());
+            Optional<Report> target = reportList.stream().filter(r ->subReportIdList.contains(r.getId())).findFirst();
+            if(target.isPresent()){
+                item.add(df1.format(target.get().getCreateTime()));
+            }else {
+                item.add("");
+            }
             StringBuilder projectNames=new StringBuilder();
             StringBuilder projectCodes=new StringBuilder();
             for (int i = 0; i < split.length; i++) {
@@ -238,9 +246,10 @@ public class ReportLogController {
                 XSSFCell nameCell = row.getCell(1);
                 XSSFCell jobNumCell = row.getCell(2);
                 XSSFCell createDateCell = row.getCell(3);
-                XSSFCell projectNameCell = row.getCell(4);
-                XSSFCell projectCodeCell = row.getCell(5);
-                XSSFCell auditDateCell = row.getCell(6);
+                XSSFCell createTimeCell = row.getCell(4);
+                XSSFCell projectNameCell = row.getCell(5);
+                XSSFCell projectCodeCell = row.getCell(6);
+                XSSFCell auditDateCell = row.getCell(7);
 
                 if (numCell != null) {
                     String code = numCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
@@ -254,6 +263,7 @@ public class ReportLogController {
                 if (nameCell != null)nameCell.setCellType(CellType.STRING);
                 if (jobNumCell != null)jobNumCell.setCellType(CellType.STRING);
                 if (createDateCell != null)createDateCell.setCellType(CellType.STRING);
+                if (createTimeCell != null)createTimeCell.setCellType(CellType.STRING);
                 if (projectNameCell != null)projectNameCell.setCellType(CellType.STRING);
                 if (projectCodeCell != null)projectCodeCell.setCellType(CellType.STRING);
                 if (auditDateCell != null)auditDateCell.setCellType(CellType.STRING);
@@ -262,6 +272,7 @@ public class ReportLogController {
                 String nameCellValue = nameCell.getStringCellValue();
                 String jobNumCellValue =jobNumCell.getStringCellValue();
                 String createDateCellValue = createDateCell.getStringCellValue();
+                String createTimeCellValue = createTimeCell.getStringCellValue();
                 String projectNameCellValue = projectNameCell.getStringCellValue();
                 String projectCodeCellValue = projectCodeCell.getStringCellValue();
                 String auditDateCellValue = auditDateCell.getStringCellValue();
@@ -273,19 +284,34 @@ public class ReportLogController {
                     String reportIdSplit = reportLog.getReportIds();
                     List<Integer> ids = Arrays.asList(reportIdSplit.split(",")).stream().map(s -> Integer.valueOf(s)).collect(Collectors.toList());
                     List<Report> reports = reportList.stream().filter(r -> ids.contains(r.getId())).collect(Collectors.toList());
-                    if(auditDateCellValue!=null){
-                        LocalDateTime time = null;
+                    LocalDateTime auditDateTime = null;
+                    LocalDateTime createTimeTime = null;
+                    if(auditDateCellValue!=null&&!StringUtils.isEmpty(auditDateCellValue)){
                         try {
-                             time = LocalDateTime.parse(auditDateCellValue, df);
+                            auditDateTime = LocalDateTime.parse(auditDateCellValue, df);
                         }catch (Exception e){
                             msg.setError("第"+row+"行审核时间格式错误,请检查审核时间数据");
                             return msg;
                         }
-                        reportLog.setOperateDate(time);
+                        reportLog.setOperateDate(auditDateTime);
                         needUpdateReportLogList.add(reportLog);
-                        LocalDateTime finalTime = time;
+                        LocalDateTime finalAuditDateTime = auditDateTime;
+                        LocalDateTime finalCreateTimeTime = createTimeTime;
+                        reports.forEach(r->{
+                            r.setProjectAuditTime(finalAuditDateTime);
+                        });
+                        needUpdateReportList.addAll(reports);
+                    }
+                    if(createTimeCellValue!=null&&!StringUtils.isEmpty(createTimeCellValue)){
+                        try {
+                            createTimeTime = LocalDateTime.parse(createTimeCellValue, df);
+                        }catch (Exception e){
+                            msg.setError("第"+row+"行填报时间格式错误,请检查审核时间数据");
+                            return msg;
+                        }
+                        LocalDateTime finalCreateTimeTime = createTimeTime;
                         reports.forEach(r->{
-                            r.setProjectAuditTime(finalTime);
+                            r.setCreateTime(finalCreateTimeTime);
                         });
                         needUpdateReportList.addAll(reports);
                     }

+ 8 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -5896,11 +5896,18 @@
                         type: "error"
                     });
                 } else {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '正在导入修改中,请耐心等待。',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(0, 0, 0, 0.7)'
+                    });
                     let formData = new FormData();
                     formData.append("multipartFile", item.file);
                     this.http.uploadFile('/report-log/importReportLogChange', formData,
                     res => {
                         this.$refs.upload.clearFiles();
+                        loading.close();
                         if (res.code == "ok") {
                             this.$message({
                             message: res.msg,
@@ -5915,6 +5922,7 @@
                     },
                     error => {
                         this.$refs.upload.clearFiles();
+                        loading.close();
                         this.$message({
                             message: error,
                             type: "error"