diff --git a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/mapper/resume_mapper.py b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/mapper/resume_mapper.py index 8e13da0..4b25e27 100644 --- a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/mapper/resume_mapper.py +++ b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/mapper/resume_mapper.py @@ -41,6 +41,9 @@ class ResumeMapper: """递归转换对象为可JSON序列化的格式""" if obj is None: return None + # 处理基本类型 + if isinstance(obj, (str, int, float, bool)): + return obj # 处理枚举类型 if hasattr(obj, 'value'): return obj.value @@ -65,7 +68,17 @@ class ResumeMapper: value = getattr(obj, field_name) result[field_name] = self._convert_to_serializable(value) return result - return obj + # 处理一般对象(如SDK返回的Model对象) + if hasattr(obj, '__dict__'): + result = {} + for key, value in obj.__dict__.items(): + # 跳过私有属性和方法 + if key.startswith('_'): + continue + result[key] = self._convert_to_serializable(value) + return result + # 最后尝试转换为字符串 + return str(obj) def _entity_to_model(self, entity: Resume) -> ResumeModel: """将实体转换为模型""" diff --git a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/service/ingestion/unified_ingestion_service.py b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/service/ingestion/unified_ingestion_service.py index cd0e18f..59a1abb 100644 --- a/src/main/python/cn/yinlihupo/ylhp_hr_2_0/service/ingestion/unified_ingestion_service.py +++ b/src/main/python/cn/yinlihupo/ylhp_hr_2_0/service/ingestion/unified_ingestion_service.py @@ -20,14 +20,16 @@ class IngestionResult: errors: list = None is_duplicate: bool = False existing_candidate_id: Optional[str] = None + is_new: bool = True # 是否为新增候选人(False表示更新) @classmethod - def success_result(cls, candidate_id: str, message: str = "") -> "IngestionResult": + def success_result(cls, candidate_id: str, message: str = "", is_new: bool = True) -> "IngestionResult": """创建成功结果""" return cls( success=True, candidate_id=candidate_id, - message=message or "入库成功" + message=message or "入库成功", + is_new=is_new ) @classmethod @@ -50,7 +52,8 @@ class IngestionResult: success=True, # 重复不算失败 is_duplicate=True, existing_candidate_id=existing_id, - message=message or "候选人已存在" + message=message or "候选人已存在", + is_new=False # 重复候选人不算新增 ) diff --git a/src/main/web/cn.yinlihupo/ylhp_hr_2_0_fronted/src/components/Layout.vue b/src/main/web/cn.yinlihupo/ylhp_hr_2_0_fronted/src/components/Layout.vue index 30b8d84..e237f20 100644 --- a/src/main/web/cn.yinlihupo/ylhp_hr_2_0_fronted/src/components/Layout.vue +++ b/src/main/web/cn.yinlihupo/ylhp_hr_2_0_fronted/src/components/Layout.vue @@ -3,35 +3,22 @@ - - - +