Commit 35f4c5f0cf86366c3c9b6e1908c35c94dba5db4e
1 parent
16451380fb
Exists in
dev
#fix:优化出生证明
Showing 2 changed files with 52 additions and 15 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BirthController.java
View file @
35f4c5f
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | |
| 58 | 58 | @RequestMapping(value = "/wx/update", method = RequestMethod.POST) |
| 59 | 59 | @ResponseBody |
| 60 | - public BaseResponse update(@RequestBody BirthResult birthResult){ | |
| 60 | + public BaseResponse update(BirthResult birthResult){ | |
| 61 | 61 | return patientServiceFacade.updatePuerpera(birthResult); |
| 62 | 62 | } |
| 63 | 63 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
35f4c5f
| ... | ... | @@ -1893,26 +1893,63 @@ |
| 1893 | 1893 | |
| 1894 | 1894 | public BaseResponse updatePuerpera(BirthResult birthResult){ |
| 1895 | 1895 | BaseResponse baseResponse = new BaseResponse(); |
| 1896 | + if (StringUtils.isEmpty(birthResult.getParentId())||StringUtils.isEmpty(birthResult.getBabyId())){ | |
| 1897 | + baseResponse.setErrorcode(ErrorCodeConstants.DATA_EXIST); | |
| 1898 | + baseResponse.setErrormsg("数据异常"); | |
| 1899 | + return baseResponse; | |
| 1900 | + } | |
| 1896 | 1901 | Patients patients=new Patients(); |
| 1897 | 1902 | BeanUtils.copy(birthResult, patients); |
| 1898 | 1903 | patients.setId(birthResult.getParentId()); |
| 1899 | 1904 | patientsService.updatePatient(patients); |
| 1900 | 1905 | BabyModel babyModel=new BabyModel(); |
| 1901 | 1906 | babyModel.setId(birthResult.getBabyId()); |
| 1902 | - babyModel.setWeek(birthResult.getBabyWeek()); | |
| 1903 | - babyModel.setBabyHeight(birthResult.getBabyHeight()); | |
| 1904 | - babyModel.setBabyWeight(birthResult.getBabyWeight()); | |
| 1905 | - babyModel.setDeliverOrg(birthResult.getDeliverOrg()); | |
| 1906 | - babyModel.setSex(birthResult.getBabySex()); | |
| 1907 | - babyModel.setName(birthResult.getBabyName()); | |
| 1908 | - babyModel.setFirstName(birthResult.getFirstName()); | |
| 1909 | - babyModel.setLastName(birthResult.getLastName()); | |
| 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()); | |
| 1907 | + if (StringUtils.isNotEmpty(birthResult.getBabyWeek())){ | |
| 1908 | + babyModel.setWeek(birthResult.getBabyWeek()); | |
| 1909 | + } | |
| 1910 | + if (StringUtils.isNotEmpty(birthResult.getBabyHeight())){ | |
| 1911 | + babyModel.setBabyHeight(birthResult.getBabyHeight()); | |
| 1912 | + } | |
| 1913 | + if (StringUtils.isNotEmpty(birthResult.getBabyWeight())){ | |
| 1914 | + babyModel.setBabyWeight(birthResult.getBabyWeight()); | |
| 1915 | + } | |
| 1916 | + if (StringUtils.isNotEmpty(birthResult.getDeliverOrg())){ | |
| 1917 | + babyModel.setDeliverOrg(birthResult.getDeliverOrg()); | |
| 1918 | + } | |
| 1919 | + if (birthResult.getBabySex()!=null){ | |
| 1920 | + babyModel.setSex(birthResult.getBabySex()); | |
| 1921 | + } | |
| 1922 | + if (StringUtils.isNotEmpty(birthResult.getBabyName())){ | |
| 1923 | + babyModel.setName(birthResult.getBabyName()); | |
| 1924 | + } | |
| 1925 | + if (StringUtils.isNotEmpty(birthResult.getFirstName())){ | |
| 1926 | + babyModel.setFirstName(birthResult.getFirstName()); | |
| 1927 | + } | |
| 1928 | + if (StringUtils.isNotEmpty(birthResult.getLastName())){ | |
| 1929 | + babyModel.setLastName(birthResult.getLastName()); | |
| 1930 | + } | |
| 1931 | + if (StringUtils.isNotEmpty(birthResult.getBabyAddress())){ | |
| 1932 | + babyModel.setBabyAddress(birthResult.getBabyAddress()); | |
| 1933 | + } | |
| 1934 | + if(StringUtils.isNotEmpty(birthResult.getBabyStreetId())){ | |
| 1935 | + babyModel.setBabyStreetId(birthResult.getBabyStreetId()); | |
| 1936 | + } | |
| 1937 | + if (StringUtils.isNotEmpty(birthResult.getProvinceId())){ | |
| 1938 | + babyModel.setBabyProvinceId(birthResult.getProvinceId()); | |
| 1939 | + } | |
| 1940 | + if (StringUtils.isNotEmpty(birthResult.getBabyCityId())){ | |
| 1941 | + babyModel.setBabyCityId(birthResult.getBabyCityId()); | |
| 1942 | + } | |
| 1943 | + if (StringUtils.isNotEmpty(birthResult.getBabyAreaId())){ | |
| 1944 | + babyModel.setBabyAreaId(birthResult.getBabyAreaId()); | |
| 1945 | + } | |
| 1946 | + if(StringUtils.isNotEmpty(birthResult.getBabyVillageId())){ | |
| 1947 | + babyModel.setBabyVillageId(birthResult.getBabyVillageId()); | |
| 1948 | + } | |
| 1949 | + if (StringUtils.isNotEmpty(birthResult.getBlNo())){ | |
| 1950 | + babyModel.setBlNo(birthResult.getBlNo()); | |
| 1951 | + } | |
| 1952 | + | |
| 1916 | 1953 | babyService.updateOneBaby(babyModel,babyModel.getId()); |
| 1917 | 1954 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 1918 | 1955 | baseResponse.setErrormsg("成功"); |