Administrator
2025-07-09 44aa87717297bb4fca4bb83ba631646a87749174
src/main/java/cc/mrbird/febs/mall/controller/clothes/AdminClothesTypeController.java
@@ -10,11 +10,11 @@
import cc.mrbird.febs.common.utils.excl.ExcelUtil;
import cc.mrbird.febs.common.utils.excl.ExcelVersion;
import cc.mrbird.febs.common.utils.excl.ResponseHeadUtil;
import cc.mrbird.febs.mall.dto.AdminHappyActivityCategoryDto;
import cc.mrbird.febs.mall.dto.DeliverGoodsDto;
import cc.mrbird.febs.mall.dto.clothes.AdminClothesDeliverGoodsDto;
import cc.mrbird.febs.mall.dto.clothes.AdminClothesOrderListDto;
import cc.mrbird.febs.mall.dto.clothes.AdminClothesRefundOrderDto;
import cc.mrbird.febs.mall.dto.clothes.AdminClothesTypeInfoDto;
import cc.mrbird.febs.mall.dto.activity.AdminCategoryAddDto;
import cc.mrbird.febs.mall.dto.activity.AdminCategoryUpdateDto;
import cc.mrbird.febs.mall.dto.clothes.*;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.service.ClothesTypeService;
import cn.hutool.core.collection.CollUtil;
@@ -51,6 +51,215 @@
    private final ClothesTypeService clothesTypeService;
    /**
     * 分类列表
     * @return
     */
    @GetMapping("groupList")
    public FebsResponse groupList(AdminClothesSocialCategoryDto dto, QueryRequest request) {
        Map<String, Object> data = getDataTable(clothesTypeService.getGroupList(dto, request));
        return new FebsResponse().success().data(data);
    }
    /**
     * 分类-新增
     */
    @PostMapping("addGroup")
    @ControllerEndpoint(operation = "分类-新增", exceptionMessage = "操作失败")
    public FebsResponse addGroup(@RequestBody @Valid AdminClothesCategoryAddDto dto) {
        return clothesTypeService.addGroup(dto);
    }
    /**
     * 分类-删除
     */
    @GetMapping("groupDelete/{id}")
    @ControllerEndpoint(operation = "选项-删除", exceptionMessage = "操作失败")
    public FebsResponse groupDelete(@NotNull(message = "{required}") @PathVariable Long id) {
        return clothesTypeService.groupDelete(id);
    }
    /**
     * 分类-更新
     */
    @PostMapping("groupUpdate")
    @ControllerEndpoint(operation = "分类-更新", exceptionMessage = "操作失败")
    public FebsResponse groupUpdate(@RequestBody @Valid AdminClothesCategoryUpdateDto dto) {
        return clothesTypeService.groupUpdate(dto);
    }
    /**
     * 分类-开启
     */
    @GetMapping("groupState/{id}/{type}")
    @ControllerEndpoint(operation = "分类-开启", exceptionMessage = "操作失败")
    public FebsResponse groupState(
            @NotNull(message = "{required}") @PathVariable Long id,
            @NotNull(message = "{required}") @PathVariable Integer type) {
        return clothesTypeService.groupState(id,type);
    }
    /**
     * 社区列表
     *
     * @param dto
     * @param request
     * @return
     */
    @GetMapping("socialList")
    public FebsResponse socialList(AdminClothesSocialListDto dto, QueryRequest request) {
        String startTime = dto.getStartTime();
        String endTime = dto.getEndTime();
        if(StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)){
            DateTime dateStartTime= DateUtil.parseDate(startTime);
            DateTime dateEndTime = DateUtil.parseDate(endTime);
            int compare = DateUtil.compare(dateStartTime, dateEndTime);
            if(compare >= 0){
                return new FebsResponse().fail().message("请输入正确的开始时间和结束时间");
            }
        }
        Map<String, Object> data = getDataTable(clothesTypeService.getSocialListInPage(dto, request));
        return new FebsResponse().success().data(data);
    }
    /**
     * 社区-新增
     */
    @PostMapping("socialAdd")
    @ControllerEndpoint(operation = "新增", exceptionMessage = "操作失败")
    public FebsResponse socialAdd(@RequestBody ClothesSocial dto) {
        return clothesTypeService.socialAdd(dto);
    }
    /**
     * 社区-更新
     */
    @PostMapping("socialUpdate")
    @ControllerEndpoint(operation = "社区-更新", exceptionMessage = "操作失败")
    public FebsResponse socialUpdate(@RequestBody ClothesSocial dto) {
        return clothesTypeService.socialUpdate(dto);
    }
    /**
     * 社区-灵感
     */
    @PostMapping("socialMuseUpdate")
    @ControllerEndpoint(operation = "社区-灵感", exceptionMessage = "操作失败")
    public FebsResponse socialMuseUpdate(@RequestBody ClothesSocialMuse dto) {
        return clothesTypeService.socialMuseUpdate(dto);
    }
    /**
     * 社区获取设计类型-工艺
     * @return
     */
    @GetMapping(value = "/allArt/{typeId}")
    public FebsResponse allArt(@NotNull(message = "{required}") @PathVariable Long typeId) {
        return new FebsResponse().success().data(clothesTypeService.allArt(typeId));
    }
    /**
     * 社区获取设计类型-尺码
     * @return
     */
    @GetMapping(value = "/allSize/{typeId}")
    public FebsResponse allSize(@NotNull(message = "{required}") @PathVariable Long typeId) {
        return new FebsResponse().success().data(clothesTypeService.allSize(typeId));
    }
    /**
     * 社区获取设计类型-位置
     * @return
     */
    @GetMapping(value = "/allLocation/{typeId}")
    public FebsResponse allLocation(@NotNull(message = "{required}") @PathVariable Long typeId) {
        return new FebsResponse().success().data(clothesTypeService.allLocation(typeId));
    }
    /**
     * 社区获取设计类型-图案
     * @return
     */
    @GetMapping(value = "/allPattern/{typeId}")
    public FebsResponse allPattern(@NotNull(message = "{required}") @PathVariable Long typeId) {
        return new FebsResponse().success().data(clothesTypeService.allPattern(typeId));
    }
    /**
     * 社区获取设计类型-布料
     * @return
     */
    @GetMapping(value = "/allCloth/{typeId}")
    public FebsResponse allCloth(@NotNull(message = "{required}") @PathVariable Long typeId) {
        return new FebsResponse().success().data(clothesTypeService.allCloth(typeId));
    }
    /**
     * 社区获取设计类型
     * @return
     */
    @GetMapping(value = "/allType")
    public FebsResponse allType() {
        return new FebsResponse().success().data(clothesTypeService.allType());
    }
    /**
     * 社区获取分类
     * @return
     */
    @GetMapping(value = "/allGroup")
    public FebsResponse allGroup() {
        return new FebsResponse().success().data(clothesTypeService.allGroup());
    }
    /**
     * 社区-开启
     */
    @GetMapping("socialState/{id}/{state}")
    @ControllerEndpoint(operation = "社区-开启", exceptionMessage = "操作失败")
    public FebsResponse socialState(@NotNull(message = "{required}") @PathVariable Long id,
                                    @NotNull(message = "{required}") @PathVariable Integer state) {
        return clothesTypeService.socialState(id,state);
    }
    /**
     * 社区-推荐首页
     */
    @GetMapping("socialHotState/{id}/{state}")
    @ControllerEndpoint(operation = "社区-开启", exceptionMessage = "操作失败")
    public FebsResponse socialHotState(@NotNull(message = "{required}") @PathVariable Long id,
                                    @NotNull(message = "{required}") @PathVariable Integer state) {
        return clothesTypeService.socialHotState(id,state);
    }
    /**
     * 社区-删除
     */
    @GetMapping("socialDelete/{id}")
    @ControllerEndpoint(operation = "社区-删除", exceptionMessage = "删除失败")
    public FebsResponse socialDelete(@NotNull(message = "{required}") @PathVariable Long id) {
        return clothesTypeService.socialDelete(id);
    }
    /**
     * 订单列表
     *
     * @param dto