hfxc226 3 lat temu
rodzic
commit
d10c669ec7

+ 4 - 4
platform-dao/src/main/java/com/platform/dao/entity/repair/RepairApplicationForm.java

@@ -123,13 +123,13 @@ public class RepairApplicationForm implements Serializable {
      */
     private String repairDispatchRemark;
     /**
-     * 维修耗时:分钟=维修结束时间-维修接收时间
+     * 接收耗时,响应时间:小时=维修接收时间-报修时间
      */
-    private Double repairMinutes;
+    private Double receiveMinutes;
     /**
-     * 接收耗时:分钟=维修接收时间-报修时间
+     * 维修耗时:小时=维修结束时间-维修接收时间
      */
-    private Double receiveMinutes;
+    private Double repairMinutes;
     /**
      * 设备停机修复时间:分钟=维修结束时间-报修时间
      */

+ 124 - 0
platform-dao/src/main/java/com/platform/dao/vo/export/repair/ExportRepairApplicationFormMergeVO.java

@@ -0,0 +1,124 @@
+package com.platform.dao.vo.export.repair;
+
+import com.platform.office.annotation.Excel;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @Description 保修单导出VO
+ * @Author liuyu
+ * @Date 2020-05-12 09:30:26
+ * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
+ */
+@Data
+@Accessors(chain = true)
+public class ExportRepairApplicationFormMergeVO implements Serializable {
+    /**
+     * 报修单号
+     */
+    @Excel(name = "报修单号", orderNum = "1")
+    private String no;
+    /**
+     * 设备编号
+     */
+    @Excel(name = "设备编号", orderNum = "2")
+    private String sbNo;
+
+    /**
+     * 设备名称
+     */
+    @Excel(name = "设备名称", orderNum = "3")
+    private String sbName;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "工单类别", orderNum = "4", dicCode = "REPAIR_APPLICATION_FORM_CATEGORY")
+    private String category;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "故障部位", orderNum = "5")
+    private String partName;
+    /**
+     * 报修人id
+     */
+    @Excel(name = "报修人", orderNum = "6")
+    private String actualUser;
+    /**
+     * 报修人id
+     */
+    @Excel(name = "响应时间", orderNum = "7")
+    private Double receiveMinutes;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "维修时间", orderNum = "8")
+    private Double repairMinutes;
+    /**
+     * 报修人id
+     */
+    @Excel(name = "修复时间", orderNum = "9")
+    private Double dealMinutes;
+    /**
+     * 报修状态: 1-待分配 2-已分配 3-已完成 4-已撤销
+     */
+    @Excel(name = "报修状态", orderNum = "10", dicCode = "REPAIR_APPLICATION_FORM_STATUS")
+    private Integer status;
+
+    /**
+     * 报修时间
+     */
+    @Excel(name = "报修时间", orderNum = "11")
+    private LocalDateTime applyTime;
+    /**
+     * 维修开始时间
+     */
+    @Excel(name = "维修开始时间", orderNum = "12")
+    private LocalDateTime repairStartTime;
+
+    /**
+     * 维修结束时间
+     */
+    @Excel(name = "维修结束时间", orderNum = "13")
+    private LocalDateTime repairEndTime;
+
+    /**
+     * 分析时间
+     */
+    @Excel(name = "分析时间", orderNum = "14")
+    private LocalDate analyzeTime;
+
+    /**
+     * 问题描述
+     */
+    @Excel(name = "问题描述", orderNum = "15")
+    private String problemDesc;
+    /**
+     * 检查处理过程
+     */
+    @Excel(name = "问题描述", orderNum = "16")
+    private String checkProcess;
+    /**
+     * 原因分析
+     */
+    @Excel(name = "原因分析", orderNum = "17")
+    private String reasonAnalysis;
+
+    /**
+     * 更新维修计划
+     */
+    @Excel(name = "改进类别", orderNum = "18")
+    private String changeRepairPlan;
+
+    /**
+     * 更新维修计划
+     */
+    @Excel(name = "改进内容", orderNum = "19")
+    private String changeRepairPlanContent;
+
+
+}

+ 36 - 28
platform-dao/src/main/java/com/platform/dao/vo/export/repair/ExportRepairApplicationFormVO.java

