|
@@ -149,12 +149,18 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
try {
|
|
|
useId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
|
|
|
} catch (Exception e) {
|
|
|
- //analyze_run运行质控没有登录认证 所以会获取不到
|
|
|
+ //analyze_run运行质控没有登录认证 所以会获取不到
|
|
|
useId = 952795279527L;
|
|
|
}
|
|
|
}
|
|
|
+ //获取上一次人工添加的缺陷
|
|
|
+ QcresultInfo qcresultInfoup
|
|
|
+ = this.getOne(
|
|
|
+ new QueryWrapper<QcresultInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode()), false);
|
|
|
Date now = DateUtil.now();
|
|
|
- //逻辑删除记录
|
|
|
this.update(new UpdateWrapper<QcresultInfo>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", analyzeVO.getHospitalId())
|
|
@@ -192,16 +198,43 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
qcresultInfo.setGmtModified(now);
|
|
|
qcresultInfo.setModifier(useId.toString());
|
|
|
this.save(qcresultInfo);
|
|
|
+ Long newId = qcresultInfo.getId();
|
|
|
//更新质控评分明细信息
|
|
|
switch (algorithmVO.getType()) {
|
|
|
//自动评分
|
|
|
case 0:
|
|
|
//删除记录
|
|
|
- qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
|
|
|
+// qcresultDetailServiceImpl.remove(new QueryWrapper<QcresultDetail>()
|
|
|
+// .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+// .eq("behospital_code", analyzeVO.getBehospitalCode()));
|
|
|
+
|
|
|
+ //上一次人工评分条目
|
|
|
+ List<QcresultDetail> oldQcresultDetails = null;
|
|
|
+ if (qcresultInfoup != null) {
|
|
|
+ oldQcresultDetails = qcresultDetailServiceImpl.list(new QueryWrapper<QcresultDetail>()
|
|
|
+ .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+ .eq("qcresult_info_id", qcresultInfoup.getId())
|
|
|
+ .eq("grade_type", "2")
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode()));
|
|
|
+ }
|
|
|
+
|
|
|
+ qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode()));
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .set("modifier", useId)
|
|
|
+ .set("gmt_modified", now));
|
|
|
+ //
|
|
|
//批量插入新的数据
|
|
|
List<QcresultDetail> qcresultDetailList = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(oldQcresultDetails)) {
|
|
|
+ qcresultDetailList.addAll(oldQcresultDetails);
|
|
|
+ qcresultDetailList.forEach(qcresultDetail -> {
|
|
|
+ //原手动添加缺陷绑定新机器评分id
|
|
|
+ qcresultDetail.setQcresultInfoId(newId);
|
|
|
+ });
|
|
|
+ }
|
|
|
List<QcResultAlgVO> qcResultAlgVORes = algorithmVO.getQcResultAlgVOList();
|
|
|
if (ListUtil.isNotEmpty(qcResultAlgVORes)) {
|
|
|
for (QcResultAlgVO qcResultAlgVO : qcResultAlgVORes) {
|
|
@@ -216,6 +249,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
qcresultDetail.setGmtModified(now);
|
|
|
qcresultDetail.setModifier(useId.toString());
|
|
|
qcresultDetail.setInfo(StringUtil.isNotBlank(qcResultAlgVO.getInfo()) ? qcResultAlgVO.getInfo() : "");
|
|
|
+ qcresultDetail.setQcresultInfoId(newId);
|
|
|
qcresultDetailList.add(qcresultDetail);
|
|
|
}
|
|
|
qcresultDetailServiceImpl.saveBatch(qcresultDetailList);
|
|
@@ -233,6 +267,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
qcresultDetailAdd.setCreator(useId.toString());
|
|
|
qcresultDetailAdd.setGmtModified(now);
|
|
|
qcresultDetailAdd.setModifier(useId.toString());
|
|
|
+ qcresultDetailAdd.setQcresultInfoId(newId);
|
|
|
qcresultDetailServiceImpl.save(qcresultDetailAdd);
|
|
|
break;
|
|
|
case 2:
|
|
@@ -253,44 +288,44 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
.set("msg", algorithmVO.getOptResultAlgVO().getMsg())
|
|
|
.set("score", algorithmVO.getOptResultAlgVO().getScore())
|
|
|
.set("opt_type", 3)
|
|
|
- .set("grade_type",2)
|
|
|
+ .set("grade_type", 2)
|
|
|
.set("modifier", useId)
|
|
|
+ .set("qcresult_info_id", newId)
|
|
|
.set("gmt_modified", now)
|
|
|
- .set("explain_info",algorithmVO.getOptResultAlgVO().getExplainInfo())
|
|
|
+ .set("explain_info", algorithmVO.getOptResultAlgVO().getExplainInfo())
|
|
|
);
|
|
|
break;
|
|
|
case 4:
|
|
|
//获取病历核查人员id,该操作只能是核查员操作
|
|
|
- Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
- .eq("behospital_code", analyzeVO.getBehospitalCode())).getCheckId();
|
|
|
- if(checkId==null)
|
|
|
- {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "病历没有分配核查人员");
|
|
|
- }
|
|
|
- if(!checkId.equals(useId))
|
|
|
- {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户不是分配的核查人员");
|
|
|
- }
|
|
|
+// Long checkId = medCheckInfoFacade.getOne(new QueryWrapper<MedCheckInfo>()
|
|
|
+// .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+// .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+// .eq("behospital_code", analyzeVO.getBehospitalCode())).getCheckId();
|
|
|
+// if(checkId==null)
|
|
|
+// {
|
|
|
+// throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "病历没有分配核查人员");
|
|
|
+// }
|
|
|
+// if(!checkId.equals(useId))
|
|
|
+// {
|
|
|
+// throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前用户不是分配的核查人员");
|
|
|
+// }
|
|
|
//逻辑删除质控明细 0删除
|
|
|
- if(analyzeVO.getDelStatus()==0)
|
|
|
- {
|
|
|
+ if (analyzeVO.getDelStatus() == 0) {
|
|
|
qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
|
.eq("id", algorithmVO.getOptResultAlgVO().getId())
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
.eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
- .set("grade_type",2)
|
|
|
+ .set("grade_type", 2)
|
|
|
.set("opt_type", 2)
|
|
|
+ .set("qcresult_info_id", newId)
|
|
|
.set("modifier", useId)
|
|
|
.set("gmt_modified", now)
|
|
|
);
|
|
|
}
|
|
|
//1恢复
|
|
|
- else if(analyzeVO.getDelStatus()==1)
|
|
|
- {
|
|
|
+ else if (analyzeVO.getDelStatus() == 1) {
|
|
|
//该条目是机器插入条目
|
|
|
qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
|
.eq("id", algorithmVO.getOptResultAlgVO().getId())
|
|
@@ -298,24 +333,48 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
.eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
.eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
.set("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("grade_type",2)
|
|
|
+ .set("grade_type", 2)
|
|
|
.set("opt_type", 1)
|
|
|
+ .set("qcresult_info_id", newId)
|
|
|
.set("modifier", useId)
|
|
|
.set("remark", null)
|
|
|
.set("gmt_modified", now)
|
|
|
);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "delStatus参数错误");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
break;
|
|
|
default:
|
|
|
/* DO NOTHING */
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ //如果不是自动评分(是新增修改删除条目)修改评分主表id
|
|
|
+ if (algorithmVO.getType() != 0) {
|
|
|
+ //修改上一次人工条目 评分主表id
|
|
|
+ if (qcresultInfoup != null && qcresultInfoup.getId() != null) {
|
|
|
+ qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
|
+ .eq("qcresult_info_id", qcresultInfoup.getId())
|
|
|
+ .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+ .eq("grade_type", 2)
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .set("qcresult_info_id", newId)
|
|
|
+ .set("modifier", useId)
|
|
|
+ .set("gmt_modified", now)
|
|
|
+ );
|
|
|
+ }
|
|
|
+ //未删除的 评分主表id
|
|
|
+ qcresultDetailServiceImpl.update(new UpdateWrapper<QcresultDetail>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .eq("hospital_id", analyzeVO.getHospitalId())
|
|
|
+ .eq("behospital_code", analyzeVO.getBehospitalCode())
|
|
|
+ .set("qcresult_info_id", newId)
|
|
|
+ .set("modifier", useId)
|
|
|
+ .set("gmt_modified", now)
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//质控模块评分数据
|
|
|
//统一为长兴的算法
|
|
|
//逻辑删除数据
|
|
@@ -337,6 +396,7 @@ public class QcresultInfoFacade extends QcresultInfoServiceImpl {
|
|
|
medQcresultCases.setCreator(useId.toString());
|
|
|
medQcresultCases.setGmtModified(now);
|
|
|
medQcresultCases.setModifier(useId.toString());
|
|
|
+ medQcresultCases.setQcresultInfoId(newId);
|
|
|
medQcresultCasesList.add(medQcresultCases);
|
|
|
}
|
|
|
medQcresultCasesService.saveBatch(medQcresultCasesList);
|