|
|
@ -136,9 +136,19 @@ public class PatientService implements IPatientService { |
|
|
|
|
|
|
|
//试题只需要记录3次的 9 和30 算分界限 <9 =0 ;<30 =14 ; >30 =90 记录2次的 270 算分界线 <270 算180 ,>270 算365
|
|
|
|
//是否需要去修改基本信息表中的录入状态
|
|
|
|
Boolean update=false; |
|
|
|
Boolean update=true; |
|
|
|
//先查看这个患者的需要的记录次数,在下面的这个对照组对象中呢
|
|
|
|
Inpatient inpatient = inpatientMapper.selectByPrimaryKey(patientInformation.getInpatientId()); |
|
|
|
|
|
|
|
//处理过的答案信息集合
|
|
|
|
List<PatientRecord> patientRecordList1=new ArrayList<PatientRecord>(); |
|
|
|
//处理过的提交的试题id集合
|
|
|
|
Set<Long> longSet=new HashSet<Long>(); |
|
|
|
//算出的提交天数
|
|
|
|
Integer da=0; |
|
|
|
//患者id
|
|
|
|
Long paId=0L; |
|
|
|
|
|
|
|
//下面是对试题进行提交
|
|
|
|
if(param.getList().size()>0) { |
|
|
|
//在这个地方修改其中得集合
|
|
|
@ -198,19 +208,42 @@ public class PatientService implements IPatientService { |
|
|
|
patientRecord.setCollectTime(threeAfter); |
|
|
|
} |
|
|
|
} |
|
|
|
//进行数据更新
|
|
|
|
if(patientRecord.getId()!=null){ |
|
|
|
//更新
|
|
|
|
patientRecordMapper.updateByPrimaryKeySelective(patientRecord); |
|
|
|
|
|
|
|
}else { |
|
|
|
//添加
|
|
|
|
patientRecord.setId(snowflake.nextId()); |
|
|
|
patientRecordMapper.insertSelective(patientRecord); |
|
|
|
update=true; |
|
|
|
} |
|
|
|
//删除之前的答题内容,想的是先把这些题的id全存起来,这里可以不用考虑去重的问题,然后呢,根据答题id数组和患者id和collectime删除之前的内容。
|
|
|
|
da=patientRecord.getCollectTime(); |
|
|
|
paId=patientRecord.getPatientId(); |
|
|
|
longSet.add(patientRecord.getTestQuestionsId()); |
|
|
|
|
|
|
|
|
|
|
|
//因为得删除之前得内容,所以把试题集合都抽出来,另外再写循环进行插入
|
|
|
|
patientRecordList1.add(patientRecord); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //进行数据更新
|
|
|
|
// if(patientRecord.getId()!=null){
|
|
|
|
// //更新
|
|
|
|
// patientRecordMapper.updateByPrimaryKeySelective(patientRecord);
|
|
|
|
//
|
|
|
|
// }else {
|
|
|
|
// //添加
|
|
|
|
// patientRecord.setId(snowflake.nextId());
|
|
|
|
// patientRecordMapper.insertSelective(patientRecord);
|
|
|
|
// update=true;
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
//对答案进行更新删除
|
|
|
|
PatientRecordExample patientRecordExample=new PatientRecordExample(); |
|
|
|
patientRecordExample.createCriteria().andTestQuestionsIdIn(new ArrayList<Long>(longSet)).andRecStatusEqualTo((byte) 0).andPatientIdEqualTo(paId).andCollectTimeEqualTo(da); |
|
|
|
PatientRecord patientRecord=new PatientRecord(); |
|
|
|
patientRecord.setRecStatus((byte)2); |
|
|
|
patientRecordMapper.updateByExampleSelective(patientRecord,patientRecordExample); |
|
|
|
|
|
|
|
patientRecordList1.forEach(patientRecord1 -> { |
|
|
|
patientRecord1.setId(snowflake.nextId()); |
|
|
|
patientRecordMapper.insertSelective(patientRecord1); |
|
|
|
}); |
|
|
|
|
|
|
|
//根据获取的发病时间答案数和需要搜集次数以及本次是需要更新,还是插入答案 , 来做修改基本信息中的录入状态
|
|
|
|
if (update){ |
|
|
|