package com.mvc.utils;

import com.mvc.entity.TAiread;
import com.mvc.model.TAicbqCfgModel;
import com.mvc.netty.dealconstant.MsgIdentifier;
import com.mvc.netty.dealconstant.TaskRemoteIdentifier;
import com.mvc.service.aiiden.UnitType;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

public class BeanUtil {

    /**
     * 填充数据
     *
     * @param rawdata
     * @param value
     * @param identifier
     */
    public static void fillTRawdata(TAiread rawdata, String value, MsgIdentifier identifier) {
        if (identifier == MsgIdentifier.FF01) {     // 水表累积水量
            if (rawdata.getDeviceType() != null && rawdata.getDeviceType().equals("2")) {
                //处理压力表的负值 2022-09-13 guozhao
                BigDecimal temp = new BigDecimal(value.substring(2));
                temp = Integer.valueOf(value.substring(0, 2)) == 1 ? temp : temp.multiply(new BigDecimal(-1));
                rawdata.setIdentValue(temp);
            } else {
                rawdata.setIdentValue(new BigDecimal(value));
            }
            rawdata.setResultValue(rawdata.getIdentValue());
        } else if (identifier == MsgIdentifier.FF03) {  //图片高
            rawdata.setPicHeigth(handleInt(value));
        } else if (identifier == MsgIdentifier.FF04) {  //图片宽
            rawdata.setPicWidth(handleInt(value));
        } else if (identifier == MsgIdentifier.I_38) {  //电源电压
            rawdata.setVoltage(handleDecimal(value));
        } else if (identifier == MsgIdentifier.FF10) {  //温度
            rawdata.setTemperature(handleDecimal(value));
        } else if (identifier == MsgIdentifier.FF11) {  //电量
            rawdata.setSocRate(handleDecimal(value));
        } else if (identifier == MsgIdentifier.FF12) {  //运行次数
            rawdata.setMcuRunNum(handleInt(value));
        } else if (identifier == MsgIdentifier.FF13) {  //运行时间
            rawdata.setBatRumTime(handleInt(value));
        } else if (identifier == MsgIdentifier.FF14) {  //信号质量
            rawdata.setRsrp(handleInt(value));
        } else if (identifier == MsgIdentifier.FF15) {  //错误码
            rawdata.setErrorCode(value);
        } else if (identifier == MsgIdentifier.FF16) {  //软件版本
            rawdata.setSoftVer(value);
        } else if (identifier == MsgIdentifier.FF17) {  //通讯卡号
            rawdata.setCcid(value);
        } else if (identifier == MsgIdentifier.FF18) {  //信噪比
            rawdata.setSnr(handleInt(value));
        } else if (identifier == MsgIdentifier.FF19) {  //主板编号
            rawdata.setHardwareCode(value);
        } else if (identifier == MsgIdentifier.FF07) {//原始值
            rawdata.setRawValue(handleDecimal(value));
        } else if (identifier == MsgIdentifier.FF21) {//原始值
            rawdata.setRawValue(handleDecimal(value));
        } else if (identifier == MsgIdentifier.FF22) {   //调试信息
            if (value != null) {
                String[] split = value.split("-");
                int index = -1;
                if (split[0] != null) {
                    int i = split[0].indexOf(",88");
                    index = i;
                    if (i > 0) {
                        rawdata.setSzsbz(split[0].substring(0, i) + (split[0].substring(i).replace("88", "-")));
                    } else {
                        rawdata.setSzsbz(split[0]);
                    }
                }
                if (split[1] != null) {
                    index = split[1].indexOf(",88");
                    if (index > 0) {
                        rawdata.setSzsbgl(split[1].substring(0, index) + (split[1].substring(index).replace("88", "-")));
                    } else {
                        rawdata.setSzsbgl(split[1]);
                    }
                }

            }
        } else if (identifier == MsgIdentifier.FF08) {//设备sn
            rawdata.setDeviceSn(value);
        } else if (identifier == MsgIdentifier.FF09) {//硬件版本号
            rawdata.setHardVersion(value);
        } else if (identifier == MsgIdentifier.FF23) {//nb硬件版本号
            rawdata.setNbVersion(value);
        } else if (identifier == MsgIdentifier.FF26) {//AI软件版本号
            rawdata.setAiVersion(value);
        } else if (identifier == MsgIdentifier.FF27) {//IP1发送状态
            rawdata.setIp1SendStatus(Integer.valueOf(value));
        } else if (identifier == MsgIdentifier.FF36) {//NB网络注册时的位置信息
            if (StringUtils.isNotEmpty(value) && value.length() > 2) {//
                value = value.substring(0, 4) + "-" + value.substring(4);  //-号连接(区位码2-小区ID4)
            }
            rawdata.setNbRegLocation(value.toUpperCase());
        } else if (identifier == MsgIdentifier.FF37) {//原图(未分片段前图片)区域坐标信息
            rawdata.setImageCoordinateInfo(value);
        } else if (identifier == MsgIdentifier.FF38) {//IMEI(15位,去除前面的0)
            rawdata.setImei(value.length() > 15 ? value.substring(1) : value);
        } else if (identifier == MsgIdentifier.FF39) {//CSQ
            rawdata.setCsq(Integer.valueOf(value));
        } else if (identifier == MsgIdentifier.FF41) {//ELC
            rawdata.setEcl(Integer.valueOf(value));
        } else if (identifier == MsgIdentifier.FF42) {//矩阵网关下的子设备的BDA
            //预留,不存储 2024-04-26 guozhao
        } else if (identifier == MsgIdentifier.FF43) {//通讯模块类型
            rawdata.setCommunicationModuleType(Integer.valueOf(value));
        } else if (identifier == MsgIdentifier.FF44) {//尾数单位精度等级
            //传输的值是UnitType的Key,并不是具体的小数点位数,此处转换为小数点个数
            UnitType unitType = UnitType.getElement(value);
            if (unitType != null) {
                int decimalDigits = unitType.getKey();
                decimalDigits = decimalDigits < 4 ? 4 - decimalDigits : 0;
                rawdata.setDecimalDigits(decimalDigits);
            }
        } else if (identifier == MsgIdentifier.FF45) {
            rawdata.setOperationStatus(Integer.valueOf(value).toString());
        } else if (identifier == MsgIdentifier.FF46) {
            rawdata.setDeviceReportCode(Integer.valueOf(value).toString());
        }
    }

