From ef28d5ea1585661005aa921fe523f8cb6a5b57e2 Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期一, 19 五月 2025 17:10:05 +0800
Subject: [PATCH] 增加产品
---
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialProductGroupManagementService.java | 65 +++++
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialProductGroupManagementServiceImpl.java | 156 ++++++++++++++
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java | 6
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialProductGroupManagementMapper.java | 65 +++++
aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialProductGroupManagementMapper.xml | 96 ++++++++
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsMaterialProductGroupManagement.java | 130 +++++++++++
aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsMaterialProductGroupManagementController.java | 119 ++++++++++
7 files changed, 634 insertions(+), 3 deletions(-)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
index 5444955..c76009c 100644
--- a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsGasPipelinePredictionController.java
@@ -45,7 +45,7 @@
* 鏌ヨ绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃
*/
@Operation(summary = "鏌ヨ绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁鍒楄〃", description = "鍒嗛〉鏌ヨ")
-// @RequiresPermissions("gasPipeline:prediction:list")
+ @RequiresPermissions("gasPipeline:prediction:list")
@GetMapping("/list")
public TableDataInfo list(ApsGasPipelinePrediction apsGasPipelineMo)
{
@@ -57,7 +57,7 @@
@Operation(summary = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鎵归噺瀵煎叆")
@Log(title = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.IMPORT)
-// @RequiresPermissions("gasPipeline:mo:import")
+ @RequiresPermissions("gasPipeline:mo:import")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file) throws Exception {
@@ -117,7 +117,7 @@
* 鍒犻櫎绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁
*/
@Operation(summary = "鍒犻櫎绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鎵归噺鍒犻櫎")
-// @RequiresPermissions("gasPipeline:prediction:remove")
+ @RequiresPermissions("gasPipeline:prediction:remove")
@Log(title = "绠¤矾鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsMaterialProductGroupManagementController.java b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsMaterialProductGroupManagementController.java
new file mode 100644
index 0000000..7e703c2
--- /dev/null
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/controller/mainPlan/ApsMaterialProductGroupManagementController.java
@@ -0,0 +1,119 @@
+package com.aps.core.controller.mainPlan;
+
+import com.aps.common.core.utils.poi.ExcelUtil;
+import com.aps.common.core.web.controller.BaseController;
+import com.aps.common.core.web.domain.AjaxResult;
+import com.aps.common.core.web.page.TableDataInfo;
+import com.aps.common.log.annotation.Log;
+import com.aps.common.log.enums.BusinessType;
+import com.aps.common.security.annotation.RequiresPermissions;
+import com.aps.core.domain.ApsMaterialProductGroupManagement;
+import com.aps.core.service.IApsMaterialProductGroupManagementService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 鐗╂枡浜у搧缁勬暟鎹鐞咰ontroller
+ *
+ * @author ruoyi
+ * @date 2025-05-19
+ */
+
+@Tag(name = "鐗╂枡浜у搧缁勬暟鎹鐞�", description = "鐗╂枡浜у搧缁勬暟鎹鐞嗘帴鍙�")
+@RestController
+@RequestMapping("/materialProductGroupManagement")
+public class ApsMaterialProductGroupManagementController extends BaseController
+{
+ @Autowired
+ private IApsMaterialProductGroupManagementService apsMaterialProductGroupManagementService;
+
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�
+ */
+ @Operation(summary = "鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�", description = "鍒嗛〉鏌ヨ")
+// @RequiresPermissions("materialProductGroup:management:list")
+ @GetMapping("/list")
+ public TableDataInfo list(ApsMaterialProductGroupManagement apsGasPipelineMo)
+ {
+ startPage();
+ List<ApsMaterialProductGroupManagement> list = apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementList(apsGasPipelineMo);
+ return getDataTable(list);
+ }
+
+
+ @Operation(summary = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", description = "鎵归噺瀵煎叆")
+ @Log(title = "瀵煎叆鎵嬪伐姘斾綋棰勬祴鏁版嵁", businessType = BusinessType.IMPORT)
+// @RequiresPermissions("materialProductGroup:mo:import")
+ @PostMapping("/importData")
+ public AjaxResult importData(MultipartFile file) throws Exception {
+
+ int i = apsMaterialProductGroupManagementService.batchInsertApsMaterialProductGroupManagement(file);
+ return toAjax(i);
+ }
+ /**
+ * 瀵煎嚭鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�
+ */
+ @Operation(summary = "瀵煎嚭鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�", description = "瀵煎嚭")
+// @RequiresPermissions("materialProductGroup:management:export")
+ @Log(title = "鐗╂枡浜у搧缁勬暟鎹鐞�", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ List<ApsMaterialProductGroupManagement> list = apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementList(apsMaterialProductGroupManagement);
+ ExcelUtil<ApsMaterialProductGroupManagement> util = new ExcelUtil<ApsMaterialProductGroupManagement>(ApsMaterialProductGroupManagement.class);
+ util.exportExcel(response, list, "鐗╂枡浜у搧缁勬暟鎹鐞嗘暟鎹�");
+ }
+
+ /**
+ * 鑾峰彇鐗╂枡浜у搧缁勬暟鎹鐞嗚缁嗕俊鎭�
+ */
+ @Operation(summary = "鑾峰彇鐗╂枡浜у搧缁勬暟鎹鐞嗚缁嗕俊鎭�", description = "鏍规嵁id鑾峰彇")
+ @RequiresPermissions("materialProductGroup:management:query")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return success(apsMaterialProductGroupManagementService.selectApsMaterialProductGroupManagementById(id));
+ }
+
+ /**
+ * 鏂板鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ @Operation(summary = "鏂板鐗╂枡浜у搧缁勬暟鎹鐞�", description = "鍗曚釜鏂板")
+// @RequiresPermissions("materialProductGroup:management:add")
+ @Log(title = "鐗╂枡浜у搧缁勬暟鎹鐞�", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ return toAjax(apsMaterialProductGroupManagementService.insertApsMaterialProductGroupManagement(apsMaterialProductGroupManagement));
+ }
+
+ /**
+ * 淇敼鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ @Operation(summary = "淇敼鐗╂枡浜у搧缁勬暟鎹鐞�", description = "鍗曚釜淇敼")
+// @RequiresPermissions("materialProductGroup:management:edit")
+ @Log(title = "鐗╂枡浜у搧缁勬暟鎹鐞�", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ return toAjax(apsMaterialProductGroupManagementService.updateApsMaterialProductGroupManagement(apsMaterialProductGroupManagement));
+ }
+
+ /**
+ * 鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ @Operation(summary = "鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�", description = "鎵归噺鍒犻櫎")
+// @RequiresPermissions("materialProductGroup:management:remove")
+ @Log(title = "鐗╂枡浜у搧缁勬暟鎹鐞�", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(apsMaterialProductGroupManagementService.deleteApsMaterialProductGroupManagementByIds(ids));
+ }
+}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsMaterialProductGroupManagement.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsMaterialProductGroupManagement.java
new file mode 100644
index 0000000..da7a861
--- /dev/null
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsMaterialProductGroupManagement.java
@@ -0,0 +1,130 @@
+package com.aps.core.domain;
+
+import com.aps.common.core.web.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.aps.common.core.annotation.Excel;
+import org.springframework.data.annotation.Id;
+
+/**
+ * 鐗╂枡浜у搧缁勬暟鎹鐞嗗璞� aps_material_product_group_management
+ *
+ * @author ruoyi
+ * @date 2025-05-19
+ */
+@Schema(description = "鐗╂枡浜у搧缁勬暟鎹鐞嗗疄浣撶被")
+@Data
+public class ApsMaterialProductGroupManagement extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ /** ID */
+ @Schema(description = "ID")
+ private Long id;
+
+ /** 閫傜敤宸ュ巶 鍙傝�� aps_factory */
+ @Excel(name = "閫傜敤宸ュ巶 鍙傝�� aps_factory")
+ @Schema(description = "閫傜敤宸ュ巶 鍙傝�� aps_factory")
+ private String factory;
+
+ /** 鏂欏彿 */
+ @Excel(name = "鏂欏彿")
+ @Schema(description = "鏂欏彿")
+ private String materialCode;
+
+ /** 涓撲笟 鍙傝�� aps_domain */
+ @Excel(name = "涓撲笟 鍙傝�� aps_domain")
+ @Schema(description = "涓撲笟 鍙傝�� aps_domain")
+ private String domain;
+
+ /** 鏄惁涓轰富闃� 鏄�/鍚� */
+ @Excel(name = "鏄惁涓轰富闃� 鏄�/鍚�")
+ @Schema(description = "鏄惁涓轰富闃� 鏄�/鍚�")
+ private String isMain;
+
+ /** 鏂欏彿绫诲埆 鍒堕�犱欢/閲囪喘浠� */
+ @Excel(name = "鏂欏彿绫诲埆 鍒堕�犱欢/閲囪喘浠�")
+ @Schema(description = "鏂欏彿绫诲埆 鍒堕�犱欢/閲囪喘浠�")
+ private String materialType;
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setFactory(String factory)
+ {
+ this.factory = factory;
+ }
+
+ public String getFactory()
+ {
+ return factory;
+ }
+
+ public void setMaterialCode(String materialCode)
+ {
+ this.materialCode = materialCode;
+ }
+
+ public String getMaterialCode()
+ {
+ return materialCode;
+ }
+
+ public void setDomain(String domain)
+ {
+ this.domain = domain;
+ }
+
+ public String getDomain()
+ {
+ return domain;
+ }
+
+ public void setIsMain(String isMain)
+ {
+ this.isMain = isMain;
+ }
+
+ public String getIsMain()
+ {
+ return isMain;
+ }
+
+ public void setMaterialType(String materialType)
+ {
+ this.materialType = materialType;
+ }
+
+ public String getMaterialType()
+ {
+ return materialType;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+ .append("id", getId())
+ .append("factory", getFactory())
+ .append("materialCode", getMaterialCode())
+ .append("domain", getDomain())
+ .append("createBy", getCreateBy())
+ .append("createTime", getCreateTime())
+ .append("updateBy", getUpdateBy())
+ .append("updateTime", getUpdateTime())
+ .append("isMain", getIsMain())
+ .append("materialType", getMaterialType())
+ .toString();
+ }
+}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialProductGroupManagementMapper.java b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialProductGroupManagementMapper.java
new file mode 100644
index 0000000..44a8536
--- /dev/null
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsMaterialProductGroupManagementMapper.java
@@ -0,0 +1,65 @@
+package com.aps.core.mapper;
+
+import com.aps.core.domain.ApsMaterialProductGroupManagement;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+/**
+ * 鐗╂枡浜у搧缁勬暟鎹鐞哅apper鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2025-05-19
+ */
+public interface ApsMaterialProductGroupManagementMapper extends BaseMapper<ApsMaterialProductGroupManagement>
+{
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id);
+
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞嗛泦鍚�
+ */
+ public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 鏂板鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 淇敼鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 缁撴灉
+ */
+ public int deleteApsMaterialProductGroupManagementById(Long id);
+
+ /**
+ * 鎵归噺鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎
+ * @return 缁撴灉
+ */
+ public int deleteApsMaterialProductGroupManagementByIds(Long[] ids);
+
+ void deleteAll();
+}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialProductGroupManagementService.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialProductGroupManagementService.java
new file mode 100644
index 0000000..adbca15
--- /dev/null
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsMaterialProductGroupManagementService.java
@@ -0,0 +1,65 @@
+package com.aps.core.service;
+
+import com.aps.core.domain.ApsMaterialProductGroupManagement;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * 鐗╂枡浜у搧缁勬暟鎹鐞哠ervice鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2025-05-19
+ */
+public interface IApsMaterialProductGroupManagementService
+{
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id);
+
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞嗛泦鍚�
+ */
+ public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 鏂板鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 淇敼鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement);
+
+ /**
+ * 鎵归噺鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿泦鍚�
+ * @return 缁撴灉
+ */
+ public int deleteApsMaterialProductGroupManagementByIds(Long[] ids);
+
+ /**
+ * 鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞嗕俊鎭�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 缁撴灉
+ */
+ public int deleteApsMaterialProductGroupManagementById(Long id);
+
+ int batchInsertApsMaterialProductGroupManagement(MultipartFile file);
+}
diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialProductGroupManagementServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialProductGroupManagementServiceImpl.java
new file mode 100644
index 0000000..18cb143
--- /dev/null
+++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsMaterialProductGroupManagementServiceImpl.java
@@ -0,0 +1,156 @@
+package com.aps.core.service.impl;
+
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import cn.hutool.core.util.IdUtil;
+import com.aps.common.core.utils.DateUtils;
+import com.aps.common.security.utils.SecurityUtils;
+import com.aps.core.domain.ApsGasPipelinePrediction;
+import com.aps.core.domain.ApsMaterialProductGroupManagement;
+import com.aps.core.mapper.ApsMaterialProductGroupManagementMapper;
+import com.aps.core.service.IApsMaterialProductGroupManagementService;
+import io.micrometer.common.util.StringUtils;
+import lombok.SneakyThrows;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.WorkbookFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 鐗╂枡浜у搧缁勬暟鎹鐞哠ervice涓氬姟灞傚鐞�
+ *
+ * @author ruoyi
+ * @date 2025-05-19
+ */
+@Service
+public class ApsMaterialProductGroupManagementServiceImpl implements IApsMaterialProductGroupManagementService
+{
+ @Autowired
+ private ApsMaterialProductGroupManagementMapper apsMaterialProductGroupManagementMapper;
+
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ @Override
+ public ApsMaterialProductGroupManagement selectApsMaterialProductGroupManagementById(Long id)
+ {
+ return apsMaterialProductGroupManagementMapper.selectApsMaterialProductGroupManagementById(id);
+ }
+
+ /**
+ * 鏌ヨ鐗╂枡浜у搧缁勬暟鎹鐞嗗垪琛�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 鐗╂枡浜у搧缁勬暟鎹鐞�
+ */
+ @Override
+ public List<ApsMaterialProductGroupManagement> selectApsMaterialProductGroupManagementList(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ return apsMaterialProductGroupManagementMapper.selectApsMaterialProductGroupManagementList(apsMaterialProductGroupManagement);
+ }
+
+ /**
+ * 鏂板鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ @Override
+ public int insertApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ apsMaterialProductGroupManagement.setCreateTime(DateUtils.getNowDate());
+ return apsMaterialProductGroupManagementMapper.insertApsMaterialProductGroupManagement(apsMaterialProductGroupManagement);
+ }
+
+ /**
+ * 淇敼鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param apsMaterialProductGroupManagement 鐗╂枡浜у搧缁勬暟鎹鐞�
+ * @return 缁撴灉
+ */
+ @Override
+ public int updateApsMaterialProductGroupManagement(ApsMaterialProductGroupManagement apsMaterialProductGroupManagement)
+ {
+ apsMaterialProductGroupManagement.setUpdateTime(DateUtils.getNowDate());
+ return apsMaterialProductGroupManagementMapper.updateApsMaterialProductGroupManagement(apsMaterialProductGroupManagement);
+ }
+
+ /**
+ * 鎵归噺鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞�
+ *
+ * @param ids 闇�瑕佸垹闄ょ殑鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteApsMaterialProductGroupManagementByIds(Long[] ids)
+ {
+ return apsMaterialProductGroupManagementMapper.deleteApsMaterialProductGroupManagementByIds(ids);
+ }
+
+ /**
+ * 鍒犻櫎鐗╂枡浜у搧缁勬暟鎹鐞嗕俊鎭�
+ *
+ * @param id 鐗╂枡浜у搧缁勬暟鎹鐞嗕富閿�
+ * @return 缁撴灉
+ */
+ @Override
+ public int deleteApsMaterialProductGroupManagementById(Long id)
+ {
+ return apsMaterialProductGroupManagementMapper.deleteApsMaterialProductGroupManagementById(id);
+ }
+
+ @SneakyThrows
+ @Override
+ public int batchInsertApsMaterialProductGroupManagement(MultipartFile file) {
+ Workbook workbook = WorkbookFactory.create(file.getInputStream());
+
+ Sheet sheet = workbook.getSheetAt(0);
+ int rows = sheet.getLastRowNum();
+ if (rows > 0) {
+ List<ApsMaterialProductGroupManagement> list = new ArrayList<>();
+
+ /*鏁版嵁鍒椾粠1寮�濮�*/
+ for (int i = 1; i <= rows; i++) {
+ Row row = sheet.getRow(i);
+ String materialCode = row.getCell(0).getStringCellValue();
+ if (StringUtils.isEmpty(materialCode)){
+ continue;
+ }
+ String materialType = row.getCell(1).getStringCellValue();
+ String domain = row.getCell(2).getStringCellValue();
+ String isMain = row.getCell(3).getStringCellValue();
+ String factory = row.getCell(4).getStringCellValue();
+ if (StringUtils.isNotBlank(materialType) &&
+ StringUtils.isNotBlank(domain) &&
+ StringUtils.isNotBlank(isMain) &&
+ StringUtils.isNotBlank(factory)) {
+ ApsMaterialProductGroupManagement item = new ApsMaterialProductGroupManagement();
+ item.setId(IdUtil.getSnowflakeNextId());
+ item.setFactory(factory);
+ item.setDomain(domain);
+ item.setMaterialType(materialType);
+ item.setMaterialCode(materialCode);
+ item.setIsMain(isMain);
+ item.setCreateBy(SecurityUtils.getUsername());
+ item.setCreateTime(DateUtils.getNowDate());
+ list.add(item);
+ }
+ }
+ if (!list.isEmpty()) {
+ apsMaterialProductGroupManagementMapper.insert(list);
+ }
+ return list.size();
+ }
+ return 0;
+ }
+}
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialProductGroupManagementMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialProductGroupManagementMapper.xml
new file mode 100644
index 0000000..37b7ace
--- /dev/null
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsMaterialProductGroupManagementMapper.xml
@@ -0,0 +1,96 @@
+<?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="com.aps.core.mapper.ApsMaterialProductGroupManagementMapper">
+
+ <resultMap type="com.aps.core.domain.ApsMaterialProductGroupManagement" id="ApsMaterialProductGroupManagementResult">
+ <result property="id" column="id" />
+ <result property="factory" column="factory" />
+ <result property="materialCode" column="material_code" />
+ <result property="domain" column="domain" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ <result property="isMain" column="is_main" />
+ <result property="materialType" column="material_type" />
+ </resultMap>
+
+ <sql id="selectApsMaterialProductGroupManagementVo">
+ select id, factory, material_code, domain, create_by, create_time, update_by, update_time, is_main, material_type from aps_material_product_group_management
+ </sql>
+
+ <select id="selectApsMaterialProductGroupManagementList" parameterType="ApsMaterialProductGroupManagement" resultMap="ApsMaterialProductGroupManagementResult">
+ <include refid="selectApsMaterialProductGroupManagementVo"/>
+ <where>
+ <if test="factory != null and factory != ''"> and factory = #{factory}</if>
+ <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
+ <if test="domain != null and domain != ''"> and domain = #{domain}</if>
+ <if test="isMain != null and isMain != ''"> and is_main = #{isMain}</if>
+ <if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
+ </where>
+ </select>
+
+ <select id="selectApsMaterialProductGroupManagementById" parameterType="Long" resultMap="ApsMaterialProductGroupManagementResult">
+ </select>
+
+ <insert id="insertApsMaterialProductGroupManagement" parameterType="ApsMaterialProductGroupManagement">
+ insert into aps_material_product_group_management
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">id,</if>
+ <if test="factory != null">factory,</if>
+ <if test="materialCode != null">material_code,</if>
+ <if test="domain != null">domain,</if>
+ <if test="createBy != null">create_by,</if>
+ <if test="createTime != null">create_time,</if>
+ <if test="updateBy != null">update_by,</if>
+ <if test="updateTime != null">update_time,</if>
+ <if test="isMain != null">is_main,</if>
+ <if test="materialType != null">material_type,</if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">#{id},</if>
+ <if test="factory != null">#{factory},</if>
+ <if test="materialCode != null">#{materialCode},</if>
+ <if test="domain != null">#{domain},</if>
+ <if test="createBy != null">#{createBy},</if>
+ <if test="createTime != null">#{createTime},</if>
+ <if test="updateBy != null">#{updateBy},</if>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="isMain != null">#{isMain},</if>
+ <if test="materialType != null">#{materialType},</if>
+ </trim>
+ </insert>
+
+ <update id="updateApsMaterialProductGroupManagement" parameterType="ApsMaterialProductGroupManagement">
+ update aps_material_product_group_management
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="factory != null">factory = #{factory},</if>
+ <if test="materialCode != null">material_code = #{materialCode},</if>
+ <if test="domain != null">domain = #{domain},</if>
+ <if test="createBy != null">create_by = #{createBy},</if>
+ <if test="createTime != null">create_time = #{createTime},</if>
+ <if test="updateBy != null">update_by = #{updateBy},</if>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="isMain != null">is_main = #{isMain},</if>
+ <if test="materialType != null">material_type = #{materialType},</if>
+ </trim>
+ where id = #{id}
+ </update>
+
+ <delete id="deleteApsMaterialProductGroupManagementById" parameterType="Long">
+ delete from aps_material_product_group_management where id = #{id}
+ </delete>
+
+ <delete id="deleteApsMaterialProductGroupManagementByIds" parameterType="String">
+ delete from aps_material_product_group_management where id in
+ <foreach item="id" collection="array" open="(" separator="," close=")">
+ #{id}
+ </foreach>
+ </delete>
+
+ <delete id="deleteAll" parameterType="String">
+ delete from aps_material_product_group_management
+ </delete>
+</mapper>
\ No newline at end of file
--
Gitblit v1.9.3