|
@@ -15,6 +15,7 @@ import (
|
|
util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
util "jygit.jydev.jianyu360.cn/data_processing/common_utils"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/mongodb"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/udp"
|
|
"jygit.jydev.jianyu360.cn/data_processing/common_utils/udp"
|
|
|
|
+ "log"
|
|
"net"
|
|
"net"
|
|
"regexp"
|
|
"regexp"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -25,7 +26,7 @@ import (
|
|
var (
|
|
var (
|
|
JyUrl = "https://www.jianyu360.cn/article/content/%s.html"
|
|
JyUrl = "https://www.jianyu360.cn/article/content/%s.html"
|
|
InfoFields = []string{"title", "project_code", "province", "city", "industry", "buyer", "budget", "winner", "amount",
|
|
InfoFields = []string{"title", "project_code", "province", "city", "industry", "buyer", "budget", "winner", "amount",
|
|
- "detail", "attch", "contact_person", "contact_phone", "attach", "discern_attach", "type", "recommended_service"}
|
|
|
|
|
|
+ "detail", "attch", "contact_person", "contact_phone", "attach", "discern_attach", "type", "recommended_service", "deliveryAddress"}
|
|
)
|
|
)
|
|
|
|
|
|
var SaveFields = map[string]string{
|
|
var SaveFields = map[string]string{
|
|
@@ -200,6 +201,13 @@ func AttsMethod(att map[string]interface{}) (*pb.FileResponse, error) {
|
|
return rep, nil
|
|
return rep, nil
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+type DeliveryAddress struct {
|
|
|
|
+ Area string `json:"area"`
|
|
|
|
+ City string `json:"city"`
|
|
|
|
+ Districts string `json:"districts "`
|
|
|
|
+ DetailsAddr string `json:"detailsAddr"`
|
|
|
|
+}
|
|
|
|
+
|
|
// @Description 信息发布
|
|
// @Description 信息发布
|
|
// @Author J 2022/4/12 1:57 PM
|
|
// @Author J 2022/4/12 1:57 PM
|
|
func InfoPub(info map[string]interface{}) {
|
|
func InfoPub(info map[string]interface{}) {
|
|
@@ -211,6 +219,22 @@ func InfoPub(info map[string]interface{}) {
|
|
if tmp[f] == nil {
|
|
if tmp[f] == nil {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ switch f {
|
|
|
|
+ case "deliveryAddress":
|
|
|
|
+ b, err := json.Marshal(tmp[f])
|
|
|
|
+ if err == nil && len(b) > 0 {
|
|
|
|
+ var da = DeliveryAddress{}
|
|
|
|
+ err = json.Unmarshal(b, &da)
|
|
|
|
+ if err == nil && da.Area != "" {
|
|
|
|
+ saveMap["deliver_area"] = da.Area
|
|
|
|
+ saveMap["deliver_city"] = da.City
|
|
|
|
+ saveMap["deliver_district"] = da.Districts
|
|
|
|
+ saveMap["deliver_detail"] = da.DetailsAddr
|
|
|
|
+ }
|
|
|
|
+ log.Println("deliveryAddress info :", da)
|
|
|
|
+ }
|
|
|
|
+ log.Println("deliveryAddress err :", err)
|
|
|
|
+ }
|
|
if f == "budget" || f == "amount" {
|
|
if f == "budget" || f == "amount" {
|
|
saveMap[SaveFields[f]] = util.Float64All(tmp[f])
|
|
saveMap[SaveFields[f]] = util.Float64All(tmp[f])
|
|
jyMap[f] = util.Float64All(tmp[f])
|
|
jyMap[f] = util.Float64All(tmp[f])
|