package com.tmerclub.cloud.systemtest.data.marketing;

import com.tmerclub.cloud.api.distribution.vo.DistributionSpuVO;
import com.tmerclub.cloud.distribution.dto.DistributionSpuDTO;
import org.springframework.beans.BeanUtils;

/**
 * @author lpj
 */
public class DistributionProdData {
    /**
     * 新增分销商品数据
     */
    public static DistributionSpuDTO getDistributionSpuDTO(Long productId, Integer awardMode, Long awardNumbers, Integer parentAwardSet, Long parentAwardNumbers, Integer state) {
        DistributionSpuDTO distributionSpuDTO = new DistributionSpuDTO();
        distributionSpuDTO.setDistributionSpuId(0L);
        distributionSpuDTO.setSpuId(productId);
        distributionSpuDTO.setAwardMode(awardMode);
        distributionSpuDTO.setAwardNumbers(awardNumbers);
        distributionSpuDTO.setParentAwardSet(parentAwardSet);
        distributionSpuDTO.setParentAwardNumbers(parentAwardNumbers);
        distributionSpuDTO.setState(state);

        return distributionSpuDTO;
    }

    /**
     * 修改分销商品数据
     */
    public static DistributionSpuDTO getUpdateDistributionSpuDTO(DistributionSpuVO distributionSpuVO) {
        DistributionSpuDTO distributionSpuDTO = new DistributionSpuDTO();
        BeanUtils.copyProperties(distributionSpuVO, distributionSpuDTO);
        //切换为按固定数值奖励
        distributionSpuDTO.setAwardMode(1);
        return distributionSpuDTO;
    }
}
