package com.sf.dangbao.core.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.water.base.entity.AutoIdEntity;
@TableName("customer")
@Data
@ApiModel
public class Customer extends AutoIdEntity {
/**
* 客戶編碼
*/
@ApiModelProperty(name = "客戶編碼")
private String customerCode;
/**
* 客戶名稱
*/
@ApiModelProperty(name = "客戶名稱")
private String customerName;
/**
* 接口參數
*/
@ApiModelProperty(name = "接口參數")
private String customerKey;
/**
* 業務類型 0攬件 1攬件&派件 2派件
*/
@ApiModelProperty(name = "業務類型 0攬件 1攬件&派件 2派件")
private Integer businessType;
/**
* 任務來源 1-API導入 2-后台每日創建
*/
@ApiModelProperty(name = "任務來源 1-API導入 2-后台每日創建")
private Integer jobSource;
/**
* 客戶狀態 0- 禁用 1-啟用
*/
@ApiModelProperty(name = "客戶狀態 0- 禁用 1-啟用")
private Integer status;
/**
* 類型排序
*/
@TableField(exist = false)
private String typeDesc;
/**
* 城市
*/
@TableField(exist = false)
private String city;
/**
* 地址對應經緯度
*/
@TableField(exist = false)
private String lngLat;
/**
* 業務類型枚舉
*/
public enum BusinessType{
//
LAN(0,"攬件"),
PAI_LAN(1,"派件&攬件"),
PAI(2,"派件"),
;
private int val;
private String desc;
BusinessType(int val,String desc){
this.val = val;
this.desc = desc;
}
public static BusinessType valueOf(int val) {
for (BusinessType businessType : BusinessType.values()) {
if (businessType.val == val) {
return businessType;
}
}
throw new IllegalArgumentException("參數錯誤,找不到業務類型:"+val);
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
/**
* 客戶分級
*/
public enum Type {
//
COUNTY(0, "區縣"),
TOWN(1, "鄉鎮"),
VILLAGE(2, "村組");
private int value;
private String desc;
Type(int value, String desc) {
this.value = value;
this.desc = desc;
}
public static Type valueOfDesc(String desc) {
for (Type type : Type.values()) {
if (type.desc.equals(desc)) {
return type;
}
}
throw new IllegalArgumentException("參數錯誤,找不到對應狀態:" + desc);
}
public static Type valueOf(int value) {
for (Type type : Type.values()) {
if (type.value == value) {
return type;
}
}
throw new IllegalArgumentException("參數錯誤,找不到對應狀態:" + value);
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
/**
* 任務來源
*/
public enum JobSource{
//
BY_API(1,"API導入"),
BY_DAY(2,"后台每日創建"),
;
private int val;
private String desc;
JobSource(int val,String desc){
this.val = val;
this.desc = desc;
}
public static JobSource valueOf(int val) {
for (JobSource jobSource : JobSource.values()) {
if (jobSource.val == val) {
return jobSource;
}
}
throw new IllegalArgumentException("參數錯誤,找不到任務創建方式:"+val);
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
}
/**
* 客戶狀態
*/
public enum CustomerStatus{
//
BAN(0),
USING(1),
;
private int val;
CustomerStatus(int val){
this.val = val;
}
public static CustomerStatus valueOf(int val) {
for (CustomerStatus customerStatus : CustomerStatus.values()) {
if (customerStatus.val == val) {
return customerStatus;
}
}
throw new IllegalArgumentException("參數錯誤,找不到客戶狀態:"+val);
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
}
}