12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package com.huaxu.zoniot.dto;
- import com.huaxu.zoniot.common.ErrorConstants;
- import io.swagger.annotations.ApiModel;
- import io.swagger.annotations.ApiModelProperty;
- import lombok.Data;
- import org.apache.commons.lang3.StringUtils;
- import java.io.Serializable;
- /**
- * <p>设备注册请求</p>
- *
- * @Author wilian.peng
- * @Date 2021/1/8 14:27
- * @Version 1.0
- */
- @Data
- @ApiModel("设备注册请求")
- public class RegistIMEIRequest implements Serializable {
- /**
- * 用户编码 --> 水表用户编码
- */
- @ApiModelProperty("用户编码")
- String customerNo ;
- /**
- * 水表注册号 --> 水表电子号
- */
- @ApiModelProperty("水表电子号")
- String registNo ;
- /**
- * 小区名称-->小区名称
- */
- @ApiModelProperty("小区名称")
- String smallZone ;
- /**
- *详细地址 --> 详细地址
- */
- @ApiModelProperty("详细地址")
- String addr ;
- /**
- * 安装位置-->水表安装位置
- */
- @ApiModelProperty("安装位置")
- String location ;
- /**
- * IMEI号 --> 设备IMEI号,设备编号
- */
- @ApiModelProperty("IMEI号")
- String imei ;
- @ApiModelProperty("水表类型,1:Lora,2:NB(天津协议),3:NB(188协议)")
- Integer meterType;
- /**
- * 验证值 --> 验证值
- */
- @ApiModelProperty("apiKey")
- String apiKey;
- public String check(){
- StringBuffer result=new StringBuffer();
- if(StringUtils.isBlank(customerNo)){
- result.append(ErrorConstants.CUSTOMER_NO_EMPTY);
- }
- if(StringUtils.isBlank(registNo)){
- result.append(ErrorConstants.REGIST_NO_EMPTY);
- }
- if(StringUtils.isBlank(smallZone)){
- result.append(ErrorConstants.SMALL_ZONE_EMPTY);
- }
- if(StringUtils.isBlank(addr)){
- result.append(ErrorConstants.ADDRESS_EMPTY);
- }
- if(StringUtils.isBlank(imei)){
- result.append(ErrorConstants.IMEI_EMPTY);
- }
- if(result.length()>0){
- return result.toString();
- }
- return null;
- }
- @Override
- public String toString() {
- return "RegistData [customerNo=" + customerNo + ", meterType=" + meterType+", registNo=" + registNo + ", smallZone=" + smallZone
- + ", addr=" + addr + ", location=" + location + ", imei=" + imei + ", apiKey=" + apiKey + "]";
- }
- }
|