feat: 优化UPF流量统计逻辑
This commit is contained in:
@@ -103,7 +103,7 @@ func (k *KpiCReport) GetReport2FE(c *gin.Context) {
|
||||
dbg := db.DB("").Model(&KpiCReport{}).Table(tableName)
|
||||
|
||||
if querys.NeID != "" {
|
||||
conditions = append(conditions, "rm_uid = (select n.rm_uid from ne_info n where n.ne_type=? and n.ne_id=? and n.status=1)")
|
||||
conditions = append(conditions, "rm_uid = (select n.rm_uid from ne_info n where n.ne_type=? and n.ne_id=?)")
|
||||
params = append(params, querys.NeType, querys.NeID)
|
||||
} else {
|
||||
c.JSON(http.StatusBadRequest, services.ErrResp("Not found required parameter NE ID"))
|
||||
|
||||
@@ -199,7 +199,10 @@ func saveKPIData(kpiReport KpiReport, index int64) int64 {
|
||||
// 推送到ws订阅组
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI, neInfo.NeType, neInfo.NeId), kpiEvent)
|
||||
if neInfo.NeType == "UPF" {
|
||||
wsService.NewWSSend.ByGroupID(wsService.GROUP_KPI_UPF+neInfo.NeId, kpiEvent)
|
||||
// 更新UPF总流量
|
||||
upValue := parse.Number(kpiEvent["UPF.03"])
|
||||
downValue := parse.Number(kpiEvent["UPF.06"])
|
||||
neDataService.NewKpiReport.UPFTodayFlowUpdate(neInfo.RmUID, upValue, downValue, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,7 +277,7 @@ func saveKPIDataC(kpiReport KpiReport, index int64) int64 {
|
||||
neInfo := neService.NewNeInfo.FindByRmuid(kpiData.RmUid)
|
||||
if neInfo.RmUID == kpiData.RmUid {
|
||||
// 推送自定义KPI到ws订阅组
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI_C, neInfo.NeType, neInfo.NeId), kpiEvent)
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s_%s_%s", wsService.GROUP_KPI_C, neInfo.NeType, neInfo.NeId), kpiEvent)
|
||||
}
|
||||
}
|
||||
return insertId
|
||||
@@ -412,12 +415,9 @@ func PostKPIReportFromNFOld(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if neInfo.RmUID == kpiData.RmUid {
|
||||
// 推送到ws订阅组
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI, neInfo.NeType, neInfo.NeId), kpiEvent)
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s_%s_%s", wsService.GROUP_KPI, neInfo.NeType, neInfo.NeId), kpiEvent)
|
||||
// 推送自定义KPI到ws订阅组
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s%s_%s", wsService.GROUP_KPI_C, neInfo.NeType, neInfo.NeId), kpiCEvent)
|
||||
if neInfo.NeType == "UPF" {
|
||||
wsService.NewWSSend.ByGroupID(wsService.GROUP_KPI_UPF+neInfo.NeId, kpiEvent)
|
||||
}
|
||||
wsService.NewWSSend.ByGroupID(fmt.Sprintf("%s_%s_%s", wsService.GROUP_KPI_C, neInfo.NeType, neInfo.NeId), kpiCEvent)
|
||||
}
|
||||
|
||||
services.ResponseStatusOK204NoContent(w)
|
||||
@@ -465,7 +465,7 @@ type Task struct {
|
||||
}
|
||||
type KpiSetJ struct {
|
||||
Code string `json:"Code"` // 统计编码 如:SMFHA01
|
||||
KPIs []string `json:"KPIs` // 指标项集合 ["SMF.AttCreatePduSession", "SMF.AttCreatePduSession._Dnn"]
|
||||
KPIs []string `json:"KPIs"` // 指标项集合 ["SMF.AttCreatePduSession", "SMF.AttCreatePduSession._Dnn"]
|
||||
}
|
||||
|
||||
type MeasureTask struct {
|
||||
@@ -475,7 +475,7 @@ type MeasureTask struct {
|
||||
KpiSet []KpiSetJ `json:"KPISet" xorm:"kpi_set"`
|
||||
StartTime string `json:"startTime" xorm:"start_time"`
|
||||
EndTime string `json:"endTime" xorm:"end_time"`
|
||||
Periods []Period `json:"Periods" xorm:"periods`
|
||||
Periods []Period `json:"Periods" xorm:"periods"`
|
||||
Schedule []ScheduleJ `json:"Schedule" xorm:"schedule"`
|
||||
GranulOption string `json:"granulOption" xorm:"granul_option"`
|
||||
Status string `json:"status" xorm:"status"`
|
||||
@@ -483,7 +483,7 @@ type MeasureTask struct {
|
||||
Comment string `json:"comment" xorm:"comment"`
|
||||
CreateTime string `json:"createTime" xorm:"create_time"`
|
||||
UpdateTime string `json:"updateTime" xorm:"update_time"`
|
||||
DeleteTime string `json:"deleteTime xorm:"delete_time"`
|
||||
DeleteTime string `json:"deleteTime" xorm:"delete_time"`
|
||||
|
||||
Tasks []Task `json:"Tasks"`
|
||||
NotifyUrl string `json:"NotifyUrl"` /* "http://xEngine.xEngine.xEngine.x:xxxx/api/rest/performanceManagement/v1/elementType/smf/objectType/measureReport */
|
||||
|
||||
Reference in New Issue
Block a user