lyh
2025-07-10 c1e82be9145431e0f15cbb7cdab4af702cbffc3c
台账导入 导入模板
已修改8个文件
112 ■■■■■ 文件已修改
db/template/生产设备三级保养规范.docx 补丁 | 查看 | 原始文档 | blame | 历史
db/template/生产设备二级保养规范.docx 补丁 | 查看 | 原始文档 | blame | 历史
db/template/设备台账导入模板.xls 补丁 | 查看 | 原始文档 | blame | 历史
db/template/设备点检标准导入模板.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
db/template/Éú²úÉ豸Èý¼¶±£Ñø¹æ·¶.docx
Binary files differ
db/template/Éú²úÉ豸¶þ¼¶±£Ñø¹æ·¶.docx
Binary files differ
db/template/É豸̨Õ˵¼ÈëÄ£°å.xls
Binary files differ
db/template/É豸µã¼ì±ê×¼µ¼ÈëÄ£°å.xlsx
Binary files differ
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamEquipmentDto.java
@@ -92,7 +92,7 @@
    /**
     * æ‰€å±žåˆ†ç±»
     */
    @Excel(name = "所属分类", width = 15, orderNum = "5")
    @Excel(name = "所属分类", width = 15, orderNum = "5",dicCode = "equipment_category")
    @ApiModelProperty(value = "所属分类")
    @Dict(dicCode = "equipment_category")
    private String equipmentCategory;
