|
@@ -12,7 +12,6 @@ import com.diagbot.enums.SexEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.EvaluatorServiceImpl;
|
|
|
-import com.diagbot.util.ArrayUtil;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
@@ -23,10 +22,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description:
|
|
@@ -48,7 +49,7 @@ public class EvaluatorFacade extends EvaluatorServiceImpl {
|
|
|
evaluator.setHeartValue(new BigDecimal(41.)); // 心肝火旺体质
|
|
|
evaluator.setStagnantValue(new BigDecimal(42.00)); // 积滞同质
|
|
|
evaluator.setExceptValue(new BigDecimal(42.01)); // 异禀体质
|
|
|
- evaluatorFacade.cal(evaluator);
|
|
|
+ evaluatorFacade.valueSort(evaluator);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -364,7 +365,43 @@ public class EvaluatorFacade extends EvaluatorServiceImpl {
|
|
|
|
|
|
private List<PhysicalVal> valueSort(Evaluator evaluator){
|
|
|
List<PhysicalVal> res = ListUtil.newArrayList();
|
|
|
- return res;
|
|
|
+ //气虚体质转化分
|
|
|
+ PhysicalVal faintValue = new PhysicalVal();
|
|
|
+ faintValue.setValue(evaluator.getFaintValue().doubleValue());
|
|
|
+ faintValue.setEnumNo(PhysicalTypeEnum.faint.getKey());
|
|
|
+ faintValue.setOrderNo(1);
|
|
|
+ res.add(faintValue);
|
|
|
+ //积滞体质转化分
|
|
|
+ PhysicalVal stagnantValue = new PhysicalVal();
|
|
|
+ stagnantValue.setValue(evaluator.getStagnantValue().doubleValue());
|
|
|
+ stagnantValue.setEnumNo(PhysicalTypeEnum.stagnant.getKey());
|
|
|
+ stagnantValue.setOrderNo(2);
|
|
|
+ res.add(stagnantValue);
|
|
|
+ //湿滞体质转化分
|
|
|
+ PhysicalVal wetValue = new PhysicalVal();
|
|
|
+ wetValue.setValue(evaluator.getWetValue().doubleValue());
|
|
|
+ wetValue.setEnumNo(PhysicalTypeEnum.wet.getKey());
|
|
|
+ wetValue.setOrderNo(3);
|
|
|
+ res.add(wetValue);
|
|
|
+ //心肝火旺体质转化分
|
|
|
+ PhysicalVal heartValue = new PhysicalVal();
|
|
|
+ heartValue.setValue(evaluator.getHeartValue().doubleValue());
|
|
|
+ heartValue.setEnumNo(PhysicalTypeEnum.heart.getKey());
|
|
|
+ heartValue.setOrderNo(4);
|
|
|
+ res.add(heartValue);
|
|
|
+ //异禀体质转化分
|
|
|
+ PhysicalVal exceptValue = new PhysicalVal();
|
|
|
+ exceptValue.setValue(evaluator.getExceptValue().doubleValue());
|
|
|
+ exceptValue.setEnumNo(PhysicalTypeEnum.except.getKey());
|
|
|
+ exceptValue.setOrderNo(5);
|
|
|
+ res.add(exceptValue);
|
|
|
+
|
|
|
+ List<PhysicalVal> collect
|
|
|
+ = res.stream()
|
|
|
+ .sorted(Comparator.comparing(PhysicalVal::getValue).reversed()
|
|
|
+ .thenComparing(PhysicalVal::getOrderNo))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ return collect;
|
|
|
}
|
|
|
|
|
|
public Boolean addEvaluator(AddEvaluatorVO addDeptInfoVO) {
|