Forráskód Böngészése

fix: 企业动态优化

许家凯 4 éve
szülő
commit
e06a0999f0

+ 1 - 1
src/main/scala/com/winhc/bigdata/spark/jobs/chance/table/company.scala

@@ -13,7 +13,7 @@ import com.winhc.bigdata.spark.jobs.chance.CompanyChangeHandle
 case class company(equCols: Seq[String]) extends CompanyChangeHandle with Serializable {
   override def getCid(rowkey: String, newMap: Map[String, String]): String = rowkey
 
-  override def getLabel(oldMap: Map[String, String], newMap: Map[String, String]): String = "1"
+  override def getLabel(oldMap: Map[String, String], newMap: Map[String, String]): String = null
 
   override def getBizTime(newMap: Map[String, String]): String = newMap("update_time")
 

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

@@ -149,6 +149,7 @@ trait CompanyDynamicHandle {
     , "" -> "2" //对外投资企业注销/吊销/经营异常
     , "" -> "2" //分支机构注销/吊销/经营异常
     , "" -> "2" //新闻舆论(中立、消极)
+    , "company_staff" -> "2" //主要成员
     , "company_holder" -> "2" //股东信息
     , "company_finance" -> "2" //融资
     , "" -> "1" //增资
@@ -206,7 +207,7 @@ trait CompanyDynamicHandle {
       , get_biz_id(rowkey)
       , get_sub_info_type()
       , get_info_risk_level(old_map, new_map)
-      , if (suggestion == null) "被监控企业流动资金紧张,可能存在经营困难的情况。建议立即与被监控企业书面对账,适当催促其履行债务并持续监控。" else suggestion
+      , if (suggestion == null) null else suggestion
     ))
   }
 

+ 1 - 1
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company.scala

@@ -19,7 +19,7 @@ case class company() extends CompanyDynamicHandle {
     , "reg_institute" -> "登记机关"
     , "reg_status" -> "企业状态"
     , "reg_capital" -> "注册资本"
-    , "actual_capital_amount" -> "实收资本"
+//    , "actual_capital_amount" -> "实收资本"
   )
 
 

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

@@ -1,7 +1,6 @@
 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 {
@@ -14,13 +13,13 @@ case class company_abnormal_info() extends CompanyDynamicHandle {
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = new_map.getOrElse("put_reason", null)
 
-  /**
+  /*
    * 变更内容
    *
    * @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 = 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->移出经营异常目录原因"))
 
 }

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

@@ -1,7 +1,6 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 /**
  * @Author: XuJiakai
  * @Date: 2020/8/21 13:44
@@ -15,17 +14,17 @@ case class company_annual_report_out_investment() extends CompanyDynamicHandle {
    * @param new_map
    * @return
    */
-  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = s"新增一家对外投资:${new_map.getOrElse("out_investment_name", "")}"
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = s"新增一家对外投资:${new_map.getOrElse("out_investment_name", "未知")}"
 
-  /**
+  /*
    * 变更内容
    *
    * @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(
+ /* override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(
     Seq("out_investment_cid", "out_investment_name", "reg_number", "credit_code"
     )
-  )
+  )*/
 }

+ 3 - 4
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_dishonest_info.scala

@@ -1,7 +1,6 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 
 /**
  * @Author: XuJiakai
@@ -18,14 +17,14 @@ case class company_dishonest_info() extends CompanyDynamicHandle {
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = s"新增1条企业失信信息:${new_map.getOrElse("court", "")}"
 
-  /**
+  /*
    * 变更内容
    *
    * @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(
+  /*override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
     "name->失信人名称"
     , "age->年龄"
     , "sexy->性别"
@@ -49,5 +48,5 @@ case class company_dishonest_info() extends CompanyDynamicHandle {
     , "pub_date->发布时间"
     , "lawsuit_url"
     , "appro_time->与官网核准的时间"
-  ))
+  ))*/
 }

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

