From 7d493a60203d5ecea26c28fac4b328c03d4e9499 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Wed, 17 Aug 2022 10:01:00 +0800 Subject: [PATCH] =?UTF-8?q?ai=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 1 + .../web/controller/pc/TRecordController.java | 28 ++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 89e2b35..7904855 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -337,6 +337,7 @@ public class AppController extends BaseController jsonObject = removeBase64Image(JSONObject.parseObject(result),recordId); TRecord tRecord = new TRecord(); tRecord.setId(recordId); + tRecord.setStatus("1"); tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecordService.updateTRecord(tRecord); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java index b78072d..ce64bb5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/pc/TRecordController.java @@ -3,15 +3,18 @@ package com.ruoyi.web.controller.pc; import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.TImage; import com.ruoyi.system.domain.req.AppRecordReq; import com.ruoyi.system.domain.req.TRecordResultReq; import com.ruoyi.system.domain.resp.RecordHistoryDataResp; import com.ruoyi.system.domain.resp.TRecordResp; +import com.ruoyi.system.service.ITImageService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections.CollectionUtils; @@ -49,6 +52,9 @@ public class TRecordController extends BaseController @Autowired private ITRecordService tRecordService; + @Resource + private ITImageService imageService; + /** * 查询诊断记录信息列表 */ @@ -123,7 +129,27 @@ public class TRecordController extends BaseController if(id == null){ return AjaxResult.error("未获取到id"); } - return AjaxResult.success(tRecordService.selectById(id)); + Map> data = new HashMap<>(); + List list = new ArrayList<>(); + list.add(tRecordService.selectById(id)); + data.put("result", Collections.singletonList(list)); + TImage tImage = new TImage(); + tImage.setThirdId(id); + List images = imageService.selectTImageList(tImage); + data.put("image", Collections.singletonList(images)); + return AjaxResult.success(data); + } + + @GetMapping("/image/{recordId}") + @ApiOperation("获取图片接口") + public AjaxResult getAiImage(@PathVariable("recordId") Long recordId){ + if(recordId == null){ + return AjaxResult.error("未获取到参数"); + } + TImage tImage = new TImage(); + tImage.setThirdId(recordId); + List images = imageService.selectTImageList(tImage); + return AjaxResult.success(images); } @GetMapping("getHistoryRecordList")