Commit d38661b9f4f4803c0263d21cc1f6d8adf2401029
1 parent
3d1cb89e06
Exists in
master
产检头部查询接口
Showing 7 changed files with 125 additions and 14 deletions
- parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/WomanFetationRecordMapper.xml
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanFetationRecordService.java
- parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanPregnantController.java
- parent/hospital.web/src/main/java/com/lyms/hospital/response/keymap/WomanFetationRecordKeymap.java
- parent/hospital.web/src/main/java/com/lyms/hospital/util/HospitalUtil.java
parent/hospital.mac/src/main/java/com/lyms/hospital/dao/woman/WomanFetationRecordMapper.xml
View file @
d38661b
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/WomanFetationRecordService.java
View file @
d38661b
| ... | ... | @@ -21,7 +21,19 @@ |
| 21 | 21 | */ |
| 22 | 22 | public interface WomanFetationRecordService extends BaseService<WomanFetationRecord> { |
| 23 | 23 | |
| 24 | + | |
| 24 | 25 | /** |
| 26 | + * <li>@Description:条件查询有效的(未被删除的,启用的,未终止妊娠的,未分娩的&其他指定条件)孕妇建档 | |
| 27 | + * <li>@param obj | |
| 28 | + * <li>@return | |
| 29 | + * <li>创建人:xujiahong | |
| 30 | + * <li>创建时间:2017年4月25日 | |
| 31 | + * <li>修改人: | |
| 32 | + * <li>修改时间: | |
| 33 | + */ | |
| 34 | + public WomanFetationRecord queryEffectiveOne(WomanFetationRecord obj); | |
| 35 | + | |
| 36 | + /** | |
| 25 | 37 | * <li>@Description:条件查询对象(未删除的)(主要用于验证条件下的存在性) |
| 26 | 38 | * <li>@param obj |
| 27 | 39 | * <li>@return |
| ... | ... | @@ -47,7 +59,7 @@ |
| 47 | 59 | |
| 48 | 60 | /** |
| 49 | 61 | * <li>@Description:查询-根据孕妇建档ID查询表单详情 |
| 50 | - * <li>@return | |
| 62 | + * <li>@return (null if 没有建档信息 或 已删除) | |
| 51 | 63 | * <li>创建人:xujiahong |
| 52 | 64 | * <li>创建时间:2017年4月19日 |
| 53 | 65 | * <li>修改人: |
parent/hospital.mac/src/main/java/com/lyms/hospital/service/woman/impl/WomanFetationRecordServiceImpl.java
View file @
d38661b
| ... | ... | @@ -129,13 +129,14 @@ |
| 129 | 129 | * (1)查询孕妇建档信息详情 |
| 130 | 130 | * (2)查询相关的配偶信息详情 |
| 131 | 131 | */ |
| 132 | - Map<String, Object> map = new HashMap<>(); | |
| 133 | 132 | WomanFetationRecord fetationRecord = this.selectDetailById(id); |
| 134 | - if(fetationRecord!=null){ | |
| 135 | - WomanHusband womanHusband = womanHusbandService.selectByTarget(WomanHusband.TARGET_TYPE_ARCHIVE, fetationRecord.getId()); | |
| 136 | - map.put("fetationRecord", fetationRecord); | |
| 137 | - map.put("womanHusband", womanHusband); | |
| 133 | + if(fetationRecord==null || fetationRecord.getIfdel()==IfdelEnum.YES.getStatus()){ | |
| 134 | + return null;//没有建档信息 或 已删除 | |
| 138 | 135 | } |
| 136 | + WomanHusband womanHusband = womanHusbandService.selectByTarget(WomanHusband.TARGET_TYPE_ARCHIVE, fetationRecord.getId()); | |
| 137 | + Map<String, Object> map = new HashMap<>(); | |
| 138 | + map.put("fetationRecord", fetationRecord); | |
| 139 | + map.put("womanHusband", womanHusband); | |
| 139 | 140 | return map; |
| 140 | 141 | } |
| 141 | 142 | |
| ... | ... | @@ -174,6 +175,15 @@ |
| 174 | 175 | ew.and("HOSPITAL_PATIENT_CARD={0}",obj.getHospitalPatientCard()); |
| 175 | 176 | } |
| 176 | 177 | return selectOne(ew); |
| 178 | + } | |
| 179 | + | |
| 180 | + @Override | |
| 181 | + public WomanFetationRecord queryEffectiveOne(WomanFetationRecord query) { | |
| 182 | + query.setIfdel(IfdelEnum.NO.getStatus());//未被删除的 | |
| 183 | + query.setEnalble(StatusEnum.ENABLED.getStatus());//启用的 | |
| 184 | + query.setWomanType(1);//妇女类别:1孕妇,3产妇 | |
| 185 | + query.setDueStatus(0);//分娩状态 0未终止妊娠 1终止妊娠 | |
| 186 | + return queryOne(query); | |
| 177 | 187 | } |
| 178 | 188 | } |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanExamController.java
View file @
d38661b
| 1 | +package com.lyms.hospital.controller.woman; | |
| 2 | + | |
| 3 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 4 | +import org.springframework.stereotype.Controller; | |
| 5 | +import org.springframework.util.StringUtils; | |
| 6 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 8 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 9 | + | |
| 10 | +import com.lyms.hospital.entity.woman.WomanFetationRecord; | |
| 11 | +import com.lyms.hospital.service.woman.WomanFetationRecordService; | |
| 12 | +import com.lyms.web.bean.AjaxResult; | |
| 13 | +import com.lyms.web.controller.BaseController; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 孕妇产检 前端控制器<br> | |
| 17 | + * | |
| 18 | + * 依据cardNo或vcCardNo查询孕妇产检记录 | |
| 19 | + * | |
| 20 | + * @author xujiahong | |
| 21 | + * | |
| 22 | + */ | |
| 23 | +@Controller | |
| 24 | +@RequestMapping("/womanExam") | |
| 25 | +public class WomanExamController extends BaseController { | |
| 26 | + | |
| 27 | + @Autowired | |
| 28 | + private WomanFetationRecordService fetationService; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * <li>@Description:依据cardNo或vcCardNo查询孕妇产检记录 | |
| 32 | + * <li>@param cardNo 证件号 | |
| 33 | + * <li>@param vcCardNo 就诊卡号 | |
| 34 | + * <li>@return | |
| 35 | + * <li>创建人:xujiahong | |
| 36 | + * <li>创建时间:2017年4月25日 | |
| 37 | + * <li>修改人: | |
| 38 | + * <li>修改时间: | |
| 39 | + */ | |
| 40 | + @RequestMapping(value = "/antexmanage", method = RequestMethod.POST) | |
| 41 | + @ResponseBody | |
| 42 | + public AjaxResult deletePregnant(String cardNo,String vcCardNo,String orgId){//orgId或来自token | |
| 43 | + /* | |
| 44 | + * (1)孕妇档案信息(通过证件号或就诊卡号查询) | |
| 45 | + * (2)高危因素列表 TODO | |
| 46 | + * (3)产检记录列表 | |
| 47 | + */ | |
| 48 | + //基本验证 | |
| 49 | + if(StringUtils.isEmpty(orgId)){ | |
| 50 | + return AjaxResult.returnFail("入参错误:医院ID为空"); | |
| 51 | + } | |
| 52 | + if(StringUtils.isEmpty(cardNo) && StringUtils.isEmpty(vcCardNo)){ | |
| 53 | + return AjaxResult.returnFail("入参错误:查询条件为空"); | |
| 54 | + } | |
| 55 | + //(1)孕妇档案信息(通过证件号或就诊卡号查询) | |
| 56 | + WomanFetationRecord query = new WomanFetationRecord(); | |
| 57 | + query.setHostpitalId(orgId);//医院ID | |
| 58 | + WomanFetationRecord dbFetationRecord = null; | |
| 59 | + | |
| 60 | + //证件号不为空,则通过证件号查询 | |
| 61 | + if(!StringUtils.isEmpty(cardNo)){ | |
| 62 | + query.setBasePapersNumber(cardNo); | |
| 63 | + dbFetationRecord = fetationService.queryEffectiveOne(query); | |
| 64 | + } | |
| 65 | + //上述查询未执行或没结果,且就诊卡号不为空,则通过就诊卡号查询 | |
| 66 | + if(dbFetationRecord==null && !StringUtils.isEmpty(vcCardNo)){ | |
| 67 | + query.setBasePapersNumber(null); | |
| 68 | + query.setContactWomanWay(vcCardNo); | |
| 69 | + dbFetationRecord = fetationService.queryEffectiveOne(query); | |
| 70 | + } | |
| 71 | + //未查询到孕妇建档信息 | |
| 72 | + if(dbFetationRecord==null){ | |
| 73 | + return AjaxResult.returnFail("未查询到孕妇建档信息"); | |
| 74 | + } | |
| 75 | + //(2)高危因素列表 TODO | |
| 76 | + //(3)产检记录列表 TODO (此处需要查询当前产程中本院和外院的所有产检记录) | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + return AjaxResult.returnFail(); | |
| 81 | + } | |
| 82 | + | |
| 83 | +} |
parent/hospital.web/src/main/java/com/lyms/hospital/controller/woman/WomanPregnantController.java
View file @
d38661b
| ... | ... | @@ -13,7 +13,6 @@ |
| 13 | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
| 14 | 14 | import org.springframework.web.bind.annotation.ResponseBody; |
| 15 | 15 | |
| 16 | -import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
| 17 | 16 | import com.lyms.base.common.service.sys.SysDictService; |
| 18 | 17 | import com.lyms.hospital.entity.woman.WomanFetationRecord; |
| 19 | 18 | import com.lyms.hospital.entity.woman.WomanHusband; |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | |
| ... | ... | @@ -51,15 +50,15 @@ |
| 51 | 50 | public class WomanPregnantController extends BaseController { |
| 52 | 51 | |
| 53 | 52 | @Autowired |
| 54 | - private WomanFetationRecordService fetationService; | |
| 55 | - @Autowired | |
| 56 | 53 | private TokenService tokenService; |
| 57 | 54 | @Autowired |
| 55 | + private WomanFetationRecordService fetationService; | |
| 56 | + @Autowired | |
| 58 | 57 | private SysDictService dictService; |
| 59 | 58 | |
| 60 | - @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.POST) | |
| 59 | + @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.DELETE) | |
| 61 | 60 | @ResponseBody |
| 62 | - public AjaxResult deletePregnant(@PathVariable String id){ | |
| 61 | + public AjaxResult deletePregnant(@PathVariable("id")String id){ | |
| 63 | 62 | Integer count = fetationService.deleteLogicById(id); |
| 64 | 63 | if(count>0){ |
| 65 | 64 | return AjaxResult.returnSuccess(); |
| ... | ... | @@ -82,6 +81,9 @@ |
| 82 | 81 | public AjaxResult findPatientData(String id){ |
| 83 | 82 | //查询详情相关对象 |
| 84 | 83 | Map<String, Object> serviceMap = fetationService.selectWomanFetationMapById(id); |
| 84 | + if(serviceMap==null){ | |
| 85 | + return AjaxResult.returnFail("档案不存在或已删除"); | |
| 86 | + } | |
| 85 | 87 | WomanFetationRecord f = (WomanFetationRecord)serviceMap.get("fetationRecord"); |
| 86 | 88 | WomanHusband w = (WomanHusband)serviceMap.get("womanHusband"); |
| 87 | 89 | /* |
| ... | ... | @@ -176,6 +178,9 @@ |
| 176 | 178 | public AjaxResult queryPregnantBuildById(@PathVariable String id){ |
| 177 | 179 | //查询详情相关对象 |
| 178 | 180 | Map<String, Object> map = fetationService.selectWomanFetationMapById(id); |
| 181 | + if(map==null){ | |
| 182 | + return AjaxResult.returnFail("档案不存在或已删除"); | |
| 183 | + } | |
| 179 | 184 | WomanFetationRecord fetationRecord = (WomanFetationRecord)map.get("fetationRecord"); |
| 180 | 185 | WomanHusband womanHusband = (WomanHusband)map.get("womanHusband"); |
| 181 | 186 | //转换为与前端对接的response对象 |
parent/hospital.web/src/main/java/com/lyms/hospital/response/keymap/WomanFetationRecordKeymap.java
View file @
d38661b
| ... | ... | @@ -123,7 +123,7 @@ |
| 123 | 123 | "hospitalServiceType",//服务类型 |
| 124 | 124 | "hospitalServiceStatus",//服务状态 |
| 125 | 125 | |
| 126 | - "hospitalRecordDoctor",//建档医生 | |
| 126 | +// "hospitalRecordDoctor",//建档医生 | |
| 127 | 127 | "hostpitalId",//建档医院 |
| 128 | 128 | "hospitalRecordDateStr",//建档日期 |
| 129 | 129 | "hospitalRecordRemark",//档案备注 |
| ... | ... | @@ -200,7 +200,7 @@ |
| 200 | 200 | "serviceType",//服务类型 |
| 201 | 201 | "serviceStatus",//服务状态 |
| 202 | 202 | |
| 203 | - "bookbuildingDoctor",//建档医生ID | |
| 203 | +// "bookbuildingDoctor",//建档医生ID | |
| 204 | 204 | "hospitalId",//建档医院ID |
| 205 | 205 | "bookbuildingDate",//建档日期 |
| 206 | 206 | "mremark",//备注 |
parent/hospital.web/src/main/java/com/lyms/hospital/util/HospitalUtil.java
View file @
d38661b