From d6544a787fff078b98d977733e445afb3907f773 Mon Sep 17 00:00:00 2001 From: Tom Li Date: Wed, 3 Dec 2025 18:08:09 +0800 Subject: [PATCH] =?UTF-8?q?RelCatalogProductEntity=E3=80=82=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RelCatalogProductController.java | 161 ++++++++++++++++++ .../jinchao/excel/RelCatalogProductExcel.java | 85 +++++++++ .../mapper/RelCatalogProductMapper.java | 62 +++++++ .../mapper/RelCatalogProductMapper.xml | 30 ++++ .../pojo/dto/RelCatalogProductDTO.java | 45 +++++ .../pojo/entity/RelCatalogProductEntity.java | 60 +++++++ .../jinchao/pojo/vo/RelCatalogProductVO.java | 45 +++++ .../service/IRelCatalogProductService.java | 61 +++++++ .../impl/RelCatalogProductServiceImpl.java | 63 +++++++ .../wrapper/RelCatalogProductWrapper.java | 59 +++++++ 10 files changed, 671 insertions(+) create mode 100644 src/main/java/org/springblade/modules/jinchao/controller/RelCatalogProductController.java create mode 100644 src/main/java/org/springblade/modules/jinchao/excel/RelCatalogProductExcel.java create mode 100644 src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.java create mode 100644 src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.xml create mode 100644 src/main/java/org/springblade/modules/jinchao/pojo/dto/RelCatalogProductDTO.java create mode 100644 src/main/java/org/springblade/modules/jinchao/pojo/entity/RelCatalogProductEntity.java create mode 100644 src/main/java/org/springblade/modules/jinchao/pojo/vo/RelCatalogProductVO.java create mode 100644 src/main/java/org/springblade/modules/jinchao/service/IRelCatalogProductService.java create mode 100644 src/main/java/org/springblade/modules/jinchao/service/impl/RelCatalogProductServiceImpl.java create mode 100644 src/main/java/org/springblade/modules/jinchao/wrapper/RelCatalogProductWrapper.java diff --git a/src/main/java/org/springblade/modules/jinchao/controller/RelCatalogProductController.java b/src/main/java/org/springblade/modules/jinchao/controller/RelCatalogProductController.java new file mode 100644 index 0000000..afe68c4 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/controller/RelCatalogProductController.java @@ -0,0 +1,161 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.controller; + +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import lombok.AllArgsConstructor; +import jakarta.validation.Valid; + +import org.springblade.core.secure.BladeUser; +import org.springblade.core.secure.annotation.IsAdmin; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import org.springblade.modules.jinchao.pojo.vo.RelCatalogProductVO; +import org.springblade.modules.jinchao.excel.RelCatalogProductExcel; +import org.springblade.modules.jinchao.wrapper.RelCatalogProductWrapper; +import org.springblade.modules.jinchao.service.IRelCatalogProductService; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.excel.util.ExcelUtil; +import org.springblade.core.tool.constant.BladeConstant; +import java.util.Map; +import java.util.List; +import jakarta.servlet.http.HttpServletResponse; + +/** + * [产品目录][产品]关联表 控制器 + * + * @author BladeX + * @since 2025-12-03 + */ +@RestController +@AllArgsConstructor +@RequestMapping("jinchao/relCatalogProduct") +@Tag(name = "[产品目录][产品]关联表", description = "[产品目录][产品]关联表接口") +public class RelCatalogProductController extends BladeController { + + private final IRelCatalogProductService relCatalogProductService; + + /** + * [产品目录][产品]关联表 详情 + */ + @GetMapping("/detail") + @ApiOperationSupport(order = 1) + @Operation(summary = "详情", description = "传入relCatalogProduct") + public R detail(RelCatalogProductEntity relCatalogProduct) { + RelCatalogProductEntity detail = relCatalogProductService.getOne(Condition.getQueryWrapper(relCatalogProduct)); + return R.data(RelCatalogProductWrapper.build().entityVO(detail)); + } + /** + * [产品目录][产品]关联表 分页 + */ + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @Operation(summary = "分页", description = "传入relCatalogProduct") + public R> list(@Parameter(hidden = true) @RequestParam Map relCatalogProduct, Query query) { + IPage pages = relCatalogProductService.page(Condition.getPage(query), Condition.getQueryWrapper(relCatalogProduct, RelCatalogProductEntity.class)); + return R.data(RelCatalogProductWrapper.build().pageVO(pages)); + } + + /** + * [产品目录][产品]关联表 自定义分页 + */ + @GetMapping("/page") + @ApiOperationSupport(order = 3) + @Operation(summary = "分页", description = "传入relCatalogProduct") + public R> page(RelCatalogProductVO relCatalogProduct, Query query) { + IPage pages = relCatalogProductService.selectRelCatalogProductPage(Condition.getPage(query), relCatalogProduct); + return R.data(pages); + } + + /** + * [产品目录][产品]关联表 新增 + */ + @PostMapping("/save") + @ApiOperationSupport(order = 4) + @Operation(summary = "新增", description = "传入relCatalogProduct") + public R save(@Valid @RequestBody RelCatalogProductEntity relCatalogProduct) { + return R.status(relCatalogProductService.save(relCatalogProduct)); + } + + /** + * [产品目录][产品]关联表 修改 + */ + @PostMapping("/update") + @ApiOperationSupport(order = 5) + @Operation(summary = "修改", description = "传入relCatalogProduct") + public R update(@Valid @RequestBody RelCatalogProductEntity relCatalogProduct) { + return R.status(relCatalogProductService.updateById(relCatalogProduct)); + } + + /** + * [产品目录][产品]关联表 新增或修改 + */ + @PostMapping("/submit") + @ApiOperationSupport(order = 6) + @Operation(summary = "新增或修改", description = "传入relCatalogProduct") + public R submit(@Valid @RequestBody RelCatalogProductEntity relCatalogProduct) { + return R.status(relCatalogProductService.saveOrUpdate(relCatalogProduct)); + } + + /** + * [产品目录][产品]关联表 删除 + */ + @PostMapping("/remove") + @ApiOperationSupport(order = 7) + @Operation(summary = "逻辑删除", description = "传入ids") + public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { + return R.status(relCatalogProductService.deleteLogic(Func.toLongList(ids))); + } + + + /** + * 导出数据 + */ + @IsAdmin + @GetMapping("/export-relCatalogProduct") + @ApiOperationSupport(order = 9) + @Operation(summary = "导出数据", description = "传入relCatalogProduct") + public void exportRelCatalogProduct(@Parameter(hidden = true) @RequestParam Map relCatalogProduct, BladeUser bladeUser, HttpServletResponse response) { + QueryWrapper queryWrapper = Condition.getQueryWrapper(relCatalogProduct, RelCatalogProductEntity.class); + //if (!AuthUtil.isAdministrator()) { + // queryWrapper.lambda().eq(RelCatalogProduct::getTenantId, bladeUser.getTenantId()); + //} + //queryWrapper.lambda().eq(RelCatalogProductEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); + List list = relCatalogProductService.exportRelCatalogProduct(queryWrapper); + ExcelUtil.export(response, "[产品目录][产品]关联表数据" + DateUtil.time(), "[产品目录][产品]关联表数据表", list, RelCatalogProductExcel.class); + } + +} diff --git a/src/main/java/org/springblade/modules/jinchao/excel/RelCatalogProductExcel.java b/src/main/java/org/springblade/modules/jinchao/excel/RelCatalogProductExcel.java new file mode 100644 index 0000000..1a67c6f --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/excel/RelCatalogProductExcel.java @@ -0,0 +1,85 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.excel; + + +import lombok.Data; + +import cn.idev.excel.annotation.ExcelProperty; +import cn.idev.excel.annotation.write.style.ColumnWidth; +import cn.idev.excel.annotation.write.style.ContentRowHeight; +import cn.idev.excel.annotation.write.style.HeadRowHeight; +import java.io.Serializable; +import java.io.Serial; + + +/** + * [产品目录][产品]关联表 Excel实体类 + * + * @author BladeX + * @since 2025-12-03 + */ +@Data +@ColumnWidth(25) +@HeadRowHeight(20) +@ContentRowHeight(18) +public class RelCatalogProductExcel implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @ColumnWidth(20) + @ExcelProperty("主键") + private Long id; + /** + * 租户ID + */ + @ColumnWidth(20) + @ExcelProperty("租户ID") + private String tenantId; + /** + * 小类[产品目录]id + */ + @ColumnWidth(20) + @ExcelProperty("小类[产品目录]id") + private Long catalogId; + /** + * [产品]id + */ + @ColumnWidth(20) + @ExcelProperty("[产品]id") + private Long productId; + /** + * 是否已删除 + */ + @ColumnWidth(20) + @ExcelProperty("是否已删除") + private Integer isDeleted; + +} diff --git a/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.java b/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.java new file mode 100644 index 0000000..d882c58 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.java @@ -0,0 +1,62 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.mapper; + +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import org.springblade.modules.jinchao.pojo.vo.RelCatalogProductVO; +import org.springblade.modules.jinchao.excel.RelCatalogProductExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * [产品目录][产品]关联表 Mapper 接口 + * + * @author BladeX + * @since 2025-12-03 + */ +public interface RelCatalogProductMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page 分页参数 + * @param relCatalogProduct 查询参数 + * @return List + */ + List selectRelCatalogProductPage(IPage page, RelCatalogProductVO relCatalogProduct); + + + /** + * 获取导出数据 + * + * @param queryWrapper 查询条件 + * @return List + */ + List exportRelCatalogProduct(@Param("ew") Wrapper queryWrapper); +} diff --git a/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.xml b/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.xml new file mode 100644 index 0000000..0f021b7 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/mapper/RelCatalogProductMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/springblade/modules/jinchao/pojo/dto/RelCatalogProductDTO.java b/src/main/java/org/springblade/modules/jinchao/pojo/dto/RelCatalogProductDTO.java new file mode 100644 index 0000000..ceeecad --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/pojo/dto/RelCatalogProductDTO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.pojo.dto; + +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.io.Serial; + +/** + * [产品目录][产品]关联表 数据传输对象实体类 + * + * @author BladeX + * @since 2025-12-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class RelCatalogProductDTO extends RelCatalogProductEntity { + @Serial + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/springblade/modules/jinchao/pojo/entity/RelCatalogProductEntity.java b/src/main/java/org/springblade/modules/jinchao/pojo/entity/RelCatalogProductEntity.java new file mode 100644 index 0000000..1b4ee74 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/pojo/entity/RelCatalogProductEntity.java @@ -0,0 +1,60 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.pojo.entity; + +import lombok.Data; +import io.swagger.v3.oas.annotations.media.Schema; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; +import java.io.Serial; + +/** + * [产品目录][产品]关联表 实体类 + * + * @author BladeX + * @since 2025-12-03 + */ +@Data +@TableName("jc_rel_catalog_product") +@Schema(description = "RelCatalogProduct对象") +@EqualsAndHashCode(callSuper = true) +public class RelCatalogProductEntity extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 小类[产品目录]id + */ + @Schema(description = "小类[产品目录]id") + private Long catalogId; + /** + * [产品]id + */ + @Schema(description = "[产品]id") + private Long productId; +} diff --git a/src/main/java/org/springblade/modules/jinchao/pojo/vo/RelCatalogProductVO.java b/src/main/java/org/springblade/modules/jinchao/pojo/vo/RelCatalogProductVO.java new file mode 100644 index 0000000..798ad49 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/pojo/vo/RelCatalogProductVO.java @@ -0,0 +1,45 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.pojo.vo; + +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.io.Serial; + +/** + * [产品目录][产品]关联表 视图实体类 + * + * @author BladeX + * @since 2025-12-03 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class RelCatalogProductVO extends RelCatalogProductEntity { + @Serial + private static final long serialVersionUID = 1L; + +} diff --git a/src/main/java/org/springblade/modules/jinchao/service/IRelCatalogProductService.java b/src/main/java/org/springblade/modules/jinchao/service/IRelCatalogProductService.java new file mode 100644 index 0000000..645818d --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/service/IRelCatalogProductService.java @@ -0,0 +1,61 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import org.springblade.modules.jinchao.pojo.vo.RelCatalogProductVO; +import org.springblade.modules.jinchao.excel.RelCatalogProductExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * [产品目录][产品]关联表 服务类 + * + * @author BladeX + * @since 2025-12-03 + */ +public interface IRelCatalogProductService extends BaseService { + /** + * 自定义分页 + * + * @param page 分页参数 + * @param relCatalogProduct 查询参数 + * @return IPage + */ + IPage selectRelCatalogProductPage(IPage page, RelCatalogProductVO relCatalogProduct); + + + /** + * 导出数据 + * + * @param queryWrapper 查询条件 + * @return List + */ + List exportRelCatalogProduct(Wrapper queryWrapper); + +} diff --git a/src/main/java/org/springblade/modules/jinchao/service/impl/RelCatalogProductServiceImpl.java b/src/main/java/org/springblade/modules/jinchao/service/impl/RelCatalogProductServiceImpl.java new file mode 100644 index 0000000..1642135 --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/service/impl/RelCatalogProductServiceImpl.java @@ -0,0 +1,63 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.service.impl; + +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import org.springblade.modules.jinchao.pojo.vo.RelCatalogProductVO; +import org.springblade.modules.jinchao.excel.RelCatalogProductExcel; +import org.springblade.modules.jinchao.mapper.RelCatalogProductMapper; +import org.springblade.modules.jinchao.service.IRelCatalogProductService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * [产品目录][产品]关联表 服务实现类 + * + * @author BladeX + * @since 2025-12-03 + */ +@Service +public class RelCatalogProductServiceImpl extends BaseServiceImpl implements IRelCatalogProductService { + + @Override + public IPage selectRelCatalogProductPage(IPage page, RelCatalogProductVO relCatalogProduct) { + return page.setRecords(baseMapper.selectRelCatalogProductPage(page, relCatalogProduct)); + } + + + @Override + public List exportRelCatalogProduct(Wrapper queryWrapper) { + List relCatalogProductList = baseMapper.exportRelCatalogProduct(queryWrapper); + //relCatalogProductList.forEach(relCatalogProduct -> { + // relCatalogProduct.setTypeName(DictCache.getValue(DictEnum.YES_NO, RelCatalogProduct.getType())); + //}); + return relCatalogProductList; + } + +} diff --git a/src/main/java/org/springblade/modules/jinchao/wrapper/RelCatalogProductWrapper.java b/src/main/java/org/springblade/modules/jinchao/wrapper/RelCatalogProductWrapper.java new file mode 100644 index 0000000..121e84d --- /dev/null +++ b/src/main/java/org/springblade/modules/jinchao/wrapper/RelCatalogProductWrapper.java @@ -0,0 +1,59 @@ +/** + * BladeX Commercial License Agreement + * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. + *

+ * Use of this software is governed by the Commercial License Agreement + * obtained after purchasing a license from BladeX. + *

+ * 1. This software is for development use only under a valid license + * from BladeX. + *

+ * 2. Redistribution of this software's source code to any third party + * without a commercial license is strictly prohibited. + *

+ * 3. Licensees may copyright their own code but cannot use segments + * from this software for such purposes. Copyright of this software + * remains with BladeX. + *

+ * Using this software signifies agreement to this License, and the software + * must not be used for illegal purposes. + *

+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is + * not liable for any claims arising from secondary or illegal development. + *

+ * Author: Chill Zhuang (bladejava@qq.com) + */ +package org.springblade.modules.jinchao.wrapper; + +import org.springblade.core.mp.support.BaseEntityWrapper; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.modules.jinchao.pojo.entity.RelCatalogProductEntity; +import org.springblade.modules.jinchao.pojo.vo.RelCatalogProductVO; +import java.util.Objects; + +/** + * [产品目录][产品]关联表 包装类,返回视图层所需的字段 + * + * @author BladeX + * @since 2025-12-03 + */ +public class RelCatalogProductWrapper extends BaseEntityWrapper { + + public static RelCatalogProductWrapper build() { + return new RelCatalogProductWrapper(); + } + + @Override + public RelCatalogProductVO entityVO(RelCatalogProductEntity relCatalogProduct) { + RelCatalogProductVO relCatalogProductVO = Objects.requireNonNull(BeanUtil.copyProperties(relCatalogProduct, RelCatalogProductVO.class)); + + //User createUser = UserCache.getUser(relCatalogProduct.getCreateUser()); + //User updateUser = UserCache.getUser(relCatalogProduct.getUpdateUser()); + //relCatalogProductVO.setCreateUserName(createUser.getName()); + //relCatalogProductVO.setUpdateUserName(updateUser.getName()); + + return relCatalogProductVO; + } + + +}