diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/DhcProductController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/DhcProductController.java index ad7100e..e9018b8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/DhcProductController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/DhcProductController.java @@ -20,15 +20,18 @@ import com.ruoyi.dhc.domain.DhcProduct; import com.ruoyi.dhc.service.IDhcProductService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; /** * 产品信息Controller * * @author ruoyi - * @date 2024-10-08 + * @date 2025-03-14 */ +@Api(tags = "产品信息管理") @RestController -@RequestMapping("/dhc/product") +@RequestMapping("/dhc/dhcProduct") public class DhcProductController extends BaseController { @Autowired @@ -37,6 +40,7 @@ public class DhcProductController extends BaseController /** * 查询产品信息列表 */ + @ApiOperation("查询产品信息列表") @PreAuthorize("@ss.hasPermi('dhc:product:list')") @GetMapping("/list") public TableDataInfo list(DhcProduct dhcProduct) @@ -49,6 +53,7 @@ public class DhcProductController extends BaseController /** * 导出产品信息列表 */ + @ApiOperation("导出产品信息列表") @PreAuthorize("@ss.hasPermi('dhc:product:export')") @Log(title = "产品信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @@ -62,6 +67,7 @@ public class DhcProductController extends BaseController /** * 获取产品信息详细信息 */ + @ApiOperation("获取产品信息详细信息") @PreAuthorize("@ss.hasPermi('dhc:product:query')") @GetMapping(value = "/{productId}") public AjaxResult getInfo(@PathVariable("productId") Long productId) @@ -72,6 +78,7 @@ public class DhcProductController extends BaseController /** * 新增产品信息 */ + @ApiOperation("新增产品信息") @PreAuthorize("@ss.hasPermi('dhc:product:add')") @Log(title = "产品信息", businessType = BusinessType.INSERT) @PostMapping @@ -83,6 +90,7 @@ public class DhcProductController extends BaseController /** * 修改产品信息 */ + @ApiOperation("修改产品信息") @PreAuthorize("@ss.hasPermi('dhc:product:edit')") @Log(title = "产品信息", businessType = BusinessType.UPDATE) @PutMapping @@ -94,6 +102,7 @@ public class DhcProductController extends BaseController /** * 删除产品信息 */ + @ApiOperation("删除产品信息") @PreAuthorize("@ss.hasPermi('dhc:product:remove')") @Log(title = "产品信息", businessType = BusinessType.DELETE) @DeleteMapping("/{productIds}") diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/ProductConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/ProductConfigController.java new file mode 100644 index 0000000..75d30a6 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/dhc/ProductConfigController.java @@ -0,0 +1,113 @@ +package com.ruoyi.web.controller.dhc; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.dhc.domain.ProductConfig; +import com.ruoyi.dhc.service.IProductConfigService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +/** + * 产品配置信息Controller + * + * @author ruoyi + * @date 2025-03-14 + */ +@Api(tags = "产品配置信息管理") +@RestController +@RequestMapping("/dhc/productConfig") +public class ProductConfigController extends BaseController +{ + @Autowired + private IProductConfigService productConfigService; + + /** + * 查询产品配置信息列表 + */ + @ApiOperation("查询产品配置信息列表") + @PreAuthorize("@ss.hasPermi('dhc:config:list')") + @GetMapping("/list") + public TableDataInfo list(ProductConfig productConfig) + { + startPage(); + List list = productConfigService.selectProductConfigList(productConfig); + return getDataTable(list); + } + + /** + * 导出产品配置信息列表 + */ + @ApiOperation("导出产品配置信息列表") + @PreAuthorize("@ss.hasPermi('dhc:config:export')") + @Log(title = "产品配置信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ProductConfig productConfig) + { + List list = productConfigService.selectProductConfigList(productConfig); + ExcelUtil util = new ExcelUtil(ProductConfig.class); + util.exportExcel(response, list, "产品配置信息数据"); + } + + /** + * 获取产品配置信息详细信息 + */ + @ApiOperation("获取产品配置信息详细信息") + @PreAuthorize("@ss.hasPermi('dhc:config:query')") + @GetMapping(value = "/{productId}") + public AjaxResult getInfo(@PathVariable("productId") Long productId) + { + return success(productConfigService.selectProductConfigByProductId(productId)); + } + + /** + * 新增产品配置信息 + */ + @ApiOperation("新增产品配置信息") + @PreAuthorize("@ss.hasPermi('dhc:config:add')") + @Log(title = "产品配置信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ProductConfig productConfig) + { + return toAjax(productConfigService.insertProductConfig(productConfig)); + } + + /** + * 修改产品配置信息 + */ + @ApiOperation("修改产品配置信息") + @PreAuthorize("@ss.hasPermi('dhc:config:edit')") + @Log(title = "产品配置信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ProductConfig productConfig) + { + return toAjax(productConfigService.updateProductConfig(productConfig)); + } + + /** + * 删除产品配置信息 + */ + @ApiOperation("删除产品配置信息") + @PreAuthorize("@ss.hasPermi('dhc:config:remove')") + @Log(title = "产品配置信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{productIds}") + public AjaxResult remove(@PathVariable Long[] productIds) + { + return toAjax(productConfigService.deleteProductConfigByProductIds(productIds)); + } +} diff --git a/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/DhcProduct.java b/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/DhcProduct.java index aae2cfb..2020f6e 100644 --- a/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/DhcProduct.java +++ b/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/DhcProduct.java @@ -1,4 +1,5 @@ package com.ruoyi.dhc.domain; + import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -11,7 +12,7 @@ import io.swagger.annotations.ApiModelProperty; /** * 产品信息对象 dhc_product - * + * * @author ruoyi * @date 2025-03-14 */ @@ -33,29 +34,24 @@ public class DhcProduct extends BaseEntity @Excel(name = "产品线名称") private String productLineName; - /** 立项单号 */ - @ApiModelProperty("立项单号") - @Excel(name = "立项单号") - private String projectNum; - /** 内部型号 */ @ApiModelProperty("内部型号") @Excel(name = "内部型号") private String internalModel; - /** 产品大类编码 */ - @ApiModelProperty("产品大类编码") - @Excel(name = "产品大类编码") + /** 产品大类 */ + @ApiModelProperty("产品大类") + @Excel(name = "产品大类") private String productCategoryLarge; - /** 产品中类编码 */ - @ApiModelProperty("产品中类编码") - @Excel(name = "产品中类编码") + /** 产品中类 */ + @ApiModelProperty("产品中类") + @Excel(name = "产品中类") private String productCategoryMiddle; - /** 产品小类编码 */ - @ApiModelProperty("产品小类编码") - @Excel(name = "产品小类编码") + /** 产品小类 */ + @ApiModelProperty("产品小类") + @Excel(name = "产品小类") private String productCategorySmall; /** 产品品类 */ @@ -63,11 +59,6 @@ public class DhcProduct extends BaseEntity @Excel(name = "产品品类") private String productCategory; - /** 产品系列 */ - @ApiModelProperty("产品系列") - @Excel(name = "产品系列") - private String productSeries; - /** 基础型号 */ @ApiModelProperty("基础型号") @Excel(name = "基础型号") @@ -130,21 +121,6 @@ public class DhcProduct extends BaseEntity @Excel(name = "产品尺寸-高") private BigDecimal productHeight; - /** 装柜数量-20GP */ - @ApiModelProperty("装柜数量-20GP") - @Excel(name = "装柜数量-20GP") - private Long loadingQuantity20gp; - - /** 装柜数量-40GP */ - @ApiModelProperty("装柜数量-40GP") - @Excel(name = "装柜数量-40GP") - private Long loadingQuantity40gp; - - /** 装柜数量-40HQ */ - @ApiModelProperty("装柜数量-40HQ") - @Excel(name = "装柜数量-40HQ") - private Long loadingQuantity40hq; - /** 最小订单量 */ @ApiModelProperty("最小订单量") @Excel(name = "最小订单量") @@ -168,273 +144,228 @@ public class DhcProduct extends BaseEntity /** 删除标志(0代表存在 1代表删除) */ private String delFlag; - public void setProductId(Long productId) + public void setProductId(Long productId) { this.productId = productId; } - public Long getProductId() + public Long getProductId() { return productId; } - public void setProductLine(String productLine) + public void setProductLine(String productLine) { this.productLine = productLine; } - public String getProductLine() + public String getProductLine() { return productLine; } - public void setProductLineName(String productLineName) + public void setProductLineName(String productLineName) { this.productLineName = productLineName; } - public String getProductLineName() + public String getProductLineName() { return productLineName; } - public void setProjectNum(String projectNum) - { - this.projectNum = projectNum; - } - - public String getProjectNum() - { - return projectNum; - } - public void setInternalModel(String internalModel) + public void setInternalModel(String internalModel) { this.internalModel = internalModel; } - public String getInternalModel() + public String getInternalModel() { return internalModel; } - public void setProductCategoryLarge(String productCategoryLarge) + public void setProductCategoryLarge(String productCategoryLarge) { this.productCategoryLarge = productCategoryLarge; } - public String getProductCategoryLarge() + public String getProductCategoryLarge() { return productCategoryLarge; } - public void setProductCategoryMiddle(String productCategoryMiddle) + public void setProductCategoryMiddle(String productCategoryMiddle) { this.productCategoryMiddle = productCategoryMiddle; } - public String getProductCategoryMiddle() + public String getProductCategoryMiddle() { return productCategoryMiddle; } - public void setProductCategorySmall(String productCategorySmall) + public void setProductCategorySmall(String productCategorySmall) { this.productCategorySmall = productCategorySmall; } - public String getProductCategorySmall() + public String getProductCategorySmall() { return productCategorySmall; } - public void setProductCategory(String productCategory) + public void setProductCategory(String productCategory) { this.productCategory = productCategory; } - public String getProductCategory() + public String getProductCategory() { return productCategory; } - public void setProductSeries(String productSeries) - { - this.productSeries = productSeries; - } - - public String getProductSeries() - { - return productSeries; - } - public void setBaseModel(String baseModel) + public void setBaseModel(String baseModel) { this.baseModel = baseModel; } - public String getBaseModel() + public String getBaseModel() { return baseModel; } - public void setFactoryModel(String factoryModel) + public void setFactoryModel(String factoryModel) { this.factoryModel = factoryModel; } - public String getFactoryModel() + public String getFactoryModel() { return factoryModel; } - public void setCustomerModel(String customerModel) + public void setCustomerModel(String customerModel) { this.customerModel = customerModel; } - public String getCustomerModel() + public String getCustomerModel() { return customerModel; } - public void setBrandId(Long brandId) + public void setBrandId(Long brandId) { this.brandId = brandId; } - public Long getBrandId() + public Long getBrandId() { return brandId; } - public void setBrandName(String brandName) + public void setBrandName(String brandName) { this.brandName = brandName; } - public String getBrandName() + public String getBrandName() { return brandName; } - public void setIrDatetime(Date irDatetime) + public void setIrDatetime(Date irDatetime) { this.irDatetime = irDatetime; } - public Date getIrDatetime() + public Date getIrDatetime() { return irDatetime; } - public void setDrDatetime(Date drDatetime) + public void setDrDatetime(Date drDatetime) { this.drDatetime = drDatetime; } - public Date getDrDatetime() + public Date getDrDatetime() { return drDatetime; } - public void setPackWayCode(String packWayCode) + public void setPackWayCode(String packWayCode) { this.packWayCode = packWayCode; } - public String getPackWayCode() + public String getPackWayCode() { return packWayCode; } - public void setProductNetWeight(BigDecimal productNetWeight) + public void setProductNetWeight(BigDecimal productNetWeight) { this.productNetWeight = productNetWeight; } - public BigDecimal getProductNetWeight() + public BigDecimal getProductNetWeight() { return productNetWeight; } - public void setProductLength(BigDecimal productLength) + public void setProductLength(BigDecimal productLength) { this.productLength = productLength; } - public BigDecimal getProductLength() + public BigDecimal getProductLength() { return productLength; } - public void setProductWidth(BigDecimal productWidth) + public void setProductWidth(BigDecimal productWidth) { this.productWidth = productWidth; } - public BigDecimal getProductWidth() + public BigDecimal getProductWidth() { return productWidth; } - public void setProductHeight(BigDecimal productHeight) + public void setProductHeight(BigDecimal productHeight) { this.productHeight = productHeight; } - public BigDecimal getProductHeight() + public BigDecimal getProductHeight() { return productHeight; } - public void setLoadingQuantity20gp(Long loadingQuantity20gp) - { - this.loadingQuantity20gp = loadingQuantity20gp; - } - - public Long getLoadingQuantity20gp() - { - return loadingQuantity20gp; - } - public void setLoadingQuantity40gp(Long loadingQuantity40gp) - { - this.loadingQuantity40gp = loadingQuantity40gp; - } - - public Long getLoadingQuantity40gp() - { - return loadingQuantity40gp; - } - public void setLoadingQuantity40hq(Long loadingQuantity40hq) - { - this.loadingQuantity40hq = loadingQuantity40hq; - } - - public Long getLoadingQuantity40hq() - { - return loadingQuantity40hq; - } - public void setMinOrderQuantity(Long minOrderQuantity) + public void setMinOrderQuantity(Long minOrderQuantity) { this.minOrderQuantity = minOrderQuantity; } - public Long getMinOrderQuantity() + public Long getMinOrderQuantity() { return minOrderQuantity; } - public void setOtherRequirement(String otherRequirement) + public void setOtherRequirement(String otherRequirement) { this.otherRequirement = otherRequirement; } - public String getOtherRequirement() + public String getOtherRequirement() { return otherRequirement; } - public void setSTATUS(String STATUS) + public void setSTATUS(String STATUS) { this.STATUS = STATUS; } - public String getSTATUS() + public String getSTATUS() { return STATUS; } - public void setApproveStatus(String approveStatus) + public void setApproveStatus(String approveStatus) { this.approveStatus = approveStatus; } - public String getApproveStatus() + public String getApproveStatus() { return approveStatus; } - public void setDelFlag(String delFlag) + public void setDelFlag(String delFlag) { this.delFlag = delFlag; } - public String getDelFlag() + public String getDelFlag() { return delFlag; } @@ -442,40 +373,35 @@ public class DhcProduct extends BaseEntity @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("productId", getProductId()) - .append("productLine", getProductLine()) - .append("productLineName", getProductLineName()) - .append("projectNum", getProjectNum()) - .append("internalModel", getInternalModel()) - .append("productCategoryLarge", getProductCategoryLarge()) - .append("productCategoryMiddle", getProductCategoryMiddle()) - .append("productCategorySmall", getProductCategorySmall()) - .append("productCategory", getProductCategory()) - .append("productSeries", getProductSeries()) - .append("baseModel", getBaseModel()) - .append("factoryModel", getFactoryModel()) - .append("customerModel", getCustomerModel()) - .append("brandId", getBrandId()) - .append("brandName", getBrandName()) - .append("irDatetime", getIrDatetime()) - .append("drDatetime", getDrDatetime()) - .append("packWayCode", getPackWayCode()) - .append("productNetWeight", getProductNetWeight()) - .append("productLength", getProductLength()) - .append("productWidth", getProductWidth()) - .append("productHeight", getProductHeight()) - .append("loadingQuantity20gp", getLoadingQuantity20gp()) - .append("loadingQuantity40gp", getLoadingQuantity40gp()) - .append("loadingQuantity40hq", getLoadingQuantity40hq()) - .append("minOrderQuantity", getMinOrderQuantity()) - .append("otherRequirement", getOtherRequirement()) - .append("STATUS", getSTATUS()) - .append("approveStatus", getApproveStatus()) - .append("delFlag", getDelFlag()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} \ No newline at end of file + .append("productId", getProductId()) + .append("productLine", getProductLine()) + .append("productLineName", getProductLineName()) + .append("internalModel", getInternalModel()) + .append("productCategoryLarge", getProductCategoryLarge()) + .append("productCategoryMiddle", getProductCategoryMiddle()) + .append("productCategorySmall", getProductCategorySmall()) + .append("productCategory", getProductCategory()) + .append("baseModel", getBaseModel()) + .append("factoryModel", getFactoryModel()) + .append("customerModel", getCustomerModel()) + .append("brandId", getBrandId()) + .append("brandName", getBrandName()) + .append("irDatetime", getIrDatetime()) + .append("drDatetime", getDrDatetime()) + .append("packWayCode", getPackWayCode()) + .append("productNetWeight", getProductNetWeight()) + .append("productLength", getProductLength()) + .append("productWidth", getProductWidth()) + .append("productHeight", getProductHeight()) + .append("minOrderQuantity", getMinOrderQuantity()) + .append("otherRequirement", getOtherRequirement()) + .append("STATUS", getSTATUS()) + .append("approveStatus", getApproveStatus()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/ProductConfig.java b/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/ProductConfig.java new file mode 100644 index 0000000..4147621 --- /dev/null +++ b/ruoyi-plan/src/main/java/com/ruoyi/dhc/domain/ProductConfig.java @@ -0,0 +1,117 @@ +package com.ruoyi.dhc.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 产品配置信息对象 product_config + * + * @author ruoyi + * @date 2025-03-14 + */ +@ApiModel(value = "ProductConfig", description = "产品配置信息") +public class ProductConfig extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 产品序列号 */ + private Long productId; + + /** 产品编号 */ + @ApiModelProperty("产品编号") + @Excel(name = "产品编号") + private String productCode; + + /** 产品编号 */ + @ApiModelProperty("产品编号") + @Excel(name = "产品编号") + private String productName; + + /** 模块名称 */ + @ApiModelProperty("模块名称") + @Excel(name = "模块名称") + private String cfgModuleName; + + /** 类型编码 */ + @ApiModelProperty("类型编码") + @Excel(name = "类型编码") + private String cfgLookupCode; + + /** 删除标志(0代表存在 1代表删除) */ + private String delFlag; + + public void setProductId(Long productId) + { + this.productId = productId; + } + + public Long getProductId() + { + return productId; + } + public void setProductCode(String productCode) + { + this.productCode = productCode; + } + + public String getProductCode() + { + return productCode; + } + public void setProductName(String productName) + { + this.productName = productName; + } + + public String getProductName() + { + return productName; + } + public void setCfgModuleName(String cfgModuleName) + { + this.cfgModuleName = cfgModuleName; + } + + public String getCfgModuleName() + { + return cfgModuleName; + } + public void setCfgLookupCode(String cfgLookupCode) + { + this.cfgLookupCode = cfgLookupCode; + } + + public String getCfgLookupCode() + { + return cfgLookupCode; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("productId", getProductId()) + .append("productCode", getProductCode()) + .append("productName", getProductName()) + .append("cfgModuleName", getCfgModuleName()) + .append("cfgLookupCode", getCfgLookupCode()) + .append("delFlag", getDelFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-plan/src/main/java/com/ruoyi/dhc/mapper/ProductConfigMapper.java b/ruoyi-plan/src/main/java/com/ruoyi/dhc/mapper/ProductConfigMapper.java new file mode 100644 index 0000000..6b45177 --- /dev/null +++ b/ruoyi-plan/src/main/java/com/ruoyi/dhc/mapper/ProductConfigMapper.java @@ -0,0 +1,63 @@ +package com.ruoyi.dhc.mapper; + + +import com.ruoyi.dhc.domain.ProductConfig; + +import java.util.List; + +/** + * 产品配置信息Mapper接口 + * + * @author ruoyi + * @date 2025-03-14 + */ +public interface ProductConfigMapper +{ + /** + * 查询产品配置信息 + * + * @param productId 产品配置信息主键 + * @return 产品配置信息 + */ + public ProductConfig selectProductConfigByProductId(Long productId); + + /** + * 查询产品配置信息列表 + * + * @param productConfig 产品配置信息 + * @return 产品配置信息集合 + */ + public List selectProductConfigList(ProductConfig productConfig); + + /** + * 新增产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + public int insertProductConfig(ProductConfig productConfig); + + /** + * 修改产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + public int updateProductConfig(ProductConfig productConfig); + + /** + * 删除产品配置信息 + * + * @param productId 产品配置信息主键 + * @return 结果 + */ + public int deleteProductConfigByProductId(Long productId); + + /** + * 批量删除产品配置信息 + * + * @param productIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteProductConfigByProductIds(Long[] productIds); +} diff --git a/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/IProductConfigService.java b/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/IProductConfigService.java new file mode 100644 index 0000000..2183107 --- /dev/null +++ b/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/IProductConfigService.java @@ -0,0 +1,61 @@ +package com.ruoyi.dhc.service; + +import java.util.List; +import com.ruoyi.dhc.domain.ProductConfig; + +/** + * 产品配置信息Service接口 + * + * @author ruoyi + * @date 2025-03-14 + */ +public interface IProductConfigService +{ + /** + * 查询产品配置信息 + * + * @param productId 产品配置信息主键 + * @return 产品配置信息 + */ + public ProductConfig selectProductConfigByProductId(Long productId); + + /** + * 查询产品配置信息列表 + * + * @param productConfig 产品配置信息 + * @return 产品配置信息集合 + */ + public List selectProductConfigList(ProductConfig productConfig); + + /** + * 新增产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + public int insertProductConfig(ProductConfig productConfig); + + /** + * 修改产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + public int updateProductConfig(ProductConfig productConfig); + + /** + * 批量删除产品配置信息 + * + * @param productIds 需要删除的产品配置信息主键集合 + * @return 结果 + */ + public int deleteProductConfigByProductIds(Long[] productIds); + + /** + * 删除产品配置信息信息 + * + * @param productId 产品配置信息主键 + * @return 结果 + */ + public int deleteProductConfigByProductId(Long productId); +} diff --git a/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/impl/ProductConfigServiceImpl.java b/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/impl/ProductConfigServiceImpl.java new file mode 100644 index 0000000..65b4d65 --- /dev/null +++ b/ruoyi-plan/src/main/java/com/ruoyi/dhc/service/impl/ProductConfigServiceImpl.java @@ -0,0 +1,96 @@ +package com.ruoyi.dhc.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.dhc.mapper.ProductConfigMapper; +import com.ruoyi.dhc.domain.ProductConfig; +import com.ruoyi.dhc.service.IProductConfigService; + +/** + * 产品配置信息Service业务层处理 + * + * @author ruoyi + * @date 2025-03-14 + */ +@Service +public class ProductConfigServiceImpl implements IProductConfigService +{ + @Autowired + private ProductConfigMapper productConfigMapper; + + /** + * 查询产品配置信息 + * + * @param productId 产品配置信息主键 + * @return 产品配置信息 + */ + @Override + public ProductConfig selectProductConfigByProductId(Long productId) + { + return productConfigMapper.selectProductConfigByProductId(productId); + } + + /** + * 查询产品配置信息列表 + * + * @param productConfig 产品配置信息 + * @return 产品配置信息 + */ + @Override + public List selectProductConfigList(ProductConfig productConfig) + { + return productConfigMapper.selectProductConfigList(productConfig); + } + + /** + * 新增产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + @Override + public int insertProductConfig(ProductConfig productConfig) + { + productConfig.setCreateTime(DateUtils.getNowDate()); + return productConfigMapper.insertProductConfig(productConfig); + } + + /** + * 修改产品配置信息 + * + * @param productConfig 产品配置信息 + * @return 结果 + */ + @Override + public int updateProductConfig(ProductConfig productConfig) + { + productConfig.setUpdateTime(DateUtils.getNowDate()); + return productConfigMapper.updateProductConfig(productConfig); + } + + /** + * 批量删除产品配置信息 + * + * @param productIds 需要删除的产品配置信息主键 + * @return 结果 + */ + @Override + public int deleteProductConfigByProductIds(Long[] productIds) + { + return productConfigMapper.deleteProductConfigByProductIds(productIds); + } + + /** + * 删除产品配置信息信息 + * + * @param productId 产品配置信息主键 + * @return 结果 + */ + @Override + public int deleteProductConfigByProductId(Long productId) + { + return productConfigMapper.deleteProductConfigByProductId(productId); + } +} diff --git a/ruoyi-plan/src/main/resources/mapper/dhc/DhcProductMapper.xml b/ruoyi-plan/src/main/resources/mapper/dhc/DhcProductMapper.xml index 3a00be6..dbf0046 100644 --- a/ruoyi-plan/src/main/resources/mapper/dhc/DhcProductMapper.xml +++ b/ruoyi-plan/src/main/resources/mapper/dhc/DhcProductMapper.xml @@ -8,13 +8,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - @@ -27,9 +25,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - @@ -42,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select product_id, product_line, product_line_name, project_num, Internal_model, product_category_large, product_category_middle, product_category_small, product_category, product_series, base_model, factory_model, customer_model, brand_id, brand_name, ir_datetime, dr_datetime, pack_way_code, product_net_weight, product_length, product_width, product_height, loading_quantity_20GP, loading_quantity_40GP, loading_quantity_40HQ, min_order_quantity, other_requirement, STATUS, approve_status, del_flag, create_by, create_time, update_by, update_time from dhc_product + select product_id, product_line, product_line_name, Internal_model, product_category_large, product_category_middle, product_category_small, product_category, base_model, factory_model, customer_model, brand_id, brand_name, ir_datetime, dr_datetime, pack_way_code, product_net_weight, product_length, product_width, product_height, min_order_quantity, other_requirement, STATUS, approve_status, del_flag, create_by, create_time, update_by, update_time from dhc_product + + + and PRODUCT_CODE = #{productCode} + and PRODUCT_NAME like concat('%', #{productName}, '%') + and CFG_MODULE_NAME like concat('%', #{cfgModuleName}, '%') + and CFG_LOOKUP_CODE = #{cfgLookupCode} + + + + + + + insert into product_config + + product_id, + PRODUCT_CODE, + PRODUCT_NAME, + CFG_MODULE_NAME, + CFG_LOOKUP_CODE, + del_flag, + create_by, + create_time, + update_by, + update_time, + + + #{productId}, + #{productCode}, + #{productName}, + #{cfgModuleName}, + #{cfgLookupCode}, + #{delFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update product_config + + PRODUCT_CODE = #{productCode}, + PRODUCT_NAME = #{productName}, + CFG_MODULE_NAME = #{cfgModuleName}, + CFG_LOOKUP_CODE = #{cfgLookupCode}, + del_flag = #{delFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where product_id = #{productId} + + + + delete from product_config where product_id = #{productId} + + + + delete from product_config where product_id in + + #{productId} + + + \ No newline at end of file