Commit ccf6ac33617ed4e20d2ec88ad01ab0a14b485835
1 parent
9a8b60605d
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 35 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/BabyRecordModel.java
View file @
ccf6ac3
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
ccf6ac3
... | ... | @@ -5756,6 +5756,19 @@ |
5756 | 5756 | BabyModel babyModelDb = babyService.getOneBabyById(request.getBabyId()); |
5757 | 5757 | babyModelDb.setNextDate(model.getNextCheckTime()); |
5758 | 5758 | babyService.updateOneBaby(babyModelDb, babyModelDb.getId()); |
5759 | + | |
5760 | + //添加高危个案管理时 更新该儿童检查档案中的下次预约时间 | |
5761 | + List<BabyCheckModel> checkList = getCheckList(babyModelDb.getId());//获取该儿童检查档案 | |
5762 | + if(CollectionUtils.isNotEmpty(checkList)){ | |
5763 | + String babyCheckid=checkList.get(checkList.size()-1).getId(); | |
5764 | + if(StringUtils.isNotEmpty(babyCheckid)){ | |
5765 | + Query query=new Query(); | |
5766 | + query.addCriteria(Criteria.where("id").is(babyCheckid)); | |
5767 | + Update update=new Update().set("nextDate",model.getNextCheckTime()); | |
5768 | + mongoTemplate.updateFirst(query,update,BabyCheckModel.class); | |
5769 | + } | |
5770 | + } | |
5771 | + | |
5759 | 5772 | return new BaseResponse(); |
5760 | 5773 | } |
5761 | 5774 | |
... | ... | @@ -5800,6 +5813,19 @@ |
5800 | 5813 | } |
5801 | 5814 | data.put("records", records); |
5802 | 5815 | return new BaseObjectResponse().setData(data); |
5816 | + } | |
5817 | + | |
5818 | + /** | |
5819 | + * 儿童检查档案 | |
5820 | + * @param id 儿童档案id | |
5821 | + * @return | |
5822 | + */ | |
5823 | + public List <BabyCheckModel> getCheckList(String id) { | |
5824 | + BabyCheckModelQuery babyCheckModel = new BabyCheckModelQuery(); | |
5825 | + babyCheckModel.setBuildId(id); | |
5826 | + babyCheckModel.setYn(YnEnums.YES.getId()); | |
5827 | + babyCheckModel.setSort("created asc"); | |
5828 | + return babyCheckService.queryBabyCheckListRecord(babyCheckModel); | |
5803 | 5829 | } |
5804 | 5830 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
ccf6ac3
... | ... | @@ -161,6 +161,14 @@ |
161 | 161 | |
162 | 162 | if (StringUtils.isNotEmpty(request.getNextDate())) { |
163 | 163 | saveCheckItem(model.getNextDate(), request.getBuildId(), request.getConfigItemId(), model.getId(), hospitalId); |
164 | + | |
165 | + //修改时同时更新高危个案管理下次预约时间 | |
166 | + Query queryBabyRecordModel =Query.query(Criteria.where("babyId").is(request.getBuildId())).with(new Sort(new Sort.Order(Sort.Direction.DESC,"created"))); | |
167 | + List<BabyRecordModel> babyRecordModelList=mongoTemplate.find(queryBabyRecordModel, BabyRecordModel.class); | |
168 | + if(CollectionUtils.isNotEmpty(babyRecordModelList)){ | |
169 | + Criteria criteriaBabyRecordMode =Criteria.where("id").is(babyRecordModelList.get(0).getId()); | |
170 | + mongoTemplate.updateFirst(Query.query(criteriaBabyRecordMode), Update.update("nextCheckTime",DateUtil.parseYMD(request.getNextDate())), BabyRecordModel.class); | |
171 | + } | |
164 | 172 | } |
165 | 173 | |
166 | 174 | if (CollectionUtils.isNotEmpty(models)) { |