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

/**
 * @ClassName: ShortCircuitImpedanceLoadLoss
 * @FullClassPath: com.huatek.busi.vo.routinetest.transformer.
 *                 ShortCircuitImpedanceLoadLoss
 * @Description: 短路阻抗和负载损耗量（t=75℃）例行
 * @author: Arno
 * @date: Aug 27, 2019 1:25:08 PM
 * @version: 1.0
 */

@Data
@EqualsAndHashCode(callSuper = false)
public class ShortCircuitImpedanceLoadLoss extends TestBase implements Serializable {

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

	/** @Fields items : */
	public List<TestItem> items;

	@Data
	class TestItem implements Serializable {

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

		/** @Fields capacity :负载损耗（kW） -- 容量MVA */
		@JSONField(ordinal = 1)
		public String capacity;

		/** @Fields ratedTapping :负载损耗（kW） -- 额定分接 */
		@JSONField(ordinal = 2)
		public String ratedTapping;

		/** @Fields positiveTapping : 负载损耗（kW） --最正分接 */
		@JSONField(ordinal = 3)
		public String positiveTapping;

		/** @Fields rated : 额定分接 ---额定 */
		@JSONField(ordinal = 4)
		public String rated;

		/** @Fields a :额定分接 ---5A */
		@JSONField(ordinal = 5)
		public String a;

		/** @Fields NegativeTapping :最负分接 */
		@JSONField(ordinal = 6)
		public String negativeTapping;
	}

	public static void main(String[] args) {
		ShortCircuitImpedanceLoadLoss entity = new ShortCircuitImpedanceLoadLoss();
		entity.setTestContent("短路阻抗和负载损耗量（t=75℃）例行");
		entity.setTestEquipment("");
		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();
		item1.setA("13.24");
		item1.setCapacity("360");
		item1.setNegativeTapping("23.23");
		item1.setPositiveTapping("14.55");
		item1.setRated("14.23");
		item1.setRatedTapping("867.82");

		
		
		TestItem item2 = entity.new TestItem();
		item2.setA("16.24");
		item2.setCapacity("360");
		item2.setNegativeTapping("26.23");
		item2.setPositiveTapping("17.55");
		item2.setRated("18.23");
		item2.setRatedTapping("877.82");

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

		entity.setItems(items);

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

}
