CarInfoVo.java 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. package com.ydtech.modules.ins.model.vo;
  2. import com.ydtech.constants.enums.dict.insurance.EnergyType;
  3. import com.ydtech.modules.ins.model.ya.CarModelDTO;
  4. import com.ydtech.validation.annotation.CheckDateTime;
  5. import io.swagger.annotations.ApiModel;
  6. import io.swagger.annotations.ApiModelProperty;
  7. import lombok.Data;
  8. import org.hibernate.validator.constraints.Range;
  9. import javax.validation.constraints.Digits;
  10. import javax.validation.constraints.NotNull;
  11. import javax.validation.constraints.Past;
  12. /**
  13. * @author qinfenglong
  14. * @version 1.0.0
  15. * @description CarModelInfo
  16. * @since 2020/11/21 20:12
  17. */
  18. @Data
  19. @ApiModel(value = "车辆信息")
  20. public class CarInfoVo {
  21. // @NotNull(message = "品牌型号不能为空")
  22. @ApiModelProperty(value = "品牌型号")
  23. private String brandName;
  24. @ApiModelProperty(value = "车型品牌")
  25. private String carBrand;
  26. @ApiModelProperty(value = "行业车型名称")
  27. private String ciCarName;
  28. @ApiModelProperty(value = "行业车型编码")
  29. private String ciModelCode;
  30. @NotNull(message = "整备质量不能为空")
  31. @Range(message = "整备质量必须为整数")
  32. @ApiModelProperty(value = "整备质量")
  33. private String completeKerbMass;
  34. @NotNull(message = "发动机号不能为空")
  35. @ApiModelProperty(value = "发动机号")
  36. private String engineNo;
  37. @ApiModelProperty(value = "排量")
  38. private String exhaustScale;
  39. @ApiModelProperty(value = "工厂名称")
  40. private String factory;
  41. @ApiModelProperty(value = "工厂编码")
  42. private String factoryid;
  43. @NotNull(message = "车架号不能为空")
  44. @ApiModelProperty(value = "车架号")
  45. private String frameNo;
  46. // @NotNull(message = "车牌号不能为空")
  47. @ApiModelProperty(value = "车牌")
  48. private String licenseNo;
  49. @ApiModelProperty(value = "车牌种类")
  50. private String licenseTypeCode;
  51. @ApiModelProperty(value = "精友车型编码")
  52. private String modelCode;
  53. @NotNull(message = "新车购置价不能为空")
  54. @Range(message = "新车购置价必须为整数")
  55. @ApiModelProperty(value = "新车购置价")
  56. private String purchasePrice;
  57. @NotNull(message = "座位数不能为空")
  58. @Range(min = 1,max = 99,message = "座位数只能填写 1 - 99的整数")
  59. @ApiModelProperty(value = "座位数")
  60. private String seatCount;
  61. @ApiModelProperty(value = "车辆类型(轿车类,特种车类)")
  62. private String vehicleclass;
  63. // @NotNull(message = "车架号不能为空")
  64. @ApiModelProperty(value = "车架号")
  65. private String vinNo;
  66. @NotNull(message = "车型不能为空")
  67. @ApiModelProperty(value = "车型")
  68. private String familyName;
  69. @NotNull(message = "车型名称不能为空")
  70. @ApiModelProperty(value = "车型名称")
  71. private String modelcname;
  72. @ApiModelProperty(value = "能源类型编码(D1天然气(NG/CNG/LNG) D3汽油 D2柴油)")
  73. private String powertypecode;
  74. /**
  75. * @Date 2023-03-15
  76. */
  77. /**
  78. * @see com.ydtech.constants.enums.dict.insurance.EnergyType
  79. */
  80. @NotNull(message = "能源种类不能为空")
  81. @ApiModelProperty(value = "能源种类")
  82. private String energyType;
  83. @ApiModelProperty(value = "总质量")
  84. private String vehicleweight;
  85. @Range(message = "核定载质量必须为整数")
  86. @ApiModelProperty(value = "核定载质量")
  87. private String limitLoad;
  88. @ApiModelProperty(value = "年款")
  89. private String caryear;
  90. /**
  91. * @see com.ydtech.constants.enums.dict.insurance.VehicleType
  92. */
  93. @NotNull(message = "车辆种类不能为空")
  94. @ApiModelProperty(value = "车辆种类")
  95. private String cimodelclass;
  96. @ApiModelProperty(value = "燃料类型")
  97. private String powertype;
  98. @Digits(integer = Integer.MAX_VALUE, fraction = 5, message = "排量必须是小数,且小数位最多5位")
  99. @ApiModelProperty(value = "排量(和exhaustScale区分开)")
  100. private String enginedesc;
  101. @NotNull(message = "行驶证注册日期不能空")
  102. @ApiModelProperty(value = "行驶证注册日期")
  103. @CheckDateTime(format = "yyyy-MM-dd", message = "行驶证注册日期的正确格式为yyyy-MM-dd")
  104. private String registerDate;
  105. @NotNull(message = "发证日期不能为空")
  106. @ApiModelProperty(value = "发证日期")
  107. @CheckDateTime(format = "yyyy-MM-dd", message = "发证日期的正确格式为yyyy-MM-dd")
  108. private String issueDate;
  109. @ApiModelProperty(value = "是否过户")
  110. private boolean transferFlag;
  111. //处理 @Data 中 boolean 无法get hxl 2024-07-17 设置为 Boolean 类型没有默认值,因此添加方法
  112. public boolean isTransferFlag() {
  113. return transferFlag;
  114. }
  115. public void setTransferFlag(boolean transferFlag) {
  116. this.transferFlag = transferFlag;
  117. }
  118. // 华农,太平,泰康,华泰
  119. @ApiModelProperty(value = "商业是否过户")
  120. private boolean transferFlagBi;
  121. /**
  122. * 国寿app
  123. *
  124. * @date: 2023/8/23 10:37
  125. **/
  126. @ApiModelProperty(value = "是否是二手车")
  127. private boolean usedCar;
  128. @ApiModelProperty(value = "是否脱保")
  129. private boolean outOfInsurance;
  130. @ApiModelProperty(value = "过户日期")
  131. @CheckDateTime(format = "yyyy-MM-dd", message = "发证日期的正确格式为yyyy-MM-dd")
  132. private String transferDate;
  133. @ApiModelProperty(value = "是否贷款车")
  134. private boolean loanStatus;
  135. @ApiModelProperty(value = "第一受益人(贷款车才有第一受益人)")
  136. private String firstBeneMan;
  137. @ApiModelProperty(value = "是否有车牌号(判断是否是新车)")
  138. private boolean noLicenseFlag;
  139. /**
  140. * @see com.ydtech.constants.enums.dict.insurance.TrafficManagementVehicleType
  141. */
  142. @ApiModelProperty(value = "车辆类型")
  143. private String cartype;
  144. /**
  145. * @see com.ydtech.constants.enums.dict.insurance.NatureOfVehicleUse
  146. */
  147. @ApiModelProperty(value = "使用性质")
  148. private String carnature;
  149. /**
  150. * 营业
  151. *
  152. * @see com.ydtech.constants.enums.dict.insurance.BusinessVehicleUse
  153. * 非营业
  154. * @see com.ydtech.constants.enums.dict.insurance.OutOfBusinessVehicleUse
  155. */
  156. @ApiModelProperty(value = "车辆用途")
  157. private String vehicleUse;
  158. /**
  159. * 所属性质
  160. *
  161. * @see com.ydtech.constants.enums.dict.insurance.Property
  162. */
  163. @ApiModelProperty(value = "所属性质(1个人 2企业 3机关)")
  164. private String property;
  165. @ApiModelProperty(value = "发动机功率")
  166. private String powerScale;
  167. // 判断是否是新能源车
  168. public boolean isNewEnergy() {
  169. return EnergyType.isNewEnergy(energyType);
  170. }
  171. /**
  172. * 获取核定载质量吨位
  173. * @return
  174. */
  175. public Double limitLoadTon(){
  176. return Double.parseDouble(limitLoad) / 1000;
  177. }
  178. public CarModelDTO toCarModelDTO() {
  179. CarModelDTO carModelDTO = new CarModelDTO();
  180. carModelDTO.setModelCode(this.modelCode);
  181. carModelDTO.setModelName(this.brandName);
  182. carModelDTO.setSeries(this.familyName);
  183. carModelDTO.setRatedPassengerCapacity(this.seatCount);
  184. carModelDTO.setDisplacement(this.enginedesc);
  185. carModelDTO.setMarketYear(this.caryear);
  186. carModelDTO.setReplacementValue(this.purchasePrice);
  187. carModelDTO.setFuelType(this.powertype);
  188. carModelDTO.setEnergyTypes(this.energyType);
  189. carModelDTO.setFuelTypeCode(this.energyType);
  190. return carModelDTO;
  191. }
  192. public void getTransferFlag() {
  193. }
  194. }