From 6e3d8e950e7dec3551bee3512673e1fc2d384d2b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期日, 18 十月 2026 20:25:55 +0800
Subject: [PATCH] fix(mes): 修复能耗抄表控制器启动时的 bean 名称冲突
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java
index 39761d1..a5f7db6 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java
@@ -37,6 +37,10 @@
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
+import org.springframework.web.multipart.MultipartFile;
+import io.swagger.v3.oas.annotations.Parameters;
+import cn.iocoder.yudao.module.mes.controller.admin.dv.checkrecord.vo.MesDvCheckRecordImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.dv.checkrecord.vo.MesDvCheckRecordImportRespVO;
@Tag(name = "绠$悊鍚庡彴 - MES 璁惧鐐规璁板綍")
@RestController
@@ -147,4 +151,34 @@
});
}
+
+ @GetMapping("/get-import-template")
+ @Operation(summary = "鑾峰緱璁惧鐐规璁板綍瀵煎叆妯℃澘")
+ public void importTemplate(HttpServletResponse response) throws IOException {
+ // 鎵嬪姩鍒涘缓瀵煎嚭 demo
+ List<MesDvCheckRecordImportExcelVO> list = Collections.singletonList(
+ MesDvCheckRecordImportExcelVO.builder()
+ .machineryCode("MC-001").planCode("CP-001")
+ .checkTime(java.time.LocalDateTime.of(2026, 12, 31, 8, 0))
+ .userId(1L).remark("")
+ .build()
+ );
+ // 杈撳嚭
+ ExcelUtils.write(response, "璁惧鐐规璁板綍瀵煎叆妯℃澘.xls", "璁惧鐐规璁板綍鍒楄〃", MesDvCheckRecordImportExcelVO.class, list);
+ }
+
+ @PostMapping("/import")
+ @Operation(summary = "瀵煎叆璁惧鐐规璁板綍")
+ @Parameters({
+ @Parameter(name = "file", description = "Excel 鏂囦欢", required = true),
+ @Parameter(name = "updateSupport", description = "鏄惁鏀寔鏇存柊锛岄粯璁や负 false", example = "true")
+ })
+ @PreAuthorize("@ss.hasPermission('mes:dv-check-record:import')")
+ public CommonResult<MesDvCheckRecordImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
+ @RequestParam(value = "updateSupport", required = false,
+ defaultValue = "false") Boolean updateSupport) throws Exception {
+ List<MesDvCheckRecordImportExcelVO> list = ExcelUtils.read(file, MesDvCheckRecordImportExcelVO.class);
+ return success(checkRecordService.importCheckRecordList(list, updateSupport));
+ }
+
}
--
Gitblit v1.9.3