/**
 * 
 */
package com.huatek.busi.vo.routinetest.transformer;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
  * @ClassName: LowVoltageNoLoad
  * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.LowVoltageNoLoad
  * @Description: 低电压下空载测量
  * @author: Arno
  * @date: Aug 26, 2019 4:52:42 PM
  * @version: 1.0
  */
@Data
@EqualsAndHashCode(callSuper = false)
public class LowVoltageNoLoad extends TestBase implements Serializable {

	/** @Fields serialVersionUID : */ 
	private static final long serialVersionUID = 8354820501538251227L;
	
	/** @Fields temperature : 温度 */ 
	public String temperature;
	
	/** @Fields humidity :湿度   */ 
	public String humidity;
	
	/** @Fields pressure : 气压*/ 
	public String pressure;
	
	
	List<TestItem> items ;
	
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem implements Serializable{

		/** @Fields serialVersionUID : */ 
		private static final long serialVersionUID = -5490511917562261486L;

		/** @Fields voltage : 施加电压（kV）*/ 
		@JSONField(ordinal= 1)
		public String voltage ;
		
		/** @Fields electricCurrent : 测量电流（A）*/ 
		@JSONField(ordinal= 2)
		public String electricCurrent ;
		
		/** @Fields noloadLoss : 空载损耗（W）*/ 
		@JSONField(ordinal= 3)
		public String noloadLoss ;
		
	}

	
	public static void main(String[] args) {
		LowVoltageNoLoad entity = new LowVoltageNoLoad();
		entity.setTestContent("低电压下空载测量");
		entity.setTestEquipment("");
		entity.setChecker("王科");
		entity.setTester("刘天天");
		entity.setSignature("林冲");
		entity.setTestTime(LocalDateTime.of(2018, 5, 26, 10, 13, 29));
		entity.setRemarks("");
		entity.setTemperature("20");
		entity.setHumidity("25");
		entity.setPressure("30");

		List<TestItem> items = new ArrayList<>();
		
		TestItem item1 = entity.new TestItem("1.88","0.54","68.6");
		TestItem item2 = entity.new TestItem("3.82","1.16","23.9");

		items.add(item1);
		items.add(item2);

	
		entity.setItems(items);
		
		String josn = JSONObject.toJSONString(entity);
		System.out.println(josn);
		LowVoltageNoLoad parseObject = JSONObject.parseObject(josn, LowVoltageNoLoad.class);
		System.out.println(parseObject);
	}
	
}