@@ -296,7 +296,7 @@
    /**
     * è´¨ä¿å¼€å§‹æ—¥æœŸ
     */
    @Excel(name = "质保开始日期", width = 15, orderNum = "36")
    @Excel(name = "质保开始日期", width = 15, format = "yyyy/MM/dd", orderNum = "36")
    @ApiModelProperty(value = "质保开始日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -305,7 +305,7 @@
    /**
     * è´¨ä¿ç»“束日期
     */
    @Excel(name = "质保结束日期", width = 15, orderNum = "37")
    @Excel(name = "质保结束日期", width = 15, format = "yyyy/MM/dd", orderNum = "37")
    @ApiModelProperty(value = "质保结束日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -321,7 +321,7 @@
    /**最新二保日期*/
    @TableField(exist = false)
    @Excel(name = "最新二保日期", width = 15, orderNum = "39")
    @Excel(name = "最新二保日期", width = 15, format = "yyyy/MM/dd", orderNum = "39")
    @ApiModelProperty(value = "最新二保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -329,7 +329,7 @@
    /**下次二保日期*/
    @TableField(exist = false)
    @Excel(name = "下次二保日期", width = 15, orderNum = "40")
    @Excel(name = "下次二保日期", width = 15, format = "yyyy/MM/dd", orderNum = "40")
    @ApiModelProperty(value = "下次二保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -338,7 +338,7 @@
    /**本次三保日期*/
    @TableField(exist = false)
    @Excel(name = "本次三保日期", width = 15, orderNum = "41")
    @Excel(name = "本次三保日期", width = 15, format = "yyyy/MM/dd", orderNum = "41")
    @ApiModelProperty(value = "本次三保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -346,7 +346,7 @@
    /**下次三保日期*/
    @TableField(exist = false)
    @Excel(name = "下次三保日期", width = 15, orderNum = "42")
    @Excel(name = "下次三保日期", width = 15, format = "yyyy/MM/dd", orderNum = "42")
    @ApiModelProperty(value = "下次三保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -360,14 +360,14 @@
    /**最新技术状态鉴定日期*/
    @TableField(exist = false)
    @Excel(name = "最新技术状态鉴定日期", width = 15, orderNum = "44")
    @Excel(name = "最新技术状态鉴定日期", width = 15, format = "yyyy/MM/dd", orderNum = "44")
    @ApiModelProperty(value = "最新技术状态鉴定日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private java.util.Date latestTechnologyCheck;
    /**技术状态下次鉴定日期*/
    @TableField(exist = false)
    @Excel(name = "技术状态下次鉴定日期", width = 15, orderNum = "45")
    @Excel(name = "技术状态下次鉴定日期", width = 15, format = "yyyy/MM/dd", orderNum = "45")
    @ApiModelProperty(value = "技术状态下次鉴定日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamEquipment.java
@@ -126,7 +126,7 @@
    /**
     * æ‰€å±žåˆ†ç±»
     */
    @Excel(name = "所属分类", width = 15, orderNum = "5")
    @Excel(name = "所属分类", width = 15, orderNum = "5",dicCode = "equipment_category")
    @ApiModelProperty(value = "所属分类")
    @Dict(dicCode = "equipment_category")
    private String equipmentCategory;
@@ -331,7 +331,7 @@
    /**
     * è´¨ä¿å¼€å§‹æ—¥æœŸ
     */
    @Excel(name = "质保开始日期", width = 15, orderNum = "36")
    @Excel(name = "质保开始日期",  width = 25, format = "yyyy/MM/dd",  orderNum = "36")
    @ApiModelProperty(value = "质保开始日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -340,7 +340,7 @@
    /**
     * è´¨ä¿ç»“束日期
     */
    @Excel(name = "质保结束日期", width = 15, orderNum = "37")
    @Excel(name = "质保结束日期", width = 15, format = "yyyy/MM/dd", orderNum = "37")
    @ApiModelProperty(value = "质保结束日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -356,7 +356,7 @@
    /**最新二保日期*/
    @TableField(exist = false)
    @Excel(name = "最新二保日期", width = 15, orderNum = "39")
    @Excel(name = "最新二保日期", width = 15, format = "yyyy/MM/dd", orderNum = "39")
    @ApiModelProperty(value = "最新二保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -364,7 +364,7 @@
    /**下次二保日期*/
    @TableField(exist = false)
    @Excel(name = "下次二保日期", width = 15, orderNum = "40")
    @Excel(name = "下次二保日期", width = 15, format = "yyyy/MM/dd", orderNum = "40")
    @ApiModelProperty(value = "下次二保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -373,7 +373,7 @@
    /**本次三保日期*/
    @TableField(exist = false)
    @Excel(name = "本次三保日期", width = 15, orderNum = "41")
    @Excel(name = "本次三保日期", width = 15,  format = "yyyy/MM/dd",orderNum = "41")
    @ApiModelProperty(value = "本次三保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -381,7 +381,7 @@
    /**下次三保日期*/
    @TableField(exist = false)
    @Excel(name = "下次三保日期", width = 15, orderNum = "42")
    @Excel(name = "下次三保日期", width = 15, format = "yyyy/MM/dd", orderNum = "42")
    @ApiModelProperty(value = "下次三保日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
@@ -395,14 +395,14 @@
    /**最新技术状态鉴定日期*/
    @TableField(exist = false)
    @Excel(name = "最新技术状态鉴定日期", width = 15, orderNum = "44")
    @Excel(name = "最新技术状态鉴定日期", width = 15, format = "yyyy/MM/dd", orderNum = "44")
    @ApiModelProperty(value = "最新技术状态鉴定日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private java.util.Date latestTechnologyCheck;
    /**技术状态下次鉴定日期*/
    @TableField(exist = false)
    @Excel(name = "技术状态下次鉴定日期", width = 15, orderNum = "45")
    @Excel(name = "技术状态下次鉴定日期", width = 15, format = "yyyy/MM/dd", orderNum = "45")
    @ApiModelProperty(value = "技术状态下次鉴定日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
@@ -303,6 +303,9 @@
                        sb.append(String.format("设备编码[%s]保存失败,无法导入\n\r", eamEquipment.getEquipmentCode()));
                        continue;
                    }
                    EamEquipmentExtend eamEquipmentExtend=new EamEquipmentExtend();
                    BeanUtils.copyProperties(eamEquipmentExtend,equipment);
                    eamEquipmentExtendService.save(eamEquipmentExtend);
                }
                log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
                //update-end-author:taoyan date:20190528 for:批量插入数据
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamMaintenanceStandardController.java
@@ -30,6 +30,7 @@
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
 * @Description: ä¿å…»æ ‡å‡†
@@ -232,15 +233,17 @@
    @DeleteMapping(value = "/deleteBatch")
    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        List<String> list = Arrays.asList(ids.split(","));
        AtomicInteger i = new AtomicInteger();
        list.forEach(id -> {
            EamMaintenanceStandard entity = eamMaintenanceStandardService.getById(id);
            if (entity != null&&entity.getStandardStatus().equals(MaintenanceStandardStatusEnum.WAIT_SUBMIT.name())) {
                //只删除状态为待提交的
                i.getAndIncrement();
                entity.setDelFlag(CommonConstant.DEL_FLAG_1);
                eamMaintenanceStandardService.updateById(entity);
            }
        });
        return Result.OK("批量删除成功!");
        return Result.OK("批量删除成功,已删除状态为待提交的保养标准,删除数量为"+i);
    }
    /**
@@ -282,18 +285,18 @@
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                MultipartFile file = entity.getValue();
                file.getOriginalFilename();
                return eamMaintenanceStandardService.importPointInspectionExcel(file);
                String fileName = file.getOriginalFilename();
                Result<?> importResult=eamMaintenanceStandardService.importPointInspectionExcel(file);
                if (importResult.isSuccess()) {
                    successCount++;
                } else {
                    results.put(fileName, importResult.getMessage());
                    failureCount++;
                }
            }
            // æž„建响应
            Map<String, Object> response = new HashMap<>();
            response.put("results", results);
            response.put("totalFiles", fileMap.size());
            response.put("successCount", successCount);
            response.put("failureCount", failureCount);
            return Result.ok("导入完成" + response);
            // æž„建最终响应
            return getResult(results, fileMap.size(), successCount, failureCount);
        } catch (Exception e) {
            log.error("点检导入处理异常", e);
@@ -318,18 +321,18 @@
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                MultipartFile file = entity.getValue();
                file.getOriginalFilename();
                return eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND");
                String fileName = file.getOriginalFilename();
                Result<?> importResult=eamMaintenanceStandardService.importMaintenanceStandard(file, "SECOND");
                if (importResult.isSuccess()) {
                    successCount++;
                } else {
                    results.put(fileName, importResult.getMessage());
                    failureCount++;
                }
            }
            // æž„建最终响应
            Map<String, Object> response = new HashMap<>();
            response.put("results", results);
            response.put("totalFiles", fileMap.size());
            response.put("successCount", successCount);
            response.put("failureCount", failureCount);
            return Result.ok("导入完成"+response);
            return getResult(results, fileMap.size(), successCount, failureCount);
        } catch (Exception e) {
            log.error("导入处理异常", e);
@@ -353,18 +356,18 @@
            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                MultipartFile file = entity.getValue();
                file.getOriginalFilename();
                return eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD");
                String fileName = file.getOriginalFilename();
                Result<?> importResult= eamMaintenanceStandardService.importMaintenanceStandard(file, "THIRD");
                if (importResult.isSuccess()) {
                    successCount++;
                } else {
                    results.put(fileName, importResult.getMessage());
                    failureCount++;
                }
            }
            // æž„建最终响应
            Map<String, Object> response = new HashMap<>();
            response.put("results", results);
            response.put("totalFiles", fileMap.size());
            response.put("successCount", successCount);
            response.put("failureCount", failureCount);
            return Result.ok("导入完成"+response);
            return getResult(results, fileMap.size(), successCount, failureCount);
        } catch (Exception e) {
            log.error("导入处理异常", e);
@@ -372,4 +375,16 @@
        }
    }
    private Result<?> getResult(Map<String, String> results, int fileCount, int successCount, int failureCount) {
        List<String> response = new ArrayList<>();
        response.add("总文件数:" + fileCount);
        response.add("成功数:" + successCount);
        response.add("失败数:" + failureCount);
        if (failureCount > 0) {
            response.add("错误信息:" + results.values());
            return Result.error("部分文件导入失败:" + response);
        }
        return Result.ok("所有文件导入成功:" + response);
    }
}