Commit 9cc5739247b5f435295eb2f56f51f65169e4341a
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 6 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBabyVisitDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyVisitDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyVisitService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IBabyVisitDao.java
View file @
9cc5739
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/BabyVisitDaoImpl.java
View file @
9cc5739
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyVisitService.java
View file @
9cc5739
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | +import com.lyms.platform.query.VisitQuery; | |
| 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | 7 | import org.springframework.stereotype.Service; |
| 7 | 8 | import org.springframework.util.Assert; |
| ... | ... | @@ -36,7 +37,11 @@ |
| 36 | 37 | MongoCondition condition = MongoCondition.newInstance("parentId", parentId, MongoOper.IS); |
| 37 | 38 | return iBabyVisitDao.queryBabyVisitWithQuery(condition.toMongoQuery()); |
| 38 | 39 | } |
| 39 | - | |
| 40 | + | |
| 41 | + | |
| 42 | + public int queryVisitCount(VisitQuery visitQuery){ | |
| 43 | + return iBabyVisitDao.queryBabyVisitCount(visitQuery.convertToQuery()); | |
| 44 | + } | |
| 40 | 45 | /** |
| 41 | 46 | * |
| 42 | 47 | * 根据id查询访视记录 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java
View file @
9cc5739
| ... | ... | @@ -213,7 +213,7 @@ |
| 213 | 213 | babyResult.setMotherName(patients.getMname()); |
| 214 | 214 | babyResult.setMotherPhone(patients.getMphone()); |
| 215 | 215 | babyResult.setId(patients.getId()); |
| 216 | - String tips = visitFacade.getFindTips(patients.getId()); | |
| 216 | + String tips = visitFacade.getFindTips(patients.getId(),Boolean.FALSE); | |
| 217 | 217 | babyResult.setVisit(tips); |
| 218 | 218 | babyResult.setVisitStatus(patients.getVisitstatus()); |
| 219 | 219 | return babyResult; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
9cc5739
| ... | ... | @@ -121,7 +121,7 @@ |
| 121 | 121 | comm = communityConfig.getName(); |
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | - String tips = visitFacade.getFindTips(model.getId()); | |
| 124 | + String tips = visitFacade.getFindTips(model.getId(),Boolean.TRUE); | |
| 125 | 125 | data.add(result.convertToResult(model, comm, tips)); |
| 126 | 126 | } |
| 127 | 127 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
9cc5739
| ... | ... | @@ -28,6 +28,7 @@ |
| 28 | 28 | import org.springframework.stereotype.Component; |
| 29 | 29 | |
| 30 | 30 | import java.util.ArrayList; |
| 31 | +import java.util.Collections; | |
| 31 | 32 | import java.util.Date; |
| 32 | 33 | import java.util.List; |
| 33 | 34 | |
| 34 | 35 | |
| 35 | 36 | |
| ... | ... | @@ -244,11 +245,18 @@ |
| 244 | 245 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 245 | 246 | } |
| 246 | 247 | |
| 247 | - public String getFindTips(String parentId) { | |
| 248 | + public String getFindTips(String parentId,boolean isM) { | |
| 249 | + | |
| 248 | 250 | VisitQuery visitQuery = new VisitQuery(); |
| 249 | 251 | visitQuery.setParentId(parentId); |
| 252 | + int count =0; | |
| 253 | + if(isM){ | |
| 250 | 254 | |
| 251 | - int count = visitService.queryVisitCount(visitQuery); | |
| 255 | + count= visitService.queryVisitCount(visitQuery); | |
| 256 | + }else | |
| 257 | + { | |
| 258 | + count=babyVisitService.queryVisitCount(visitQuery); | |
| 259 | + } | |
| 252 | 260 | |
| 253 | 261 | return count <= 0 ? "未访视" : "访视" + count + "次"; |
| 254 | 262 | } |
| 255 | 263 | |
| ... | ... | @@ -266,10 +274,26 @@ |
| 266 | 274 | } |
| 267 | 275 | return findBabyVisit(puerperaModel);*/ |
| 268 | 276 | BabyModel babyModel = findOneBabyByMphone(cardNo); |
| 269 | - if (null == babyModel) { | |
| 270 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("新生儿信息不存在"); | |
| 277 | + | |
| 278 | + if (null != babyModel) { | |
| 279 | + return findBabyVisit(babyModel); | |
| 271 | 280 | } |
| 272 | - return findBabyVisit(babyModel); | |
| 281 | + | |
| 282 | + PatientsQuery patientsQuery =new PatientsQuery(); | |
| 283 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 284 | + patientsQuery.setType(3); | |
| 285 | + patientsQuery.setPhone(cardNo); | |
| 286 | + | |
| 287 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery); | |
| 288 | + | |
| 289 | + if(CollectionUtils.isNotEmpty(patientses)){ | |
| 290 | + Patients patients = patientses.get(0); | |
| 291 | + BabyVisitResult babyVisitResult = new BabyVisitResult(); | |
| 292 | + babyVisitResult.convertToResult1(patients, CommonsHelper.fullAddress(patients, basicConfigService)); | |
| 293 | + babyVisitResult.setData(Collections.EMPTY_LIST); | |
| 294 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(babyVisitResult); | |
| 295 | + } | |
| 296 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("新生儿信息不存在"); | |
| 273 | 297 | } |
| 274 | 298 | |
| 275 | 299 | /** |