| | |
| | | "apsClient/pkg/ecode" |
| | | "apsClient/pkg/logx" |
| | | "apsClient/pkg/structx" |
| | | "encoding/json" |
| | | "fmt" |
| | | "gorm.io/gorm" |
| | | "time" |
| | |
| | | return taskResp, ecode.OK |
| | | } |
| | | func (slf TaskService) NewTaskCount() (count int64) { |
| | | count, _ = model.NewProceduresSearch(nil).SetDeviceId(conf.Conf.System.DeviceId).SetStatus(model.ProcedureStatusWaitProcess).Count() |
| | | nowTs := time.Now().Unix() |
| | | count, _ = model.NewProceduresSearch(nil).SetDeviceId(conf.Conf.System.DeviceId).SetStatus(model.ProcedureStatusWaitProcess).SetEndTimeMin(nowTs).Count() |
| | | return count |
| | | } |
| | | |
| | |
| | | return nil, err |
| | | } |
| | | if err == nil { |
| | | err = json.Unmarshal([]byte(data.Params), &data.ParamsMap) |
| | | if err != nil { |
| | | logx.Errorf("process model json.Unmarshal:%v", err) |
| | | return |
| | | } |
| | | return data, nil |
| | | } |
| | | |