Commit 7f5a527ed02e15b763d6ec162db56f3216ff46ff
1 parent
1773396c15
Exists in
dev
#fix:优化孕期营养报告功能模块
Showing 3 changed files with 41 additions and 2 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnancyReportController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnancyReportController.java
View file @
7f5a527
| ... | ... | @@ -2,13 +2,16 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
| 4 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | +import com.lyms.platform.common.base.LoginContext; | |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 9 | +import com.lyms.platform.operate.web.facade.PatientServiceFacade; | |
| 8 | 10 | import com.lyms.platform.operate.web.facade.PregnancyReportFacade; |
| 9 | 11 | import com.lyms.platform.operate.web.facade.PregnancyReportMattersServiceFacade; |
| 10 | 12 | import com.lyms.platform.pojo.PregnancyReport; |
| 11 | 13 | import com.lyms.platform.pojo.PregnancyReportMatters; |
| 14 | +import com.lyms.platform.query.PatientsQuery; | |
| 12 | 15 | import com.lyms.platform.query.PregnancyReportMattersQuery; |
| 13 | 16 | import com.lyms.platform.query.PregnancyReportQuery; |
| 14 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -27,6 +30,25 @@ |
| 27 | 30 | private PregnancyReportFacade pregnancyReportFacade; |
| 28 | 31 | @Autowired |
| 29 | 32 | private PregnancyReportMattersServiceFacade pregnancyReportMattersServiceFacade; |
| 33 | + | |
| 34 | + @Autowired | |
| 35 | + private PatientServiceFacade patientServiceFacade; | |
| 36 | + | |
| 37 | + @RequestMapping(method = RequestMethod.GET, value = "/getPatientList") | |
| 38 | + @ResponseBody | |
| 39 | + @TokenRequired | |
| 40 | + public Object getPatientList(@RequestParam("page") Integer page, | |
| 41 | + @RequestParam("limit") Integer limit, | |
| 42 | + @RequestParam(required = false) String queryNo | |
| 43 | + ,HttpServletRequest httpServletRequest){ | |
| 44 | + | |
| 45 | + PatientsQuery patientsQuery=new PatientsQuery(); | |
| 46 | + patientsQuery.setPage(page); | |
| 47 | + patientsQuery.setLimit(limit); | |
| 48 | + patientsQuery.setQueryNo(queryNo); | |
| 49 | + return patientServiceFacade.getPatientList(patientsQuery,((LoginContext) httpServletRequest.getAttribute("loginContext")).getId()); | |
| 50 | + } | |
| 51 | + | |
| 30 | 52 | |
| 31 | 53 | /** |
| 32 | 54 | * 新增模板报告 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
7f5a527
| ... | ... | @@ -1776,5 +1776,22 @@ |
| 1776 | 1776 | return baseResponse; |
| 1777 | 1777 | } |
| 1778 | 1778 | |
| 1779 | + public BaseResponse getPatientList(PatientsQuery patientsQuery,Integer userId){ | |
| 1780 | + BaseListResponse baseResponse = new BaseListResponse(); | |
| 1781 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 1782 | + if (StringUtils.isEmpty(hospitalId)) { | |
| 1783 | + baseResponse.setErrormsg("获取医院id为空").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1784 | + return baseResponse; | |
| 1785 | + } | |
| 1786 | + patientsQuery.setHospitalId(hospitalId); | |
| 1787 | + patientsQuery.setYn(1); | |
| 1788 | + patientsQuery.setServiceType(1); | |
| 1789 | + patientsQuery.setNeed("true"); | |
| 1790 | + List<Patients> list= patientsService.queryPatient(patientsQuery); | |
| 1791 | + baseResponse.setPageInfo(patientsQuery.getPageInfo()); | |
| 1792 | + baseResponse.setData(list); | |
| 1793 | + return baseResponse; | |
| 1794 | + } | |
| 1795 | + | |
| 1779 | 1796 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PregnancyReportFacade.java
View file @
7f5a527
| ... | ... | @@ -24,13 +24,13 @@ |
| 24 | 24 | private PregnancyReportMattersService pregnancyReportMattersService; |
| 25 | 25 | |
| 26 | 26 | public BaseResponse add(PregnancyReport postpartumReport){ |
| 27 | - postpartumReport.setWeek(getWeek(postpartumReport.getWeek())); | |
| 27 | + postpartumReport.setWeek(postpartumReport.getWeek()); | |
| 28 | 28 | pregnancyReportService.add(postpartumReport); |
| 29 | 29 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public BaseResponse update(PregnancyReport postpartumReport){ |
| 33 | - postpartumReport.setWeek(getWeek(postpartumReport.getWeek())); | |
| 33 | + postpartumReport.setWeek(postpartumReport.getWeek()); | |
| 34 | 34 | pregnancyReportService.updateById(postpartumReport,postpartumReport.getId()); |
| 35 | 35 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 36 | 36 | } |