Browse Source

问诊保存修改

rgb 6 years ago
parent
commit
04ec3286fd

+ 77 - 0
prec-service/src/main/java/com/diagbot/dto/EvaluatorCalDTO.java

@@ -0,0 +1,77 @@
+package com.diagbot.dto;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import com.diagbot.entity.PhysicalInfo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:56
+ */
+@ApiModel(value="儿童体质辨识--体质计算--接口出参")
+@Getter
+@Setter
+public class EvaluatorCalDTO{
+	
+    /**
+     * 平和体质转化分
+     */
+	 @ApiModelProperty(value="平和体质转化分")
+    private BigDecimal mildValue;
+	
+	/**
+     * 气虚体质转化分
+     */
+    @ApiModelProperty(value="气虚体质转化分")
+    private BigDecimal faintValue;
+
+    /**
+     * 湿滞体质转化分
+     */
+    @ApiModelProperty(value="湿滞体质转化分")
+    private BigDecimal wetValue;
+
+    /**
+     * 心肝火旺体质转化分
+     */
+    @ApiModelProperty(value="心肝火旺体质转化分")
+    private BigDecimal heartValue;
+
+    /**
+     * 积滞体质转化分
+     */
+    @ApiModelProperty(value="积滞体质转化分")
+    private BigDecimal stagnantValue;
+
+    /**
+     * 异禀体质转化分
+     */
+    @ApiModelProperty(value="异禀体质转化分")
+    private BigDecimal exceptValue;
+	
+    /**
+     * 体质结果
+     */
+	@ApiModelProperty(value="体质结果")
+    private String physicalRes;
+
+    /**
+     * 需要显示的体质逗号隔开
+     */
+	@ApiModelProperty(value="需要显示的体质逗号隔开")
+    private String physicalTypes;
+    
+	/**
+     * 体质结果基本信息列表
+     */
+	@ApiModelProperty(value="体质结果基本信息列表")
+    private List<PhysicalInfo> physicalInfoList;
+		
+}

+ 0 - 102
prec-service/src/main/java/com/diagbot/dto/SearchEvaluatorDTO.java

@@ -1,102 +0,0 @@
-package com.diagbot.dto;
-
-import com.diagbot.enums.SexEnum;
-import com.diagbot.util.ListUtil;
-import lombok.Getter;
-import lombok.Setter;
-
-import java.math.BigDecimal;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2019/5/30 10:53
- */
-
-@Getter
-@Setter
-public class SearchEvaluatorDTO {
-    /**
-     * 主键
-     */
-    private Long id;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    private Integer sex;
-
-    /**
-     * 性别名称(1:男 2:女)
-     */
-    private String sexName;
-
-    /**
-     * 年龄
-     */
-    private Integer age;
-
-    /**
-     * 平和体质转化分
-     */
-    private BigDecimal mildValue;
-
-    /**
-     * 气虚体质转化分
-     */
-    private BigDecimal faintValue;
-
-    /**
-     * 湿滞体质转化分
-     */
-    private BigDecimal wetValue;
-
-    /**
-     * 心肝火旺体质转化分
-     */
-    private BigDecimal heartValue;
-
-    /**
-     * 积滞体质转化分
-     */
-    private BigDecimal stagnantValue;
-
-    /**
-     * 异禀体质转化分
-     */
-    private BigDecimal exceptValue;
-
-    /**
-     * 体质结果
-     */
-    private String physicalRes;
-
-    /**
-     * 需要显示的体质逗号隔开
-     */
-    private String physicalTypes;
-
-    public String getSexName(){
-        return SexEnum.getName(this.getSex());
-    }
-
-    //体质显示列表
-    private List<PhysicalInfoDTO> physicalInfoDTOList = ListUtil.newArrayList();
-}

+ 0 - 2
prec-service/src/main/java/com/diagbot/entity/PhysicalVal.java

@@ -3,8 +3,6 @@ package com.diagbot.entity;
 import lombok.Getter;
 import lombok.Setter;
 
