allen 2 месяцев назад
Родитель
Сommit
891af2f152

+ 10 - 10
mirs-admin/src/main/java/com/mirs/biz/controller/IndexController.java

@@ -74,24 +74,24 @@ public class IndexController extends BaseController {
 
     @GetMapping("/getTemperatureK")
     public AjaxResult getTemperatureK(IndexSearchDTO dto) {
-        if("1".equals(dto.getDataType())){
-            return success(emiMeasurementService.getTemperatureK());
+        if ("1".equals(dto.getDataType())) {
+            return success(emiMeasurementService.getTemperatureK(dto.getEmiMeasurement()));
         } else {
-            return success(brdfDataService.getTemperatureK());
+            return success(brdfDataService.getTemperatureK(dto.getBrdfData()));
         }
     }
 
     @GetMapping("/getAllAngle")
-    public AjaxResult getAllAngle() {
-        return success(brdfDataService.getAllAngle());
+    public AjaxResult getAllAngle(IndexSearchDTO dto) {
+        return success(brdfDataService.getAllAngle(dto.getBrdfData()));
     }
     @GetMapping("/getOthersOptions")
     public AjaxResult getOthersOptions(IndexSearchDTO dto) {
         Map<String, Object> result = new HashMap<>(4);
-        result.put("sampleTypeOptions", sampleService.getSampleType(dto.getDataType()));
-        result.put("sampleModelOptions", sampleService.getSampleModel(dto));
+//        result.put("sampleTypeOptions", sampleService.getSampleType(dto.getDataType()));
+//        result.put("sampleModelOptions", sampleService.getSampleModel(dto));
         if("1".equals(dto.getDataType())){
-            result.put("temperatureKOptions", emiMeasurementService.getTemperatureK());
+            result.put("temperatureKOptions", emiMeasurementService.getTemperatureK(dto.getEmiMeasurement()));
 
             Map<String, Object> resultMap = new HashMap<>(4);
             resultMap.put("thetaIncidentOptions", new ArrayList<>());
@@ -100,9 +100,9 @@ public class IndexController extends BaseController {
             resultMap.put("phiReflectedOptions", new ArrayList<>());
             result.put("allAngleOptions", resultMap);
         } else {
-            result.put("temperatureKOptions", brdfDataService.getTemperatureK());
+            result.put("temperatureKOptions", brdfDataService.getTemperatureK(dto.getBrdfData()));
 
-            result.put("allAngleOptions", brdfDataService.getAllAngle());
+            result.put("allAngleOptions", brdfDataService.getAllAngle(dto.getBrdfData()));
         }
         return success(result);
     }

+ 49 - 0
mirs-admin/src/main/java/com/mirs/biz/domain/EmiMeasurement.java

@@ -7,6 +7,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.mirs.common.annotation.Excel;
 import com.mirs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.math.NumberUtils;
 
 /**
  * 测量数据对象 biz_emi_measurement_t
@@ -35,6 +36,9 @@ public class EmiMeasurement extends BaseEntity
     private BigDecimal wavelengthUm;
 
     private String wavelengthUmStr;
+    private Boolean wavelengthUmInterval;
+    private Integer wavelengthUmMin;
+    private Integer wavelengthUmMax;
 
     /** EMI-修正1 */
     @Excel(name = "EMI-修正1")
@@ -60,4 +64,49 @@ public class EmiMeasurement extends BaseEntity
     @Excel(name = "均值")
     private BigDecimal meanValue;
 
+    public void setWavelengthUmStr(String wavelengthUmStr) {
+        this.wavelengthUmStr = wavelengthUmStr;
+        Boolean wavelengthUmInterval = Boolean.FALSE;
+        if (wavelengthUmStr != null) {
+            String[] split = wavelengthUmStr.split("~");
+            if (split.length == 2) {
+                wavelengthUmInterval = Boolean.TRUE;
+                this.wavelengthUmMin = Integer.parseInt(split[0]);
+                this.wavelengthUmMax = Integer.parseInt(split[1]);
+            }
+        }
+        this.wavelengthUmInterval = wavelengthUmInterval;
+    }
+//    public Boolean wavelengthUmStrNumber(){
+//        return NumberUtils.isCreatable(wavelengthUmStr);
+//    }
+//
+//    public Boolean getWavelengthUmInterval(){
+//        if(wavelengthUmStr != null){
+//            String[] split = wavelengthUmStr.split("~");
+//            if(split.length == 2){
+//                return  Boolean.TRUE;
+//            }
+//        }
+//        return Boolean.FALSE;
+//    }
+//    public Integer getWavelengthUmMin(){
+//        if(wavelengthUmStr != null){
+//            String[] split = wavelengthUmStr.split("~");
+//            if(split.length == 2){
+//                return  Integer.parseInt(split[0]);
+//            }
+//        }
+//        return null;
+//    }
+//
+//    public Integer getWavelengthUmMax() {
+//        if (wavelengthUmStr != null) {
+//            String[] split = wavelengthUmStr.split("~");
+//            if (split.length == 2) {
+//                return Integer.parseInt(split[1]);
+//            }
+//        }
+//        return null;
+//    }
 }

+ 4 - 4
mirs-admin/src/main/java/com/mirs/biz/mapper/BrdfDataMapper.java

@@ -59,13 +59,13 @@ public interface BrdfDataMapper
      */
     public int deleteBrdfDataByIds(Long[] ids);
 
-    List getThetaIncident();
+    List getThetaIncident(BrdfData brdfData);
 
-    List getPhiIncident();
+    List getPhiIncident(BrdfData brdfData);
 
-    List getThetaReflected();
+    List getThetaReflected(BrdfData brdfData);
 
-    List getPhiReflected();
+    List getPhiReflected(BrdfData brdfData);
 
     List getTemperatureK();
 }

+ 1 - 2
mirs-admin/src/main/java/com/mirs/biz/mapper/EmiMeasurementMapper.java

@@ -2,7 +2,6 @@ package com.mirs.biz.mapper;
 
 import java.util.List;
 import com.mirs.biz.domain.EmiMeasurement;
-import com.mirs.biz.dto.IndexSearchDTO;
 
 /**
  * 测量数据Mapper接口
@@ -60,5 +59,5 @@ public interface EmiMeasurementMapper
      */
     public int deleteEmiMeasurementByIds(Long[] ids);
 
-    List getTemperatureK();
+    List getTemperatureK(EmiMeasurement emiMeasurement);
 }

+ 2 - 2
mirs-admin/src/main/java/com/mirs/biz/service/IBrdfDataService.java

@@ -63,7 +63,7 @@ public interface IBrdfDataService
 
     String importBrdfData(List<BrdfData> brdfDataList, boolean updateSupport, String operName);
 
-    Map getAllAngle();
+    Map getAllAngle(BrdfData brdfData);
 
-    List getTemperatureK();
+    List getTemperatureK(BrdfData brdfData);
 }

