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: BushingCapacitanceMediumLoss
  * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.BushingCapacitanceMediumLoss
  * @Description: 套管电容和介质损耗测量
  * @author: Arno
  * @date: Aug 23, 2019 5:44:26 PM
  * @version: 1.0
  */

@Data
@EqualsAndHashCode(callSuper = false)
public class BushingCapacitanceMediumLoss extends TestBase implements Serializable {
	
	
	/** @Fields serialVersionUID : */ 
	private static final long serialVersionUID = -6288491698399864620L;

	
	/** @Fields oilTemperature : 温度 */ 
	public String oilTemperature;
	
	/** @Fields humidity :湿度   */ 
	public String humidity;
	
	/** @Fields bridgeType : 电桥型号*/ 
	public String bridgeType;
	
	public List<TestItem> items ;
	
	
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem  implements Serializable {
		
		/** @Fields serialVersionUID : */ 
		private static final long serialVersionUID = 168474687325651544L;

		/** @Fields phase : 相序*/ 
		@JSONField(ordinal= 1)
		public String phase ;
		
		/** @Fields model : 型号*/ 
		@JSONField(ordinal= 2)
		public String model ;
		
		/** @Fields code : 编号*/ 
		@JSONField(ordinal= 3)
		public String code ;
		
		/** @Fields voltage :实验电压（kV） */ 
		@JSONField(ordinal= 4)
		public String voltage ;
		
		/** @Fields cn : CN（pF）*/ 
		@JSONField(ordinal= 5)
		public String cn ;
		
		/** @Fields tano : tano（%）*/
		@JSONField(ordinal= 6)
		public String tano ;
		
		/** @Fields cx : Cx（pF）*/ 
		@JSONField(ordinal= 7)
		public String cx ;
	}
	
	public static void main(String[] args) {
		BushingCapacitanceMediumLoss entity = new BushingCapacitanceMediumLoss();
		entity.setTestContent("套管电容和介质损耗测量");
		entity.setTestEquipment("欣影电力-XPOI112");
		entity.setOilTemperature("30.0℃");
		entity.setHumidity("40%");
		entity.setBridgeType("AI-6000A");
		entity.setChecker("王科");
		entity.setTester("刘天天");
		entity.setSignature("林冲");
		entity.setTestTime(LocalDateTime.of(2018, 5, 25, 10, 13, 29));
		entity.setRemarks("合格");
		
		List<TestItem> items = new ArrayList<>();
		TestItem item1 = entity.new TestItem("A","KTKG550-1800/2000","1ZSCD102345","10","234","0.291","285.9");
		TestItem item2 = entity.new TestItem("B","KTKG550-1800/2001","1ZSCD102346","10","323","0.231","285.2");
		TestItem item3 = entity.new TestItem("C","KTKG550-1800/2002","1ZSCD102347","10","232","0.321","293.5");
		TestItem item4 = entity.new TestItem("O","GOB250/1250-0.5","1ZSCD14568/02","10","242","0235","324.5");
		TestItem item5 = entity.new TestItem("a","GOH170/16","1ZSCD14568/03","10","522","0.285","289.9");
		TestItem item6 = entity.new TestItem("b","GOH170/17","1ZSCD14568/04","10","544","0.355","243.6");
		TestItem item7 = entity.new TestItem("c","GOH170/18","1ZSCD14568/06","10","513","0.243","516.5");
		items.add(item1);
		items.add(item2);
		items.add(item3);
		items.add(item4);
		items.add(item5);	
		items.add(item6);
		items.add(item7);
		entity.setItems(items);
		
		String josn = JSONObject.toJSONString(entity);
		System.out.println(josn);
		BushingCapacitanceMediumLoss parseObject = JSONObject.parseObject(josn, BushingCapacitanceMediumLoss.class);
		System.out.println(parseObject);
	}

}
