From 4229657c5b6be8a1da9e59a40e2426cf6b0995c2 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 25 十月 2026 12:01:55 +0800
Subject: [PATCH] feat(hrm): 新增人事管理模块功能
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/reel/ProductCtcReelController.java | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/reel/ProductCtcReelController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/reel/ProductCtcReelController.java
index 8dca240..923cee6 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/reel/ProductCtcReelController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pd/reel/ProductCtcReelController.java
@@ -5,6 +5,9 @@
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.mes.controller.admin.pd.reel.vo.ProductCtcReelImportExcelVO;
+import cn.iocoder.yudao.module.mes.controller.admin.pd.reel.vo.ProductCtcReelImportRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pd.reel.vo.ProductCtcReelPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.pd.reel.vo.ProductCtcReelRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pd.reel.vo.ProductCtcReelSaveReqVO;
@@ -14,13 +17,17 @@
import cn.iocoder.yudao.module.mes.service.pd.reel.ProductCtcReelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -94,6 +101,34 @@
return success(buildReelRespVOList(list));
}
+ @GetMapping("/get-import-template")
+ @Operation(summary = "鑾峰緱鐩樺叿璁$畻璁板綍瀵煎叆妯℃澘")
+ public void importTemplate(HttpServletResponse response) throws IOException {
+ List<ProductCtcReelImportExcelVO> list = Collections.singletonList(
+ ProductCtcReelImportExcelVO.builder()
+ .ctcOrderSpec("QQNB-2/120").reelType("鏈ㄧ洏")
+ .reelOuterDiameter(new java.math.BigDecimal("1200")).reelInnerDiameter(new java.math.BigDecimal("630"))
+ .reelWidth(new java.math.BigDecimal("850")).maxCapacity(new java.math.BigDecimal("3"))
+ .recommendedLength(new java.math.BigDecimal("2.5")).netWeight(new java.math.BigDecimal("180"))
+ .grossWeight(new java.math.BigDecimal("200")).calcFormula("").remark("").build()
+ );
+ ExcelUtils.write(response, "鐩樺叿璁$畻璁板綍瀵煎叆妯℃澘.xls", "鐩樺叿璁$畻璁板綍鍒楄〃", ProductCtcReelImportExcelVO.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:pd-ctc-reel:import')")
+ public CommonResult<ProductCtcReelImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
+ @RequestParam(value = "updateSupport", required = false,
+ defaultValue = "false") Boolean updateSupport) throws Exception {
+ List<ProductCtcReelImportExcelVO> list = ExcelUtils.read(file, ProductCtcReelImportExcelVO.class);
+ return success(reelService.importReelList(list, updateSupport));
+ }
+
// ==================== 鎷兼帴 VO ====================
private List<ProductCtcReelRespVO> buildReelRespVOList(List<ProductCtcReelDO> list) {
--
Gitblit v1.9.3