|
@@ -1,5 +1,12 @@
|
|
|
package com.winhc.bigdata.spark.jobs.monitor
|
|
|
|
|
|
+import java.util
|
|
|
+import java.util.Collections
|
|
|
+
|
|
|
+import com.winhc.bigdata.spark.utils.BaseUtil
|
|
|
+import org.apache.http.entity.ContentType
|
|
|
+import org.apache.http.nio.entity.NStringEntity
|
|
|
+import org.apache.http.util.EntityUtils
|
|
|
import org.apache.spark.internal.Logging
|
|
|
|
|
|
/**
|
|
@@ -33,9 +40,12 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
, "company_holder_deleted" -> "1" //股东移除
|
|
|
, "increase_registered_capital_info" -> "2" //增资记录
|
|
|
, "auction_tracking_list" -> "3" //司法拍卖
|
|
|
+ , "zxr_evaluate" -> "3" //有资产选定询价评估机构
|
|
|
+ , "zxr_evaluate_results" -> "3" //有资产完成询价评估
|
|
|
+
|
|
|
)
|
|
|
|
|
|
- //财产流向 0 -> 流入 1 -> 流出
|
|
|
+ //财产流向 0 -> 流入 1 -> 流出 2->流向未知
|
|
|
private val flow_type_map = Map(
|
|
|
"wenshu_detail_combine_v2" -> "0" //新增胜诉案件
|
|
|
, "company_dishonest_info" -> "1" //失信移除
|
|
@@ -55,10 +65,12 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
, "company_patent_list" -> "0" //专利
|
|
|
, "company_copyright_reg_list" -> "0" //软件著作权
|
|
|
, "company_copyright_works_list" -> "0" //作品著作权
|
|
|
- , "company_holder_add" -> "0" //股东新增
|
|
|
+ , "company_holder_add" -> "2" //股东新增
|
|
|
, "company_holder_deleted" -> "1" //股东移除
|
|
|
, "increase_registered_capital_info" -> "0" //增资记录
|
|
|
, "auction_tracking_list" -> "0" //司法拍卖
|
|
|
+ , "zxr_evaluate" -> "0" //有资产选定询价评估机构
|
|
|
+ , "zxr_evaluate_results" -> "0" //有资产完成询价评估
|
|
|
)
|
|
|
|
|
|
|
|
@@ -85,6 +97,8 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
, "wenshu_detail_combine" -> "18" //WENSHU_DETAIL//ES
|
|
|
, "wenshu_detail_combine_v2" -> "18" //WENSHU_DETAIL//ES
|
|
|
, "auction_tracking_list" -> "19" //AUCTION_TRACKING_LIST//HBase
|
|
|
+ , "zxr_evaluate" -> "20" ////zxr_evaluate//HBase
|
|
|
+ , "zxr_evaluate_results" -> "21" ////zxr_evaluate_results//HBase
|
|
|
)
|
|
|
|
|
|
//类别
|
|
@@ -111,6 +125,8 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
, "wenshu_detail_combine_v2" -> "20" //新增胜诉案件
|
|
|
, "company_land_mortgage_v2" -> "21" //接受了他人土地抵押
|
|
|
, "auction_tracking_list" -> "22" //有资产即将被司法拍卖
|
|
|
+ , "zxr_evaluate" -> "23" //有资产选定询价评估机构
|
|
|
+ , "zxr_evaluate_results" -> "24" //有资产完成询价评估
|
|
|
)
|
|
|
|
|
|
/**
|
|
@@ -131,7 +147,7 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
* info_risk_level
|
|
|
* type
|
|
|
*/
|
|
|
- def handle(rowkey: String, bizDate: String, cid: String, change_fields: Seq[String], old_map: Map[String, String], new_map: Map[String, String], cname: String = null): Seq[(String, String, String, String, String, String, String, String, String)] = {
|
|
|
+ def handle(rowkey: String, bizDate: String, cid: String, change_fields: Seq[String], old_map: Map[String, String], new_map: Map[String, String], cname: String = null): Seq[(String, String, String, String, String, String, String, String, String, String)] = {
|
|
|
val rta_desc = get_rta_desc(old_map, new_map)
|
|
|
if (rta_desc == null) {
|
|
|
return Seq.empty
|
|
@@ -146,6 +162,7 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
, get_biz_id(rowkey, new_map)
|
|
|
, get_info_risk_level(old_map, new_map)
|
|
|
, get_type()
|
|
|
+ , getMoney(new_map)
|
|
|
))
|
|
|
} catch {
|
|
|
case e: Exception => {
|
|
@@ -235,4 +252,31 @@ trait CompanyMonitorHandle extends Logging {
|
|
|
def get_conditional_filter(): String = ""
|
|
|
|
|
|
|
|
|
+ protected def getMoney(new_map: Map[String, String]) : String = "0"
|
|
|
+
|
|
|
+ protected def processMoney(amt : String) :String ={
|
|
|
+ var amtstr = amt
|
|
|
+ if (amtstr == null ){
|
|
|
+ "0"
|
|
|
+ }else{
|
|
|
+ amtstr = amtstr.replaceAll("[^\\d.]", "")
|
|
|
+
|
|
|
+ if(amtstr.equals("") || amtstr.split("\\.").size > 2 || amtstr.startsWith(".") || amtstr.endsWith(".") ){
|
|
|
+ amtstr = "0.0"
|
|
|
+ }
|
|
|
+ try{
|
|
|
+ var x = amtstr.toDouble
|
|
|
+ }catch {
|
|
|
+ case ex : Exception =>{
|
|
|
+ amtstr = "0"
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ amtstr
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|