-import java.math.BigDecimal;
-
 /**
  * @Description:
  * @author: gaodm

+ 106 - 152
prec-service/src/main/java/com/diagbot/facade/InquiryEvaluatorFacade.java

@@ -1,35 +1,30 @@
 package com.diagbot.facade;
 
-import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
+import org.assertj.core.util.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.PhysicalInfoDTO;
-import com.diagbot.dto.SearchEvaluatorDTO;
+import com.diagbot.dto.EvaluatorCalDTO;
 import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.entity.InquiryInfo;
-import com.diagbot.entity.PhysicalInfo;
 import com.diagbot.entity.PhysicalVal;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.PhysicalTypeEnum;
-import com.diagbot.enums.SexEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.InquiryEvaluatorServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
-import com.diagbot.util.RegexValidateUtil;
 import com.diagbot.vo.AddEvaluatorVO;
-import com.diagbot.vo.SearchEvaluatorVO;
+import com.diagbot.vo.EvaluatorCalVO;
 
 /**
  * @author: zhoutg
@@ -42,194 +37,153 @@ public class InquiryEvaluatorFacade extends InquiryEvaluatorServiceImpl {
 	@Autowired
     private InquiryInfoFacade inquiryInfoFacade;
 
-    public static void main(String[] args) {
-    	InquiryEvaluatorFacade inquiryEvaluatorFacade = new InquiryEvaluatorFacade();
+	/**
+	 * 儿童体质辨识--添加
+	 * @param addDeptInfoVO
+	 * @return
+	 */
+    public Boolean addEvaluator(AddEvaluatorVO addDeptInfoVO) {
+        QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
+        inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+        inquiryInfoQe.eq("hospital_id", addDeptInfoVO.getHospitalId());
+        inquiryInfoQe.eq("hospital_dept_id", addDeptInfoVO.getHospitalDeptId());
+        inquiryInfoQe.eq("doctor_id", addDeptInfoVO.getDoctorId());
+        inquiryInfoQe.eq("patient_id", addDeptInfoVO.getPatientId());
+        inquiryInfoQe.eq("inquiry_code", addDeptInfoVO.getInquiryCode());
+        InquiryInfo inquiryInfo = inquiryInfoFacade.getOne(inquiryInfoQe);
+        
+        Date now = DateUtil.now();
+        
+        if(inquiryInfo==null){
+        	inquiryInfo = new InquiryInfo();
+        	inquiryInfo.setGmtCreate(now);
+        }
+        
+        BeanUtil.copyProperties(addDeptInfoVO, inquiryInfo);
+        inquiryInfo.setGmtModified(now);
+        inquiryInfoFacade.saveOrUpdate(inquiryInfo);
+
         InquiryEvaluator inquiryEvaluator = new InquiryEvaluator();
-        inquiryEvaluator.setMildValue(new BigDecimal(70.0)); // 平和体质
-        inquiryEvaluator.setFaintValue(new BigDecimal(50.0)); // 气虚体质
-        inquiryEvaluator.setStagnantValue(new BigDecimal(49.0)); // 积滞同质
-        inquiryEvaluator.setWetValue(new BigDecimal(31.0)); // 湿滞体质
-        inquiryEvaluator.setHeartValue(new BigDecimal(31.000)); // 心肝火旺体质
-        inquiryEvaluator.setExceptValue(new BigDecimal(22.01)); // 异禀体质
-        //inquiryEvaluatorFacade.valueSort(inquiryEvaluator);
-        inquiryEvaluatorFacade.cal(inquiryEvaluator);
+        BeanUtil.copyProperties(addDeptInfoVO, inquiryEvaluator);
+        inquiryEvaluator.setInquiryId(inquiryInfo.getId());
+        inquiryEvaluator.setGmtCreate(now);
+        inquiryEvaluator.setGmtModified(now);
+        
+        if (!save(inquiryEvaluator)) {
+            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "评估结果提交失败!");
+        }
+        
+        return true;
     }
