|
@@ -39,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.LinkedHashMap;
|
|
@@ -472,6 +471,16 @@ public class KlDiagnoseImportFacade {
|
|
|
|
|
|
// 保存记录表和记录明细表
|
|
|
List<KlDiagnoseRecordDTO> recordList = importDiagnoseResVO.getRecordList();
|
|
|
+ List<KlDiagnoseRecord> klDiagnoseRecordList = klDiagnoseRecordService.list(new QueryWrapper<KlDiagnoseRecord>()
|
|
|
+ .eq("diagnose_id", klDiagnoseSaveVO.getId()));
|
|
|
+ if (ListUtil.isNotEmpty(klDiagnoseRecordList)) {
|
|
|
+ List<Long> recordIdList = klDiagnoseRecordList.stream().map(r -> r.getId()).collect(Collectors.toList());
|
|
|
+ // 先删除记录明细表
|
|
|
+ klDiagnoseRecordDetailService.remove(new QueryWrapper<KlDiagnoseRecordDetail>()
|
|
|
+ .in("diagnose_record_id", recordIdList));
|
|
|
+ // 再删除记录表
|
|
|
+ klDiagnoseRecordService.remove(new QueryWrapper<KlDiagnoseRecord>().in("id", recordIdList));
|
|
|
+ }
|
|
|
for (KlDiagnoseRecordDTO klDiagnoseRecordDTO : recordList) {
|
|
|
// 保存记录表
|
|
|
KlDiagnoseRecord klDiagnoseRecord = new KlDiagnoseRecord();
|