Browse Source

动态添加

xufei 4 years ago
parent
commit
27b1552fa2

+ 16 - 12
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/CompanyDynamicHandle.scala

@@ -23,7 +23,7 @@ trait CompanyDynamicHandle {
     , "company_abnormal_info" -> "eci_exception" //经营异常
     , "" -> "eci_zscq" //知识产权
     , "" -> "eci_wenshu" //裁判文书
-    , "" -> "court_announcement" //法院公告
+    , "company_court_announcement_list" -> "court_announcement" //法院公告
     , "" -> "" //对外投资
     , "company_punishment_info" -> "punishment_info" //行政处罚
     , "company_punishment_info_creditchina" -> "punishment_info_creditchina" //行政处罚-信用中国
@@ -34,18 +34,21 @@ trait CompanyDynamicHandle {
     , "" -> "serious_violation" //严重违法
     , "" -> "simple_cancellation" //简易注销
     , "company_equity_info" -> "stock_pledge" //股权出质
-    , "" -> "tax_illegal" //税收违法
-    , "" -> "tax_owenotice" //欠税公告
-    , "" -> "judicial" //司法拍卖
+    , "company_tax_contravention" -> "tax_illegal" //税收违法
+    , "company_own_tax" -> "tax_owenotice" //欠税公告
+    , "company_judicial_sale_combine_list" -> "judicial" //司法拍卖
     , "" -> "recruit" //招聘信息
     , "" -> "liquidation_information" //清算信息
     , "" -> "investor_equity_change" //大股东变更
     , "" -> "actual_controller_change" //实际控制人变更
-    , "" -> "court_notice" //开庭公告
+    , "company_court_open_announcement_list" -> "court_notice" //开庭公告
     , "bankruptcy_open_case" -> "bankruptcy_open_case" //破产重整
     , "company_stock_announcement" -> "company_stock_announcement" //企业公告
 
     , "company_staff" -> "company_staff" //主要成员
+    , "company_check_info" -> "spot_check" //抽查检查
+    , "company_double_random_check_info" -> "company_double_random_check_info" //双随机抽查
+    , "company_court_register" -> "company_court_register" //立案信息
   )
 
   private val table_2_info_type = Map(
@@ -56,10 +59,10 @@ trait CompanyDynamicHandle {
     , "company_abnormal_info" -> "4" // 经营异常
     , "" -> "5" // 知识产权
     , "" -> "6" // 裁判文书
-    , "" -> "7" // 法院公告
+    , "company_court_announcement_list" -> "7" // 法院公告
     , "" -> "8" // 对外投资
     , "company_mortgage_info" -> "9" // 动产抵押
-    , "" -> "10" // 司法拍卖
+    , "company_judicial_sale_combine_list" -> "10" // 司法拍卖
     , "company_land_publicity" -> "11-1" // 土地信息-地块公示
     , "company_land_announcement" -> "11-2" // 土地信息-购地信息
     , "company_land_transfer" -> "11-3" // 土地信息-土地转让
@@ -73,26 +76,27 @@ trait CompanyDynamicHandle {
     , "company_equity_info" -> "17" // 股权出质
     , "" -> "18" // 严重违法
     , "" -> "19" // 简易注销
-    , "" -> "20" // 欠税公告
-    , "" -> "21" // 税收违法
+    , "company_own_tax" -> "20" // 欠税公告
+    , "company_tax_contravention" -> "21" // 税收违法
     , "" -> "22" // 股权冻结
     , "" -> "23" // 清算信息
     , "" -> "24" // 大股东变更
     , "" -> "25" // 实际控制人变更
-    , "" -> "26" // 开庭公告
+    , "company_court_open_announcement_list" -> "26" // 开庭公告
     , "" -> "27" // 新闻信息
     , "" -> "28" // 股东信息
     , "" -> "29" // 最终受益人
     , "company_staff" -> "30" // 主要成员
     , "" -> "31" // 融资动态
     , "company_stock_announcement" -> "32" // 企业公告
-    , "" -> "33" // 抽查检查
+    , "company_check_info" -> "33" // 抽查检查
     , "" -> "34" // 行政许可
-    , "" -> "35" // 双随机抽查
+    , "company_double_random_check_info" -> "35" // 双随机抽查
     , "" -> "36" // 限制高消费
     , "" -> "37" // 被执行人
     , "" -> "38" // 送达报告
     , "bankruptcy_open_case" -> "39" // 破产重整
+    , "company_court_register" -> "40" // 立案信息
   )
 
 

+ 45 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_check_info.scala

@@ -0,0 +1,45 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 抽查检查
+ */
+case class company_check_info() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+    s"""
+       |日期:${new_map("check_date")}\n
+       |结果:${new_map("check_result")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = ""
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 61 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_court_announcement_list.scala

@@ -0,0 +1,61 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 法院公告
+ */
+case class company_court_announcement_list() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+    s"""
+       |案号:${new_map("case_no")}万元\n
+       |上诉人:${new_map("plaintiff")}\n
+       |被上诉人:${new_map("litigant")}\n
+       |刊登日期:${new_map("publish_date")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
+    "announcement_type_code->公告类型"
+    , "plaintiff->原告"
+    , "bltn_no->公告号"
+    , "court_name->法院名"
+    , "deal_grade->处理等级名称"
+    , "litigant->当事人"
+    , "judge->法官"
+    , "province->省份"
+    , "judge_phone->法官电话"
+    , "case_no->案件号"
+    , "content->案件内容"
+    , "publish_page->刊登版面"
+    , "publish_date->刊登日期"
+  ))
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 58 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_court_open_announcement_list.scala

@@ -0,0 +1,58 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 开庭公告
+ */
+case class company_court_open_announcement_list() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+
+    s"""
+       |开庭时间:${new_map("start_date")}\n
+       |案号:${new_map("case_no")}\n
+       |案由:${new_map("case_reason")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
+    "case_reason->案由"
+    ,"case_no->案号"
+    ,"start_date->开庭时间"
+    ,"area->地区"
+    ,"plan_date->排期日期"
+    ,"judge->审判长/主审人"
+    ,"litigant->当事人"
+    ,"court->法院"
+    ,"court_room->法庭"
+    ,"content->公告内容"
+  ))
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 61 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_court_register_list.scala

@@ -0,0 +1,61 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 立案信息
+ */
+case class company_court_register_list() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+
+    s"""
+       |立案日期:${new_map("filing_date")}\n
+       |上诉人:${new_map("plaintiff")}\n
+       |被上诉人:${new_map("defendant")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
+    "case_reason->案由"
+    ,"case_no->案号"
+    ,"filing_date->立案日期"
+    ,"start_time->开庭时间"
+    ,"department->承办部门"
+    ,"court->法院"
+    ,"judge->承办法官"
+    ,"assistant->法官助理"
+    ,"case_type->案件类型"
+    ,"case_status->案件状态"
+    ,"plaintiff->上诉人"
+    ,"defendant->被上诉人"
+    ,"third->第三人"
+  ))
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 46 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_double_random_check_info.scala

@@ -0,0 +1,46 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 双随机抽查
+ */
+case class company_double_random_check_info() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+    s"""
+       |任务编号:${new_map("check_task_num")}\n
+       |任务名称:${new_map("check_task_name")}\n
+       |抽查机关:${new_map("check_department")}\n
+       |完成日期:${new_map("check_date")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = ""
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 49 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_judicial_sale_combine_list.scala

@@ -0,0 +1,49 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 司法拍卖
+ */
+case class company_judicial_sale_combine_list() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+
+    s"""
+       |标题:${new_map("title")}\n
+       |起拍价:${new_map("initial_price")}\n
+       |拍卖时间:${new_map("start_time")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
+    "source_id->address"
+  ))
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "提示信息"
+}

