From 88edaf51b771f5362e3eae6dc43fc4cf561f7363 Mon Sep 17 00:00:00 2001 From: chenfei <18955928961@163.com> Date: Fri, 19 Aug 2022 13:56:39 +0800 Subject: [PATCH] =?UTF-8?q?ai=E4=B8=8A=E4=BC=A0=E5=BC=80=E5=A7=8B=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=92=8CAI=E7=BB=93=E6=9E=9C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/api/AppController.java | 15 ++--- .../java/com/ruoyi/system/domain/TRecord.java | 58 ++++++++++--------- 2 files changed, 38 insertions(+), 35 deletions(-) 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 45d209e..0372a2c 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 @@ -28,6 +28,8 @@ import org.springframework.web.bind.annotation.*; import sun.misc.BASE64Decoder; import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.*; import java.util.stream.Collectors; @@ -356,13 +358,13 @@ public class AppController extends BaseController String URL = RequestParamsUtil.HTTP + ip + RequestParamsUtil.SEPARATOR + port + url; JSONObject jsonObject = new JSONObject(); String result; - long start; - long end; + Date start; + Date end; try { - start = System.currentTimeMillis(); + start = new Date(); result = HttpUtils.sendPost(URL, mapper.writeValueAsString(delNullData(aiPostReq))); - end = System.currentTimeMillis(); + end = new Date(); } catch (Exception e) { @@ -383,9 +385,8 @@ public class AppController extends BaseController throw new ServiceException(data.getString("msg")); } jsonObject = removeBase64Image(data,recordId); - tRecord.setAiResultReturnTime(new Date()); - tRecord.setUpdateTime(new Date()); - tRecord.setResponseTime((end-start)/1000); + tRecord.setUploadTime(start); + tRecord.setAiResultReturnTime(end); tRecord.setAiResult(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecord.setAiResult2(JSONObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue)); tRecordService.updateTRecord(tRecord); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java index 70009e2..3ad0fb2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TRecord.java @@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 诊断记录信息对象 t_record - * + * * @author ruoyi * @date 2022-08-03 */ @@ -53,7 +53,7 @@ public class TRecord extends BaseEntity private String updateResult2; /** 上传时间 */ - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd") private Date uploadTime; @@ -71,126 +71,128 @@ public class TRecord extends BaseEntity /** 响应时长 */ @Excel(name = "ai结果返回时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date aiResultReturnTime; /** 响应时长 */ @Excel(name = "ai结果修改时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date aiResultModifyTime; - public void setId(Long id) + public void setId(Long id) { this.id = id; } - public Long getId() + public Long getId() { return id; } - public void setPatientId(Long patientId) + public void setPatientId(Long patientId) { this.patientId = patientId; } - public Long getPatientId() + public Long getPatientId() { return patientId; } - public void setDoctorId(Long doctorId) + public void setDoctorId(Long doctorId) { this.doctorId = doctorId; } - public Long getDoctorId() + public Long getDoctorId() { return doctorId; } - public void setHospitalId(Long hospitalId) + public void setHospitalId(Long hospitalId) { this.hospitalId = hospitalId; } - public Long getHospitalId() + public Long getHospitalId() { return hospitalId; } - public void setStatus(String status) + public void setStatus(String status) { this.status = status; } - public String getStatus() + public String getStatus() { return status; } - public void setAiResult(String aiResult) + public void setAiResult(String aiResult) { this.aiResult = aiResult; } - public String getAiResult() + public String getAiResult() { return aiResult; } - public void setAiResult2(String aiResult2) + public void setAiResult2(String aiResult2) { this.aiResult2 = aiResult2; } - public String getAiResult2() + public String getAiResult2() { return aiResult2; } - public void setUpdateResult(String updateResult) + public void setUpdateResult(String updateResult) { this.updateResult = updateResult; } - public String getUpdateResult() + public String getUpdateResult() { return updateResult; } - public void setUpdateResult2(String updateResult2) + public void setUpdateResult2(String updateResult2) { this.updateResult2 = updateResult2; } - public String getUpdateResult2() + public String getUpdateResult2() { return updateResult2; } - public void setUploadTime(Date uploadTime) + public void setUploadTime(Date uploadTime) { this.uploadTime = uploadTime; } - public Date getUploadTime() + public Date getUploadTime() { return uploadTime; } - public void setImgSx(String imgSx) + public void setImgSx(String imgSx) { this.imgSx = imgSx; } - public String getImgSx() + public String getImgSx() { return imgSx; } - public void setImgSm(String imgSm) + public void setImgSm(String imgSm) { this.imgSm = imgSm; } - public String getImgSm() + public String getImgSm() { return imgSm; } - public void setResponseTime(Long responseTime) + public void setResponseTime(Long responseTime) { this.responseTime = responseTime; } - public Long getResponseTime() + public Long getResponseTime() { return responseTime; }