liurunyu
3 天以前 b042d6a5ae1959ad79b489e1d0b01c057b68d5f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.dy.pipIrrProject.mqtt.manure;
 
import com.dy.pipIrrGlobal.pojoPr.PrStManure;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
 
/**
 * @Author: liurunyu
 * @Date: 2025/6/18 14:52
 * @Description
 */
@Data
@Schema(name = "水肥机")
public class ManureDto {
    public static final long serialVersionUID = 202506091032001L;
    /**
     * 主键
     */
    public String id;
 
    /**
     * 水肥机名称
     */
    @NotEmpty(message = "水肥机名称不能为空") //不能为空也不能为null
    public String name;
    /**
     * 水肥机编号
     */
    @NotEmpty(message = "水肥机编号不能为空") //不能为空也不能为null
    public Integer no;
 
 
    /**
     * 经度
     */
    public Double lng;
 
    /**
     * 纬度
     */
    public Double lat;
 
    /**
     * 备注
     */
    public String remark;
 
    public PrStManure toNewPo(){
        PrStManure po = new PrStManure();
        po.name = this.name;
        po.no = this.no;
        po.lng = this.lng;
        po.lat = this.lat;
        po.remark = this.remark;
        return po;
    }
    public PrStManure toPo(){
        PrStManure po = this.toNewPo();
        po.id = Long.parseLong(this.id) ;
        return po;
    }
}