From d69ee0edbb5df260ac6b872357b88499d7914610 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期一, 30 十二月 2024 09:08:53 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/eyes --- manage/src/main/java/com/jilongda/manage/controller/TLensSeriesController.java | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 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 992f4bd..bcff7ea 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,7 @@ package com.jilongda.manage.controller; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.JsonArray; import com.jilongda.common.basic.ApiResult; @@ -20,6 +21,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * <p> @@ -97,34 +99,36 @@ } @ApiOperation(value = "根据系列id + 球/非球查询折射率列表 球/非球入参数1为球 2非球 3双飞") @GetMapping(value = "/refractiveIndexList") - public ApiResult<List<String>> refractiveIndexList(Integer id, Integer lensType) { + public ApiResult<JSONArray> refractiveIndexList(Integer id, Integer lensType) { TLensSeries byId = lensSeriesService.getById(id); + JSONArray jsonArray = null; if (lensType==1){ String sphere = byId.getSphere(); // 将字符串化为jsonArray if (StringUtils.hasLength(sphere)) { - JSONObject.parseArray(sphere); + jsonArray = JSONObject.parseArray(sphere); } else { - return ApiResult.success(new ArrayList<String>()); + return ApiResult.success(new JSONArray()); } } if (lensType==2){ String asphericSurface = byId.getAsphericSurface(); if (StringUtils.hasLength(asphericSurface)) { - JSONObject.parseArray(asphericSurface); + jsonArray = JSONObject.parseArray(asphericSurface); } else { - return ApiResult.success(new ArrayList<String>()); + return ApiResult.success(new JSONArray()); } } if (lensType==3){ String doubleNon = byId.getDoubleNon(); if (StringUtils.hasLength(doubleNon)) { - JSONObject.parseArray(doubleNon); + jsonArray = JSONObject.parseArray(doubleNon); } else { - return ApiResult.success(new ArrayList<String>()); + return ApiResult.success(new JSONArray()); } } - return ApiResult.success(new ArrayList<String>()); + + return ApiResult.success(jsonArray); } } -- Gitblit v1.7.1