Administrator
2025-07-14 17cea8fe652d1566e856e168d528a1af628e2140
src/main/java/cc/mrbird/febs/mall/controller/clothes/ViewClothesTypeController.java
@@ -2,7 +2,10 @@
import cc.mrbird.febs.common.controller.BaseController;
import cc.mrbird.febs.common.entity.FebsConstant;
import cc.mrbird.febs.common.enumerates.SocialPatternLocationTypeEnum;
import cc.mrbird.febs.common.utils.AppContants;
import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.common.utils.RedisUtils;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.*;
import cc.mrbird.febs.mall.service.ClothesTypeService;
@@ -10,6 +13,8 @@
import cc.mrbird.febs.mall.vo.AdminLabelSetVo;
import cc.mrbird.febs.mall.vo.AdminMallOrderVo;
import cc.mrbird.febs.mall.vo.clothes.AdminClothesDeliverGoodsVo;
import cc.mrbird.febs.mall.vo.clothes.AdminClothesLocationRemarkVo;
import cc.mrbird.febs.mall.vo.clothes.AdminClothesPatternRemarkVo;
import cc.mrbird.febs.mall.vo.clothes.AdminClothesTypeInfoVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -54,6 +59,9 @@
    private final ClothesSocialMuseMapper clothesSocialMuseMapper;
    private final ClothesSocialFileMapper clothesSocialFileMapper;
    private final MallExpressInfoMapper mallExpressInfoMapper;
    private final ClothesPatternRemarkMapper clothesPatternRemarkMapper;
    private final ClothesLocationRemarkMapper clothesLocationRemarkMapper;
    private final RedisUtils redisUtils;
    /**
     * 社区分类列表
@@ -101,6 +109,27 @@
        return FebsUtil.view("modules/clothesType/socialList");
    }
    /**
     * 社区列表-查看评论
     * @return
     */
    @GetMapping("/socialComment/{id}")
    @RequiresPermissions("socialComment:view")
    public String socialComment(@PathVariable Long id, Model model) {
        String existToken = redisUtils.getString(AppContants.SOCIAL_COMMENT);
        if (StrUtil.isNotBlank(existToken)) {
            Object o = redisUtils.get(existToken);
            if (ObjectUtil.isNotEmpty(o)) {
                redisUtils.del(existToken);
            }
        }
        redisUtils.set(AppContants.SOCIAL_COMMENT, id, -1);
        return FebsUtil.view("modules/clothesType/socialComment");
    }
    /**
     * 社区-新增
     */
@@ -109,6 +138,8 @@
    public String socialAdd() {
        return FebsUtil.view("modules/clothesType/socialAdd");
    }
    /**
     * 社区-修改
@@ -151,12 +182,45 @@
                .last("LIMIT 1")
        );
        String patternRemark = clothesSocialMuse.getPatternRemark();
        if(StrUtil.isNotBlank(patternRemark)){
            JSON parse = JSONUtil.parse(patternRemark);
            clothesSocialMuse.setPatternText(parse.getByPath("text", String.class));
            clothesSocialMuse.setPatternImage(parse.getByPath("file", String.class));
        List<AdminClothesPatternRemarkVo> patternData = new ArrayList<>();
        List<ClothesPatternRemark> patternRemarks = clothesPatternRemarkMapper.selectList(
                Wrappers.lambdaQuery(ClothesPatternRemark.class)
                        .eq(ClothesPatternRemark::getSourceId, clothesSocialMuse.getId())
                        .eq(ClothesPatternRemark::getType, SocialPatternLocationTypeEnum.MUSE.getValue())
        );
        if(CollUtil.isNotEmpty(patternRemarks)){
            for (ClothesPatternRemark entity : patternRemarks){
                AdminClothesPatternRemarkVo vo = new AdminClothesPatternRemarkVo();
                vo.setPatternId(entity.getPatternId());
                ClothesPattern clothesPattern = clothesPatternMapper.selectById(entity.getPatternId());
                vo.setPatternName(clothesPattern.getName());
                JSON parse = JSONUtil.parse(entity.getRemark());
                vo.setPatternText(parse.getByPath("text", String.class));
                vo.setSkuPatternImage(parse.getByPath("file", String.class));
                patternData.add(vo);
            }
            clothesSocialMuse.setPatternData(patternData);
        }
        List<AdminClothesLocationRemarkVo> locationData = new ArrayList<>();
        List<ClothesLocationRemark> locationRemarks = clothesLocationRemarkMapper.selectList(
                Wrappers.lambdaQuery(ClothesLocationRemark.class)
                        .eq(ClothesLocationRemark::getSourceId, clothesSocialMuse.getId())
                        .eq(ClothesLocationRemark::getType, SocialPatternLocationTypeEnum.MUSE.getValue())
        );
        if(CollUtil.isNotEmpty(locationRemarks)){
            for (ClothesLocationRemark entity : locationRemarks){
                AdminClothesLocationRemarkVo vo = new AdminClothesLocationRemarkVo();
                vo.setLocationId(entity.getLocationId());
                ClothesLocation clothesLocation = clothesLocationMapper.selectById(entity.getLocationId());
                vo.setLocationName(clothesLocation.getName());
                JSON parse = JSONUtil.parse(entity.getRemark());
                vo.setLocationText(parse.getByPath("text", String.class));
                vo.setSkuLocationImage(parse.getByPath("file", String.class));
                locationData.add(vo);
            }
            clothesSocialMuse.setLocationData(locationData);
        }
        model.addAttribute("socialMuse", clothesSocialMuse);
        return FebsUtil.view("modules/clothesType/socialMuseUpdate");
@@ -180,9 +244,13 @@
     */
    @GetMapping("deliverGoods/{id}")
    @RequiresPermissions("deliverGoods:update")
    public String deliverGoods(@PathVariable long id, Model model) {
    public String deliverGoods(@PathVariable Long id, Model model) {
        AdminClothesDeliverGoodsVo data = new AdminClothesDeliverGoodsVo();
        ClothesOrder clothesOrder = clothesOrderMapper.selectById(id);
        data.setId(clothesOrder.getId());
        data.setName(clothesOrder.getName());
        data.setPhone(clothesOrder.getPhone());
        data.setAddress(clothesOrder.getAddress());
        data.setExpressCom("极兔快递");
        MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne(
                Wrappers.lambdaQuery(MallExpressInfo.class)