Sfoglia il codice sorgente

1.出差期间现场调试

Administrator 1 anno fa
parent
commit
29bacd8975

+ 30 - 0
neim-biz/src/main/java/com/jiayue/biz/api/apiHDY.java

@@ -4,12 +4,21 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.crypto.digest.HMac;
 import cn.hutool.crypto.digest.HmacAlgorithm;
 import cn.hutool.http.HttpUtil;
+import com.jiayue.biz.domain.ProphaseAnemometryData;
+import com.jiayue.biz.util.CalculationUtil;
+import com.jiayue.common.utils.DateUtil;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.sql.Timestamp;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
 @Component
+@Slf4j
 public class apiHDY {
 
 //    private static final String KEY = "dcforitilapi321";
@@ -26,8 +35,29 @@ public class apiHDY {
         //拼接签名元数据
         multiValueMap.put("sign", mac.digestHex(StrUtil.builder(time).toString()));
         String resultStr = HttpUtil.get(DC_GET_ACCURACY_COMPARE, multiValueMap);
+
         return resultStr;
     }
 
 
+    public static void main1(String[] args) {
+        String time = "20230913";
+        Map<String, Object> multiValueMap = new HashMap<>();
+        multiValueMap.put("rq", time);
+        //签名密钥
+//        byte[] key = KEY.getBytes();
+        // TODO 此处有问题,执行卡顿3分钟
+        HMac mac = new HMac(HmacAlgorithm.HmacMD5);
+        //拼接签名元数据
+        multiValueMap.put("sign", mac.digestHex(StrUtil.builder(time).toString()));
+        String resultStr = HttpUtil.get(DC_GET_ACCURACY_COMPARE, multiValueMap);
+        System.out.printf(resultStr);
+    }
+
+
+    public static void main(String[] args) {
+        BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(new BigDecimal(19.02)), 2, RoundingMode.HALF_UP)).multiply(new BigDecimal(948)).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
+
+        System.out.printf(airDensity+"");
+    }
 }

+ 1 - 1
neim-biz/src/main/java/com/jiayue/biz/domain/FanJsonInfo.java

