package services

import (
	"fmt"
	"ppms-fj/global"
	"ppms-fj/internal/colComment/model"
	"ppms-fj/tools"
	"strings"
)

func ColCommentService() {
	db := (*global.DBMap)[global.DBFJSJ]
	var reportList []model.SysBbzdb
	db.Debug().Find(reportList)
	baseDir := global.Config.ColComment.Dir
	if !strings.HasSuffix(baseDir, "/") && !strings.HasSuffix(baseDir, "\\") {
		baseDir += "/"
	}
	for _, ele := range reportList {
		if ele.Dybm == nil || *ele.Dybm == "" {
			continue
		}
		path := fmt.Sprintf("%srp%s.xml", baseDir, *ele.Dybm)
		if !tools.FileExists(path) {
			global.Logger.Warn("[FileNotExist]" + path)
		}

	}
}
