package com.huatek.busi.service.impl.report;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.huatek.busi.service.cable.BusiOfflineCableRepairService;
import org.springframework.beans.factory.annotation.Autowired;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.huatek.busi.common.BusiConstant.WarningType;
import com.huatek.busi.common.ReportType;
import com.huatek.busi.common.SiteConstants.ArresterTreeEnum;
import com.huatek.busi.common.SiteConstants.GisTreeEnum;
import com.huatek.busi.common.SiteConstants.SiteTreeEnum;
import com.huatek.busi.common.SiteConstants.TransfromerTreeEnum;
import com.huatek.busi.common.SiteConstants.CableTreeEnum;
import com.huatek.busi.common.util.DecimalUtil;
import com.huatek.busi.dto.EquipmentInfoDto;
import com.huatek.busi.service.BusiEqmWarningService;
import com.huatek.busi.service.BusiSensorService;
import com.huatek.busi.service.BusiSubTreeService;
import com.huatek.busi.service.FailureRateService;
import com.huatek.busi.service.arrester.ArresterReadTableService;
import com.huatek.busi.service.arrester.BusiOfflineArresterRepairService;
import com.huatek.busi.service.gis.BusiOfflineGisRepairService;
import com.huatek.busi.service.gis.GisReadTableService;
import com.huatek.busi.service.impl.report.helper.ReportImpl;
import com.huatek.busi.service.report.BusiCommonReportService;
import com.huatek.busi.service.transformer.BusiOfflineTransformerRepairService;
import com.huatek.busi.service.transformer.TransformerInfraredTemperatureService;
import com.huatek.busi.service.transformer.TransformerReadTableService;
import com.huatek.busi.util.CalcUtil;

@ReportImpl(value = "busiPZReportService", exportTypes = {
    ReportType.BYQ_PZ_MONTHLY_REPORT,
    ReportType.GIS_PZ_MONTHLY_REPORT,
    ReportType.BLQ_PZ_MONTHLY_REPORT,
    ReportType.OTHER_PZ_MONTHLY_REPORT,
    ReportType.BYQ_HWRCX_MONTHLY_REPORT,
    ReportType.GIS_HWRCX_MONTHLY_REPORT,
    ReportType.BLQ_HWRCX_MONTHLY_REPORT,
    ReportType.OTHER_HWRCX_MONTHLY_REPORT,
    ReportType.DL_HWRCX_MONTHLY_REPORT,
})
public class BusiPZReportServiceImpl implements BusiCommonReportService {
    @Autowired
    private BusiSubTreeService busiSubTreeService;
    @Autowired
    private BusiEqmWarningService busiEqmWarningService;
    @Autowired
    private FailureRateService failureRateService;
    @Autowired
    private BusiSensorService busiSensorService;
    @Autowired
    private BusiOfflineGisRepairService busiOfflineGisRepairService;
    @Autowired
    private BusiOfflineTransformerRepairService busiOfflineTransformerRepairService;
    @Autowired
    private BusiOfflineArresterRepairService busiOfflineArresterRepairService;
    @Autowired
    private BusiOfflineCableRepairService busiOfflineCableRepairService;
    @Autowired
    private TransformerInfraredTemperatureService transformerInfraredTemperatureService;
    @Autowired
    private ArresterReadTableService arresterReadTableService;
    @Autowired
    private GisReadTableService gisReadTableService;
    @Autowired
    private TransformerReadTableService transformerReadTableService;
    
