123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479 |
- package com.ruoyi.app.domain;
- import java.math.BigDecimal;
- import java.time.LocalDateTime;
- import java.time.LocalTime;
- import java.time.ZoneId;
- import java.util.Date;
- import com.fasterxml.jackson.annotation.JsonFormat;
- import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
- import com.fasterxml.jackson.databind.annotation.JsonSerialize;
- import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
- import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
- import org.apache.commons.lang3.builder.ToStringBuilder;
- import org.apache.commons.lang3.builder.ToStringStyle;
- import com.ruoyi.common.annotation.Excel;
- import com.ruoyi.common.core.domain.BaseEntity;
- import org.springframework.format.annotation.DateTimeFormat;
- import javax.validation.constraints.*;
- /**
- * 入场批次对象 entrance_batch
- *
- * @author coede
- * @date 2025-03-19
- */
- public class EntranceBatch extends BaseEntity
- {
- private static final long serialVersionUID = 1L;
- /** ID */
- private Long id;
- /** 供应商ID */
- @Excel(name = "供应商ID")
- private Long supplierId;
- /** 进场时间 */
- @JsonDeserialize(using = LocalDateTimeDeserializer.class)
- @JsonSerialize(using = LocalDateTimeSerializer.class)
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
- @Excel(name = "进场时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
- private LocalDateTime entranceTime;
- /** 产地:三选一:1-本市、2-市外、3-省外,默认本市 */
- @Excel(name = "产地:三选一:1-本市、2-市外、3-省外,默认本市")
- private String originPlace;
- /** 动物品种 */
- @Excel(name = "动物品种")
- private String variety;
- /** 运输车辆 */
- @Excel(name = "运输车辆")
- private String transportVehicle;
- /** 重量 */
- @Excel(name = "重量")
- private BigDecimal weight;
- /** 待宰圈 */
- @Excel(name = "待宰圈")
- private String pigpens;
- /** 检疫证号码 */
- @Excel(name = "检疫证号码")
- private String animalCertNo;
- /** 检疫证图片或文件 */
- @Excel(name = "检疫证图片或文件")
- private String animalCertPics;
- /** 货主 */
- @Excel(name = "货主")
- private String cargoOwner;
- /** 主体识别号 */
- @Excel(name = "主体识别号")
- private String companyNo;
- /** 货主联系方式 */
- @Excel(name = "货主联系方式")
- private String cargoOwnerPhone;
- /** 动物种类 */
- @Excel(name = "动物种类")
- private String animalCategory;
- /** 数量 */
- @Excel(name = "数量")
- private Integer amount;
- /** 单位 */
- @Excel(name = "单位")
- private String units;
- /** 用途 */
- @Excel(name = "用途")
- private String useto;
- /** 启运地点 */
- @Excel(name = "启运地点")
- private String fromPlace;
- /** 到达地点 */
- @Excel(name = "到达地点")
- private String toPlace;
- /** 承运人 */
- @Excel(name = "承运人")
- private String carrier;
- /** 承运人联系方式 */
- @Excel(name = "承运人联系方式")
- private String carrierPhone;
- /** 牲畜耳标号 */
- @Excel(name = "牲畜耳标号")
- private String animalEartags;
- /** 备注 */
- @Excel(name = "备注")
- private String remark;
- /** 删除标志 */
- private String delFlag;
- private HarmlessTreatment harmlessTreatment;
- private Supplier supplier;
- public void setId(Long id)
- {
- this.id = id;
- }
- public Long getId()
- {
- return id;
- }
- public void setSupplierId(Long supplierId)
- {
- this.supplierId = supplierId;
- }
- @NotNull(message = "供应商不能为空")
- public Long getSupplierId()
- {
- return supplierId;
- }
- public void setEntranceTime(LocalDateTime entranceTime)
- {
- this.entranceTime = entranceTime;
- }
- public void entranceTimeAdapter() {
- if(entranceTime != null) {
- LocalDateTime realTime = entranceTime;
- if((realTime.getHour() == 0) && (realTime.getMinute() == 0) && (realTime.getSecond() == 0)) {
- LocalTime nowTime = LocalTime.now();
- realTime = realTime.withHour(nowTime.getHour())
- .withMinute(nowTime.getMinute())
- .minusSeconds(nowTime.getSecond())
- .withNano(nowTime.getNano());
- entranceTime = realTime;
- }
- }else {
- this.entranceTime = LocalDateTime.now();
- }
- }
- @NotNull(message = "进场时间不能为空")
- public LocalDateTime getEntranceTime()
- {
- return entranceTime;
- }
- public void setOriginPlace(String originPlace)
- {
- this.originPlace = originPlace;
- }
- @NotBlank(message = "产地不能为空")
- public String getOriginPlace()
- {
- return originPlace;
- }
- public void setVariety(String variety)
- {
- this.variety = variety;
- }
- @NotBlank(message = "品种不能为空")
- public String getVariety()
- {
- return variety;
- }
- public void setTransportVehicle(String transportVehicle)
- {
- this.transportVehicle = transportVehicle;
- }
- @Size(min = 0, max = 10, message = "运输车牌号输入超出最大长度限制(10位)")
- public String getTransportVehicle()
- {
- return transportVehicle;
- }
- public void setWeight(BigDecimal weight)
- {
- this.weight = weight;
- }
- @DecimalMin(value = "0.01", inclusive = true, message = "重量输入超出设定范围限制(0.01~99999.99)")
- @DecimalMax(value = "99999.99", inclusive = true, message = "重量输入超出设定范围限制(0.01~99999.99)")
- @Digits(integer = 5, fraction = 2, message = "重量输入的整数部分不能超过5位,小数部分不能超过2位")
- public BigDecimal getWeight()
- {
- return weight;
- }
- public void setPigpens(String pigpens)
- {
- this.pigpens = pigpens;
- }
- public String getPigpens()
- {
- return pigpens;
- }
- public void setAnimalCertNo(String animalCertNo)
- {
- this.animalCertNo = animalCertNo;
- }
- @NotBlank(message = "检疫证号不能为空")
- @Pattern(regexp = "^\\d{11}$", message = "检疫证号格式输入错误")
- public String getAnimalCertNo()
- {
- return animalCertNo;
- }
- public void setAnimalCertPics(String animalCertPics)
- {
- this.animalCertPics = animalCertPics;
- }
- public String getAnimalCertPics()
- {
- return animalCertPics;
- }
- public void setCargoOwner(String cargoOwner)
- {
- this.cargoOwner = cargoOwner;
- }
- @NotBlank(message = "货主不能为空")
- @Size(min = 1, max = 30, message = "货主输入超出最大长度限制(30位)")
- public String getCargoOwner()
- {
- return cargoOwner;
- }
- public void setCompanyNo(String companyNo)
- {
- this.companyNo = companyNo;
- }
- @NotBlank(message = "主体识别号不能为空")
- @Size(min = 18, max = 18, message = "主体识别号输入超出最大长度限制(18位)")
- public String getCompanyNo()
- {
- return companyNo;
- }
- public void setCargoOwnerPhone(String cargoOwnerPhone)
- {
- this.cargoOwnerPhone = cargoOwnerPhone;
- }
- @NotBlank(message = "联系方式不能为空")
- @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系方式格式输入错误")
- public String getCargoOwnerPhone()
- {
- return cargoOwnerPhone;
- }
- public void setAnimalCategory(String animalCategory)
- {
- this.animalCategory = animalCategory;
- }
- @NotBlank(message = "动物种类不能为空")
- @Size(min = 1, max = 10, message = "动物种类输入超出最大长度限制(10位)")
- public String getAnimalCategory()
- {
- return animalCategory;
- }
- public void setAmount(Integer amount)
- {
- this.amount = amount;
- }
- @NotNull(message = "数量不能为空")
- @Min(value = 1, message = "数量输入超出设定范围限制(1~999)")
- @Max(value = 999, message = "数量输入超出设定范围限制(1~999)")
- public Integer getAmount()
- {
- return amount;
- }
- public void setUnits(String units)
- {
- this.units = units;
- }
- @NotBlank(message = "单位不能为空")
- public String getUnits()
- {
- return units;
- }
- public void setUseto(String useto)
- {
- this.useto = useto;
- }
- @NotBlank(message = "用途不能为空")
- @Size(min = 1, max = 10, message = "用途输入超出最大长度限制(10位)")
- public String getUseto()
- {
- return useto;
- }
- public void setFromPlace(String fromPlace)
- {
- this.fromPlace = fromPlace;
- }
- @NotBlank(message = "启运地点不能为空")
- @Size(min = 1, max = 50, message = "启运地点输入超出最大长度限制(50位)")
- public String getFromPlace()
- {
- return fromPlace;
- }
- public void setToPlace(String toPlace)
- {
- this.toPlace = toPlace;
- }
- @NotBlank(message = "到达地点不能为空")
- @Size(min = 1, max = 50, message = "到达地点输入超出最大长度限制(50位)")
- public String getToPlace()
- {
- return toPlace;
- }
- public void setCarrier(String carrier)
- {
- this.carrier = carrier;
- }
- @NotBlank(message = "承运人不能为空")
- @Size(min = 1, max = 30, message = "承运人输入超出最大长度限制(30位)")
- public String getCarrier()
- {
- return carrier;
- }
- public void setCarrierPhone(String carrierPhone)
- {
- this.carrierPhone = carrierPhone;
- }
- @NotBlank(message = "联系方式不能为空")
- @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系方式格式输入错误")
- public String getCarrierPhone()
- {
- return carrierPhone;
- }
- public void setAnimalEartags(String animalEartags)
- {
- this.animalEartags = animalEartags;
- }
- @NotBlank(message = "耳标号不能为空")
- @Size(min = 15, max = 5000, message = "耳标号格式输入错误")
- public String getAnimalEartags()
- {
- return animalEartags;
- }
- @Override
- public void setRemark(String remark)
- {
- this.remark = remark;
- }
- @Override
- @Size(min = 0, max = 50, message = "备注输入超出最大长度限制(50位)")
- public String getRemark()
- {
- return remark;
- }
- public void setDelFlag(String delFlag)
- {
- this.delFlag = delFlag;
- }
- public String getDelFlag()
- {
- return delFlag;
- }
- public void setHarmlessTreatment(HarmlessTreatment harmlessTreatment)
- {
- this.harmlessTreatment = harmlessTreatment;
- }
- public HarmlessTreatment getHarmlessTreatment()
- {
- return harmlessTreatment;
- }
- public void setSupplier(Supplier supplier)
- {
- this.supplier = supplier;
- }
- public Supplier getSupplier()
- {
- return supplier;
- }
- @Override
- public String toString() {
- return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
- .append("id", getId())
- .append("supplierId", getSupplierId())
- .append("entranceTime", getEntranceTime())
- .append("variety", getVariety())
- .append("transportVehicle", getTransportVehicle())
- .append("weight", getWeight())
- .append("pigpens", getPigpens())
- .append("animalCertNo", getAnimalCertNo())
- .append("animalCertPics", getAnimalCertPics())
- .append("cargoOwner", getCargoOwner())
- .append("companyNo", getCompanyNo())
- .append("cargoOwnerPhone", getCargoOwnerPhone())
- .append("animalCategory", getAnimalCategory())
- .append("amount", getAmount())
- .append("units", getUnits())
- .append("useto", getUseto())
- .append("fromPlace", getFromPlace())
- .append("toPlace", getToPlace())
- .append("carrier", getCarrier())
- .append("carrierPhone", getCarrierPhone())
- .append("animalEartags", getAnimalEartags())
- .append("remark", getRemark())
- .append("createTime", getCreateTime())
- .append("createBy", getCreateBy())
- .append("updateTime", getUpdateTime())
- .append("updateBy", getUpdateBy())
- .append("delFlag", getDelFlag())
- .append("harmlessTreatment", getHarmlessTreatment())
- .append("supplier", getSupplier())
- .toString();
- }
- }
|