Parcourir la source

feat: 企业动态风险等级抽取统一映射

许家凯 il y a 4 ans
Parent
commit
202bc037bd

+ 59 - 1
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/CompanyDynamicHandle.scala

@@ -94,6 +94,64 @@ trait CompanyDynamicHandle {
     , "bankruptcy_open_case" -> "39" // 破产重整
   )
 
+
+  //风险等级映射
+  private val info_risk_level_map = Map(
+    "" -> "4" //企业失信被执情况
+    , "" -> "4" //股东失信被执情况
+    , "" -> "4" //股权冻结
+    , "" -> "4" //司法拍卖
+    , "" -> "4" //清算信息
+    , "" -> "4" //简易注销
+    , "" -> "4" //严重违法
+    , "" -> "3" //裁判文书(被告)
+    , "" -> "3" //裁判文书(被执行人)
+    , "" -> "3" //法院公告(被告/被执行人)
+    , "" -> "3" //开庭公告(被告)
+    , "" -> "3" //减资
+    , "" -> "3" //土地抵押(抵押人)
+    , "" -> "3" //动产抵押(抵押人)
+    , "" -> "3" //土地转让(转让方)
+    , "" -> "3" //股权出质(出质人)
+    , "" -> "3" //欠税公告
+    , "" -> "3" //税收违法
+    , "" -> "3" //行政处罚
+    , "" -> "3" //环保处罚
+    , "company_abnormal_info" -> "3" //经营异常
+    , "" -> "3" //公示催告
+    , "" -> "3" //实际控制人变更
+    , "" -> "3" //大股东变更
+    , "" -> "2" //裁判文书(第三人)
+    , "" -> "2" //法院公告(原告/申请人)
+    , "" -> "2" //开庭公告(原告)
+    , "" -> "2" //工商变更
+    , "" -> "2" //退出对外投资
+    , "" -> "2" //对外投资企业注销/吊销/经营异常
+    , "" -> "2" //分支机构注销/吊销/经营异常
+    , "" -> "2" //新闻舆论(中立、消极)
+    , "" -> "1" //增资
+    , "" -> "1" //裁判文书(原告)
+    , "" -> "1" //裁判文书(申请执行人)
+    , "" -> "1" //对外投资
+    , "" -> "1" //分支机构
+    , "" -> "1" //购地信息
+    , "" -> "1" //地块公示
+    , "" -> "1" //土地转让(受让方)
+    , "" -> "1" //土地抵押(作为抵押权人)
+    , "" -> "1" //股权出质(作为质权人)
+    , "" -> "1" //招投标
+    , "" -> "1" //年报信息
+    , "" -> "1" //资质证书
+    , "" -> "1" //建筑资质
+    , "" -> "1" //商标
+    , "" -> "1" //专利
+    , "" -> "1" //作品著作权
+    , "" -> "1" //软件著作权
+    , "" -> "1" //招聘信息
+    , "" -> "1" //公告研报
+    , "" -> "1" //新闻舆论(积极)
+  )
+
   /**
    *
    * @param rowkey
@@ -189,7 +247,7 @@ trait CompanyDynamicHandle {
    * @param new_map
    * @return
    */
-  protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String
+  protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = info_risk_level_map(getClass.getSimpleName)
 
 }
 

+ 2 - 10
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_abnormal_info.scala

@@ -2,6 +2,7 @@ package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
 import com.winhc.bigdata.spark.implicits.MapHelper._
+
 //经营异常
 case class company_abnormal_info() extends CompanyDynamicHandle {
   /**
@@ -20,15 +21,6 @@ case class company_abnormal_info() extends CompanyDynamicHandle {
    * @param new_map
    * @return
    */
-  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String = null): String = new_map.toJson(Seq("put_department->做出决定机关","remove_department->移出决定机关","put_reason->列入经营异常目录原因","put_date->列入日期","remove_date->移出日期","remove_reason->移出经营异常目录原因"))
-
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String = null): String = new_map.toJson(Seq("put_department->做出决定机关", "remove_department->移出决定机关", "put_reason->列入经营异常目录原因", "put_date->列入日期", "remove_date->移出日期", "remove_reason->移出经营异常目录原因"))
 
-  /**
-   * 风险等级
-   *
-   * @param old_map
-   * @param new_map
-   * @return
-   */
-  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "3"
 }

+ 4 - 5
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_equity_info.scala

@@ -10,7 +10,6 @@ import com.winhc.bigdata.spark.implicits.MapHelper._
  */
 case class company_equity_info() extends CompanyDynamicHandle {
 
-
   /**
    *
    * @param rowkey
@@ -33,12 +32,12 @@ case class company_equity_info() extends CompanyDynamicHandle {
     if ("1".equals(new_map("deleted"))) {
       return Seq.empty
     }
-    var list: Seq[(String, String)] = Seq((new_map("cid"), cname))
+    var list: Seq[(String, String, String)] = Seq((new_map("cid"), cname, "2")) //标的企业
     if ("2".equals(new_map.getOrElse("pledgor_type", "0"))) {
-      list = list :+ (new_map("pledgor_id"), new_map("pledgor"))
+      list = list :+ (new_map("pledgor_id"), new_map("pledgor"), "3") //出质人
     }
     if ("2".equals(new_map.getOrElse("pledgee_type", "0"))) {
-      list = list :+ (new_map("pledgee_id"), new_map("pledgee"))
+      list = list :+ (new_map("pledgee_id"), new_map("pledgee"), "1") //质权人
     }
 
     list.map(t => {
@@ -50,7 +49,7 @@ case class company_equity_info() extends CompanyDynamicHandle {
         , get_change_time(bizDate, new_map)
         , get_biz_id(rowkey)
         , get_sub_info_type()
-        , get_info_risk_level(old_map, new_map)
+        , t._3
         , "被监控企业流动资金紧张,可能存在经营困难的情况。建议立即与被监控企业书面对账,适当催促其履行债务并持续监控。"
       )
     }).seq