@@ -5,7 +5,7 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 
 /**
- *     fdl 发电量
+ *     fdl 发电量 日均
  *     fd1 发电量1期  ...
  *     ZFX 主风向 天气
  *     pjfs 风速 日照强度  平均

File diff suppressed because it is too large
+ 1 - 2
neim-biz/src/main/java/com/jiayue/biz/job/AirDensityJob.java


+ 91 - 80
neim-biz/src/main/java/com/jiayue/biz/job/ModbusReciveJob.java

@@ -1,6 +1,7 @@
 package com.jiayue.biz.job;
 
 import cn.hutool.core.thread.ThreadFactoryBuilder;
+import cn.hutool.json.JSONUtil;
 import com.jiayue.biz.domain.PointAttribute;
 import com.jiayue.biz.domain.TunnelInfo;
 import com.jiayue.biz.domain.WindTowerInfo;
@@ -90,100 +91,110 @@ public class ModbusReciveJob {
 
     public void tunnel() {
         List<TunnelInfo> tunnelInfoList = tunnelInfoService.list();
+        log.info("接入tunnelInfoList通道:{}", JSONUtil.parse(tunnelInfoList));
         List<PointAttribute> attributeList = pointAttributeService.list();
-        String time = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm");
+        String time = DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:00");
+        log.info("接入modbus时间:{}",time);
         //TODO 现场测试筛选数据是否能正常入库
 //        List<HashMap<String, Object>> mapList = new ArrayList<>();
         for (Map.Entry<String, ModbusTcpMasterBuilder> masterBuilderEntry : masterMap.entrySet()) {
-            //获取通道map中的key
-            String stationId = masterBuilderEntry.getKey();
-            //风速层高
-            HashSet<Integer> wsHeightSet = new HashSet<>();
-            //风向层高
-            HashSet<Integer> wdHeightSet = new HashSet<>();
-            //根据通道key获取ip端口号等数据
-            List<TunnelInfo> tunnelist = tunnelInfoList.stream().filter(t -> t.getStationId().equals(stationId)).collect(Collectors.toList());
-            TunnelInfo tunnelInfo;
-            if (!tunnelist.isEmpty()) {
-                tunnelInfo = tunnelist.get(0);
-            } else {
-                //如果此通道不存在 关闭通道
-                this.stop(stationId);
-                continue;
-            }
-            //根据通道key获取点表数据
-            List<PointAttribute> pointAttributeList = attributeList.stream().filter(a -> a.getStationId().equals(stationId)).collect(Collectors.toList());
-            //拿到所有点位
-            List<Integer> points = pointAttributeList.stream().map(PointAttribute::getPoint).collect(Collectors.toList());
-            Map<Integer, ModbusDataTypeEnum> pointTypeMap = new HashMap<>();
-            for (Integer point : points) {
-                //点位以及点位类型存入map
-                pointTypeMap.put(point, ModbusDataTypeEnum.valueOf(tunnelInfo.getDataFormat()));
-            }
-
-            //获取连接
-            ModbusTcpMasterBuilder master = masterBuilderEntry.getValue();
-            //获取点位信息map
-            Map<String, Integer> stringStringBuilderMap = savePoints(pointAttributeList, wsHeightSet, wdHeightSet);
-            WindTowerInfo windTowerInfo = new WindTowerInfo();
-            //判断是否存在此塔
-            boolean emptyOfEntity = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, tunnelInfo.getEquipmentNo()).list().isEmpty();
-            if (emptyOfEntity) {
-                StringBuilder wsHeightStr = new StringBuilder();
-                for (Integer height : wsHeightSet) {
-                    wsHeightStr = wsHeightStr.append(height + ",");
+            try {
+                //获取通道map中的key
+                String stationId = masterBuilderEntry.getKey();
+                //风速层高
+                HashSet<Integer> wsHeightSet = new HashSet<>();
+                //风向层高
+                HashSet<Integer> wdHeightSet = new HashSet<>();
+                //根据通道key获取ip端口号等数据
+                List<TunnelInfo> tunnelist = tunnelInfoList.stream().filter(t -> t.getStationId().equals(stationId)).collect(Collectors.toList());
+                TunnelInfo tunnelInfo;
+                if (!tunnelist.isEmpty()) {
+                    tunnelInfo = tunnelist.get(0);
+                } else {
+                    //如果此通道不存在 关闭通道
+                    this.stop(stationId);
+                    continue;
                 }
-                String wsHeight = null;
-                if (wsHeightStr.length() > 0) {
-                    wsHeight = wsHeightStr.substring(0, wsHeightStr.length() - 1);
+                //根据通道key获取点表数据
+                List<PointAttribute> pointAttributeList = attributeList.stream().filter(a -> a.getStationId().equals(stationId)).collect(Collectors.toList());
+                //拿到所有点位
+                List<Integer> points = pointAttributeList.stream().map(PointAttribute::getPoint).collect(Collectors.toList());
+                Map<Integer, ModbusDataTypeEnum> pointTypeMap = new HashMap<>();
+                for (Integer point : points) {
+                    //点位以及点位类型存入map
+                    pointTypeMap.put(point, ModbusDataTypeEnum.valueOf(tunnelInfo.getDataFormat()));
                 }
 
-                StringBuilder wdHeightStr = new StringBuilder();
-                for (Integer height : wsHeightSet) {
-                    wdHeightStr = wdHeightStr.append(height + ",");
-                }
-                String wdHeight = null;
-                if (wdHeightStr.length() > 0) {
-                    wdHeight = wdHeightStr.substring(0, wdHeightStr.length() - 1);
+                //获取连接
+                ModbusTcpMasterBuilder master = masterBuilderEntry.getValue();
+                //获取点位信息map
+                Map<String, Integer> stringStringBuilderMap = savePoints(pointAttributeList, wsHeightSet, wdHeightSet);
+                WindTowerInfo windTowerInfo = new WindTowerInfo();
+                //判断是否存在此塔
+                boolean emptyOfEntity = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getEquipmentNo, tunnelInfo.getEquipmentNo()).list().isEmpty();
+                log.info("处理塔{} 存在:{}", tunnelInfo.getEquipmentNo(), emptyOfEntity);
+                if (emptyOfEntity) {
+
+                    StringBuilder wsHeightStr = new StringBuilder();
+                    for (Integer height : wsHeightSet) {
+                        wsHeightStr = wsHeightStr.append(height + ",");
+                    }
+                    String wsHeight = null;
+                    if (wsHeightStr.length() > 0) {
+                        wsHeight = wsHeightStr.substring(0, wsHeightStr.length() - 1);
+                    }
+
+                    StringBuilder wdHeightStr = new StringBuilder();
+                    for (Integer height : wsHeightSet) {
+                        wdHeightStr = wdHeightStr.append(height + ",");
+                    }
+                    String wdHeight = null;
+                    if (wdHeightStr.length() > 0) {
+                        wdHeight = wdHeightStr.substring(0, wdHeightStr.length() - 1);
+                    }
+                    //存储测风塔信息
+                    windTowerInfo.setEquipmentNo(tunnelist.get(0).getEquipmentNo());
+                    windTowerInfo.setName(tunnelist.get(0).getStationId());
+                    windTowerInfo.setHeights(wsHeight);
+                    windTowerInfo.setWdHeights(wdHeight);
+                    windTowerInfo.setType("station");
+                    log.info("处理数据入库结果:{}", JSONUtil.parse(windTowerInfo));
+                    windTowerInfoService.save(windTowerInfo);
                 }
-                //存储测风塔信息
-                windTowerInfo.setEquipmentNo(tunnelist.get(0).getEquipmentNo());
-                windTowerInfo.setName(tunnelist.get(0).getStationId());
-                windTowerInfo.setHeights(wsHeight);
-                windTowerInfo.setWdHeights(wdHeight);
-                windTowerInfo.setType("station");
-                windTowerInfoService.save(windTowerInfo);
-            }
-            // 例如: key:wsAve val:数据
-            HashMap<String, BigDecimal> pointMap = new HashMap<>();
-            //分解成Obj4RequestCoil
-            List<Obj4RequestRegister> obj4RequestRegisters = null;
-            try {
-                obj4RequestRegisters = ModbusRequestDataUtils.splitModbusRequest(pointTypeMap, 1, FunctionCode.READ_HOLDING_REGISTERS);
-                for (Obj4RequestRegister obj4RequestRegister : obj4RequestRegisters) {
-                    Map<Integer, IModbusDataType> registerData = ModbusRequestDataUtils.getRegisterData(master, obj4RequestRegister);
-                    if(!registerData.isEmpty()){
-                        for (Map.Entry<Integer, IModbusDataType> typeEntry : registerData.entrySet()) {
-                            for (Map.Entry<String, Integer> entry : stringStringBuilderMap.entrySet()) {
-                                if (typeEntry.getKey().equals(entry.getValue())) {
-                                    log.info("点位:{}-----数值:{}",typeEntry.getKey(),((NumericModbusData) typeEntry.getValue()).getValue());
-                                    //点位一致 置换value
-                                    pointMap.put(entry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
+                // 例如: key:wsAve val:数据
+                HashMap<String, BigDecimal> pointMap = new HashMap<>();
+                //分解成Obj4RequestCoil
+                List<Obj4RequestRegister> obj4RequestRegisters = null;
+                try {
+                    obj4RequestRegisters = ModbusRequestDataUtils.splitModbusRequest(pointTypeMap, 1, FunctionCode.READ_HOLDING_REGISTERS);
+                    for (Obj4RequestRegister obj4RequestRegister : obj4RequestRegisters) {
+                        Map<Integer, IModbusDataType> registerData = ModbusRequestDataUtils.getRegisterData(master, obj4RequestRegister);
+                        if (!registerData.isEmpty()) {
+                            for (Map.Entry<Integer, IModbusDataType> typeEntry : registerData.entrySet()) {
+                                for (Map.Entry<String, Integer> entry : stringStringBuilderMap.entrySet()) {
+                                    if (typeEntry.getKey().equals(entry.getValue())) {
+                                        log.info("点位:{}-----数值:{}", typeEntry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
+                                        //点位一致 置换value
+                                        pointMap.put(entry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
+                                    }
                                 }
                             }
                         }
-                    }
 
+                    }
+                } catch (ModbusException e) {
+                    log.info(e.getMsg());
+                    throw new RuntimeException(e);
                 }
-            } catch (ModbusException e) {
-                log.info(e.getMsg());
-                throw new RuntimeException(e);
-            }
-            wsHeightSet.addAll(wdHeightSet);
+                wsHeightSet.addAll(wdHeightSet);
 
-            List<Map<String, Object>> mapList = new CheckDataRecode().checkValue((List<Map<String, Object>>) pointMap, "station");
+                //List<Map<String, Object>> mapList = new CheckDataRecode().checkValue((List<Map<String, Object>>) pointMap, "station");
 
-            windTowerDataParentTableService.saveDataForTunnel(pointMap, wsHeightSet,tunnelInfo.getEquipmentNo(),time);
+                //log.info("校验前数据:{} ;;; 校验后数据:{}",JSONUtil.parse(pointMap),JSONUtil.parse(mapList));
+                windTowerDataParentTableService.saveDataForTunnel(pointMap, wsHeightSet, tunnelInfo.getEquipmentNo(), time);
+            }catch (Exception e){
+                log.error("modbus 接入测风塔:{} 的数据错误:{}",masterBuilderEntry.getKey() ,e);
+            }
         }
 
     }
@@ -273,7 +284,7 @@ public class ModbusReciveJob {
             typeStr = "Max";
         } else if (str.contains("最小值")) {
             typeStr = "Min";
-        } else if (str.contains("瞬时")) {
+        } else if (str.contains("瞬时") ||str.contains("实时")) {
             typeStr = "Inst";
         } else if (str.contains("极大")) {
             typeStr = "Great";

+ 0 - 1
neim-biz/src/main/java/com/jiayue/biz/service/ProphaseAnemometryDataOrgService.java

@@ -1,6 +1,5 @@
 package com.jiayue.biz.service;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jiayue.biz.domain.ProphaseAnemometryData;
 import com.jiayue.biz.domain.ProphaseAnemometryDataOrg;

+ 0 - 1
neim-biz/src/main/java/com/jiayue/biz/service/impl/ProphaseAnemometryDataOrgServiceImpl.java

@@ -1,6 +1,5 @@
 package com.jiayue.biz.service.impl;
 
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jiayue.biz.domain.ProphaseAnemometryData;
 import com.jiayue.biz.domain.ProphaseAnemometryDataOrg;

+ 3 - 2
neim-biz/src/main/java/com/jiayue/biz/service/impl/ProphaseWeatherDataServiceImpl.java

@@ -7,6 +7,7 @@ import com.jiayue.biz.domain.StatisticsSituation;
 import com.jiayue.biz.mapper.ProphaseWeatherDataMapper;
 import com.jiayue.biz.service.ProphaseWeatherDataService;
 import com.jiayue.biz.service.StatisticsSituationService;
+import com.jiayue.common.core.text.Convert;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.annotations.Param;
@@ -53,7 +54,7 @@ public class ProphaseWeatherDataServiceImpl extends ServiceImpl<ProphaseWeatherD
                 hashMap.put("endTime", Long.parseLong(timeArr[1]));
             }
 //            e.printStackTrace();
-            log.error("{}此测风塔没有表",equipmentNo);
+            log.error("{} 此测风塔没有表",equipmentNo);
         }
 
         return hashMap;
@@ -78,7 +79,7 @@ public class ProphaseWeatherDataServiceImpl extends ServiceImpl<ProphaseWeatherD
     //查询空气密度
     public List<ProphaseWeatherData> selectAir(String equipmentId, Timestamp startTime, Timestamp endTime) {
         List<ProphaseWeatherData> weatherDataList = baseMapper.selectAir(equipmentId, startTime, endTime);
-        return weatherDataList.stream().filter(w -> w.getAirDensity() > 0).collect(Collectors.toList());
+        return weatherDataList.stream().filter(w -> Convert.toFloat(w.getAirDensity(),0f) > 0).collect(Collectors.toList());
     }
 
     //查询最开始一条记录

+ 75 - 70
neim-biz/src/main/java/com/jiayue/biz/service/impl/WindTowerDataParentTableServiceImpl.java

@@ -19,6 +19,7 @@ import com.jiayue.biz.util.CalculationUtil;
 import com.jiayue.biz.util.CommonUtil;
 import com.jiayue.biz.util.DateTimeUtil;
 import com.jiayue.biz.util.FileUtil;
+import com.jiayue.common.core.text.Convert;
 import com.jiayue.common.utils.DateUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -135,16 +136,16 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
         for (String height : heightAll) {
             ProphaseAnemometryData one = new ProphaseAnemometryData();
             //组装子表数据
-            one.setWsAve(m.get("wsAve_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wsAve_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWsMin(m.get("wsMin_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wsMin_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWsMax(m.get("wsMax_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wsMax_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWsSta(m.get("wsSta_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wsSta_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWsInst(m.get("wsInst_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wsInst_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWdAve(m.get("wdAve_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wdAve_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWdMax(m.get("wdMax_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wdMax_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWdMin(m.get("wdMin_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wdMin_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWdSta(m.get("wdSta_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wdSta_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
-            one.setWdInst(m.get("wdInst_" + height) == null ? null : CalculationUtil.getBigDecimal(m.get("wdInst_" + height)).setScale(2, RoundingMode.HALF_UP).floatValue());
+            one.setWsAve(m.get("wsAve_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wsAve_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWsMin(m.get("wsMin_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wsMin_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWsMax(m.get("wsMax_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wsMax_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWsSta(m.get("wsSta_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wsSta_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWsInst(m.get("wsInst_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wsInst_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWdAve(m.get("wdAve_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wdAve_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWdMax(m.get("wdMax_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wdMax_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWdMin(m.get("wdMin_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wdMin_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWdSta(m.get("wdSta_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wdSta_" + height)).setScale(2, RoundingMode.HALF_UP)));
+            one.setWdInst(m.get("wdInst_" + height) == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("wdInst_" + height)).setScale(2, RoundingMode.HALF_UP)));
             one.setLayerHeight(height);
             one.setEquipmentId(equipmentId);
             if (m.get("time") != null) {
@@ -171,41 +172,41 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
         if (m.get("paMax") != null)
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(m.get("paMax").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseAnemometryPublicData.setPaMax(CalculationUtil.getBigDecimal(m.get("paMax").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP).floatValue());
+                prophaseAnemometryPublicData.setPaMax(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paMax").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP)));
             else
-                prophaseAnemometryPublicData.setPaMax(CalculationUtil.getBigDecimal(m.get("paMax").toString()).floatValue());
+                prophaseAnemometryPublicData.setPaMax(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paMax").toString())));
         if (m.get("paMin") != null)
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(m.get("paMin").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseAnemometryPublicData.setPaMin(CalculationUtil.getBigDecimal(m.get("paMin").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP).floatValue());
+                prophaseAnemometryPublicData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paMin").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP)));
             else
-                prophaseAnemometryPublicData.setPaMin(CalculationUtil.getBigDecimal(m.get("paMin").toString()).floatValue());
+                prophaseAnemometryPublicData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paMin").toString())));
         if (m.get("paAve") != null)
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(m.get("paAve").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseAnemometryPublicData.setPaAve(CalculationUtil.getBigDecimal(m.get("paAve").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP).floatValue());
+                prophaseAnemometryPublicData.setPaAve(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paAve").toString()).multiply(new BigDecimal(10)).setScale(2, RoundingMode.HALF_UP)));
             else
-                prophaseAnemometryPublicData.setPaAve(CalculationUtil.getBigDecimal(m.get("paAve").toString()).floatValue());
-        prophaseAnemometryPublicData.setPaSta(m.get("paSta") == null ? null : CalculationUtil.getBigDecimal(m.get("paSta")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setTMax(m.get("tMax") == null ? null : CalculationUtil.getBigDecimal(m.get("tMax")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setTMin(m.get("tMin") == null ? null : CalculationUtil.getBigDecimal(m.get("tMin")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setTAve(m.get("tAve") == null ? null : CalculationUtil.getBigDecimal(m.get("tAve")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setTSta(m.get("tSta") == null ? null : CalculationUtil.getBigDecimal(m.get("tSta")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setRhMax(m.get("rhMax") == null ? null : CalculationUtil.getBigDecimal(m.get("rhMax")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setRhMin(m.get("rhMin") == null ? null : CalculationUtil.getBigDecimal(m.get("rhMin")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setRhAve(m.get("rhAve") == null ? null : CalculationUtil.getBigDecimal(m.get("rhAve")).setScale(2, RoundingMode.HALF_UP).floatValue());
-        prophaseAnemometryPublicData.setRhSta(m.get("rhSta") == null ? null : CalculationUtil.getBigDecimal(m.get("rhSta")).setScale(2, RoundingMode.HALF_UP).floatValue());
+                prophaseAnemometryPublicData.setPaAve(Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paAve").toString())));
+        prophaseAnemometryPublicData.setPaSta(m.get("paSta") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("paSta")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setTMax(m.get("tMax") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("tMax")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setTMin(m.get("tMin") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("tMin")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setTAve(m.get("tAve") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("tAve")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setTSta(m.get("tSta") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("tSta")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setRhMax(m.get("rhMax") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("rhMax")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setRhMin(m.get("rhMin") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("rhMin")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setRhAve(m.get("rhAve") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("rhAve")).setScale(2, RoundingMode.HALF_UP)));
+        prophaseAnemometryPublicData.setRhSta(m.get("rhSta") == null ? null : Convert.toFloat(CalculationUtil.getBigDecimal(m.get("rhSta")).setScale(2, RoundingMode.HALF_UP)));
         //计算空气密度  1.293*(273/(273+温度摄氏度))*气压百帕/1013
         if (prophaseAnemometryPublicData.getTAve() != null && prophaseAnemometryPublicData.getPaAve() != null &&
                 prophaseAnemometryPublicData.getTAve() != -99 && prophaseAnemometryPublicData.getPaAve() > 0) {
             BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(BigDecimal.valueOf(prophaseAnemometryPublicData.getTAve())), 2, RoundingMode.HALF_UP)).multiply(BigDecimal.valueOf(prophaseAnemometryPublicData.getPaAve())).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
-            prophaseAnemometryPublicData.setAirDensity(airDensity.floatValue());
+            prophaseAnemometryPublicData.setAirDensity(Convert.toFloat(airDensity));
         }else{
             //随机数 上限1.28 下限1.15
             Random random = new Random();
             int randNumber = random.nextInt(128 - 115 + 1) + 115;
             BigDecimal air = BigDecimal.valueOf(randNumber).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP);
-            prophaseAnemometryPublicData.setAirDensity(air.floatValue());
+            prophaseAnemometryPublicData.setAirDensity(Convert.toFloat(air));
         }
         if (m.get("time") != null) {
             try {
@@ -499,28 +500,27 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
 
     //通道数据保存
     public void saveDataForTunnel(HashMap<String, BigDecimal> dataMap, HashSet<Integer> heightSet, String equipmentNo, String time) {
+        Timestamp curentTimestamp = new Timestamp(DateUtil.parse(time).getTime());
 
-//        List<WindTowerInfo> windTowerInfos = windTowerInfoService.lambdaQuery().eq(WindTowerInfo::getType, "2").eq(WindTowerInfo::getEquipmentNo, "3002").list();
-//        List<EquipmentAttribute> equipmentAttributes = equipmentAttributeService.lambdaQuery().eq(EquipmentAttribute::getAttributeFunction, "height").list();
         for (Integer height : heightSet) {
 //            List<EquipmentAttribute> eqHeight = equipmentAttributes.stream().filter(e -> e.getFieldName().equals(height.toString())).collect(Collectors.toList());
             ProphaseAnemometryData prophaseAnemometryData = new ProphaseAnemometryData();
 
             prophaseAnemometryData.setLayerHeight(height.toString());
 
-            prophaseAnemometryData.setWsAve(CalculationUtil.getBigDecimal(dataMap.get("wsAve" + height) == null ? null : dataMap.get("wsAve" + height).toString()).floatValue());
-            prophaseAnemometryData.setWsMin(CalculationUtil.getBigDecimal(dataMap.get("wsMin" + height) == null ? null : dataMap.get("wsMin" + height).toString()).floatValue());
-            prophaseAnemometryData.setWsMax(CalculationUtil.getBigDecimal(dataMap.get("wsMax" + height) == null ? null : dataMap.get("wsMax" + height).toString()).floatValue());
-            prophaseAnemometryData.setWsSta(CalculationUtil.getBigDecimal(dataMap.get("wsSta" + height) == null ? null : dataMap.get("wsSta" + height).toString()).floatValue());
-            prophaseAnemometryData.setWsInst(CalculationUtil.getBigDecimal(dataMap.get("wsInst" + height) == null ? null : dataMap.get("wsInst" + height).toString()).floatValue());
-            prophaseAnemometryData.setWsGust(CalculationUtil.getBigDecimal(dataMap.get("wsGust" + height) == null ? null : dataMap.get("wsGust" + height).toString()).floatValue());
-            prophaseAnemometryData.setWdAve(CalculationUtil.getBigDecimal(dataMap.get("wdAve" + height) == null ? null : dataMap.get("wdAve" + height).toString()).floatValue());
-            prophaseAnemometryData.setWdMax(CalculationUtil.getBigDecimal(dataMap.get("wdMax" + height) == null ? null : dataMap.get("wdMax" + height).toString()).floatValue());
-            prophaseAnemometryData.setWdMin(CalculationUtil.getBigDecimal(dataMap.get("wdMin" + height) == null ? null : dataMap.get("wdMin" + height).toString()).floatValue());
-            prophaseAnemometryData.setWdSta(CalculationUtil.getBigDecimal(dataMap.get("wdSta" + height) == null ? null : dataMap.get("wdSta" + height).toString()).floatValue());
-            prophaseAnemometryData.setWdInst(CalculationUtil.getBigDecimal(dataMap.get("wdInst" + height) == null ? null : dataMap.get("wdInst" + height).toString()).floatValue());
+            prophaseAnemometryData.setWsAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsAve" + height) == null ? null : dataMap.get("wsAve" + height).toString())));
+            prophaseAnemometryData.setWsMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsMin" + height) == null ? null : dataMap.get("wsMin" + height).toString())));
+            prophaseAnemometryData.setWsMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsMax" + height) == null ? null : dataMap.get("wsMax" + height).toString())));
+            prophaseAnemometryData.setWsSta(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsSta" + height) == null ? null : dataMap.get("wsSta" + height).toString())));
+            prophaseAnemometryData.setWsInst(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsInst" + height) == null ? null : dataMap.get("wsInst" + height).toString())));
+            prophaseAnemometryData.setWsGust(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wsGust" + height) == null ? null : dataMap.get("wsGust" + height).toString())));
+            prophaseAnemometryData.setWdAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wdAve" + height) == null ? null : dataMap.get("wdAve" + height).toString())));
+            prophaseAnemometryData.setWdMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wdMax" + height) == null ? null : dataMap.get("wdMax" + height).toString())));
+            prophaseAnemometryData.setWdMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wdMin" + height) == null ? null : dataMap.get("wdMin" + height).toString())));
+            prophaseAnemometryData.setWdSta(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wdSta" + height) == null ? null : dataMap.get("wdSta" + height).toString())));
+            prophaseAnemometryData.setWdInst(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("wdInst" + height) == null ? null : dataMap.get("wdInst" + height).toString())));
             prophaseAnemometryData.setEquipmentId(equipmentNo);
-
+            prophaseAnemometryData.setTs(curentTimestamp);
             prophaseAnemometryDataOrgService.insertOneWithNew(prophaseAnemometryData);
             prophaseAnemometryDataService.insertOneWithNew(prophaseAnemometryData);
         }
@@ -529,53 +529,58 @@ public class WindTowerDataParentTableServiceImpl extends ServiceImpl<WindTowerDa
 
 
         prophaseWeatherData.setEquipmentId(equipmentNo);
-        //设置时间
-        prophaseWeatherData.setTs(new Timestamp(DateUtil.parseDate(time).getTime()));
-        if (dataMap.get("paMax") != null)
+
+        if (dataMap.get("paMax") != null) {
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(dataMap.get("paMax").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseWeatherData.setPaMax(CalculationUtil.getBigDecimal(dataMap.get("paMax").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP).floatValue());
+                prophaseWeatherData.setPaMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paMax").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP)));
             else
-                prophaseWeatherData.setPaMax(CalculationUtil.getBigDecimal(dataMap.get("paMax").toString()).floatValue());
-        if (dataMap.get("paMin") != null)
+                prophaseWeatherData.setPaMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paMax").toString())));
+        }
+        if (dataMap.get("paMin") != null) {
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(dataMap.get("paMin").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseWeatherData.setPaMin(CalculationUtil.getBigDecimal(dataMap.get("paMin").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP).floatValue());
+                prophaseWeatherData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paMin").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP)));
             else
-                prophaseWeatherData.setPaMin(CalculationUtil.getBigDecimal(dataMap.get("paMin").toString()).floatValue());
-        if (dataMap.get("paInst") != null)
+                prophaseWeatherData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paMin").toString())));
+        }
+        if (dataMap.get("paInst") != null) {
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(dataMap.get("paInst").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseWeatherData.setPaMin(CalculationUtil.getBigDecimal(dataMap.get("paInst").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP).floatValue());
+                prophaseWeatherData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paInst").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP)));
             else
-                prophaseWeatherData.setPaMin(CalculationUtil.getBigDecimal(dataMap.get("paInst").toString()).floatValue());
-        if (dataMap.get("paAve") != null)
+                prophaseWeatherData.setPaMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paInst").toString())));
+        }
+        if (dataMap.get("paAve") != null) {
             //kpa转hpa
             if (BigDecimal.valueOf(Double.parseDouble(dataMap.get("paAve").toString())).compareTo(new BigDecimal(200)) < 0)
-                prophaseWeatherData.setPaAve(CalculationUtil.getBigDecimal(dataMap.get("paAve").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP).floatValue());
+                prophaseWeatherData.setPaAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paAve").toString()).multiply(new BigDecimal(10)).setScale(4, RoundingMode.HALF_UP)));
             else
-                prophaseWeatherData.setPaAve(CalculationUtil.getBigDecimal(dataMap.get("paAve").toString()).floatValue());
-        prophaseWeatherData.setPaSta(CalculationUtil.getBigDecimal(dataMap.get("paSta") == null ? null : dataMap.get("paSta").toString()).floatValue());
+                prophaseWeatherData.setPaAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paAve").toString())));
+        }
+        prophaseWeatherData.setPaSta(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("paSta") == null ? null : dataMap.get("paSta").toString())));
 
-        prophaseWeatherData.setTMax(CalculationUtil.getBigDecimal(dataMap.get("tMax") == null ? null : dataMap.get("tMax").toString()).floatValue());
-        prophaseWeatherData.setTMin(CalculationUtil.getBigDecimal(dataMap.get("tMin") == null ? null : dataMap.get("tMin").toString()).floatValue());
-        prophaseWeatherData.setTAve(CalculationUtil.getBigDecimal(dataMap.get("tAve") == null ? null : dataMap.get("tAve").toString()).floatValue());
-        prophaseWeatherData.setTSta(CalculationUtil.getBigDecimal(dataMap.get("tSta") == null ? null : dataMap.get("tSta").toString()).floatValue());
-        prophaseWeatherData.setTInst(CalculationUtil.getBigDecimal(dataMap.get("tInst") == null ? null : dataMap.get("tInst").toString()).floatValue());
+        prophaseWeatherData.setTMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("tMax") == null ? null : dataMap.get("tMax").toString())));
+        prophaseWeatherData.setTMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("tMin") == null ? null : dataMap.get("tMin").toString())));
+        prophaseWeatherData.setTAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("tAve") == null ? null : dataMap.get("tAve").toString())));
+        prophaseWeatherData.setTSta(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("tSta") == null ? null : dataMap.get("tSta").toString())));
+        prophaseWeatherData.setTInst(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("tInst") == null ? null : dataMap.get("tInst").toString())));
 
-        prophaseWeatherData.setRhMax(CalculationUtil.getBigDecimal(dataMap.get("rhMax") == null ? null : dataMap.get("rhMax").toString()).floatValue());
-        prophaseWeatherData.setRhMin(CalculationUtil.getBigDecimal(dataMap.get("rhMin") == null ? null : dataMap.get("rhMin").toString()).floatValue());
-        prophaseWeatherData.setRhAve(CalculationUtil.getBigDecimal(dataMap.get("rhAve") == null ? null : dataMap.get("rhAve").toString()).floatValue());
-        prophaseWeatherData.setRhSta(CalculationUtil.getBigDecimal(dataMap.get("rhSta") == null ? null : dataMap.get("rhSta").toString()).floatValue());
-        prophaseWeatherData.setRhInst(CalculationUtil.getBigDecimal(dataMap.get("rhInst") == null ? null : dataMap.get("rhInst").toString()).floatValue());
+        prophaseWeatherData.setRhMax(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("rhMax") == null ? null : dataMap.get("rhMax").toString())));
+        prophaseWeatherData.setRhMin(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("rhMin") == null ? null : dataMap.get("rhMin").toString())));
+        prophaseWeatherData.setRhAve(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("rhAve") == null ? null : dataMap.get("rhAve").toString())));
+        prophaseWeatherData.setRhSta(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("rhSta") == null ? null : dataMap.get("rhSta").toString())));
+        prophaseWeatherData.setRhInst(Convert.toFloat(CalculationUtil.getBigDecimal(dataMap.get("rhInst") == null ? null : dataMap.get("rhInst").toString())));
 
 
         //计算空气密度
-        if (dataMap.get("TAve") != null && dataMap.get("paAve") != null) {
-            BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(dataMap.get("TAve")), 2, RoundingMode.HALF_UP)).multiply(dataMap.get("paAve")).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
-            prophaseWeatherData.setAirDensity(airDensity.floatValue());
+        if (dataMap.get("tAve") != null && dataMap.get("paAve") != null) {
+            BigDecimal airDensity = BigDecimal.valueOf(1.293).multiply(new BigDecimal(273).divide(new BigDecimal(273).add(dataMap.get("tAve")), 2, RoundingMode.HALF_UP)).multiply(dataMap.get("paAve")).divide(new BigDecimal(1013), 2, RoundingMode.HALF_UP);
+            prophaseWeatherData.setAirDensity(Convert.toFloat(airDensity));
         }
-
+        log.info("dataMap.get(tAve):{} ,,, {}",dataMap.get("tAve"),dataMap.get("paAve"));
+        //设置时间
+        prophaseWeatherData.setTs(curentTimestamp);
         prophaseWeatherDataService.insertOne(prophaseWeatherData);
         prophaseWeatherDataOrgService.insertOne(prophaseWeatherData);
 

+ 13 - 16
neim-biz/src/main/resources/application-dev.yml

@@ -2,26 +2,23 @@
 spring:
   servlet:
     multipart:
-      max-file-size: 10MB
-      max-request-size: 20MB
+      max-file-size: 100MB
+      max-request-size: 200MB
   data:
     mongodb:
-#      host: 49.4.78.194
-#      host: 10.124.252.246
-      host: 192.168.1.208
-#      port: 17142
+      host: 168.178.8.2
       port: 27017
       database: neim
-      username: neimdb
-      password: 'neim123'
+      username: root
+      password: '!QAZ2root'
   datasource:
     dynamic:
       primary: mysql #设置默认的数据源或者数据源组,默认值即为master
       datasource:
         mysql:
-          url: jdbc:mysql://192.168.1.205:3306/nerp-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+#          url: jdbc:mysql://192.168.1.205:3306/nerp-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
 #          url: jdbc:mysql://49.4.78.194:17136/nerp-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-#          url: jdbc:mysql://10.124.252.246:3306/nerp-db-v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          url: jdbc:mysql://168.178.8.2:3306/nerp-db-v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
           username: root
           password: '!QAZ2root'
           driver-class-name: com.mysql.cj.jdbc.Driver
@@ -68,12 +65,12 @@ spring:
                 config:
                   multi-statement-allow: true
         tdengine:
-          url: jdbc:TAOS://192.168.1.208:6030/nerp_db
+#          url: jdbc:TAOS://192.168.1.208:6030/nerp_db
 #          url: jdbc:TAOS://10.124.252.246:6030/nerp_db
-#          url: jdbc:TAOS://49.4.78.194:17139/nerp_db
+          url: jdbc:TAOS://168.178.8.2:6030/nerp_db
           username: root
-          password: 123456
-#          password: "!QAZ2root"
+#          password: 123456
+          password: "!QAZ2root"
           driver-class-name: com.taosdata.jdbc.TSDBDriver
           type: com.alibaba.druid.pool.DruidDataSource
           druid:
@@ -83,8 +80,8 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 192.168.1.205
-#    host: 10.124.252.244
+ #   host: 192.168.1.205
+    host: 168.178.8.2
     # 端口,默认为6379
     port: 6379
 #    port: 17137

+ 74 - 56
neim-biz/src/main/resources/application-prod.yml

@@ -1,64 +1,82 @@
 # 数据源配置
 spring:
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 200MB
+  data:
+    mongodb:
+      host: 168.178.8.1
+      port: 27017
+      database: neim
+      username: root
+      password: '!QAZ2root'
+      authentication-database: admin
   datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driverClassName: com.mysql.cj.jdbc.Driver
-    druid:
-      # 主库数据源
-      master:
-        url: jdbc:mysql://10.124.252.246:3306/nerp-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&allowMultiQueries=true&rewriteBatchedStatements=true
-        username: root
-        password: '!QAZ2root'
-      # 从库数据源
-      slave:
-        # 从数据源开关/默认关闭
-        enabled: false
-        url:
-        username:
-        password:
-      # 初始连接数
-      initialSize: 5
-      # 最小连接池数量
-      minIdle: 10
-      # 最大连接池数量
-      maxActive: 20
-      # 配置获取连接等待超时的时间
-      maxWait: 60000
-      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
-      timeBetweenEvictionRunsMillis: 60000
-      # 配置一个连接在池中最小生存的时间,单位是毫秒
-      minEvictableIdleTimeMillis: 300000
-      # 配置一个连接在池中最大生存的时间,单位是毫秒
-      maxEvictableIdleTimeMillis: 900000
-      # 配置检测连接是否有效
-      validationQuery: SELECT 1 FROM DUAL
-      testWhileIdle: true
-      testOnBorrow: false
-      testOnReturn: false
-      webStatFilter:
-        enabled: true
-      statViewServlet:
-        enabled: true
-        # 设置白名单,不填则允许所有访问
-        allow:
-        url-pattern: /druid/*
-        # 控制台管理用户名和密码
-        login-username: nerp
-        login-password: nerp
-      filter:
-        stat:
-          enabled: true
-          # 慢SQL记录
-          log-slow-sql: true
-          slow-sql-millis: 1000
-          merge-sql: true
-        wall:
-          config:
-            multi-statement-allow: true
+    dynamic:
+      primary: mysql #设置默认的数据源或者数据源组,默认值即为master
+      datasource:
+        mysql:
+          url: jdbc:mysql://168.178.8.1:3306/nerp-db-v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&connectTimeout=6000&socketTimeout=6000
+          username: root
+          password: '!QAZ2root'
+          driver-class-name: com.mysql.cj.jdbc.Driver
+          type: com.alibaba.druid.pool.DruidDataSource
+          druid:
+            # 初始连接数
+            initial-size: 5
+            # 最小连接池数量
+            min-idle: 10
+            # 最大连接池数量
+            max-active: 20
+            # 配置获取连接等待超时的时间
+            max-wait: 60000
+            # 配置一个连接在池中最小生存的时间,单位是毫秒
+            min-evictable-idle-time-millis: 300000
+            # 配置一个连接在池中最大生存的时间,单位是毫秒
+            max-evictable-idle-time-millis: 900000
+            # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+            time-between-eviction-runs-millis: 60000
+            # 配置检测连接是否有效
+            test-while-idle: true
+            test-on-borrow: false
+            test-on-return: false
+            validation-query: select 1
+            validation-query-timeout: -1
+            webStatFilter:
+              enabled: true
+            statViewServlet:
+              enabled: true
+              # 设置白名单,不填则允许所有访问
+              allow:
+              url-pattern: /druid/*
+              # 控制台管理用户名和密码
+              login-username: nerp
+              login-password: nerp
+            filter:
+              stat:
+                enabled: true
+                # 慢SQL记录
+                log-slow-sql: true
+                slow-sql-millis: 1000
+                merge-sql: true
+              wall:
+                config:
+                  multi-statement-allow: true
+        tdengine:
+          url: jdbc:TAOS://168.178.8.1:6030/nerp_db
+          username: root
+          password: "!QAZ2root"
+          driver-class-name: com.taosdata.jdbc.TSDBDriver
+          type: com.alibaba.druid.pool.DruidDataSource
+          druid:
+            initial-size: 5
+            min-idle: 5
+            max-active: 5
   # redis 配置
   redis:
     # 地址
-    host: 10.124.252.244
+    host: 10.124.241.22
     # 端口,默认为6379
     port: 6379
     # 数据库索引
@@ -77,7 +95,7 @@ spring:
         max-active: 8
         # #连接池最大阻塞等待时间(使用负值表示没有限制)
         max-wait: -1ms
-#
+
 #mybatis-plus:
 #  configuration:
 #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志

+ 2 - 2
neim-biz/src/main/resources/application.yml

@@ -66,9 +66,9 @@ spring:
   servlet:
     multipart:
       # 单个文件大小
-      max-file-size: 10MB
+      max-file-size: 100MB
       # 设置总上传的文件大小
-      max-request-size: 20MB
+      max-request-size: 200MB
   # 服务模块
   devtools:
     restart:

File diff suppressed because it is too large
+ 1 - 1
neim-biz/src/test/java/service/TDengineTest.java


+ 2 - 2
neim-ui/src/utils/bigemap/3dmap.js

@@ -1,7 +1,7 @@
 //map.js
 // 换成本地的服务器js文件即可
 let script = [
-  'http://www.bigemap.com:9000/bigemap-gl.js/v1.1.0/bigemap-gl.js',
+  'http://10.124.241.21:9000/bigemap-gl.js/v1.1.0/bigemap-gl.js',
   // '/js/bigemap-velocity.min.js',
   '/jquery.min.js',
   //如果有更多的JS要引用 ,也一起放到这个数组中
@@ -11,7 +11,7 @@ export default new Promise(resolve => {
   link.rel = "stylesheet";
   link.async = false;
   // 换成本地的服务器css文件即可
-  link.href = "http://www.bigemap.com:9000/bigemap-gl.js/v1.1.0/Widgets/widgets.css";
+  link.href = "http://10.124.241.21:9000/bigemap-gl.js/v1.1.0/Widgets/widgets.css";
   document.head.appendChild(link);
   let loads = script.map(v => {
     let script = document.createElement("script");

+ 2 - 2
neim-ui/src/utils/bigemap/map.js

@@ -1,7 +1,7 @@
 //map.js
 // 换成本地的服务器js文件即可
 let script = [
-  'http://www.bigemap.com:9000/bigemap.js/v2.1.0/bigemap.js',
+  'http://10.124.241.21:9000/bigemap.js/v2.1.0/bigemap.js',
   // 'http://www.bigemap.com/public/js/tool/BMturf.min.js',
   // '/js/bigemap-velocity.min.js',
   '/js/BMturf.min.js',
@@ -13,7 +13,7 @@ export default new Promise(resolve => {
   link.rel = "stylesheet";
   link.async = false;
   // 换成本地的服务器css文件即可
-  link.href = "http://www.bigemap.com:9000/bigemap.js/v2.1.0/bigemap.css";
+  link.href = "http://10.124.241.21:9000/bigemap.js/v2.1.0/bigemap.css";
   document.head.appendChild(link);
   let loads = script.map(v => {
     let script = document.createElement("script");

+ 1 - 1
neim-ui/src/views/largeScreenPage/Subpage/stationResources.vue

@@ -221,7 +221,7 @@ export default {
     },
     //场站列表点击名称事件
     stationNameClick(station) {
-      // console.log(station)
+      //console.log(station)
       sessionStorage.setItem("stationInfo",JSON.stringify(station))
       this.$store.dispatch('equipmentInfo/stationInfo',JSON.stringify(station))
       this.$router.push({path: "/homepage/stationInfo"})

+ 1 - 3
neim-ui/src/views/largeScreenPage/components/3DbigeMap.vue

@@ -50,7 +50,7 @@ export default {
         // console.log(center, 154);
         // window.bmgl.Config.HTTP_URL ='http://www.bigemap.com:9000';
         //TODO 修改地址和端口的时候要同步修改下面的TODO
-        window.bmgl.Config.HTTP_URL = 'http://49.4.78.194:17143';
+        window.bmgl.Config.HTTP_URL = 'http://10.124.241.21:9000';
         // window.bmgl.Config.HTTP_URL = 'http://localhost:9000';
         let viewer = new bmgl.Viewer('container', {
           // mapId: 'bigemap.zhongkexingtu',
@@ -71,8 +71,6 @@ export default {
         let helper = new bmgl.EventHelper();
         helper.add(viewer.scene.globe.tileLoadProgressEvent, e => {
           var layer=viewer.imageryLayers.get(0);
-          // TODO 改端口了这里需要屏蔽或者跟着调整
-          layer.imageryProvider._imageryProvider._resource._url=layer.imageryProvider._imageryProvider._resource._url.replace('9000','17143');
           console.log(layer.imageryProvider._imageryProvider._resource._url)
           helper.removeAll();
           helper=null;

+ 1 - 1
neim-ui/src/views/largeScreenPage/components/bigeHeatMap.vue

@@ -69,7 +69,7 @@ export default {
 
         window.BM.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
         let ip1 = process.env.VUE_APP_GIS_API;
-        let ip2 = 'http://49.4.78.194:17143';
+        let ip2 = 'http://10.124.241.21:9000';
         // window.BM.Config.HTTP_URL = 'http://localhost:9000';
         // let ip1 = 'http://localhost:9000';
         // let ip2 = 'http://localhost:9000';

+ 1 - 1
neim-ui/src/views/largeScreenPage/components/bigeHeatSunMap.vue

@@ -70,7 +70,7 @@ export default {
 
         window.BM.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
         let ip1 = process.env.VUE_APP_GIS_API;
-        let ip2 = 'http://49.4.78.194:17143';
+        let ip2 = 'http://10.124.241.21:9000';
         // window.BM.Config.HTTP_URL = 'http://localhost:9000';
         // let ip1 = 'http://localhost:9000';
         // let ip2 = 'http://localhost:9000';

+ 10 - 15
neim-ui/src/views/largeScreenPage/components/bigeMap.vue

@@ -67,10 +67,8 @@ export default {
 
         window.BM.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
         let ip1 = process.env.VUE_APP_GIS_API;
-        let ip2 = 'http://49.4.78.194:17143';
-        // window.BM.Config.HTTP_URL = 'http://49.4.78.194:17143';
-        // let ip1 = 'http://49.4.78.194:17143';
-        // let ip2 = 'http://49.4.78.194:17143';
+        let ip2 = 'http://10.124.241.21:9000';
+
         // window.BM.Config.HTTP_URL = 'http://localhost:9000';
         // let ip1 = 'http://localhost:9000';
         // let ip2 = 'http://localhost:9000';
@@ -174,20 +172,17 @@ export default {
             fillOpacity: 0.7
           }).addTo(this.bMap);
 
-          //初始化热力图
-          // this.setHeatMap(this.bMap);
           //绑定事件
           this.bindEvents(this.bMap);
-          if (this.mapData.level !== null) {
-            _self.level = this.mapData.level
-            _self.center = this.mapData.center
-            this.bMap.setView(this.mapData.center, this.mapData.level)
-            // this.bMap.setZoom(this.mapData.level)
-            // this.bMap.panTo(this.mapData.center)
+          setTimeout(function (){
+          if (_self.mapData.level !== null) {
+            _self.level = _self.mapData.level
+            _self.center = _self.mapData.center
+            _self.bMap.setView(_self.mapData.center, _self.mapData.level)
           } else {
-            this.bMap.setView([46.69090, 128.13354], 7)
-          }
-
+            _self.bMap.setView([46.69090, 128.13354], 7)
+          }},500
+        )
 
         })
         let sIconurl = 'http://' + _self.href.split("//")[1].split("/")[0] + '/largeScreenImg/station.png'

+ 2 - 2
neim-ui/src/views/largeScreenPage/components/zaiXianBigeMap.vue

@@ -64,8 +64,8 @@ export default {
         // window.BM.Config.HTTP_URL = 'http://www.bigemap.com:9000';
 
         window.BM.Config.HTTP_URL = process.env.VUE_APP_GIS_API;
-        let ip1 = 'http://49.4.78.194:17143';
-        let ip2 = 'http://49.4.78.194:17143';
+        let ip1 = 'http://10.124.241.21:9000';
+        let ip2 = 'http://10.124.241.21:9000';
 
         // window.BM.Config.HTTP_URL = 'http://49.4.78.194:17143';
         // let ip1 = 'http://49.4.78.194:17143';

Some files were not shown because too many files changed in this diff