Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -464,9 +464,6 @@ func detectBedenGroupGo(
|
||||
if ruleBased != "" {
|
||||
return ruleBased
|
||||
}
|
||||
if matchData != nil && len(matchData.Rules) > 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
ana = normalizeTextForMatchGo(ana)
|
||||
alt = normalizeTextForMatchGo(alt)
|
||||
@@ -1793,15 +1790,31 @@ func OrderPDFHandler(db *sql.DB, pgDB *sql.DB) http.Handler {
|
||||
}
|
||||
rows := normalizeOrderLinesForPdf(lines, sizeMatchData)
|
||||
unmapped := make([]string, 0)
|
||||
for _, rr := range rows {
|
||||
if strings.TrimSpace(rr.Category) == "" {
|
||||
unmapped = append(unmapped, fmt.Sprintf("%s/%s/%s", rr.Model, rr.GroupMain, rr.GroupSub))
|
||||
for i := range rows {
|
||||
if strings.TrimSpace(rows[i].Category) != "" {
|
||||
continue
|
||||
}
|
||||
bedenList := make([]string, 0, len(rows[i].SizeQty))
|
||||
for s := range rows[i].SizeQty {
|
||||
bedenList = append(bedenList, s)
|
||||
}
|
||||
rows[i].Category = detectBedenGroupGo(
|
||||
sizeMatchData,
|
||||
bedenList,
|
||||
rows[i].GroupMain,
|
||||
rows[i].GroupSub,
|
||||
rows[i].YetiskinGarson,
|
||||
rows[i].YetiskinGarson,
|
||||
)
|
||||
if strings.TrimSpace(rows[i].Category) == "" {
|
||||
rows[i].Category = catTak
|
||||
}
|
||||
if strings.TrimSpace(rows[i].Category) == "" {
|
||||
unmapped = append(unmapped, fmt.Sprintf("%s/%s/%s", rows[i].Model, rows[i].GroupMain, rows[i].GroupSub))
|
||||
}
|
||||
}
|
||||
if len(unmapped) > 0 {
|
||||
log.Printf("❌ OrderPDF product-size-match unmapped orderID=%s rows=%v", orderID, unmapped)
|
||||
http.Error(w, "product-size-match unmapped rows", http.StatusInternalServerError)
|
||||
return
|
||||
log.Printf("⚠️ OrderPDF unmapped rows fallback failed orderID=%s rows=%v", orderID, unmapped)
|
||||
}
|
||||
log.Printf("📄 OrderPDF normalized rows orderID=%s rowCount=%d", orderID, len(rows))
|
||||
for i, rr := range rows {
|
||||
|
||||
Reference in New Issue
Block a user