package com.ruoyi.demo.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.ruoyi.demo.entity.Statistics;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class ScanListVo {
    private String goodsId;
    private String goodsName;
    private String equipmentId;
    private String equipmentName;
    private String equipmentCode;
    private String addrInfo;
    private String userId;
    private String userName;
    private String userTelephone;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime time;

    public ScanListVo(){}
    public ScanListVo(Statistics statistics){
        this.goodsId = statistics.getGoodsId();
        this.goodsName = statistics.getGoodsName();
        this.equipmentId = statistics.getEquipmentId();
        this.equipmentName = statistics.getEquipmentName();
        this.equipmentCode = statistics.getEquipmentCode();
        this.addrInfo = statistics.getAddrInfo();
        this.userId = statistics.getUserId();
        this.userName = statistics.getUserName();
        this.userTelephone = statistics.getUserTelephone();
        this.time = statistics.getTime();
    }
}
