package com.yonge.cooleshow.biz.dal.wrapper;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.dayaedu.cbs.common.enums.EClientType;
import com.dayaedu.cbs.common.enums.music.*;
import com.dayaedu.cbs.common.enums.school.EMusicSheetType;
import com.dayaedu.cbs.openfeign.wrapper.music.CbsMusicSheetWrapper;
import com.microsvc.toolkit.common.response.paging.QueryInfo;
import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
import com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment;
import com.yonge.cooleshow.biz.dal.enums.*;
import com.yonge.cooleshow.common.enums.YesOrNoEnum;
import com.yonge.toolset.base.util.StringUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
 * 曲谱表
 * 2022-12-07 10:16:58
 */
@ApiModel(value = "MusicSheetWrapper对象", description = "曲谱表查询对象")
public class MusicSheetWrapper {

    @Data
	@Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" MusicSheetQuery-曲谱表")
    public static class MusicSheetQuery implements QueryInfo {

    	@ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("关键字匹配")
		private String keyword;

        @ApiModelProperty("伴奏类型")
        private EAudioType audioType;

        @ApiModelProperty("标签Id")
        private String musicTag;

        @ApiModelProperty("声部Id")
        private String musicSubject;

        @ApiModelProperty("伴奏类型  HOMEMODE：自制 COMMON：普通")
        private String accompanimentType;

        @ApiModelProperty("曲谱分类编号")
        private Integer musicSheetCategoriesId;

        private List<Integer> musicSheetCategoriesIdList;

        @ApiModelProperty(value = "删除标识", hidden = true)
        private Boolean delFlag;

        @ApiModelProperty(value = "启用停用标识，曲目状态（0：停用，1：启用）")
        private Boolean status;

        @ApiModelProperty("用户类型")
        private EClientType clientType;

        @ApiModelProperty("学校ID集合")
        private List<Long> schoolIds;

        @ApiModelProperty("可用途径 ORG 机构 PLATFORM 平台")
        private String availableType;

        @ApiModelProperty("学校ID")
        private Long schoolId;

        @ApiModelProperty("需要排查的曲谱ID")
        private List<Long> excludeMusicIds;

        @ApiModelProperty("曲谱ID")
        private List<Long> musicIds;

        public String getKeyword() {
            return Optional.ofNullable(keyword).filter(StringUtils::isNotBlank).orElse(null);
        }

        public Boolean getDelFlag() {
            return Optional.ofNullable(delFlag).orElse(false);
        }

        public String getMusicTag() {
            return Optional.ofNullable(musicTag).filter(StringUtils::isNotBlank).orElse(null);
        }

        public String getMusicSubject() {
            return Optional.ofNullable(musicSubject).filter(StringUtils::isNotBlank).orElse(null);
        }

        public String getAccompanimentType() {
            return Optional.ofNullable(accompanimentType).filter(StringUtils::isNotBlank).orElse(null);
        }

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static MusicSheetQuery from(String json) {
            return JSON.parseObject(json, MusicSheetQuery.class);
        }
    }




    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
	@ApiModel(" MusicSheet-曲谱表")
    public static class MusicSheetVo implements Serializable {
        @ApiModelProperty("添加人")
        private String addName;


        @ApiModelProperty("谱面类型")
        @TableField("score_type_")
        private String scoreType;

        @ApiModelProperty("添加头像（老师头像）")
        private String addUserAvatar;

        @ApiModelProperty("标签名")
        private String musicTagNames;

        @ApiModelProperty("声部名")
        private String subjectNames;

        @ApiModelProperty("收藏 0：否，1：是")
        private YesOrNoEnum favorite = YesOrNoEnum.NO;

        @ApiModelProperty("是否购买/VIP（0：否，1：是） ")
        private YesOrNoEnum play;

        @ApiModelProperty("专辑中曲目的排序号")
        private Integer albumSortNumber;  //排序号

        @ApiModelProperty("单曲专辑数")
        private Integer albumNums;

        @ApiModelProperty("曲目来源名")
        private String  sourceName;

        @ApiModelProperty("机构专辑ID,逗号隔开")
        private String tenantAlbumId;

        @ApiModelProperty("所属人信息")
        private CbsMusicSheetWrapper.MusicSheetExtend musicSheetExtend;

        @ApiModelProperty(value = "主键id")
        private String id;  //主键ID

        @ApiModelProperty(value = "内容平台曲目ID")
        private String cbsMusicSheetId;  //主键ID

        @NotBlank(message = "曲谱名称不能为空!")
        @ApiModelProperty(value = "曲谱名称")
        private String musicSheetName;  //曲谱名称


        @NotBlank(message = "曲谱封面图不能为空!")
        @ApiModelProperty(value = "封面图")
        private String titleImg;  //曲谱名称

        @ApiModelProperty(value = "曲谱来源(平台用户ID或者是老师ID)")
        private Long userId;  //曲谱来源(平台用户ID或者是老师ID)

        @ApiModelProperty("是否可以转简谱（0:否，1：是）")
        private YesOrNoEnum notation;

        @ApiModelProperty("曲目图片")
        private String musicImg;

        @ApiModelProperty(value = "曲目来源类型 TEACHER 老师 PLATFORM 平台")
        private SourceTypeEnum sourceType;


        @ApiModelProperty(value = "提供方 TENANT 机构 PLATFORM 平台")
        private SourceTypeEnum providerType;

        @NotBlank(message = "艺术家不能为空!")
        @ApiModelProperty(value = "艺术家")
        private String composer;  //音乐家

        @ApiModelProperty(value = "曲谱声部(适用的乐器,可能是多个,用逗号分隔)")
        private String musicSubject;  //曲谱声部(适用的乐器,可能是多个,用逗号分隔)

        @ApiModelProperty(value = "曲目音频类型 MP3：mp3, MIDI:midi,")
        private AudioTypeEnum audioType;

        @ApiModelProperty(value = "mp3类型 MP3：mp3, MP3_METRONOME:MP3_METRONOME,")
        private AudioTypeEnum mp3Type;


        @ApiModelProperty(value = "收藏数")
        private Integer favoriteCount;


        @ApiModelProperty("虚拟人数 ")
        private Integer virtualNumber;

        @ApiModelProperty(value = "曲谱标签(多个标签用逗号分隔)")
        private String musicTag;  //曲谱标签(多个标签用逗号分隔)

        @ApiModelProperty(value = "伴奏类型 HOMEMODE:自制伴奏  COMMON:普通伴奏")
        private AccompanimentTypeEnum accompanimentType;

        // @NotNull(message = "默认播放速度不能为空!")
        @ApiModelProperty(value = "默认播放速度")
        private String playSpeed;  //默认播放速度

        @ApiModelProperty(value = "是否可以评测(0:否;1:是)")
        private YesOrNoEnum canEvaluate;  //是否可以评测(0:否;1:是)

        @ApiModelProperty(value = "是否展示指法(0:否;1:是)")
        private YesOrNoEnum showFingering;  //是否展示指法(0:否;1:是)

        // @NotNull(message = "收费类型不能为空!")
        @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
        private ChargeTypeEnum chargeType;  //收费类型(0:免费;1:会员;2:单曲收费)

        @NotNull(message = "收费类型不能为空!")
        @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
        private String paymentType;


        @ApiModelProperty(value = "曲目状态(0:停用，1：启用)")
        private YesOrNoEnum state;

        @ApiModelProperty(value = "曲目停用原因")
        private String reason;

        @ApiModelProperty(value = "审核状态(DOING:待审核;PASS:通过;UNPASS:未通过)")
        private AuthStatusEnum auditStatus;

        @ApiModelProperty(value = "提交审核时间")
        private Date submitAuditTime;

        @ApiModelProperty(value = "第一次通过审核时间")
        private Date firstPassAuditTime;

        @ApiModelProperty(value = "排序号")
        private Integer sortNumber;  //排序号

        @ApiModelProperty(value = "是否置顶(0:否;1:是)")
        private YesOrNoEnum topFlag;  //是否置顶(0:否;1:是)

        @ApiModelProperty(value = "是否热门曲谱(0:否;1:是)")
        private YesOrNoEnum hotFlag;  //是否热门曲谱(0:否;1:是)

        @ApiModelProperty(value = "精品标志(0:否;1:是)")
        private YesOrNoEnum exquisiteFlag;

        @ApiModelProperty(value = "曲谱价格")
        private java.math.BigDecimal musicPrice;  //曲谱价格

        @ApiModelProperty(value = "音频文件存储路径")
        private String audioFileUrl;  //音频文件存储路径

        @ApiModelProperty(value = "XML文件存储路径")
        private String xmlFileUrl;  //XML文件存储路径

        @ApiModelProperty(value = "midi路径")
        private String midiUrl;  //XML文件存储路径

        @ApiModelProperty(value = "伴奏含节拍器路径")
        private String metronomeUrl;  //XML文件存储路径

        @ApiModelProperty(value = "伴奏（不含节拍器）路径")
        private String url;  //XML文件存储路径

        @ApiModelProperty(value = "是否自带节拍器(0:否;1:是)")
        private YesOrNoEnum hasBeat;  //是否自带节拍器(0:否;1:是)

        @ApiModelProperty(value = "是否审核时可见 （0:否  1：是）")
        private YesOrNoEnum auditVersion;

        @ApiModelProperty(value = "创建时间")
        private java.util.Date createTime;  //创建时间

        @ApiModelProperty(value = "创建人(老师或者是后台平台用户)")
        private Long createBy;  //创建人(老师或者是后台平台用户)

        @ApiModelProperty(value = "更新时间")
        private java.util.Date updateTime;  //更新时间

        @ApiModelProperty(value = "更新人(老师或者是后台平台用户)")
        private Long updateBy;  //更新人(老师或者是后台平台用户)

        @ApiModelProperty(value = "备注")
        private String remark;  //备注，填写未通过审核的原因


        @ApiModelProperty("曲目配置信息")
        private String extConfigJson;

        private String musicJSON;

        private String musicSvg;

        private String musicJianSvg;

        private String musicFirstSvg;

        @ApiModelProperty("首调")
        private String firstTone;

        @ApiModelProperty("固定调")
        private String fixedTone;

        @ApiModelProperty(value = "假删除标识 0：未删除 1：已删除")
        private Boolean delFlag;

        @ApiModelProperty(value = "数据修复时间")
        private Date correctTime;

        //曲谱类型 SINGLE/CONCERT ，使用MusicSheetTypeEnum
        @ApiModelProperty(value = "曲谱类型(SINGLE:单曲，CONCERT:合奏)")
        private MusicSheetTypeEnum musicSheetType;

        public ChargeTypeEnum getChargeType() {
            if (Objects.isNull(this.chargeType) && StringUtils.isNotEmpty(getPaymentType())) {

                return ChargeTypeEnum.valueOf(getPaymentType().split(",")[0]);
            }
            return chargeType;
        }
    }



    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
	@ApiModel(" MusicSheet-曲谱表")
    public static class MusicSheet implements Serializable {

        @TableId(value = "id_", type = IdType.AUTO)
        @ApiModelProperty(value = "主键id")
        private String id;  //主键ID

        @TableField(value = "cbs_music_sheet_id_")
        @ApiModelProperty(value = "内容平台曲目ID")
        private String cbsMusicSheetId;  //主键ID

        @NotBlank(message = "曲谱名称不能为空!")
        @Size(max = 64, message = "曲谱名称长度不能超过64位!")
        @TableField("music_sheet_name_")
        @ApiModelProperty(value = "曲谱名称")
        private String musicSheetName;  //曲谱名称


        @NotBlank(message = "曲谱封面图不能为空!")
        @TableField("title_img_")
        @ApiModelProperty(value = "封面图")
        private String titleImg;  //曲谱名称

        @TableField("user_id_")
        @ApiModelProperty(value = "曲谱来源(平台用户ID或者是老师ID)")
        private Long userId;  //曲谱来源(平台用户ID或者是老师ID)

        @TableField("notation_")
        @ApiModelProperty("是否可以转简谱（0:否，1：是）")
        private YesOrNoEnum notation;

        @TableField("music_img_")
        @ApiModelProperty("曲目图片")
        private String musicImg;

        @TableField("source_type_")
        @ApiModelProperty(value = "曲目来源类型 TEACHER 老师 PLATFORM 平台")
        private SourceTypeEnum sourceType;


        @TableField("provider_type_")
        @ApiModelProperty(value = "提供方 TENANT 机构 PLATFORM 平台")
        private SourceTypeEnum providerType;

        @NotBlank(message = "艺术家不能为空!")
        @Size(max = 32, message = "艺术家长度不能超过32位!")
        @TableField("composer_")
        @ApiModelProperty(value = "艺术家")
        private String composer;  //音乐家

        @TableField("music_subject_")
        @ApiModelProperty(value = "曲谱声部(适用的乐器,可能是多个,用逗号分隔)")
        private String musicSubject;  //曲谱声部(适用的乐器,可能是多个,用逗号分隔)

        @NotNull(message = "曲谱音频文件类型不能为空!")
        @TableField("audio_type_")
        @ApiModelProperty(value = "曲目音频类型 MP3：mp3, MIDI:midi,")
        private AudioTypeEnum audioType;

        @TableField("mp3_type_")
        @ApiModelProperty(value = "mp3类型 MP3：mp3, MP3_METRONOME:MP3_METRONOME,")
        private AudioTypeEnum mp3Type;


        @TableField("favorite_count_")
        @ApiModelProperty(value = "收藏数")
        private Integer favoriteCount;


        @ApiModelProperty("虚拟人数 ")
        @TableField(value = "virtual_number_")
        private Integer virtualNumber;

        @NotBlank(message = "曲谱标签不能为空!")
        @TableField("music_tag_")
        @ApiModelProperty(value = "曲谱标签(多个标签用逗号分隔)")
        private String musicTag;  //曲谱标签(多个标签用逗号分隔)

        @NotNull(message = "伴奏类型不能为空!")
        @TableField("accompaniment_type_")
        @ApiModelProperty(value = "伴奏类型 HOMEMODE:自制伴奏  COMMON:普通伴奏")
        private AccompanimentTypeEnum accompanimentType;

        @TableField("play_speed_")
        // @NotNull(message = "默认播放速度不能为空!")
        @ApiModelProperty(value = "默认播放速度")
        private String playSpeed;  //默认播放速度

        @TableField("can_evaluate_")
        @ApiModelProperty(value = "是否可以评测(0:否;1:是)")
        private YesOrNoEnum canEvaluate;  //是否可以评测(0:否;1:是)

        @TableField("show_fingering_")
        @ApiModelProperty(value = "是否展示指法(0:否;1:是)")
        private YesOrNoEnum showFingering;  //是否展示指法(0:否;1:是)

        // @NotNull(message = "收费类型不能为空!")
        @TableField("charge_type_")
        @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
        private ChargeTypeEnum chargeType;  //收费类型(0:免费;1:会员;2:单曲收费)

        @NotNull(message = "收费类型不能为空!")
        @TableField("payment_type_")
        @ApiModelProperty(value = "收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
        private String paymentType;


        @TableField("state_")
        @ApiModelProperty(value = "曲目状态(0:停用，1：启用)")
        private YesOrNoEnum state;

        @TableField("reason_")
        @ApiModelProperty(value = "曲目停用原因")
        private String reason;

        @TableField("audit_status_")
        @ApiModelProperty(value = "审核状态(DOING:待审核;PASS:通过;UNPASS:未通过)")
        private AuthStatusEnum auditStatus;

        @TableField("submit_audit_time_")
        @ApiModelProperty(value = "提交审核时间")
        private Date submitAuditTime;

        @TableField("first_pass_audit_time_")
        @ApiModelProperty(value = "第一次通过审核时间")
        private Date firstPassAuditTime;

        @TableField("sort_number_")
        @ApiModelProperty(value = "排序号")
        private Integer sortNumber;  //排序号

        @TableField("top_flag_")
        @ApiModelProperty(value = "是否置顶(0:否;1:是)")
        private YesOrNoEnum topFlag;  //是否置顶(0:否;1:是)

        @TableField("hot_flag_")
        @ApiModelProperty(value = "是否热门曲谱(0:否;1:是)")
        private YesOrNoEnum hotFlag;  //是否热门曲谱(0:否;1:是)

        @TableField("exquisite_flag_")
        @ApiModelProperty(value = "精品标志(0:否;1:是)")
        private YesOrNoEnum exquisiteFlag;

        @TableField("music_price_")
        @ApiModelProperty(value = "曲谱价格")
        private java.math.BigDecimal musicPrice;  //曲谱价格

        @TableField("audio_file_url_")
        @ApiModelProperty(value = "音频文件存储路径")
        private String audioFileUrl;  //音频文件存储路径

        @NotBlank(message = "XML文件存储路径不能为空!")
        @TableField("xml_file_url_")
        @ApiModelProperty(value = "XML文件存储路径")
        private String xmlFileUrl;  //XML文件存储路径


        @TableField("midi_url_")
        @ApiModelProperty(value = "midi路径")
        private String midiUrl;  //XML文件存储路径


        @TableField("metronome_url_")
        @ApiModelProperty(value = "伴奏含节拍器路径")
        private String metronomeUrl;  //XML文件存储路径


        @TableField("url_")
        @ApiModelProperty(value = "伴奏（不含节拍器）路径")
        private String url;  //XML文件存储路径

        @TableField("has_beat_")
        @ApiModelProperty(value = "是否自带节拍器(0:否;1:是)")
        private YesOrNoEnum hasBeat;  //是否自带节拍器(0:否;1:是)

        @TableField("audit_version_")
        @ApiModelProperty(value = "是否审核时可见 （0:否  1：是）")
        private YesOrNoEnum auditVersion;

        @TableField("create_time_")
        @ApiModelProperty(value = "创建时间")
        private java.util.Date createTime;  //创建时间

        @TableField("create_by_")
        @ApiModelProperty(value = "创建人(老师或者是后台平台用户)")
        private Long createBy;  //创建人(老师或者是后台平台用户)

        @TableField("update_time_")
        @ApiModelProperty(value = "更新时间")
        private java.util.Date updateTime;  //更新时间

        @TableField("update_by_")
        @ApiModelProperty(value = "更新人(老师或者是后台平台用户)")
        private Long updateBy;  //更新人(老师或者是后台平台用户)

        @TableField("remark_")
        @ApiModelProperty(value = "备注")
        private String remark;  //备注，填写未通过审核的原因

        @ApiModelProperty("谱面类型")
        @TableField("score_type_")
        private String scoreType;

        @TableField("ext_config_json_")
        @ApiModelProperty("曲目配置信息")
        private String extConfigJson;

        @TableField("music_json_")
        private String musicJSON;

        @TableField("music_svg_")
        private String musicSvg;

        @TableField("music_jian_svg_")
        private String musicJianSvg;

        @TableField("music_first_svg_")
        private String musicFirstSvg;

        @TableField("first_tone_")
        @ApiModelProperty("首调")
        private String firstTone;

        @TableField("fixed_tone_")
        @ApiModelProperty("固定调")
        private String fixedTone;

        @TableField("del_flag_")
        @ApiModelProperty(value = "假删除标识 0：未删除 1：已删除")
        private Boolean delFlag;

        @TableField("correct_time_")
        @ApiModelProperty(value = "数据修复时间")
        private Date correctTime;

        //曲谱类型 SINGLE/CONCERT ，使用MusicSheetTypeEnum
        @TableField("music_sheet_type_")
        @ApiModelProperty(value = "曲谱类型(SINGLE:单曲，CONCERT:合奏)")
        private MusicSheetTypeEnum musicSheetType;

        public ChargeTypeEnum getChargeType() {
            if (Objects.isNull(this.chargeType) && StringUtils.isNotEmpty(getPaymentType())) {

                return ChargeTypeEnum.valueOf(getPaymentType().split(",")[0]);
            }
            return chargeType;
        }
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class MusicSheetDetailVo extends MusicSheet {

        @ApiModelProperty("曲谱伴奏")
        private List<MusicSheetAccompaniment> background;

        @ApiModelProperty("是否能播放（0：否，1：是） 学生端进入小酷Ai判断 试用/完整 播放")
        private YesOrNoEnum play;


        @ApiModelProperty("收藏0：否，1：是")
        private YesOrNoEnum favorite;

        @ApiModelProperty("订单状态(WAIT_PAY:待支付;PAYING:支付中,PAID:已付款)")
        private OrderStatusEnum orderStatus;

        @ApiModelProperty("支付订单号")
        private String orderNo;

        @ApiModelProperty("上传老师名称")
        private String userName;

        @ApiModelProperty("上传用户头像")
        private String userAvatar;

        @ApiModelProperty("标签名")
        private String musicTagNames;

        @ApiModelProperty("声部名")
        private String subjectNames;

        @ApiModelProperty("声部code")
        private String code;

        @ApiModelProperty("声部频率")
        private Integer aiDefaultFrequency;

        @ApiModelProperty("审核理由")
        private String reason;

        @ApiModelProperty("是否使用节拍器")
        private Boolean isPlayBeat;

//    @ApiModelProperty("上一次审核的曲目信息")
//    private MusicSheetDetailVo lastMusicSheet;

        @ApiModelProperty("真实姓名")
        private String realName;

        @ApiModelProperty("审核时间")
        private Date auditTime;

        @ApiModelProperty("审核人")
        private String  auditName;

        @ApiModelProperty("审核理由")
        private String auditReason;

        @ApiModelProperty("是否为课件")
        private YesOrNoEnum coursewareStatus = YesOrNoEnum.NO;

        @ApiModelProperty("课件id")
        private Long coursewareId;

        @ApiModelProperty("曲目json文件")
        private String musicSheetJson;
    }

    @Data
    @ApiModel(" MusicSheet-曲目表")
    public static class CbsMusicSheet {

        @ApiModelProperty("主键")
        private String id;

        @ApiModelProperty("业务平台曲目ID")
        private String bizId;

        @ApiModelProperty("曲目分类ID")
        private String musicCategoryId;

        @ApiModelProperty("曲目分类名称")
        private String musicCategoryName;

        @ApiModelProperty("曲目标签")
        private String musicTag;

        @ApiModelProperty("曲目标签名称")
        private String musicTagNames;

        @ApiModelProperty("曲目封面图")
        private String musicCover;

        @ApiModelProperty("曲目名称")
        private String name;

        @ApiModelProperty("是否审核版本")
        private Boolean appAuditFlag;

        @ApiModelProperty("曲目声部(多个,用逗号分隔)")
        private String subjectIds;

        @ApiModelProperty("曲目声部code")
        private String subjectCodes;

        @ApiModelProperty("曲目声部名称")
        private String subjectNames;

        @ApiModelProperty("曲目乐器(多个,用逗号分隔)")
        private String musicalInstrumentIds;

        @ApiModelProperty("曲目乐器code")
        private String musicalInstrumentIdCodes;

        @ApiModelProperty("曲目乐器名称")
        private String musicalInstrumentNames;

        @ApiModelProperty("作曲人/音乐人")
        private String composer;

        @ApiModelProperty("曲目类型(SINGLE:单曲 CONCERT:合奏)")
        private EMusicSheetType musicSheetType;

        @ApiModelProperty("是否使用系统节拍器(0:否;1:是)")
        private Boolean isUseSystemBeat;

        @ApiModelProperty("是否可评测(0:否;1:是)") //  midi默认1, mp3 有伴奏1
        private Boolean isEvaluated;

        @ApiModelProperty("是否可转谱(0:否; 1:是)") // 固定调，首调 有值 1
        private Boolean isConvertibleScore;

        @ApiModelProperty("是否展示指法(0:否;1:是)") // moren 1
        private Boolean isShowFingering;

        @ApiModelProperty("是否播入节拍器(0: 否 1:是)")
        private Boolean isPlayBeat;

        @ApiModelProperty("多声轨选择")
        private String multiTracksSelection;

        @ApiModelProperty("播放速度")
        private String playSpeed;

        @ApiModelProperty("播放模式(MIDI;MP3)")
        private EMusicPlayMode playMode;

        @ApiModelProperty("XML文件")
        private String xmlFileUrl;

        @ApiModelProperty("MIDI文件(保留字段)")
        private String midiFileUrl;

        @ApiModelProperty("曲目JSON")
        private String musicJson;

        @ApiModelProperty("曲目缓存JSON(后续使用)")
        private String musicSvgJson;

        @ApiModelProperty("曲目缓存")
        private String musicSvg;


        @ApiModelProperty("评测标准 节奏 AMPLITUDE 音准 FREQUENCY 分贝 DECIBELS")
        private EEvaluationStandard evaluationStandard;

        @ApiModelProperty("简谱缓存")
        private String musicJianSvg;

        @ApiModelProperty("首调缓存")
        private String musicFirstSvg;

        @ApiModelProperty("谱面图片JSON(后续使用)")
        private String musicImgJson;

        @ApiModelProperty("五线谱图片")
        private String musicImg;

        @ApiModelProperty("首调图片")
        private String musicFirstImg;

        @ApiModelProperty("固定调图片")
        private String musicJianImg;

        @ApiModelProperty("谱面参数设置")
        private String extConfigJson;

        @ApiModelProperty("谱面样式参数设置")
        private String extStyleConfigJson;

        @ApiModelProperty("可用类型(PLATFORM: 平台; ORG: 机构; PERSON: 个人)") // 暂时没有
        private EMusicAvailableType availableType;

        @ApiModelProperty("来源类型/作者属性(PLATFORM: 平台; ORG: 机构; PERSON: 个人)") // 作者属性
        private EMusicSourceType sourceType;

        @ApiModelProperty("音频类型(HOMEMODE: 自制 COMMON: 普通)")
        private EAudioType audioType;

        @ApiModelProperty("曲目状态（0：停用，1：启用）")
        private Boolean status;

        @ApiModelProperty("停用原因")
        private String reason;

        @ApiModelProperty("备注")
        private String remark;

        @ApiModelProperty("逻辑删除标识(0: 未删 1:已删)")
        private Boolean delFlag;

        @ApiModelProperty("更新人")
        private Long updateBy;

        @ApiModelProperty("更新时间")
        private Date updateTime;

        @ApiModelProperty("创建人")
        private Long createBy;

        @ApiModelProperty("上传人名称")
        private String createByName;

        @ApiModelProperty("创建时间")
        private Date createTime;

        @ApiModelProperty("评测频率,详情返回，指定应用端")
        private String evaluationFrequency;


        @ApiModelProperty("曲目伴奏")
        private List<CbsMusicSheetWrapper.MusicSheetAccompaniment> musicSheetAccompanimentList;


        @ApiModelProperty("曲目原音")
        private List<CbsMusicSheetWrapper.MusicSheetSound> musicSheetSoundList;


        @ApiModelProperty("所属人信息")
        private CbsMusicSheetWrapper.MusicSheetExtend musicSheetExtend;

        @ApiModelProperty("乐器信息")
        private List<CbsMusicSheetWrapper.MusicalInstrument> musicalInstruments;

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static CbsMusicSheetWrapper.MusicSheet from(String json) {
            return JSON.parseObject(json, CbsMusicSheetWrapper.MusicSheet.class);
        }
    }


    @Data
    public static class MusicUse{

        @ApiModelProperty("是否能播放（0：否，1：是） 学生端进入小酷Ai判断 试用/完整 播放")
        private YesOrNoEnum play;

        @ApiModelProperty("是否购买（0：否，1：是）")
        private Boolean buyed = false;
    }


    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @ApiModel(" MusicSheetTenantQuery-曲谱表")
    public static class MusicSheetTenantQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("关键字匹配 曲目编号/名称")
        private String keyword;

        @ApiModelProperty(value = "曲目来源类型 TEACHER 老师 PLATFORM 平台")
        private SourceTypeEnum sourceType;


        @ApiModelProperty("伴奏类型  HOMEMODE：自制 COMMON：普通")
        private String accompanimentType;


        @ApiModelProperty("声部Id")
        private String musicSubject;

        @ApiModelProperty("曲谱分类编号")
        private Integer musicSheetCategoriesId;

        private List<Integer> musicSheetCategoriesIdList;

        @ApiModelProperty(value = "启用停用标识，曲目状态（0：停用，1：启用）")
        private Boolean platformStatus;

        @ApiModelProperty(value = "启用停用标识，曲目状态（0：停用，1：启用）")
        private Boolean clientStatus;

        @ApiModelProperty("需要排查的曲谱ID")
        private List<Long> excludeMusicIds;

    }

    @Data
    public static class MusicSheetApplication extends CbsMusicSheetWrapper.MusicSheetApplication{
        @ApiModelProperty("主键")
        @JSONField(serializeUsing = ToStringSerializer.class)
        private Long id;

        @ApiModelProperty("分类ID")
        @JSONField(serializeUsing = ToStringSerializer.class)
        private Long musicSheetCategoryId;

    }

    @Data
    public static class MusicSheetApplicationQuery extends CbsMusicSheetWrapper.MusicSheetApplicationQuery {
        @ApiModelProperty("类型")
        private String subjectType;
    }


    @Data
    public static class MusicSheetCloud {

        @ApiModelProperty("主键")
        private String id;

        @ApiModelProperty("曲谱名称")
        private String musicSheetName;

        @ApiModelProperty("封面图")
        private String titleImg;

        @ApiModelProperty("作曲人")
        private String composer;

        @ApiModelProperty("内容平台曲目ID")
        private String cbsMusicSheetId;

        @ApiModelProperty("被使用次数")
        private Long usedNum;

        @ApiModelProperty("收费类型(FREE:免费;VIP:会员;CHARGE:单曲收费)")
        private String paymentType;

        @ApiModelProperty("音频类型，SING：演唱，PLAY：演奏")
        private String audioPlayTypes;

        @ApiModelProperty(value = "曲谱价格")
        private java.math.BigDecimal musicPrice;  //曲谱价格

        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static MusicSheet from(String json) {
            return JSON.parseObject(json, MusicSheet.class);
        }
    }

    @Data
    public static class MusicSheetCloudQuery implements QueryInfo {

        @ApiModelProperty("当前页")
        private Integer page;

        @ApiModelProperty("分页行数")
        private Integer rows;

        @ApiModelProperty("关键字匹配")
        private String keyword;
        private Long musicSheetId;
        @ApiModelProperty("仅匹配资源名称")
        private String name;

        @ApiModelProperty("曲目乐器Id")
        private Long musicalInstrumentId;

        @ApiModelProperty(value = "删除标识", hidden = true)
        private Boolean delFlag;

        @ApiModelProperty(value = "启用停用标识，曲目状态（0：停用，1：启用）")
        private Boolean status;

        @ApiModelProperty(value = "是否审核数据")
        private Boolean versionFlag = false;

        @ApiModelProperty(value = "用户ID",hidden = true)
        private Long userId;

        @ApiModelProperty(value = "用户类型",hidden = true)
        private String clientType;

        @ApiModelProperty("是否最近练习")
        private Boolean recentFlag = false;

        @ApiModelProperty(value = "必须要匹配声部ID")
        private List<Long> mustMatchSubjectIds;

        @ApiModelProperty("是否查看收藏")
        private Boolean favoriteFlag = false;

        @ApiModelProperty("最近练习 当前曲目ID")
        private Long excludeMusicId;

        @ApiModelProperty("app版本")
        private String version;

        @ApiModelProperty("platform")
        private String platform;

        @ApiModelProperty("id集合")
        private List<Long> ids;

        private Long albumId;

        private Long subjectId;

        @ApiModelProperty("可用机构专辑ID集合")
        private List<Long> tenantAlbumIds;

        private MusicSheetTypeEnum musicSheetType;

        // 是否为机构学生用户
        @ApiModelProperty(value = "提供方 TENANT 机构 PLATFORM 平台")
        private SourceTypeEnum providerType;

        @ApiModelProperty("标签id（多个逗号隔开）")
        private String musicTagIds;

        @ApiModelProperty(hidden = true)
        private List<Long> musicTagIdList;

        public void setMusicTagIds(String musicTagIds) {
            this.musicTagIds = musicTagIds;
            if (StringUtils.isNotBlank(musicTagIds)) {
                this.musicTagIdList = StringUtil.toLongList(musicTagIds);
            }
        }
        public String jsonString() {
            return JSON.toJSONString(this);
        }

        public static MusicSheetQuery from(String json) {
            return JSON.parseObject(json, MusicSheetQuery.class);
        }
    }
}
