|
@@ -1,11 +1,15 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.client.AiptServiceClient;
|
|
import com.diagbot.client.AiptServiceClient;
|
|
-import com.diagbot.dto.CalculateDTO;
|
|
|
|
|
|
+import com.diagbot.client.bean.Response;
|
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
|
+import com.diagbot.exception.CommonException;
|
|
import com.diagbot.vo.CalculateVO;
|
|
import com.diagbot.vo.CalculateVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
* @Author:zhaops
|
|
* @Author:zhaops
|
|
@@ -16,11 +20,12 @@ public class CalculateFacade {
|
|
@Autowired
|
|
@Autowired
|
|
AiptServiceClient aiptServiceClient;
|
|
AiptServiceClient aiptServiceClient;
|
|
|
|
|
|
- public CalculateDTO calculate(CalculateVO calculateVO) {
|
|
|
|
- CalculateDTO calculateDTO = new CalculateDTO();
|
|
|
|
- calculateDTO.setValue(10D);
|
|
|
|
- calculateDTO.setUnit("ml/min•1.73m2");
|
|
|
|
- calculateDTO.setText("肾功能衰竭");
|
|
|
|
- return calculateDTO;
|
|
|
|
|
|
+ public Map<String, Object> calculate(CalculateVO calculateVO) {
|
|
|
|
+ Response<Map<String, Object>> res = aiptServiceClient.scaleCalc(calculateVO);
|
|
|
|
+ if (res == null || res.getData() == null) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "计算没有结果返回");
|
|
|
|
+ }
|
|
|
|
+ Map<String, Object> map = res.getData();
|
|
|
|
+ return map;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|