@@ -48,114 +48,122 @@ public class ExportRepairApplicationFormVO implements Serializable {
      */
     @Excel(name = "报修人", orderNum = "6")
     private String actualUser;
-
     /**
-     * 维修描述
+     * 报修人id
      */
-    @Excel(name = "问题描述", orderNum = "7")
-    private String repairContent;
-
+    @Excel(name = "响应时间", orderNum = "7")
+    private Double receiveMinutes;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "维修时间", orderNum = "8")
+    private Double repairMinutes;
+    /**
+     * 报修人id
+     */
+    @Excel(name = "修复时间", orderNum = "9")
+    private Double dealMinutes;
     /**
      * 报修状态: 1-待分配 2-已分配 3-已完成 4-已撤销
      */
-    @Excel(name = "报修状态", orderNum = "8", dicCode = "REPAIR_APPLICATION_FORM_STATUS")
+    @Excel(name = "报修状态", orderNum = "10", dicCode = "REPAIR_APPLICATION_FORM_STATUS")
     private Integer status;
 
     /**
      * 报修时间
      */
-    @Excel(name = "报修时间", orderNum = "9")
+    @Excel(name = "报修时间", orderNum = "11")
     private LocalDateTime applyTime;
     /**
      * 维修开始时间
      */
-    @Excel(name = "维修开始时间", orderNum = "10")
+    @Excel(name = "维修开始时间", orderNum = "12")
     private LocalDateTime repairStartTime;
 
     /**
      * 维修结束时间
      */
-    @Excel(name = "维修结束时间", orderNum = "11")
+    @Excel(name = "维修结束时间", orderNum = "13")
     private LocalDateTime repairEndTime;
 
     /**
      * 分析时间
      */
-    @Excel(name = "分析时间", orderNum = "12")
+    @Excel(name = "分析时间", orderNum = "14")
     private LocalDate analyzeTime;
 
     /**
      * 问题描述
      */
-    @Excel(name = "问题描述", orderNum = "13")
+    @Excel(name = "问题描述", orderNum = "15")
     private String problemDesc;
     /**
      * 检查处理过程
      */
-    @Excel(name = "问题描述", orderNum = "14")
+    @Excel(name = "问题描述", orderNum = "16")
     private String checkProcess;
     /**
      * 原因分析
      */
-    @Excel(name = "原因分析", orderNum = "15")
+    @Excel(name = "原因分析", orderNum = "17")
     private String reasonAnalysis;
 
     /**
      * 更新维修计划
      */
-    @Excel(name = "是否更新维修计划", orderNum = "16")
-    private String changeRepairPlan;
+    @Excel(name = "是否更新维修计划", orderNum = "18")
+    private Boolean changeRepairPlan;
 
     /**
      * 更新维修计划
      */
-    @Excel(name = "更新维修计划", orderNum = "17")
+    @Excel(name = "更新维修计划", orderNum = "19")
     private String changeRepairPlanContent;
 
     /**
      * 更新备件计划
      */
-    @Excel(name = "是否更新备件计划", orderNum = "18")
-    private String changeSparePlan;
+    @Excel(name = "是否更新备件计划", orderNum = "20")
+    private Boolean changeSparePlan;
 
     /**
      * 更新备件计划
      */
-    @Excel(name = "更新备件计划", orderNum = "19")
+    @Excel(name = "更新备件计划", orderNum = "21")
     private String changeSparePlanContent;
 
     /**
      * 人员培训
      */
-    @Excel(name = "是否人员培训", orderNum = "20")
-    private String userTeach;
+    @Excel(name = "是否人员培训", orderNum = "22")
+    private Boolean userTeach;
 
     /**
      * 人员培训
      */
-    @Excel(name = "人员培训", orderNum = "21")
+    @Excel(name = "人员培训", orderNum = "23")
     private String userTeachContent;
     /**
      * 设备改造升级
      */
-    @Excel(name = "是否设备改造升级", orderNum = "22")
-    private String sbChange;
+    @Excel(name = "是否设备改造升级", orderNum = "24")
+    private Boolean sbChange;
 
     /**
      * 设备改造升级
      */
-    @Excel(name = "设备改造升级", orderNum = "23")
+    @Excel(name = "设备改造升级", orderNum = "25")
     private String sbChangeContent;
     /**
      * 其他
      */
-    @Excel(name = "是否其他", orderNum = "24")
-    private String otherChange;
+    @Excel(name = "是否其他", orderNum = "26")
+    private Boolean otherChange;
 
     /**
      * 其他
      */
-    @Excel(name = "其他", orderNum = "25")
+    @Excel(name = "其他", orderNum = "27")
     private String otherChangeContent;
 
 }

