Ver código fonte

返回参数调整

gaodm 5 anos atrás
pai
commit
426176516b

+ 38 - 0
src/main/java/com/diagbot/dto/AnalyzeDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/15 12:24
+ */
+@Getter
+@Setter
+public class AnalyzeDTO {
+    // 病历id
+    private String behospitalCode;
+    //得分
+    private Boolean isSuccess;
+    //得分
+    private BigDecimal scoreRes;
+    //等级
+    private String level;
+    /**
+     * 评分类型(1:机器,2:人工)
+     */
+    private Integer gradeType;
+    /**
+     * 评分类型名称(1:机器,2:人工)
+     */
+    private String gradeTypeName;
+
+    /**
+     * 评分时间
+     */
+    private Date gradeTime;
+}

+ 13 - 3
src/main/java/com/diagbot/facade/BehospitalInfoFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.QcServiceClient;
 import com.diagbot.dto.AlgorithmDTO;
+import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.MsgDTO;
 import com.diagbot.dto.OutputInfo;
@@ -89,7 +90,7 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
     }
 
 
-    public Map<String, Object> analyze(AnalyzeVO analyzeVO) {
+    public AnalyzeDTO analyze(AnalyzeVO analyzeVO) {
         Map<String, Object> res = new HashMap<>(); // 返回结果
         Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
 //        Long hospitalId = 1L; // 写死
@@ -197,14 +198,23 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
         AlgorithmDTO algorithmDTO = algorithmFacade.getAlgorithmRes(algorithmVO);
         //保存
         String pageData = JSON.toJSONString(outputInfo.getPageData());
-        qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData);
+        Date date = qcresultInfoFacade.saveQcResult(algorithmDTO, algorithmVO, analyzeVO, pageData);
         res.put("pageData", pageData);
 
         // 返回提示信息
         List<MsgDTO> msgDTOList = getMsg(analyzeVO);
         Map<String, List<MsgDTO>> msgMap = EntityUtil.makeEntityListMap(msgDTOList, "modelName");
         res.put("msg", msgMap);
-        return res;
+        //返回参数组装
+        AnalyzeDTO analyzeDTO = new AnalyzeDTO();
+        analyzeDTO.setBehospitalCode(analyzeVO.getBehospitalCode());
+        analyzeDTO.setIsSuccess(true);
+        analyzeDTO.setGradeType(1);
+        analyzeDTO.setGradeTypeName("机器");
+        analyzeDTO.setScoreRes(algorithmDTO.getScore());
+        analyzeDTO.setLevel(algorithmDTO.getLevel());
+        analyzeDTO.setGradeTime(date);
+        return analyzeDTO;
     }
 
 

+ 15 - 5
src/main/java/com/diagbot/facade/QcresultInfoFacade.java

@@ -3,6 +3,7 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.AlgorithmDTO;
+import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.entity.QcresultDetail;
 import com.diagbot.entity.QcresultInfo;
 import com.diagbot.enums.IsDeleteEnum;
@@ -40,7 +41,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
     @Autowired
     private AlgorithmFacade algorithmFacade;
 
-    public Boolean changeQcResult(QcresultVO qcresultVO) {
+    public AnalyzeDTO changeQcResult(QcresultVO qcresultVO) {
         //入参验证
         if (StringUtil.isBlank(qcresultVO.getBehospitalCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "病历id不能为空!");
@@ -81,11 +82,20 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
         AnalyzeVO analyzeVO = new AnalyzeVO();
         analyzeVO.setHospitalId(hospitalId);
         analyzeVO.setBehospitalCode(qcresultVO.getBehospitalCode());
-        this.saveQcResult(algorithmDTO, algorithmVO, analyzeVO,null);
-        return true;
+        Date date = this.saveQcResult(algorithmDTO, algorithmVO, analyzeVO,null);
+        //返回参数组装
+        AnalyzeDTO analyzeDTO = new AnalyzeDTO();
+        analyzeDTO.setBehospitalCode(qcresultVO.getBehospitalCode());
+        analyzeDTO.setIsSuccess(true);
+        analyzeDTO.setGradeType(2);
+        analyzeDTO.setGradeTypeName("人工");
+        analyzeDTO.setScoreRes(algorithmDTO.getScore());
+        analyzeDTO.setLevel(algorithmDTO.getLevel());
+        analyzeDTO.setGradeTime(date);
+        return analyzeDTO;
     }
 
-    public Boolean saveQcResult(AlgorithmDTO algorithmDTO, AlgorithmVO algorithmVO, AnalyzeVO analyzeVO, String pageData) {
+    public Date saveQcResult(AlgorithmDTO algorithmDTO, AlgorithmVO algorithmVO, AnalyzeVO analyzeVO, String pageData) {
         //更新质控评分结果信息
         Long useId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
         Date now = DateUtil.now();
@@ -152,6 +162,6 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
             }
             qcresultDetailServiceImpl.saveBatch(qcresultDetailList);
         }
-        return true;
+        return now;
     }
 }

+ 6 - 6
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -2,6 +2,7 @@ package com.diagbot.web;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.AnalyzeDTO;
 import com.diagbot.dto.BehospitalInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.BehospitalInfoFacade;
@@ -55,16 +56,15 @@ public class BehospitalInfoController {
             notes = "")
     @PostMapping("/analyze")
     @SysLogger("analyze")
-    public RespDTO<Map<String, Object>> analyze(@RequestBody AnalyzeVO analyzeVO) {
-        Map<String, Object> data = behospitalInfoFacade.analyze(analyzeVO);
-        return RespDTO.onSuc(data);
+    public RespDTO<AnalyzeDTO> analyze(@RequestBody AnalyzeVO analyzeVO) {
+        return RespDTO.onSuc(behospitalInfoFacade.analyze(analyzeVO));
     }
 
     @ApiOperation(value = "新增质控条目[by:zhoutg]",
             notes = "")
     @PostMapping("/addCase")
     @SysLogger("addCase")
-    public RespDTO<Boolean> addCase(@RequestBody QcresultVO qcresultVO){
+    public RespDTO<AnalyzeDTO> addCase(@RequestBody QcresultVO qcresultVO){
         qcresultVO.setType(1);
         return RespDTO.onSuc(qcresultInfoFacade.changeQcResult(qcresultVO));
     }
@@ -73,7 +73,7 @@ public class BehospitalInfoController {
             notes = "")
     @PostMapping("/delCase")
     @SysLogger("delCase")
-    public RespDTO<Boolean> delCase(@RequestBody QcresultVO qcresultVO){
+    public RespDTO<AnalyzeDTO> delCase(@RequestBody QcresultVO qcresultVO){
         qcresultVO.setType(2);
         return RespDTO.onSuc(qcresultInfoFacade.changeQcResult(qcresultVO));
     }
@@ -82,7 +82,7 @@ public class BehospitalInfoController {
             notes = "")
     @PostMapping("/updCase")
     @SysLogger("updCase")
-    public RespDTO<Boolean> updCase(@RequestBody QcresultVO qcresultVO){
+    public RespDTO<AnalyzeDTO> updCase(@RequestBody QcresultVO qcresultVO){
         qcresultVO.setType(3);
         return RespDTO.onSuc(qcresultInfoFacade.changeQcResult(qcresultVO));
     }