Commit 642325220d77e049497d90898841664108889900
1 parent
1510474699
Exists in
dev
产妇建档
Showing 2 changed files with 59 additions and 43 deletions
platform-biz-service/src/main/resources/mainOrm/master/AppointmentMapper.xml
View file @
6423252
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
6423252
... | ... | @@ -21,8 +21,10 @@ |
21 | 21 | import com.lyms.platform.operate.web.request.*; |
22 | 22 | import com.lyms.platform.operate.web.result.*; |
23 | 23 | import com.lyms.platform.operate.web.service.RareBloodGroupService; |
24 | +import com.lyms.platform.permission.model.Departments; | |
24 | 25 | import com.lyms.platform.permission.model.MedicalRecordVo; |
25 | 26 | import com.lyms.platform.permission.model.Organization; |
27 | +import com.lyms.platform.permission.model.Users; | |
26 | 28 | import com.lyms.platform.permission.service.AppointmentService; |
27 | 29 | import com.lyms.platform.permission.service.OrganizationService; |
28 | 30 | import com.lyms.platform.permission.service.UsersService; |
29 | 31 | |
30 | 32 | |
31 | 33 | |
32 | 34 | |
... | ... | @@ -509,52 +511,65 @@ |
509 | 511 | */ |
510 | 512 | @RequestMapping(value = "/apatients", method = RequestMethod.GET) |
511 | 513 | @ResponseBody |
512 | - @TokenRequired | |
513 | - public BaseResponse queryAllPatients(@Valid RiskPatientsQueryRequest patientsQueryRequest, HttpServletRequest request) { | |
514 | - // 未建党标志 | |
515 | - if( "1".equals(patientsQueryRequest.getPatientsType())){ | |
516 | - List<QuanChanResult> data = new ArrayList<>(); | |
517 | - MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
518 | - medicalRecordVo.setNeed("true"); | |
519 | - medicalRecordVo.setLimit(patientsQueryRequest.getLimit()); | |
520 | - medicalRecordVo.setPage(patientsQueryRequest.getPage()); | |
521 | - List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
522 | - if(CollectionUtils.isNotEmpty(medicalRecordVoList)){ | |
523 | - for (MedicalRecordVo recordVo : medicalRecordVoList) { | |
524 | - // 查建档 | |
525 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
526 | - patientsQuery.setCardNo(recordVo.getCardNo()); | |
527 | - patientsQuery.setYn(1); | |
528 | - patientsQuery.setDesc("true"); | |
529 | - patientsQuery.setSort("created"); | |
530 | - List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
531 | - if(CollectionUtils.isNotEmpty(patientsList)){ | |
532 | - continue; | |
514 | +// @TokenRequired | |
515 | + public BaseResponse queryAllPatients(@Valid RiskPatientsQueryRequest patientsQueryRequest) { | |
516 | +// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
517 | + List<QuanChanResult> data = new ArrayList<>(); | |
518 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
519 | + medicalRecordVo.setNeed("true"); | |
520 | + medicalRecordVo.setLimit(patientsQueryRequest.getLimit()); | |
521 | + medicalRecordVo.setPage(patientsQueryRequest.getPage()); | |
522 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
523 | + | |
524 | + if(CollectionUtils.isEmpty(medicalRecordVoList)){ | |
525 | + return new BaseListResponse().setData(medicalRecordVoList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("未查询到有效数据"); | |
526 | + } | |
527 | + | |
528 | + if(CollectionUtils.isNotEmpty(medicalRecordVoList)){ | |
529 | + for (MedicalRecordVo recordVo : medicalRecordVoList) { | |
530 | + QuanChanResult quanChanResult = new QuanChanResult(); | |
531 | + quanChanResult.setCardNo(recordVo.getCardNo()); | |
532 | + quanChanResult.setPhone(recordVo.getPhone()); | |
533 | + quanChanResult.setName(recordVo.getName()); | |
534 | + String age1 = recordVo.getAge().substring(0,8); | |
535 | + Date date = DateUtil.parseYYYYMMDD(age1); | |
536 | + int age = DateUtil.getYearSpace(new Date(),date); | |
537 | + quanChanResult.setAge(age); | |
538 | + quanChanResult.setDueWeek(recordVo.getDeliveryTime()); | |
539 | + Date date2 = DateUtil.parseYMD(recordVo.getDeliveryTime()); | |
540 | + int day= DateUtil.getDays(date2,new Date()); | |
541 | + quanChanResult.setcTime(String.valueOf(day)); | |
542 | + quanChanResult.setMdtrtTag(recordVo.getMdtrtTag()); | |
543 | + quanChanResult.setRealPhone(recordVo.getPhone()); | |
544 | + // 查建档 | |
545 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
546 | + patientsQuery.setCardNo(recordVo.getCardNo()); | |
547 | + patientsQuery.setYn(1); | |
548 | + patientsQuery.setHospitalId("2100002419"); | |
549 | + patientsQuery.setDesc("true"); | |
550 | + patientsQuery.setSort("created"); | |
551 | + List<Patients> patientsList = patientsService.queryPatient(patientsQuery); | |
552 | + if(CollectionUtils.isNotEmpty(patientsList)){ | |
553 | + Patients patients = patientsList.get(0); | |
554 | + quanChanResult.setbTime(DateUtil.getYyyyMmDd(patients.getBookbuildingDate())); | |
555 | + quanChanResult.setPhone(patients.getPhone()); | |
556 | + quanChanResult.setId(patients.getId()); | |
557 | + quanChanResult.setPid(patients.getPid()); | |
558 | + Users serviceUsers = usersService.getUsers(patients.getOperator()); | |
559 | + if(serviceUsers != null){ | |
560 | + quanChanResult.setlName(serviceUsers.getName()); | |
533 | 561 | } |
534 | - QuanChanResult quanChanResult = new QuanChanResult(); | |
535 | - quanChanResult.setName(recordVo.getName()); | |
536 | - String age1 = recordVo.getAge().substring(0,8); | |
537 | - Date date = DateUtil.parseYYYYMMDD(age1); | |
538 | - int age = DateUtil.getYearSpace(new Date(),date); | |
539 | - quanChanResult.setAge(age); | |
540 | - quanChanResult.setDueWeek(recordVo.getDeliveryTime()); | |
541 | - Date date2 = DateUtil.parseYMD(recordVo.getDeliveryTime()); | |
542 | - int day= DateUtil.getDays(date2,new Date()); | |
543 | - quanChanResult.setcTime(String.valueOf(day)); | |
544 | - quanChanResult.setRealPhone(recordVo.getPhone()); | |
545 | - data.add(quanChanResult); | |
546 | 562 | } |
563 | + data.add(quanChanResult); | |
547 | 564 | } |
548 | - com.lyms.platform.common.base.PageInfo pageInfo = new PageInfo(); | |
549 | - pageInfo.setCount(medicalRecordVo.getCount()); | |
550 | - pageInfo.setPage(medicalRecordVo.getPage()); | |
551 | - pageInfo.setLimit(medicalRecordVo.getLimit()); | |
552 | - pageInfo.setLastPage(medicalRecordVo.getLastPage()); | |
553 | - return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(pageInfo); | |
554 | - | |
555 | 565 | } |
556 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
557 | - return patientFacade.queryHighRisk(patientsQueryRequest, null, 3, loginState.getId(), "true", Boolean.FALSE); | |
566 | + com.lyms.platform.common.base.PageInfo pageInfo = new PageInfo(); | |
567 | + pageInfo.setCount(medicalRecordVo.getCount()); | |
568 | + pageInfo.setPage(medicalRecordVo.getPage()); | |
569 | + pageInfo.setLimit(medicalRecordVo.getLimit()); | |
570 | + pageInfo.setLastPage(medicalRecordVo.getLastPage()); | |
571 | + return new BaseListResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(pageInfo); | |
572 | +// return patientFacade.queryHighRisk(patientsQueryRequest, null, 3, loginState.getId(), "true", Boolean.FALSE); | |
558 | 573 | } |
559 | 574 | |
560 | 575 |