+ 75 - 0
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_tax_contravention.scala

@@ -0,0 +1,75 @@
+package com.winhc.bigdata.spark.jobs.dynamic.tables
+
+import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import org.apache.commons.lang3.StringUtils
+
+/**
+ * @Author: π
+ * @Date: 2020/8/11 17:39
+ * @Description: 税收违法
+ */
+case class company_tax_contravention() extends CompanyDynamicHandle {
+
+
+  /**
+   * 来源表的变更类型,insert or update
+   *
+   * @return
+   */
+  override def org_type(): Seq[String] = Seq("insert")
+
+  /**
+   * 信息描述
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+    s"""
+       |案件性质:${new_map("case_type")}\n
+       |发布日期:${new_map("publish_time")}
+       |""".stripMargin
+  }
+
+  /**
+   * 变更内容
+   *
+   * @param old_map
+   * @param new_map
+   * @return
+   */
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = {
+      new_map.toJson(Seq(
+        "taxpayer_name->纳税人名称"
+        , "taxpayer_number->纳税人识别号"
+        , "taxpayer_code->组织机构代码"
+        , "address->注册地址"
+        , "publish_time->发布日期"
+        , "case_type->案件性质"
+        , "department->所属税务机关"
+        , "case_info->主要违法事实"
+        , "legal_person_info->法定代表人或负责人"
+//        , s"${splitInfo(new_map("legal_person_info"))._2}->性别"
+//        , s"${splitInfo(new_map("legal_person_info"))._3}->证件名称"
+//        , s"${splitInfo(new_map("legal_person_info"))._4}->证件号码"
+        , "responsible_person_info->负有责任的财务负责人"
+//        , s"${splitInfo(new_map("legal_person_info"))._2}->性别"
+//        , s"${splitInfo(new_map("legal_person_info"))._3}->证件名称"
+//        , s"${splitInfo(new_map("legal_person_info"))._4}->证件号码"
+        , "responsible_department_info->负有直接责任的中介机构"
+      ))
+  }
+
+  def splitInfo(s: String) = {
+    if (StringUtils.isNotBlank(s) && s.replaceAll(":", ",").split(",").size == 4) {
+      val Array(name, sex, card, number) = s.replaceAll(":", ",").split(",")
+      (name, sex, card, number)
+    } else {
+      ("", "", "", "")
+    }
+  }
+
+  override protected def get_info_risk_level(old_map: Map[String, String], new_map: Map[String, String]): String = "警示信息"
+}