Commit 02ccfef294256fcb394deea62e0aaa4d0cf6bbf1
1 parent
1764381a86
Exists in
dev
#fix:优化建档管理,产检医生查询
Showing 5 changed files with 143 additions and 14 deletions
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BirthController.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/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BirthResult.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
02ccfef
| ... | ... | @@ -1226,7 +1226,11 @@ |
| 1226 | 1226 | |
| 1227 | 1227 | |
| 1228 | 1228 | if (StringUtils.isNotEmpty(lastCheckEmployeeId)) { |
| 1229 | - condition = condition.and("lastCheckEmployeeId", lastCheckEmployeeId, MongoOper.IS); | |
| 1229 | + if("0123456789".equals(lastCheckEmployeeId)){ | |
| 1230 | + condition = condition.and("lastCheckEmployeeId", false, MongoOper.EXISTS); | |
| 1231 | + }else { | |
| 1232 | + condition = condition.and("lastCheckEmployeeId", lastCheckEmployeeId, MongoOper.IS); | |
| 1233 | + } | |
| 1230 | 1234 | } else if (lastCheckEId) { |
| 1231 | 1235 | condition = condition.and("lastCheckEmployeeId", "", MongoOper.NE); |
| 1232 | 1236 | MongoCondition c = MongoCondition.newInstance(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BirthController.java
View file @
02ccfef
| ... | ... | @@ -4,10 +4,12 @@ |
| 4 | 4 | import com.lyms.platform.common.annotation.TokenRequired; |
| 5 | 5 | import com.lyms.platform.common.base.BaseController; |
| 6 | 6 | import com.lyms.platform.common.base.LoginContext; |
| 7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 7 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | 9 | import com.lyms.platform.common.utils.DateUtil; |
| 9 | 10 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 11 | import com.lyms.platform.operate.web.facade.PatientServiceFacade; |
| 12 | +import com.lyms.platform.operate.web.facade.ViewFacade; | |
| 11 | 13 | import com.lyms.platform.operate.web.result.BirthResult; |
| 12 | 14 | import com.lyms.platform.query.PatientsQuery; |
| 13 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -24,6 +26,8 @@ |
| 24 | 26 | public class BirthController extends BaseController { |
| 25 | 27 | @Autowired |
| 26 | 28 | private PatientServiceFacade patientServiceFacade; |
| 29 | + @Autowired | |
| 30 | + private ViewFacade viewFacade; | |
| 27 | 31 | |
| 28 | 32 | @RequestMapping(value = "/getPatientList", method = RequestMethod.GET) |
| 29 | 33 | @ResponseBody |
| ... | ... | @@ -55,6 +59,16 @@ |
| 55 | 59 | @ResponseBody |
| 56 | 60 | public BaseResponse update(@RequestBody BirthResult birthResult){ |
| 57 | 61 | return patientServiceFacade.updatePuerpera(birthResult); |
| 62 | + } | |
| 63 | + | |
| 64 | + @RequestMapping(value = "/wx/getBirthInfo", method = RequestMethod.GET) | |
| 65 | + @ResponseBody | |
| 66 | + public BaseResponse getBirthInfo(@RequestParam String parentId){ | |
| 67 | + BaseResponse baseResponse=new BaseResponse(); | |
| 68 | + baseResponse.setObject(viewFacade.getBirthInfo(parentId)); | |
| 69 | + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 70 | + baseResponse.setErrormsg("成功"); | |
| 71 | + return baseResponse; | |
| 58 | 72 | } |
| 59 | 73 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
02ccfef
| ... | ... | @@ -1907,13 +1907,12 @@ |
| 1907 | 1907 | babyModel.setName(birthResult.getBabyName()); |
| 1908 | 1908 | babyModel.setFirstName(birthResult.getFirstName()); |
| 1909 | 1909 | babyModel.setLastName(birthResult.getLastName()); |
| 1910 | - babyModel.setAddress(patients.getAddress()); | |
| 1911 | - babyModel.setStreetId(patients.getStreetId()); | |
| 1912 | - babyModel.setProvinceId(patients.getProvinceId()); | |
| 1913 | - babyModel.setCityId(patients.getCityId()); | |
| 1914 | - babyModel.setAreaId(patients.getAreaId()); | |
| 1915 | - babyModel.setStreetId(patients.getStreetId()); | |
| 1916 | - babyModel.setVillageId(patients.getVillageId()); | |
| 1910 | + babyModel.setBabyAddress(birthResult.getBabyAddress()); | |
| 1911 | + babyModel.setBabyStreetId(birthResult.getBabyStreetId()); | |
| 1912 | + babyModel.setBabyProvinceId(birthResult.getProvinceId()); | |
| 1913 | + babyModel.setBabyCityId(birthResult.getBabyCityId()); | |
| 1914 | + babyModel.setBabyAreaId(birthResult.getBabyAreaId()); | |
| 1915 | + babyModel.setBabyVillageId(birthResult.getBabyVillageId()); | |
| 1917 | 1916 | babyService.updateOneBaby(babyModel,babyModel.getId()); |
| 1918 | 1917 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1919 | 1918 | baseResponse.setErrormsg("成功"); |
| ... | ... | @@ -1922,7 +1921,6 @@ |
| 1922 | 1921 | |
| 1923 | 1922 | public BaseResponse getPuerperaInfo(String parentId){ |
| 1924 | 1923 | BaseResponse baseResponse = new BaseResponse(); |
| 1925 | - | |
| 1926 | 1924 | Patients patients= patientsService.findOnePatientById(parentId); |
| 1927 | 1925 | if (patients==null||patients.getType()!=3){ |
| 1928 | 1926 | baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST); |
| 1929 | 1927 | |
| ... | ... | @@ -1930,9 +1928,18 @@ |
| 1930 | 1928 | return baseResponse; |
| 1931 | 1929 | } |
| 1932 | 1930 | BabyModelQuery babyQuery=new BabyModelQuery(); |
| 1933 | - babyQuery.setYn(1); | |
| 1931 | + //babyQuery.setYn(1); | |
| 1934 | 1932 | BirthResult birthResult=new BirthResult(); |
| 1935 | 1933 | BeanUtils.copy(patients, birthResult); |
| 1934 | + String dueWeek = ""; | |
| 1935 | + String babyWeek=""; | |
| 1936 | + if (patients.getFmWeek()!=null){ | |
| 1937 | + String week = (patients.getFmWeek() / 7) + ""; | |
| 1938 | + int day = (patients.getFmWeek() % 7); | |
| 1939 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
| 1940 | + babyWeek=DateUtil.getBabyMonthAge(patients.getFmDate(),new Date()); | |
| 1941 | + } | |
| 1942 | + birthResult.setDueWeek(dueWeek); | |
| 1936 | 1943 | birthResult.setParentId(patients.getId()); |
| 1937 | 1944 | babyQuery.setParentId(patients.getId()); |
| 1938 | 1945 | List<BabyModel> babyModels= babyService.queryBabyWithQuery(babyQuery); |
| 1939 | 1946 | |
| ... | ... | @@ -1942,10 +1949,13 @@ |
| 1942 | 1949 | birthResult.setBabyHeight(babyModel.getBabyHeight()); |
| 1943 | 1950 | birthResult.setBabyName(babyModel.getName()); |
| 1944 | 1951 | birthResult.setBabyWeight(babyModel.getBabyWeight()); |
| 1945 | - birthResult.setBabyWeek(babyModel.getWeek()); | |
| 1952 | + birthResult.setBabyWeek(babyWeek); | |
| 1946 | 1953 | birthResult.setBabySex(babyModel.getSex()); |
| 1947 | 1954 | birthResult.setCommunityId(babyModel.getCommunityId()); |
| 1948 | - birthResult.setDeliverOrg(babyModel.getDeliverOrg()); | |
| 1955 | + if (StringUtils.isNotEmpty(babyModel.getDeliverOrg())){ | |
| 1956 | + Organization organization= organizationService.getOrganization(Integer.valueOf(babyModel.getDeliverOrg())); | |
| 1957 | + birthResult.setDeliverOrg(organization.getName()); | |
| 1958 | + } | |
| 1949 | 1959 | birthResult.setBlNo(babyModel.getBlNo()); |
| 1950 | 1960 | birthResult.setFirstName(babyModel.getFirstName()); |
| 1951 | 1961 | birthResult.setLastName(babyModel.getLastName()); |
| 1952 | 1962 | |
| 1953 | 1963 | |
| ... | ... | @@ -1968,16 +1978,18 @@ |
| 1968 | 1978 | if (CollectionUtils.isNotEmpty(list)){ |
| 1969 | 1979 | List<BirthResult> birthResults=new ArrayList<>(); |
| 1970 | 1980 | BabyModelQuery babyQuery=new BabyModelQuery(); |
| 1971 | - babyQuery.setYn(1); | |
| 1981 | + //babyQuery.setYn(1); | |
| 1972 | 1982 | babyQuery.setHospitalId(hospitalId); |
| 1973 | 1983 | for (Patients patients:list){ |
| 1974 | 1984 | BirthResult birthResult=new BirthResult(); |
| 1975 | 1985 | BeanUtils.copy(patients, birthResult); |
| 1976 | 1986 | String dueWeek = ""; |
| 1987 | + String babyWeek=""; | |
| 1977 | 1988 | if (patients.getFmWeek()!=null){ |
| 1978 | 1989 | String week = (patients.getFmWeek() / 7) + ""; |
| 1979 | 1990 | int day = (patients.getFmWeek() % 7); |
| 1980 | 1991 | dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); |
| 1992 | + babyWeek=DateUtil.getBabyMonthAge(patients.getFmDate(),new Date()); | |
| 1981 | 1993 | } |
| 1982 | 1994 | birthResult.setDueWeek(dueWeek); |
| 1983 | 1995 | |
| 1984 | 1996 | |
| ... | ... | @@ -1990,11 +2002,15 @@ |
| 1990 | 2002 | birthResult.setBabyHeight(babyModel.getBabyHeight()); |
| 1991 | 2003 | birthResult.setBabyName(babyModel.getName()); |
| 1992 | 2004 | birthResult.setBabyWeight(babyModel.getBabyWeight()); |
| 1993 | - birthResult.setBabyWeek(babyModel.getWeek()); | |
| 2005 | + birthResult.setBabyWeek(babyWeek); | |
| 1994 | 2006 | birthResult.setBabySex(babyModel.getSex()); |
| 1995 | 2007 | birthResult.setCommunityId(babyModel.getCommunityId()); |
| 1996 | 2008 | birthResult.setDeliverOrg(babyModel.getDeliverOrg()); |
| 1997 | 2009 | birthResult.setBlNo(babyModel.getBlNo()); |
| 2010 | + birthResult.setFirstName(babyModel.getFirstName()); | |
| 2011 | + birthResult.setLastName(babyModel.getLastName()); | |
| 2012 | + //birthResult.setBabyAddress(CommonsHelper.getResidence(babyModel.getBabyProvinceId(),babyModel.getBabyCityId(),babyModel.getBabyAreaId(),babyModel.getBabyStreetId(),babyModel.getBabyAddress(),basicConfigService)); | |
| 2013 | + | |
| 1998 | 2014 | } |
| 1999 | 2015 | birthResults.add(birthResult); |
| 2000 | 2016 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
02ccfef
| ... | ... | @@ -412,6 +412,44 @@ |
| 412 | 412 | return map; |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | + public Map<String,Object> getBirthInfo(String id){ | |
| 416 | + Patients data=patientsService.findOnePatientById(id); | |
| 417 | + if (data==null){ | |
| 418 | + return null; | |
| 419 | + } | |
| 420 | + Map <String, Object> map = new HashMap <>(); | |
| 421 | + /* 丈夫信息 */ | |
| 422 | + map.put("hcertificateType", getBasicConfig(data.getHcertificateTypeId())); | |
| 423 | + map.put("hcountry", getBasicConfig(data.getHcountryId())); | |
| 424 | + map.put("hnation", getBasicConfig(data.getHnationId())); | |
| 425 | + map.put("hregister", CommonsHelper.getResidence(data.getHprovinceRegisterId(), data.getHcityRegisterId(), | |
| 426 | + data.getHareaRegisterId(), data.getHstreetRegisterId(), data.getHaddressRegister(), | |
| 427 | + basicConfigService)); | |
| 428 | + //丈夫居住地 | |
| 429 | + map.put("hresidence", CommonsHelper.getResidence(data.getHprovinceId(), data.getHcityId(), | |
| 430 | + data.getHareaId(), data.getHstreetId(), data.getHaddress(), | |
| 431 | + basicConfigService)); | |
| 432 | + /* 孕妇基础数据 */ | |
| 433 | + map.put("pcerteType", getBasicConfig(data.getPcerteTypeId())); | |
| 434 | + map.put("pcountry", getBasicConfig(data.getPcountryId())); | |
| 435 | + map.put("pnation", getBasicConfig(data.getPnationId())); | |
| 436 | + /* 孕妇联系方式 */ | |
| 437 | + map.put("residence", CommonsHelper.getResidence(data.getProvinceId(), data.getCityId(), | |
| 438 | + data.getAreaId(), data.getStreetId(), data.getAddress(), basicConfigService)); | |
| 439 | + map.put("register", CommonsHelper.getResidence(data.getProvinceRegisterId(), data.getCityRegisterId(), | |
| 440 | + data.getAreaRegisterId(), data.getStreetRegisterId(), data.getAddressRegister(), basicConfigService)); | |
| 441 | + BabyModelQuery babyQuery=new BabyModelQuery(); | |
| 442 | + // babyQuery.setYn(1); | |
| 443 | + babyQuery.setParentId(data.getId()); | |
| 444 | + List<BabyModel> babyModels= babyService.queryBabyWithQuery(babyQuery); | |
| 445 | + if (CollectionUtils.isNotEmpty(babyModels)){ | |
| 446 | + BabyModel babyModel= babyModels.get(0); | |
| 447 | + /* 儿童数据*/ | |
| 448 | + map.put("babyAddress",CommonsHelper.getResidence(babyModel.getBabyProvinceId(),babyModel.getBabyCityId(),babyModel.getBabyAreaId(),babyModel.getBabyStreetId(),babyModel.getBabyAddress(),basicConfigService)); | |
| 449 | + } | |
| 450 | + return map; | |
| 451 | + } | |
| 452 | + | |
| 415 | 453 | public Map <String, Object> getPatientViewData(Patients data, String id) { |
| 416 | 454 | Map <String, Object> map = new HashMap <>(); |
| 417 | 455 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BirthResult.java
View file @
02ccfef
| ... | ... | @@ -117,6 +117,15 @@ |
| 117 | 117 | private String lastName; |
| 118 | 118 | //病历号(住院号) |
| 119 | 119 | private String blNo; |
| 120 | + /** | |
| 121 | + * 儿童出生地址 | |
| 122 | + */ | |
| 123 | + private String babyAddress; | |
| 124 | + private String babyProvinceId; | |
| 125 | + private String babyCityId; | |
| 126 | + private String babyAreaId; | |
| 127 | + private String babyStreetId; | |
| 128 | + private String babyVillageId; | |
| 120 | 129 | |
| 121 | 130 | public Integer getHmarriageAge() { |
| 122 | 131 | return DateUtil.getAge(husbandBirth); |
| ... | ... | @@ -548,6 +557,54 @@ |
| 548 | 557 | |
| 549 | 558 | public void setVillageRegister(String villageRegister) { |
| 550 | 559 | this.villageRegister = villageRegister; |
| 560 | + } | |
| 561 | + | |
| 562 | + public String getBabyAddress() { | |
| 563 | + return babyAddress; | |
| 564 | + } | |
| 565 | + | |
| 566 | + public void setBabyAddress(String babyAddress) { | |
| 567 | + this.babyAddress = babyAddress; | |
| 568 | + } | |
| 569 | + | |
| 570 | + public String getBabyProvinceId() { | |
| 571 | + return babyProvinceId; | |
| 572 | + } | |
| 573 | + | |
| 574 | + public void setBabyProvinceId(String babyProvinceId) { | |
| 575 | + this.babyProvinceId = babyProvinceId; | |
| 576 | + } | |
| 577 | + | |
| 578 | + public String getBabyCityId() { | |
| 579 | + return babyCityId; | |
| 580 | + } | |
| 581 | + | |
| 582 | + public void setBabyCityId(String babyCityId) { | |
| 583 | + this.babyCityId = babyCityId; | |
| 584 | + } | |
| 585 | + | |
| 586 | + public String getBabyAreaId() { | |
| 587 | + return babyAreaId; | |
| 588 | + } | |
| 589 | + | |
| 590 | + public void setBabyAreaId(String babyAreaId) { | |
| 591 | + this.babyAreaId = babyAreaId; | |
| 592 | + } | |
| 593 | + | |
| 594 | + public String getBabyStreetId() { | |
| 595 | + return babyStreetId; | |
| 596 | + } | |
| 597 | + | |
| 598 | + public void setBabyStreetId(String babyStreetId) { | |
| 599 | + this.babyStreetId = babyStreetId; | |
| 600 | + } | |
| 601 | + | |
| 602 | + public String getBabyVillageId() { | |
| 603 | + return babyVillageId; | |
| 604 | + } | |
| 605 | + | |
| 606 | + public void setBabyVillageId(String babyVillageId) { | |
| 607 | + this.babyVillageId = babyVillageId; | |
| 551 | 608 | } |
| 552 | 609 | } |