/**
 * 
 */
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: WindingInsulationResistanceAndCapacitanceDielectricLoss
 * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.
 *                 WindingInsulationResistanceAndCapacitanceDielectricLoss
 * @Description: 绕组对地绝缘电阻和绝缘系统电容和介质损耗测量
 * @author: Arno
 * @date: Aug 27, 2019 10:39:29 AM
 * @version: 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class WindingInsulationResistanceAndCapacitanceDielectricLoss extends TestBase implements Serializable {
	/** @Fields serialVersionUID : */
	private static final long serialVersionUID = 2045105568651368076L;

	/** @Fields oilTemperature : 温度 */
	public String oilTemperature;

	/** @Fields humidity :湿度 */
	public String humidity;

	/** @Fields items : 测定部位--高压-低压及地 低压-高压及地 高压，低压-地 */
	public List<TestItem1> items;

	/** @Fields item2 : 测定部位 --- 高压-低压 */
	public TestItem2 item2;

	/** @Fields item3 :其他 */
	public TestItem3 item3;

	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem1 implements Serializable {

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

		/**
		 * @Fields item :
		 * 					R15"MΩ		--- r15
		 * 					R60"MΩ		--- r60		
		 * 					R600"MΩ		--- r600 
		 * 					吸收比 		--- xsb
		 * 					极化指数		--- jhzs 
		 * 					施加电压（KV）	--- dy 
		 * 					Cx（nF）		--- cx
		 *         			tang（%）	--- tang
		 * 
		 *       
		 */
		@JSONField(ordinal= 1)
		public String item ;
		
		/** @Fields highVoltage_lVoltageAndGround : 高压-低压及地*/
		@JSONField(ordinal= 2)
		public String hVoltage_lVoltageAndGround;

		/** @Fields lowVoltage_hVoltageAndGround : 低压-高压及地 */
		@JSONField(ordinal= 3)
		public String lowVoltage_hVoltageAndGround;

		/** @Fields hVoltageAndlVoltage_Ground :高压，低压-地 */
		@JSONField(ordinal= 4)
		public String hVoltageOrlVoltage_Ground;

		/** @Fields equipment :试验设备 */
		@JSONField(ordinal= 5)
		public String equipment;

	}
	
	

	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem2 implements Serializable {

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

		/** @Fields voltage : 施加电压（KV） */
		@JSONField(ordinal= 1)
		public String voltage;

		/** @Fields cx : Cx（nF） */
		@JSONField(ordinal= 2)
		public String cx;

		/** @Fields tan : tang（%） */
		@JSONField(ordinal= 3)
		public String tang;

		/** @Fields equipment :试验设备 */
		@JSONField(ordinal= 4)
		public String equipment;

	}

	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	class TestItem3 implements Serializable {

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

		/** @Fields ironCore :铁芯-地 */
		@JSONField(ordinal= 1)
		public String ironCore;

		/** @Fields clip :夹件—地 */
		@JSONField(ordinal= 2)
		public String clip;

	}
	
	
	public static void main(String[] args) {
		WindingInsulationResistanceAndCapacitanceDielectricLoss entity = new WindingInsulationResistanceAndCapacitanceDielectricLoss();
		entity.setTestContent("绕组对地绝缘电阻和绝缘系统电容和介质损耗测量");
		entity.setTestEquipment("");
		entity.setOilTemperature("30.0℃");
		entity.setHumidity("40%");
		entity.setChecker("王科");
		entity.setTester("刘天天");
		entity.setSignature("林冲");
		entity.setTestTime(LocalDateTime.of(2018, 5, 25, 10, 13, 29));
		entity.setRemarks("合格");
		
		List<TestItem1> items = new ArrayList<>();
		TestItem1 item1 = entity.new TestItem1("r15","6700","6100","6300","兆欧表型号：XD2905，电压：5000V");
		TestItem1 item2 = entity.new TestItem1("r60","8950","8200","8400","兆欧表型号：XD2905，电压：5000V");
		TestItem1 item3 = entity.new TestItem1("r600","15000","13100","14300","兆欧表型号：XD2905，电压：5000V");
		TestItem1 item4 = entity.new TestItem1("xsb","1.34","1.34","1.33","兆欧表型号：XD2905，电压：5000V");
		TestItem1 item5 = entity.new TestItem1("jhzs","1.68","1.6","1.7","电桥型号：AI-6000A，接线方式：反接");
		TestItem1 item6 = entity.new TestItem1("dy","10","10","10","电桥型号：AI-6000A，接线方式：反接");
		TestItem1 item7 = entity.new TestItem1("cx","15.57","32.53","3.09","电桥型号：AI-6000A，接线方式：反接");
		TestItem1 item8= entity.new TestItem1("tang","0.237","0.2","0.222","电桥型号：AI-6000A，接线方式：反接");
		items.add(item1);
		items.add(item2);
		items.add(item3);
		items.add(item4);
		items.add(item5);	
		items.add(item6);
		items.add(item7);
		items.add(item8);
		entity.setItems(items);
		
		TestItem2 item21 = entity.new TestItem2 ("10","7.503","0.208","电桥型号：AI-6000A，接线方式：正接");
		TestItem3 item31 = entity.new TestItem3 ("用2500V摇表R60‘=2300MΩ","用2500V摇表R60=2000MΩ");
		
		entity.setItem2(item21);
		entity.setItem3(item31);
		
		String josn = JSONObject.toJSONString(entity);
		System.out.println(josn);
		WindingInsulationResistanceAndCapacitanceDielectricLoss parseObject = JSONObject.parseObject(josn, WindingInsulationResistanceAndCapacitanceDielectricLoss.class);
		System.out.println(parseObject.getItem3().getClip());
	}

}
