Ver código fonte

feat: 风险上线

许家凯 3 anos atrás
pai
commit
3eeb61d63d

+ 58 - 0
src/main/scala/com/winhc/bigdata/spark/ng/jobs/args_company_job.scala

@@ -34,6 +34,64 @@ object args_company_job {
         , explode_args("defendant_info", "$.litigant_id", "defendant_info_id_explode")
       )
     )
+    , args_company_job("company_dishonest_info", Seq("case_no", "name")
+      , rowkey_udf = "md5(cleanup(concat_ws('',case_no_trim(case_no),get_fixed_val(keyno,name) )))"
+      , is_super_filter = false
+      , where = "case_no_trim(case_no) is not null and get_fixed_val(keyno,name) is not null"
+    )
+    , args_company_job("company_zxr_restrict", Seq("case_no", "person_name")
+      , rowkey_udf = "md5(cleanup(concat_ws('',case_no_trim(case_no),person_name )))"
+      , is_super_filter = false
+      , verify_company_id = false
+      , where = "case_no_trim(case_no) is not null and person_name is not null and length(trim(person_name))>=2 "
+    )
+
+    , args_company_job("company_equity_info", Seq("reg_number", "pledgee_info", "pledgor_info")
+      , rowkey_udf = "md5(cleanup(concat_ws('',reg_number,equity_info_rowkey(pledgee_info,pledgor_info)  )))"
+      , is_super_filter = false
+
+      , explode_args = Seq(
+        explode_args("pledgor_info", "$.pledgor_id", "pledgor_keyno_explode")
+        , explode_args("pledgee_info", "$.pledgee_id", "pledgee_keyno_explode")
+      )
+
+    )
+    , args_company_job("company_land_mortgage", Seq("land_mark", "land_num", "other_item_num", "use_right_num")
+      , is_super_filter = false
+    )
+    , args_company_job("company_judicial_assistance", Seq("executed_person", "execute_notice_num", "type_state", "company_id")
+      , rowkey_udf = "md5(cleanup(concat_ws('',get_fixed_val(executed_person_id,executed_person),execute_notice_num,type_state,company_id )))"
+      , is_super_filter = false
+    )
+    , args_company_job("company_public_announcement", Seq("bill_num")
+      , rowkey_add_company_id = false
+      ,verify_company_id = false
+    )
+
+    , args_company_job("company_abnormal_info", Seq("company_id", "put_reason", "put_date")
+      , rowkey_udf = "concat_ws('_',company_id,md5(cleanup(concat_ws('',put_reason,split_date(cast(put_date as String)) ))))"
+      , is_super_filter = false
+    )
+    , args_company_job("company_illegal_info", Seq("company_id", "put_reason", "put_date")
+      , rowkey_udf = "concat_ws('_',company_id,md5(cleanup(concat_ws('',put_reason,split_date(cast(put_date as String)) ))))"
+      , is_super_filter = false
+    )
+
+    , args_company_job("zxr_evaluate_results", Seq("case_no", "asset_name", "name", "publish_time")
+      , rowkey_udf = "md5(cleanup(concat_ws('',case_no,asset_name,get_fixed_val(keyno,name),publish_time )))"
+      , is_super_filter = false
+    )
+    , args_company_job("zxr_evaluate", Seq("case_no", "asset_name", "name")
+      , rowkey_udf = "md5(cleanup(concat_ws('',case_no,asset_name,get_fixed_val(keyno,name) )))"
+      , is_super_filter = false
+    )
+
+    , args_company_job("restrictions_on_exit", Seq("case_no", "limited_person", "executed_person_name", "publish_time")
+      ,rowkey_udf = "md5(cleanup(concat_ws('',case_no,limited_person,get_fixed_val(executed_person_keyno,executed_person_name),publish_time )))"
+      , is_super_filter = false
+    )
+
+
   )
 
   def get_args_company_job(tn: String): args_company_job = {

+ 33 - 0
src/main/scala/com/winhc/bigdata/spark/ng/jobs/general_handler.scala

@@ -1,5 +1,6 @@
 package com.winhc.bigdata.spark.ng.jobs
 
+import com.alibaba.fastjson.JSON
 import com.winhc.bigdata.spark.config.EsConfig
 import com.winhc.bigdata.spark.ng.utils.explode_tab
 import com.winhc.bigdata.spark.udf.BaseFunc
@@ -89,6 +90,38 @@ case class general_handler(s: SparkSession,
 
     spark.udf.register("get_fixed_val", get_fixed_val _)
 
+
+    def equity_info_rowkey(pledgee_info: String, pledgor_info: String): String = {
+      try {
+        def get_seq(key: String, value: String): String = {
+          val jSONArray = JSON.parseArray(value)
+          if (jSONArray.isEmpty) {
+            return ""
+          }
+          val arr = mutable.ArrayBuffer[String]()
+          for (i <- 0 until jSONArray.size()) {
+            val jSONObject = jSONArray.getJSONObject(i)
+            val id = jSONObject.getString(key + "_id")
+            if(StringUtils.isNoneEmpty(id) && id.length==32){
+              arr.append(id)
+            }else{
+              arr.append(jSONObject.getString(key))
+            }
+          }
+          arr.distinct.sorted.mkString("、")
+        }
+        val str = get_seq("pledgee", pledgee_info) +" "+ get_seq("pledgor", pledgor_info)
+        str
+      } catch {
+        case ex: Exception => {
+          ""
+        }
+      }
+    }
+
+    spark.udf.register("equity_info_rowkey", equity_info_rowkey _)
+
+
   }
 
   private def get_rowkey_udf(): String = {

+ 40 - 0
src/main/scala/com/winhc/bigdata/spark/ng/utils/export_company_index_2_es.scala

@@ -129,6 +129,46 @@ object export_company_index_2_es {
   val as = Seq(
     export_2_es_args("company_court_open_announcement"
       , "rowkey,defendant_info,plaintiff_info,start_date,case_no,case_reason".split(","))
+
+      , export_2_es_args("company_dishonest_info"
+      , "rowkey,keyno,name,case_no,court,gist_dd,reg_time,performance,pub_date,status,deleted".split(","))
+
+    , export_2_es_args("company_zxr_restrict"
+      , "rowkey,company_id,company_name,pid,person_name,sex,card_num,court_name,case_create_time,case_no,status,deleted".split(","))
+
+    , export_2_es_args("company_equity_info"
+      , "rowkey,related_company_name,related_company_id,reg_number,pledgor_info,equity_amount,pledgee_info,reg_date,state,deleted".split(","))
+
+    , export_2_es_args("company_land_mortgage"
+      , "rowkey,mortgagor_company_id,mortgagee_company_id,mortgagor,mortgagee,use_for,area,evaluate_amount,mortgage_amount,start_date,deleted".split(","))
+
+    , export_2_es_args("company_judicial_assistance"
+      , "rowkey,company_name,company_id,executed_person_id,executed_person,equity_amount,execute_notice_num,executive_court,type_state,deleted".split(","))
+
+    , export_2_es_args("company_public_announcement"
+      , "rowkey,company_id,bill_type,bill_num,bill_amt,apply_name,publish_date,court,deleted".split(","))
+
+    , export_2_es_args("company_abnormal_info"
+      , "rowkey,company_id,company_name,put_reason,put_date,put_department,remove_reason,remove_date,remove_department,deleted".split(","))
+
+    , export_2_es_args("company_illegal_info"
+      , "rowkey,company_id,company_name,put_reason,put_date,put_department,remove_reason,remove_date,remove_department,deleted".split(","))
+
+    , export_2_es_args("zxr_evaluate_results"
+      , "rowkey,keyno,name,court_name,case_no,asset_type,publish_time,reference_price,money,deleted".split(","))
+
+    , export_2_es_args("zxr_evaluate"
+      , "rowkey,keyno,name,court_name,case_no,asset_type,asset_name,deleted".split(","))
+
+    , export_2_es_args("restrictions_on_exit"
+      , "rowkey,limited_person_pid,case_no,limited_person,executed_person_keyno,executed_person_name,executed_address,executed_amount,deleted".split(","))
+
+
+
+
+
+
+
   )