-
-
+    
     /**
-     * 计算体质
-     *
-     * @param evaluator 参数
+     * 儿童体质辨识--体质计算
+     * @param evaluatorCalVO
      * @return
      */
-    public InquiryEvaluator cal(InquiryEvaluator evaluator) {
-
-        List<PhysicalVal> list = this.valueSort(evaluator);
-        Double max = list.get(0).getValue();
-        Double min = list.get(4).getValue();
-
-        if (max >= 50) {
+    public EvaluatorCalDTO evaluatorCal(EvaluatorCalVO evaluatorCalVO){
+    	EvaluatorCalDTO evaluatorCalDTO = new EvaluatorCalDTO();
+    	
+        List<PhysicalVal> physicalValList = valueSort(evaluatorCalVO);
+        Double max = physicalValList.get(0).getValue();
+        Double min = physicalValList.get(4).getValue();
+        
+        String physicalRes = null,physicalTypes=null;
+        if(max>=50){
             // 最大值有多个【是XX体质兼有XX体质】,最大值只有1个【是XX体质】
-            if (list.get(1).getValue() >= 50) {
-                evaluator.setPhysicalRes("是" +
-                        PhysicalTypeEnum.getName(list.get(0).getEnumNo())
-                        + "兼有" +
-                        PhysicalTypeEnum.getName(list.get(1).getEnumNo()));
-                evaluator.setPhysicalTypes("" + list.get(0).getEnumNo() + "," + list.get(1).getEnumNo());
-            } else {
-                evaluator.setPhysicalRes("是" +
-                        PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                evaluator.setPhysicalTypes("" + list.get(0).getEnumNo());
+            if(physicalValList.get(1).getValue()>=50){
+            	physicalRes = "是" 
+            				+ PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo())
+            				+ "兼有" 
+            				+ PhysicalTypeEnum.getName(physicalValList.get(1).getEnumNo());
+            	physicalTypes = physicalValList.get(0).getEnumNo() 
+            				  + "," 
+            				  + physicalValList.get(1).getEnumNo();
+            }else{
+            	physicalRes = "是" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+            	physicalTypes = String.valueOf(physicalValList.get(0).getEnumNo());
             }
-        } else if (max < 30) {
+        }else if(max<30){
             // 同时其他5种体质转化分均<30分, max[2/3/4/5/6] < 30
-            evaluator.setPhysicalRes("平和体质");
-            evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()));
-        } else {
-            if (evaluator.getMildValue().doubleValue() >= 60.0) {
-                if (max < 50 && min >= 30) {
+        	physicalRes = "平和体质";
+        	physicalTypes = String.valueOf(PhysicalTypeEnum.mild.getKey());
+        }else{
+            if(evaluatorCalVO.getMildValue().doubleValue()>=60.0){
+                if(max<50&&min>=30){
                     // 同时其他5种体质转化分均<50分,min[2/3/4/5/6] >= 30 and max[2/3/4/5/6] < 50
-                    evaluator.setPhysicalRes("基本是平和体质");
-                    evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()));
-                } else if (max < 50 && max >= 30 && min < 30) {
+                	physicalRes = "基本是平和体质";
+                	physicalTypes = String.valueOf(PhysicalTypeEnum.mild.getKey());
+                }else if(max<50&&max>=30&&min<30){
                     // 同时其他5种体质转化分有30-49分,max[2/3/4/5/6] < 50 and max[2/3/4/5/6] >= 30 and min[2/3/4/5/6] < 30
-                    evaluator.setPhysicalRes("基本是平和体质兼倾向" + PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                    evaluator.setPhysicalTypes(String.valueOf(PhysicalTypeEnum.mild.getKey()) + "," + list.get(0).getEnumNo());
+                	physicalRes = "基本是平和体质兼倾向" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+                	physicalTypes = PhysicalTypeEnum.mild.getKey() + "," + physicalValList.get(0).getEnumNo();
                 }
-            } else {
-                if (list.get(0).getValue().equals(list.get(1).getValue())) {
-                    evaluator.setPhysicalRes(
-                            "倾向是" +
-                                    PhysicalTypeEnum.getName(list.get(0).getEnumNo())
-                                    + "兼有" +
-                                    PhysicalTypeEnum.getName(list.get(1).getEnumNo()));
-                    evaluator.setPhysicalTypes("" + list.get(0).getEnumNo() + "," + list.get(1).getEnumNo());
-                } else {
-                    evaluator.setPhysicalRes("倾向是" +
-                            PhysicalTypeEnum.getName(list.get(0).getEnumNo()));
-                    evaluator.setPhysicalTypes("" + list.get(0).getEnumNo());
+            }else{
+                if(physicalValList.get(0).getValue().equals(physicalValList.get(1).getValue())){
+                	physicalRes = "倾向是" 
+                                + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo())
+                                + "兼有" 
+                                + PhysicalTypeEnum.getName(physicalValList.get(1).getEnumNo());
+                	physicalTypes = physicalValList.get(0).getEnumNo() + "," + physicalValList.get(1).getEnumNo();
+                }else{
+                	physicalRes = "倾向是" + PhysicalTypeEnum.getName(physicalValList.get(0).getEnumNo());
+                	physicalTypes = String.valueOf(physicalValList.get(0).getEnumNo());
                 }
             }
         }
-        return evaluator;
+        
+        BeanUtil.copyProperties(evaluatorCalVO, evaluatorCalDTO);;
+        evaluatorCalDTO.setPhysicalRes(physicalRes);
+        evaluatorCalDTO.setPhysicalTypes(physicalTypes);
+        evaluatorCalDTO.setPhysicalInfoList(Lists.newArrayList(physicalInfoFacade.listByIds(Arrays.asList(physicalTypes.split(",")).stream().map(i->Integer.parseInt(i)).collect(Collectors.toList()))));
+        
+        return evaluatorCalDTO;
     }
-
-
+    
+    
     /**
      * 对偏颇体质排序
-     *
-     * @param evaluator
-     * @return 列表
+     * @param evaluatorCalVO
+     * @return
      */
-    private List<PhysicalVal> valueSort(InquiryEvaluator evaluator){
+    private List<PhysicalVal> valueSort(EvaluatorCalVO evaluatorCalVO){
         List<PhysicalVal> res = ListUtil.newArrayList();
         //气虚体质转化分
         PhysicalVal faintValue = new PhysicalVal();
-        faintValue.setValue(evaluator.getFaintValue().doubleValue());
+        faintValue.setValue(evaluatorCalVO.getFaintValue().doubleValue());
         faintValue.setEnumNo(PhysicalTypeEnum.faint.getKey());
         faintValue.setOrderNo(1);
         res.add(faintValue);
         //积滞体质转化分
         PhysicalVal stagnantValue = new PhysicalVal();
-        stagnantValue.setValue(evaluator.getStagnantValue().doubleValue());
+        stagnantValue.setValue(evaluatorCalVO.getStagnantValue().doubleValue());
         stagnantValue.setEnumNo(PhysicalTypeEnum.stagnant.getKey());
         stagnantValue.setOrderNo(2);
         res.add(stagnantValue);
         //湿滞体质转化分
         PhysicalVal wetValue = new PhysicalVal();
-        wetValue.setValue(evaluator.getWetValue().doubleValue());
+        wetValue.setValue(evaluatorCalVO.getWetValue().doubleValue());
         wetValue.setEnumNo(PhysicalTypeEnum.wet.getKey());
         wetValue.setOrderNo(3);
         res.add(wetValue);
         //心肝火旺体质转化分
         PhysicalVal heartValue = new PhysicalVal();
-        heartValue.setValue(evaluator.getHeartValue().doubleValue());
+        heartValue.setValue(evaluatorCalVO.getHeartValue().doubleValue());
         heartValue.setEnumNo(PhysicalTypeEnum.heart.getKey());
         heartValue.setOrderNo(4);
         res.add(heartValue);
         //异禀体质转化分
         PhysicalVal exceptValue = new PhysicalVal();
-        exceptValue.setValue(evaluator.getExceptValue().doubleValue());
+        exceptValue.setValue(evaluatorCalVO.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))
+        return res.stream()
+                .sorted(Comparator.comparing(PhysicalVal::getValue)
+                .reversed()
+                .thenComparing(PhysicalVal::getOrderNo))
                 .collect(Collectors.toList());
-        return collect;
-    }
-
-    public Boolean addEvaluator(AddEvaluatorVO addDeptInfoVO) {
-        //参数验证
-        if (!RegexValidateUtil.checkMobileNumber(addDeptInfoVO.getPhone())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "请输入正确的手机号");
-        }
-        if (null == SexEnum.getName(addDeptInfoVO.getSex())) {
-            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
-                    "请输入正确的性别类型");
-        }
-        
-        Date now = DateUtil.now();
-        
-        QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
-        inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
-        inquiryInfoQe.eq("hospital_id", addDeptInfoVO.getHospitalId());
-        inquiryInfoQe.eq("hospital_dept_id", addDeptInfoVO.getHospitalDeptId());
-        inquiryInfoQe.eq("doctor_id", addDeptInfoVO.getDoctorId());
-        inquiryInfoQe.eq("patient_id", addDeptInfoVO.getPatientId());
-        inquiryInfoQe.eq("inquiry_code", addDeptInfoVO.getInquiryCode());
-        InquiryInfo inquiryInfo = inquiryInfoFacade.getOne(inquiryInfoQe);
-        
-        if(inquiryInfo==null){
-        	inquiryInfo = new InquiryInfo();
-        	inquiryInfo.setGmtCreate(now);
-        }
-        
-        BeanUtil.copyProperties(addDeptInfoVO, inquiryInfo);
-        inquiryInfo.setGmtModified(now);
-        inquiryInfoFacade.saveOrUpdate(inquiryInfo);
-
-        InquiryEvaluator evaluator = new InquiryEvaluator();
-        BeanUtil.copyProperties(addDeptInfoVO, evaluator);
-        evaluator.setInquiryId(inquiryInfo.getId());
-        
-        //计算
-        this.cal(evaluator);
-
-        //保存结果
-        evaluator.setIsDeleted(IsDeleteEnum.N.getKey());
-        evaluator.setGmtCreate(now);
-        evaluator.setGmtModified(now);
-        Boolean res = this.save(evaluator);
-        if (!res) {
-            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "评估结果提交失败!");
-        }
-        return res;
     }
