|
@@ -238,26 +238,26 @@ public class RelationContactFacade extends RelationServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 医学术语关联维护/医学术语多层关联维护/化验子项维护-删除或者恢复
|
|
|
|
|
|
+ * 化验子项维护-逻辑删除或者恢复
|
|
* @param removeRelationContactVO
|
|
* @param removeRelationContactVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Boolean removeRelationContact(RemoveRelationContactVO removeRelationContactVO){
|
|
public Boolean removeRelationContact(RemoveRelationContactVO removeRelationContactVO){
|
|
String currentUser = UserUtils.getCurrentPrincipleID();
|
|
String currentUser = UserUtils.getCurrentPrincipleID();
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
- repairRelationDataForDel(removeRelationContactVO.getConceptId(), removeRelationContactVO.getRelationId(),removeRelationContactVO.getIsDeleted(),currentUser,now);
|
|
|
|
|
|
+ repairRelationDataForRemove(removeRelationContactVO.getConceptId(), removeRelationContactVO.getRelationId(),removeRelationContactVO.getIsDeleted(),currentUser,now);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 处理关系节点-删除/恢复事件
|
|
|
|
|
|
+ * 化验子项维护-逻辑删除或者恢复-处理关系节点
|
|
* @param conceptId
|
|
* @param conceptId
|
|
* @param relationId
|
|
* @param relationId
|
|
* @param isDeleted
|
|
* @param isDeleted
|
|
* @param currentUser 操作人
|
|
* @param currentUser 操作人
|
|
* @param now 操作时间
|
|
* @param now 操作时间
|
|
*/
|
|
*/
|
|
- private void repairRelationDataForDel(Long conceptId,Long relationId,String isDeleted,String currentUser,Date now){
|
|
|
|
|
|
+ private void repairRelationDataForRemove(Long conceptId,Long relationId,String isDeleted,String currentUser,Date now){
|
|
QueryWrapper<Relation> relationQe = new QueryWrapper<>();
|
|
QueryWrapper<Relation> relationQe = new QueryWrapper<>();
|
|
relationQe.eq("start_id", conceptId);
|
|
relationQe.eq("start_id", conceptId);
|
|
relationQe.eq(relationId!=null,"relation_id", relationId);
|
|
relationQe.eq(relationId!=null,"relation_id", relationId);
|
|
@@ -290,7 +290,41 @@ public class RelationContactFacade extends RelationServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
relationList.forEach(i->{
|
|
relationList.forEach(i->{
|
|
- repairRelationDataForDel(i.getEndId(), relationId,isDeleted,currentUser,now);
|
|
|
|
|
|
+ repairRelationDataForRemove(i.getEndId(), relationId,isDeleted,currentUser,now);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 医学术语关联维护/医学术语多层关联维护-物理删除
|
|
|
|
+ * @param removeRelationContactVO
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public Boolean deleteRelationContact(RemoveRelationContactVO removeRelationContactVO){
|
|
|
|
+ repairRelationDataForDelete(removeRelationContactVO.getConceptId(), removeRelationContactVO.getRelationId());
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 医学术语关联维护/医学术语多层关联维护-物理删除-处理关系节点
|
|
|
|
+ * @param conceptId
|
|
|
|
+ * @param relationId
|
|
|
|
+ */
|
|
|
|
+ private void repairRelationDataForDelete(Long conceptId,Long relationId){
|
|
|
|
+ QueryWrapper<Relation> relationQe = new QueryWrapper<>();
|
|
|
|
+ relationQe.eq("start_id", conceptId);
|
|
|
|
+ relationQe.eq(relationId!=null,"relation_id", relationId);
|
|
|
|
+ List<Relation> relationList = list(relationQe);
|
|
|
|
+
|
|
|
|
+ if(relationList.size()==0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(!remove(relationQe)){
|
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ relationList.forEach(i->{
|
|
|
|
+ repairRelationDataForDelete(i.getEndId(), relationId);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|