Commit e77b7feb92a296207c1c9b08f766b68dc880d3fd

Authored by liquanyu
1 parent 93c0f08cbc

update code

Showing 1 changed file with 60 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ e77b7fe
... ... @@ -5474,10 +5474,70 @@
5474 5474 map.put("risk",risk);
5475 5475 map.put("score",model.gethScore());
5476 5476 map.put("score",model.getStatus() == 0 ? "未确诊" : "已确诊");
  5477 + riskList.add(map);
5477 5478 }
5478 5479 }
5479 5480 return new BaseListResponse().setData(riskList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setPageInfo(baseQuery.getPageInfo());
5480 5481 }
5481 5482  
  5483 + public BaseResponse getAutoRiskCount(Integer userId) {
  5484 + Query query = new Query();
  5485 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  5486 + query.addCriteria(Criteria.where("hospitalId").is(hospitalId));
  5487 + query.addCriteria(Criteria.where("status").is(0));
  5488 + long count = mongoTemplate.count(query.with(new Sort(Sort.Direction.DESC, "created")), AutoRiskRecord.class);
  5489 + return new BaseObjectResponse().setData(count).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  5490 + }
  5491 +
  5492 +
  5493 + public BaseResponse setAutoRisked(String id, Integer userId) {
  5494 + Query query = new Query();
  5495 + query.addCriteria(Criteria.where("_id").is(id));
  5496 + AutoRiskRecord autoRisk = mongoTemplate.findOne(query, AutoRiskRecord.class);
  5497 + if (autoRisk != null)
  5498 + {
  5499 + if (autoRisk.getType() == 0) {
  5500 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  5501 + antExChuQuery.setYn(YnEnums.YES.getId());
  5502 + antExChuQuery.setParentId(autoRisk.getPatientId());
  5503 + List<AntExChuModel> list = antenatalExaminationService.queryAntExChu(antExChuQuery);
  5504 + if (CollectionUtils.isNotEmpty(list)) {
  5505 + AntExChuModel model = list.get(0);
  5506 + AntExcAddRequest excAddRequest = new AntExcAddRequest();
  5507 + excAddRequest.setId(model.getId());
  5508 + List li = null;
  5509 + try {
  5510 + li = JsonUtil.toList(model.getHighrisk(), List.class);
  5511 + } catch (Exception e) {
  5512 + }
  5513 + List<String> riskList = autoRisk.gethRisk();
  5514 + if (CollectionUtils.isNotEmpty(li))
  5515 + {
  5516 + riskList.addAll(li);
  5517 + }
  5518 +
  5519 + excAddRequest.setHighrisk(riskList);
  5520 + excAddRequest.setParentId(autoRisk.getPatientId());
  5521 + addOneAnetExChu(excAddRequest, userId);
  5522 + }
  5523 + }
  5524 + else if (autoRisk.getType() == 1)
  5525 + {
  5526 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  5527 + antExChuQuery.setYn(YnEnums.YES.getId());
  5528 + antExChuQuery.setId(autoRisk.getFid());
  5529 + List<AntExChuModel> list = antenatalExaminationService.queryAntExChu(antExChuQuery);
  5530 + if (CollectionUtils.isNotEmpty(list)) {
  5531 + AntExChuModel model = list.get(0);
  5532 + AntExcAddRequest excAddRequest = new AntExcAddRequest();
  5533 + excAddRequest.setId(model.getId());
  5534 + excAddRequest.setHighrisk(autoRisk.gethRisk());
  5535 + excAddRequest.setParentId(autoRisk.getPatientId());
  5536 + addOneAnetExChu(excAddRequest, userId);
  5537 + }
  5538 + }
  5539 + }
  5540 + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
  5541 + }
5482 5542 }