|
@@ -243,7 +243,7 @@ func AnalysisChartInventoryWeeklyEdb(htm []byte, rule *CCFChartRule) (isStop boo
|
|
|
childRule := make(map[string]*CCFChartRule)
|
|
|
// 判断是否存在子页面
|
|
|
if len(rule.Child) > 0 {
|
|
|
- for _, v := range childRule {
|
|
|
+ for _, v := range rule.Child {
|
|
|
childRule[v.Name] = v
|
|
|
}
|
|
|
}
|
|
@@ -257,12 +257,15 @@ func AnalysisChartInventoryWeeklyEdb(htm []byte, rule *CCFChartRule) (isStop boo
|
|
|
if indexCode == "" {
|
|
|
productName := row.Find("td:nth-child(1)").Text()
|
|
|
productName = strings.TrimSpace(productName)
|
|
|
- indexCode = fmt.Sprintf("ccf%s", utils.GetFirstPingYin(productName))
|
|
|
- indexName = fmt.Sprintf("CCF%s", productName)
|
|
|
//判断子页面的频度
|
|
|
if newRule, ok := childRule[productName]; ok {
|
|
|
frequency = newRule.Frequency
|
|
|
+ // 在存在子类的情况下,判断产品是否属于子类,不属于则跳过
|
|
|
+ } else if len(childRule) > 0 {
|
|
|
+ return
|
|
|
}
|
|
|
+ indexCode = fmt.Sprintf("ccf%s", utils.GetFirstPingYin(productName))
|
|
|
+ indexName = fmt.Sprintf("CCF%s", productName)
|
|
|
}
|
|
|
// 提取日期
|
|
|
date := row.Find("td:nth-child(2)").Text()
|