-
-    public IPage<SearchEvaluatorDTO> getEvaluatorPage(SearchEvaluatorVO searchEvaluatorVO) {
-        IPage<SearchEvaluatorDTO> res = this.baseMapper.getEvaluators(searchEvaluatorVO);
-        if (ListUtil.isNotEmpty(res.getRecords())) {
-            Map<String, PhysicalInfo> pMap = physicalInfoFacade.getPhysicalMap();
-
-            for (SearchEvaluatorDTO searchEvaluatorDTO : res.getRecords()) {
-                String[] physicalTypes = searchEvaluatorDTO.getPhysicalTypes().split(",");
-                List<PhysicalInfoDTO> physicalInfoDTOList = ListUtil.newArrayList();
-                for (String s : physicalTypes) {
-                    PhysicalInfoDTO physicalInfoDTO = new PhysicalInfoDTO();
-                    if (null != pMap.get(s)) {
-                        BeanUtil.copyProperties(pMap.get(s), physicalInfoDTO);
-                        physicalInfoDTOList.add(physicalInfoDTO);
-                    }
-                }
-                searchEvaluatorDTO.setPhysicalInfoDTOList(physicalInfoDTOList);
-            }
-        }
-        return res;
-    }
-
+    
 }

+ 1 - 5
prec-service/src/main/java/com/diagbot/mapper/InquiryEvaluatorMapper.java

