Administrator
2025-07-21 25ff701c08ebb6f98b9c9af4263dcbc8ac64c22c
feat(mall): 添加服装分类类型字段并优化相关逻辑

- 在 ApiAllSocialDto 和 ApiClothesCategoryInfoVo 中添加 type 字段,用于区分查询类型
- 在 ApiClothesOrderServiceImpl 中增加对自定义尺码的非空校验
- 更新 ApiClothesSocialServiceImpl 中的分类信息,添加类型字段
- 修改 ClothesSocialMapper.xml,增加对热门状态的查询条件
5 files modified
15 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/dto/clothes/ApiAllSocialDto.java 4 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesCategoryInfoVo.java 3 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/modules/ClothesSocialMapper.xml 3 ●●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/dto/clothes/ApiAllSocialDto.java
@@ -23,4 +23,8 @@
    @ApiModelProperty(value = "分类ID,查询全部传0")
    private Long categoryId;
    @NotNull(message = "类型不能为空")
    @ApiModelProperty(value = "类型 1-首页查询 2-社区查询")
    private Integer type;
}
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesOrderServiceImpl.java
@@ -505,6 +505,9 @@
                continue;
            } else if (ClothesOrderItemEnum.CUSTOMIZE.getCode() == item.getType()) {
                ClothesMemberStature clothesMemberStature = clothesMemberStatureMapper.selectById(item.getSkuId());
                if (ObjectUtil.isNull(clothesMemberStature)){
                    throw new FebsException("请选择您的自定义尺码");
                }
                orderItem.setItemId(clothesMemberStature.getId());
                orderItem.setName(clothesMemberStature.getName());
                orderItem.setPrice(BigDecimal.ZERO);
src/main/java/cc/mrbird/febs/mall/service/impl/ApiClothesSocialServiceImpl.java
@@ -69,6 +69,7 @@
        ApiClothesCategoryInfoVo apiClothesCategoryInfoVo = new ApiClothesCategoryInfoVo();
        apiClothesCategoryInfoVo.setId(0L);
        apiClothesCategoryInfoVo.setName("全部");
        apiClothesCategoryInfoVo.setType(2);
        vos.add(apiClothesCategoryInfoVo);
        List<ClothesSocialCategory> list = clothesSocialCategoryMapper.selectList(
                Wrappers.lambdaQuery(ClothesSocialCategory.class)
@@ -89,6 +90,7 @@
            ApiClothesCategoryInfoVo vo = new ApiClothesCategoryInfoVo();
            vo.setId(entity.getId());
            vo.setName(entity.getName());
            vo.setType(1);
            vos.add(vo);
        }
        return vos;
src/main/java/cc/mrbird/febs/mall/vo/clothes/ApiClothesCategoryInfoVo.java
@@ -13,4 +13,7 @@
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "类型 1-首页查询 2-社区查询")
    private Integer type;
}
src/main/resources/mapper/modules/ClothesSocialMapper.xml
@@ -48,6 +48,9 @@
                <if test="record.categoryId != 0">
                    and a.category_id = #{record.categoryId}
                </if>
                <if test="record.type == 1">
                    and a.hot_state = #{record.type}
                </if>
            </if>
        </where>
        order by a.hot_state desc, a.created_time desc