From a84ca213053bb61486f37539efac5a1f500e246f Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期五, 20 六月 2025 11:32:29 +0800
Subject: [PATCH] 设备管理-设备采购计划及附件

---
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/util/ExcelUtils.java                            |   51 ++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentPurchasePlanMapper.xml          |    5 
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentPurchasePlanController.java     |  414 +++++++++++++++++++++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentPurchasePlan.java                   |  132 ++++++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamPurchasePlanAttachmentServiceImpl.java |   62 +++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentPurchasePlanMapper.java             |   17 
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentPurchasePlanService.java          |   15 
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamPurchasePlanAttachmentMapper.java            |   17 
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamPurchasePlanAttachmentRequest.java          |   33 +
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamPurchasePlanAttachmentService.java         |   20 +
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentPurchasePlanServiceImpl.java  |   33 +
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentPurchasePlanStatusEnum.java   |   32 +
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamPurchasePlanAttachmentController.java    |  182 +++++++++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamPurchasePlanAttachment.java                  |   83 ++++
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamPurchasePlanAttachmentMapper.xml         |    5 
 15 files changed, 1,101 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentPurchasePlanStatusEnum.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentPurchasePlanStatusEnum.java
new file mode 100644
index 0000000..66afe5a
--- /dev/null
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentPurchasePlanStatusEnum.java
@@ -0,0 +1,32 @@
+package org.jeecg.modules.eam.constant;
+
+import lombok.Getter;
+
+/**
+ * 璁惧閲囪喘璁″垝鐘舵��
+ */
+@Getter
+public enum EquipmentPurchasePlanStatusEnum {
+    NEWLY("鏂板缓"),//鏂板缓
+    PENDING_AUDIT("寰呭鏍�"),//寰呭鏍�
+    COMPLETED("宸插畬鎴�"), //宸插畬鎴�
+    REJECT("椹冲洖"); //椹冲洖
+
+    private final String zhName;
+
+    EquipmentPurchasePlanStatusEnum(String zhName) {
+        this.zhName = zhName;
+    }
+
+    /**
+     * 鏍规嵁涓枃鍚嶈幏鍙栨灇涓�
+     */
+    public static EquipmentPurchasePlanStatusEnum fromZhName(String zhName) {
+        for (EquipmentPurchasePlanStatusEnum e : values()) {
+            if (e.getZhName().equals(zhName)) {
+                return e;
+            }
+        }
+        return null;
+    }
+}
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/util/ExcelUtils.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/util/ExcelUtils.java
new file mode 100644
index 0000000..87ce100
--- /dev/null
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/util/ExcelUtils.java
@@ -0,0 +1,51 @@
+package org.jeecg.modules.eam.util;
+
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
+import org.apache.poi.ss.usermodel.DateUtil;
+import org.apache.poi.ss.usermodel.Row;
+
+import java.text.SimpleDateFormat;
+
+public class ExcelUtils {
+    // 杈呭姪鏂规硶锛氭牴鎹崟鍏冩牸绫诲瀷瀹夊叏鍦拌幏鍙栧瓧绗︿覆鍊�
+    public static String getCellValueAsString(Cell cell) {
+        if (cell == null) {
+            return null;
+        }
+        switch (cell.getCellType()) {
+            case STRING:
+                return cell.getStringCellValue();
+            case NUMERIC:
+                if (DateUtil.isCellDateFormatted(cell)) {
+                    // 濡傛灉鏄棩鏈熸牸寮忥紝杩斿洖鏃ユ湡瀛楃涓�
+                    return new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
+                } else {
+                    // 鍚﹀垯杩斿洖鏁板�肩殑瀛楃涓插舰寮�
+                    return String.valueOf(cell.getNumericCellValue());
+                }
+            case BOOLEAN:
+                return String.valueOf(cell.getBooleanCellValue());
+            case FORMULA:
+                try {
+                    return String.valueOf(cell.getNumericCellValue()); // 灏濊瘯瑙f瀽鍏紡缁撴灉
+                } catch (Exception e) {
+                    return String.valueOf(cell.getStringCellValue()); // 濡傛灉鍏紡缁撴灉涓哄瓧绗︿覆
+                }
+            default:
+                return "";
+        }
+    }
+
+    // 鍒ゆ柇鏌愪竴琛屾槸鍚﹀叏涓虹┖(鏈夋晥鏁版嵁琛屽垽鏂�)
+    public static boolean isRowEmpty(Row row) {
+        if (row == null) return true;
+        for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) {
+            Cell cell = row.getCell(c);
+            if (cell != null && cell.getCellType() != CellType.BLANK) {
+                return false;
+            }
+        }
+        return true;
+    }
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentPurchasePlanController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentPurchasePlanController.java
new file mode 100644
index 0000000..a1b62a4
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentPurchasePlanController.java
@@ -0,0 +1,414 @@
+package org.jeecg.modules.eam.controller;
+
+import java.io.File;
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.*;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import org.apache.commons.lang3.time.DateUtils;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.PmsUtil;
+import org.jeecg.common.util.StrUtils;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.eam.constant.EquipmentPurchasePlanStatusEnum;
+import org.jeecg.modules.eam.entity.EamEquipmentPurchasePlan;
+import org.jeecg.modules.eam.service.IEamEquipmentPurchasePlanService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecg.modules.eam.util.ExcelUtils;
+import org.jeecg.modules.system.entity.MdcProduction;
+import org.jeecg.modules.system.entity.SysUser;
+import org.jeecg.modules.system.service.IMdcProductionService;
+import org.jeecg.modules.system.service.ISysBusinessCodeRuleService;
+import org.jeecg.modules.system.service.ISysUserService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: eam_equipment_purchase_plan
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Api(tags="eam_equipment_purchase_plan")
+@RestController
+@RequestMapping("/eam/eamEquipmentPurchasePlan")
+@Slf4j
+public class EamEquipmentPurchasePlanController extends JeecgController<EamEquipmentPurchasePlan, IEamEquipmentPurchasePlanService> {
+	@Autowired
+	private IEamEquipmentPurchasePlanService eamEquipmentPurchasePlanService;
+	@Autowired
+	private ISysUserService sysUserService;
+	@Autowired
+	private IMdcProductionService mdcProductionService;
+	@Autowired
+	private ISysBusinessCodeRuleService sysBusinessCodeRuleService;
+	
+	/**
+	 * 鍒嗛〉鍒楄〃鏌ヨ
+	 *
+	 * @param eamEquipmentPurchasePlan
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "eam_equipment_purchase_plan-鍒嗛〉鍒楄〃鏌ヨ")
+	@ApiOperation(value="eam_equipment_purchase_plan-鍒嗛〉鍒楄〃鏌ヨ", notes="eam_equipment_purchase_plan-鍒嗛〉鍒楄〃鏌ヨ")
+	@GetMapping(value = "/list")
+	public Result<IPage<EamEquipmentPurchasePlan>> queryPageList(EamEquipmentPurchasePlan eamEquipmentPurchasePlan,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<EamEquipmentPurchasePlan> queryWrapper = QueryGenerator.initQueryWrapper(eamEquipmentPurchasePlan, req.getParameterMap());
+		Page<EamEquipmentPurchasePlan> page = new Page<EamEquipmentPurchasePlan>(pageNo, pageSize);
+		IPage<EamEquipmentPurchasePlan> pageList = eamEquipmentPurchasePlanService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   娣诲姞
+	 *
+	 * @param eamEquipmentPurchasePlan
+	 * @return
+	 */
+	@AutoLog(value = "eam_equipment_purchase_plan-娣诲姞")
+	@ApiOperation(value="eam_equipment_purchase_plan-娣诲姞", notes="eam_equipment_purchase_plan-娣诲姞")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody EamEquipmentPurchasePlan eamEquipmentPurchasePlan) {
+		eamEquipmentPurchasePlanService.savePurchasePlan(eamEquipmentPurchasePlan);
+		return Result.OK("娣诲姞鎴愬姛锛�");
+	}
+	
+	/**
+	 *  缂栬緫
+	 *
+	 * @param eamEquipmentPurchasePlan
+	 * @return
+	 */
+	@AutoLog(value = "eam_equipment_purchase_plan-缂栬緫")
+	@ApiOperation(value="eam_equipment_purchase_plan-缂栬緫", notes="eam_equipment_purchase_plan-缂栬緫")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody EamEquipmentPurchasePlan eamEquipmentPurchasePlan) {
+		eamEquipmentPurchasePlanService.updateById(eamEquipmentPurchasePlan);
+		return Result.OK("缂栬緫鎴愬姛!");
+	}
+
+	@AutoLog(value = "eam_equipment_purchase_plan-鎻愪氦")
+	@ApiOperation(value="eam_equipment_purchase_plan-鎻愪氦", notes = "eam_equipment_purchase_plan-鎻愪氦")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:submit")
+	@GetMapping(value = "/submit")
+	public Result<String> submit(@RequestParam("id") String id) {
+		EamEquipmentPurchasePlan plan = eamEquipmentPurchasePlanService.getById(id);
+		if (Objects.isNull(plan) || !EquipmentPurchasePlanStatusEnum.NEWLY.name().equals(plan.getPlanStatus())) {
+			return Result.error("閲囪喘璁″垝涓嶅瓨鍦�/璁″垝宸叉彁浜わ紒");
+		}
+		plan.setPlanStatus(EquipmentPurchasePlanStatusEnum.PENDING_AUDIT.name());
+		eamEquipmentPurchasePlanService.updateById(plan);
+		return Result.OK("鎻愪氦鎴愬姛!");
+	}
+
+	@AutoLog(value = "eam_equipment_purchase_plan-瀹℃牳")
+	@ApiOperation(value="eam_equipment_purchase_plan-瀹℃牳", notes = "eam_equipment_purchase_plan-瀹℃牳")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:audit")
+	@RequestMapping(value = "/audit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> audit(@RequestBody EamEquipmentPurchasePlan request) {
+		EamEquipmentPurchasePlan plan = eamEquipmentPurchasePlanService.getById(request.getId());
+		if (Objects.isNull(plan)) {
+			return Result.error("閲囪喘璁″垝涓嶅瓨鍦紒");
+		}
+		if (!EquipmentPurchasePlanStatusEnum.PENDING_AUDIT.name().equals(plan.getPlanStatus())) {
+			return Result.error("璁″垝鏈彁浜ゆ垨宸插鏍革紒");
+		}
+		if (EquipmentPurchasePlanStatusEnum.COMPLETED.name().equals(request.getPlanStatus())) {
+			plan.setPlanStatus(EquipmentPurchasePlanStatusEnum.COMPLETED.name());
+		}
+		if (EquipmentPurchasePlanStatusEnum.REJECT.name().equals(request.getPlanStatus())) {
+			//濡傛灉椹冲洖锛岀姸鎬佹敼涓烘柊寤猴紝閲嶆柊鎻愪氦瀹℃牳
+			plan.setPlanStatus(EquipmentPurchasePlanStatusEnum.NEWLY.name());
+		}
+		eamEquipmentPurchasePlanService.updateById(plan);
+		return Result.OK("瀹℃牳鎴愬姛!");
+	}
+	
+	/**
+	 *   閫氳繃id鍒犻櫎
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "eam_equipment_purchase_plan-閫氳繃id鍒犻櫎")
+	@ApiOperation(value="eam_equipment_purchase_plan-閫氳繃id鍒犻櫎", notes="eam_equipment_purchase_plan-閫氳繃id鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		eamEquipmentPurchasePlanService.removeById(id);
+		return Result.OK("鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 *  鎵归噺鍒犻櫎
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "eam_equipment_purchase_plan-鎵归噺鍒犻櫎")
+	@ApiOperation(value="eam_equipment_purchase_plan-鎵归噺鍒犻櫎", notes="eam_equipment_purchase_plan-鎵归噺鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.eamEquipmentPurchasePlanService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("鎵归噺鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 * 閫氳繃id鏌ヨ
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "eam_equipment_purchase_plan-閫氳繃id鏌ヨ")
+	@ApiOperation(value="eam_equipment_purchase_plan-閫氳繃id鏌ヨ", notes="eam_equipment_purchase_plan-閫氳繃id鏌ヨ")
+	@GetMapping(value = "/queryById")
+	public Result<EamEquipmentPurchasePlan> queryById(@RequestParam(name="id",required=true) String id) {
+		EamEquipmentPurchasePlan eamEquipmentPurchasePlan = eamEquipmentPurchasePlanService.getById(id);
+		if(eamEquipmentPurchasePlan==null) {
+			return Result.error("鏈壘鍒板搴旀暟鎹�");
+		}
+		return Result.OK(eamEquipmentPurchasePlan);
+	}
+
+    /**
+    * 瀵煎嚭excel
+    *
+    * @param request
+    * @param eamEquipmentPurchasePlan
+    */
+    //@RequiresPermissions("org.jeecg.modules:eam_equipment_purchase_plan:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, EamEquipmentPurchasePlan eamEquipmentPurchasePlan) {
+        return super.exportXls(request, eamEquipmentPurchasePlan, EamEquipmentPurchasePlan.class, "璁惧閲囪喘璁″垝");
+    }
+
+    /**
+      * 閫氳繃excel瀵煎叆鏁版嵁
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("eam_equipment_purchase_plan:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+		Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+		int successLines = 0,dataLines = 0;
+		List<String> errorMessage = CollectionUtil.newArrayList();
+		List<EamEquipmentPurchasePlan> importList = CollectionUtil.newArrayList();
+        try {
+            for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+                // 鑾峰彇涓婁紶鏂囦欢瀵硅薄
+                MultipartFile file = entity.getValue();
+                InputStream inputStream = file.getInputStream();
+				Workbook workbook = WorkbookFactory.create(inputStream);
+                Sheet sheet = workbook.getSheetAt(0);
+				for (Row row : sheet) {
+					EamEquipmentPurchasePlan plan = new EamEquipmentPurchasePlan();
+					int rowNum = row.getRowNum();
+					int currentRowNum  = rowNum + 1;
+					if (rowNum < 3 || ExcelUtils.isRowEmpty(row)) {
+						//璺宠繃琛ㄥご鍜岀┖琛�
+						continue;
+					}
+					dataLines++;
+					Cell cell0 = row.getCell(0);
+					if (cell0 == null || cell0.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗�" + currentRowNum + "琛岄噰璐鍒掑悕绉颁负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setPlanName(ExcelUtils.getCellValueAsString(cell0));
+					}
+					Cell cell1 = row.getCell(1);
+					if (cell1 == null || cell1.getCellType() == CellType.BLANK) {
+						//濡傛灉璁″垝鐘舵�佷负绌猴紝榛樿缁� 鏂板缓 鐘舵��
+						plan.setPlanStatus(EquipmentPurchasePlanStatusEnum.NEWLY.name());
+					} else {
+						String statusZh = ExcelUtils.getCellValueAsString(cell1).trim();
+						EquipmentPurchasePlanStatusEnum planStatusEnum = EquipmentPurchasePlanStatusEnum.fromZhName(statusZh);
+						if (Objects.isNull(planStatusEnum)) {
+							errorMessage.add("绗� " + currentRowNum + " 琛岃鍒掔姸鎬佷笉鍚堟硶锛屾棤娉曞鍏ワ紝璇蜂娇鐢� [鏂板缓, 寰呭鏍�, 宸插畬鎴怾 涓殑涓�涓��");
+							continue;
+						}
+						plan.setPlanStatus(planStatusEnum.name());
+					}
+					Cell cell2 = row.getCell(2);
+					if (cell2 == null || cell2.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛屽瀷鍙蜂负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setEquipmentModel(ExcelUtils.getCellValueAsString(cell2));
+					}
+					Cell cell3 = row.getCell(3);
+					if (cell3 == null || cell3.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岄噰璐暟閲忎负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setPurchaseNumber(Integer.valueOf(ExcelUtils.getCellValueAsString(cell3)));
+					}
+					Cell cell4 = row.getCell(4);
+					if (cell4 == null || cell4.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岄璁″崟浠蜂负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setEstimatedUnitPrice(new BigDecimal(ExcelUtils.getCellValueAsString(cell4)));
+					}
+					Cell cell5 = row.getCell(5);
+					if (cell5 == null || cell5.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛屾�讳环涓虹┖锛屾棤娉曞鍏�");
+						continue;
+					} else {
+						plan.setTotalPrice(new BigDecimal(ExcelUtils.getCellValueAsString(cell5)));
+					}
+					Cell cell6 = row.getCell(6);
+					if (cell6 == null || cell6.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛屽悎鍚屾�婚噾棰濅负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setOverallContractAmount(new BigDecimal(ExcelUtils.getCellValueAsString(cell6)));
+					}
+					Cell cell7 = row.getCell(7);
+					if (cell7 == null || cell7.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岀鐞嗗垎绫讳负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						plan.setEquipmentImportance(ExcelUtils.getCellValueAsString(cell7));
+					}
+					Cell cell8 = row.getCell(8);
+					if (cell8 == null || cell8.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岀敵璇蜂汉涓虹┖锛屾棤娉曞鍏�");
+						continue;
+					} else {
+						String username = ExcelUtils.getCellValueAsString(cell8);
+						SysUser sysUser = sysUserService.getUserByName(username);
+						if (sysUser == null) {
+							errorMessage.add("绗� " + currentRowNum + " 琛岀敵璇蜂汉涓嶅瓨鍦紝鏃犳硶瀵煎叆");
+							continue;
+						}
+						plan.setPlanCategory(username);
+					}
+					Cell cell9 = row.getCell(9);
+					if (cell9 == null || cell9.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岀敵璇疯溅闂翠负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						String productionName = ExcelUtils.getCellValueAsString(cell9);
+						boolean present = mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>()
+								.eq(MdcProduction::getProductionName, productionName)
+								.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0))
+								.stream().findAny().isPresent();
+						if (!present) {
+							errorMessage.add("绗� " + currentRowNum + " 琛岀敵璇疯溅闂翠笉瀛樺湪锛屾棤娉曞鍏�");
+							continue;
+						}
+						plan.setApplicantProduction(productionName);
+					}
+					Cell cell10 = row.getCell(10);
+					if (cell10 == null || cell10.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岃鍒掑紑濮嬫棩鏈熶负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						String planStartDateStr = ExcelUtils.getCellValueAsString(cell10);
+                        try {
+							Date date = DateUtils.parseDate(planStartDateStr, "yyyy/MM/dd HH", "yyyy/MM/dd", "yyyy-MM-dd HH", "yyyy-MM-dd");
+							plan.setPlanStartDate(date);
+						} catch (ParseException e) {
+							errorMessage.add("绗� " + currentRowNum + " 琛岃鍒掑紑濮嬫棩鏈熸牸寮忛敊璇紝鏃犳硶瀵煎叆锛岃浣跨敤 yyyy-MM-dd 鏍煎紡");
+							continue;
+                        }
+					}
+					Cell cell11 = row.getCell(11);
+					if (cell11 == null || cell11.getCellType() == CellType.BLANK) {
+						errorMessage.add("绗� " + currentRowNum + " 琛岃鍒掑畬鎴愭椂闂翠负绌猴紝鏃犳硶瀵煎叆");
+						continue;
+					} else {
+						String planEndDateStr = ExcelUtils.getCellValueAsString(cell11);
+                        try {
+							Date date = DateUtils.parseDate(planEndDateStr, "yyyy/MM/dd HH", "yyyy/MM/dd", "yyyy-MM-dd HH", "yyyy-MM-dd");
+							plan.setPlanEndDate(date);
+						} catch (ParseException e) {
+							errorMessage.add("绗� " + currentRowNum + " 琛岃鍒掑畬鎴愭棩鏈熸牸寮忛敊璇紝鏃犳硶瀵煎叆锛岃浣跨敤 yyyy-MM-dd 鏍煎紡");
+							continue;
+						}
+					}
+					Cell cell12 = row.getCell(12);
+					plan.setPlanDescription(ExcelUtils.getCellValueAsString(cell12));
+					Cell cell13 = row.getCell(13);
+					plan.setRelatedDeparts(ExcelUtils.getCellValueAsString(cell13));
+					Cell cell14 = row.getCell(14);
+					plan.setRemark(ExcelUtils.getCellValueAsString(cell14));
+					plan.setPlanCode(sysBusinessCodeRuleService.generateBusinessCodeSeq("EquipmentPurchasePlanRule"));
+					plan.setDelFlag(CommonConstant.DEL_FLAG_0);
+					importList.add(plan);
+					successLines++;
+				}
+			}
+			eamEquipmentPurchasePlanService.saveBatch(importList);
+			if (successLines == dataLines) {
+				return Result.OK("鍏�" + dataLines + "琛屾暟鎹叏閮ㄥ鍏ユ垚鍔燂紒");
+			} else {
+				JSONObject result = new JSONObject(5);
+				result.put("successCount", successLines);
+				result.put("msg", "鎬讳笂浼犺鏁帮細" + dataLines + "锛屾垚鍔熷鍏ヨ鏁帮細" + successLines);
+				result.put("errorMsg", errorMessage);
+				String fileUrl = PmsUtil.saveErrorMsgByList(errorMessage, "userImportExcelErrorLog");
+				int lastIndex = fileUrl.lastIndexOf(File.separator);
+				String fileName = fileUrl.substring(lastIndex + 1);
+				result.put("fileUrl", "/sys/common/static/" + fileUrl);
+				result.put("fileName", fileName);
+				Result res = Result.ok(result);
+				res.setCode(201);
+				res.setMessage("鏂囦欢瀵煎叆鎴愬姛锛屼絾鏈夐敊璇��");
+				return res;
+			}
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamPurchasePlanAttachmentController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamPurchasePlanAttachmentController.java
new file mode 100644
index 0000000..c08412e
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamPurchasePlanAttachmentController.java
@@ -0,0 +1,182 @@
+package org.jeecg.modules.eam.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.eam.entity.EamPurchasePlanAttachment;
+import org.jeecg.modules.eam.request.EamPurchasePlanAttachmentRequest;
+import org.jeecg.modules.eam.service.IEamPurchasePlanAttachmentService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: eam_purchase_plan_attachment
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Api(tags="eam_purchase_plan_attachment")
+@RestController
+@RequestMapping("/eam/eamPurchasePlanAttachment")
+@Slf4j
+public class EamPurchasePlanAttachmentController extends JeecgController<EamPurchasePlanAttachment, IEamPurchasePlanAttachmentService> {
+	@Autowired
+	private IEamPurchasePlanAttachmentService eamPurchasePlanAttachmentService;
+	
+	/**
+	 * 鍒嗛〉鍒楄〃鏌ヨ
+	 *
+	 * @param eamPurchasePlanAttachment
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "eam_purchase_plan_attachment-鍒嗛〉鍒楄〃鏌ヨ")
+	@ApiOperation(value="eam_purchase_plan_attachment-鍒嗛〉鍒楄〃鏌ヨ", notes="eam_purchase_plan_attachment-鍒嗛〉鍒楄〃鏌ヨ")
+	@GetMapping(value = "/list")
+	public Result<IPage<EamPurchasePlanAttachment>> queryPageList(EamPurchasePlanAttachment eamPurchasePlanAttachment,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<EamPurchasePlanAttachment> queryWrapper = QueryGenerator.initQueryWrapper(eamPurchasePlanAttachment, req.getParameterMap());
+		Page<EamPurchasePlanAttachment> page = new Page<EamPurchasePlanAttachment>(pageNo, pageSize);
+		IPage<EamPurchasePlanAttachment> pageList = eamPurchasePlanAttachmentService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   娣诲姞
+	 *
+	 * @param request
+	 * @return
+	 */
+	@AutoLog(value = "eam_purchase_plan_attachment-娣诲姞")
+	@ApiOperation(value="eam_purchase_plan_attachment-娣诲姞", notes="eam_purchase_plan_attachment-娣诲姞")
+	//@RequiresPermissions("org.jeecg.modules:eam_purchase_plan_attachment:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody EamPurchasePlanAttachmentRequest request) {
+		eamPurchasePlanAttachmentService.saveAttachmentList(request);
+		return Result.OK("娣诲姞鎴愬姛锛�");
+	}
+	
+	/**
+	 *  缂栬緫
+	 *
+	 * @param eamPurchasePlanAttachment
+	 * @return
+	 */
+	@AutoLog(value = "eam_purchase_plan_attachment-缂栬緫")
+	@ApiOperation(value="eam_purchase_plan_attachment-缂栬緫", notes="eam_purchase_plan_attachment-缂栬緫")
+	//@RequiresPermissions("org.jeecg.modules:eam_purchase_plan_attachment:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody EamPurchasePlanAttachment eamPurchasePlanAttachment) {
+		eamPurchasePlanAttachmentService.updateById(eamPurchasePlanAttachment);
+		return Result.OK("缂栬緫鎴愬姛!");
+	}
+	
+	/**
+	 *   閫氳繃id鍒犻櫎
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "eam_purchase_plan_attachment-閫氳繃id鍒犻櫎")
+	@ApiOperation(value="eam_purchase_plan_attachment-閫氳繃id鍒犻櫎", notes="eam_purchase_plan_attachment-閫氳繃id鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:eam_purchase_plan_attachment:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		eamPurchasePlanAttachmentService.removeById(id);
+		return Result.OK("鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 *  鎵归噺鍒犻櫎
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "eam_purchase_plan_attachment-鎵归噺鍒犻櫎")
+	@ApiOperation(value="eam_purchase_plan_attachment-鎵归噺鍒犻櫎", notes="eam_purchase_plan_attachment-鎵归噺鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:eam_purchase_plan_attachment:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.eamPurchasePlanAttachmentService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("鎵归噺鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 * 閫氳繃id鏌ヨ
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "eam_purchase_plan_attachment-閫氳繃id鏌ヨ")
+	@ApiOperation(value="eam_purchase_plan_attachment-閫氳繃id鏌ヨ", notes="eam_purchase_plan_attachment-閫氳繃id鏌ヨ")
+	@GetMapping(value = "/queryById")
+	public Result<EamPurchasePlanAttachment> queryById(@RequestParam(name="id",required=true) String id) {
+		EamPurchasePlanAttachment eamPurchasePlanAttachment = eamPurchasePlanAttachmentService.getById(id);
+		if(eamPurchasePlanAttachment==null) {
+			return Result.error("鏈壘鍒板搴旀暟鎹�");
+		}
+		return Result.OK(eamPurchasePlanAttachment);
+	}
+
+    /**
+    * 瀵煎嚭excel
+    *
+    * @param request
+    * @param eamPurchasePlanAttachment
+    */
+    //@RequiresPermissions("org.jeecg.modules:eam_purchase_plan_attachment:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, EamPurchasePlanAttachment eamPurchasePlanAttachment) {
+        return super.exportXls(request, eamPurchasePlanAttachment, EamPurchasePlanAttachment.class, "eam_purchase_plan_attachment");
+    }
+
+    /**
+      * 閫氳繃excel瀵煎叆鏁版嵁
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("eam_purchase_plan_attachment:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, EamPurchasePlanAttachment.class);
+    }
+
+	@GetMapping("/downloadFile")
+	public void downloadFile(@RequestParam("id") String id, HttpServletResponse response) {
+		eamPurchasePlanAttachmentService.downloadFile(response, eamPurchasePlanAttachmentService.getById(id));
+	}
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentPurchasePlan.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentPurchasePlan.java
new file mode 100644
index 0000000..8230968
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamEquipmentPurchasePlan.java
@@ -0,0 +1,132 @@
+package org.jeecg.modules.eam.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: eam_equipment_purchase_plan
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Data
+@TableName("eam_equipment_purchase_plan")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="eam_equipment_purchase_plan瀵硅薄", description="eam_equipment_purchase_plan")
+public class EamEquipmentPurchasePlan implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**涓婚敭*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "涓婚敭")
+    private String id;
+	/**閲囪喘璁″垝鍚嶇О*/
+	@Excel(name = "閲囪喘璁″垝鍚嶇О", width = 20, orderNum = "2")
+    @ApiModelProperty(value = "閲囪喘璁″垝鍚嶇О")
+    private String planName;
+	/**閲囪喘璁″垝缂栫爜*/
+	@Excel(name = "閲囪喘璁″垝缂栫爜", width = 20, orderNum = "1")
+    @ApiModelProperty(value = "閲囪喘璁″垝缂栫爜")
+    private String planCode;
+	/**璁″垝鐘舵��*/
+    @Dict(dicCode = "equipment_purchase_plan_status")
+	@Excel(name = "璁″垝鐘舵��", width = 20, dicCode = "equipment_purchase_plan_status", orderNum = "3")
+    @ApiModelProperty(value = "璁″垝鐘舵��")
+    private String planStatus;
+	/**鍨嬪彿*/
+	@Excel(name = "鍨嬪彿", width = 15, orderNum = "4")
+    @ApiModelProperty(value = "鍨嬪彿")
+    private String equipmentModel;
+	/**閲囪喘鏁伴噺*/
+	@Excel(name = "閲囪喘鏁伴噺", width = 15, orderNum = "5")
+    @ApiModelProperty(value = "閲囪喘鏁伴噺")
+    private Integer purchaseNumber;
+	/**棰勮鍗曚环*/
+	@Excel(name = "棰勮鍗曚环", width = 15, orderNum = "6")
+    @ApiModelProperty(value = "棰勮鍗曚环")
+    private BigDecimal estimatedUnitPrice;
+	/**鎬讳环*/
+	@Excel(name = "鎬讳环", width = 15, orderNum = "7")
+    @ApiModelProperty(value = "鎬讳环")
+    private BigDecimal totalPrice;
+	/**鍚堝悓鎬婚噾棰�*/
+	@Excel(name = "鍚堝悓鎬婚噾棰�", width = 15, orderNum = "8")
+    @ApiModelProperty(value = "鍚堝悓鎬婚噾棰�")
+    private BigDecimal overallContractAmount;
+	/**ABC鏍囪瘑(绠$悊鍒嗙被)*/
+	@Excel(name = "绠$悊鍒嗙被", width = 10, orderNum = "9")
+    @ApiModelProperty(value = "ABC鏍囪瘑(绠$悊鍒嗙被)")
+    private String equipmentImportance;
+	/**璁″垝绫诲埆*/
+    @ApiModelProperty(value = "璁″垝绫诲埆")
+    private String planCategory;
+	/**鐢宠浜�*/
+	@Excel(name = "鐢宠浜�", width = 15, orderNum = "10")
+    @ApiModelProperty(value = "鐢宠浜�")
+    private String applicant;
+	/**鐢宠杞﹂棿*/
+	@Excel(name = "鐢宠杞﹂棿", width = 15, dictTable = "mdc_production", dicText = "production_name", dicCode = "id", orderNum = "11")
+    @ApiModelProperty(value = "鐢宠杞﹂棿")
+    @Dict(dictTable = "mdc_production", dicText = "production_name", dicCode = "id")
+    private String applicantProduction;
+	/**璁″垝寮�濮嬫棩鏈�*/
+	@Excel(name = "璁″垝寮�濮嬫棩鏈�", width = 15, format = "yyyy/MM/dd HH", orderNum = "12")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "璁″垝寮�濮嬫棩鏈�")
+    private Date planStartDate;
+	/**璁″垝瀹屾垚鏃ユ湡*/
+	@Excel(name = "璁″垝瀹屾垚鏃ユ湡", width = 15, format = "yyyy/MM/dd HH", orderNum = "13")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "璁″垝瀹屾垚鏃ユ湡")
+    private Date planEndDate;
+	/**璁″垝鎻忚堪*/
+	@Excel(name = "璁″垝鎻忚堪", width = 50, orderNum = "14")
+    @ApiModelProperty(value = "璁″垝鎻忚堪")
+    private String planDescription;
+	/**瀹炴柦鍙婂崗鍔╅儴闂�*/
+	@Excel(name = "瀹炴柦鍙婂崗鍔╅儴闂�", width = 15, orderNum = "15")
+    @ApiModelProperty(value = "瀹炴柦鍙婂崗鍔╅儴闂�")
+    private String relatedDeparts;
+	/**澶囨敞*/
+	@Excel(name = "澶囨敞", width = 50, orderNum = "16")
+    @ApiModelProperty(value = "澶囨敞")
+    private String remark;
+	/**鍒涘缓浜�*/
+    @ApiModelProperty(value = "鍒涘缓浜�")
+    private String createBy;
+	/**鍒涘缓鏃堕棿*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+    private Date createTime;
+	/**鏇存柊浜�*/
+    @ApiModelProperty(value = "鏇存柊浜�")
+    private String updateBy;
+	/**鏇存柊鏃堕棿*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "鏇存柊鏃堕棿")
+    private Date updateTime;
+	/**鍒犻櫎鏍囪*/
+    @ApiModelProperty(value = "鍒犻櫎鏍囪")
+    @TableLogic
+    private Integer delFlag;
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamPurchasePlanAttachment.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamPurchasePlanAttachment.java
new file mode 100644
index 0000000..dc9a391
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamPurchasePlanAttachment.java
@@ -0,0 +1,83 @@
+package org.jeecg.modules.eam.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: eam_purchase_plan_attachment
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Data
+@TableName("eam_purchase_plan_attachment")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="eam_purchase_plan_attachment瀵硅薄", description="eam_purchase_plan_attachment")
+public class EamPurchasePlanAttachment implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**涓婚敭*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "涓婚敭")
+    private String id;
+	/**璁″垝ID*/
+	@Excel(name = "璁″垝ID", width = 15)
+    @ApiModelProperty(value = "璁″垝ID")
+    private String planId;
+	/**鏂囦欢鍔犲瘑鍚�*/
+	@Excel(name = "鏂囦欢鍔犲瘑鍚�", width = 15)
+    @ApiModelProperty(value = "鏂囦欢鍔犲瘑鍚�")
+    private String fileEncodeName;
+	/**鏂囦欢鍚嶇О*/
+	@Excel(name = "鏂囦欢鍚嶇О", width = 15)
+    @ApiModelProperty(value = "鏂囦欢鍚嶇О")
+    private String fileName;
+	/**鏂囦欢淇濆瓨璺緞*/
+	@Excel(name = "鏂囦欢淇濆瓨璺緞", width = 15)
+    @ApiModelProperty(value = "鏂囦欢淇濆瓨璺緞")
+    private String filePath;
+	/**鏂囦欢鍚庣紑鍚�*/
+	@Excel(name = "鏂囦欢鍚庣紑鍚�", width = 15)
+    @ApiModelProperty(value = "鏂囦欢鍚庣紑鍚�")
+    private String fileSuffix;
+	/**鏂囦欢澶у皬*/
+	@Excel(name = "鏂囦欢澶у皬", width = 15)
+    @ApiModelProperty(value = "鏂囦欢澶у皬")
+    private Long fileSize;
+	/**鎻忚堪*/
+	@Excel(name = "鎻忚堪", width = 15)
+    @ApiModelProperty(value = "鎻忚堪")
+    private String description;
+	/**鍒涘缓浜�*/
+    @ApiModelProperty(value = "鍒涘缓浜�")
+    private String createBy;
+	/**鍒涘缓鏃堕棿*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "鍒涘缓鏃堕棿")
+    private Date createTime;
+	/**鏇存柊浜�*/
+    @ApiModelProperty(value = "鏇存柊浜�")
+    private String updateBy;
+	/**鏇存柊鏃堕棿*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH")
+    @ApiModelProperty(value = "鏇存柊鏃堕棿")
+    private Date updateTime;
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentPurchasePlanMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentPurchasePlanMapper.java
new file mode 100644
index 0000000..7ae4072
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentPurchasePlanMapper.java
@@ -0,0 +1,17 @@
+package org.jeecg.modules.eam.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.eam.entity.EamEquipmentPurchasePlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: eam_equipment_purchase_plan
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+public interface EamEquipmentPurchasePlanMapper extends BaseMapper<EamEquipmentPurchasePlan> {
+
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamPurchasePlanAttachmentMapper.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamPurchasePlanAttachmentMapper.java
new file mode 100644
index 0000000..15e83ca
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamPurchasePlanAttachmentMapper.java
@@ -0,0 +1,17 @@
+package org.jeecg.modules.eam.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.eam.entity.EamPurchasePlanAttachment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: eam_purchase_plan_attachment
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+public interface EamPurchasePlanAttachmentMapper extends BaseMapper<EamPurchasePlanAttachment> {
+
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentPurchasePlanMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentPurchasePlanMapper.xml
new file mode 100644
index 0000000..b051fda
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentPurchasePlanMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.eam.mapper.EamEquipmentPurchasePlanMapper">
+
+</mapper>
\ No newline at end of file
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamPurchasePlanAttachmentMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamPurchasePlanAttachmentMapper.xml
new file mode 100644
index 0000000..98ccffb
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamPurchasePlanAttachmentMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.eam.mapper.EamPurchasePlanAttachmentMapper">
+
+</mapper>
\ No newline at end of file
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamPurchasePlanAttachmentRequest.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamPurchasePlanAttachmentRequest.java
new file mode 100644
index 0000000..5510a28
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamPurchasePlanAttachmentRequest.java
@@ -0,0 +1,33 @@
+package org.jeecg.modules.eam.request;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecg.common.api.vo.FileUploadResult;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: 璁惧闄勪欢绠$悊
+ * @Author: jeecg-boot
+ * @Date:   2025-03-17
+ * @Version: V1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="璇锋眰瀵硅薄", description="璁惧閲囪喘璁″垝闄勪欢绠$悊")
+public class EamPurchasePlanAttachmentRequest implements Serializable {
+	/**鎻忚堪*/
+    @ApiModelProperty(value = "鎻忚堪")
+	private String description;
+	/**璁″垝ID*/
+	@ApiModelProperty(value = "璁″垝ID")
+	private String planId;
+	/**涓婁紶鏂囦欢瀵圭郴*/
+	@ApiModelProperty(value = "涓婁紶鏂囦欢瀵圭郴")
+	private List<FileUploadResult> fileList;
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentPurchasePlanService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentPurchasePlanService.java
new file mode 100644
index 0000000..d35fb64
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentPurchasePlanService.java
@@ -0,0 +1,15 @@
+package org.jeecg.modules.eam.service;
+
+import org.jeecg.modules.eam.entity.EamEquipmentPurchasePlan;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: eam_equipment_purchase_plan
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+public interface IEamEquipmentPurchasePlanService extends IService<EamEquipmentPurchasePlan> {
+
+    void savePurchasePlan(EamEquipmentPurchasePlan eamEquipmentPurchasePlan);
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamPurchasePlanAttachmentService.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamPurchasePlanAttachmentService.java
new file mode 100644
index 0000000..97b394c
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamPurchasePlanAttachmentService.java
@@ -0,0 +1,20 @@
+package org.jeecg.modules.eam.service;
+
+import org.jeecg.modules.eam.entity.EamPurchasePlanAttachment;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.eam.request.EamPurchasePlanAttachmentRequest;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @Description: eam_purchase_plan_attachment
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+public interface IEamPurchasePlanAttachmentService extends IService<EamPurchasePlanAttachment> {
+
+    void saveAttachmentList(EamPurchasePlanAttachmentRequest request);
+
+    void downloadFile(HttpServletResponse response, EamPurchasePlanAttachment byId);
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentPurchasePlanServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentPurchasePlanServiceImpl.java
new file mode 100644
index 0000000..9423de1
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentPurchasePlanServiceImpl.java
@@ -0,0 +1,33 @@
+package org.jeecg.modules.eam.service.impl;
+
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.modules.eam.constant.EquipmentPurchasePlanStatusEnum;
+import org.jeecg.modules.eam.entity.EamEquipmentPurchasePlan;
+import org.jeecg.modules.eam.mapper.EamEquipmentPurchasePlanMapper;
+import org.jeecg.modules.eam.service.IEamEquipmentPurchasePlanService;
+import org.jeecg.modules.system.service.ISysBusinessCodeRuleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: eam_equipment_purchase_plan
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Service
+public class EamEquipmentPurchasePlanServiceImpl extends ServiceImpl<EamEquipmentPurchasePlanMapper, EamEquipmentPurchasePlan> implements IEamEquipmentPurchasePlanService {
+
+    @Autowired
+    private ISysBusinessCodeRuleService sysBusinessCodeRuleService;
+
+    @Override
+    public void savePurchasePlan(EamEquipmentPurchasePlan eamEquipmentPurchasePlan) {
+        eamEquipmentPurchasePlan.setPlanCode(sysBusinessCodeRuleService.generateBusinessCodeSeq("EquipmentPurchasePlanRule"));
+        eamEquipmentPurchasePlan.setPlanStatus(EquipmentPurchasePlanStatusEnum.NEWLY.name());
+        eamEquipmentPurchasePlan.setDelFlag(CommonConstant.DEL_FLAG_0);
+        save(eamEquipmentPurchasePlan);
+    }
+}
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamPurchasePlanAttachmentServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamPurchasePlanAttachmentServiceImpl.java
new file mode 100644
index 0000000..0737137
--- /dev/null
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamPurchasePlanAttachmentServiceImpl.java
@@ -0,0 +1,62 @@
+package org.jeecg.modules.eam.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import org.jeecg.common.util.FileUtil;
+import org.jeecg.modules.eam.entity.EamEquipmentPurchasePlan;
+import org.jeecg.modules.eam.entity.EamPurchasePlanAttachment;
+import org.jeecg.modules.eam.mapper.EamPurchasePlanAttachmentMapper;
+import org.jeecg.modules.eam.request.EamPurchasePlanAttachmentRequest;
+import org.jeecg.modules.eam.service.IEamEquipmentPurchasePlanService;
+import org.jeecg.modules.eam.service.IEamPurchasePlanAttachmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Objects;
+
+/**
+ * @Description: eam_purchase_plan_attachment
+ * @Author: jeecg-boot
+ * @Date:   2025-06-18
+ * @Version: V1.0
+ */
+@Service
+public class EamPurchasePlanAttachmentServiceImpl extends ServiceImpl<EamPurchasePlanAttachmentMapper, EamPurchasePlanAttachment> implements IEamPurchasePlanAttachmentService {
+
+    @Autowired
+    private IEamEquipmentPurchasePlanService eamEquipmentPurchasePlanService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void saveAttachmentList(EamPurchasePlanAttachmentRequest request) {
+        if (Objects.isNull(request) || CollectionUtil.isEmpty(request.getFileList())) {
+            throw new RuntimeException("璇烽�夋嫨鏂囨。鍐嶄笂浼狅紒");
+        }
+        EamEquipmentPurchasePlan plan = eamEquipmentPurchasePlanService.getById(request.getPlanId());
+        if (Objects.isNull(plan)) {
+            throw new RuntimeException("璇峰厛閫夋嫨璁惧閲囪喘璁″垝鍐嶄笂浼犳枃妗o紒");
+        }
+        ArrayList<EamPurchasePlanAttachment> attachmentList = CollectionUtil.newArrayList();
+        request.getFileList().forEach(fileUploadResult -> {
+            EamPurchasePlanAttachment attachment = new EamPurchasePlanAttachment()
+                    .setPlanId(request.getPlanId())
+                    .setFilePath(fileUploadResult.getFilePath())
+                    .setFileName(fileUploadResult.getFileName())
+                    .setFileEncodeName(fileUploadResult.getFileEncodeName())
+                    .setFileSize(fileUploadResult.getFileSize())
+                    .setFileSuffix(fileUploadResult.getFileSuffix())
+                    .setDescription(request.getDescription());
+            attachmentList.add(attachment);
+        });
+        saveBatch(attachmentList);
+    }
+
+    @Override
+    public void downloadFile(HttpServletResponse response, EamPurchasePlanAttachment entity) {
+        FileUtil.downLoadFile(response, entity.getFilePath(), entity.getFileName());
+    }
+}

--
Gitblit v1.9.3