|
@@ -4,6 +4,7 @@ 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;
|
|
@@ -11,12 +12,17 @@ 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.EvaluatorCalDTO;
|
|
|
+import com.diagbot.dto.GetEvaluatorPageDTO;
|
|
|
+import com.diagbot.dto.PhysicalInfoDTO;
|
|
|
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;
|
|
@@ -25,6 +31,7 @@ import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.vo.AddEvaluatorVO;
|
|
|
import com.diagbot.vo.EvaluatorCalVO;
|
|
|
+import com.diagbot.vo.GetEvaluatorPageVO;
|
|
|
|
|
|
/**
|
|
|
* @author: zhoutg
|
|
@@ -91,6 +98,34 @@ public class InquiryEvaluatorFacade extends InquiryEvaluatorServiceImpl {
|
|
|
return evaluatorCalDTO;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 儿童体质辨识--获取分页信息
|
|
|
+ * @param getEvaluatorPageVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public IPage<GetEvaluatorPageDTO> getEvaluatorPage(GetEvaluatorPageVO getEvaluatorPageVO){
|
|
|
+ IPage<GetEvaluatorPageDTO> ipage = this.baseMapper.getEvaluatorPage(getEvaluatorPageVO);
|
|
|
+ if(ListUtil.isNotEmpty(ipage.getRecords())){
|
|
|
+ Map<String, PhysicalInfo> physicalInfoMap = physicalInfoFacade.getPhysicalMap();
|
|
|
+ ipage.getRecords().forEach(getEvaluatorPageDTO->{
|
|
|
+ getEvaluatorPageDTO.setSexName(SexEnum.getName(getEvaluatorPageDTO.getSex()));
|
|
|
+ getEvaluatorPageDTO.setAge(DateUtil.yearCompare(getEvaluatorPageDTO.getBirthday(), DateUtil.now()));
|
|
|
+
|
|
|
+ String[] physicalTypes = getEvaluatorPageDTO.getPhysicalTypes().split(",");
|
|
|
+ List<PhysicalInfoDTO> physicalInfoDTOList = ListUtil.newArrayList();
|
|
|
+ for (String physicalType : physicalTypes) {
|
|
|
+ if(physicalInfoMap.get(physicalType)!=null) {
|
|
|
+ PhysicalInfoDTO physicalInfoDTO = new PhysicalInfoDTO();
|
|
|
+ BeanUtil.copyProperties(physicalInfoMap.get(physicalType), physicalInfoDTO);
|
|
|
+ physicalInfoDTOList.add(physicalInfoDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ getEvaluatorPageDTO.setPhysicalInfoDTOList(physicalInfoDTOList);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return ipage;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 进行体质计算
|
|
|
* @param evaluatorCalVO
|