admin
2022-04-09 ce3420676d9ccf4a2bdf87aeb7ad1494b5e5d26c
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
package com.yeshi.makemoney.app.vo.admin.goldcorn;
 
import com.yeshi.makemoney.app.entity.SystemEnum;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetPrice;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType;
import org.yeshi.utils.TimeUtil;
 
import java.math.BigDecimal;
import java.util.Date;
 
/**
 * @author hxh
 * @title: GoldCornGetPriceAdminVO
 * @description: TODO
 * @date 2022/4/2 17:42
 */
public class GoldCornGetPriceAdminVO {
 
    private String id;
    private GoldCornGetType type;
    private Integer cornNum;
    private String validateTime;
    private BigDecimal teamGainRate;
    private String remarks;
    private String teamDivide;
 
    public GoldCornGetPrice toEntity(SystemEnum system) {
        GoldCornGetPrice entity = new GoldCornGetPrice();
        entity.setCornNum(cornNum);
        entity.setId(id);
        entity.setRemarks(remarks);
        entity.setTeamGainRate(teamGainRate);
        entity.setTeamDivide("on".equalsIgnoreCase(teamDivide) ? true : false);
        entity.setSystem(system);
        entity.setType(type);
        entity.setValidateTime(new Date(TimeUtil.convertToTimeTemp(validateTime, "yyyy-MM-dd HH:mm:ss")));
        return entity;
    }
 
 
    public static GoldCornGetPriceAdminVO create(GoldCornGetPrice entity) {
        GoldCornGetPriceAdminVO vo = new GoldCornGetPriceAdminVO();
        vo.setCornNum(entity.getCornNum());
        vo.setId(entity.getId());
        vo.setRemarks(entity.getRemarks());
        vo.setType(entity.getType());
        vo.setTeamDivide(entity.getTeamDivide() ? "on" : null);
        vo.setTeamGainRate(entity.getTeamGainRate());
        vo.setValidateTime(TimeUtil.getGernalTime(entity.getValidateTime().getTime(), "yyyy-MM-dd HH:mm:ss"));
        return vo;
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public GoldCornGetType getType() {
        return type;
    }
 
    public void setType(GoldCornGetType type) {
        this.type = type;
    }
 
    public Integer getCornNum() {
        return cornNum;
    }
 
    public void setCornNum(Integer cornNum) {
        this.cornNum = cornNum;
    }
 
    public String getValidateTime() {
        return validateTime;
    }
 
    public void setValidateTime(String validateTime) {
        this.validateTime = validateTime;
    }
 
    public String getRemarks() {
        return remarks;
    }
 
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
 
    public BigDecimal getTeamGainRate() {
        return teamGainRate;
    }
 
    public void setTeamGainRate(BigDecimal teamGainRate) {
        this.teamGainRate = teamGainRate;
    }
 
    public String getTeamDivide() {
        return teamDivide;
    }
 
    public void setTeamDivide(String teamDivide) {
        this.teamDivide = teamDivide;
    }
}