From 9075785a9e14f6220783d052d231f915c6930b87 Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期三, 04 十一月 2026 10:21:45 +0800
Subject: [PATCH] revert(collect): 撤销 collect 数采模块(新高设备管理已有自己的采集方式)
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/checkrecord/MesDvCheckRecordController.java | 36 ++++++++++++++++++++++++++++++++++--
1 files changed, 34 insertions(+), 2 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..55598d6 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
@@ -90,7 +94,6 @@
@GetMapping("/get")
@Operation(summary = "鑾峰緱璁惧鐐规璁板綍")
@Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
- @PreAuthorize("@ss.hasPermission('mes:dv-check-record:query')")
public CommonResult<MesDvCheckRecordRespVO> getCheckRecord(@RequestParam("id") Long id) {
MesDvCheckRecordDO checkRecord = checkRecordService.getCheckRecord(id);
if (checkRecord == null) {
@@ -101,7 +104,6 @@
@GetMapping("/page")
@Operation(summary = "鑾峰緱璁惧鐐规璁板綍鍒嗛〉")
- @PreAuthorize("@ss.hasPermission('mes:dv-check-record:query')")
public CommonResult<PageResult<MesDvCheckRecordRespVO>> getCheckRecordPage(@Valid MesDvCheckRecordPageReqVO pageReqVO) {
PageResult<MesDvCheckRecordDO> pageResult = checkRecordService.getCheckRecordPage(pageReqVO);
return success(new PageResult<>(buildCheckRecordRespVOList(pageResult.getList()), pageResult.getTotal()));
@@ -147,4 +149,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.writeTemplate(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