package com.ruoyi.common.core.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.constant.DeletedEnum;
import com.ruoyi.common.utils.SecurityUtils;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 经纬度基础对象 sys_base_longitude_latitude
 *
 * @author lyp
 * @date 2023-09-16
 */
@Data
public class BaseLongitudeLatitude extends BaseEntity {

    private static final long serialVersionUID = -8784312000473660588L;
    /**
     * uuid主键
     */
    private String id;

    /**
     * 业务表主键
     */
    @Excel(name = "业务表主键")
    private String serviceId;

    /**
     * 业务表主键数组
     */
//    @Excel(name = "业务表主键数组")
//    private List<String> serviceIdList;

    /**
     * 业务表编码：防止业务表主键一样时无法区分
     */
    @Excel(name = "业务表编码：防止业务表主键一样时无法区分")
    private String serviceCode;

    /**
     * 经度
     */
    @Excel(name = "经度")
    private BigDecimal longitude;

    /**
     * 维度
     */
    @Excel(name = "维度")
    private BigDecimal latitude;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remarkInfo;

    /**
     * 企业编码
     */
    @Excel(name = "企业编码")
    private String companyCode;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    /**
     * 创建人ID
     */
    @Excel(name = "创建人ID")
    private Long createUserId;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateDate;

    /**
     * 更新人
     */
    @Excel(name = "更新人")
    private Long updateUserId;

    /**
     * 删除标识：0正常，1已删除
     */
    @Excel(name = "删除标识：0正常，1已删除")
    private Integer isDel;

    public void setCreateDefault() {
        this.setCreateUserId(SecurityUtils.getUserId());
        this.setCreateDate(new Date());
        this.setUpdateUserId(SecurityUtils.getUserId());
        this.setUpdateDate(new Date());
        this.setIsDel(DeletedEnum.VALID.getValue());
        this.setCompanyCode(SecurityUtils.getUserCompanyCode());

    }

    public void setUpdateDefault() {
        this.setUpdateUserId(SecurityUtils.getUserId());
        this.setUpdateDate(new Date());
    }


}
