Commit 761080fae629324cad35608687cd38a57ecdd433
1 parent
42cb87a580
Exists in
master
and in
6 other branches
实时添加追访记录
Showing 5 changed files with 30 additions and 11 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyAfterVisitController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyAfterVisitService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyAfterVisitController.java
View file @
761080f
| ... | ... | @@ -13,6 +13,7 @@ |
| 13 | 13 | import org.springframework.stereotype.Controller; |
| 14 | 14 | import org.springframework.web.bind.annotation.*; |
| 15 | 15 | |
| 16 | +import javax.servlet.http.HttpServletRequest; | |
| 16 | 17 | import javax.validation.Valid; |
| 17 | 18 | import java.util.concurrent.ExecutionException; |
| 18 | 19 | |
| ... | ... | @@ -59,8 +60,8 @@ |
| 59 | 60 | @RequestMapping(method = RequestMethod.POST, value = "/afterVisit/list") |
| 60 | 61 | @ResponseBody |
| 61 | 62 | @TokenRequired |
| 62 | - private BaseResponse getAfterVisitListPage(@RequestBody @Valid BabyAfterVisitRequest request) { | |
| 63 | - return babyAfterVisitService.getAfterVisitListPage(request); | |
| 63 | + private BaseResponse getAfterVisitListPage(@RequestBody @Valid BabyAfterVisitRequest request, HttpServletRequest req) { | |
| 64 | + return babyAfterVisitService.getAfterVisitListPage(request,getUserId(req)); | |
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | /** |
| ... | ... | @@ -72,8 +73,8 @@ |
| 72 | 73 | @RequestMapping(method = RequestMethod.POST, value = "/build/list") |
| 73 | 74 | @ResponseBody |
| 74 | 75 | @TokenRequired |
| 75 | - private BaseResponse getBuildListPage(@RequestBody @Valid BabyAfterVisitBuildListRequest request) { | |
| 76 | - return babyAfterVisitService.getBuildListPage(request); | |
| 76 | + private BaseResponse getBuildListPage(@RequestBody @Valid BabyAfterVisitBuildListRequest request, HttpServletRequest req) { | |
| 77 | + return babyAfterVisitService.getBuildListPage(request, getUserId(req)); | |
| 77 | 78 | } |
| 78 | 79 | |
| 79 | 80 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
761080f
| ... | ... | @@ -529,6 +529,8 @@ |
| 529 | 529 | } else { |
| 530 | 530 | babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_CHECK, STATUS_TYPE_UPDATE); |
| 531 | 531 | } |
| 532 | + bm.setId(request.getBuildId()); | |
| 533 | + babyAfterVisitService.addOrUpdateAfterVisitData(bm, TYPE_STATISTICS, STATUS_TYPE_CHECK); | |
| 532 | 534 | |
| 533 | 535 | operateLogFacade.addAddOptLog(userId, Integer.valueOf(hospitalId), model, OptActionEnums.ADD.getId(), "添加儿童检查"); |
| 534 | 536 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyAfterVisitService.java
View file @
761080f
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | * @param request |
| 57 | 57 | * @return |
| 58 | 58 | */ |
| 59 | - BaseResponse getAfterVisitListPage(BabyAfterVisitRequest request); | |
| 59 | + BaseResponse getAfterVisitListPage(BabyAfterVisitRequest request, Integer userId); | |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | 62 | * 初始化同步儿童追访统计表数据 |
| 63 | 63 | |
| ... | ... | @@ -67,12 +67,12 @@ |
| 67 | 67 | BaseResponse syncInitStatistics(String babyId, String startTime, String endTime) throws ExecutionException, InterruptedException; |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * 档案转正列表 | |
| 70 | + * 档案转正列表/儿保检查/眼保检查/听力筛查 | |
| 71 | 71 | * |
| 72 | 72 | * @param request |
| 73 | 73 | * @return |
| 74 | 74 | */ |
| 75 | - BaseResponse getBuildListPage(BabyAfterVisitBuildListRequest request); | |
| 75 | + BaseResponse getBuildListPage(BabyAfterVisitBuildListRequest request, Integer userId); | |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * 档案转正/儿保检查/眼保检查/听力筛查 - 新增追访记录 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyAfterVisitServiceImpl.java
View file @
761080f
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | import com.lyms.platform.common.result.BaseModel; |
| 12 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 13 | 13 | import com.lyms.platform.common.utils.*; |
| 14 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
| 14 | 15 | import com.lyms.platform.operate.web.request.BabyAfterVisitBuildListRequest; |
| 15 | 16 | import com.lyms.platform.operate.web.request.BabyAfterVisitInfoDetailListRequest; |
| 16 | 17 | import com.lyms.platform.operate.web.request.BabyAfterVisitInfoDetailRequest; |
| ... | ... | @@ -57,6 +58,9 @@ |
| 57 | 58 | @Autowired |
| 58 | 59 | private MasterUsersMapper usersMapper; |
| 59 | 60 | |
| 61 | + @Autowired | |
| 62 | + private AutoMatchFacade autoMatchFacade; | |
| 63 | + | |
| 60 | 64 | /** |
| 61 | 65 | * 追访管理 - 追访列表 |
| 62 | 66 | * |
| 63 | 67 | |
| ... | ... | @@ -64,9 +68,11 @@ |
| 64 | 68 | * @return |
| 65 | 69 | */ |
| 66 | 70 | @Override |
| 67 | - public BaseResponse getAfterVisitListPage(BabyAfterVisitRequest request) { | |
| 71 | + public BaseResponse getAfterVisitListPage(BabyAfterVisitRequest request, Integer userId) { | |
| 68 | 72 | String querNo = request.getQuerNo(); |
| 69 | 73 | Query query = new Query(); |
| 74 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 75 | + query.addCriteria(Criteria.where("hospitalId").is(hospitalId)); | |
| 70 | 76 | |
| 71 | 77 | // 查询号 姓名、证件号、手机号 |
| 72 | 78 | if (StringUtils.isNotEmpty(querNo)) { |
| 73 | 79 | |
| ... | ... | @@ -273,13 +279,13 @@ |
| 273 | 279 | |
| 274 | 280 | |
| 275 | 281 | /** |
| 276 | - * 档案转正列表 | |
| 282 | + * 档案转正列表/儿保检查/眼保检查/听力筛查 | |
| 277 | 283 | * |
| 278 | 284 | * @param request |
| 279 | 285 | * @return |
| 280 | 286 | */ |
| 281 | 287 | @Override |
| 282 | - public BaseResponse getBuildListPage(BabyAfterVisitBuildListRequest request) { | |
| 288 | + public BaseResponse getBuildListPage(BabyAfterVisitBuildListRequest request, Integer userId) { | |
| 283 | 289 | String type = request.getType(); |
| 284 | 290 | boolean isOk = checkOverdueDataByType(type); |
| 285 | 291 | if (!isOk) { |
| ... | ... | @@ -287,6 +293,8 @@ |
| 287 | 293 | } |
| 288 | 294 | |
| 289 | 295 | Query query = new Query(); |
| 296 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 297 | + query.addCriteria(Criteria.where("hospitalId").is(hospitalId)); | |
| 290 | 298 | if (Objects.isNull(type)) { |
| 291 | 299 | return new BaseResponse("参数缺失", ErrorCodeConstants.PARAMETER_ERROR); |
| 292 | 300 | } |
| ... | ... | @@ -770,7 +778,12 @@ |
| 770 | 778 | } |
| 771 | 779 | // 更新眼保数量 |
| 772 | 780 | if (Objects.equals(STATUS_TYPE_EYE_CHECK, statusType)) { |
| 773 | - | |
| 781 | + BabyAfterVisitStatisticsModel one = mongoTemplate.findOne(Query.query(Criteria.where(BABY_ID).is(babyModelId)), BabyAfterVisitStatisticsModel.class); | |
| 782 | + if (one != null) { | |
| 783 | + Integer eyeCheckSize = one.getEyeCheckSize(); | |
| 784 | + eyeCheckSize ++; | |
| 785 | + mongoTemplate.updateFirst(Query.query(Criteria.where(BABY_ID).is(babyModelId)), Update.update("eyeCheckSize", eyeCheckSize), BabyAfterVisitStatisticsModel.class); | |
| 786 | + } | |
| 774 | 787 | } |
| 775 | 788 | logger.info("已更新到追访概况中"); |
| 776 | 789 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
View file @
761080f
| ... | ... | @@ -109,6 +109,9 @@ |
| 109 | 109 | } else { |
| 110 | 110 | babyAfterVisitService.addOrUpdateAfterVisitData(babyEyeCheck, TYPE_EYE_CHECK, STATUS_TYPE_UPDATE); |
| 111 | 111 | } |
| 112 | + BabyModel model = new BabyModel(); | |
| 113 | + model.setId(babyEyeCheck.getBabyId()); | |
| 114 | + babyAfterVisitService.addOrUpdateAfterVisitData(model, TYPE_STATISTICS, STATUS_TYPE_EYE_CHECK); | |
| 112 | 115 | |
| 113 | 116 | if(CollectionUtils.isNotEmpty(babyEyeCheck.getRiskFactorId())) { |
| 114 | 117 | String riskFactor = org.apache.commons.lang3.StringUtils.join(babyEyeCheck.getRiskFactorId().toArray(), ","); |