Pārlūkot izejas kodu

fix: 企业动态优化

许家凯 4 gadi atpakaļ
vecāks
revīzija
8438773f60

+ 6 - 6
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/CompanyDynamic.scala

@@ -143,7 +143,7 @@ object CompanyDynamic {
           None
         }
         else {
-          result.map(res => Row(CompanyDynamicHandleUtils.getDynamicId(cid, res._4, res._7, res._6), res._1, res._2, res._3, res._4, res._5, res._6, res._7, res._8, res._9, res._10, DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")))
+          result.map(res => Row(CompanyDynamicHandleUtils.getDynamicId(res._1, res._4, res._7, res._6), res._1, res._2, res._3, res._4, res._5, res._6, res._7, res._8, res._9, res._10, DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")))
         }
       })
 
@@ -177,14 +177,14 @@ object CompanyDynamic {
   }
 
   private val startArgs = Seq(
-    Args(tableName = "company_abnormal_info", bName = 0)
+    Args(tableName = "company_abnormal_info", bName = 1)
     , Args(tableName = "company_equity_info")
-    , Args(tableName = "company_staff", bName = 0)
+    , Args(tableName = "company_staff", bName = 1)
     , Args(tableName = "company", bName = 0)
     , Args(tableName = "bankruptcy_open_case", bName = 1)
-    , Args(tableName = "company_illegal_info", bName = 0)
+    , Args(tableName = "company_illegal_info", bName = 1)
     , Args(tableName = "company_land_publicity", bName = 1)
-    , Args(tableName = "company_employment", bName = 1)
+//    , Args(tableName = "company_employment", bName = 1)
     , Args(tableName = "company_land_announcement", bName = 1)
     , Args(tableName = "company_bid_list", bName = 2)
     , Args(tableName = "company_land_transfer", bName = 1)
@@ -215,7 +215,7 @@ object CompanyDynamic {
     , Args(tableName = "company_judicial_sale_combine_list", bName = 1) //司法拍卖
     , Args(tableName = "company_tax_contravention", bName = 1) //税收违法
     , Args(tableName = "wenshu_detail_combine", bName = 1) //裁判文书
-    , Args(tableName = "company_holder", bName = 1) //裁判文书
+    , Args(tableName = "company_holder", bName = 1) //股东
     , Args(tableName = "company_annual_report_out_investment", bName = 1) //裁判文书
     , Args(tableName = "company_own_tax", bName = 1) //欠税公告
   )

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

@@ -82,7 +82,7 @@ case class company() extends CompanyDynamicHandle {
         , new_map("name")
         , super.get_info_type()
         , s"${change_type_map(e)}发生变更"
-        , s"""{"变更后内容": ${new_map(e).getOrNull()},"变更事项": ${change_type_map(e).getOrNull()},"变更日期": "$bizDate","变更前内容": ${old_map(e).getOrNull()}}"""
+        , s"""{"content_after": ${new_map(e).getOrNull()},"change_item": ${change_type_map(e).getOrNull()},"change_time": "$bizDate","content_before": ${old_map(e).getOrNull()}}"""
         , bizDate
         , rowkey
         , super.get_sub_info_type()

+ 18 - 17
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_equity_info.scala

@@ -31,27 +31,28 @@ case class company_equity_info() extends CompanyDynamicHandle {
     if ("1".equals(new_map("deleted"))) {
       return Seq.empty
     }
-    var list: Seq[(String, String, String)] = Seq((new_map("cid"), cname, "2")) //标的企业
+
+    var map = Map(new_map("cid") -> (cname, "2")) //标的企业
     if ("2".equals(new_map.getOrElse("pledgor_type", "0"))) {
-      list = list :+ (new_map("pledgor_id"), new_map("pledgor"), "3") //出质人
+      map = map ++ Map(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"), "1") //质权人
+      map = map ++ Map(new_map("pledgee_id") -> (new_map("pledgee"), "1")) //质权人
     }
-
-    list.map(t => {
-      (t._1
-        , t._2
-        , get_info_type()
-        , get_rta_desc(old_map, new_map)
-        , get_change_content(old_map, new_map, cname)
-        , get_change_time(bizDate, new_map)
-        , get_biz_id(rowkey)
-        , get_sub_info_type()
-        , t._3
-        , null
-      )
-    }).seq
+    map.map(e => (e._1, e._2._1, e._2._2)).toSeq
+      .map(t => {
+        (t._1
+          , t._2
+          , get_info_type()
+          , get_rta_desc(old_map, new_map)
+          , get_change_content(old_map, new_map, cname)
+          , get_change_time(bizDate, new_map)
+          , get_biz_id(rowkey)
+          , get_sub_info_type()
+          , t._3
+          , null
+        )
+      }).seq
   }
 
   /**

+ 14 - 16
src/main/scala/com/winhc/bigdata/spark/jobs/dynamic/tables/company_holder.scala

@@ -25,7 +25,21 @@ case class company_holder() extends CompanyDynamicHandle {
    * @return
    */
   override protected def get_rta_desc(old_map: Map[String, String], new_map: Map[String, String]): String = {
+    if (old_map == null) {
+      "insert"
+    } else {
+      "update"
+    }
+  }
 
+  /*
+   * 变更内容
+   *
+   * @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 = {
     var out = Map(
       "after" -> new_map("percent")
       , "holder_id" -> new_map("holder_id")
@@ -45,20 +59,4 @@ case class company_holder() extends CompanyDynamicHandle {
     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(
-    "holder_id"
-    , "holder_type"
-    , "amount"
-    , "capital"
-    , "capital_actual"
-    , "percent"
-  ))*/
 }