/**
 * 
 */
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: ExcitationCharacteristict
  * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.ExcitationCharacteristict
  * @Description: 励磁特性测量
  * @author: Arno
  * @date: Aug 26, 2019 4:52:42 PM
  * @version: 1.0
  */
@Data
@EqualsAndHashCode(callSuper = false)
public class ExcitationCharacteristict extends TestBase implements Serializable {

	/** @Fields serialVersionUID : */ 
	private static final long serialVersionUID = 1048764814006777150L;
	
	List<TestItem> items ;
	
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem implements Serializable{

		/** @Fields serialVersionUID : */ 
		private static final long serialVersionUID = 8150155253523751212L;
		
		/** @Fields voltage : 施加电压（kV）*/ 
		@JSONField(ordinal= 1)
		public String voltage ;
		
		/** @Fields electricCurrent : 测量电流（A）*/ 
		@JSONField(ordinal= 2)
		public String electricCurrent ;
		
	}

	
	public static void main(String[] args) {
		ExcitationCharacteristict entity = new ExcitationCharacteristict();
		entity.setTestContent("励磁特性测量");
		entity.setTestEquipment("");
		entity.setChecker("王科");
		entity.setTester("刘天天");
		entity.setSignature("林冲");
		entity.setTestTime(LocalDateTime.of(2018, 5, 26, 10, 13, 29));
		entity.setRemarks("方均根值电压表与平均值电压表读数之差在3%以内");

		List<TestItem> items = new ArrayList<>();
		
		TestItem item1 = entity.new TestItem("1.88","0.54");
		TestItem item2 = entity.new TestItem("3.82","1.16");
		TestItem item3 = entity.new TestItem("5.59","1.75");
		TestItem item4 = entity.new TestItem("7.35","2.4");
		TestItem item5 = entity.new TestItem("9.03","3.01");
		TestItem item6 = entity.new TestItem("10.81","3.66");
		TestItem item7 = entity.new TestItem("12.61","4.81");
		
		TestItem item8 = entity.new TestItem("14.41","5.12");
		TestItem item9 = entity.new TestItem("16.22","5.14");
		
		TestItem item10 = entity.new TestItem("18","5.14");
		TestItem item11 = entity.new TestItem("18.92","5.52");
		TestItem item12 = entity.new TestItem("19.86","9.42");
		TestItem item13 = entity.new TestItem("20.77","25.44");
		
		items.add(item1);
		items.add(item2);
		items.add(item3);
		items.add(item4);
		items.add(item5);
		items.add(item6);
		items.add(item7);
		items.add(item8);
		items.add(item9);
		items.add(item10);
		items.add(item11);
		items.add(item12);
		items.add(item13);
		entity.setItems(items);
		
		String josn = JSONObject.toJSONString(entity);
		System.out.println(josn);
		ExcitationCharacteristict parseObject = JSONObject.parseObject(josn, ExcitationCharacteristict.class);
		System.out.println(parseObject);
	}
	
}
