|
@@ -0,0 +1,40 @@
|
|
|
+package com.winhc.bigdata.spark.utils
|
|
|
+
|
|
|
+import com.winhc.bigdata.spark.implicits.CaseClass2JsonHelper._
|
|
|
+import com.winhc.bigdata.spark.utils.BaseUtil.cleanup
|
|
|
+import org.apache.commons.lang3.StringUtils
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author: π
|
|
|
+ * @date: 2021/1/11
|
|
|
+ */
|
|
|
+case class company_node(id: String, name: String, deleted: String, topic_type: String)
|
|
|
+
|
|
|
+case class relation_holder(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, percent: Double, deleted: Int, holder_type: Int, topic_type: String)
|
|
|
+
|
|
|
+case class relation_staff(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, staff_type: String, deleted: Int, topic_type: String)
|
|
|
+
|
|
|
+case class relation_legal_entity(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, deleted: Int, legal_entity_type: String, topic_type: String)
|
|
|
+
|
|
|
+
|
|
|
+object CompanyRelationUtils {
|
|
|
+
|
|
|
+ def get_company_node(id: String, name: String, deleted: String, topic_type: String): String =
|
|
|
+ company_node(id, name, deleted, topic_type).toJson()
|
|
|
+
|
|
|
+ def get_relation_holder(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, percent: Double, deleted: Int, holder_type: Int, topic_type: String): String =
|
|
|
+ relation_holder(start_id, start_name, end_id, end_name, percent, deleted, holder_type, topic_type).toJson()
|
|
|
+
|
|
|
+ def get_relation_staff(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, staff_type: String, deleted: Int, topic_type: String): String =
|
|
|
+ relation_staff(start_id, start_name, end_id, end_name, staff_type, deleted, topic_type).toJson()
|
|
|
+
|
|
|
+ def get_relation_legal_entity(start_id: String, start_name: String, end_id: String,
|
|
|
+ end_name: String, deleted: Int, legal_entity_type: String, topic_type: String): String =
|
|
|
+ relation_legal_entity(start_id, start_name, end_id, end_name, deleted, legal_entity_type, topic_type).toJson()
|
|
|
+
|
|
|
+}
|