| | |
| | | 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; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | @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); |
| | | } |
| | | } |
| | | |