    @Override
    public Map<String, Object> buildExportData(String exportType, List<String> sensors, String exportTime,String startTime, String endTime) {
        if (exportType.equals(ReportType.BYQ_PZ_MONTHLY_REPORT)
            || exportType.equals(ReportType.GIS_PZ_MONTHLY_REPORT)
            || exportType.equals(ReportType.BLQ_PZ_MONTHLY_REPORT)
            || exportType.equals(ReportType.OTHER_PZ_MONTHLY_REPORT)) {
            return this.buildPZExportData(sensors, exportTime, exportType,startTime,endTime);
        } else if (exportType.equals(ReportType.BYQ_HWRCX_MONTHLY_REPORT)
            || exportType.equals(ReportType.GIS_HWRCX_MONTHLY_REPORT)
            || exportType.equals(ReportType.BLQ_HWRCX_MONTHLY_REPORT)
            || exportType.equals(ReportType.OTHER_HWRCX_MONTHLY_REPORT)
            || exportType.equals(ReportType.DL_HWRCX_MONTHLY_REPORT)
        ) {
            return this.buildHWExportData(sensors, exportTime, exportType,startTime,endTime);
        }
        return null;
    }

    private Map<String, Object> buildPZExportData(List<String> sensors, String exportTime, String exportType,String start,String end) {
    	DateTimeFormatter dateTimeFormater = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    	
    	LocalDateTime startTime=null;
    	LocalDateTime endTime = null;
    	
    	if(start != null && !"".equals(start))
    	{
	        startTime = LocalDateTime.parse(start + " 00:00:00", dateTimeFormater);
	        endTime = LocalDateTime.parse(end + " 23:59:59", dateTimeFormater);
    	}
    	else
    	{
    		startTime = LocalDateTime.parse(LocalDate.now()+" 00:00:00",dateTimeFormater);
			endTime = LocalDateTime.parse( LocalDate.now().plusDays(1)+" 00:00:00",dateTimeFormater);
    	}
    	
        EquipmentInfoDto equipmentInfo = new EquipmentInfoDto();
        String sensorCode = sensors.get(0);
        int repairCount = 0;
        int sensorCount = 0;
        String info = "";
        if (exportType.equals(ReportType.BYQ_PZ_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.BYQ.getValue());
            info = "变压器拍照检测装置管理考核";
        } else if (exportType.equals(ReportType.GIS_PZ_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.GIS.getValue());
            sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.GIS.getValue(), GisTreeEnum.SF6_EQM.getValue());
            info = "GIS拍照检测装置管理考核";
        } else if (exportType.equals(ReportType.BLQ_PZ_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.BLQ.getValue());
            info = "避雷器拍照检测装置管理考核";
        } else if (exportType.equals(ReportType.OTHER_PZ_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.OTHER.getValue());
            info = "其他拍照检测装置管理考核";
        }
        Map<String, Object> resultData = Maps.newLinkedHashMapWithExpectedSize(35);
        Map<String, Object> result = Maps.newHashMap();
        if (equipmentInfo != null) {
           
            Map<String, LocalDateTime> mapDate = CalcUtil.getcurrentMonthDateMap();
            String dataMissingRate = failureRateService.getSensorLossRate(sensorCode, mapDate.get("startTime"), mapDate.get("endTime"));
            
            Map<String, Object> param = Maps.newHashMap();
            param.put("mainTreeId", equipmentInfo.getMainTreeId());
            param.put("startTime", mapDate.get("startTime"));
    		param.put("endTime", mapDate.get("endTime"));
            param.put("sensorCode", sensorCode);
            
            if (exportType.equals(ReportType.BYQ_PZ_MONTHLY_REPORT)) {
                repairCount = busiOfflineTransformerRepairService.getTransformerRepairCount(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.BYQ.getValue(), TransfromerTreeEnum.TP_EQM.getValue());
            } else if (exportType.equals(ReportType.GIS_PZ_MONTHLY_REPORT)) {
                repairCount = busiOfflineGisRepairService.getRepairCount(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.GIS.getValue(), GisTreeEnum.TP_EQM.getValue());
            } else if (exportType.equals(ReportType.BLQ_PZ_MONTHLY_REPORT)) {
                repairCount = busiOfflineArresterRepairService.getRepairCountForArrester(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.BLQ.getValue(), ArresterTreeEnum.TP_EQM.getValue());
            } else if (exportType.equals(ReportType.OTHER_PZ_MONTHLY_REPORT)) {
               //
            }
            
            String repareRate = "0";
            if (sensorCount != 0 && repairCount != 0) {
                // 转换成百分比
                DecimalFormat df = new DecimalFormat("0.00");// 设置保留位数
                repareRate =
                    df.format(DecimalUtil.divide(DecimalUtil.getVal(repairCount).multiply(BigDecimal.valueOf(100)),
                        DecimalUtil.getVal(sensorCount), 2));
            }
            Map<String, Object> params = Maps.newHashMap();
            params.put("mainTreeId", equipmentInfo.getMainTreeId());
            params.put("startTime", mapDate.get("startTime"));
    		params.put("endTime", mapDate.get("endTime"));
            params.put("sensorCode", sensorCode);
            BigDecimal totalCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(params));  //报警次数
            params.put("warningType", WarningType.FAULT);
            BigDecimal gzCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(params)); //故障次数

            params.put("warningType", WarningType.MISREPORT);
            BigDecimal wbCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(params));//误报次数

            String falseAlarmRate = "0";
            if (BigDecimal.ZERO.compareTo(totalCount) != 0 && BigDecimal.ZERO.compareTo(wbCount) != 0) {
                // 转换成百分比
                DecimalFormat df = new DecimalFormat("0.00");// 设置保留位数
                falseAlarmRate =
                    df.format(DecimalUtil.divide(wbCount.multiply(BigDecimal.valueOf(100)), totalCount, 2));
            }

            resultData.put("reportCode", "");
            resultData.put("reportDate", LocalDate.now());
            resultData.put("operationDate",
                equipmentInfo.getSubEquipmentUseDate() == null ? "" : equipmentInfo.getSubEquipmentUseDate());
            resultData.put("manufacturer",
                equipmentInfo.getSubEquipmentManufactor() == null ? "" : equipmentInfo.getSubEquipmentManufactor());
            resultData.put("installLocation",
                equipmentInfo.getSensorPositionDes() == null ? "" : equipmentInfo.getSensorPositionDes());
            resultData.put("installNumber", ""); // 安装数量
            resultData.put("overhaulNumber", repairCount);// 检修次数(月)
            resultData.put("overhaulRate",repareRate); //检修率

            resultData.put("dataMissRate", dataMissingRate == null ? "" : dataMissingRate); //缺失率

            List<Map<String, Object>> pdList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> item = Maps.newLinkedHashMapWithExpectedSize(5);

            item.put("totalWarnNumber", totalCount); //报警次数
            item.put("falseAlarmRate", falseAlarmRate);  //误报率
            item.put("gzCount", gzCount);  //故障次数

            pdList1.add(item);
            resultData.put("pzList", pdList1);

            resultData.put("reporter", "");
            resultData.put("signatory", "");
            resultData.put("reportDescription", "");

            List<Map<String, Object>> monthList1 = Lists.newArrayListWithCapacity(10);

            List<Map<String,Object>> voList = new ArrayList<Map<String,Object>>();
            if (exportType.equals(ReportType.BYQ_PZ_MONTHLY_REPORT)) {
            	voList = transformerReadTableService.queryHistory(sensorCode,startTime,endTime);
            } else if (exportType.equals(ReportType.GIS_PZ_MONTHLY_REPORT)) {
            	voList = gisReadTableService.queryHistory(sensorCode,startTime,endTime);
            } else if (exportType.equals(ReportType.BLQ_PZ_MONTHLY_REPORT)) {
            	voList = arresterReadTableService.queryHistory(sensorCode,startTime,endTime);
            } else if (exportType.equals(ReportType.OTHER_PZ_MONTHLY_REPORT)) {
            }
            
            if (!voList.isEmpty()) {
                for (int i = 0; i < voList.size(); i++) {
                    Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);
                    Map<String,Object> map = voList.get(i);
                    if (map != null) {
                    	monthitem.put("val1",  i + 1);
                    	monthitem.put("val2", map.get("dataval"));
                    	
                    	String workState = map.get("workState").toString() ;
                    	if("1".equals(workState))
                    	{
                    		monthitem.put("val3", "发电");
                    	}
                    	if("2".equals(workState))
                    	{
                    		monthitem.put("val3", "抽水");
                    	}
                    	if("3".equals(workState))
                    	{
                    		monthitem.put("val3", "空闲");
                    	}
                    	else 
                    	{
                    		monthitem.put("val3", "");
                    	}
                     	monthitem.put("val4", map.get("timeStamp").toString());
                        monthList1.add(monthitem);
                    }
                }
            } else {
                Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);
                monthitem.put("val1",  "");
            	monthitem.put("val2", "");
              	monthitem.put("val3", "");
            	monthitem.put("val4", "");
                monthList1.add(monthitem);
            }
            resultData.put("pzMonthList", monthList1);
        } else {
            resultData.put("reportCode", "");
            resultData.put("reportDate",  LocalDate.now());
            resultData.put("operationDate", "");
            resultData.put("manufacturer", "");
            resultData.put("installLocation", "");
            resultData.put("installNumber", "");
            resultData.put("overhaulNumber", "");
            resultData.put("overhaulRate", "");
            resultData.put("dataMissRate", "");

            List<Map<String, Object>> pdList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> item = Maps.newLinkedHashMapWithExpectedSize(5);
            item.put("totalWarnNumber", "");
            item.put("falseAlarmRate", "");
            item.put("gzCount", "");
            pdList1.add(item);
            resultData.put("pzList", pdList1);
            resultData.put("reporter", "");
            resultData.put("signatory", "");
            resultData.put("reportDescription", "");

            List<Map<String, Object>> monthList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);

            monthitem.put("val1",  "");
        	monthitem.put("val2", "");
          	monthitem.put("val3", "");
        	monthitem.put("val4", "");
            monthList1.add(monthitem);
            resultData.put("pzMonthList", monthList1);
        }
        result.put("fileName", info);
        result.put("data", resultData);
        return result;
    }

    private Map<String, Object> buildHWExportData(List<String> sensors, String exportTime, String exportType,String start,String end) {
    	DateTimeFormatter dateTimeFormater = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    	LocalDateTime startTime=null;
    	LocalDateTime endTime = null;
    	if(start != null && !"".equals(start))
    	{
	        startTime = LocalDateTime.parse(start + " 00:00:00", dateTimeFormater);
	        endTime = LocalDateTime.parse(end + " 23:59:59", dateTimeFormater);
    	}
    	else
    	{
    		startTime = LocalDateTime.parse(LocalDate.now()+" 00:00:00",dateTimeFormater);
			endTime = LocalDateTime.parse( LocalDate.now().plusDays(1)+" 00:00:00",dateTimeFormater);
    	}
    	
        EquipmentInfoDto equipmentInfo = new EquipmentInfoDto();
        String sensorCode = sensors.get(0);
        String info = "";
        if (exportType.equals(ReportType.BYQ_HWRCX_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.BYQ.getValue());
            info = "变压器红外热成像检测装置管理考核";
        } else if (exportType.equals(ReportType.GIS_HWRCX_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.GIS.getValue());
            info = "GIS红外热成像检测装置管理考核";
        } else if (exportType.equals(ReportType.BLQ_HWRCX_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.BLQ.getValue());
            info = "避雷器红外热成像检测装置管理考核";
        } else if (exportType.equals(ReportType.OTHER_HWRCX_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.OTHER.getValue());
            info = "其他红外热成像检测装置管理考核";
        } else if (exportType.equals(ReportType.DL_HWRCX_MONTHLY_REPORT)) {
            equipmentInfo = busiSubTreeService.findEquipmentInfo(sensorCode, SiteTreeEnum.DL.getValue());
            info = "电缆红外热成像检测装置管理考核";
        }

        Map<String, Object> resultData = Maps.newLinkedHashMapWithExpectedSize(35);
        Map<String, Object> result = Maps.newHashMap();

        if (equipmentInfo != null) {
            Map<String, LocalDateTime> mapDate = CalcUtil.getcurrentMonthDateMap();
            String dataMissingRate =
                failureRateService.getSensorLossRate(sensorCode, mapDate.get("startTime"), mapDate.get("endTime"));
            Map<String, Object> param = Maps.newHashMap();
            param.put("mainTreeId", equipmentInfo.getMainTreeId());
            param.put("startTime", mapDate.get("startTime"));
    		param.put("endTime", mapDate.get("endTime"));
            param.put("sensorCode", sensorCode);
            BigDecimal totalCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(param));
            param.put("warningType", WarningType.FAULT);
            BigDecimal gzCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(param));

            int repairCount = 0;
            int sensorCount = 0;
            if (exportType.equals(ReportType.BYQ_HWRCX_MONTHLY_REPORT)) {
                repairCount = busiOfflineTransformerRepairService.getTransformerRepairCount(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.BYQ.getValue(), TransfromerTreeEnum.HW_EQM.getValue());
            } else if (exportType.equals(ReportType.GIS_HWRCX_MONTHLY_REPORT)) {
                repairCount = busiOfflineGisRepairService.getRepairCount(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.GIS.getValue(), GisTreeEnum.HW_EQM.getValue());
            } else if (exportType.equals(ReportType.BLQ_HWRCX_MONTHLY_REPORT)) {
                repairCount = busiOfflineArresterRepairService.getRepairCountForArrester(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.BLQ.getValue(), ArresterTreeEnum.HW_EQM.getValue());
            } else if (exportType.equals(ReportType.OTHER_HWRCX_MONTHLY_REPORT)) {
               //
            } else if (exportType.equals(ReportType.DL_HWRCX_MONTHLY_REPORT)) {
                repairCount = busiOfflineCableRepairService.getRepairCountForCable(param);
                sensorCount = busiSensorService.findSensorCount(SiteTreeEnum.DL.getValue(), CableTreeEnum.HW_EQM.getValue());
            }
            
            String repareRate = "0";
            if (sensorCount != 0 && repairCount != 0) {
                // 转换成百分比
                DecimalFormat df = new DecimalFormat("0.00");// 设置保留位数
                repareRate =
                    df.format(DecimalUtil.divide(DecimalUtil.getVal(repairCount).multiply(BigDecimal.valueOf(100)),
                        DecimalUtil.getVal(sensorCount), 2));
            }
            param.put("warningType", WarningType.MISREPORT);
            BigDecimal wbCount = DecimalUtil.getVal(busiEqmWarningService.getBusiEqmWarningCount(param));

            String falseAlarmRate = "0";
            if (BigDecimal.ZERO.compareTo(totalCount) != 0 && BigDecimal.ZERO.compareTo(wbCount) != 0) {
                // 转换成百分比
                DecimalFormat df = new DecimalFormat("0.00");// 设置保留位数
                falseAlarmRate =
                    df.format(DecimalUtil.divide(wbCount.multiply(BigDecimal.valueOf(100)), totalCount, 2));
            }
            resultData.put("reportCode", "");
            resultData.put("reportDate", LocalDate.now());
            resultData.put("operationDate",
                equipmentInfo.getSubEquipmentUseDate() == null ? "" : equipmentInfo.getSubEquipmentUseDate());
            resultData.put("manufacturer",
                equipmentInfo.getSubEquipmentManufactor() == null ? "" : equipmentInfo.getSubEquipmentManufactor());
            resultData.put("installLocation",
                equipmentInfo.getSensorPositionDes() == null ? "" : equipmentInfo.getSensorPositionDes());
            resultData.put("installNumber", "");
            
            resultData.put("overhaulNumber", repairCount);// 检修次数(月)
            resultData.put("overhaulRate",repareRate); //检修率

            resultData.put("dataMissRate", dataMissingRate == null ? "" : dataMissingRate);
            List<Map<String, Object>> pdList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> item = Maps.newLinkedHashMapWithExpectedSize(5);

            item.put("totalWarnNumber", totalCount);
            item.put("falseAlarmRate", falseAlarmRate);
            item.put("gzCount", gzCount);

            pdList1.add(item);
            resultData.put("hwList", pdList1);

            resultData.put("reporter", "");
            resultData.put("signatory", "");
            resultData.put("reportDescription", "");

            List<Map<String, Object>> monthList1 = Lists.newArrayListWithCapacity(10);
            List<Map<String,Object>> voList = new ArrayList<Map<String,Object>>();
         
            voList = transformerInfraredTemperatureService.queryHistory(sensorCode,startTime,endTime);
            if (!voList.isEmpty()) {
            	 for (int i = 0; i < voList.size(); i++) {
                     Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);
                     Map<String,Object> map = voList.get(i);
                     if (map != null) {
                     	monthitem.put("val1",  i + 1);
                     	monthitem.put("val2", map.get("phase"));
                       	monthitem.put("val3", map.get("maxTmp"));
                     	monthitem.put("val4", map.get("minTmp"));
                     	monthitem.put("val5", map.get("avgTmp"));
                      	String workState = map.get("runState").toString();
                      	if("1".equals(workState))
                    	{
                    		monthitem.put("val6", "发电");
                    	}
                    	if("2".equals(workState))
                    	{
                    		monthitem.put("val6", "抽水");
                    	}
                    	if("3".equals(workState))
                    	{
                    		monthitem.put("val6", "空闲");
                    	}
                    	else 
                    	{
                    		monthitem.put("val6", "");
                    	}
                    	
                      	monthitem.put("val7", map.get("timeStamp").toString());
                     	monthList1.add(monthitem);
                     }
                 }
            } else {
                Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);
                monthitem.put("val1",  "");
             	monthitem.put("val2", "");
               	monthitem.put("val3", "");
             	monthitem.put("val4", "");
             	monthitem.put("val5", "");
             	monthitem.put("val6", "");
             	monthitem.put("val7", "");
                monthList1.add(monthitem);
            }
            resultData.put("hwMonthList", monthList1);
        } else {
            resultData.put("reportCode", "");
            resultData.put("reportDate", exportTime);
            resultData.put("operationDate", "");
            resultData.put("manufacturer", "");
            resultData.put("installLocation", "");
            resultData.put("installNumber", "");
            resultData.put("overhaulNumber", "");
            resultData.put("overhaulRate", "");
            resultData.put("dataMissRate", "");

            List<Map<String, Object>> pdList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> item = Maps.newLinkedHashMapWithExpectedSize(5);
            item.put("totalWarnNumber", "");
            item.put("falseAlarmRate", "");
            item.put("gzCount", "");
            pdList1.add(item);
            resultData.put("hwList", pdList1);
            resultData.put("reporter", "");
            resultData.put("signatory", "");
            resultData.put("reportDescription", "");

            List<Map<String, Object>> monthList1 = Lists.newArrayListWithCapacity(10);
            Map<String, Object> monthitem = Maps.newLinkedHashMapWithExpectedSize(8);

            monthitem.put("val1",  "");
         	monthitem.put("val2", "");
           	monthitem.put("val3", "");
         	monthitem.put("val4", "");
         	monthitem.put("val5", "");
         	monthitem.put("val6", "");
         	monthitem.put("val7", "");
            monthList1.add(monthitem);
            resultData.put("hwMonthList", monthList1);
        }
        result.put("fileName", info);
        result.put("data", resultData);

        return result;
    }
}
