Commit 4ef93d44f3a24c3ac2275865b44e3857c33a1004
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-common/src/main/java/com/lyms/platform/common/enums/RenShenJieJuEnums.java
View file @
4ef93d4
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AntenatalExaminationController.java
View file @
4ef93d4
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | @TokenRequired |
| 41 | 41 | public BaseResponse queryAntenatalExamination(@Valid AntenatalExaminationQueryRequest antenatalExaminationQueryRequest) { |
| 42 | 42 | if (StringUtils.isEmpty(antenatalExaminationQueryRequest.getCardNo()) && StringUtils.isEmpty(antenatalExaminationQueryRequest.getVcCardNo())) { |
| 43 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请输出参数."); | |
| 43 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("请输入查询条件."); | |
| 44 | 44 | } |
| 45 | 45 | return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest); |
| 46 | 46 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
4ef93d4
| ... | ... | @@ -5,12 +5,10 @@ |
| 5 | 5 | import com.lyms.platform.common.enums.*; |
| 6 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 7 | 7 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | -import com.lyms.platform.common.utils.Assert; | |
| 9 | 8 | import com.lyms.platform.common.utils.DateUtil; |
| 10 | 9 | import com.lyms.platform.common.utils.JsonUtil; |
| 11 | 10 | import com.lyms.platform.operate.web.request.MatDeliverAddRequest; |
| 12 | 11 | import com.lyms.platform.operate.web.request.MatDeliverQueryRequest; |
| 13 | -import com.lyms.platform.operate.web.result.AntenatalExaminationResult; | |
| 14 | 12 | import com.lyms.platform.operate.web.result.MatDeliverListResult; |
| 15 | 13 | import com.lyms.platform.operate.web.result.MaternalDeliverResult; |
| 16 | 14 | import com.lyms.platform.permission.model.Organization; |
| ... | ... | @@ -60,7 +58,7 @@ |
| 60 | 58 | * @param deliverAddRequest |
| 61 | 59 | * @return |
| 62 | 60 | */ |
| 63 | - public BaseResponse addOrUpdateMatDeliver(MatDeliverAddRequest deliverAddRequest,Integer userId) { | |
| 61 | + public BaseResponse addOrUpdateMatDeliver(MatDeliverAddRequest deliverAddRequest, Integer userId) { | |
| 64 | 62 | //增加 |
| 65 | 63 | if (StringUtils.isEmpty(deliverAddRequest.getId()) && StringUtils.isNotEmpty(deliverAddRequest.getParentId())) { |
| 66 | 64 | MaternalDeliverModel maternalDeliverModel = deliverAddRequest.convertToDataModel(); |
| 67 | 65 | |
| 68 | 66 | |
| 69 | 67 | |
| ... | ... | @@ -82,25 +80,28 @@ |
| 82 | 80 | patientsService.updatePatient(patients.get(0)); |
| 83 | 81 | } |
| 84 | 82 | } |
| 85 | - | |
| 86 | 83 | for (MatDeliverAddRequest.Baby baby : list) { |
| 84 | + | |
| 87 | 85 | BabyModel babyModel = baby.convertToDataModel(); |
| 88 | 86 | babyModel.setParentId(parentId); |
| 89 | 87 | babyModel.setName(userName + (babyModel.getSex() == 1 ? "之子" : "之女")); |
| 90 | - babyModel.setYn(YnEnums.YES.getId()); | |
| 91 | - | |
| 92 | - PersonModel personModel=new PersonModel(); | |
| 93 | - personModel.setType(2); | |
| 94 | - personModel.setYn(YnEnums.YES.getId()); | |
| 95 | - personModel.setBirth(DateUtil.parseYMD(deliverAddRequest.getDueDate())); | |
| 96 | - personModel.setModified(new Date()); | |
| 97 | - babyModel.setPid(personService.addPerson(personModel).getId()); | |
| 88 | + babyModel.setYn(YnEnums.NO.getId()); | |
| 89 | + //判断妊娠结局是活产才添加数据 | |
| 90 | + if ((RenShenJieJuEnums.O.getId() + "").equals(baby.getPregnancyOut())) { | |
| 91 | + babyModel.setYn(YnEnums.YES.getId()); | |
| 92 | + PersonModel personModel = new PersonModel(); | |
| 93 | + personModel.setType(2); | |
| 94 | + personModel.setYn(YnEnums.YES.getId()); | |
| 95 | + personModel.setBirth(DateUtil.parseYMD(deliverAddRequest.getDueDate())); | |
| 96 | + personModel.setModified(new Date()); | |
| 97 | + babyModel.setPid(personService.addPerson(personModel).getId()); | |
| 98 | + } | |
| 98 | 99 | babyIds.add(babyService.addOneBaby(babyModel).getId()); |
| 99 | 100 | } |
| 100 | 101 | } |
| 101 | - List list1 = autoMatchFacade.matchOrgId(userId); | |
| 102 | - if(CollectionUtils.isNotEmpty(list1)){ | |
| 103 | - maternalDeliverModel.setHospitalId(list1.get(0)+""); | |
| 102 | + List list1 = autoMatchFacade.matchOrgId(userId); | |
| 103 | + if (CollectionUtils.isNotEmpty(list1)) { | |
| 104 | + maternalDeliverModel.setHospitalId(list1.get(0) + ""); | |
| 104 | 105 | } |
| 105 | 106 | maternalDeliverModel.setBaby(babyIds); |
| 106 | 107 | maternalDeliverModel.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -149,7 +150,7 @@ |
| 149 | 150 | */ |
| 150 | 151 | public BaseResponse queryMatDeliver(MatDeliverQueryRequest deliverQueryRequest) { |
| 151 | 152 | //获取 |
| 152 | - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(),null); | |
| 153 | + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null); | |
| 153 | 154 | if (null == patients) { |
| 154 | 155 | return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR); |
| 155 | 156 | } |
| 156 | 157 | |
| 157 | 158 | |
| 158 | 159 | |
| 159 | 160 | |
| ... | ... | @@ -159,37 +160,37 @@ |
| 159 | 160 | List<MaternalDeliverModel> list = matDeliverService.query(matDeliverQuery); |
| 160 | 161 | MatDeliverListResult matDeliverListResult = new MatDeliverListResult(); |
| 161 | 162 | matDeliverListResult.convertToResult(list, patients); |
| 162 | - AntExQuery antExQuery=new AntExQuery(); | |
| 163 | + AntExQuery antExQuery = new AntExQuery(); | |
| 163 | 164 | antExQuery.setParentId(patients.getId()); |
| 164 | 165 | antExQuery.setYn(YnEnums.YES.getId()); |
| 165 | 166 | List<AntenatalExaminationModel> examinationModel = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
| 166 | 167 | try { |
| 167 | - String tTireNumber=""; | |
| 168 | + String tTireNumber = ""; | |
| 168 | 169 | List data = new ArrayList(); |
| 169 | - if(CollectionUtils.isNotEmpty(examinationModel)){ | |
| 170 | - if(null!=examinationModel&&StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())){ | |
| 171 | - tTireNumber=examinationModel.get(0).getTireNumber(); | |
| 172 | - List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(),List.class); | |
| 173 | - for(int i=0;i<l.size();i++){ | |
| 174 | - String key = (String)l.get(i); | |
| 175 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 176 | - if(null!=basicConfig){ | |
| 170 | + if (CollectionUtils.isNotEmpty(examinationModel)) { | |
| 171 | + if (null != examinationModel && StringUtils.isNotEmpty(examinationModel.get(0).getRiskFactor())) { | |
| 172 | + tTireNumber = examinationModel.get(0).getTireNumber(); | |
| 173 | + List l = JsonUtil.toList(examinationModel.get(0).getRiskFactor(), List.class); | |
| 174 | + for (int i = 0; i < l.size(); i++) { | |
| 175 | + String key = (String) l.get(i); | |
| 176 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 177 | + if (null != basicConfig) { | |
| 177 | 178 | data.add(basicConfig.getName()); |
| 178 | 179 | } |
| 179 | 180 | } |
| 180 | 181 | } |
| 181 | - }else{ | |
| 182 | - AntExChuQuery antExChuQuery=new AntExChuQuery(); | |
| 182 | + } else { | |
| 183 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 183 | 184 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 184 | 185 | antExChuQuery.setParentId(patients.getId()); |
| 185 | - List<AntExChuModel> antExChuModels= antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 186 | - if(CollectionUtils.isNotEmpty(antExChuModels)){ | |
| 187 | - tTireNumber=antExChuModels.get(0).getTireNumber(); | |
| 188 | - List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(),List.class); | |
| 189 | - for(int i=0;i<l.size();i++){ | |
| 190 | - String key = (String)l.get(i); | |
| 191 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 192 | - if(null!=basicConfig){ | |
| 186 | + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 187 | + if (CollectionUtils.isNotEmpty(antExChuModels)) { | |
| 188 | + tTireNumber = antExChuModels.get(0).getTireNumber(); | |
| 189 | + List l = JsonUtil.toList(antExChuModels.get(0).getHighrisk(), List.class); | |
| 190 | + for (int i = 0; i < l.size(); i++) { | |
| 191 | + String key = (String) l.get(i); | |
| 192 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 193 | + if (null != basicConfig) { | |
| 193 | 194 | data.add(basicConfig.getName()); |
| 194 | 195 | } |
| 195 | 196 | } |
| ... | ... | @@ -198,7 +199,8 @@ |
| 198 | 199 | |
| 199 | 200 | matDeliverListResult.setRiskFactor(data); |
| 200 | 201 | matDeliverListResult.setTireNumber1(tTireNumber); |
| 201 | - }catch (Exception e){} | |
| 202 | + } catch (Exception e) { | |
| 203 | + } | |
| 202 | 204 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(matDeliverListResult); |
| 203 | 205 | } |
| 204 | 206 | |
| 205 | 207 | |
| 206 | 208 | |
| 207 | 209 | |
| ... | ... | @@ -261,19 +263,19 @@ |
| 261 | 263 | map.put("getTaiPan", getTaiPan()); |
| 262 | 264 | map.put("getQidaiYc", getQidaiYc()); |
| 263 | 265 | map.put("getRenShenJieJuEnums", getRenShenJieJuEnums()); |
| 264 | - map.put("organizations",convert()); | |
| 265 | - map.put("cTime",DateUtil.getyyyy_MM_dd(new Date())); | |
| 266 | + map.put("organizations", convert()); | |
| 267 | + map.put("cTime", DateUtil.getyyyy_MM_dd(new Date())); | |
| 266 | 268 | return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 267 | 269 | } |
| 268 | 270 | |
| 269 | - private List convert(){ | |
| 271 | + private List convert() { | |
| 270 | 272 | List<Organization> organization = organizationService.queryHospital(); |
| 271 | 273 | List data = new ArrayList(); |
| 272 | - if(CollectionUtils.isNotEmpty(organization)){ | |
| 273 | - for(Organization org:organization){ | |
| 274 | + if (CollectionUtils.isNotEmpty(organization)) { | |
| 275 | + for (Organization org : organization) { | |
| 274 | 276 | Map map = new HashMap(); |
| 275 | - map.put("id",org.getId()); | |
| 276 | - map.put("name",org.getName()); | |
| 277 | + map.put("id", org.getId()); | |
| 278 | + map.put("name", org.getName()); | |
| 277 | 279 | data.add(map); |
| 278 | 280 | } |
| 279 | 281 | } |
| ... | ... | @@ -411,6 +413,7 @@ |
| 411 | 413 | } |
| 412 | 414 | return list; |
| 413 | 415 | } |
| 416 | + | |
| 414 | 417 | //脐带异常类型 |
| 415 | 418 | public List getQidaiYc() { |
| 416 | 419 | List<Object> list = new ArrayList<>(); |
| ... | ... | @@ -422,6 +425,7 @@ |
| 422 | 425 | } |
| 423 | 426 | return list; |
| 424 | 427 | } |
| 428 | + | |
| 425 | 429 | //妊娠结局 |
| 426 | 430 | public List getRenShenJieJuEnums() { |
| 427 | 431 | List<Object> list = new ArrayList<>(); |