|
@ -1,8 +1,11 @@
|
|
|
package com.yihu.wlyy.web.doctor.team;
|
|
|
|
|
|
import com.yihu.wlyy.entity.dict.Disease;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
|
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
|
import com.yihu.wlyy.entity.patient.PatientDisease;
|
|
|
import com.yihu.wlyy.repository.patient.PatientDiseaseDao;
|
|
|
import com.yihu.wlyy.service.app.account.DoctorInfoService;
|
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
|
import com.yihu.wlyy.util.IdCardUtil;
|
|
@ -17,13 +20,14 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/doctor/admin-teams", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生行政团队")
|
|
|
public class AdminTeamController extends BaseController {
|
|
|
@Autowired
|
|
|
private DoctorInfoService doctorInfoService;
|
|
|
private PatientDiseaseDao patientDiseaseDao;
|
|
|
|
|
|
@Autowired
|
|
|
private AdminTeamService teamService;
|
|
@ -225,7 +229,11 @@ public class AdminTeamController extends BaseController {
|
|
|
simplified.put("sex", patient.getSex());
|
|
|
simplified.put("photo", patient.getPhoto());
|
|
|
simplified.put("age", IdCardUtil.getAgeForIdcard(patient.getIdcard()));
|
|
|
simplified.put("disease", patient.getDisease());
|
|
|
|
|
|
List<PatientDisease> diseases = patientDiseaseDao.findByPatient(patient.getCode());
|
|
|
List<String> simplifiedDisease = diseases.stream().map(PatientDisease::getDiseaseName).collect(Collectors.toList());
|
|
|
|
|
|
simplified.put("disease", simplifiedDisease);
|
|
|
|
|
|
simplifiedPatients.add(simplified);
|
|
|
}
|