Commit 4f0e2d1ce87b7ffe9b6e27ecb8f7d39cd9c81316
1 parent
60ec60876e
Exists in
dev
产妇建档
Showing 2 changed files with 102 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MedicalRecordController.java
View file @
4f0e2d1
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.lyms.platform.common.base.BaseController; | |
| 5 | +import com.lyms.platform.common.result.BaseResponse; | |
| 6 | +import com.lyms.platform.operate.web.facade.MedicalRecordFacade; | |
| 7 | +import com.lyms.platform.permission.model.MedicalRecordVo; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Controller; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 13 | + | |
| 14 | +import javax.validation.Valid; | |
| 15 | + | |
| 16 | + | |
| 17 | +/* | |
| 18 | + * 产妇建党 | |
| 19 | + */ | |
| 20 | +@Controller("/medicalRecord") | |
| 21 | +public class MedicalRecordController extends BaseController { | |
| 22 | + | |
| 23 | + @Autowired | |
| 24 | + private MedicalRecordFacade medicalRecordFacade; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 病案信息查询 | |
| 28 | + * | |
| 29 | + * @return | |
| 30 | + */ | |
| 31 | + @RequestMapping(method = RequestMethod.GET, value = "/queryRecord") | |
| 32 | + @ResponseBody | |
| 33 | + public BaseResponse queryRecord(@Valid MedicalRecordVo medicalRecordVo) { | |
| 34 | + return medicalRecordFacade.queryRecord(medicalRecordVo); | |
| 35 | + } | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 病案单人信息查询 | |
| 39 | + * | |
| 40 | + * @return | |
| 41 | + */ | |
| 42 | + @RequestMapping(method = RequestMethod.GET, value = "/queryRecordOne") | |
| 43 | + @ResponseBody | |
| 44 | + public BaseResponse queryRecordOne(@Valid MedicalRecordVo medicalRecordVo) { | |
| 45 | + return medicalRecordFacade.queryRecordOne(medicalRecordVo); | |
| 46 | + } | |
| 47 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MedicalRecordFacade.java
View file @
4f0e2d1
| 1 | +package com.lyms.platform.operate.web.facade; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.base.PageInfo; | |
| 4 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 5 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 8 | +import com.lyms.platform.permission.model.MedicalRecordVo; | |
| 9 | +import com.lyms.platform.permission.service.AppointmentService; | |
| 10 | +import org.apache.commons.collections.CollectionUtils; | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.stereotype.Component; | |
| 13 | + | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 产妇建党查询 | |
| 18 | + */ | |
| 19 | +@Component | |
| 20 | +public class MedicalRecordFacade { | |
| 21 | + | |
| 22 | + @Autowired | |
| 23 | + private AppointmentService appointmentService; | |
| 24 | + public BaseResponse queryRecord(MedicalRecordVo queryVo) { | |
| 25 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
| 26 | + medicalRecordVo.setNeed("true"); | |
| 27 | + medicalRecordVo.setLimit(queryVo.getLimit()); | |
| 28 | + medicalRecordVo.setPage(queryVo.getPage()); | |
| 29 | + medicalRecordVo.setCardNo(queryVo.getCardNo()); | |
| 30 | + medicalRecordVo.setPhone(queryVo.getPhone()); | |
| 31 | + medicalRecordVo.setMdtrtId(queryVo.getMdtrtId()); | |
| 32 | + | |
| 33 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
| 34 | + if(CollectionUtils.isEmpty(medicalRecordVoList)){ | |
| 35 | + return new BaseListResponse().setData(medicalRecordVoList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("未查询到有效数据"); | |
| 36 | + } | |
| 37 | + PageInfo pageInfo = new PageInfo(); | |
| 38 | + pageInfo.setCount(medicalRecordVo.getCount()); | |
| 39 | + pageInfo.setPage(medicalRecordVo.getPage()); | |
| 40 | + pageInfo.setLimit(medicalRecordVo.getLimit()); | |
| 41 | + pageInfo.setLastPage(medicalRecordVo.getLastPage()); | |
| 42 | + return new BaseListResponse().setData(medicalRecordVoList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(pageInfo); | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + public BaseResponse queryRecordOne(MedicalRecordVo queryVo) { | |
| 47 | + MedicalRecordVo medicalRecordVo = new MedicalRecordVo(); | |
| 48 | + medicalRecordVo.setCardNo(queryVo.getCardNo()); | |
| 49 | + List<MedicalRecordVo> medicalRecordVoList = appointmentService.queryList(medicalRecordVo); | |
| 50 | + if(CollectionUtils.isEmpty(medicalRecordVoList)){ | |
| 51 | + return new BaseListResponse().setData(medicalRecordVoList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("未查询到有效数据"); | |
| 52 | + } | |
| 53 | + return new BaseObjectResponse().setData(medicalRecordVoList.get(0)).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 54 | + } | |
| 55 | +} |