Commit c709ee54ff717ce3b28c4fe498968af29ef6b06e
1 parent
87215ac44d
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 108 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommonController.java
View file @
c709ee5
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | import org.springframework.beans.factory.annotation.Autowired; |
| 4 | +import org.springframework.data.repository.query.Param; | |
| 4 | 5 | import org.springframework.stereotype.Controller; |
| 5 | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 6 | 7 | import org.springframework.web.bind.annotation.RequestMethod; |
| 8 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 7 | 9 | import org.springframework.web.bind.annotation.ResponseBody; |
| 8 | 10 | |
| 9 | 11 | import com.fasterxml.jackson.annotation.JsonAlias; |
| ... | ... | @@ -51,5 +53,28 @@ |
| 51 | 53 | return commonServer.baseInfoByKeyword(param); |
| 52 | 54 | } |
| 53 | 55 | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 荣成开发孕妇基本信息接口 | |
| 59 | + * @param idNo 孕妇身份证号 | |
| 60 | + * @return | |
| 61 | + */ | |
| 62 | + @RequestMapping(method = RequestMethod.GET, value = "/queryPatientInfo") | |
| 63 | + @ResponseBody | |
| 64 | + public BaseResponse queryPatientInfo(@RequestParam("idNo") String idNo) { | |
| 65 | + return commonServer.queryPatientInfo(idNo); | |
| 66 | + } | |
| 67 | + | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 母亲身份证号码查询儿童基本信息 | |
| 71 | + * @param idNo 母亲身份证号码 | |
| 72 | + * @return | |
| 73 | + */ | |
| 74 | + @RequestMapping(method = RequestMethod.GET, value = "/queryKidsInfo") | |
| 75 | + @ResponseBody | |
| 76 | + public BaseResponse queryKidsInfo(@RequestParam("idNo") String idNo) { | |
| 77 | + return commonServer.queryKidsInfo(idNo); | |
| 78 | + } | |
| 54 | 79 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ICommonServer.java
View file @
c709ee5
| ... | ... | @@ -21,5 +21,21 @@ |
| 21 | 21 | * @return |
| 22 | 22 | */ |
| 23 | 23 | BaseResponse baseInfoByKeyword(CommonRequest param); |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 荣成根据孕妇身份证号码返回基本信息 | |
| 27 | + * @param cardNo | |
| 28 | + * @return | |
| 29 | + */ | |
| 30 | + BaseResponse queryPatientInfo(String cardNo); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 荣成根据母亲身份证号码返返回儿童信息 | |
| 34 | + * @param cardNo | |
| 35 | + * @return | |
| 36 | + */ | |
| 37 | + BaseResponse queryKidsInfo(String cardNo); | |
| 38 | + | |
| 39 | + | |
| 24 | 40 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CommonServerImpl.java
View file @
c709ee5
| 1 | 1 | package com.lyms.platform.operate.web.service.impl; |
| 2 | 2 | |
| 3 | -import java.util.Date; | |
| 4 | -import java.util.List; | |
| 3 | +import java.util.*; | |
| 5 | 4 | |
| 5 | +import com.lyms.platform.common.enums.SexEnum; | |
| 6 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 7 | +import com.lyms.platform.common.result.ResponseCode; | |
| 8 | +import com.lyms.platform.pojo.*; | |
| 6 | 9 | import org.slf4j.Logger; |
| 7 | 10 | import org.slf4j.LoggerFactory; |
| 8 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -24,11 +27,6 @@ |
| 24 | 27 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| 25 | 28 | import com.lyms.platform.permission.dao.master.FolviteMapper; |
| 26 | 29 | import com.lyms.platform.permission.model.FolviteQuery; |
| 27 | -import com.lyms.platform.pojo.FolviteRecordModel; | |
| 28 | -import com.lyms.platform.pojo.MaternalDeliverModel; | |
| 29 | -import com.lyms.platform.pojo.Patients; | |
| 30 | -import com.lyms.platform.pojo.PersonModel; | |
| 31 | -import com.lyms.platform.pojo.ResidentsArchiveModel; | |
| 32 | 30 | |
| 33 | 31 | /** |
| 34 | 32 | * @author dongqin |
| ... | ... | @@ -192,6 +190,8 @@ |
| 192 | 190 | return baseResponse; |
| 193 | 191 | } |
| 194 | 192 | |
| 193 | + | |
| 194 | + | |
| 195 | 195 | /** |
| 196 | 196 | * 根据身份证号获取孕妇/妇女基本信息 |
| 197 | 197 | * |
| ... | ... | @@ -262,6 +262,66 @@ |
| 262 | 262 | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + } | |
| 266 | + | |
| 267 | + | |
| 268 | + @Override | |
| 269 | + public BaseResponse queryPatientInfo(String cardNo) { | |
| 270 | + | |
| 271 | + List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("cardNo").is(cardNo).and("yn").is(1).and("type").is(1)).with(new Sort(Sort.Direction.DESC, "created")), Patients.class); | |
| 272 | + | |
| 273 | + Map data = new HashMap(); | |
| 274 | + if (CollectionUtils.isNotEmpty(patients)) | |
| 275 | + { | |
| 276 | + Patients pat = patients.get(0); | |
| 277 | + | |
| 278 | + data.put("id",pat.getId()); | |
| 279 | + data.put("cardNo",pat.getVcCardNo());//就诊卡号 | |
| 280 | + data.put("name",pat.getUsername()); | |
| 281 | + data.put("sex", "女"); | |
| 282 | + data.put("birthday",DateUtil.getyyyy_MM_dd(pat.getBirth())); | |
| 283 | + data.put("bhnum",""); | |
| 284 | + data.put("phone",pat.getPhone()); | |
| 285 | + data.put("idcard",pat.getCardNo()); | |
| 286 | + //户籍地址 | |
| 287 | + String addressRegister = CommonsHelper.getResidence(pat.getProvinceId(), pat.getCityId(), | |
| 288 | + pat.getAreaId(), pat.getStreetId(), pat.getAddress(), basicConfigService); | |
| 289 | + data.put("addr",addressRegister); | |
| 290 | + | |
| 291 | + } | |
| 292 | + BaseResponse baseResponse = new BaseObjectResponse(); | |
| 293 | + baseResponse.setObject(data); | |
| 294 | + baseResponse.setErrorcode(ResponseCode.SUCCESS.getCode()); | |
| 295 | + baseResponse.setErrormsg(ResponseCode.SUCCESS.getMsg()); | |
| 296 | + return baseResponse; | |
| 297 | + } | |
| 298 | + | |
| 299 | + | |
| 300 | + @Override | |
| 301 | + public BaseResponse queryKidsInfo(String cardNo) { | |
| 302 | + List<BabyModel> babyModels = mongoTemplate.find(Query.query(Criteria.where("mcertNo").is(cardNo).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), BabyModel.class); | |
| 303 | + List<Map> datas = new ArrayList<>(); | |
| 304 | + if (CollectionUtils.isNotEmpty(babyModels)) | |
| 305 | + { | |
| 306 | + for (BabyModel baby : babyModels) | |
| 307 | + { | |
| 308 | + Map data = new HashMap(); | |
| 309 | + data.put("id",baby.getId()); | |
| 310 | + data.put("bhnum",baby.getBlNo()); | |
| 311 | + data.put("name",baby.getName()); | |
| 312 | + data.put("phone",baby.getMphone()); | |
| 313 | + data.put("cardNo",baby.getBabyDiagnosis());//诊断名称 | |
| 314 | + data.put("sex", SexEnum.getTextById(baby.getSex())); | |
| 315 | + data.put("modified", DateUtil.getyyyy_MM_dd(baby.getModified())); | |
| 316 | + data.put("created", DateUtil.getyyyy_MM_dd(baby.getCreated())); | |
| 317 | + datas.add(data); | |
| 318 | + } | |
| 319 | + } | |
| 320 | + BaseResponse baseResponse = new BaseObjectResponse(); | |
| 321 | + baseResponse.setObject(datas); | |
| 322 | + baseResponse.setErrorcode(ResponseCode.SUCCESS.getCode()); | |
| 323 | + baseResponse.setErrormsg(ResponseCode.SUCCESS.getMsg()); | |
| 324 | + return baseResponse; | |
| 265 | 325 | } |
| 266 | 326 | } |