|
@@ -14,6 +14,7 @@ import com.diagbot.enums.ModeIdEnum;
|
|
import com.diagbot.enums.data.*;
|
|
import com.diagbot.enums.data.*;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.facade.*;
|
|
import com.diagbot.facade.*;
|
|
|
|
+import com.diagbot.service.ModelHospitalService;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
import com.diagbot.util.*;
|
|
import com.diagbot.util.*;
|
|
@@ -43,6 +44,10 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
@Autowired
|
|
@Autowired
|
|
private ModelHospitalFacade modelHospitalFacade;
|
|
private ModelHospitalFacade modelHospitalFacade;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ @Qualifier("modelHospitalServiceImpl")
|
|
|
|
+ private ModelHospitalService modelHospitalService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private AMedicalRecordContentFacade aMedicalRecordContentFacade;
|
|
private AMedicalRecordContentFacade aMedicalRecordContentFacade;
|
|
|
|
|
|
@@ -492,20 +497,18 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
List<MedicalRecord> addE = Lists.newLinkedList();
|
|
List<MedicalRecord> addE = Lists.newLinkedList();
|
|
List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
List<BehospitalInfo> behospitalInfoList = Lists.newLinkedList();
|
|
List<BehospitalInfo> behospitalInfoList = Lists.newLinkedList();
|
|
- List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
|
|
|
|
+ List<ModelHospital> modelHospitalList = Lists.newLinkedList();
|
|
if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
medicalRecordList.stream().forEach(s -> {
|
|
medicalRecordList.stream().forEach(s -> {
|
|
//初始化mode_id
|
|
//初始化mode_id
|
|
Long modeId = initModeId(s);
|
|
Long modeId = initModeId(s);
|
|
if (modeId == Long.valueOf("0")) {
|
|
if (modeId == Long.valueOf("0")) {
|
|
//新增类型到监测表中
|
|
//新增类型到监测表中
|
|
- QcAbnormal qcAbnormal = new QcAbnormal();
|
|
|
|
- qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
- qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
- qcAbnormal.setType(1);
|
|
|
|
- qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
- qcAbnormal.setGmtCreate(new Date());
|
|
|
|
- qcAbnormalList.add(qcAbnormal);
|
|
|
|
|
|
+ ModelHospital modelHospital=new ModelHospital();
|
|
|
|
+ modelHospital.setHospitalId(s.getHospitalId());
|
|
|
|
+ modelHospital.setHospitalModelName(s.getRecTitle());
|
|
|
|
+ modelHospital.setGmtCreate(new Date());
|
|
|
|
+ modelHospitalList.add(modelHospital);
|
|
} else if (modeId == Long.valueOf("1")) {
|
|
} else if (modeId == Long.valueOf("1")) {
|
|
BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
.eq("behospital_code", s.getBehospitalCode())
|
|
.eq("behospital_code", s.getBehospitalCode())
|
|
@@ -520,14 +523,16 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
}
|
|
}
|
|
s.setModeId(modeId);
|
|
s.setModeId(modeId);
|
|
//新增或修改
|
|
//新增或修改
|
|
- MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
|
|
|
|
- .eq("rec_id", s.getRecId())
|
|
|
|
- .eq("hospital_id", s.getHospitalId())
|
|
|
|
- .eq("behospital_code", s.getBehospitalCode()), false);
|
|
|
|
|
|
+ QueryWrapper<MedicalRecord> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("rec_id", s.getRecId());
|
|
|
|
+ queryWrapper.eq("hospital_id", s.getHospitalId());
|
|
|
|
+ queryWrapper.eq("behospital_code", s.getBehospitalCode());
|
|
|
|
+ MedicalRecord mRecord = this.getOne(queryWrapper);
|
|
if (mRecord != null) {
|
|
if (mRecord != null) {
|
|
s.setGmtModified(new Date());
|
|
s.setGmtModified(new Date());
|
|
s.setIsDeleted(IsDeleteEnum.N.getKey());
|
|
s.setIsDeleted(IsDeleteEnum.N.getKey());
|
|
- updateE.add(s);
|
|
|
|
|
|
+ medicalRecordService.update(s,queryWrapper);
|
|
|
|
+ //updateE.add(s);
|
|
} else {
|
|
} else {
|
|
s.setGmtCreate(new Date());
|
|
s.setGmtCreate(new Date());
|
|
addE.add(s);
|
|
addE.add(s);
|
|
@@ -537,11 +542,11 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
if (addE.size() > 0) {
|
|
if (addE.size() > 0) {
|
|
medicalRecordService.saveBatch(addE);
|
|
medicalRecordService.saveBatch(addE);
|
|
}
|
|
}
|
|
- if (updateE.size() > 0) {
|
|
|
|
|
|
+ /*if (updateE.size() > 0) {
|
|
medicalRecordService.updateBatchByKey(updateE);
|
|
medicalRecordService.updateBatchByKey(updateE);
|
|
- }
|
|
|
|
- if (qcAbnormalList.size() > 0) {
|
|
|
|
- qcAbnormalService.saveBatch(qcAbnormalList);
|
|
|
|
|
|
+ }*/
|
|
|
|
+ if (modelHospitalList.size() > 0) {
|
|
|
|
+ modelHospitalService.saveBatch(modelHospitalList);
|
|
}
|
|
}
|
|
if (behospitalInfoList.size() > 0) {
|
|
if (behospitalInfoList.size() > 0) {
|
|
behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|
|
behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|