package com.ruoyi.project.production.controller;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.production.controller.vo.FurnanceSummaryVO;
import com.ruoyi.project.production.controller.vo.FurnanceTemperatureVO;
import com.ruoyi.project.production.domain.TFurnanceTemperature;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.production.domain.TFurnanceTemperature;
import com.ruoyi.project.production.service.ITFurnanceTemperatureService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 裂解炉炉管测温Controller
 *
 * @author ssy
 * @date 2024-03-21
 */
@RestController
@RequestMapping("/production/temperature")
public class TFurnanceTemperatureController extends BaseController
{
    @Autowired
    private ITFurnanceTemperatureService tFurnanceTemperatureService;

    /**
     * 裂解炉测温列表Summary（APP）
     */
    @GetMapping("/summary")
    public AjaxResult getTemperatureSummary() throws ParseException {
        TFurnanceTemperature query = new TFurnanceTemperature();
        Date date = new Date();
        date.setHours(0);
        date.setMinutes(0);
        date.setSeconds(0);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date parse = sdf.parse(sdf.format(date));
        query.setRecordTime(parse);
        List<TFurnanceTemperature> result = tFurnanceTemperatureService.selectTFurnanceTemperatureByDate2(query);
        List<FurnanceSummaryVO> voList = new ArrayList<>();
        for (TFurnanceTemperature temperature : result) {
            Long id = temperature.getId();
            String furnanceName = temperature.getFurnanceName();
            String status = temperature.getStatus();
            double maxValue = 0;
            switch (furnanceName) {
                case "H109":
                    maxValue = this.getMaxValue109(temperature);
                    break;
                case "H110":
                case "H111":
                case "H112":
                case "H113":
                case "H114":
                case "H115":
                case "H116":
                case "H117":
                case "H118":
                    maxValue = this.getMaxValue11x(temperature);
                    break;
                case "H130":
                    maxValue = this.getMaxValue130(temperature);
                    break;
            }
            FurnanceSummaryVO vo = new FurnanceSummaryVO();
            vo.setId(id);
            vo.setFurnanceName(furnanceName);
            vo.setStatus(status);
            vo.setMaxValue(maxValue);
            voList.add(vo);
        }
        return AjaxResult.success(voList);
    }
    public double getMaxValue109(TFurnanceTemperature temperature) {
        String pass1 = temperature.getPass1();
        String pass2 = temperature.getPass2();
        String pass3 = temperature.getPass3();
        String pass4 = temperature.getPass4();
        String pass5 = temperature.getPass5();
        String pass6 = temperature.getPass6();
        String pass7 = temperature.getPass7();
        String pass8 = temperature.getPass8();
        String pass9 = temperature.getPass9();
        String pass10 = temperature.getPass10();
        String pass11 = temperature.getPass11();
        String pass12 = temperature.getPass12();
        String pass13 = temperature.getPass13();
        String pass14 = temperature.getPass14();
        String pass15 = temperature.getPass15();
        String pass16 = temperature.getPass16();
        int maxValue1 = this.getMaxValue(pass1);
        int maxValue2 = this.getMaxValue(pass2);
        int maxValue3 = this.getMaxValue(pass3);
        int maxValue4 = this.getMaxValue(pass4);
        int maxValue5 = this.getMaxValue(pass5);
        int maxValue6 = this.getMaxValue(pass6);
        int maxValue7 = this.getMaxValue(pass7);
        int maxValue8 = this.getMaxValue(pass8);
        int maxValue9 = this.getMaxValue(pass9);
        int maxValue10 = this.getMaxValue(pass10);
        int maxValue11 = this.getMaxValue(pass11);
        int maxValue12 = this.getMaxValue(pass12);
        int maxValue13 = this.getMaxValue(pass13);
        int maxValue14 = this.getMaxValue(pass14);
        int maxValue15 = this.getMaxValue(pass15);
        int maxValue16 = this.getMaxValue(pass16);
        return this.getMaxValue(
                maxValue1 + "," + maxValue2 + "," + maxValue3 + "," + maxValue4 + ","
                        + maxValue5 + "," + maxValue6 + "," + maxValue7 + "," + maxValue8 + ","
                        + maxValue9 + "," + maxValue10 + "," + maxValue11 + "," + maxValue12 + ","
                        + maxValue13 + "," + maxValue14 + "," + maxValue15 + "," + maxValue16 + ","
        );
    }
    public double getMaxValue11x(TFurnanceTemperature temperature) {
        String pass1 = temperature.getPass1();
        String pass2 = temperature.getPass2();
        String pass3 = temperature.getPass3();
        String pass4 = temperature.getPass4();
        String pass5 = temperature.getPass5();
        String pass6 = temperature.getPass6();
        String pass7 = temperature.getPass7();
        String pass8 = temperature.getPass8();
        int maxValue1 = this.getMaxValue(pass1);
        int maxValue2 = this.getMaxValue(pass2);
        int maxValue3 = this.getMaxValue(pass3);
        int maxValue4 = this.getMaxValue(pass4);
        int maxValue5 = this.getMaxValue(pass5);
        int maxValue6 = this.getMaxValue(pass6);
        int maxValue7 = this.getMaxValue(pass7);
        int maxValue8 = this.getMaxValue(pass8);
        return this.getMaxValue(
                maxValue1 + "," + maxValue2 + "," + maxValue3 + "," + maxValue4 + ","
                        + maxValue5 + "," + maxValue6 + "," + maxValue7 + "," + maxValue8 + ","
        );
    }
    public double getMaxValue130(TFurnanceTemperature temperature) {
        String pass1 = temperature.getPass1();
        String pass2 = temperature.getPass2();
        String pass3 = temperature.getPass3();
        String pass4 = temperature.getPass4();
        int maxValue1 = this.getMaxValue(pass1);
        int maxValue2 = this.getMaxValue(pass2);
        int maxValue3 = this.getMaxValue(pass3);
        int maxValue4 = this.getMaxValue(pass4);
        return this.getMaxValue(maxValue1 + "," + maxValue2 + "," + maxValue3 + "," + maxValue4 + ",");
    }

