|
@@ -9,6 +9,7 @@ import (
|
|
|
"qfw/util"
|
|
|
"qfw/util/redis"
|
|
|
"regexp"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
@@ -322,6 +323,7 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
}
|
|
|
year := 0
|
|
|
phone, email := "", ""
|
|
|
+ employeeNum := 0
|
|
|
for _, v := range reports {
|
|
|
if util.ObjToString(v["_operation_type"]) == "insert" {
|
|
|
exp := make(map[string]interface{})
|
|
@@ -329,6 +331,7 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
exp["report_year"] = v["report_year"]
|
|
|
exp["zip_code"] = v["zip_code"]
|
|
|
exp["employee_no"] = v["employee_no"]
|
|
|
+ exp["member_no"] = v["member_no"]
|
|
|
exp["company_phone"] = v["company_phone"]
|
|
|
exp["company_email"] = v["company_email"]
|
|
|
exp["_id"] = util.IntAll(v["id"])
|
|
@@ -337,6 +340,13 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
year = util.IntAll(v["report_year"])
|
|
|
phone = util.ObjToString(v["company_phone"])
|
|
|
email = util.ObjToString(v["company_email"])
|
|
|
+ employeeNo := DealMemberNo(util.ObjToString(v["employee_no"]))
|
|
|
+ memberNo := DealMemberNo(util.ObjToString(v["member_no"]))
|
|
|
+ if employeeNo > 0 {
|
|
|
+ employeeNum = employeeNo
|
|
|
+ } else if memberNo > 0 {
|
|
|
+ employeeNum = memberNo
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
eqFlag := true
|
|
@@ -347,6 +357,7 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
m["report_year"] = v["report_year"]
|
|
|
m["zip_code"] = v["zip_code"]
|
|
|
m["employee_no"] = v["employee_no"]
|
|
|
+ m["member_no"] = v["member_no"]
|
|
|
m["company_phone"] = v["company_phone"]
|
|
|
m["company_email"] = v["company_email"]
|
|
|
break
|
|
@@ -354,20 +365,26 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
}
|
|
|
if eqFlag {
|
|
|
exp := make(map[string]interface{})
|
|
|
- exp["stock_capital"] = v["stock_capital"]
|
|
|
- exp["stock_name"] = v["stock_name"]
|
|
|
- exp["identify_no"] = v["identify_no"]
|
|
|
- exp["stock_realcapital"] = v["stock_realcapital"]
|
|
|
- exp["is_history"] = v["is_history"]
|
|
|
- exp["is_personal"] = v["is_personal"]
|
|
|
- exp["stock_type"] = v["stock_type"]
|
|
|
- exp["identify_type"] = v["identify_type"]
|
|
|
+ exp["operator_name"] = v["operator_name"]
|
|
|
+ exp["report_year"] = v["report_year"]
|
|
|
+ exp["zip_code"] = v["zip_code"]
|
|
|
+ exp["employee_no"] = v["employee_no"]
|
|
|
+ exp["member_no"] = v["member_no"]
|
|
|
+ exp["company_phone"] = v["company_phone"]
|
|
|
+ exp["company_email"] = v["company_email"]
|
|
|
exp["_id"] = util.IntAll(v["id"])
|
|
|
arr = append(arr, exp)
|
|
|
if year < util.IntAll(v["report_year"]) {
|
|
|
year = util.IntAll(v["report_year"])
|
|
|
phone = util.ObjToString(v["company_phone"])
|
|
|
email = util.ObjToString(v["company_email"])
|
|
|
+ employeeNo := DealMemberNo(util.ObjToString(v["employee_no"]))
|
|
|
+ memberNo := DealMemberNo(util.ObjToString(v["member_no"]))
|
|
|
+ if employeeNo > 0 {
|
|
|
+ employeeNum = employeeNo
|
|
|
+ } else if memberNo > 0 {
|
|
|
+ employeeNum = memberNo
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -378,6 +395,8 @@ func IncStd(tmp map[string]interface{}) {
|
|
|
if year != 0 {
|
|
|
save["company_phone"] = phone
|
|
|
save["company_email"] = email
|
|
|
+ save["employee_num"] = employeeNum
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
// website_url
|
|
@@ -746,7 +765,7 @@ func partnerFun(tmp map[string]interface{}) {
|
|
|
|
|
|
// annual_report_base 年报信息
|
|
|
func reportFunMysql(tmp map[string]interface{}) {
|
|
|
- query := "SELECT report_year, company_phone, company_email, zip_code, employee_no, operator_name FROM annual_report_base WHERE company_id=?"
|
|
|
+ query := "SELECT report_year, company_phone, company_email, zip_code, employee_no, member_no, operator_name FROM annual_report_base WHERE company_id=?"
|
|
|
info := MysqlTool.SelectBySql(query, util.ObjToString(tmp["_id"]))
|
|
|
if len(*info) > 0 {
|
|
|
tmp["annual_reports"] = *info
|
|
@@ -766,7 +785,7 @@ func reportFunMysql(tmp map[string]interface{}) {
|
|
|
}
|
|
|
}
|
|
|
func reportFun(tmp map[string]interface{}) {
|
|
|
- field := bson.M{"report_year": 1, "company_phone": 1, "company_email": 1, "zip_code": 1, "employee_no": 1, "operator_name": 1}
|
|
|
+ field := bson.M{"report_year": 1, "company_phone": 1, "company_email": 1, "zip_code": 1, "employee_no": 1, "member_no": 1, "operator_name": 1}
|
|
|
info, b := MongoTool1.Find("annual_report_base", bson.M{"company_id": tmp["_id"]}, nil, field, false, -1, -1)
|
|
|
if b && len(*info) > 0 {
|
|
|
tmp["annual_reports"] = *info
|
|
@@ -901,3 +920,21 @@ func taskinfo1() {
|
|
|
//}
|
|
|
//updatePool <- updataInfo
|
|
|
}
|
|
|
+
|
|
|
+func DealMemberNo(memberNo string) (no int) {
|
|
|
+ memberNo = strings.Trim(memberNo, " ")
|
|
|
+ if memberNo == "" {
|
|
|
+ return no
|
|
|
+ }
|
|
|
+ if memberNo == "企业选择不公示" {
|
|
|
+ return no
|
|
|
+ }
|
|
|
+ if strings.HasSuffix(memberNo, "人") {
|
|
|
+ cou := strings.Split(memberNo, "人")[0]
|
|
|
+ count, _ := strconv.Atoi(cou)
|
|
|
+ return count
|
|
|
+ }
|
|
|
+
|
|
|
+ no, _ = strconv.Atoi(memberNo)
|
|
|
+ return no
|
|
|
+}
|