| package com.dy.pipIrrProject.mqtt.soil; | 
|   | 
| import com.dy.pipIrrGlobal.pojoPr.PrStSoil; | 
| import io.swagger.v3.oas.annotations.media.Schema; | 
| import jakarta.validation.constraints.NotEmpty; | 
| import jakarta.validation.constraints.NotNull; | 
| import lombok.Data; | 
|   | 
| /** | 
|  * @Author: liurunyu | 
|  * @Date: 2025/6/18 14:52 | 
|  * @Description | 
|  */ | 
| @Data | 
| @Schema(name = "墒情站") | 
| public class SoilDto { | 
|     public static final long serialVersionUID = 202506191032001L; | 
|     /** | 
|      * 主键 | 
|      */ | 
|     public String id; | 
|   | 
|     /** | 
|      * 墒情站FBox序列号 | 
|      */ | 
|     @NotEmpty(message = "墒情站FBox序列号") //不能为空也不能为null | 
|     public String fboxId; | 
|   | 
|     /** | 
|      * 墒情站名称 | 
|      */ | 
|     @NotEmpty(message = "墒情站名称不能为空") //不能为空也不能为null | 
|     public String name; | 
|     /** | 
|      * 墒情站编号 | 
|      */ | 
|     @NotNull(message = "墒情站编号不能为空") //不能为空也不能为null | 
|     public Integer no; | 
|   | 
|   | 
|     /** | 
|      * 经度 | 
|      */ | 
|     public Double lng; | 
|   | 
|     /** | 
|      * 纬度 | 
|      */ | 
|     public Double lat; | 
|   | 
|     /** | 
|      * 备注 | 
|      */ | 
|     public String remark; | 
|   | 
|     public PrStSoil toNewPo(){ | 
|         PrStSoil po = new PrStSoil(); | 
|         po.fboxId = this.fboxId; | 
|         po.name = this.name; | 
|         po.no = this.no; | 
|         po.lng = this.lng; | 
|         po.lat = this.lat; | 
|         po.remark = this.remark; | 
|         return po; | 
|     } | 
|     public PrStSoil toPo(){ | 
|         PrStSoil po = this.toNewPo(); | 
|         po.id = Long.parseLong(this.id) ; | 
|         return po; | 
|     } | 
| } |