|
@@ -41,8 +41,8 @@ object WenshuJson {
|
|
|
var res: Map[String, String] = cols.map(c => {
|
|
|
(c, r.getAs[String](c))
|
|
|
}).toMap
|
|
|
- res += ("tag" ->"终结本次执行")
|
|
|
- res
|
|
|
+ var newmap = Map("tag" ->"终结本次执行") ++ res
|
|
|
+ newmap
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -97,8 +97,9 @@ case class CompanyWenshu(s: SparkSession, project: String, //表所在工程名
|
|
|
| ,bg_name
|
|
|
| ,case_reason
|
|
|
| ,case_stage
|
|
|
- | ,case_amt
|
|
|
+ | ,concat(case_amt, '万元') as case_amt
|
|
|
| ,case_no
|
|
|
+ | ,date_format(judge_date, 'yyyy-MM-dd') as judge_date
|
|
|
| ,title
|
|
|
| ,ROW_NUMBER() OVER(PARTITION BY cname,bg_name,case_no,court_name,judge_date ORDER BY judge_date) RN
|
|
|
| ,court_name
|
|
@@ -129,8 +130,8 @@ case class CompanyWenshu(s: SparkSession, project: String, //表所在工程名
|
|
|
s"""
|
|
|
|insert ${if (isWindows) "INTO" else "OVERWRITE"} table $ads_case_chance partition (ds=$adsListDs)
|
|
|
|select
|
|
|
- |rowkey,title,cname,cid,label,business_id,business_type,business_type_name,dynamic_content,
|
|
|
- |biz_date,create_time, province_code, city_code, county_code
|
|
|
+ |rowkey,title,yg_name, bg_name, cname,cid,label,business_id,business_type,business_type_name,dynamic_content,
|
|
|
+ |biz_date,create_time
|
|
|
|from tmp_ads_chance_zhongben
|
|
|
|""".stripMargin)
|
|
|
|
|
@@ -159,14 +160,13 @@ case class CompanyWenshu(s: SparkSession, project: String, //表所在工程名
|
|
|
val yg_name = r.getAs[String]("yg_name") //原告
|
|
|
|
|
|
val bg_name = r.getAs[String]("bg_name") //被告企业
|
|
|
- val label: String = Json(DefaultFormats).write(WenshuJson(r, Seq("case_amt", "biz_date", "case_stage", "is_success"))) //标签列表
|
|
|
+ val label: String = Json(DefaultFormats).write(WenshuJson(r, Seq("case_amt", "judge_date" ))) //标签列表
|
|
|
val business_id = r.getAs[Long]("biz_id") //业务主键id
|
|
|
val business_type = "6" //动态类型
|
|
|
val business_type_name = "0" //动态类型name
|
|
|
val m1: Map[String, String] = queryCompany(restClient, cname)
|
|
|
//动态变更内容
|
|
|
- val m2: Map[String, String] = WenshuJson(r, Seq("yg_name",
|
|
|
- "bg_name", "case_reason", "case_no", "court_name", "biz_date", "link_url", "case_stage", "is_success"))
|
|
|
+ val m2: Map[String, String] = WenshuJson(r, Seq("case_reason", "case_no", "court_name", "judge_date", "link_url", "case_stage", "is_success"))
|
|
|
val dynamic_content = Json(DefaultFormats).write(m1 ++: m2)
|
|
|
val biz_date = r.getAs[Timestamp]("biz_date") //动态变更时间
|
|
|
val create_time = atMonthsBefore(0, "yyyy-MM-dd HH:mm:ss") //创建时间
|
|
@@ -264,25 +264,25 @@ object CompanyWenshuYgZhongben {
|
|
|
var table = ""
|
|
|
var runOld = false
|
|
|
|
|
|
-// if (args.length == 2) {
|
|
|
-// val Array(project1, table1) = args
|
|
|
-// project = project1
|
|
|
-// table = table1
|
|
|
-// } else if (args.length == 3) {
|
|
|
-// val Array(project1, table1, remain) = args
|
|
|
-// project = project1
|
|
|
-// table = table1
|
|
|
-// if (remain.equals("1"))
|
|
|
-// runOld = true
|
|
|
-// } else {
|
|
|
-// println("please set project,table...")
|
|
|
-// sys.exit(-1)
|
|
|
-// }
|
|
|
-
|
|
|
-// println(
|
|
|
-// s"""
|
|
|
-// |project: $project| table: $table| runOld: $runOld
|
|
|
-// |""".stripMargin)
|
|
|
+ if (args.length == 2) {
|
|
|
+ val Array(project1, table1) = args
|
|
|
+ project = project1
|
|
|
+ table = table1
|
|
|
+ } else if (args.length == 3) {
|
|
|
+ val Array(project1, table1, remain) = args
|
|
|
+ project = project1
|
|
|
+ table = table1
|
|
|
+ if (remain.equals("1"))
|
|
|
+ runOld = true
|
|
|
+ } else {
|
|
|
+ println("please set project,table...")
|
|
|
+ sys.exit(-1)
|
|
|
+ }
|
|
|
+
|
|
|
+ println(
|
|
|
+ s"""
|
|
|
+ |project: $project| table: $table| runOld: $runOld
|
|
|
+ |""".stripMargin)
|
|
|
|
|
|
val config = mutable.Map(
|
|
|
"spark.hadoop.odps.project.name" -> "winhc_eci_dev",
|