package com.bonus.core.customer.model;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bonus.core.common.utils.SysUtil;
import com.bonus.utils.ValidationGroups;
import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

@TableName("cust_org")
@ApiModel("组织机构表")
@Data
public class CustOrg {
   private static final long serialVersionUID = 1L;
   @TableId
   @ApiModelProperty("主键自增")
   private Long id;
   @ApiModelProperty("机构id")
   private @NotNull(
   message = "{customer.org.orgId.nonNull}",
   groups = {ValidationGroups.Update.class, ValidationGroups.Delete.class}
) Long orgId;
   @ApiModelProperty("机构全路径id")
   private String orgFullId;
   @ApiModelProperty("机构编号")
   private @Size(
   max = 128,
   message = "{customer.org.num.size.limit}"
) String orgNum;
   @ApiModelProperty("机构名称")
   private @Size(
   min = 1,
   max = 50,
   message = "{customer.org.name.size.limit}",
   groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class}
) String orgName;
   @ApiModelProperty("机构全称")
   private String orgFullName;
   @ApiModelProperty("机构级别")
   private Integer orgLevel;
   @ApiModelProperty("上级机构id")
   private @NotNull(
   message = "{customer.org.superOrgId.nonNull}",
   groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class}
) Long superId;
   @ApiModelProperty("机构负责人")
   private String orgHead;
   @ApiModelProperty("组织负责人id（cust_id）")
   private Long orgHeadId;
   @ApiModelProperty("机构电话")
   private String orgTel;
   @ApiModelProperty("组织图片")
   private String picture;
   @ApiModelProperty("有效日期")
   private LocalDate endDate;
   @ApiModelProperty("就餐地（为新增人员提供默认值）")
   private JsonNode diningPlace;
   @ApiModelProperty("备注描述")
   private @Size(
   max = 512,
   message = "{customer.org.remark.size.limit}",
   groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class}
) String remarks;
   @ApiModelProperty("是否删除")
   private Integer ifDel;
   @ApiModelProperty("乐观锁")
   private Integer revision;
   @ApiModelProperty("创建人")
   private String crby;
   @ApiModelProperty("创建时间")
   private LocalDateTime crtime;
   @ApiModelProperty("更新人")
   private String upby;
   @ApiModelProperty("更新时间")
   private LocalDateTime uptime;
   @ApiModelProperty("排序号")
   private Integer sort;

   public CustOrg setPicture(String picture) {
      this.picture = SysUtil.getCutPath(picture);
      return this;
   }

   public Long getId() {
      return this.id;
   }

   public Long getOrgId() {
      return this.orgId;
   }

   public String getOrgFullId() {
      return this.orgFullId;
   }

   public String getOrgNum() {
      return this.orgNum;
   }

   public String getOrgName() {
      return this.orgName;
   }

   public String getOrgFullName() {
      return this.orgFullName;
   }

   public Integer getOrgLevel() {
      return this.orgLevel;
   }

   public Long getSuperId() {
      return this.superId;
   }

   public String getOrgHead() {
      return this.orgHead;
   }

   public Long getOrgHeadId() {
      return this.orgHeadId;
   }

   public String getOrgTel() {
      return this.orgTel;
   }

   public String getPicture() {
      return this.picture;
   }

   public LocalDate getEndDate() {
      return this.endDate;
   }

   public JsonNode getDiningPlace() {
      return this.diningPlace;
   }

   public String getRemarks() {
      return this.remarks;
   }

   public Integer getIfDel() {
      return this.ifDel;
   }

   public Integer getRevision() {
      return this.revision;
   }

   public String getCrby() {
      return this.crby;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public String getUpby() {
      return this.upby;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public Integer getSort() {
      return this.sort;
   }

   public CustOrg setId(final Long id) {
      this.id = id;
      return this;
   }

   public CustOrg setOrgId(final Long orgId) {
      this.orgId = orgId;
      return this;
   }

   public CustOrg setOrgFullId(final String orgFullId) {
      this.orgFullId = orgFullId;
      return this;
   }

   public CustOrg setOrgNum(final String orgNum) {
      this.orgNum = orgNum;
      return this;
   }

   public CustOrg setOrgName(final String orgName) {
      this.orgName = orgName;
      return this;
   }

   public CustOrg setOrgFullName(final String orgFullName) {
      this.orgFullName = orgFullName;
      return this;
   }

   public CustOrg setOrgLevel(final Integer orgLevel) {
      this.orgLevel = orgLevel;
      return this;
   }

   public CustOrg setSuperId(final Long superId) {
      this.superId = superId;
      return this;
   }

   public CustOrg setOrgHead(final String orgHead) {
      this.orgHead = orgHead;
      return this;
   }

   public CustOrg setOrgHeadId(final Long orgHeadId) {
      this.orgHeadId = orgHeadId;
      return this;
   }

   public CustOrg setOrgTel(final String orgTel) {
      this.orgTel = orgTel;
      return this;
   }

   public CustOrg setEndDate(final LocalDate endDate) {
      this.endDate = endDate;
      return this;
   }

   public CustOrg setDiningPlace(final JsonNode diningPlace) {
      this.diningPlace = diningPlace;
      return this;
   }

   public CustOrg setRemarks(final String remarks) {
      this.remarks = remarks;
      return this;
   }

   public CustOrg setIfDel(final Integer ifDel) {
      this.ifDel = ifDel;
      return this;
   }

   public CustOrg setRevision(final Integer revision) {
      this.revision = revision;
      return this;
   }

   public CustOrg setCrby(final String crby) {
      this.crby = crby;
      return this;
   }

   public CustOrg setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
      return this;
   }

   public CustOrg setUpby(final String upby) {
      this.upby = upby;
      return this;
   }

   public CustOrg setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
      return this;
   }

   public CustOrg setSort(final Integer sort) {
      this.sort = sort;
      return this;
   }


}
