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.github.stuxuhai.jpinyin.PinyinException;
import com.ruoyi.common.jpush.JiGuangPushService;
import com.ruoyi.common.sendEmail.IMailService;
import com.ruoyi.common.thread.furnance.FurnancePressureThread;
import com.ruoyi.common.thread.furnance.FurnanceTemperatureThread;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.project.plant.domain.TStaffmgr;
import com.ruoyi.project.plant.service.ITStaffmgrService;
import com.ruoyi.project.production.controller.vo.FurnancePressureFvpVO;
import com.ruoyi.project.production.controller.vo.FurnanceSummaryVO;
import com.ruoyi.project.production.controller.vo.FurnanceTemperatureVO;
import com.ruoyi.project.production.domain.TFurnanceTemperature;
import com.ruoyi.project.production.service.ITFurnancePressureService;
import com.ruoyi.project.system.domain.SysDictData;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.service.ISysConfigService;
import com.ruoyi.project.system.service.ISysDictTypeService;
import com.ruoyi.project.system.service.ISysUserService;
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.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;

    @Autowired
    private ITFurnancePressureService tFurnancePressureService;

    @Autowired
    private ISysDictTypeService iSysDictTypeService;

    @Autowired
    private IMailService mailService;

    @Autowired
    private ITStaffmgrService staffmgrService;

    @Autowired
    private ISysUserService userService;

    @Autowired
    private JiGuangPushService jiGuangPushService;

    @Autowired
    private ISysConfigService configService;

    /**
     * 裂解炉测温列表Summary（APP）
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:list')")
    @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 + ",");
    }

    /**
     * 获取裂解炉炉管测温详细信息
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:list')")
    @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 ) {
            temperature = this.genData(tFurnanceTemperature);
        }
        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;
    }

    /**
     * 每日巡检数据生成
     */
    public synchronized TFurnanceTemperature genData(TFurnanceTemperature tFurnanceTemperature) {
        TFurnanceTemperature obj = tFurnanceTemperatureService.selectTFurnanceTemperatureByDate(tFurnanceTemperature);
        if (obj != null) {
            return obj;
        } else {
            // yyyy-MM-dd 08:00:00
            Date am = new Date();
            am.setHours(8);
            am.setMinutes(0);
            am.setSeconds(0);
            // yyyy-MM-dd 20:00:00
            Date pm = new Date();
            pm.setHours(20);
            pm.setMinutes(0);
            pm.setSeconds(0);
            // furnanceName array
            String[] furnanceNames = {"H109", "H110", "H111", "H112", "H113", "H114", "H115", "H116", "H117", "H118", "H130"};
            // 遍历生成数据
            for (String furnanceName : furnanceNames) {
                // 测温 08:00:00
                TFurnanceTemperature temperature = new TFurnanceTemperature();
                temperature.setRecordTime(am);
                temperature.setDeptId(103L);
                temperature.setFurnanceName(furnanceName);
                // 默认赋值=0
//                switch (furnanceName) {
//                    case "H109":
//                        this.setZeroTemperature(temperature, 16, 14);
//                        break;
//                    case "H110":
//                    case "H111":
//                    case "H112":
//                    case "H113":
//                    case "H114":
//                    case "H115":
//                    case "H116":
//                    case "H117":
//                    case "H118":
//                        this.setZeroTemperature(temperature, 8, 10);
//                        break;
//                    case "H130":
//                        this.setZeroTemperature(temperature, 12, 3);
//                        break;
//                }
                // 新增
                tFurnanceTemperatureService.insertTFurnanceTemperature(temperature);
            }
            return tFurnanceTemperatureService.selectTFurnanceTemperatureByDate(tFurnanceTemperature);
        }
    }

    public String getZeroString(int length) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < length; i++) {
            sb.append("0");
            if (i != length - 1) {
                sb.append(",");
            }
        }
        return sb.toString();
    }

    public void setZeroTemperature(TFurnanceTemperature temperature, int passNum, int length) {
        String zeroString = this.getZeroString(length);
        temperature.setPass1(zeroString);
        temperature.setPass2(zeroString);
        temperature.setPass3(zeroString);
        temperature.setPass4(zeroString);
        temperature.setPass5(zeroString);
        temperature.setPass6(zeroString);
        temperature.setPass7(zeroString);
        temperature.setPass8(zeroString);
        if (passNum == 12 || passNum == 16) {
            temperature.setPass9(zeroString);
            temperature.setPass10(zeroString);
            temperature.setPass11(zeroString);
            temperature.setPass12(zeroString);
        }
        if (passNum == 16) {
            temperature.setPass13(zeroString);
            temperature.setPass14(zeroString);
            temperature.setPass15(zeroString);
            temperature.setPass16(zeroString);
        }
    }

    /**
     * 查询裂解炉炉管测温MAX
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:list')")
    @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 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                String pass9 = this.checkNull(ft.getPass9());
                String pass10 = this.checkNull(ft.getPass10());
                String pass11 = this.checkNull(ft.getPass11());
                String pass12 = this.checkNull(ft.getPass12());
                String pass13 = this.checkNull(ft.getPass13());
                String pass14 = this.checkNull(ft.getPass14());
                String pass15 = this.checkNull(ft.getPass15());
                String pass16 = this.checkNull(ft.getPass16());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)
                        || "".equals(pass9) || "".equals(pass10) || "".equals(pass11) || "".equals(pass12)
                        || "".equals(pass13) || "".equals(pass14) || "".equals(pass15) || "".equals(pass16)) {
                    return AjaxResult.success("incompleteData");
                }
                coil.setH109Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8) + ","
                        + this.getMaxValue(pass9 + "," + pass10) + ","
                        + this.getMaxValue(pass11 + "," + pass12) + ","
                        + this.getMaxValue(pass13 + "," + pass14) + ","
                        + this.getMaxValue(pass15 + "," + pass16));
                coilList.add(coil);
            }
        }
        if (list110.size() != 0) {
            for (int i = 0; i < list110.size(); i++) {
                TFurnanceTemperature ft = list110.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH110Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list111.size() != 0) {
            for (int i = 0; i < list111.size(); i++) {
                TFurnanceTemperature ft = list111.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH111Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list112.size() != 0) {
            for (int i = 0; i < list112.size(); i++) {
                TFurnanceTemperature ft = list112.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH112Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list113.size() != 0) {
            for (int i = 0; i < list113.size(); i++) {
                TFurnanceTemperature ft = list113.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH113Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list114.size() != 0) {
            for (int i = 0; i < list114.size(); i++) {
                TFurnanceTemperature ft = list114.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH114Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list115.size() != 0) {
            for (int i = 0; i < list115.size(); i++) {
                TFurnanceTemperature ft = list115.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH115Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list116.size() != 0) {
            for (int i = 0; i < list116.size(); i++) {
                TFurnanceTemperature ft = list116.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH116Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list117.size() != 0) {
            for (int i = 0; i < list117.size(); i++) {
                TFurnanceTemperature ft = list117.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH117Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list118.size() != 0) {
            for (int i = 0; i < list118.size(); i++) {
                TFurnanceTemperature ft = list118.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH118Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8));
            }
        }
        if (list130.size() != 0) {
            for (int i = 0; i < list130.size(); i++) {
                TFurnanceTemperature ft = list130.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                String pass9 = this.checkNull(ft.getPass9());
                String pass10 = this.checkNull(ft.getPass10());
                String pass11 = this.checkNull(ft.getPass11());
                String pass12 = this.checkNull(ft.getPass12());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)
                        || "".equals(pass9) || "".equals(pass10) || "".equals(pass11) || "".equals(pass12)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH130Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8) + ","
                        + this.getMaxValue(pass9) + "," + this.getMaxValue(pass10) + ","
                        + this.getMaxValue(pass11) + "," + this.getMaxValue(pass12));
            }
        }
        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);
    }

    public String checkNull(String pass) {
        if (StringUtils.isNull(pass)) {
            return "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0";
        } else {
            return pass;
        }
    }

    /**
     * 查询裂解炉炉管测温COIL
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:list')")
    @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 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                String pass9 = this.checkNull(ft.getPass9());
                String pass10 = this.checkNull(ft.getPass10());
                String pass11 = this.checkNull(ft.getPass11());
                String pass12 = this.checkNull(ft.getPass12());
                String pass13 = this.checkNull(ft.getPass13());
                String pass14 = this.checkNull(ft.getPass14());
                String pass15 = this.checkNull(ft.getPass15());
                String pass16 = this.checkNull(ft.getPass16());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)
                        || "".equals(pass9) || "".equals(pass10) || "".equals(pass11) || "".equals(pass12)
                        || "".equals(pass13) || "".equals(pass14) || "".equals(pass15) || "".equals(pass16)) {
                    return AjaxResult.success("incompleteData");
                }
                coil.setH109Out(this.getMaxValue(pass1 + "," + pass2) + ","
                        + this.getMaxValue(pass3 + "," + pass4) + ","
                        + this.getMaxValue(pass5 + "," + pass6) + ","
                        + this.getMaxValue(pass7 + "," + pass8) + ","
                        + this.getMaxValue(pass9 + "," + pass10) + ","
                        + this.getMaxValue(pass11 + "," + pass12) + ","
                        + this.getMaxValue(pass13 + "," + pass14) + ","
                        + this.getMaxValue(pass15 + "," + pass16));
                coilList.add(coil);
            }
        }
        if (list110.size() != 0) {
            for (int i = 0; i < list110.size(); i++) {
                TFurnanceTemperature ft = list110.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH110Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list111.size() != 0) {
            for (int i = 0; i < list111.size(); i++) {
                TFurnanceTemperature ft = list111.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH111Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list112.size() != 0) {
            for (int i = 0; i < list112.size(); i++) {
                TFurnanceTemperature ft = list112.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH112Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list113.size() != 0) {
            for (int i = 0; i < list113.size(); i++) {
                TFurnanceTemperature ft = list113.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH113Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list114.size() != 0) {
            for (int i = 0; i < list114.size(); i++) {
                TFurnanceTemperature ft = list114.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH114Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list115.size() != 0) {
            for (int i = 0; i < list115.size(); i++) {
                TFurnanceTemperature ft = list115.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH115Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list116.size() != 0) {
            for (int i = 0; i < list116.size(); i++) {
                TFurnanceTemperature ft = list116.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH116Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list117.size() != 0) {
            for (int i = 0; i < list117.size(); i++) {
                TFurnanceTemperature ft = list117.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH117Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list118.size() != 0) {
            for (int i = 0; i < list118.size(); i++) {
                TFurnanceTemperature ft = list118.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH118Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8));
            }
        }
        if (list130.size() != 0) {
            for (int i = 0; i < list130.size(); i++) {
                TFurnanceTemperature ft = list130.get(i);
                String pass1 = this.checkNull(ft.getPass1());
                String pass2 = this.checkNull(ft.getPass2());
                String pass3 = this.checkNull(ft.getPass3());
                String pass4 = this.checkNull(ft.getPass4());
                String pass5 = this.checkNull(ft.getPass5());
                String pass6 = this.checkNull(ft.getPass6());
                String pass7 = this.checkNull(ft.getPass7());
                String pass8 = this.checkNull(ft.getPass8());
                String pass9 = this.checkNull(ft.getPass9());
                String pass10 = this.checkNull(ft.getPass10());
                String pass11 = this.checkNull(ft.getPass11());
                String pass12 = this.checkNull(ft.getPass12());
                if ("".equals(pass1) || "".equals(pass2) || "".equals(pass3) || "".equals(pass4)
                        || "".equals(pass5) || "".equals(pass6) || "".equals(pass7) || "".equals(pass8)
                        || "".equals(pass9) || "".equals(pass10) || "".equals(pass11) || "".equals(pass12)) {
                    return AjaxResult.success("incompleteData");
                }
                coilList.get(i).setH130Out(this.getMaxValue(pass1) + "," + this.getMaxValue(pass2) + ","
                        + this.getMaxValue(pass3) + "," + this.getMaxValue(pass4) + ","
                        + this.getMaxValue(pass5) + "," + this.getMaxValue(pass6) + ","
                        + this.getMaxValue(pass7) + "," + this.getMaxValue(pass8) + ","
                        + this.getMaxValue(pass9) + "," + this.getMaxValue(pass10) + ","
                        + this.getMaxValue(pass11) + "," + this.getMaxValue(pass12));
            }
        }
        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));
    }

    /**
     * 修改裂解炉炉管测温（APP）
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:edit')")
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TFurnanceTemperature tFurnanceTemperature) throws PinyinException {
        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();
        int i = tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature);
        String message = "";
        String furnanceName = tFurnanceTemperature.getFurnanceName();
        if (StringUtils.isNotNull(furnanceName)) {//快捷修改不检查发邮件
            switch (furnanceName) {
                case "H109":
                    message = this.checkTemperature109(tFurnanceTemperature);
                    break;
                case "H110":
                case "H111":
                case "H112":
                case "H113":
                case "H114":
                case "H115":
                case "H116":
                case "H117":
                case "H118":
                    message = this.checkTemperature10x(tFurnanceTemperature);
                    break;
                case "H130":
                    message = this.checkTemperature130(tFurnanceTemperature);
                    break;
            }
            boolean isFull = false;
            if ("H109".equals(furnanceName)) {
                isFull = StringUtils.isNotNull(pass1) && StringUtils.isNotNull(pass2) && StringUtils.isNotNull(pass3) && StringUtils.isNotNull(pass4)
                        && StringUtils.isNotNull(pass5) && StringUtils.isNotNull(pass6) && StringUtils.isNotNull(pass7) && StringUtils.isNotNull(pass8)
                        && StringUtils.isNotNull(pass9) && StringUtils.isNotNull(pass10) && StringUtils.isNotNull(pass11) && StringUtils.isNotNull(pass12)
                        && StringUtils.isNotNull(pass13) && StringUtils.isNotNull(pass14) && StringUtils.isNotNull(pass15) && StringUtils.isNotNull(pass16)
                        && !"".equals(pass1) && !"".equals(pass2) && !"".equals(pass3) && !"".equals(pass4)
                        && !"".equals(pass5) && !"".equals(pass6) && !"".equals(pass7) && !"".equals(pass8)
                        && !"".equals(pass9) && !"".equals(pass10) && !"".equals(pass11) && !"".equals(pass12)
                        && !"".equals(pass13) && !"".equals(pass14) && !"".equals(pass15) && !"".equals(pass16);
            } else if ("H130".equals(furnanceName)) {
                isFull = StringUtils.isNotNull(pass1) && StringUtils.isNotNull(pass2) && StringUtils.isNotNull(pass3) && StringUtils.isNotNull(pass4)
                        && StringUtils.isNotNull(pass5) && StringUtils.isNotNull(pass6) && StringUtils.isNotNull(pass7) && StringUtils.isNotNull(pass8)
                        && StringUtils.isNotNull(pass9) && StringUtils.isNotNull(pass10) && StringUtils.isNotNull(pass11) && StringUtils.isNotNull(pass12)
                        && !"".equals(pass1) && !"".equals(pass2) && !"".equals(pass3) && !"".equals(pass4)
                        && !"".equals(pass5) && !"".equals(pass6) && !"".equals(pass7) && !"".equals(pass8)
                        && !"".equals(pass9) && !"".equals(pass10) && !"".equals(pass11) && !"".equals(pass12);
            } else {
                isFull = StringUtils.isNotNull(pass1) && StringUtils.isNotNull(pass2) && StringUtils.isNotNull(pass3) && StringUtils.isNotNull(pass4)
                        && StringUtils.isNotNull(pass5) && StringUtils.isNotNull(pass6) && StringUtils.isNotNull(pass7) && StringUtils.isNotNull(pass8)
                        && !"".equals(pass1) && !"".equals(pass2) && !"".equals(pass3) && !"".equals(pass4)
                        && !"".equals(pass5) && !"".equals(pass6) && !"".equals(pass7) && !"".equals(pass8);
            }
            if (isFull && !"".equals(message)) {
                message = message.substring(0, message.length() - 1);
                message += "温度>1080，请注意处理。";
                // 发邮件
                String mailMsg = furnanceName + "：" + message;
                List<SysDictData> furnanceRecipientDict = iSysDictTypeService.selectDictDataByType("FURNANCE_RECIPIENT");
                for (SysDictData sysDictData : furnanceRecipientDict) {
                    String dictValue = sysDictData.getDictValue();
                    TStaffmgr staffmgr = staffmgrService.selectTStaffmgrByStaffId(dictValue);
                    SysUser sysUser = userService.selectUserByStaffId(dictValue);
                    FurnanceTemperatureThread mailThread = new FurnanceTemperatureThread(mailService, staffmgr, sysUser.getUserName(), mailMsg + "，");
                    Thread thread = new Thread(mailThread);
                    thread.start();
                }
                // APP推送
                String pushList = configService.selectConfigByKey("production.furnance.pushList");
                String[] staffIds = pushList.split(",");
                String[] userIds = new String[staffIds.length];
                for (int j = 0; j < staffIds.length; j++) {
                    userIds[j] = userService.selectUserByStaffId(staffIds[j]).getUserId().toString();
                }
                jiGuangPushService.send("裂解炉高温预警", mailMsg, userIds);
            }
        }
        return toAjax(i);
    }

    /**
     * 修改裂解炉炉管测温（WEB）
     */
    @PreAuthorize("@ss.hasPermi('production:temperature:edit')")
    @Log(title = "裂解炉炉管测温", businessType = BusinessType.UPDATE)
    @PutMapping("/editWeb")
    public AjaxResult editWeb(@RequestBody TFurnanceTemperature tFurnanceTemperature) throws PinyinException {
        String status = tFurnanceTemperature.getStatus();
        // 烧焦、停炉状态不检查
        if ("0".equals(status)) {
            String message = "";
            String furnanceName = tFurnanceTemperature.getFurnanceName();
            switch (furnanceName) {
                case "H109":
                    message = this.checkTemperature109(tFurnanceTemperature);
                    break;
                case "H110":
                case "H111":
                case "H112":
                case "H113":
                case "H114":
                case "H115":
                case "H116":
                case "H117":
                case "H118":
                    message = this.checkTemperature10x(tFurnanceTemperature);
                    break;
                case "H130":
                    message = this.checkTemperature130(tFurnanceTemperature);
                    break;
            }
            if (!"".equals(message)) {
                message = message.substring(0, message.length() - 1);
                message += "温度>1080，请注意处理。";
                // 发邮件
                String mailMsg = furnanceName + message;
                List<SysDictData> furnanceRecipientDict = iSysDictTypeService.selectDictDataByType("FURNANCE_RECIPIENT");
                for (SysDictData sysDictData : furnanceRecipientDict) {
                    String dictValue = sysDictData.getDictValue();
                    TStaffmgr staffmgr = staffmgrService.selectTStaffmgrByStaffId(dictValue);
                    SysUser sysUser = userService.selectUserByStaffId(dictValue);
                    FurnanceTemperatureThread mailThread = new FurnanceTemperatureThread(mailService, staffmgr, sysUser.getUserName(), mailMsg + "，");
                    Thread thread = new Thread(mailThread);
                    thread.start();
                }
            }
            // 检查数据是否包含负值或为Null
            String msg = this.isNegativeOrNull(tFurnanceTemperature);
            if ("".equals(msg)) {
                return AjaxResult.success(message, tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
            } else {
                return AjaxResult.error("提交失败，" + msg + "数据必须>=600，并且<=1300！");
            }
        } else {
            return toAjax(tFurnanceTemperatureService.updateTFurnanceTemperature(tFurnanceTemperature));
        }
    }

    public String checkTemperature10x(TFurnanceTemperature furnanceTemperature) {
        String msg = "";
        String pass1 = furnanceTemperature.getPass1();
        String pass2 = furnanceTemperature.getPass2();
        String pass3 = furnanceTemperature.getPass3();
        String pass4 = furnanceTemperature.getPass4();
        String pass5 = furnanceTemperature.getPass5();
        String pass6 = furnanceTemperature.getPass6();
        String pass7 = furnanceTemperature.getPass7();
        String pass8 = furnanceTemperature.getPass8();
        if (this.isGreaterThan1080(pass1)) {msg += "PASS1、";}
        if (this.isGreaterThan1080(pass2)) {msg += "PASS2、";}
        if (this.isGreaterThan1080(pass3)) {msg += "PASS3、";}
        if (this.isGreaterThan1080(pass4)) {msg += "PASS4、";}
        if (this.isGreaterThan1080(pass5)) {msg += "PASS5、";}
        if (this.isGreaterThan1080(pass6)) {msg += "PASS6、";}
        if (this.isGreaterThan1080(pass7)) {msg += "PASS7、";}
        if (this.isGreaterThan1080(pass8)) {msg += "PASS8、";}
        return msg;
    }
    public String checkTemperature109(TFurnanceTemperature furnanceTemperature) {
        String msg = "";
        String pass1 = furnanceTemperature.getPass1();
        String pass2 = furnanceTemperature.getPass2();
        String pass3 = furnanceTemperature.getPass3();
        String pass4 = furnanceTemperature.getPass4();
        String pass5 = furnanceTemperature.getPass5();
        String pass6 = furnanceTemperature.getPass6();
        String pass7 = furnanceTemperature.getPass7();
        String pass8 = furnanceTemperature.getPass8();
        String pass9 = furnanceTemperature.getPass9();
        String pass10 = furnanceTemperature.getPass10();
        String pass11 = furnanceTemperature.getPass11();
        String pass12 = furnanceTemperature.getPass12();
        String pass13 = furnanceTemperature.getPass13();
        String pass14 = furnanceTemperature.getPass14();
        String pass15 = furnanceTemperature.getPass15();
        String pass16 = furnanceTemperature.getPass16();
        if (this.isGreaterThan1080(pass1)) {msg += "PASS1出口左、";}
        if (this.isGreaterThan1080(pass2)) {msg += "PASS1出口右、";}
        if (this.isGreaterThan1080(pass3)) {msg += "PASS2出口左、";}
        if (this.isGreaterThan1080(pass4)) {msg += "PASS2出口右、";}
        if (this.isGreaterThan1080(pass5)) {msg += "PASS3出口左、";}
        if (this.isGreaterThan1080(pass6)) {msg += "PASS3出口右、";}
        if (this.isGreaterThan1080(pass7)) {msg += "PASS4出口左、";}
        if (this.isGreaterThan1080(pass8)) {msg += "PASS4出口右、";}
        if (this.isGreaterThan1080(pass9)) {msg += "PASS5出口左、";}
        if (this.isGreaterThan1080(pass10)) {msg += "PASS5出口右、";}
        if (this.isGreaterThan1080(pass11)) {msg += "PASS6出口左、";}
        if (this.isGreaterThan1080(pass12)) {msg += "PASS6出口右、";}
        if (this.isGreaterThan1080(pass13)) {msg += "PASS7出口左、";}
        if (this.isGreaterThan1080(pass14)) {msg += "PASS7出口右、";}
        if (this.isGreaterThan1080(pass15)) {msg += "PASS8出口左、";}
        if (this.isGreaterThan1080(pass16)) {msg += "PASS8出口右、";}
        return msg;
    }
    public String checkTemperature130(TFurnanceTemperature furnanceTemperature) {
        String msg = "";
        String pass1 = furnanceTemperature.getPass1();
        String pass2 = furnanceTemperature.getPass2();
        String pass3 = furnanceTemperature.getPass3();
        String pass4 = furnanceTemperature.getPass4();
        String pass5 = furnanceTemperature.getPass5();
        String pass6 = furnanceTemperature.getPass6();
        String pass7 = furnanceTemperature.getPass7();
        String pass8 = furnanceTemperature.getPass8();
        String pass9 = furnanceTemperature.getPass9();
        String pass10 = furnanceTemperature.getPass10();
        String pass11 = furnanceTemperature.getPass11();
        String pass12 = furnanceTemperature.getPass12();
        if (this.isGreaterThan1080(pass1)) {msg += "PASS1、";}
        if (this.isGreaterThan1080(pass2)) {msg += "PASS2、";}
        if (this.isGreaterThan1080(pass3)) {msg += "PASS3、";}
        if (this.isGreaterThan1080(pass4)) {msg += "PASS4、";}
        if (this.isGreaterThan1080(pass5)) {msg += "PASS5、";}
        if (this.isGreaterThan1080(pass6)) {msg += "PASS6、";}
        if (this.isGreaterThan1080(pass7)) {msg += "PASS7、";}
        if (this.isGreaterThan1080(pass8)) {msg += "PASS8、";}
        if (this.isGreaterThan1080(pass9)) {msg += "PASS9、";}
        if (this.isGreaterThan1080(pass10)) {msg += "PASS10、";}
        if (this.isGreaterThan1080(pass11)) {msg += "PASS11、";}
        if (this.isGreaterThan1080(pass12)) {msg += "PASS12、";}
        return msg;
    }

    public boolean isGreaterThan1080(String pass) {
        boolean flag = false;
        if (StringUtils.isNotNull(pass) && StringUtils.isNotEmpty(pass)) {
            String[] split = pass.split(",");
            for (int i = 0; i < split.length; i++) {
                if (!StringUtils.isNull(split[i]) && !StringUtils.isEmpty(split[i])) {
                    int element = Integer.parseInt(split[i]);
                    if (element >= 1080) {
                        flag = true;
                        break;
                    }
                }
            }
        }
        return flag;
    }

    public String isNegativeOrNull(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();
        if ("H109".equals(tFurnanceTemperature.getFurnanceName())) {
            if (this.isPassNegativeOrNull(pass1)) {
                return "PASS1";
            } else if (this.isPassNegativeOrNull(pass2)) {
                return "PASS2";
            } else if (this.isPassNegativeOrNull(pass3)) {
                return "PASS3";
            } else if (this.isPassNegativeOrNull(pass4)) {
                return "PASS4";
            } else if (this.isPassNegativeOrNull(pass5)) {
                return "PASS5";
            } else if (this.isPassNegativeOrNull(pass6)) {
                return "PASS6";
            } else if (this.isPassNegativeOrNull(pass7)) {
                return "PASS7";
            } else if (this.isPassNegativeOrNull(pass8)) {
                return "PASS8";
            } else if (this.isPassNegativeOrNull(pass9)) {
                return "PASS9";
            } else if (this.isPassNegativeOrNull(pass10)) {
                return "PASS10";
            } else if (this.isPassNegativeOrNull(pass11)) {
                return "PASS11";
            } else if (this.isPassNegativeOrNull(pass12)) {
                return "PASS12";
            } else if (this.isPassNegativeOrNull(pass13)) {
                return "PASS13";
            } else if (this.isPassNegativeOrNull(pass14)) {
                return "PASS14";
            } else if (this.isPassNegativeOrNull(pass15)) {
                return "PASS15";
            } else if (this.isPassNegativeOrNull(pass16)) {
                return "PASS16";
            } else {
                return "";
            }
        } else if ("H130".equals(tFurnanceTemperature.getFurnanceName())) {
            if (this.isPassNegativeOrNull(pass1)) {
                return "PASS1";
            } else if (this.isPassNegativeOrNull(pass2)) {
                return "PASS2";
            } else if (this.isPassNegativeOrNull(pass3)) {
                return "PASS3";
            } else if (this.isPassNegativeOrNull(pass4)) {
                return "PASS4";
            } else if (this.isPassNegativeOrNull(pass5)) {
                return "PASS5";
            } else if (this.isPassNegativeOrNull(pass6)) {
                return "PASS6";
            } else if (this.isPassNegativeOrNull(pass7)) {
                return "PASS7";
            } else if (this.isPassNegativeOrNull(pass8)) {
                return "PASS8";
            } else if (this.isPassNegativeOrNull(pass9)) {
                return "PASS9";
            } else if (this.isPassNegativeOrNull(pass10)) {
                return "PASS10";
            } else if (this.isPassNegativeOrNull(pass11)) {
                return "PASS11";
            } else if (this.isPassNegativeOrNull(pass12)) {
                return "PASS12";
            } else {
                return "";
            }
        } else {
            if (this.isPassNegativeOrNull(pass1)) {
                return "PASS1";
            } else if (this.isPassNegativeOrNull(pass2)) {
                return "PASS2";
            } else if (this.isPassNegativeOrNull(pass3)) {
                return "PASS3";
            } else if (this.isPassNegativeOrNull(pass4)) {
                return "PASS4";
            } else if (this.isPassNegativeOrNull(pass5)) {
                return "PASS5";
            } else if (this.isPassNegativeOrNull(pass6)) {
                return "PASS6";
            } else if (this.isPassNegativeOrNull(pass7)) {
                return "PASS7";
            } else if (this.isPassNegativeOrNull(pass8)) {
                return "PASS8";
            } else {
                return "";
            }
        }
    }

    public boolean isPassNegativeOrNull(String pass) {
        boolean flag = false;
        if (StringUtils.isNotNull(pass) && StringUtils.isNotEmpty(pass)) {
            String[] split = pass.split(",");
            for (int i = 0; i < split.length; i++) {
                if (StringUtils.isNull(split[i]) || StringUtils.isEmpty(split[i])) {
                    flag = true;
                    break;
                } else {
                    int element = Integer.parseInt(split[i]);
                    if (element <= 600 || element >= 1300) {
                        flag = true;
                        break;
                    }
                }
            }
            return flag;
        } else {
            return true;
        }
    }

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