Browse Source

wip:采购信息配置

wangshan 9 months ago
parent
commit
aec75d841b
3 changed files with 9 additions and 5 deletions
  1. 2 1
      jy_publishing/config.json
  2. 4 3
      jy_publishing/main.go
  3. 3 1
      jy_publishing/task.go

+ 2 - 1
jy_publishing/config.json

@@ -78,7 +78,8 @@
     {
       "code": "zc_cgxx",
       "name": "直采-采购信息",
-      "isPublic": 1
+      "isPublic": 1,
+      "extractType": -1
     }
   ]
 }

+ 4 - 3
jy_publishing/main.go

@@ -36,9 +36,10 @@ var (
 )
 
 type infoCode struct {
-	Code     string `json:"code"`     //发布信息代码
-	Name     string `json:"name"`     //发布信息类型名称
-	IsPublic int    `json:"isPublic"` //是否公开;默认公开:0;不公开:1
+	Code        string `json:"code"`        //发布信息代码
+	Name        string `json:"name"`        //发布信息类型名称
+	IsPublic    int    `json:"isPublic"`    //是否公开;默认公开:0;不公开:1
+	ExtractType int    `json:"extractType"` //-1:采购信息
 }
 
 func init() {

+ 3 - 1
jy_publishing/task.go

@@ -206,6 +206,7 @@ func InfoPub(info map[string]interface{}) {
 	tmp := info["appendInfo"].(map[string]interface{})
 	saveMap := make(map[string]interface{})
 	jyMap := make(map[string]interface{})
+	extractType := 0
 	for _, f := range InfoFields {
 		if tmp[f] == nil {
 			continue
@@ -269,6 +270,7 @@ func InfoPub(info map[string]interface{}) {
 				}
 				saveMap["infoattribute"] = InfoCodes[it-1].Code
 				saveMap["ispublic"] = InfoCodes[it-1].IsPublic //是否公开
+				extractType = InfoCodes[it-1].ExtractType
 			}
 		} else if f == "recommended_service" {
 			saveMap[SaveFields[f]] = util.IntAll(tmp[f])
@@ -293,7 +295,7 @@ func InfoPub(info map[string]interface{}) {
 	saveMap["site"] = "剑鱼信息发布平台"
 	saveMap["channel"] = "公告"
 	saveMap["spidercode"] = "a_jyxxfbpt_gg"
-	saveMap["extracttype"] = 0
+	saveMap["extracttype"] = extractType
 	saveMap["areaval"] = 0
 	saveMap["detail_isvalidity"] = 1
 	saveMap["infoformat"] = 1