From 65948198a6dc5e808440ac6874db6df8aab6d9ab Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期一, 23 十二月 2024 09:15:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java b/manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java
index a5c7a3e..992f4bd 100644
--- a/manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java
+++ b/manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java
@@ -1,6 +1,8 @@
 package com.jilongda.manage.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.JsonArray;
 import com.jilongda.common.basic.ApiResult;
 import com.jilongda.common.basic.PageInfo;
 import com.jilongda.manage.model.TLensSeries;
@@ -15,6 +17,9 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * <p>
@@ -69,5 +74,57 @@
         lensSeriesService.updateById(byId);
         return ApiResult.success();
     }
+    @ApiOperation(value = "通过品牌id查询镜片系列列表")
+    @GetMapping(value = "/seriesList")
+    public ApiResult<List<TLensSeries>> seriesList(Integer brandId) {
+        return ApiResult.success(lensSeriesService.lambdaQuery().eq(TLensSeries::getBrandId,brandId).list());
+    }
+    @ApiOperation(value = "通过系列id查询球/非球 返回参数1为球 2非球 3双飞")
+    @GetMapping(value = "/lensTypeList")
+    public ApiResult<List<Integer>> lensTypeList(Integer id) {
+        TLensSeries byId = lensSeriesService.getById(id);
+        List<Integer> integers = new ArrayList<>();
+        if (StringUtils.hasLength(byId.getSphere())){
+            integers.add(1);
+        }
+        if (StringUtils.hasLength(byId.getAsphericSurface())){
+            integers.add(2);
+        }
+        if (StringUtils.hasLength(byId.getDoubleNon())){
+            integers.add(3);
+        }
+        return ApiResult.success(integers);
+    }
+    @ApiOperation(value = "根据系列id + 球/非球查询折射率列表 球/非球入参数1为球 2非球 3双飞")
+    @GetMapping(value = "/refractiveIndexList")
+    public ApiResult<List<String>> refractiveIndexList(Integer id, Integer lensType) {
+        TLensSeries byId = lensSeriesService.getById(id);
+        if (lensType==1){
+            String sphere = byId.getSphere();
+            // 将字符串化为jsonArray
+            if (StringUtils.hasLength(sphere)) {
+                JSONObject.parseArray(sphere);
+            } else {
+                return ApiResult.success(new ArrayList<String>());
+            }
+        }
+        if (lensType==2){
+            String asphericSurface = byId.getAsphericSurface();
+            if (StringUtils.hasLength(asphericSurface)) {
+                JSONObject.parseArray(asphericSurface);
+            } else {
+                return ApiResult.success(new ArrayList<String>());
+            }
+        }
+        if (lensType==3){
+            String doubleNon = byId.getDoubleNon();
+            if (StringUtils.hasLength(doubleNon)) {
+                JSONObject.parseArray(doubleNon);
+            } else {
+                return ApiResult.success(new ArrayList<String>());
+            }
+        }
+        return ApiResult.success(new ArrayList<String>());
+    }
 }
 

--
Gitblit v1.7.1