package com.cool.store.request;

import com.cool.store.entity.OpeningOperationPlanDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @Auther: WangShuo
 * @Date: 2024/04/19/下午7:32
 * @Version 1.0
 * @注释:
 */
@Data
public class OpeningOperationPlanRequest {


    @ApiModelProperty("店铺id")
    private Long shopId;

    @ApiModelProperty("0-新增/1-同步")
    private Boolean planSource;

    @ApiModelProperty("调研结果")
    private String surveyResult;

    @ApiModelProperty("调研结果url")
    private String surveyResultUrl;

    @ApiModelProperty("活动主题")
    private String activityTheme;

    @ApiModelProperty("活动主题url")
    private String  activityThemeUrl;

    @ApiModelProperty("筹备人员ids")
    private List<String>  preparationUserIds;

    @ApiModelProperty("是否完成排车路线0未完成，1完成")
    private Byte routeCompleted;



    public OpeningOperationPlanDO toOpeningOperationPlanDO() {
        OpeningOperationPlanDO openingOperationPlanDO = new OpeningOperationPlanDO();
        openingOperationPlanDO.setShopId(this.shopId);
        openingOperationPlanDO.setPlanSource(this.planSource);
        openingOperationPlanDO.setSurveyResult(this.surveyResult);
        openingOperationPlanDO.setSurveyResultUrl(this.surveyResultUrl);
        openingOperationPlanDO.setActivityThemeUrl( this.activityThemeUrl);
        if (CollectionUtils.isNotEmpty(this.preparationUserIds)) {
            openingOperationPlanDO.setPreparationUserIds(String.join(",", this.preparationUserIds));
        }
        openingOperationPlanDO.setActivityTheme(this.activityTheme);
        openingOperationPlanDO.setRouteCompleted(this.routeCompleted);
        return openingOperationPlanDO;
    }
}
