admin
2022-04-02 87532065ba0c304817c31628ebb1000f4e308f12
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
package com.yeshi.makemoney.app.vo.admin.goldcorn;
 
import com.yeshi.makemoney.app.entity.SystemEnum;
import com.yeshi.makemoney.app.entity.goldcorn.GoldCornMoneyExchangeRateRecord;
import org.yeshi.utils.TimeUtil;
 
import java.math.BigDecimal;
import java.util.Date;
 
/**
 * @author hxh
 * @title: GoldCornMoneyExchangeRateAdminVO
 * @description:
 * @date 2022/4/2 16:42
 */
public class GoldCornMoneyExchangeRateAdminVO {
 
    private String id;
    private String day;
    private BigDecimal rate;
    private String validateTime;
 
    public GoldCornMoneyExchangeRateRecord toEntity(SystemEnum system) {
        GoldCornMoneyExchangeRateRecord record = new GoldCornMoneyExchangeRateRecord();
        record.setId(id);
        record.setValidateTime(new Date(TimeUtil.convertToTimeTemp(validateTime, "yyyy-MM-dd HH:mm:ss")));
        record.setSystem(system);
        record.setRate(rate);
        record.setDay(day);
        return record;
    }
 
    public static GoldCornMoneyExchangeRateAdminVO create(GoldCornMoneyExchangeRateRecord record) {
        GoldCornMoneyExchangeRateAdminVO vo = new GoldCornMoneyExchangeRateAdminVO();
        vo.setId(record.getId());
        vo.setValidateTime(TimeUtil.getGernalTime(record.getValidateTime().getTime(), "yyyy-MM-dd HH:mm:ss"));
        vo.setRate(record.getRate());
        vo.setDay(record.getDay());
        return vo;
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getDay() {
        return day;
    }
 
    public void setDay(String day) {
        this.day = day;
    }
 
    public BigDecimal getRate() {
        return rate;
    }
 
    public void setRate(BigDecimal rate) {
        this.rate = rate;
    }
 
    public String getValidateTime() {
        return validateTime;
    }
 
    public void setValidateTime(String validateTime) {
        this.validateTime = validateTime;
    }
}