/**
 * @filename:CustomerAssignRecord 2024-06-03
 * @project trade-admin V1.0 Copyright(c) 2024 wanglang Co. Ltd. All right reserved.
 */
package com.trade.admin.enterprise.customer.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.trade.common.core.domain.CommonEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @Description: 客户移交分配记录表
 * @version: V1.0
 * @author: wanglang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("customer_assign_record")
public class CustomerAssignRecord extends CommonEntity<CustomerAssignRecord> {

    private static final long serialVersionUID = 1717384281930L;
    @ApiModelProperty(name = "bdUserIdNew", value = "BD用户ID（B端用户）新的")
    private Long bdUserIdNew;
    @ApiModelProperty(name = "bdUserIdSource", value = "BD用户ID（B端用户）旧的")
    private Long bdUserIdSource;
    @ApiModelProperty(name = "bdUserNameNew", value = "BD用户名称（B端用户）新的")
    private String bdUserNameNew;
    @ApiModelProperty(name = "bdUserNameSource", value = "BD用户名称（B端用户）旧的")
    private String bdUserNameSource;
    @NotNull(message = "分配ID不能为空")
    @ApiModelProperty(name = "customerAssignId", value = "客户分配ID")
    private Long customerAssignId;
    @NotNull(message = "C端用户ID不能为空")
    @ApiModelProperty(name = "customerUserId", value = "C端用户ID")
    private Long customerUserId;
    @ApiModelProperty(name = "operatorId", value = "操作人ID（B端用户）")
    private Long operatorId;
    @ApiModelProperty(name = "operatorName", value = "操作人名称（B端用户）")
    private String operatorName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(name = "operatorTime", value = "操作时间（B端用户）")
    private LocalDateTime operatorTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(name = "operatorType", value = "操作类型:1认领,2分配,3-移交")
    private Integer operatorType;
    @ApiModelProperty(name = "rcUserIdNew", value = "RC用户ID（B端用户）新的")
    private Long rcUserIdNew;
    @ApiModelProperty(name = "rcUserIdSource", value = "RC用户ID（B端用户）旧的")
    private Long rcUserIdSource;
    @ApiModelProperty(name = "rcUserNameNew", value = "RC用户名称（B端用户）新的")
    private String rcUserNameNew;
    @ApiModelProperty(name = "rcUserNameSource", value = "RC用户名称（B端用户）旧的")
    private String rcUserNameSource;
    @Length(max = 500, message = "备注不能超过500个字符")
    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    public CustomerAssignRecord(){
    }

    public CustomerAssignRecord(CustomerAssign customerAssign){
        this.bdUserIdSource = customerAssign.getBdUserId();
        this.bdUserNameSource = customerAssign.getBdUserName();
        this.customerAssignId = customerAssign.getId();
        this.customerUserId = customerAssign.getCustomerUserId();
        this.rcUserIdSource = customerAssign.getRcUserId();
        this.rcUserNameSource = customerAssign.getRcUserName();
    }
}
