diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductGroupController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductCategoryController.java similarity index 58% rename from eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductGroupController.java rename to eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductCategoryController.java index 509384d2..39a739ff 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductGroupController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/TbPadProductCategoryController.java @@ -1,7 +1,7 @@ package cn.ysk.cashier.controller.product; -import cn.ysk.cashier.dto.product.PadProductGroupDTO; -import cn.ysk.cashier.mybatis.service.TbPadProductGroupService; +import cn.ysk.cashier.dto.product.PadProductCategoryDTO; +import cn.ysk.cashier.mybatis.service.TbPadProductCategoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.http.ResponseEntity; @@ -12,64 +12,64 @@ import java.util.List; import java.util.Map; /** - * Pad商品自定义分组 + * Pad商品自定义分类 * @author tankaikai * @since 2024-10-22 16:38 */ @RestController -@RequestMapping("/api/pad/productGroup") -@Api(tags="Pad商品自定义分组") -public class TbPadProductGroupController { +@RequestMapping("/api/pad/productCategory") +@Api(tags="Pad商品自定义分类") +public class TbPadProductCategoryController { @Resource - private TbPadProductGroupService mpPadProductGroupService; + private TbPadProductCategoryService mpPadProductCategoryService; @GetMapping("page") @ApiOperation("分页") public ResponseEntity page(@RequestParam Map params) { - Map page = mpPadProductGroupService.findPage(params); + Map page = mpPadProductCategoryService.findPage(params); return ResponseEntity.ok().body(page); } @GetMapping("{id}") @ApiOperation("详情") public ResponseEntity get(@PathVariable("id") Long id) { - PadProductGroupDTO data = mpPadProductGroupService.get(id); + PadProductCategoryDTO data = mpPadProductCategoryService.get(id); return ResponseEntity.ok().body(data); } @PostMapping @ApiOperation("保存") - public ResponseEntity save(@RequestBody PadProductGroupDTO dto) { - mpPadProductGroupService.save(dto); + public ResponseEntity save(@RequestBody PadProductCategoryDTO dto) { + mpPadProductCategoryService.save(dto); return ResponseEntity.ok().body(dto.getId()); } @PutMapping @ApiOperation("修改") - public ResponseEntity update(@RequestBody PadProductGroupDTO dto) { - mpPadProductGroupService.update(dto); + public ResponseEntity update(@RequestBody PadProductCategoryDTO dto) { + mpPadProductCategoryService.update(dto); return ResponseEntity.ok().body(dto.getId()); } @DeleteMapping("{id}") @ApiOperation("删除") public ResponseEntity delete(@PathVariable("id") Long id) { - mpPadProductGroupService.delete(id); + mpPadProductCategoryService.delete(id); return ResponseEntity.ok().build(); } @PostMapping("sort") @ApiOperation("排序") - public ResponseEntity sort(@RequestBody List sortList) { - mpPadProductGroupService.sort(sortList); + public ResponseEntity sort(@RequestBody List sortList) { + mpPadProductCategoryService.sort(sortList); return ResponseEntity.ok().build(); } @PostMapping("copy/{id}") @ApiOperation("复制") public ResponseEntity copy(@PathVariable("id") Long id) { - mpPadProductGroupService.copy(id); + mpPadProductCategoryService.copy(id); return ResponseEntity.ok().build(); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductGroupDTO.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductCategoryDTO.java similarity index 87% rename from eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductGroupDTO.java rename to eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductCategoryDTO.java index 00b74611..6868a2ce 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductGroupDTO.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/PadProductCategoryDTO.java @@ -9,13 +9,13 @@ import java.util.Date; import java.util.List; /** - * Pad商品自定义分组 + * Pad商品自定义分类 * * @author tankaikai * @since 2024-10-22 17:07 */ @Data -public class PadProductGroupDTO implements Serializable { +public class PadProductCategoryDTO implements Serializable { private static final long serialVersionUID = 1L; /** @@ -34,7 +34,7 @@ public class PadProductGroupDTO implements Serializable { /** * 商品分类id */ - private Long productGroupId; + private Long productCategoryId; /** * 店铺id */ @@ -72,9 +72,9 @@ public class PadProductGroupDTO implements Serializable { private String padLayoutName; /** - * 布局类型 + * 分类名称 */ - private String productGroupName; + private String productCategoryName; /** * 商品id列表 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupDetailMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryDetailMapper.java similarity index 53% rename from eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupDetailMapper.java rename to eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryDetailMapper.java index b9429073..bae5b410 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupDetailMapper.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryDetailMapper.java @@ -1,16 +1,16 @@ package cn.ysk.cashier.mybatis.mapper; -import cn.ysk.cashier.pojo.product.TbPadProductGroupDetail; +import cn.ysk.cashier.pojo.product.TbPadProductCategoryDetail; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** -* Pad商品自定义分组明细 +* Pad商品自定义分类明细 * * @author Tankaikai tankaikai@aliyun.com * @since 2.0 2024-10-22 */ @Mapper -public interface TbPadProductGroupDetailMapper extends BaseMapper { +public interface TbPadProductCategoryDetailMapper extends BaseMapper { } \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryMapper.java new file mode 100644 index 00000000..ea45da32 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductCategoryMapper.java @@ -0,0 +1,22 @@ +package cn.ysk.cashier.mybatis.mapper; + +import cn.ysk.cashier.dto.product.PadProductCategoryDTO; +import cn.ysk.cashier.pojo.product.TbPadProductCategory; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** +* Pad商品自定义分类 +* +* @author Tankaikai tankaikai@aliyun.com +* @since 2.0 2024-10-22 +*/ +@Mapper +public interface TbPadProductCategoryMapper extends BaseMapper { + + List findList(Map params); + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupMapper.java deleted file mode 100644 index 5eea4391..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbPadProductGroupMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package cn.ysk.cashier.mybatis.mapper; - -import cn.ysk.cashier.dto.product.PadProductGroupDTO; -import cn.ysk.cashier.pojo.product.TbPadProductGroup; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; -import java.util.Map; - -/** -* Pad商品自定义分组 -* -* @author Tankaikai tankaikai@aliyun.com -* @since 2.0 2024-10-22 -*/ -@Mapper -public interface TbPadProductGroupMapper extends BaseMapper { - - List findList(Map params); - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryDetailService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryDetailService.java new file mode 100644 index 00000000..fddc4fa7 --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryDetailService.java @@ -0,0 +1,14 @@ +package cn.ysk.cashier.mybatis.service; + +import cn.ysk.cashier.pojo.product.TbPadProductCategoryDetail; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * Pad商品自定义分类明细 + * + * @author Tankaikai tankaikai@aliyun.com + * @since 2.0 2024-10-22 + */ +public interface TbPadProductCategoryDetailService extends IService { + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryService.java new file mode 100644 index 00000000..10dcd1bc --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductCategoryService.java @@ -0,0 +1,32 @@ +package cn.ysk.cashier.mybatis.service; + +import cn.ysk.cashier.dto.product.PadProductCategoryDTO; +import cn.ysk.cashier.pojo.product.TbPadProductCategory; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; +import java.util.Map; + +/** + * Pad商品自定义分类 + * + * @author Tankaikai tankaikai@aliyun.com + * @since 2.0 2024-10-22 + */ +public interface TbPadProductCategoryService extends IService { + + Map findPage(Map params); + + PadProductCategoryDTO get(Long id); + + void save(PadProductCategoryDTO dto); + + void update(PadProductCategoryDTO dto); + + void sort(List sortList); + + void delete(Long id); + + void copy(Long id); + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupDetailService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupDetailService.java deleted file mode 100644 index 82ee7bf9..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupDetailService.java +++ /dev/null @@ -1,14 +0,0 @@ -package cn.ysk.cashier.mybatis.service; - -import cn.ysk.cashier.pojo.product.TbPadProductGroupDetail; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * Pad商品自定义分组明细 - * - * @author Tankaikai tankaikai@aliyun.com - * @since 2.0 2024-10-22 - */ -public interface TbPadProductGroupDetailService extends IService { - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupService.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupService.java deleted file mode 100644 index cf5a7383..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/TbPadProductGroupService.java +++ /dev/null @@ -1,32 +0,0 @@ -package cn.ysk.cashier.mybatis.service; - -import cn.ysk.cashier.dto.product.PadProductGroupDTO; -import cn.ysk.cashier.pojo.product.TbPadProductGroup; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; -import java.util.Map; - -/** - * Pad商品自定义分组 - * - * @author Tankaikai tankaikai@aliyun.com - * @since 2.0 2024-10-22 - */ -public interface TbPadProductGroupService extends IService { - - Map findPage(Map params); - - PadProductGroupDTO get(Long id); - - void save(PadProductGroupDTO dto); - - void update(PadProductGroupDTO dto); - - void sort(List sortList); - - void delete(Long id); - - void copy(Long id); - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryDetailServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryDetailServiceImpl.java new file mode 100644 index 00000000..50b9c13f --- /dev/null +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryDetailServiceImpl.java @@ -0,0 +1,28 @@ +package cn.ysk.cashier.mybatis.service.impl; + +import cn.ysk.cashier.mybatis.mapper.TbPadProductCategoryDetailMapper; +import cn.ysk.cashier.mybatis.service.TbPadProductCategoryDetailService; +import cn.ysk.cashier.pojo.product.TbPadProductCategoryDetail; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * Pad商品自定义分类明细 + * + * @author Tankaikai tankaikai@aliyun.com + * @since 2.0 2024-10-22 + */ +@Service +public class TbPadProductCategoryDetailServiceImpl extends ServiceImpl implements TbPadProductCategoryDetailService { + + public QueryWrapper getWrapper(Map params){ + QueryWrapper wrapper = new QueryWrapper<>(); + + wrapper.orderByDesc("id"); + return wrapper; + } + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java similarity index 69% rename from eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupServiceImpl.java rename to eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java index 6fe70be0..bd0deb64 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductCategoryServiceImpl.java @@ -4,16 +4,16 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.map.MapProxy; -import cn.ysk.cashier.dto.product.PadProductGroupDTO; +import cn.ysk.cashier.dto.product.PadProductCategoryDTO; import cn.ysk.cashier.exception.BadRequestException; import cn.ysk.cashier.mybatis.mapper.TbPadLayoutMapper; -import cn.ysk.cashier.mybatis.mapper.TbPadProductGroupDetailMapper; -import cn.ysk.cashier.mybatis.mapper.TbPadProductGroupMapper; +import cn.ysk.cashier.mybatis.mapper.TbPadProductCategoryDetailMapper; +import cn.ysk.cashier.mybatis.mapper.TbPadProductCategoryMapper; import cn.ysk.cashier.mybatis.mapper.TbProductMapper; -import cn.ysk.cashier.mybatis.service.TbPadProductGroupService; +import cn.ysk.cashier.mybatis.service.TbPadProductCategoryService; import cn.ysk.cashier.pojo.product.TbPadLayout; -import cn.ysk.cashier.pojo.product.TbPadProductGroup; -import cn.ysk.cashier.pojo.product.TbPadProductGroupDetail; +import cn.ysk.cashier.pojo.product.TbPadProductCategory; +import cn.ysk.cashier.pojo.product.TbPadProductCategoryDetail; import cn.ysk.cashier.pojo.product.TbProduct; import cn.ysk.cashier.utils.PageUtil; import com.baomidou.mybatisplus.core.metadata.OrderItem; @@ -31,19 +31,19 @@ import java.util.Map; import java.util.stream.Collectors; /** - * Pad商品自定义分组 + * Pad商品自定义分类 * * @author Tankaikai tankaikai@aliyun.com * @since 2.0 2024-10-22 */ @Service -public class TbPadProductGroupServiceImpl extends ServiceImpl implements TbPadProductGroupService { +public class TbPadProductCategoryServiceImpl extends ServiceImpl implements TbPadProductCategoryService { @Resource private TbPadLayoutMapper tbPadLayoutMapper; @Resource - private TbPadProductGroupDetailMapper tbPadProductGroupDetailMapper; + private TbPadProductCategoryDetailMapper tbPadProductCategoryDetailMapper; @Resource private TbProductMapper tbProductMapper; @@ -52,16 +52,16 @@ public class TbPadProductGroupServiceImpl extends ServiceImpl page = new Page<>(pageNum, pageSize); + Page page = new Page<>(pageNum, pageSize); page.addOrder(OrderItem.asc("sort")); params.put("page", page); - List list = baseMapper.findList(params); + List list = baseMapper.findList(params); return PageUtil.toPlusPage(list, Convert.toInt(page.getTotal())); } @Override - public PadProductGroupDTO get(Long id) { - TbPadProductGroup entity = baseMapper.selectById(id); + public PadProductCategoryDTO get(Long id) { + TbPadProductCategory entity = baseMapper.selectById(id); if (entity == null) { throw new BadRequestException("id对应的数据不存在"); } @@ -72,14 +72,14 @@ public class TbPadProductGroupServiceImpl extends ServiceImpl params = new HashMap<>(2); params.put("id", id); params.put("shopId", entity.getShopId()); - List list = baseMapper.findList(params); - PadProductGroupDTO dto = list.get(0); - if(entity.getProductGroupId().longValue() == 0L){ - dto.setProductGroupName("推荐菜"); + List list = baseMapper.findList(params); + PadProductCategoryDTO dto = list.get(0); + if(entity.getProductCategoryId().longValue() == 0L){ + dto.setProductCategoryName("推荐菜"); } - List subList = tbPadProductGroupDetailMapper.selectList(Wrappers.lambdaQuery().eq(TbPadProductGroupDetail::getPadProductGroupId, entity.getId())); + List subList = tbPadProductCategoryDetailMapper.selectList(Wrappers.lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId())); if(CollUtil.isNotEmpty(subList)){ - List productIdList = subList.stream().map(TbPadProductGroupDetail::getProductId).collect(Collectors.toList()); + List productIdList = subList.stream().map(TbPadProductCategoryDetail::getProductId).collect(Collectors.toList()); dto.setProductIdList(productIdList); List> splitIdList = CollUtil.split(productIdList, 10); List productList = dto.getProductList(); @@ -94,14 +94,14 @@ public class TbPadProductGroupServiceImpl extends ServiceImpl maximum.intValue()) { throw new BadRequestException("商品数量不能超过布局版式最大限制:" + maximum.intValue()); } - TbPadProductGroup entity = new TbPadProductGroup(); + TbPadProductCategory entity = new TbPadProductCategory(); BeanUtil.copyProperties(dto, entity); entity.setCreateTime(new Date()); super.save(entity); for (Long productId : productIdList) { - TbPadProductGroupDetail subEntity = new TbPadProductGroupDetail(); + TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail(); subEntity.setProductId(productId); - subEntity.setPadProductGroupId(entity.getId()); + subEntity.setPadProductCategoryId(entity.getId()); subEntity.setCreateTime(new Date()); - tbPadProductGroupDetailMapper.insert(subEntity); + tbPadProductCategoryDetailMapper.insert(subEntity); } } @Override @Transactional(rollbackFor = Exception.class) - public void update(PadProductGroupDTO dto) { + public void update(PadProductCategoryDTO dto) { Long id = dto.getId(); if (id == null) { throw new BadRequestException("id不能为空"); @@ -154,9 +154,9 @@ public class TbPadProductGroupServiceImpl extends ServiceImpl maximum.intValue()) { throw new BadRequestException("商品数量不能超过布局版式最大限制:" + maximum.intValue()); } - TbPadProductGroup entity = baseMapper.selectById(id); + TbPadProductCategory entity = baseMapper.selectById(id); if (entity == null) { throw new BadRequestException("id对应的数据不存在"); } @@ -192,23 +192,23 @@ public class TbPadProductGroupServiceImpl extends ServiceImpllambdaQuery().eq(TbPadProductGroupDetail::getPadProductGroupId, entity.getId())); - TbPadProductGroupDetail subEntity = new TbPadProductGroupDetail(); + tbPadProductCategoryDetailMapper.delete(Wrappers.lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, entity.getId())); + TbPadProductCategoryDetail subEntity = new TbPadProductCategoryDetail(); subEntity.setProductId(productId); - subEntity.setPadProductGroupId(entity.getId()); + subEntity.setPadProductCategoryId(entity.getId()); subEntity.setCreateTime(new Date()); - tbPadProductGroupDetailMapper.insert(subEntity); + tbPadProductCategoryDetailMapper.insert(subEntity); } } @Override @Transactional(rollbackFor = Exception.class) - public void sort(List sortList) { + public void sort(List sortList) { if(CollUtil.isEmpty(sortList)) { throw new BadRequestException("排序列表不能为空"); } - for (PadProductGroupDTO dto : sortList) { - super.update(null, Wrappers.lambdaUpdate().eq(TbPadProductGroup::getId, dto.getId()).set(TbPadProductGroup::getSort, dto.getSort())); + for (PadProductCategoryDTO dto : sortList) { + super.update(null, Wrappers.lambdaUpdate().eq(TbPadProductCategory::getId, dto.getId()).set(TbPadProductCategory::getSort, dto.getSort())); } } @@ -216,13 +216,13 @@ public class TbPadProductGroupServiceImpl extends ServiceImpllambdaQuery().eq(TbPadProductGroupDetail::getPadProductGroupId, id)); + tbPadProductCategoryDetailMapper.delete(Wrappers.lambdaQuery().eq(TbPadProductCategoryDetail::getPadProductCategoryId, id)); } @Override @Transactional(rollbackFor = Exception.class) public void copy(Long id) { - PadProductGroupDTO dto = get(id); + PadProductCategoryDTO dto = get(id); dto.setId(null); dto.setCreateTime(null); dto.setUpdateTime(null); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupDetailServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupDetailServiceImpl.java deleted file mode 100644 index c891202b..00000000 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbPadProductGroupDetailServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.ysk.cashier.mybatis.service.impl; - -import cn.ysk.cashier.mybatis.mapper.TbPadProductGroupDetailMapper; -import cn.ysk.cashier.mybatis.service.TbPadProductGroupDetailService; -import cn.ysk.cashier.pojo.product.TbPadProductGroupDetail; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.Map; - -/** - * Pad商品自定义分组明细 - * - * @author Tankaikai tankaikai@aliyun.com - * @since 2.0 2024-10-22 - */ -@Service -public class TbPadProductGroupDetailServiceImpl extends ServiceImpl implements TbPadProductGroupDetailService { - - public QueryWrapper getWrapper(Map params){ - QueryWrapper wrapper = new QueryWrapper<>(); - - wrapper.orderByDesc("id"); - return wrapper; - } - -} \ No newline at end of file diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroup.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategory.java similarity index 86% rename from eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroup.java rename to eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategory.java index bbbcd49f..bf990170 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroup.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategory.java @@ -9,15 +9,15 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * Pad商品自定义分组 + * Pad商品自定义分类 * * @author Tankaikai tankaikai@aliyun.com * @since 2.0 2024-10-22 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("tb_pad_product_group") -public class TbPadProductGroup { +@TableName("tb_pad_product_category") +public class TbPadProductCategory { private static final long serialVersionUID = 1L; /** @@ -36,7 +36,7 @@ public class TbPadProductGroup { /** * 商品分类id */ - private Long productGroupId; + private Long productCategoryId; /** * 店铺id */ diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroupDetail.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategoryDetail.java similarity index 76% rename from eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroupDetail.java rename to eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategoryDetail.java index 3f1da24e..51248a3f 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductGroupDetail.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbPadProductCategoryDetail.java @@ -9,15 +9,15 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * Pad商品自定义分组明细 + * Pad商品自定义分类明细 * * @author Tankaikai tankaikai@aliyun.com * @since 2.0 2024-10-22 */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("tb_pad_product_group_detail") -public class TbPadProductGroupDetail { +@TableName("tb_pad_product_category_detail") +public class TbPadProductCategoryDetail { private static final long serialVersionUID = 1L; /** @@ -26,9 +26,9 @@ public class TbPadProductGroupDetail { @TableId(type = IdType.AUTO) private Long id; /** - * Pad商品自定义分组id + * Pad商品自定义分类id */ - private Long padProductGroupId; + private Long padProductCategoryId; /** * 商品id */ diff --git a/eladmin-system/src/main/resources/mapper/plus/TbPadProductGroupMapper.xml b/eladmin-system/src/main/resources/mapper/plus/TbPadProductCategoryMapper.xml similarity index 70% rename from eladmin-system/src/main/resources/mapper/plus/TbPadProductGroupMapper.xml rename to eladmin-system/src/main/resources/mapper/plus/TbPadProductCategoryMapper.xml index 2aee8bc6..5f921c14 100644 --- a/eladmin-system/src/main/resources/mapper/plus/TbPadProductGroupMapper.xml +++ b/eladmin-system/src/main/resources/mapper/plus/TbPadProductCategoryMapper.xml @@ -1,18 +1,18 @@ - + - SELECT t1.*, - t3.name as productGroupName, + t3.name as productCategoryName, GROUP_CONCAT(t4.name) as productNames, t5.code as padLayoutCode, t5.name as padLayoutName FROM - tb_pad_product_group t1 - LEFT JOIN tb_pad_product_group_detail t2 on t1.id = t2.pad_product_group_id - LEFT JOIN tb_product_group t3 on t1.product_group_id = t3.id + tb_pad_product_category t1 + LEFT JOIN tb_pad_product_category_detail t2 on t1.id = t2.pad_product_category_id + LEFT JOIN tb_shop_category t3 on t1.product_category_id = t3.id LEFT JOIN tb_product t4 on t2.product_id = t4.id LEFT JOIN tb_pad_layout t5 on t1.pad_layout_id = t5.id @@ -23,8 +23,8 @@ and t1.custom_name like concat(#{customName},'%') - - and t1.product_group_id = #{productGroupId} + + and t1.product_category_id = #{productCategoryId} and t1.pad_layout_id = #{padLayoutId}