    private static BigDecimal handleDecimal(String value) {
        if (value == null) {
            return null;
        }
        return new BigDecimal(value);
    }

    private static Integer handleInt(String value) {
        if (value == null) {
            return null;
        }
        return Integer.valueOf(value);
    }

    //填充数据，设备参数
    public static TAicbqCfgModel fillTAicbqCfg(TAicbqCfgModel tAicbqCfgModel, String value, TaskRemoteIdentifier identifier) {
        if (identifier == TaskRemoteIdentifier.EE02) {     // 遥测站地址
            tAicbqCfgModel.setStationCode(value);
        } else if (identifier == TaskRemoteIdentifier.EE04) {//iP1port1
            String ipport = value;
            int p1 = Integer.valueOf(ipport.substring(2, 5));
            int p2 = Integer.valueOf(ipport.substring(5, 8));
            int p3 = Integer.valueOf(ipport.substring(8, 11));
            int p4 = Integer.valueOf(ipport.substring(11, 14));
            int p5 = Integer.valueOf(ipport.substring(14, 20));
            tAicbqCfgModel.setServerIp1(p1 + "." + p2 + "." + p3 + "." + p4);
            tAicbqCfgModel.setServerPort1(p5);
        } else if (identifier == TaskRemoteIdentifier.EE06) {//iP2port2
            String ipport = value;
            int p1 = Integer.valueOf(ipport.substring(2, 5));
            int p2 = Integer.valueOf(ipport.substring(5, 8));
            int p3 = Integer.valueOf(ipport.substring(8, 11));
            int p4 = Integer.valueOf(ipport.substring(11, 14));
            int p5 = Integer.valueOf(ipport.substring(14, 20));
            tAicbqCfgModel.setServerIp2(p1 + "." + p2 + "." + p3 + "." + p4);
            tAicbqCfgModel.setServerPort2(p5);
        } else if (identifier == TaskRemoteIdentifier.EE08) {//iP3port3
            String ipport = value;
            int p1 = Integer.valueOf(ipport.substring(2, 5));
            int p2 = Integer.valueOf(ipport.substring(5, 8));
            int p3 = Integer.valueOf(ipport.substring(8, 11));
            int p4 = Integer.valueOf(ipport.substring(11, 14));
            int p5 = Integer.valueOf(ipport.substring(14, 20));
            tAicbqCfgModel.setServerIp3(p1 + "." + p2 + "." + p3 + "." + p4);
            tAicbqCfgModel.setServerPort3(p5);
        } else if (identifier == TaskRemoteIdentifier.EE0A) {//iP4port4
            String ipport = value;
            int p1 = Integer.valueOf(ipport.substring(2, 5));
            int p2 = Integer.valueOf(ipport.substring(5, 8));
            int p3 = Integer.valueOf(ipport.substring(8, 11));
            int p4 = Integer.valueOf(ipport.substring(11, 14));
            int p5 = Integer.valueOf(ipport.substring(14, 20));
            tAicbqCfgModel.setServerIp4(p1 + "." + p2 + "." + p3 + "." + p4);
            tAicbqCfgModel.setServerPort4(p5);
        } else if (identifier == TaskRemoteIdentifier.EE10) {//水表类型
            tAicbqCfgModel.setDnType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE11) {//数字轮子个数
            int num = Integer.valueOf(value, 16);
            int wheelnum = num & 0xF;
            int dignum = num >> 4 & 0xF;
            tAicbqCfgModel.setWheelNum(wheelnum);
            tAicbqCfgModel.setDigitNum(dignum);
        } else if (identifier == TaskRemoteIdentifier.EE12) {  //水表最后一位单位类型
            tAicbqCfgModel.setUnitType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE13) {  //水表安装方向
            tAicbqCfgModel.setSetupDir(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EE14) {  //采样时间间隔
            tAicbqCfgModel.setSampleInterval(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE15) {  //上传服务器时间间隔
            tAicbqCfgModel.setUpInterval(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE16) {  //低温采样时间间隔
            tAicbqCfgModel.setLtSampleInterval(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE17) {  //最低工作温度
            if (Integer.valueOf(value.substring(0, 2)) == 1) {//1正数 0负数
                tAicbqCfgModel.setWorkLt(Integer.valueOf(value.substring(2)));
            } else {
                tAicbqCfgModel.setWorkLt(Integer.valueOf(value.substring(2)).intValue() * -1);
            }
        } else if (identifier == TaskRemoteIdentifier.EE18) {  //安装年份
            tAicbqCfgModel.setSetupYear(value);
        } else if (identifier == TaskRemoteIdentifier.EE19) {//入网超时
            tAicbqCfgModel.setNetworkRegTimeout(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE1A) {//电池报警电量
            tAicbqCfgModel.setBatAlarmSoc(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE1B) {  //强拉回概率值
            tAicbqCfgModel.setAiPullBack(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE1C) {//识别概率阀值
            tAicbqCfgModel.setAiPass(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE1D) {//位概率阀值
            tAicbqCfgModel.setAiSinglePass(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE1E) {//最高工作温度
            if (Integer.valueOf(value.substring(0, 2)) == 1) {//1正数 0负数
                tAicbqCfgModel.setWorkHt(Integer.valueOf(value.substring(2)));
            } else {
                tAicbqCfgModel.setWorkHt(Integer.valueOf(value.substring(2)) * -1);
            }
        } else if (identifier == TaskRemoteIdentifier.EE1F) {//电压报警值
            tAicbqCfgModel.setBatAlarmVt(new BigDecimal(value));
        } else if (identifier == TaskRemoteIdentifier.EEB1) {//CPU版本号
            tAicbqCfgModel.setCpuVersion(value);
        } else if (identifier == TaskRemoteIdentifier.EEB2) {//通讯版本号
            tAicbqCfgModel.setTongxunVersion(value);
        } else if (identifier == TaskRemoteIdentifier.EEB3) {//天线类型
            tAicbqCfgModel.setTianxianType(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEB4) {//背光频率
            tAicbqCfgModel.setPwmHz(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEB5) {//占空比
            tAicbqCfgModel.setPwmDuty(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEB6) {//灯光亮度范围
            tAicbqCfgModel.setFlashBrightMax(Integer.valueOf(value.substring(4)));
            tAicbqCfgModel.setFlashBrightMin(Integer.valueOf(value.substring(0, 4)));
        } else if (identifier == TaskRemoteIdentifier.EEB7) {//通讯方式
            tAicbqCfgModel.setTongxunWay(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEBA) {//水表读数
            tAicbqCfgModel.setLastVal(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEBB) {//正图报周规则
            String guize = "0000000" + NumberUtil.hexStringToBinaryString(value);
            guize = guize.substring(guize.length() - 7);
            tAicbqCfgModel.setUpWholeImgWeek1(guize.substring(0, 1));
            tAicbqCfgModel.setUpWholeImgWeek2(guize.substring(1, 2));
            tAicbqCfgModel.setUpWholeImgWeek3(guize.substring(2, 3));
            tAicbqCfgModel.setUpWholeImgWeek4(guize.substring(3, 4));
            tAicbqCfgModel.setUpWholeImgWeek5(guize.substring(4, 5));
            tAicbqCfgModel.setUpWholeImgWeek6(guize.substring(5, 6));
            tAicbqCfgModel.setUpWholeImgWeek7(guize.substring(6, 7));
        } else if (identifier == TaskRemoteIdentifier.EEBC) {//紧急域名
            String domain = value.substring(0, 56);
            String port = value.substring(56);
            byte[] bytes = NumberUtil.hexStringToBytes(domain);
            tAicbqCfgModel.setDomainName(StringUtil.getStringByBytes(bytes));
            tAicbqCfgModel.setDomainPort(Integer.valueOf(port, 16));
        } else if (identifier == TaskRemoteIdentifier.EEBD) {//输出串口日志
            tAicbqCfgModel.setIsprintcomlog(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEBE) {//WDT计数清零
            tAicbqCfgModel.setIsresetwdt(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEC1) {//量程下限
            BigDecimal temp = new BigDecimal(value.substring(2));
            temp = Integer.valueOf(value.substring(0, 2)) == 1 ? temp : temp.multiply(new BigDecimal(-1));
            tAicbqCfgModel.setPgRangeMin(temp);
        } else if (identifier == TaskRemoteIdentifier.EEC2) {//量程上限
            BigDecimal temp = new BigDecimal(value.substring(2));
            temp = Integer.valueOf(value.substring(0, 2)) == 1 ? temp : temp.multiply(new BigDecimal(-1));
            tAicbqCfgModel.setPgRangeMax(temp);
        } else if (identifier == TaskRemoteIdentifier.EEC3) {//数据精度
            tAicbqCfgModel.setPgPrecisionType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEC4) {//校正参数
            BigDecimal temp = new BigDecimal(value.substring(2));
            temp = Integer.valueOf(value.substring(0, 2)) == 1 ? temp : temp.multiply(new BigDecimal(-1));
            tAicbqCfgModel.setPgCorrectvalue(temp);
        } else if (identifier == TaskRemoteIdentifier.EEC5) {//坐标点赋值
            tAicbqCfgModel.setPgManualConfig(value);
        } else if (identifier == TaskRemoteIdentifier.EEC6) {//图片是否描点
            tAicbqCfgModel.setPgIsDebug(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEC7) {//目标区域历史数据初始化
            tAicbqCfgModel.setPgInitTargetRegion(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEB8) {//电池次数清零
            tAicbqCfgModel.setIsresetbat(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEB9) {//硬件次数清零
            tAicbqCfgModel.setIsrestmcu(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EED1) {//手动触发大图开关
            tAicbqCfgModel.setWiTaskManwakeupFlag(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EED2) {//月初月底上传大图开关
            tAicbqCfgModel.setWiTaskMonthFlag(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EED3) {//大图定时上传规则
            tAicbqCfgModel.setWiTaskSpecdateFlag(value);
        } else if (identifier == TaskRemoteIdentifier.EEBF) {//日志上传规则
            tAicbqCfgModel.setLogUploadRules(value);
        } else if (identifier == TaskRemoteIdentifier.EED4) {//是否上传上一次MCU通讯错误的日志
            tAicbqCfgModel.setUploadLastFailLogFlag(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EED5) {//手动触发发送本次工作日志
            tAicbqCfgModel.setLogTaskManwakeupFlag(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEC8) {//压力表人工配置坐标点的优先级
            tAicbqCfgModel.setPgManualConfigLevel(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEDA) {//图片类型
            tAicbqCfgModel.setImageType(Integer.valueOf(value).intValue());
        } else if (identifier == TaskRemoteIdentifier.EEDB) {//图片像素外扩
            tAicbqCfgModel.setImageMargin(Integer.valueOf(value).intValue());
        } else if (identifier == TaskRemoteIdentifier.EEDC) {//人工配置坐标和角度
            tAicbqCfgModel.setImageConfig(value);
        } else if (identifier == TaskRemoteIdentifier.EEDD) {//上传模型输出结果
            tAicbqCfgModel.setUploadCnnFlag(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EEDE) {//NMS阈值
            tAicbqCfgModel.setNmsThreshold(Integer.valueOf(value).intValue());
        } else if (identifier == TaskRemoteIdentifier.EEDF) {//检测到的大框来排除野数字
            tAicbqCfgModel.setIsUseDetectedNum(StringUtil.formatConfigFlag(value));
        } else if (identifier == TaskRemoteIdentifier.EE71) {//指定坐标区域上报的图片类型
            tAicbqCfgModel.setRegionImageType(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EE72) {//上报的JPG的压缩类型
            tAicbqCfgModel.setJpgCompressType(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EE80) {//RS485使能开关
            tAicbqCfgModel.setRsPortEnable(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EE81) {//RS485波特率
            tAicbqCfgModel.setRsBandRate(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE82) {//模块ID号
            tAicbqCfgModel.setModuleId(value);
        } else if (identifier == TaskRemoteIdentifier.EE83) {//模块名称
            tAicbqCfgModel.setModuleName(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EE84) {//RS485校验类型
            tAicbqCfgModel.setRsChecksumType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE85) {//RS485停止位
            tAicbqCfgModel.setRsStopbitType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA0) {//AI识别需要的图片亮度设置值
            tAicbqCfgModel.setImageBrightness(Double.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA1) {//摄像头拍照时的合成类型
            tAicbqCfgModel.setImageSynthesisType(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA2) {//日首次采样时间
            tAicbqCfgModel.setFirsttxntimeDaily(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA3) {//上传图片的大小
            tAicbqCfgModel.setUploadImageSize(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA4) {//AI输出测试(标注)图开关
            tAicbqCfgModel.setEnableAiImageProcess(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEA5) {//是否使用人工配置的参数用于AI识别过程
            tAicbqCfgModel.setEnableNoconfigManualConfig(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEA6) {//禁用AI识别
            tAicbqCfgModel.setDisableAiRecognition(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEA7) {//最大离散时长范围
            tAicbqCfgModel.setMaxDiscreteDuration(Integer.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEA8) {//启用离散标志
            tAicbqCfgModel.setEnableDiscrete(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEA9) {//启用智慧院平台
            tAicbqCfgModel.setEnableSendBjzhy(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEAA) {//启用北京自来水平台
            tAicbqCfgModel.setEnableSendBjzls(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEF0) {//水表地址
            tAicbqCfgModel.setBjzlsMeterAddress(value);
        } else if (identifier == TaskRemoteIdentifier.EEF1) {//启用AES加密
            tAicbqCfgModel.setBjzlsEnableAes(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEFA) {//恢复数据
            tAicbqCfgModel.setIsResetData(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEAB) {//是否上传红色指针部分
            tAicbqCfgModel.setIsUploadRedPointer(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEF2) {//北京自来水平台密钥类型
            tAicbqCfgModel.setBjzlsSecretKeyType(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEAC) {//人工配置角度
            if (Integer.valueOf(value.substring(0, 2)) == 1) {//1正数 0负数
                tAicbqCfgModel.setNoconfigSetupAngle(Integer.valueOf(value.substring(2)));
            } else {
                tAicbqCfgModel.setNoconfigSetupAngle(Integer.parseInt(value.substring(2)) * -1);
            }
        } else if (identifier == TaskRemoteIdentifier.EEAD) {//数字位置
            tAicbqCfgModel.setDigitalPosition(Integer.valueOf(value).intValue() + "");
        } else if (identifier == TaskRemoteIdentifier.EEAE) {//数字表放大倍率
            tAicbqCfgModel.setAiDigitalZoomFactor(Float.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EEAF) {//指针表放大倍率
            tAicbqCfgModel.setAiPointerZoomFactor(Float.valueOf(value));
        } else if (identifier == TaskRemoteIdentifier.EE90) {//投运类型
            tAicbqCfgModel.setOperationStatus(Integer.valueOf(value).toString());
        } else if (identifier == TaskRemoteIdentifier.EE91) {//表盘类型
            tAicbqCfgModel.setDialType(Integer.valueOf(value).toString());
        } else if (identifier == TaskRemoteIdentifier.EE92) {//表盘区域坐标
            tAicbqCfgModel.setDialAreaCoordinates(StringUtil.reverseConvertCoordinateString(value));
        } else if (identifier == TaskRemoteIdentifier.EE93) {//数字区域坐标
            tAicbqCfgModel.setDigitAreaCoordinates(StringUtil.reverseConvertCoordinateString(value));
        } else if (identifier == TaskRemoteIdentifier.EE94) {//首尾指针坐标
            tAicbqCfgModel.setStartEndPointerCoordinates(StringUtil.reverseConvertCoordinateString(value));
        } else if (identifier == TaskRemoteIdentifier.EE95) {//表底读数+相应时间
            tAicbqCfgModel.setLastVal(Integer.valueOf(value.substring(0, 10)));
            tAicbqCfgModel.setLastValTime(DateUtil.parseTimeStr(value.substring(10), "yyMMddHHmm"));
        }

        return tAicbqCfgModel;
    }
}
