/**
 * 
 */
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 lombok.Data;
import lombok.EqualsAndHashCode;

/**
  * @ClassName: WindingBushLossTangent
  * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.WindingBushLossTangent
  * @Description: 测量绕组连同套管的介质损耗角正切值
  * @author: Arno
  * @date: Aug 22, 2019 7:50:13 PM
  * @version: 1.0
  */
@Data
@EqualsAndHashCode(callSuper = false)
public class WindingBushLossTangent extends TestBase implements Serializable{
	
	/** @Fields serialVersionUID : */ 
	private static final long serialVersionUID = 2392570516844258571L;
	
	public List<TestItem> items;
	
	
	@Data
	class TestItem  implements Serializable{

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

		/** @Fields item : 试验项目*/
		private String item;
		
		/** @Fields voltage : 试验电压（kV）*/ 
		private String voltage ="--" ;
		
		/** @Fields capacitance : 电容量（nF）*/ 
		private String capacitance = "--" ;
		
		/** @Fields tangent : tgδ（%）*/ 
		private String tangent  = "--";
	}

	public static void main(String[] args) {
		
		WindingBushLossTangent bush = new WindingBushLossTangent  ();	
		bush.setTestContent("测量绕组连同套管的介质损耗角正切值");
		bush.setTestEquipment("AI-6000E型介质损耗测量仪，No。C60532");
		bush.setChecker("王科");
		bush.setTester("刘天天");
		bush.setSignature("林冲");
		bush.setRemarks("合格");
		bush.setTestTime(LocalDateTime.of(2018,11,13,12,24,56));
		
		TestItem item1 = bush.new TestItem(); 
		item1.setItem(TestContant.WindingBushLossTangentEnum.HV_LV_E.getName());
		
		item1.setVoltage("10");
		item1.setCapacitance("15.7");
		item1.setTangent("0.203");
		
		
		TestItem item2 = bush.new TestItem(); 
		item2.setItem(TestContant.WindingBushLossTangentEnum.LV_HV_E.getName());
		item2.setVoltage("10");
		item2.setCapacitance("438.7");
		item2.setTangent("0.028");
		
		List<TestItem> list = new ArrayList<>();
		list.add(item1);
		list.add(item2);
		bush.setItems(list);
		
		String jsonString = JSONObject.toJSONString(bush);
		System.out.println(jsonString);
		//BushingTest parseObject = JSON.parseObject(jsonString, new TypeReference<BushingTest>(){});
		WindingBushLossTangent parseObject = JSONObject.parseObject(jsonString,WindingBushLossTangent.class);
		System.out.println(parseObject);
	}
}