+ 5 - 5
platform-dao/src/main/java/com/platform/dao/vo/repair/RepairApplicationFormVO.java

@@ -307,7 +307,7 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
     /**
      * 更新维修计划
      */
-    private String changeRepairPlan;
+    private Boolean changeRepairPlan;
 
     /**
      * 更新维修计划
@@ -317,7 +317,7 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
     /**
      * 更新备件计划
      */
-    private String changeSparePlan;
+    private Boolean changeSparePlan;
 
     /**
      * 更新备件计划
@@ -327,7 +327,7 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
     /**
      * 人员培训
      */
-    private String userTeach;
+    private Boolean userTeach;
 
     /**
      * 人员培训
@@ -336,7 +336,7 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
     /**
      * 设备改造升级
      */
-    private String sbChange;
+    private Boolean sbChange;
 
     /**
      * 设备改造升级
@@ -345,7 +345,7 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
     /**
      * 其他
      */
-    private String otherChange;
+    private Boolean otherChange;
 
     /**
      * 其他

+ 1 - 1
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -77,7 +77,7 @@
                     and (application.repair_user_id = #{repairUserId} or application.repair_user_id is null)
                 </if>
                 <if test="repairUserIdOrNoAssignFlag == null || repairUserIdOrNoAssignFlag == false">
-                    and application.repair_user_id = #{repairUserId}
+                    and (application.repair_user_id = #{repairUserId}  or sb.repair_user_second  = #{repairUserId} )
                 </if>
             </if>
             <if test="checkUserId != null and checkUserId != ''">

+ 185 - 0
platform-office/src/main/java/com/platform/office/poi/excel/ExcelMergeExportUtil.java

@@ -0,0 +1,185 @@
+package com.platform.office.poi.excel;
+
+import com.google.common.collect.Lists;
+import com.platform.office.vo.PoiModel;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * Created by zelei.fan on 2017/3/14.
+ */
+public class ExcelMergeExportUtil {
+
+    /**
+     * @param title      标题集合 tilte的长度应该与list中的model的属性个数一致
+     * @param maps       内容集合
+     * @param mergeIndex 合并单元格的列
+     */
+    public static String createExcel(String[] title, Map<String/*sheet名*/, List<Map<String/*对应title的值*/, String>>> maps, int[] mergeIndex) {
+        if (title.length == 0) {
+            return null;
+        }
+        /*初始化excel模板*/
+        Workbook workbook = new XSSFWorkbook();
+        Sheet sheet = null;
+        int n = 0;
+        /*循环sheet页*/
+        for (Map.Entry<String, List<Map<String/*对应title的值*/, String>>> entry : maps.entrySet()) {
+            /*实例化sheet对象并且设置sheet名称,book对象*/
+            try {
+                sheet = workbook.createSheet();
+                workbook.setSheetName(n, entry.getKey());
+                workbook.setSelectedTab(0);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            /*初始化head,填值标题行(第一行)*/
+            Row row0 = sheet.createRow(0);
+            for (int i = 0; i < title.length; i++) {
+                /*创建单元格,指定类型*/
+                Cell cell_1 = row0.createCell(i, Cell.CELL_TYPE_STRING);
+                cell_1.setCellValue(title[i]);
+            }
+            /*得到当前sheet下的数据集合*/
+            List<Map<String/*对应title的值*/, String>> list = entry.getValue();
+            /*遍历该数据集合*/
+            List<PoiModel> poiModels = Lists.newArrayList();
+            if (null != workbook) {
+                Iterator iterator = list.iterator();
+                int index = 1;/*这里1是从excel的第二行开始,第一行已经塞入标题了*/
+                while (iterator.hasNext()) {
+                    Row row = sheet.createRow(index);
+                    /*取得当前这行的map,该map中以key,value的形式存着这一行值*/
+                    Map<String, String> map = (Map<String, String>) iterator.next();
+                    /*循环列数,给当前行塞值*/
+                    for (int i = 0; i < title.length; i++) {
+                        String old = "";
+                        /*old存的是上一行统一位置的单元的值,第一行是最上一行了,所以从第二行开始记*/
+                        if (index > 1) {
+                            old = poiModels.get(i) == null ? "" : poiModels.get(i).getContent();
+                        }
+                        /*循环需要合并的列*/
+                        for (int j = 0; j < mergeIndex.length; j++) {
+                            if (index == 1) {
+                                /*记录第一行的开始行和开始列*/
+                                PoiModel poiModel = new PoiModel();
+                                poiModel.setOldContent(map.get(title[i]));
+                                poiModel.setContent(map.get(title[i]));
+                                poiModel.setRowIndex(1);
+                                poiModel.setCellIndex(i);
+                                poiModels.add(poiModel);
+                                break;
+                            } else if (i > 0 && mergeIndex[j] == i) {/*这边i>0也是因为第一列已经是最前一列了,只能从第二列开始*/
+                                /*当前同一列的内容与上一行同一列不同时,把那以上的合并, 或者在当前元素一样的情况下,前一列的元素并不一样,这种情况也合并*/
+                                /*如果不需要考虑当前行与上一行内容相同,但是它们的前一列内容不一样则不合并的情况,把下面条件中||poiModels.get(i).getContent().equals(map.get(title[i])) && !poiModels.get(i - 1).getOldContent().equals(map.get(title[i-1]))去掉就行*/
+                                if (!poiModels.get(i).getContent().equals(map.get(title[i])) || poiModels.get(i).getContent().equals(map.get(title[i])) && !poiModels.get(i - 1).getOldContent().equals(map.get(title[i - 1]))) {
+                                    /*当前行的当前列与上一行的当前列的内容不一致时,则把当前行以上的合并*/
+                                    CellRangeAddress cra = new CellRangeAddress(poiModels.get(i).getRowIndex()/*从第二行开始*/, index - 1/*到第几行*/, poiModels.get(i).getCellIndex()/*从某一列开始*/, poiModels.get(i).getCellIndex()/*到第几列*/);
+                                    //在sheet里增加合并单元格
+                                    sheet.addMergedRegion(cra);
+                                    /*重新记录该列的内容为当前内容,行标记改为当前行标记,列标记则为当前列*/
+                                    poiModels.get(i).setContent(map.get(title[i]));
+                                    poiModels.get(i).setRowIndex(index);
+                                    poiModels.get(i).setCellIndex(i);
+                                }
+                            }
+                            /*处理第一列的情况*/
+                            if (mergeIndex[j] == i && i == 0 && !poiModels.get(i).getContent().equals(map.get(title[i]))) {
+                                /*当前行的当前列与上一行的当前列的内容不一致时,则把当前行以上的合并*/
+                                CellRangeAddress cra = new CellRangeAddress(poiModels.get(i).getRowIndex()/*从第二行开始*/, index - 1/*到第几行*/, poiModels.get(i).getCellIndex()/*从某一列开始*/, poiModels.get(i).getCellIndex()/*到第几列*/);
+                                //在sheet里增加合并单元格
+                                sheet.addMergedRegion(cra);
+                                /*重新记录该列的内容为当前内容,行标记改为当前行标记*/
+                                poiModels.get(i).setContent(map.get(title[i]));
+                                poiModels.get(i).setRowIndex(index);
+                                poiModels.get(i).setCellIndex(i);
+                            }
+
+                            /*最后一行没有后续的行与之比较,所有当到最后一行时则直接合并对应列的相同内容*/
+                            if (mergeIndex[j] == i && index == list.size()) {
+                                CellRangeAddress cra = new CellRangeAddress(poiModels.get(i).getRowIndex()/*从第二行开始*/, index/*到第几行*/, poiModels.get(i).getCellIndex()/*从某一列开始*/, poiModels.get(i).getCellIndex()/*到第几列*/);
+                                //在sheet里增加合并单元格
+                                sheet.addMergedRegion(cra);
+                            }
+                        }
+                        Cell cell = row.createCell(i, Cell.CELL_TYPE_STRING);
+                        cell.setCellValue(map.get(title[i]));
+                        /*在每一个单元格处理完成后,把这个单元格内容设置为old内容*/
+                        poiModels.get(i).setOldContent(old);
+                    }
+                    index++;
+                }
+            }
+            n++;
+        }
+        /*生成临时文件*/
+        FileOutputStream out = null;
+        String localPath = null;
+        File tempFile = null;
+        String fileName = String.valueOf(new Date().getTime() / 1000);
+        try {
+            tempFile = File.createTempFile(fileName, ".xlsx");
+            localPath = tempFile.getAbsolutePath();
+            out = new FileOutputStream(localPath);
+            workbook.write(out);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                out.flush();
+                out.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return localPath;
+    }
+
+    public static void main(String[] args) throws IOException {
+        /*此处标题的数组则对应excel的标题*/
+        String[] title = {"id", "标题", "描述", "负责人", "开始时间"};
+        List<Map<String, String>> list = Lists.newArrayList();
+        /*这边是制造一些数据,注意每个list中map的key要和标题数组中的元素一致*/
+        for (int i = 0; i < 10; i++) {
+            HashMap<String, String> map = com.google.common.collect.Maps.newHashMap();
+            if (i > 5) {
+                if (i < 7) {
+                    map.put("id", "333");
+                    map.put("标题", "mmmm");
+                } else {
+                    map.put("id", "333");
+                    map.put("标题", "aaaaa");
+                }
+            } else if (i > 3) {
+                map.put("id", "222");
+                map.put("标题", "哈哈哈哈");
+            } else if (i > 1 && i < 3) {
+                map.put("id", "222");
+                map.put("标题", "hhhhhhhh");
+            } else {
+                map.put("id", "222");
+                map.put("标题", "bbbb");
+            }
+            map.put("描述", "sssssss");
+            map.put("负责人", "vvvvv");
+            map.put("开始时间", "2017-02-27 11:20:26");
+            list.add(map);
+        }
+        /*此处的key为每个sheet的名称,一个excel中可能有多个sheet页*/
+        /*此处key对应每一列的标题*/
+        /*该list为每个sheet页的数据*/
+        Map<String, List<Map<String, String>>> map = new HashMap<>();
+        map.put("测试合并数据", list);
+        System.out.println(createExcel(title, map, new int[]{0, 1, 2}/*此处数组为需要合并的列,可能有的需求是只需要某些列里面相同内容合并*/));
+    }
+
+}

+ 43 - 0
platform-office/src/main/java/com/platform/office/vo/PoiModel.java

@@ -0,0 +1,43 @@
+package com.platform.office.vo;
+
+public class PoiModel {
+    private String content;
+
+    private String oldContent;
+
+    private int rowIndex;
+
+    private int cellIndex;
+
+    public String getOldContent() {
+        return oldContent;
+    }
+
+    public void setOldContent(String oldContent) {
+        this.oldContent = oldContent;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public int getRowIndex() {
+        return rowIndex;
+    }
+
+    public void setRowIndex(int rowIndex) {
+        this.rowIndex = rowIndex;
+    }
+
+    public int getCellIndex() {
+        return cellIndex;
+    }
+
+    public void setCellIndex(int cellIndex) {
+        this.cellIndex = cellIndex;
+    }
+}

+ 39 - 2
platform-rest/src/main/java/com/platform/rest/controller/repair/RepairApplicationFormController.java

@@ -11,7 +11,9 @@ import com.platform.dao.dto.repair.RepairFormDTO;
 import com.platform.dao.dto.repair.RepairReasonDTO;
 import com.platform.dao.entity.repair.RepairApplicationForm;
 import com.platform.dao.util.ExcelUtil;
+import com.platform.dao.vo.export.repair.ExportRepairApplicationFormMergeVO;
 import com.platform.dao.vo.export.repair.ExportRepairApplicationFormVO;
+import com.platform.dao.vo.export.repair.ExportRepairCheckVO;
 import com.platform.dao.vo.repair.RepairApplicationFormVO;
 import com.platform.rest.RestApplication;
 import com.platform.rest.log.annotation.SysLog;
@@ -26,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -179,7 +182,7 @@ public class RepairApplicationFormController {
     @SysLog("提交审核维修单")
     @PutMapping("/examine/{id}")
     @PreAuthorize("@pms.hasPermission('repair-application-forms-finish')")
-    public R examineApply (@PathVariable("id") String id) {
+    public R examineApply(@PathVariable("id") String id) {
         repairApplicationFormService.examine(id);
         return new R<>();
     }
@@ -251,7 +254,41 @@ public class RepairApplicationFormController {
     @PreAuthorize("@pms.hasPermission('repair-application-forms-export')")
     public void export(HttpServletResponse response, RepairApplicationFormDTO repairApplicationFormDTO) {
         List<RepairApplicationFormVO> list = repairApplicationFormService.getVOListByDTO(repairApplicationFormDTO);
-        ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormVO.class, BeanConverterUtil.copyListProperties(list, ExportRepairApplicationFormVO.class), "工单");
+        List<ExportRepairApplicationFormVO> excelList = BeanConverterUtil.copyListProperties(list, ExportRepairApplicationFormVO.class);
+        List<ExportRepairApplicationFormMergeVO> mergeVOList = new ArrayList<>();
+        for (ExportRepairApplicationFormVO vo : excelList) {
+            if(vo.getChangeRepairPlan()){
+                ExportRepairApplicationFormMergeVO mergeVO = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormMergeVO.class);
+                mergeVO.setChangeRepairPlan("更新维修计划");
+                mergeVO.setChangeRepairPlanContent(vo.getChangeRepairPlanContent());
+                mergeVOList.add(mergeVO);
+            }
+            if(vo.getChangeSparePlan()){
+                ExportRepairApplicationFormMergeVO mergeVO = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormMergeVO.class);
+                mergeVO.setChangeRepairPlan("更新备件计划");
+                mergeVO.setChangeRepairPlanContent(vo.getChangeSparePlanContent());
+                mergeVOList.add(mergeVO);
+            }
+            if(vo.getUserTeach()){
+                ExportRepairApplicationFormMergeVO mergeVO = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormMergeVO.class);
+                mergeVO.setChangeRepairPlan("人员培训");
+                mergeVO.setChangeRepairPlanContent(vo.getUserTeachContent());
+                mergeVOList.add(mergeVO);
+            }
+            if(vo.getSbChange()){
+                ExportRepairApplicationFormMergeVO mergeVO = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormMergeVO.class);
+                mergeVO.setChangeRepairPlan("设备改造升级");
+                mergeVO.setChangeRepairPlanContent(vo.getSbChangeContent());
+                mergeVOList.add(mergeVO);
+            }
+            if(vo.getOtherChange()){
+                ExportRepairApplicationFormMergeVO mergeVO = BeanConverterUtil.copyObjectProperties(vo, ExportRepairApplicationFormMergeVO.class);
+                mergeVO.setChangeRepairPlan("其他");
+                mergeVO.setChangeRepairPlanContent(vo.getOtherChangeContent());
+                mergeVOList.add(mergeVO);
+            }
+        }
+        ExcelUtil.exportResponseDict(response, ExportRepairApplicationFormMergeVO.class, mergeVOList, "维修工单");
     }
 
 }