@@ -1,10 +1,7 @@
 package com.diagbot.mapper;
 
-import com.diagbot.dto.SearchEvaluatorDTO;
-import com.diagbot.entity.InquiryEvaluator;
-import com.diagbot.vo.SearchEvaluatorVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.entity.InquiryEvaluator;
 
 /**
  * <p>
@@ -16,6 +13,5 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
  */
 public interface InquiryEvaluatorMapper extends BaseMapper<InquiryEvaluator> {
 	
-	IPage<SearchEvaluatorDTO> getEvaluators(SearchEvaluatorVO searchEvaluatorVO);
 
 }

+ 52 - 32
prec-service/src/main/java/com/diagbot/vo/AddEvaluatorVO.java

@@ -1,21 +1,23 @@
 package com.diagbot.vo;
 
-import lombok.Getter;
-import lombok.Setter;
+import java.math.BigDecimal;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
-import io.swagger.annotations.ApiModelProperty;
+import org.hibernate.validator.constraints.Range;
 
-import java.math.BigDecimal;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
 
 /**
  * @Description:
  * @author: gaodm
  * @time: 2019/5/30 10:53
  */
-
+@ApiModel(value="儿童体质辨识--添加--接口传参")
 @Getter
 @Setter
 public class AddEvaluatorVO {
@@ -26,6 +28,13 @@ public class AddEvaluatorVO {
 	@ApiModelProperty(value="医院id",required=true)
 	@NotNull(message="医院id必传")
     private Long hospitalId;
+	
+    /**
+     * 医院编码
+     */
+	@ApiModelProperty(value="医院编码",required=true)
+	@NotBlank(message="医院编码必传")
+    private String hospitalCode;
 
     /**
      * 科室id
@@ -55,63 +64,74 @@ public class AddEvaluatorVO {
 	@NotBlank(message="就诊序列号必传")
     private String inquiryCode;
 	
-    /**
-     * 姓名
-     */
-    @NotBlank(message = "请输入姓名")
-    private String name;
-
-    /**
-     * 手机号
-     */
-    @NotBlank(message = "请输手机号")
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
+	/**
+     * 就诊状态(0待接诊,1接诊中,2完成接诊)
      */
-    @NotNull(message = "请输入性别")
-    private Integer sex;
+	@ApiModelProperty(value="就诊状态(0待接诊,1接诊中,2完成接诊)")
+	@Range(min=0,max=2,message="就诊状态必须是0、1、2")
+	private Integer regVisitedState=1;
 
     /**
-     * 年龄
+     * 病历分类(1:门诊,2:住院)
      */
-    @NotNull(message = "请输入年龄")
-    private Integer age;
-
-    /**
+	@ApiModelProperty(value="病历分类(1:门诊,2:住院)")
+	@Range(min=1,max=2,message="病历分类必须是1、2")
+    private Integer type=1;
+	
+	/**
      * 平和体质转化分
      */
-    @NotNull(message = "请输入平和体质转化分")
+	@ApiModelProperty(value="平和体质转化分",required=true)
+	@NotNull(message="平和体质转化分必传")
     private BigDecimal mildValue;
 
     /**
      * 气虚体质转化分
      */
-    @NotNull(message = "请输入气虚体质转化分")
+    @ApiModelProperty(value="气虚体质转化分",required=true)
+	@NotNull(message="气虚体质转化分必传")
     private BigDecimal faintValue;
 
     /**
      * 湿滞体质转化分
      */
-    @NotNull(message = "请输入湿滞体质转化分")
+    @ApiModelProperty(value="湿滞体质转化分",required=true)
+	@NotNull(message="湿滞体质转化分必传")
     private BigDecimal wetValue;
 
     /**
      * 心肝火旺体质转化分
      */
-    @NotNull(message = "请输入心肝火旺体质转化分")
+    @ApiModelProperty(value="心肝火旺体质转化分",required=true)
+	@NotNull(message="心肝火旺体质转化分必传")
     private BigDecimal heartValue;
 
     /**
      * 积滞体质转化分
      */
-    @NotNull(message = "请输入积滞体质转化分")
+    @ApiModelProperty(value="积滞体质转化分",required=true)
+	@NotNull(message="积滞体质转化分必传")
     private BigDecimal stagnantValue;
 
     /**
      * 异禀体质转化分
      */
-    @NotNull(message = "请输入异禀体质转化分")
+    @ApiModelProperty(value="异禀体质转化分",required=true)
+	@NotNull(message="异禀体质转化分必传")
     private BigDecimal exceptValue;
+    
+    /**
+     * 体质结果
+     */
+	@ApiModelProperty(value="体质结果",required=true)
+	@NotBlank(message="体质结果必传")
+    private String physicalRes;
+
+    /**
+     * 需要显示的体质逗号隔开
+     */
+	@ApiModelProperty(value="需要显示的体质逗号隔开",required=true)
+	@NotBlank(message="需要显示的体质逗号隔开必传")
+    private String physicalTypes;
+	
 }

+ 65 - 0
prec-service/src/main/java/com/diagbot/vo/EvaluatorCalVO.java

@@ -0,0 +1,65 @@
+package com.diagbot.vo;
+
+import java.math.BigDecimal;
+
+import javax.validation.constraints.NotNull;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: rengb
+ * @time: 2018/11/19 18:58
+ */
+@ApiModel(value="儿童体质辨识--体质计算--接口传参")
+@Getter
+@Setter
+public class EvaluatorCalVO {
+	
+    /**
+     * 平和体质转化分
+     */
+	@ApiModelProperty(value="平和体质转化分",required=true)
+	@NotNull(message="平和体质转化分必传")
+    private BigDecimal mildValue;
+
+    /**
+     * 气虚体质转化分
+     */
+    @ApiModelProperty(value="气虚体质转化分",required=true)
+	@NotNull(message="气虚体质转化分必传")
+    private BigDecimal faintValue;
+
+    /**
+     * 湿滞体质转化分
+     */
+    @ApiModelProperty(value="湿滞体质转化分",required=true)
+	@NotNull(message="湿滞体质转化分必传")
+    private BigDecimal wetValue;
+
+    /**
+     * 心肝火旺体质转化分
+     */
+    @ApiModelProperty(value="心肝火旺体质转化分",required=true)
+	@NotNull(message="心肝火旺体质转化分必传")
+    private BigDecimal heartValue;
+
+    /**
+     * 积滞体质转化分
+     */
+    @ApiModelProperty(value="积滞体质转化分",required=true)
+	@NotNull(message="积滞体质转化分必传")
+    private BigDecimal stagnantValue;
+
+    /**
+     * 异禀体质转化分
+     */
+    @ApiModelProperty(value="异禀体质转化分",required=true)
+	@NotNull(message="异禀体质转化分必传")
+    private BigDecimal exceptValue;
+	
+    
+}

+ 0 - 30
prec-service/src/main/java/com/diagbot/vo/SearchEvaluatorVO.java

@@ -1,30 +0,0 @@
-package com.diagbot.vo;
-
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2019/5/30 10:53
- */
-
-@Getter
-@Setter
-public class SearchEvaluatorVO extends Page {
-    /**
-     * 姓名
-     */
-    private String name;
-
-    /**
-     * 手机号
-     */
-    private String phone;
-
-    /**
-     * 性别(1:男 2:女)
-     */
-    private Integer sex;
-}

+ 10 - 32
prec-service/src/main/java/com/diagbot/web/InquiryEvaluatorController.java

@@ -9,14 +9,12 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.EvaluatorCalDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.SearchEvaluatorDTO;
-import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.facade.InquiryEvaluatorFacade;
 import com.diagbot.vo.AddEvaluatorVO;
-import com.diagbot.vo.SearchEvaluatorVO;
+import com.diagbot.vo.EvaluatorCalVO;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -30,39 +28,19 @@ public class InquiryEvaluatorController {
     @Autowired
     private InquiryEvaluatorFacade inquiryEvaluatorFacade;
 
-    @ApiOperation(value = "儿童体质辨识--添加[by:gaodm]",
-            	  notes = "name: 姓名,必填<br>" +
-            			  "phone: 手机号,必填<br>" +
-            			  "sex: 性别(1:男 2:女),必填<br>" +
-            			  "age: 年龄,必填<br>" +
-            			  "mildValue: 平和体质转化分,必填<br>" +
-            			  "faintValue: 气虚体质转化分,必填<br>" +
-            			  "wetValue: 湿滞体质转化分,必填<br>" +
-            			  "heartValue: 心肝火旺体质转化分,必填<br>" +
-            			  "stagnantValue: 积滞体质转化分,必填<br>" +
-                    	  "exceptValue: 异禀体质转化分,必填")
+    @ApiOperation(value = "儿童体质辨识--添加")
     @PostMapping("/addEvaluator")
     @SysLogger("addEvaluator")
     @Transactional
-    public RespDTO<Boolean> addEvaluator(@RequestBody @Valid AddEvaluatorVO addDeptInfoVO){
+    public RespDTO<Boolean> addEvaluator(@Valid @RequestBody AddEvaluatorVO addDeptInfoVO){
         return RespDTO.onSuc(inquiryEvaluatorFacade.addEvaluator(addDeptInfoVO));
     }
 
-    @ApiOperation(value = "儿童体质辨识--获取分页信息[by:gaodm]",
-            	  notes = "name: 姓名<br>" +
-            			  "phone: 手机号<br>" +
-                    	  "sex: 性别(1:男 2:女)")
-    @PostMapping("/getEvaluatorPage")
-    @SysLogger("getEvaluatorPage")
-    public RespDTO<IPage<SearchEvaluatorDTO>> getEvaluatorPage(@RequestBody SearchEvaluatorVO searchEvaluatorVO){
-        return RespDTO.onSuc(inquiryEvaluatorFacade.getEvaluatorPage(searchEvaluatorVO));
-    }
-
-    @ApiOperation(value = "体质规则计算,测试使用", notes = "体质规则计算,测试使用")
-    @PostMapping("/cal2")
-    @SysLogger("cal2")
-    public RespDTO<String> cal2(@RequestBody InquiryEvaluator inquiryEvaluator) {
-    	inquiryEvaluatorFacade.cal(inquiryEvaluator);
-        return RespDTO.onSuc(inquiryEvaluator.getPhysicalRes());
+    @ApiOperation(value = "儿童体质辨识--体质计算")
+    @PostMapping("/evaluatorCal")
+    @SysLogger("evaluatorCal")
+    public RespDTO<EvaluatorCalDTO> evaluatorCal(@Valid @RequestBody EvaluatorCalVO evaluatorCalVO) {
+        return RespDTO.onSuc(inquiryEvaluatorFacade.evaluatorCal(evaluatorCalVO));
     }
+    
 }

+ 0 - 17
prec-service/src/main/resources/mapper/InquiryEvaluatorMapper.xml

@@ -26,22 +26,5 @@
         <result column="physical_types" property="physicalTypes" />
     </resultMap>
     
-    <select id="getEvaluators" resultType="com.diagbot.dto.SearchEvaluatorDTO">
-        SELECT
-        a.*
-        FROM prec_evaluator a
-        WHERE
-        a.is_deleted = 'N'
-        <if test="name != null and name != ''">
-            AND a.`name` LIKE CONCAT('%',#{name},'%')
-        </if>
-        <if test="phone != null and phone != ''">
-            AND a.`phone` LIKE CONCAT('%',#{phone},'%')
-        </if>
-        <if test="sex != null">
-            AND a.`sex` = #{sex}
-        </if>
-        ORDER BY a.gmt_create DESC
-    </select>
 
 </mapper>