package com.zcxk.process.dto;

import com.alibaba.fastjson.JSON;
import lombok.Data;

/**
 * 工作流条件实体类
 *
 * @author wilian.peng
 * @Description
 * @date 2019年3月26日 下午3:08:58
 */
@Data
public class ConditionObject {
    private Integer[] buildingIds;
    private String alarmTimeRange;
    private Integer[] deviceTypeIds;
    private String[] alarmCategorys;
    private Integer[] alarmLevelIds;
    private Integer[] alarmTypeIds;
    private String preHandleResult;

    public static void main(String[] args) {
        ConditionObject obj = new ConditionObject();
        obj.setAlarmCategorys(new String[]{"1"});
        obj.setAlarmLevelIds(new Integer[]{1, 2, 3});
        obj.setAlarmTimeRange("21:00-06:00");
        obj.setAlarmTypeIds(new Integer[]{100, 101});
        obj.setBuildingIds(new Integer[]{20, 21});
        obj.setDeviceTypeIds(new Integer[]{101, 102});
        obj.setPreHandleResult("1");
        String conditionJSONStr = "{\"alarmCategorys\":[\"1\"],\"alarmLevelIds\":[1,2,3],\"alarmTimeRange\":\"21:00-06:00\",\"alarmTypeIds\":[100,101],\"buildingIds\":[20,21],\"deviceTypeIds\":[101,102],\"preHandleResult\":\"1\"}";
        System.out.println(JSON.toJSONString(obj));
        System.out.println(conditionJSONStr);
        String conditionJSONStr1 = "{\"alarmCategorys\":[\"1\"],\"alarmLevelIds\":[1,2,3],\"alarmTimeRange\":\"21:00-06:00\",\"alarmTypeIds\":[100,101],\"buildingIds\":[20,21],\"deviceTypeIds\":[101,102]}";

        System.out.println(JSON.toJSONString(JSON.parseObject(conditionJSONStr1, ConditionObject.class)));
    }
}