+ 1 - 2
mirs-admin/src/main/java/com/mirs/biz/service/IEmiMeasurementService.java

@@ -2,7 +2,6 @@ package com.mirs.biz.service;
 
 import java.util.List;
 import com.mirs.biz.domain.EmiMeasurement;
-import com.mirs.biz.dto.IndexSearchDTO;
 
 /**
  * 测量数据Service接口
@@ -62,5 +61,5 @@ public interface IEmiMeasurementService
 
     String importEmiMeasurement(List<EmiMeasurement> emiMeasurementList, boolean updateSupport, String operName);
 
-    List getTemperatureK();
+    List getTemperatureK(EmiMeasurement emiMeasurement);
 }

+ 6 - 9
mirs-admin/src/main/java/com/mirs/biz/service/impl/BrdfDataServiceImpl.java

@@ -4,13 +4,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.mirs.common.core.domain.entity.SysUser;
 import com.mirs.common.exception.ServiceException;
 import com.mirs.common.utils.DateUtils;
-import com.mirs.common.utils.SecurityUtils;
 import com.mirs.common.utils.StringUtils;
 import com.mirs.common.utils.bean.BeanValidators;
-import com.mirs.system.service.impl.SysUserServiceImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -154,12 +151,12 @@ public class BrdfDataServiceImpl implements IBrdfDataService
     }
 
     @Override
-    public Map getAllAngle() {
+    public Map getAllAngle(BrdfData brdfData) {
         Map<String, List> resultMap = new HashMap<>(8);
-        List thetaIncidentOptions = brdfDataMapper.getThetaIncident();
-        List phiIncidentOptions = brdfDataMapper.getPhiIncident();
-        List thetaReflectedOptions = brdfDataMapper.getThetaReflected();
-        List phiReflectedOptions = brdfDataMapper.getPhiReflected();
+        List thetaIncidentOptions = brdfDataMapper.getThetaIncident(brdfData);
+        List phiIncidentOptions = brdfDataMapper.getPhiIncident(brdfData);
+        List thetaReflectedOptions = brdfDataMapper.getThetaReflected(brdfData);
+        List phiReflectedOptions = brdfDataMapper.getPhiReflected(brdfData);
         resultMap.put("thetaIncidentOptions", thetaIncidentOptions);
         resultMap.put("phiIncidentOptions", phiIncidentOptions);
         resultMap.put("thetaReflectedOptions", thetaReflectedOptions);
@@ -168,7 +165,7 @@ public class BrdfDataServiceImpl implements IBrdfDataService
     }
 
     @Override
-    public List getTemperatureK() {
+    public List getTemperatureK(BrdfData brdfData) {
         return brdfDataMapper.getTemperatureK();
     }
 }

+ 2 - 4
mirs-admin/src/main/java/com/mirs/biz/service/impl/EmiMeasurementServiceImpl.java

@@ -2,8 +2,6 @@ package com.mirs.biz.service.impl;
 
 import java.util.List;
 
-import com.mirs.biz.domain.BrdfData;
-import com.mirs.biz.dto.IndexSearchDTO;
 import com.mirs.common.exception.ServiceException;
 import com.mirs.common.utils.DateUtils;
 import com.mirs.common.utils.StringUtils;
@@ -150,7 +148,7 @@ public class EmiMeasurementServiceImpl implements IEmiMeasurementService
     }
 
     @Override
-    public List getTemperatureK() {
-        return emiMeasurementMapper.getTemperatureK();
+    public List getTemperatureK(EmiMeasurement emiMeasurement) {
+        return emiMeasurementMapper.getTemperatureK(emiMeasurement);
     }
 }

+ 3 - 2
mirs-admin/src/main/resources/application.yml

@@ -7,7 +7,7 @@ ruoyi:
   # 版权年份
   copyrightYear: 2024
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
-  profile: D:/mirs/uploadPath
+  profile: /mirs/uploadPath
   # 获取ip地址开关
   addressEnabled: false
   # 验证码类型 math 数字计算 char 字符验证
@@ -69,11 +69,12 @@ spring:
   redis:
     # 地址
     host: 101.126.133.7
+#    host: 127.0.0.1
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 0
-    # 密码
+    # 密码 Z;G4AS:Vor'YF#p?
     password: Z;G4AS:Vor'YF#p?
     # 连接超时时间
     timeout: 10s

+ 1 - 1
mirs-admin/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration>
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/home/ruoyi/logs" />
+	<property name="log.path" value="/mirs/logs" />
     <!-- 日志输出格式 -->
 	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
 

+ 25 - 5
mirs-admin/src/main/resources/mapper/manage/BrdfDataMapper.xml

@@ -129,22 +129,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="getTemperatureK" parameterType="String" resultType="HashMap">
-        select distinct temperature_k name, temperature_k value from biz_brdf_data_t ORDER BY temperature_k asc
+        select distinct temperature_k name, temperature_k value from biz_brdf_data_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        ORDER BY temperature_k asc
     </select>
 
     <select id="getThetaIncident" resultType="HashMap">
-        select distinct theta_incident name, theta_incident value from biz_brdf_data_t order by theta_incident asc
+        select distinct theta_incident name, theta_incident value from biz_brdf_data_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        order by theta_incident asc
     </select>
 
     <select id="getPhiIncident" resultType="HashMap">
-        select distinct phi_incident name, phi_incident value from biz_brdf_data_t order by phi_incident asc
+        select distinct phi_incident name, phi_incident value from biz_brdf_data_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        order by phi_incident asc
     </select>
 
     <select id="getThetaReflected" resultType="HashMap">
-        select distinct theta_reflected name, theta_reflected value from biz_brdf_data_t order by theta_reflected asc
+        select distinct theta_reflected name, theta_reflected value from biz_brdf_data_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        order by theta_reflected asc
     </select>
 
     <select id="getPhiReflected" resultType="HashMap">
-        select distinct phi_reflected name, phi_reflected value from biz_brdf_data_t order by phi_reflected asc
+        select distinct phi_reflected name, phi_reflected value from biz_brdf_data_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        order by phi_reflected asc
     </select>
 </mapper>

+ 10 - 18
mirs-admin/src/main/resources/mapper/manage/EmiMeasurementMapper.xml

@@ -33,23 +33,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="wavelengthUm != null "> and wavelength_um = #{wavelengthUm}</if>
             <if test="wavelengthUmStr != null and wavelengthUmStr != ''">
                 <choose>
-                    <!-- 处理3~5范围 -->
-                    <when test="wavelengthUmStr == '3~5'">
-                        and wavelength_um &gt;= 3 AND wavelength_um &lt;= 5
+                    <!-- 区间查询 -->
+                    <when test="wavelengthUmInterval">
+                        and wavelength_um &gt;= #{wavelengthUmMin} AND wavelength_um &lt;= #{wavelengthUmMax}
                     </when>
-                    <!-- 处理5~9范围 -->
-                    <when test="wavelengthUmStr == '5~9'">
-                        and wavelength_um &gt;= 5 AND wavelength_um &lt;= 9
-                    </when>
-                    <!-- 处理8~16范围(实际查询8~14) -->
-                    <when test="wavelengthUmStr == '8~16'">
-                        and wavelength_um &gt;= 8 AND wavelength_um &lt;= 14
-                    </when>
-                    <!-- 处理特定值10.6 -->
-                    <when test="wavelengthUmStr == '10.6'">
-                        and wavelength_um = 10.6
-                    </when>
-                    <!-- 如果不是以上预设值,则按实际值查询 -->
+                    <!-- 如果不是区间查询,则按实际值查询 -->
                     <otherwise>
                         and wavelength_um = #{wavelengthUmStr}
                     </otherwise>
@@ -127,8 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-    <select id="getTemperatureK" parameterType="String" resultType="HashMap">
-        select distinct temperature_k name, temperature_k value from biz_emi_measurement_t ORDER BY temperature_k asc
+    <select id="getTemperatureK" parameterType="EmiMeasurement" resultType="HashMap">
+        select distinct temperature_k name, temperature_k value from biz_emi_measurement_t
+        <where>
+            <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
+        </where>
+        ORDER BY temperature_k asc
     </select>
 
 </mapper>

+ 3 - 2
mirs-admin/src/main/resources/mapper/manage/SampleMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="getOne" parameterType="Sample" resultMap="SampleResult">
         <include refid="selectSampleVo"/>
         <where>
+            <if test="dataType != null  and dataType != ''"> and data_type = #{dataType}</if>
             <if test="sampleType != null  and sampleType != ''"> and sample_type = #{sampleType}</if>
             <if test="sampleModel != null  and sampleModel != ''"> and sample_model = #{sampleModel}</if>
         </where>
@@ -94,9 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <select id="getSampleType" parameterType="String" resultType="HashMap">
-        select sample_type name, sample_type value from biz_sample_t where data_type = #{value}
+        select distinct sample_type name, sample_type value from biz_sample_t where data_type = #{value}
     </select>
     <select id="getSampleModel" parameterType="Sample" resultType="HashMap">
-        select sample_model name, sample_model value from biz_sample_t where data_type = #{dataType}
+        select distinct sample_model name, sample_model value from biz_sample_t where data_type = #{dataType} and sample_type = #{sampleType}
     </select>
 </mapper>

+ 1 - 10
mirs-ui/src/api/manage/index.js

@@ -36,16 +36,7 @@ export function getTemperatureK(query) {
   });
 }
 
-// 查询主页BRDF所有角
-export function getAllAngle(query) {
-  return request({
-    url: "/index/search/getAllAngle",
-    method: "get",
-    params: query,
-  });
-}
-
-// 查询主页BRDF所有角
+// 查询其他所有下拉框
 export function getOthersOptions(query) {
   return request({
     url: "/index/search/getOthersOptions",

+ 1 - 1
mirs-ui/src/utils/request.js

@@ -17,7 +17,7 @@ const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
   baseURL: process.env.VUE_APP_BASE_API,
   // 超时
-  timeout: 10000
+  timeout: 3600000
 })
 
 // request拦截器

+ 65 - 9
mirs-ui/src/views/index.vue

@@ -31,6 +31,7 @@
           placeholder="请选择"
           clearable
           @keyup.enter.native="handleQuery"
+          @change="changeSampleType"
         >
           <el-option
             v-for="item in options.sampleTypeOption"
@@ -52,6 +53,7 @@
           placeholder="请选择"
           clearable
           @keyup.enter.native="handleQuery"
+          @change="changeSampleModel"
         >
           <el-option
             v-for="item in options.sampleModelOption"
@@ -352,7 +354,12 @@
 
 <script>
 import * as echarts from "echarts";
-import { getIndexInfo, getOthersOptions } from "@/api/manage/index";
+import {
+  getIndexInfo,
+  getSampleType,
+  getSampleModel,
+  getOthersOptions,
+} from "@/api/manage/index";
 export default {
   name: "Index",
   dicts: ["biz_data_type", "biz_wavelength_um"],
@@ -421,9 +428,9 @@ export default {
     getList() {
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
       });
       getIndexInfo(this.queryParams).then((response) => {
         const data = response.data;
@@ -463,16 +470,65 @@ export default {
         thetaReflected: null,
         phiReflected: null,
       };
-      const params = {
-        dataType: this.queryParams.dataType,
+      getSampleType(this.queryParams).then((resp) => {
+        this.options = {
+          sampleTypeOption: resp.data,
+          sampleModelOption: [],
+          temperatureKOption: [],
+          allAngleOption: {
+            thetaIncidentOptions: [],
+            phiIncidentOptions: [],
+            thetaReflectedOptions: [],
+            phiReflectedList: [],
+          },
+        };
+      });
+    },
+    changeSampleType(val) {
+      this.showResult = false;
+      const dataType = this.queryParams.dataType;
+      this.queryParams = {
+        dataType,
+        sampleType: val,
+        sampleModel: null,
+        temperatureK: null,
+        wavelengthUm: null,
+        thetaIncident: null,
+        phiIncident: null,
+        thetaReflected: null,
+        phiReflected: null,
+      };
+      getSampleModel(this.queryParams).then((resp) => {
+        this.options.sampleModelOption = resp.data;
+        this.options.allAngleOption = {
+          thetaIncidentOptions: [],
+          phiIncidentOptions: [],
+          thetaReflectedOptions: [],
+          phiReflectedList: [],
+        };
+      });
+    },
+    changeSampleModel(val) {
+      this.showResult = false;
+      const dataType = this.queryParams.dataType;
+      const sampleType = this.queryParams.sampleType;
+      this.queryParams = {
+        dataType,
+        sampleType,
+        sampleModel: val,
+        temperatureK: null,
+        wavelengthUm: null,
+        thetaIncident: null,
+        phiIncident: null,
+        thetaReflected: null,
+        phiReflected: null,
       };
-      getOthersOptions(params).then((resp) => {
-        this.options.sampleTypeOption = resp.data.sampleTypeOptions;
-        this.options.sampleModelOption = resp.data.sampleModelOptions;
+      getOthersOptions(this.queryParams).then((resp) => {
         this.options.temperatureKOption = resp.data.temperatureKOptions;
         this.options.allAngleOption = resp.data.allAngleOptions;
       });
     },
+
     // 修改 initChart 方法
     initChart() {
       // 确保容器存在