Commit e9c98fc8a30b8d851bcacaadfaabc1695382376b

Authored by jiangjiazhi
1 parent 0fb68c5194

修改产检删除

Showing 2 changed files with 50 additions and 3 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AntExRecordService.java View file @ e9c98fc
... ... @@ -93,6 +93,50 @@
93 93 }
94 94 }
95 95  
  96 +
  97 +
  98 + private void syncSingle(String parentId){
  99 + AntExQuery antExQuery = new AntExQuery();
  100 + antExQuery.setYn(YnEnums.YES.getId());
  101 + antExQuery.setParentId(parentId);
  102 + //复诊
  103 + List<AntenatalExaminationModel> list = antExService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC,"checkDate"));
  104 + for (AntenatalExaminationModel antEx : list) {
  105 + AntExRecordModel record = convert(antEx);
  106 + if (null != record) {
  107 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  108 + antExRecordQuery.setParentId(record.getParentId());
  109 + antExRecordQuery.setcId(record.getCheckDoctor());
  110 + Integer count = count(antExRecordQuery);
  111 + if (null == count || 0 == count) {
  112 + antExRecordDao.addOneRecord(record);
  113 + }
  114 + }
  115 + }
  116 +
  117 +
  118 + //初诊
  119 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  120 + antExChuQuery.setYn(YnEnums.YES.getId());
  121 + antExChuQuery.setParentId(parentId);
  122 + List<AntExChuModel> antExChuModelList = antExService.queryAntExChu(antExChuQuery.convertToQuery());
  123 +
  124 + if (CollectionUtils.isNotEmpty(antExChuModelList)) {
  125 + for (AntExChuModel antEx : antExChuModelList) {
  126 + AntExRecordModel record = convert(antEx);
  127 + if (null != record) {
  128 + AntExRecordQuery antExRecordQuery = new AntExRecordQuery();
  129 + antExRecordQuery.setParentId(record.getParentId());
  130 + antExRecordQuery.setcId(record.getCheckDoctor());
  131 + Integer count = count(antExRecordQuery);
  132 + if (null == count || 0 == count) {
  133 + antExRecordDao.addOneRecord(record);
  134 + }
  135 + }
  136 + }
  137 + }
  138 + }
  139 +
96 140 /**
97 141 * 处理删除检查
98 142 *
99 143  
... ... @@ -103,8 +147,11 @@
103 147 return;
104 148 }
105 149 AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery();
106   - antExRecordQuery1.setfId(parentId);
  150 + antExRecordQuery1.setParentId(parentId);
107 151 antExRecordDao.findAndMove(antExRecordQuery1.convertToQuery());
  152 +
  153 +
  154 + syncSingle(parentId);
108 155 /* //先删除掉该人的
109 156 AntExRecordQuery antExRecordQuery1 = new AntExRecordQuery();
110 157 antExRecordQuery1.setParentId(parentId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ e9c98fc
... ... @@ -1432,7 +1432,7 @@
1432 1432 setLashCTimes(hospital, antenatalExaminationModel.getParentId(), 2);
1433 1433  
1434 1434 updateLastRisk(antenatalExaminationModel.getParentId());
1435   - recordService.handExRecord(antenatalExaminationModel.getId());
  1435 + recordService.handExRecord(antenatalExaminationModel.getParentId());
1436 1436 } else {
1437 1437 return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除");
1438 1438 }
... ... @@ -1480,7 +1480,7 @@
1480 1480 AntExChuModel antExChuModel1 = antenatalExaminationService.findOne(antExQueryRequest.getId());
1481 1481 setLashCTimes(hospital, antExChuModel1.getParentId(), 1);
1482 1482 updateLastRisk(antExChuModel1.getParentId());
1483   - recordService.handExRecord(antExChuModel1.getId());
  1483 + recordService.handExRecord(antExChuModel1.getParentId());
1484 1484 } else {
1485 1485 return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg("当前产检记录不是本院最新的产检记录,不能删除");
1486 1486 }