+ 7 - 5
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -170,7 +170,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
                     record.setUserId(userInfo.getUserId());
                 }
             }
-            // 获取维修人
+            // 获取维修人,包括第二维修人
             if (record.getSearchType() == 2) {
                 if (record.getFilter() != null && DataFilterTypeEnum.SELF.getValue() == record.getFilter().intValue()) {
                     UserInfo userInfo = SecurityUtils.getUserInfo();
@@ -551,7 +551,7 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         if (applicationForm.getRepairStartTime() == null) {
             applicationForm.setRepairStartTime(LocalDateTime.now());
         }
-        applicationForm.setReceiveMinutes(Double.valueOf(DateUtils.getDurationMinutesStr(applicationForm.getApplyTime(), applicationForm.getRepairStartTime())));
+        applicationForm.setReceiveMinutes(DateUtils.getDurationHours(applicationForm.getApplyTime(), applicationForm.getRepairStartTime()));
 
         // 根据配置判断维修是否超时
         String minuteStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_WARN_MINUTE.name());
@@ -619,7 +619,9 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
     /**
      * 完成为待验收状态,此时需要再次编辑维修内容,最终提交审核
      * 完成同时将设备状态为使用中
-     *
+     *  需要记录
+     *  1:维修时间=维修结束-维修开始
+     *  2:停机时间=维修结束-报修开始
      * @param dto
      */
     @Override
@@ -638,8 +640,8 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
             applicationForm.setRepairEndTime(dto.getRepairEndTime());
         }
 
-        applicationForm.setRepairMinutes(Double.valueOf(DateUtils.getDurationMinutes(applicationForm.getRepairStartTime(), applicationForm.getRepairEndTime())));
-        applicationForm.setDealMinutes(Double.valueOf(DateUtils.getDurationMinutes(applicationForm.getApplyTime(), applicationForm.getRepairEndTime())));
+        applicationForm.setRepairMinutes(DateUtils.getDurationHours(applicationForm.getRepairStartTime(), applicationForm.getRepairEndTime()));
+        applicationForm.setDealMinutes(DateUtils.getDurationHours(applicationForm.getApplyTime(), applicationForm.getRepairEndTime()));
 
         // 根据配置判断维修是否超时
         String hourFirstStr = ConfigCache.getLabelByValueAllowNull(SysConfigEnum.REPAIR_OVERTIME_MINUTE_FIRST.name());