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")