@@ -1,7 +1,6 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 
 /**
  * @Author: XuJiakai
@@ -50,7 +49,7 @@ case class company_equity_info() extends CompanyDynamicHandle {
         , get_biz_id(rowkey)
         , get_sub_info_type()
         , t._3
-        , "被监控企业流动资金紧张,可能存在经营困难的情况。建议立即与被监控企业书面对账,适当催促其履行债务并持续监控。"
+        , null
       )
     }).seq
   }
@@ -64,25 +63,17 @@ case class company_equity_info() extends CompanyDynamicHandle {
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = "新增1条股权出质信息"
 
-  /**
+  /*
    * 变更内容
    *
    * @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 = null): String = {
+  /*override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String = null): String = {
+    import com.winhc.bigdata.spark.implicits.MapHelper._
     val json = new_map.toJson(Seq("equity_amount->出质股权数额", "state->出质状态", "reg_date->股权出质设立登记日期", "reg_number->质权登记编号"))
     json.substring(0, json.length - 1) +
       s""","出质股权标的企业": {"企业名称": "$cname","企业KeyNo": "${new_map("cid")}"},"出质人信息": {"证件号": "${new_map("certif_number_l")}","出质人": "${new_map("pledgor")}"},"质权人信息": {"质权人": "${new_map("pledgee")}","证件号": "${new_map("certif_number_r")}"}}"""
-  }
-
-  /**
-   * 风险等级
-   *
-   * @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 = null
+  }*/
 }

+ 3 - 4
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_finance.scala

@@ -1,7 +1,6 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 
 /**
  * @Author: XuJiakai
@@ -18,18 +17,18 @@ case class company_finance() extends CompanyDynamicHandle {
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = s"获得了${new_map.getOrElse("round", "")}融资,由${new_map.getOrElse("inverstors", "")}投资"
 
-  /**
+  /*
    * 变更内容
    *
    * @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(
+  /*override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
     "company_name->公司名称"
     , "finance_time->融资时间"
     , "money->融资金额"
     , "round->轮次"
     , "inverstors->投资人"
-  ))
+  ))*/
 }

+ 25 - 6
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_holder.scala

@@ -1,12 +1,11 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 
 /**
  * @Author: XuJiakai
  * @Date: 2020/8/19 14:15
- * @Description:
+ * @Description: 股东
  */
 case class company_holder() extends CompanyDynamicHandle {
 
@@ -25,21 +24,41 @@ case class company_holder() extends CompanyDynamicHandle {
    * @param new_map
    * @return
    */
-  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = s"股东及出资信息发生变化"
+  override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
 
-  /**
+    var out = Map(
+      "after" -> new_map("percent")
+      , "holder_id" -> new_map("holder_id")
+      , "holder_type" -> new_map("holder_type")
+    )
+    if (old_map == null) {
+      out = out ++ Map(
+        "type" -> "insert"
+      )
+    } else {
+      out = out ++ Map(
+        "type" -> "update"
+        , "before" -> old_map("percent")
+      )
+    }
+    import com.winhc.bigdata.spark.implicits.MapHelper._
+    val keys = out.keys.toSeq
+    out.toJson(keys)
+  }
+
+  /*
    * 变更内容
    *
    * @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(
+  /*override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
     "holder_id"
     , "holder_type"
     , "amount"
     , "capital"
     , "capital_actual"
     , "percent"
-  ))
+  ))*/
 }

+ 5 - 6
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_illegal_info.scala

@@ -1,7 +1,6 @@
 package com.winhc.bigdata.spark.jobs.dynamic.tables
 
 import com.winhc.bigdata.spark.jobs.dynamic.CompanyDynamicHandle
-import com.winhc.bigdata.spark.implicits.MapHelper._
 
 /**
  * @Author: XuJiakai
@@ -27,22 +26,22 @@ case class company_illegal_info() extends CompanyDynamicHandle {
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
     if (old_map == null)
-      return s"新增严重违法记录:${new_map.getOrElse("put_reason", "")}"
+      return s"新增严重违法记录:${new_map.getOrElse("put_reason", "未知")}"
 
     if (old_map.get("remove_date") == null && new_map("remove_date") != null)
-      return s"移除严重违法记录:${new_map.getOrElse("remove_reason", "")}"
+      return s"移除严重违法记录:${new_map.getOrElse("remove_reason", "未知")}"
 
     null
   }
 
-  /**
+  /*
    * 变更内容
    *
    * @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(
+  /*override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq(
     "put_reason->列入原因"
     , "put_date->列入时间"
     , "remove_date->移除时间"
@@ -50,5 +49,5 @@ case class company_illegal_info() extends CompanyDynamicHandle {
     , "remove_reason->移除原因"
     , "remove_department->移除决定机关"
     , "type->类型"
-  ))
+  ))*/
 }

+ 2 - 9
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_staff.scala

@@ -25,14 +25,7 @@ case class company_staff() extends CompanyDynamicHandle {
    * @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("hid","staff_type->职位"))
+  override protected def get_change_content(old_map: Map[String, String], new_map: Map[String, String], cname: String): String = new_map.toJson(Seq("hid", "staff_type"))
+
 
-  /**
-   * 风险等级
-   *
-   * @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 = "1"
 }