CarInfoVo.java 7.5 KB

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