    /**
     * 获取裂解炉炉管测温详细信息
     */
    @PostMapping("/info")
    public AjaxResult getTemperatureInfo(@RequestBody TFurnanceTemperature tFurnanceTemperature) throws ParseException {
        String furnanceName = tFurnanceTemperature.getFurnanceName();
        Date recordTime = new Date();
        if ("".equals(furnanceName) || recordTime == null) {
            return AjaxResult.success();
        }
        Date date = new Date();
        date.setYear(recordTime.getYear());
        date.setMonth(recordTime.getMonth());
        date.setDate(recordTime.getDate());
        date.setHours(0);
        date.setMinutes(0);
        date.setSeconds(0);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date parse = sdf.parse(sdf.format(date));
        tFurnanceTemperature.setRecordTime(parse);
        TFurnanceTemperature temperature = tFurnanceTemperatureService.selectTFurnanceTemperatureByDate(tFurnanceTemperature);
        if (temperature == null ) {
            return AjaxResult.error("当天数据未生成");
        } else {
            this.isComplete(temperature);
            return AjaxResult.success(temperature);
        }
    }
    public TFurnanceTemperature isComplete(TFurnanceTemperature tFurnanceTemperature) {
        String furnanceName = tFurnanceTemperature.getFurnanceName();
        tFurnanceTemperature.setProgress(0L);
        tFurnanceTemperature.setPass1Complete(false);
        tFurnanceTemperature.setPass2Complete(false);
        tFurnanceTemperature.setPass3Complete(false);
        tFurnanceTemperature.setPass4Complete(false);
        tFurnanceTemperature.setPass5Complete(false);
        tFurnanceTemperature.setPass6Complete(false);
        tFurnanceTemperature.setPass7Complete(false);
        tFurnanceTemperature.setPass8Complete(false);
        tFurnanceTemperature.setPass9Complete(false);
        tFurnanceTemperature.setPass10Complete(false);
        tFurnanceTemperature.setPass11Complete(false);
        tFurnanceTemperature.setPass12Complete(false);
        tFurnanceTemperature.setPass13Complete(false);
        tFurnanceTemperature.setPass14Complete(false);
        tFurnanceTemperature.setPass15Complete(false);
        tFurnanceTemperature.setPass16Complete(false);
        switch (furnanceName) {
            case "H109":
                this.isComplete109(tFurnanceTemperature);
                break;
            case "H110":
            case "H111":
            case "H112":
            case "H113":
            case "H114":
            case "H115":
            case "H116":
            case "H117":
            case "H118":
                this.isComplete11x(tFurnanceTemperature);
                break;
            case "H130":
                this.isComplete130(tFurnanceTemperature);
                break;
        }
        return tFurnanceTemperature;
    }
    public TFurnanceTemperature isComplete109(TFurnanceTemperature tFurnanceTemperature) {
        String pass1 = tFurnanceTemperature.getPass1();
        String pass2 = tFurnanceTemperature.getPass2();
        String pass3 = tFurnanceTemperature.getPass3();
        String pass4 = tFurnanceTemperature.getPass4();
        String pass5 = tFurnanceTemperature.getPass5();
        String pass6 = tFurnanceTemperature.getPass6();
        String pass7 = tFurnanceTemperature.getPass7();
        String pass8 = tFurnanceTemperature.getPass8();
        String pass9 = tFurnanceTemperature.getPass9();
        String pass10 = tFurnanceTemperature.getPass10();
        String pass11 = tFurnanceTemperature.getPass11();
        String pass12 = tFurnanceTemperature.getPass12();
        String pass13 = tFurnanceTemperature.getPass13();
        String pass14 = tFurnanceTemperature.getPass14();
        String pass15 = tFurnanceTemperature.getPass15();
        String pass16 = tFurnanceTemperature.getPass16();
        double count = 0;
        if (StringUtils.isNotNull(pass1) && StringUtils.isNotEmpty(pass1)) {
            String[] split = pass1.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass1Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass2) && StringUtils.isNotEmpty(pass2)) {
            String[] split = pass2.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass2Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass3) && StringUtils.isNotEmpty(pass3)) {
            String[] split = pass3.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass3Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass4) && StringUtils.isNotEmpty(pass4)) {
            String[] split = pass4.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass4Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass5) && StringUtils.isNotEmpty(pass5)) {
            String[] split = pass5.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass5Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass6) && StringUtils.isNotEmpty(pass6)) {
            String[] split = pass6.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass6Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass7) && StringUtils.isNotEmpty(pass7)) {
            String[] split = pass7.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass7Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass8) && StringUtils.isNotEmpty(pass8)) {
            String[] split = pass8.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass8Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass9) && StringUtils.isNotEmpty(pass9)) {
            String[] split = pass9.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass9Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass10) && StringUtils.isNotEmpty(pass10)) {
            String[] split = pass10.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass10Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass11) && StringUtils.isNotEmpty(pass11)) {
            String[] split = pass11.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass11Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass12) && StringUtils.isNotEmpty(pass12)) {
            String[] split = pass12.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass12Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass13) && StringUtils.isNotEmpty(pass13)) {
            String[] split = pass13.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass13Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass14) && StringUtils.isNotEmpty(pass14)) {
            String[] split = pass14.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass14Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass15) && StringUtils.isNotEmpty(pass15)) {
            String[] split = pass15.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass15Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass16) && StringUtils.isNotEmpty(pass16)) {
            String[] split = pass16.split(",");
            if (split.length >= 14) {
                tFurnanceTemperature.setPass16Complete(true);
                count++;
            }
        }
        tFurnanceTemperature.setProgress(count * 1.00d / 16L);
        return tFurnanceTemperature;
    }
    public TFurnanceTemperature isComplete11x(TFurnanceTemperature tFurnanceTemperature) {
        String pass1 = tFurnanceTemperature.getPass1();
        String pass2 = tFurnanceTemperature.getPass2();
        String pass3 = tFurnanceTemperature.getPass3();
        String pass4 = tFurnanceTemperature.getPass4();
        String pass5 = tFurnanceTemperature.getPass5();
        String pass6 = tFurnanceTemperature.getPass6();
        String pass7 = tFurnanceTemperature.getPass7();
        String pass8 = tFurnanceTemperature.getPass8();
        double count = 0;
        if (StringUtils.isNotNull(pass1) && StringUtils.isNotEmpty(pass1)) {
            String[] split = pass1.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass1Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass2) && StringUtils.isNotEmpty(pass2)) {
            String[] split = pass2.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass2Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass3) && StringUtils.isNotEmpty(pass3)) {
            String[] split = pass3.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass3Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass4) && StringUtils.isNotEmpty(pass4)) {
            String[] split = pass4.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass4Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass5) && StringUtils.isNotEmpty(pass5)) {
            String[] split = pass5.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass5Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass6) && StringUtils.isNotEmpty(pass6)) {
            String[] split = pass6.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass6Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass7) && StringUtils.isNotEmpty(pass7)) {
            String[] split = pass7.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass7Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass8) && StringUtils.isNotEmpty(pass8)) {
            String[] split = pass8.split(",");
            if (split.length >= 10) {
                tFurnanceTemperature.setPass8Complete(true);
                count++;
            }
        }
        tFurnanceTemperature.setProgress(count * 1.00d / 8L);
        return tFurnanceTemperature;
    }
    public TFurnanceTemperature isComplete130(TFurnanceTemperature tFurnanceTemperature) {
        String pass1 = tFurnanceTemperature.getPass1();
        String pass2 = tFurnanceTemperature.getPass2();
        String pass3 = tFurnanceTemperature.getPass3();
        String pass4 = tFurnanceTemperature.getPass4();
        String pass5 = tFurnanceTemperature.getPass5();
        String pass6 = tFurnanceTemperature.getPass6();
        String pass7 = tFurnanceTemperature.getPass7();
        String pass8 = tFurnanceTemperature.getPass8();
        String pass9 = tFurnanceTemperature.getPass9();
        String pass10 = tFurnanceTemperature.getPass10();
        String pass11 = tFurnanceTemperature.getPass11();
        String pass12 = tFurnanceTemperature.getPass12();
        double count = 0;
        if (StringUtils.isNotNull(pass1) && StringUtils.isNotEmpty(pass1)) {
            String[] split = pass1.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass1Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass2) && StringUtils.isNotEmpty(pass2)) {
            String[] split = pass2.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass2Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass3) && StringUtils.isNotEmpty(pass3)) {
            String[] split = pass3.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass3Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass4) && StringUtils.isNotEmpty(pass4)) {
            String[] split = pass4.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass4Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass5) && StringUtils.isNotEmpty(pass5)) {
            String[] split = pass5.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass5Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass6) && StringUtils.isNotEmpty(pass6)) {
            String[] split = pass6.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass6Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass7) && StringUtils.isNotEmpty(pass7)) {
            String[] split = pass7.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass7Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass8) && StringUtils.isNotEmpty(pass8)) {
            String[] split = pass8.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass8Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass9) && StringUtils.isNotEmpty(pass9)) {
            String[] split = pass9.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass9Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass10) && StringUtils.isNotEmpty(pass10)) {
            String[] split = pass10.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass10Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass11) && StringUtils.isNotEmpty(pass11)) {
            String[] split = pass11.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass11Complete(true);
                count++;
            }
        }
        if (StringUtils.isNotNull(pass12) && StringUtils.isNotEmpty(pass12)) {
            String[] split = pass12.split(",");
            if (split.length >= 3) {
                tFurnanceTemperature.setPass12Complete(true);
                count++;
            }
        }
        tFurnanceTemperature.setProgress(count * 1.00d / 12L);
        return tFurnanceTemperature;
    }

    /**
     * 查询裂解炉炉管测温MAX
     */
    @GetMapping("/max")
    public AjaxResult max(TFurnanceTemperature tFurnanceTemperature)
    {
        tFurnanceTemperature.setFurnanceName("H109");
        List<TFurnanceTemperature> list109 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H110");
        List<TFurnanceTemperature> list110 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H111");
        List<TFurnanceTemperature> list111 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H112");
        List<TFurnanceTemperature> list112 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H113");
        List<TFurnanceTemperature> list113 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H114");
        List<TFurnanceTemperature> list114 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H115");
        List<TFurnanceTemperature> list115 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H116");
        List<TFurnanceTemperature> list116 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H117");
        List<TFurnanceTemperature> list117 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H118");
        List<TFurnanceTemperature> list118 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H130");
        List<TFurnanceTemperature> list130 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        if (list109.size() != list110.size() || list109.size() != list111.size()
            || list109.size() != list112.size() || list109.size() != list113.size()
            || list109.size() != list114.size() || list109.size() != list115.size()
            || list109.size() != list116.size() || list109.size() != list117.size()
            || list109.size() != list118.size() || list109.size() != list130.size()) {
            return AjaxResult.success("incompleteData");
        }
        List<FurnanceTemperatureVO> coilList = new ArrayList<FurnanceTemperatureVO>(list109.size());
        if (list109.size() != 0) {
            for (int i = 0; i < list109.size(); i++) {
                TFurnanceTemperature ft = list109.get(i);
                FurnanceTemperatureVO coil = new FurnanceTemperatureVO();
                coil.setRecordTime(ft.getRecordTime());
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                String pass9 = ft.getPass9();
                String pass10 = ft.getPass10();
                String pass11 = ft.getPass11();
                String pass12 = ft.getPass12();
                String pass13 = ft.getPass13();
                String pass14 = ft.getPass14();
                String pass15 = ft.getPass15();
                String pass16 = ft.getPass16();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)
                        || "".equals(pass9) || StringUtils.isNull(pass9)
                        || "".equals(pass10) || StringUtils.isNull(pass10)
                        || "".equals(pass11) || StringUtils.isNull(pass11)
                        || "".equals(pass12) || StringUtils.isNull(pass12)
                        || "".equals(pass13) || StringUtils.isNull(pass13)
                        || "".equals(pass14) || StringUtils.isNull(pass14)
                        || "".equals(pass15) || StringUtils.isNull(pass15)
                        || "".equals(pass16) || StringUtils.isNull(pass16)) {
                    return AjaxResult.success("incompleteData");
                }
                coil.setH109Out(this.getMaxValue(ft.getPass1() + "," + ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3() + "," + ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5() + "," + ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7() + "," + ft.getPass8()) + ","
                        + this.getMaxValue(ft.getPass9() + "," + ft.getPass10()) + ","
                        + this.getMaxValue(ft.getPass11() + "," + ft.getPass12()) + ","
                        + this.getMaxValue(ft.getPass13() + "," + ft.getPass14()) + ","
                        + this.getMaxValue(ft.getPass15() + "," + ft.getPass16()));
                coilList.add(coil);
            }
        }
        if (list110.size() != 0) {
            for (int i = 0; i < list110.size(); i++) {
                TFurnanceTemperature ft = list110.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH110Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list111.size() != 0) {
            for (int i = 0; i < list111.size(); i++) {
                TFurnanceTemperature ft = list111.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH111Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list112.size() != 0) {
            for (int i = 0; i < list112.size(); i++) {
                TFurnanceTemperature ft = list112.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH112Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list113.size() != 0) {
            for (int i = 0; i < list113.size(); i++) {
                TFurnanceTemperature ft = list113.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH113Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list114.size() != 0) {
            for (int i = 0; i < list114.size(); i++) {
                TFurnanceTemperature ft = list114.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH114Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list115.size() != 0) {
            for (int i = 0; i < list115.size(); i++) {
                TFurnanceTemperature ft = list115.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH115Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list116.size() != 0) {
            for (int i = 0; i < list116.size(); i++) {
                TFurnanceTemperature ft = list116.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH116Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list117.size() != 0) {
            for (int i = 0; i < list117.size(); i++) {
                TFurnanceTemperature ft = list117.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH117Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list118.size() != 0) {
            for (int i = 0; i < list118.size(); i++) {
                TFurnanceTemperature ft = list118.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH118Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list130.size() != 0) {
            for (int i = 0; i < list130.size(); i++) {
                TFurnanceTemperature ft = list130.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                String pass9 = ft.getPass9();
                String pass10 = ft.getPass10();
                String pass11 = ft.getPass11();
                String pass12 = ft.getPass12();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)
                        || "".equals(pass9) || StringUtils.isNull(pass9)
                        || "".equals(pass10) || StringUtils.isNull(pass10)
                        || "".equals(pass11) || StringUtils.isNull(pass11)
                        || "".equals(pass12) || StringUtils.isNull(pass12)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH130Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()) + ","
                        + this.getMaxValue(ft.getPass9()) + "," + this.getMaxValue(ft.getPass10()) + ","
                        + this.getMaxValue(ft.getPass11()) + "," + this.getMaxValue(ft.getPass12()));
            }
        }
        for (FurnanceTemperatureVO vo : coilList) {
            vo.setH109Out(this.getMaxValue(vo.getH109Out())+"");
            vo.setH110Out(this.getMaxValue(vo.getH110Out())+"");
            vo.setH111Out(this.getMaxValue(vo.getH111Out())+"");
            vo.setH112Out(this.getMaxValue(vo.getH112Out())+"");
            vo.setH113Out(this.getMaxValue(vo.getH113Out())+"");
            vo.setH114Out(this.getMaxValue(vo.getH114Out())+"");
            vo.setH115Out(this.getMaxValue(vo.getH115Out())+"");
            vo.setH116Out(this.getMaxValue(vo.getH116Out())+"");
            vo.setH117Out(this.getMaxValue(vo.getH117Out())+"");
            vo.setH118Out(this.getMaxValue(vo.getH118Out())+"");
            vo.setH130Out(this.getMaxValue(vo.getH130Out())+"");
        }
        return AjaxResult.success(coilList);
    }

    /**
     * 查询裂解炉炉管测温COIL
     */
    @GetMapping("/coil")
    public AjaxResult coil(TFurnanceTemperature tFurnanceTemperature)
    {
        tFurnanceTemperature.setFurnanceName("H109");
        List<TFurnanceTemperature> list109 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H110");
        List<TFurnanceTemperature> list110 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H111");
        List<TFurnanceTemperature> list111 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H112");
        List<TFurnanceTemperature> list112 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H113");
        List<TFurnanceTemperature> list113 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H114");
        List<TFurnanceTemperature> list114 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H115");
        List<TFurnanceTemperature> list115 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H116");
        List<TFurnanceTemperature> list116 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H117");
        List<TFurnanceTemperature> list117 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H118");
        List<TFurnanceTemperature> list118 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        tFurnanceTemperature.setFurnanceName("H130");
        List<TFurnanceTemperature> list130 = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        if (list109.size() != list110.size() || list109.size() != list111.size()
                || list109.size() != list112.size() || list109.size() != list113.size()
                || list109.size() != list114.size() || list109.size() != list115.size()
                || list109.size() != list116.size() || list109.size() != list117.size()
                || list109.size() != list118.size() || list109.size() != list130.size()) {
            return AjaxResult.success("incompleteData");
        }
        List<FurnanceTemperatureVO> coilList = new ArrayList<FurnanceTemperatureVO>(list109.size());
        if (list109.size() != 0) {
            for (int i = 0; i < list109.size(); i++) {
                TFurnanceTemperature ft = list109.get(i);
                FurnanceTemperatureVO coil = new FurnanceTemperatureVO();
                coil.setRecordTime(ft.getRecordTime());
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                String pass9 = ft.getPass9();
                String pass10 = ft.getPass10();
                String pass11 = ft.getPass11();
                String pass12 = ft.getPass12();
                String pass13 = ft.getPass13();
                String pass14 = ft.getPass14();
                String pass15 = ft.getPass15();
                String pass16 = ft.getPass16();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)
                        || "".equals(pass9) || StringUtils.isNull(pass9)
                        || "".equals(pass10) || StringUtils.isNull(pass10)
                        || "".equals(pass11) || StringUtils.isNull(pass11)
                        || "".equals(pass12) || StringUtils.isNull(pass12)
                        || "".equals(pass13) || StringUtils.isNull(pass13)
                        || "".equals(pass14) || StringUtils.isNull(pass14)
                        || "".equals(pass15) || StringUtils.isNull(pass15)
                        || "".equals(pass16) || StringUtils.isNull(pass16)) {
                    return AjaxResult.success("incompleteData");
                }
                coil.setH109Out(this.getMaxValue(ft.getPass1() + "," + ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3() + "," + ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5() + "," + ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7() + "," + ft.getPass8()) + ","
                        + this.getMaxValue(ft.getPass9() + "," + ft.getPass10()) + ","
                        + this.getMaxValue(ft.getPass11() + "," + ft.getPass12()) + ","
                        + this.getMaxValue(ft.getPass13() + "," + ft.getPass14()) + ","
                        + this.getMaxValue(ft.getPass15() + "," + ft.getPass16()));
                coilList.add(coil);
            }
        }
        if (list110.size() != 0) {
            for (int i = 0; i < list110.size(); i++) {
                TFurnanceTemperature ft = list110.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH110Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list111.size() != 0) {
            for (int i = 0; i < list111.size(); i++) {
                TFurnanceTemperature ft = list111.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH111Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list112.size() != 0) {
            for (int i = 0; i < list112.size(); i++) {
                TFurnanceTemperature ft = list112.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH112Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list113.size() != 0) {
            for (int i = 0; i < list113.size(); i++) {
                TFurnanceTemperature ft = list113.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH113Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list114.size() != 0) {
            for (int i = 0; i < list114.size(); i++) {
                TFurnanceTemperature ft = list114.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH114Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list115.size() != 0) {
            for (int i = 0; i < list115.size(); i++) {
                TFurnanceTemperature ft = list115.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH115Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list116.size() != 0) {
            for (int i = 0; i < list116.size(); i++) {
                TFurnanceTemperature ft = list116.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH116Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list117.size() != 0) {
            for (int i = 0; i < list117.size(); i++) {
                TFurnanceTemperature ft = list117.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH117Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list118.size() != 0) {
            for (int i = 0; i < list118.size(); i++) {
                TFurnanceTemperature ft = list118.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH118Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()));
            }
        }
        if (list130.size() != 0) {
            for (int i = 0; i < list130.size(); i++) {
                TFurnanceTemperature ft = list130.get(i);
                String pass1 = ft.getPass1();
                String pass2 = ft.getPass2();
                String pass3 = ft.getPass3();
                String pass4 = ft.getPass4();
                String pass5 = ft.getPass5();
                String pass6 = ft.getPass6();
                String pass7 = ft.getPass7();
                String pass8 = ft.getPass8();
                String pass9 = ft.getPass9();
                String pass10 = ft.getPass10();
                String pass11 = ft.getPass11();
                String pass12 = ft.getPass12();
                if ("".equals(pass1) || StringUtils.isNull(pass1)
                        || "".equals(pass2) || StringUtils.isNull(pass2)
                        || "".equals(pass3) || StringUtils.isNull(pass3)
                        || "".equals(pass4) || StringUtils.isNull(pass4)
                        || "".equals(pass5) || StringUtils.isNull(pass5)
                        || "".equals(pass6) || StringUtils.isNull(pass6)
                        || "".equals(pass7) || StringUtils.isNull(pass7)
                        || "".equals(pass8) || StringUtils.isNull(pass8)
                        || "".equals(pass9) || StringUtils.isNull(pass9)
                        || "".equals(pass10) || StringUtils.isNull(pass10)
                        || "".equals(pass11) || StringUtils.isNull(pass11)
                        || "".equals(pass12) || StringUtils.isNull(pass12)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH130Out(this.getMaxValue(ft.getPass1()) + "," + this.getMaxValue(ft.getPass2()) + ","
                        + this.getMaxValue(ft.getPass3()) + "," + this.getMaxValue(ft.getPass4()) + ","
                        + this.getMaxValue(ft.getPass5()) + "," + this.getMaxValue(ft.getPass6()) + ","
                        + this.getMaxValue(ft.getPass7()) + "," + this.getMaxValue(ft.getPass8()) + ","
                        + this.getMaxValue(ft.getPass9()) + "," + this.getMaxValue(ft.getPass10()) + ","
                        + this.getMaxValue(ft.getPass11()) + "," + this.getMaxValue(ft.getPass12()));
            }
        }
        return AjaxResult.success(coilList);
    }
    public int getMaxValue(String value) {
        if (StringUtils.isNotNull(value) && StringUtils.isNotEmpty(value)) {
            String[] split = value.split(",");
            int max = Integer.parseInt(split[0]);
            for (int i = 0; i < split.length; i++) {
                int element = Integer.parseInt(split[i]);
                if (element > max) {
                    max = element;
                }
            }
            return max;
        } else {
            return 0;
        }
    }

    /**
     * 查询裂解炉炉管测温列表
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:list')")
    @GetMapping("/list")
    public TableDataInfo list(TFurnanceTemperature tFurnanceTemperature)
    {
        startPage();
        List<TFurnanceTemperature> list = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        return getDataTable(list);
    }

    /**
     * 导出裂解炉炉管测温列表
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:export')")
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(TFurnanceTemperature tFurnanceTemperature)
    {
        List<TFurnanceTemperature> list = tFurnanceTemperatureService.selectTFurnanceTemperatureList(tFurnanceTemperature);
        ExcelUtil<TFurnanceTemperature> util = new ExcelUtil<TFurnanceTemperature>(TFurnanceTemperature.class);
        return util.exportExcel(list, "temperature");
    }

    /**
     * 获取裂解炉炉管测温详细信息
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(tFurnanceTemperatureService.selectTFurnanceTemperatureById(id));
    }

    /**
     * 新增裂解炉炉管测温
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:add')")
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TFurnanceTemperature tFurnanceTemperature)
    {
        return toAjax(tFurnanceTemperatureService.insertTFurnanceTemperature(tFurnanceTemperature));
    }

    /**
     * 修改裂解炉炉管测温
     */
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TFurnanceTemperature tFurnanceTemperature)
    {
        return toAjax(tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
    }

    /**
     * 删除裂解炉炉管测温
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:remove')")
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tFurnanceTemperatureService.deleteTFurnanceTemperatureByIds(ids));
    }
}
