cloudroam
2024-09-06 8cd0381305c29d2dbb55582c53692d9de2b8343d
src/main/java/com/mzl/flower/service/flower/FlowerMarkupSpCgService.java
@@ -2,7 +2,10 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.config.exception.ValidationException;
import com.mzl.flower.config.security.SecurityUtils;
import com.mzl.flower.dto.request.flower.FlowerMarkupPsSpCgSaveDTO;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgBatchSaveDTO;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgQueryDTO;
import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgSaveDTO;
import com.mzl.flower.dto.response.flower.FlowerMarkupSpCgDTO;
@@ -47,6 +50,18 @@
        markupCacheClient.addMarkupSpCg(dto.getPartnerId(), cId, cg);
    }
    public void saveMarkupSpCgBatch(FlowerMarkupSpCgBatchSaveDTO dto) {
        List<Long> categoryIds = dto.getCategoryId();
        if (categoryIds == null || categoryIds.size() == 0) {
            throw new ValidationException("分类列表不能为空");
        }
        for (Long categoryId : categoryIds) {
            FlowerMarkupSpCgSaveDTO cg = new FlowerMarkupSpCgSaveDTO();
            BeanUtils.copyProperties(dto, cg);
            cg.setCategoryId(categoryId);
            saveMarkupSpCg(cg);
        }
    }
    public FlowerMarkupSpCgDTO getMarkupSpCg(Long categoryId){
        FlowerMarkupSpCgDTO dto = new FlowerMarkupSpCgDTO();
        dto.setCategoryId(categoryId);