RegistIMEIRequest.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.huaxu.zoniot.dto;
  2. import com.huaxu.zoniot.common.ErrorConstants;
  3. import io.swagger.annotations.ApiModel;
  4. import io.swagger.annotations.ApiModelProperty;
  5. import lombok.Data;
  6. import org.apache.commons.lang3.StringUtils;
  7. import java.io.Serializable;
  8. /**
  9. * <p>设备注册请求</p>
  10. *
  11. * @Author wilian.peng
  12. * @Date 2021/1/8 14:27
  13. * @Version 1.0
  14. */
  15. @Data
  16. @ApiModel("设备注册请求")
  17. public class RegistIMEIRequest implements Serializable {
  18. /**
  19. * 用户编码 --> 水表用户编码
  20. */
  21. @ApiModelProperty("用户编码")
  22. String customerNo ;
  23. /**
  24. * 水表注册号 --> 水表电子号
  25. */
  26. @ApiModelProperty("水表电子号")
  27. String registNo ;
  28. /**
  29. * 小区名称-->小区名称
  30. */
  31. @ApiModelProperty("小区名称")
  32. String smallZone ;
  33. /**
  34. *详细地址 --> 详细地址
  35. */
  36. @ApiModelProperty("详细地址")
  37. String addr ;
  38. /**
  39. * 安装位置-->水表安装位置
  40. */
  41. @ApiModelProperty("安装位置")
  42. String location ;
  43. /**
  44. * IMEI号 --> 设备IMEI号,设备编号
  45. */
  46. @ApiModelProperty("IMEI号")
  47. String imei ;
  48. @ApiModelProperty("水表类型,1:Lora,2:NB(天津协议),3:NB(188协议)")
  49. Integer meterType;
  50. /**
  51. * 验证值 --> 验证值
  52. */
  53. @ApiModelProperty("apiKey")
  54. String apiKey;
  55. public String check(){
  56. StringBuffer result=new StringBuffer();
  57. if(StringUtils.isBlank(customerNo)){
  58. result.append(ErrorConstants.CUSTOMER_NO_EMPTY);
  59. }
  60. if(StringUtils.isBlank(registNo)){
  61. result.append(ErrorConstants.REGIST_NO_EMPTY);
  62. }
  63. if(StringUtils.isBlank(smallZone)){
  64. result.append(ErrorConstants.SMALL_ZONE_EMPTY);
  65. }
  66. if(StringUtils.isBlank(addr)){
  67. result.append(ErrorConstants.ADDRESS_EMPTY);
  68. }
  69. if(StringUtils.isBlank(imei)){
  70. result.append(ErrorConstants.IMEI_EMPTY);
  71. }
  72. if(result.length()>0){
  73. return result.toString();
  74. }
  75. return null;
  76. }
  77. @Override
  78. public String toString() {
  79. return "RegistData [customerNo=" + customerNo + ", meterType=" + meterType+", registNo=" + registNo + ", smallZone=" + smallZone
  80. + ", addr=" + addr + ", location=" + location + ", imei=" + imei + ", apiKey=" + apiKey + "]";
  81. }
  82. }