EntranceBatch.java 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. package com.ruoyi.app.domain;
  2. import java.math.BigDecimal;
  3. import java.time.LocalDateTime;
  4. import java.time.LocalTime;
  5. import java.time.ZoneId;
  6. import java.util.Date;
  7. import com.fasterxml.jackson.annotation.JsonFormat;
  8. import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
  9. import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  10. import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
  11. import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
  12. import org.apache.commons.lang3.builder.ToStringBuilder;
  13. import org.apache.commons.lang3.builder.ToStringStyle;
  14. import com.ruoyi.common.annotation.Excel;
  15. import com.ruoyi.common.core.domain.BaseEntity;
  16. import org.springframework.format.annotation.DateTimeFormat;
  17. import javax.validation.constraints.*;
  18. /**
  19. * 入场批次对象 entrance_batch
  20. *
  21. * @author coede
  22. * @date 2025-03-19
  23. */
  24. public class EntranceBatch extends BaseEntity
  25. {
  26. private static final long serialVersionUID = 1L;
  27. /** ID */
  28. private Long id;
  29. /** 供应商ID */
  30. @Excel(name = "供应商ID")
  31. private Long supplierId;
  32. /** 进场时间 */
  33. @JsonDeserialize(using = LocalDateTimeDeserializer.class)
  34. @JsonSerialize(using = LocalDateTimeSerializer.class)
  35. @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  36. @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  37. @Excel(name = "进场时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
  38. private LocalDateTime entranceTime;
  39. /** 产地:三选一:1-本市、2-市外、3-省外,默认本市 */
  40. @Excel(name = "产地:三选一:1-本市、2-市外、3-省外,默认本市")
  41. private String originPlace;
  42. /** 动物品种 */
  43. @Excel(name = "动物品种")
  44. private String variety;
  45. /** 运输车辆 */
  46. @Excel(name = "运输车辆")
  47. private String transportVehicle;
  48. /** 重量 */
  49. @Excel(name = "重量")
  50. private BigDecimal weight;
  51. /** 待宰圈 */
  52. @Excel(name = "待宰圈")
  53. private String pigpens;
  54. /** 检疫证号码 */
  55. @Excel(name = "检疫证号码")
  56. private String animalCertNo;
  57. /** 检疫证图片或文件 */
  58. @Excel(name = "检疫证图片或文件")
  59. private String animalCertPics;
  60. /** 货主 */
  61. @Excel(name = "货主")
  62. private String cargoOwner;
  63. /** 主体识别号 */
  64. @Excel(name = "主体识别号")
  65. private String companyNo;
  66. /** 货主联系方式 */
  67. @Excel(name = "货主联系方式")
  68. private String cargoOwnerPhone;
  69. /** 动物种类 */
  70. @Excel(name = "动物种类")
  71. private String animalCategory;
  72. /** 数量 */
  73. @Excel(name = "数量")
  74. private Integer amount;
  75. /** 单位 */
  76. @Excel(name = "单位")
  77. private String units;
  78. /** 用途 */
  79. @Excel(name = "用途")
  80. private String useto;
  81. /** 启运地点 */
  82. @Excel(name = "启运地点")
  83. private String fromPlace;
  84. /** 到达地点 */
  85. @Excel(name = "到达地点")
  86. private String toPlace;
  87. /** 承运人 */
  88. @Excel(name = "承运人")
  89. private String carrier;
  90. /** 承运人联系方式 */
  91. @Excel(name = "承运人联系方式")
  92. private String carrierPhone;
  93. /** 牲畜耳标号 */
  94. @Excel(name = "牲畜耳标号")
  95. private String animalEartags;
  96. /** 备注 */
  97. @Excel(name = "备注")
  98. private String remark;
  99. /** 删除标志 */
  100. private String delFlag;
  101. private HarmlessTreatment harmlessTreatment;
  102. private Supplier supplier;
  103. public void setId(Long id)
  104. {
  105. this.id = id;
  106. }
  107. public Long getId()
  108. {
  109. return id;
  110. }
  111. public void setSupplierId(Long supplierId)
  112. {
  113. this.supplierId = supplierId;
  114. }
  115. @NotNull(message = "供应商不能为空")
  116. public Long getSupplierId()
  117. {
  118. return supplierId;
  119. }
  120. public void setEntranceTime(LocalDateTime entranceTime)
  121. {
  122. this.entranceTime = entranceTime;
  123. }
  124. public void entranceTimeAdapter() {
  125. if(entranceTime != null) {
  126. LocalDateTime realTime = entranceTime;
  127. if((realTime.getHour() == 0) && (realTime.getMinute() == 0) && (realTime.getSecond() == 0)) {
  128. LocalTime nowTime = LocalTime.now();
  129. realTime = realTime.withHour(nowTime.getHour())
  130. .withMinute(nowTime.getMinute())
  131. .minusSeconds(nowTime.getSecond())
  132. .withNano(nowTime.getNano());
  133. entranceTime = realTime;
  134. }
  135. }else {
  136. this.entranceTime = LocalDateTime.now();
  137. }
  138. }
  139. @NotNull(message = "进场时间不能为空")
  140. public LocalDateTime getEntranceTime()
  141. {
  142. return entranceTime;
  143. }
  144. public void setOriginPlace(String originPlace)
  145. {
  146. this.originPlace = originPlace;
  147. }
  148. @NotBlank(message = "产地不能为空")
  149. public String getOriginPlace()
  150. {
  151. return originPlace;
  152. }
  153. public void setVariety(String variety)
  154. {
  155. this.variety = variety;
  156. }
  157. @NotBlank(message = "品种不能为空")
  158. public String getVariety()
  159. {
  160. return variety;
  161. }
  162. public void setTransportVehicle(String transportVehicle)
  163. {
  164. this.transportVehicle = transportVehicle;
  165. }
  166. @Size(min = 0, max = 10, message = "运输车牌号输入超出最大长度限制(10位)")
  167. public String getTransportVehicle()
  168. {
  169. return transportVehicle;
  170. }
  171. public void setWeight(BigDecimal weight)
  172. {
  173. this.weight = weight;
  174. }
  175. @DecimalMin(value = "0.01", inclusive = true, message = "重量输入超出设定范围限制(0.01~99999.99)")
  176. @DecimalMax(value = "99999.99", inclusive = true, message = "重量输入超出设定范围限制(0.01~99999.99)")
  177. @Digits(integer = 5, fraction = 2, message = "重量输入的整数部分不能超过5位,小数部分不能超过2位")
  178. public BigDecimal getWeight()
  179. {
  180. return weight;
  181. }
  182. public void setPigpens(String pigpens)
  183. {
  184. this.pigpens = pigpens;
  185. }
  186. public String getPigpens()
  187. {
  188. return pigpens;
  189. }
  190. public void setAnimalCertNo(String animalCertNo)
  191. {
  192. this.animalCertNo = animalCertNo;
  193. }
  194. @NotBlank(message = "检疫证号不能为空")
  195. @Pattern(regexp = "^\\d{11}$", message = "检疫证号格式输入错误")
  196. public String getAnimalCertNo()
  197. {
  198. return animalCertNo;
  199. }
  200. public void setAnimalCertPics(String animalCertPics)
  201. {
  202. this.animalCertPics = animalCertPics;
  203. }
  204. public String getAnimalCertPics()
  205. {
  206. return animalCertPics;
  207. }
  208. public void setCargoOwner(String cargoOwner)
  209. {
  210. this.cargoOwner = cargoOwner;
  211. }
  212. @NotBlank(message = "货主不能为空")
  213. @Size(min = 1, max = 30, message = "货主输入超出最大长度限制(30位)")
  214. public String getCargoOwner()
  215. {
  216. return cargoOwner;
  217. }
  218. public void setCompanyNo(String companyNo)
  219. {
  220. this.companyNo = companyNo;
  221. }
  222. @NotBlank(message = "主体识别号不能为空")
  223. @Size(min = 18, max = 18, message = "主体识别号输入超出最大长度限制(18位)")
  224. public String getCompanyNo()
  225. {
  226. return companyNo;
  227. }
  228. public void setCargoOwnerPhone(String cargoOwnerPhone)
  229. {
  230. this.cargoOwnerPhone = cargoOwnerPhone;
  231. }
  232. @NotBlank(message = "联系方式不能为空")
  233. @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系方式格式输入错误")
  234. public String getCargoOwnerPhone()
  235. {
  236. return cargoOwnerPhone;
  237. }
  238. public void setAnimalCategory(String animalCategory)
  239. {
  240. this.animalCategory = animalCategory;
  241. }
  242. @NotBlank(message = "动物种类不能为空")
  243. @Size(min = 1, max = 10, message = "动物种类输入超出最大长度限制(10位)")
  244. public String getAnimalCategory()
  245. {
  246. return animalCategory;
  247. }
  248. public void setAmount(Integer amount)
  249. {
  250. this.amount = amount;
  251. }
  252. @NotNull(message = "数量不能为空")
  253. @Min(value = 1, message = "数量输入超出设定范围限制(1~999)")
  254. @Max(value = 999, message = "数量输入超出设定范围限制(1~999)")
  255. public Integer getAmount()
  256. {
  257. return amount;
  258. }
  259. public void setUnits(String units)
  260. {
  261. this.units = units;
  262. }
  263. @NotBlank(message = "单位不能为空")
  264. public String getUnits()
  265. {
  266. return units;
  267. }
  268. public void setUseto(String useto)
  269. {
  270. this.useto = useto;
  271. }
  272. @NotBlank(message = "用途不能为空")
  273. @Size(min = 1, max = 10, message = "用途输入超出最大长度限制(10位)")
  274. public String getUseto()
  275. {
  276. return useto;
  277. }
  278. public void setFromPlace(String fromPlace)
  279. {
  280. this.fromPlace = fromPlace;
  281. }
  282. @NotBlank(message = "启运地点不能为空")
  283. @Size(min = 1, max = 50, message = "启运地点输入超出最大长度限制(50位)")
  284. public String getFromPlace()
  285. {
  286. return fromPlace;
  287. }
  288. public void setToPlace(String toPlace)
  289. {
  290. this.toPlace = toPlace;
  291. }
  292. @NotBlank(message = "到达地点不能为空")
  293. @Size(min = 1, max = 50, message = "到达地点输入超出最大长度限制(50位)")
  294. public String getToPlace()
  295. {
  296. return toPlace;
  297. }
  298. public void setCarrier(String carrier)
  299. {
  300. this.carrier = carrier;
  301. }
  302. @NotBlank(message = "承运人不能为空")
  303. @Size(min = 1, max = 30, message = "承运人输入超出最大长度限制(30位)")
  304. public String getCarrier()
  305. {
  306. return carrier;
  307. }
  308. public void setCarrierPhone(String carrierPhone)
  309. {
  310. this.carrierPhone = carrierPhone;
  311. }
  312. @NotBlank(message = "联系方式不能为空")
  313. @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系方式格式输入错误")
  314. public String getCarrierPhone()
  315. {
  316. return carrierPhone;
  317. }
  318. public void setAnimalEartags(String animalEartags)
  319. {
  320. this.animalEartags = animalEartags;
  321. }
  322. @NotBlank(message = "耳标号不能为空")
  323. @Size(min = 15, max = 5000, message = "耳标号格式输入错误")
  324. public String getAnimalEartags()
  325. {
  326. return animalEartags;
  327. }
  328. @Override
  329. public void setRemark(String remark)
  330. {
  331. this.remark = remark;
  332. }
  333. @Override
  334. @Size(min = 0, max = 50, message = "备注输入超出最大长度限制(50位)")
  335. public String getRemark()
  336. {
  337. return remark;
  338. }
  339. public void setDelFlag(String delFlag)
  340. {
  341. this.delFlag = delFlag;
  342. }
  343. public String getDelFlag()
  344. {
  345. return delFlag;
  346. }
  347. public void setHarmlessTreatment(HarmlessTreatment harmlessTreatment)
  348. {
  349. this.harmlessTreatment = harmlessTreatment;
  350. }
  351. public HarmlessTreatment getHarmlessTreatment()
  352. {
  353. return harmlessTreatment;
  354. }
  355. public void setSupplier(Supplier supplier)
  356. {
  357. this.supplier = supplier;
  358. }
  359. public Supplier getSupplier()
  360. {
  361. return supplier;
  362. }
  363. @Override
  364. public String toString() {
  365. return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  366. .append("id", getId())
  367. .append("supplierId", getSupplierId())
  368. .append("entranceTime", getEntranceTime())
  369. .append("variety", getVariety())
  370. .append("transportVehicle", getTransportVehicle())
  371. .append("weight", getWeight())
  372. .append("pigpens", getPigpens())
  373. .append("animalCertNo", getAnimalCertNo())
  374. .append("animalCertPics", getAnimalCertPics())
  375. .append("cargoOwner", getCargoOwner())
  376. .append("companyNo", getCompanyNo())
  377. .append("cargoOwnerPhone", getCargoOwnerPhone())
  378. .append("animalCategory", getAnimalCategory())
  379. .append("amount", getAmount())
  380. .append("units", getUnits())
  381. .append("useto", getUseto())
  382. .append("fromPlace", getFromPlace())
  383. .append("toPlace", getToPlace())
  384. .append("carrier", getCarrier())
  385. .append("carrierPhone", getCarrierPhone())
  386. .append("animalEartags", getAnimalEartags())
  387. .append("remark", getRemark())
  388. .append("createTime", getCreateTime())
  389. .append("createBy", getCreateBy())
  390. .append("updateTime", getUpdateTime())
  391. .append("updateBy", getUpdateBy())
  392. .append("delFlag", getDelFlag())
  393. .append("harmlessTreatment", getHarmlessTreatment())
  394. .append("supplier", getSupplier())
  395. .toString();
  396. }
  397. }