Browse Source

fix: 调整动态

许家凯 3 years ago
parent
commit
87b3ee2f81

+ 1 - 1
src/main/scala/com/winhc/bigdata/spark/ng/change/NgChangeExtractAll.scala

@@ -111,7 +111,7 @@ object NgChangeExtractAll {
   def main(args: Array[String]): Unit = {
     val Array(tableName) = args
     if (args.size != 1) {
-      println("please set tableName ds.")
+      println("please set tableName.")
       sys.exit(-1)
     }
     println(s"table : $tableName")

+ 53 - 3
src/main/scala/com/winhc/bigdata/spark/ng/change/NgChangeExtractArgs.scala

@@ -16,11 +16,61 @@ object NgChangeExtractArgs {
   val startArgs: Seq[NgChangeExtractArgs] =
     Seq(
       NgChangeExtractArgs(tableName = "company_holder", primaryFields = "holder_id,percent,amount,deleted", newlyRegister = true)
-      , NgChangeExtractArgs(tableName = "company_staff", primaryFields = "staff_type,deleted", newlyRegister = true)
+      , NgChangeExtractArgs(tableName = "company_staff", primaryFields = "staff_type,hid,deleted", newlyRegister = true)
       , NgChangeExtractArgs(tableName = "company", primaryKey = "company_id", primaryFields = "name,cate_third_code,county_code,reg_capital_amount,legal_entity_name,legal_entity_id,reg_capital,reg_location,business_scope,reg_status_std")
       , NgChangeExtractArgs(tableName = "company_tm", primaryFields = "status")
       , NgChangeExtractArgs(tableName = "company_icp", primaryFields = "domain")
-    ) ++ Seq(
+
+
+      ,NgChangeExtractArgs(tableName = "auction_tracking")    //司法拍卖
+      ,NgChangeExtractArgs(tableName = "bankruptcy_open_case")    //破产信息
+      ,NgChangeExtractArgs(tableName = "company_abnormal_info")    //经营异常
+      ,NgChangeExtractArgs(tableName = "company_brief_cancel_announcement")    //简易注销
+      ,NgChangeExtractArgs(tableName = "company_certificate")    //资质证书
+      ,NgChangeExtractArgs(tableName = "company_check_info")    //抽查检查
+      ,NgChangeExtractArgs(tableName = "company_copyright_reg")    //知识产权-软件著作权
+      ,NgChangeExtractArgs(tableName = "company_copyright_works")    //知识产权-作品著作权
+      ,NgChangeExtractArgs(tableName = "company_court_announcement",primaryFields = "plaintiff_info,litigant_info")    //法院公告
+      ,NgChangeExtractArgs(tableName = "company_court_open_announcement",primaryFields = "defendant_info,plaintiff_info")    //开庭公告
+      ,NgChangeExtractArgs(tableName = "company_court_register",primaryFields = "plaintiff_info,defendant_info")    //立案信息
+      ,NgChangeExtractArgs(tableName = "company_dishonest_info",primaryFields = "keyno")    //失信
+      ,NgChangeExtractArgs(tableName = "company_double_random_check_info")    //双随机抽查
+      ,NgChangeExtractArgs(tableName = "company_env_punishment")    //环保处罚
+      ,NgChangeExtractArgs(tableName = "company_equity_info",primaryFields = "pledgor_info,pledgee_info")    //股权出质
+      ,NgChangeExtractArgs(tableName = "company_equity_pledge_holder",primaryFields = "holder_id")    //股权质押
+      ,NgChangeExtractArgs(tableName = "company_finance")    //融资信息
+      ,NgChangeExtractArgs(tableName = "company_illegal_info")    //严重违法
+      ,NgChangeExtractArgs(tableName = "company_judicial_assistance",primaryFields = "executed_person_id")    //司法协助(股权冻结)
+      ,NgChangeExtractArgs(tableName = "company_land_announcement")    //购地信息
+      ,NgChangeExtractArgs(tableName = "company_land_mortgage")    //土地抵押
+      ,NgChangeExtractArgs(tableName = "company_land_publicity")    //地块公示
+      ,NgChangeExtractArgs(tableName = "company_land_transfer",primaryFields = "now_keyno,pre_keyno")    //土地转让
+
+//      ,NgChangeExtractArgs(tableName = "company_lawsuit",primaryFields = "defendant_info,plaintiff_info")    //裁判文书
+      ,NgChangeExtractArgs(tableName = "wenshu_detail_v2",primaryFields = "defendant_info,plaintiff_info")    //裁判文书
+
+      ,NgChangeExtractArgs(tableName = "company_license")    //行政许可
+      ,NgChangeExtractArgs(tableName = "company_license_creditchina")    //行政许可
+      ,NgChangeExtractArgs(tableName = "company_license_entpub")    //行政许可
+      ,NgChangeExtractArgs(tableName = "company_mortgage_info")    //动产抵押-主表
+      ,NgChangeExtractArgs(tableName = "company_mortgage_people")    //动产抵押-人
+      ,NgChangeExtractArgs(tableName = "company_own_tax")    //欠税公告
+      ,NgChangeExtractArgs(tableName = "company_patent")    //专利信息
+      ,NgChangeExtractArgs(tableName = "company_public_announcement")    //公示催告
+      ,NgChangeExtractArgs(tableName = "company_punishment_info")    //行政处罚
+      ,NgChangeExtractArgs(tableName = "company_punishment_info_creditchina")    //行政处罚-信用中国
+      ,NgChangeExtractArgs(tableName = "company_send_announcement",primaryFields = "plaintiff_info,plaintiff_info")    //送达公告
+      ,NgChangeExtractArgs(tableName = "company_tax_contravention")    //税收违法
+      ,NgChangeExtractArgs(tableName = "company_zxr",primaryFields = "keyno")    //被执行人
+      ,NgChangeExtractArgs(tableName = "company_zxr_final_case",primaryFields = "keyno")    //终本案件
+      ,NgChangeExtractArgs(tableName = "company_zxr_restrict",primaryFields = "pid")    //限高
+      ,NgChangeExtractArgs(tableName = "restrictions_on_exit",primaryFields = "executed_person_keyno,limited_person_pid")    //限制出镜
+      ,NgChangeExtractArgs(tableName = "zxr_evaluate_results",primaryFields = "keyno")    //询价评估结果
+    )
+
+
+/*
+  ++ Seq(
       "auction_tracking"
       , "company_abnormal_info"
       , "company_court_announcement"
@@ -74,5 +124,5 @@ object NgChangeExtractArgs {
       , "company_copyright_works"
       , "company_certificate"
 
-    ).map(r => NgChangeExtractArgs(tableName = r))
+    ).map(r => NgChangeExtractArgs(tableName = r))*/
 }

+ 12 - 12
src/main/scala/com/winhc/bigdata/spark/ng/change/table/company_lawsuit.scala

@@ -1,12 +1,12 @@
-
-
-package com.winhc.bigdata.spark.ng.change.table
-
-import com.winhc.bigdata.spark.ng.change.NgCompanyChangeHandle
-import com.winhc.bigdata.spark.utils.DateUtils
-
-case class company_lawsuit(equCols: Seq[String], is_inc:Boolean) extends NgCompanyChangeHandle {
-
-  override protected def getBizDate(newMap: Map[String, String]): String = DateUtils.getBizDate(newMap("pub_date"),newMap("judge_date"))
-}
-
+//
+//
+//package com.winhc.bigdata.spark.ng.change.table
+//
+//import com.winhc.bigdata.spark.ng.change.NgCompanyChangeHandle
+//import com.winhc.bigdata.spark.utils.DateUtils
+//
+//case class company_lawsuit(equCols: Seq[String], is_inc:Boolean) extends NgCompanyChangeHandle {
+//
+//  override protected def getBizDate(newMap: Map[String, String]): String = DateUtils.getBizDate(newMap("pub_date"),newMap("judge_date"))
+//}
+//

+ 12 - 0
src/main/scala/com/winhc/bigdata/spark/ng/change/table/wenshu_detail_v2.scala

@@ -0,0 +1,12 @@
+
+
+package com.winhc.bigdata.spark.ng.change.table
+
+import com.winhc.bigdata.spark.ng.change.NgCompanyChangeHandle
+import com.winhc.bigdata.spark.utils.DateUtils
+
+case class wenshu_detail_v2(equCols: Seq[String], is_inc:Boolean) extends NgCompanyChangeHandle {
+
+  override protected def getBizDate(newMap: Map[String, String]): String = DateUtils.getBizDate(newMap("publish_date"),newMap("judge_date"))
+}
+

+ 4 - 5
src/main/scala/com/winhc/bigdata/spark/ng/dynamic/handle/company_court_announcement.scala

@@ -2,9 +2,8 @@
 
 package com.winhc.bigdata.spark.ng.dynamic.handle
 import com.winhc.bigdata.spark.implicits.MapHelper._
-import com.winhc.bigdata.spark.ng.dynamic.{AssociationEntityInfo, NgCompanyRiskLevelType}
 import com.winhc.bigdata.spark.ng.dynamic.utils.{ComplexDailyDynamic, DailyAggHandle}
-import com.winhc.bigdata.spark.ng.dynamic.utils.DynamicFiledUtils.createDynamicInfo
+import com.winhc.bigdata.spark.ng.dynamic.{AssociationEntityInfo, NgCompanyRiskLevelType}
 
 import scala.collection.mutable
 
@@ -19,10 +18,10 @@ case class company_court_announcement(is_inc:Boolean) extends DailyAggHandle wit
     try {
       var list: mutable.Seq[AssociationEntityInfo] = mutable.Seq.empty
       val defendant_info = new_data.getOrEmptyStr("litigant_info")
-      list = list ++ getEntity(defendant_info, "litigant_id", "name", NgCompanyRiskLevelType.Caution, "做为被告/被上诉人")
+      list = list ++ getEntity(defendant_info, "litigant_id", "name", NgCompanyRiskLevelType.Caution, "当事人")
 
-      val plaintiff_info = new_data.getOrEmptyStr("plaintiff_info")
-      list = list ++ getEntity(plaintiff_info, "litigant_id", "name", NgCompanyRiskLevelType.Prompt, "做为原告/上诉人")
+//      val plaintiff_info = new_data.getOrEmptyStr("plaintiff_info")
+//      list = list ++ getEntity(plaintiff_info, "litigant_id", "name", NgCompanyRiskLevelType.Prompt, "做为原告/上诉人")
       list
     } catch {
       case e: Exception => {

+ 22 - 22
src/main/scala/com/winhc/bigdata/spark/ng/dynamic/handle/company_lawsuit.scala

@@ -1,22 +1,22 @@
-
-
-package com.winhc.bigdata.spark.ng.dynamic.handle
-
-import com.winhc.bigdata.spark.implicits.MapHelper._
-import com.winhc.bigdata.spark.ng.dynamic.utils.{ComplexDailyDynamic, DailyAggHandle}
-import com.winhc.bigdata.spark.ng.dynamic.{AssociationEntityInfo, NgCompanyRiskLevelType}
-
-/**
- * @author: XuJiakai
- * @date: 2021/7/13 15:07
- *        裁判文书
- */
-case class company_lawsuit(is_inc:Boolean) extends DailyAggHandle with ComplexDailyDynamic {
-
-
-  override def getAssociationEntityInfo(new_data: Map[String, String]): Seq[AssociationEntityInfo] = {
-    getEntity(new_data.getOrEmptyStr("plaintiff_info"),"litigant_id","name",NgCompanyRiskLevelType.Positive,"原告/上诉人")++
-      getEntity(new_data.getOrEmptyStr("defendant_info"),"litigant_id","name",NgCompanyRiskLevelType.Caution,"被告/被上诉人")
-  }
-}
-
+//
+//
+//package com.winhc.bigdata.spark.ng.dynamic.handle
+//
+//import com.winhc.bigdata.spark.implicits.MapHelper._
+//import com.winhc.bigdata.spark.ng.dynamic.utils.{ComplexDailyDynamic, DailyAggHandle}
+//import com.winhc.bigdata.spark.ng.dynamic.{AssociationEntityInfo, NgCompanyRiskLevelType}
+//
+///**
+// * @author: XuJiakai
+// * @date: 2021/7/13 15:07
+// *        裁判文书
+// */
+//case class company_lawsuit(is_inc:Boolean) extends DailyAggHandle with ComplexDailyDynamic {
+//
+//
+//  override def getAssociationEntityInfo(new_data: Map[String, String]): Seq[AssociationEntityInfo] = {
+//    getEntity(new_data.getOrEmptyStr("plaintiff_info"),"litigant_id","name",NgCompanyRiskLevelType.Positive,"原告/上诉人")++
+//      getEntity(new_data.getOrEmptyStr("defendant_info"),"litigant_id","name",NgCompanyRiskLevelType.Caution,"被告/被上诉人")
+//  }
+//}
+//

+ 22 - 0
src/main/scala/com/winhc/bigdata/spark/ng/dynamic/handle/wenshu_detail_v2.scala

@@ -0,0 +1,22 @@
+
+
+package com.winhc.bigdata.spark.ng.dynamic.handle
+
+import com.winhc.bigdata.spark.implicits.MapHelper._
+import com.winhc.bigdata.spark.ng.dynamic.utils.{ComplexDailyDynamic, DailyAggHandle}
+import com.winhc.bigdata.spark.ng.dynamic.{AssociationEntityInfo, NgCompanyRiskLevelType}
+
+/**
+ * @author: XuJiakai
+ * @date: 2021/7/13 15:07
+ *        裁判文书
+ */
+case class wenshu_detail_v2(is_inc:Boolean) extends DailyAggHandle with ComplexDailyDynamic {
+
+
+  override def getAssociationEntityInfo(new_data: Map[String, String]): Seq[AssociationEntityInfo] = {
+    getEntity(new_data.getOrEmptyStr("plaintiff_info"),"litigant_id","name",NgCompanyRiskLevelType.Positive,"原告/上诉人")++
+      getEntity(new_data.getOrEmptyStr("defendant_info"),"litigant_id","name",NgCompanyRiskLevelType.Caution,"被告/被上诉人")
+  }
+}
+

+ 13 - 0
src/main/scala/com/winhc/bigdata/spark/ng/dynamic/utils/DynamicDimConfiguration.scala

@@ -526,6 +526,19 @@ object DynamicDimConfiguration {
         , "pub_date" -> Map()
       )
     )
+    , "wenshu_detail_v2" -> Map(
+      "code" -> Map(
+        "insert" -> "304401"
+      ),
+      "sample" -> true,
+      "name" -> "裁判文书",
+      "list_field" -> Map(
+        "case_reason" -> Map()
+        , "case_no" -> Map()
+        , "pub_date" -> Map()
+      )
+    )
+
 
 
   )

+ 6 - 2
src/main/scala/com/winhc/bigdata/spark/udf/CompanyIndexFunc.scala

@@ -17,7 +17,11 @@ trait CompanyIndexFunc extends LoggingUtils {
   def company_org_type_udf(): Unit = {
     val pattern = Pattern.compile("[^\\u4e00-\\u9fa5()()]")
 
-    def get_company_org_type_std(company_name: String, company_org_type2: String): String = {
+    def get_company_org_type_std(company_name: String, company_org_type2: String, credit_code: String): String = {
+      if (credit_code != null && credit_code.startsWith("93")) {
+        return "集体所有制"
+      }
+
       if (company_name.contains("有限责任公司")) "有限责任公司"
       else if (company_name.contains("股份")) "股份有限公司"
       else if (company_name.contains("有限公司")) "有限责任公司"
@@ -29,7 +33,7 @@ trait CompanyIndexFunc extends LoggingUtils {
         else if (company_org_type.contains("股份")) "股份有限公司"
         else if (company_org_type.contains("个人独资企业")) "独资企业"
         else if (company_org_type.contains("个人经营") || company_org_type.contains("个体")) "个体工商户"
-        else if (company_org_type.contains("专业合作") || company_org_type.contains("集体")) "集体所有制"
+        else if (company_org_type.contains("专业合作") || company_org_type.contains("合作社") || company_org_type.contains("集体")) "集体所有制"
         else if (company_org_type.contains("有限") && company_org_type.contains("合伙")) "有限合伙"
         else if (company_org_type.contains("合伙")) "普通合伙"
         else if (company_org_type.contains("国有") || company_org_type.contains("全民所有制") || company_org_type.contains("国资")) "国企"