|
@@ -1,14 +1,17 @@
|
|
|
-package com.winhc.bigdata.spark.jobs
|
|
|
+package com.winhc.bigdata.spark.model
|
|
|
|
|
|
import java.util.Date
|
|
|
+
|
|
|
import com.winhc.bigdata.calc.DimScoreV2
|
|
|
import com.winhc.bigdata.spark.utils.{BaseUtil, LoggingUtils, SparkUtils}
|
|
|
import org.apache.spark.sql.{Row, SparkSession}
|
|
|
+
|
|
|
import scala.annotation.meta.getter
|
|
|
import scala.collection.mutable
|
|
|
|
|
|
/**
|
|
|
- * 软件著作权 | 作品著作权 | 专利
|
|
|
+ * 知识产权类得分
|
|
|
+ * 软件著作权 | 作品著作权 | 专利 | 商标 | 网站
|
|
|
* π
|
|
|
*/
|
|
|
|
|
@@ -17,7 +20,9 @@ object CompanyIntellectualsScore {
|
|
|
val tabMapping: Map[String, (String, String, String, String)] =
|
|
|
Map("ads_company_copyright_reg_list" -> ("1", "publish_time", "资产权益", "软著作权"), //软件著作权
|
|
|
"ads_company_copyright_works_list" -> ("2", "finish_time", "资产权益", "著作权"), //作品著作权
|
|
|
- "ads_company_patent_list" -> ("3;4", "pub_date", "资产权益", "实用新型、外观设计专利;发明专利") //专利
|
|
|
+ "ads_company_patent_list" -> ("3;4", "pub_date", "资产权益", "实用新型、外观设计专利;发明专利"), //专利
|
|
|
+ "ads_company_icp" -> ("5", "examine_date", "资产权益", "网站"), //网站
|
|
|
+ "ads_company_tm" -> ("6", "app_date", "资产权益", "商标") //商标
|
|
|
)
|
|
|
|
|
|
def main(args: Array[String]): Unit = {
|
|
@@ -115,15 +120,17 @@ case class CompanyIntellectualsScore(s: SparkSession, sourceTable: String,
|
|
|
val cid = r.getAs[Long]("new_cid").toString
|
|
|
val cnt1 = r.getAs[Long]("cnt1")
|
|
|
flag match {
|
|
|
- case "1" => getSoftCopyRightScore(id, cid, cnt1, kind, prpject)
|
|
|
- case "2" => getCopyRightScore(id, cid, cnt1, kind, prpject)
|
|
|
+ case "1" => softCopyRightScore(id, cid, cnt1, kind, prpject)
|
|
|
+ case "2" => copyRightScore(id, cid, cnt1, kind, prpject)
|
|
|
case "3" => ordinaryPatentScore(id, cid, cnt1, kind, prpject)
|
|
|
case "4" => inventScore(id, cid, cnt1, kind, prpject)
|
|
|
+ case "5" => webSiteScore(id, cid, cnt1, kind, prpject)
|
|
|
+ case "6" => tradeMarkScore(id, cid, cnt1, kind, prpject)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//软著作权
|
|
|
- def getSoftCopyRightScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
+ def softCopyRightScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
var score = 0f
|
|
|
val total = 3f
|
|
|
val extraScore = 0f
|
|
@@ -146,7 +153,7 @@ case class CompanyIntellectualsScore(s: SparkSession, sourceTable: String,
|
|
|
}
|
|
|
|
|
|
//著作权
|
|
|
- def getCopyRightScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
+ def copyRightScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
var score = 0f
|
|
|
val total = 2f
|
|
|
val extraScore = 0f
|
|
@@ -210,4 +217,50 @@ case class CompanyIntellectualsScore(s: SparkSession, sourceTable: String,
|
|
|
score, total, extraScore)
|
|
|
}
|
|
|
|
|
|
+ //网站
|
|
|
+ def webSiteScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
+ var score = 0f
|
|
|
+ val total = 1f
|
|
|
+ val extraScore = 0f
|
|
|
+ var ty = ""
|
|
|
+ if (cnt1 > 20) {
|
|
|
+ score = 4f
|
|
|
+ ty = "网站域名数量>20,该项分数上加3分"
|
|
|
+ } else if (cnt1 > 0) {
|
|
|
+ score = 1f
|
|
|
+ ty = "有"
|
|
|
+ } else {
|
|
|
+ score = 0f
|
|
|
+ ty = "无"
|
|
|
+ }
|
|
|
+ (id, cid, kind, DimScoreV2.newsEventMap.get(kind), project, DimScoreV2.newsEventMap.get(project), ty,
|
|
|
+ score, total, extraScore)
|
|
|
+ }
|
|
|
+
|
|
|
+ //商标
|
|
|
+ def tradeMarkScore(id: Long, cid: String, cnt1: Long, kind: String, project: String) = {
|
|
|
+ var score = 0f
|
|
|
+ val total = 4f
|
|
|
+ val extraScore = 0f
|
|
|
+ var ty = ""
|
|
|
+ if (cnt1 == 0) {
|
|
|
+ score = 0f
|
|
|
+ ty = "无"
|
|
|
+ } else if (cnt1 <= 2) {
|
|
|
+ score = 2f
|
|
|
+ ty = "授予数量≤2"
|
|
|
+ } else if (cnt1 <= 8) {
|
|
|
+ score = 3f
|
|
|
+ ty = "授予数量>2,≤8"
|
|
|
+ } else if (cnt1 <= 100) {
|
|
|
+ score = 4f
|
|
|
+ ty = "授予数量>8"
|
|
|
+ } else {
|
|
|
+ score = 9f
|
|
|
+ ty = "商标数量>100,该项分数上加5分"
|
|
|
+ }
|
|
|
+ (id, cid, kind, DimScoreV2.newsEventMap.get(kind), project, DimScoreV2.newsEventMap.get(project), ty,
|
|
|
+ score, total, extraScore)
|
|
|
+ }
|
|
|
+
|
|
|
}
|