class WholesaleSaleModelRenderImpl implements SalesModelRender {
    /**
     * 批发商品
     */
    @Autowired
    private WholesaleService wholesaleService;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void renderSingle(GoodsSku goodsSku, GoodsOperationDTO goodsOperationDTO) {
        Assert.notEmpty(goodsOperationDTO.getWholesaleList(), "批发规则不能为空");
        this.checkWholesaleList(goodsOperationDTO.getWholesaleList(), goodsSku);
        List<Wholesale> collect = goodsOperationDTO.getWholesaleList().stream().sorted(Comparator.comparing(Wholesale::getPrice)).collect(Collectors.toList());
        wholesaleService.removeByGoodsId(goodsSku.getGoodsId());
        wholesaleService.saveOrUpdateBatch(collect);
        goodsSku.setPrice(collect.get(0).getPrice());
        goodsSku.setCost(collect.get(0).getPrice());
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void renderBatch(List<GoodsSku> goodsSkus, GoodsOperationDTO goodsOperationDTO) {
        Assert.notEmpty(goodsOperationDTO.getWholesaleList(), "批发规则不能为空");
        this.checkWholesaleList(goodsOperationDTO.getWholesaleList(), goodsSkus.get(0));
        List<Wholesale> collect = goodsOperationDTO.getWholesaleList().stream().sorted(Comparator.comparing(Wholesale::getPrice)).collect(Collectors.toList());
        for (GoodsSku skus : goodsSkus) {
            skus.setPrice(collect.get(0).getPrice());
            skus.setCost(collect.get(0).getPrice());
        }
        if (Boolean.TRUE.equals(goodsOperationDTO.getGoodsTemplateFlag())) {
            wholesaleService.removeByTemplateId(goodsSkus.get(0).getGoodsId());
        } else {
            wholesaleService.removeByGoodsId(goodsSkus.get(0).getGoodsId());
        }
        wholesaleService.saveOrUpdateBatch(collect);
    }

    private void checkWholesaleList(List<WholesaleDTO> wholesaleList, GoodsSku goodsSku) {<FILL_FUNCTION_BODY>}

    @Override
    public String getSalesMode() {
        return GoodsSalesModeEnum.WHOLESALE.name();
    }
}

        if (CollUtil.isEmpty(wholesaleList)) {
            throw new ServiceException(ResultCode.MUST_HAVE_SALES_MODEL);
        }
        for (WholesaleDTO wholesaleDTO : wholesaleList) {
            if (wholesaleDTO.getPrice() == null || wholesaleDTO.getPrice() <= 0 || wholesaleDTO.getNum() == null || wholesaleDTO.getNum() <= 0) {
                throw new ServiceException(ResultCode.HAVE_INVALID_SALES_MODEL);
            }
            if (CharSequenceUtil.isEmpty(wholesaleDTO.getGoodsId())) {
                wholesaleDTO.setGoodsId(goodsSku.getGoodsId());
            }

        }
    
<no_super_class>