12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- package models
- import "hongze/hongze_edb_lib/utils"
- // BaseEdbInfoInterface 基础指标接口
- type BaseEdbInfoInterface interface {
- Add(params AddCalculateBatchParams) (edbInfo *EdbInfo, err error, errMsg string)
- Edit(params EditCalculateBatchParams) (err error, errMsg string)
- Refresh(params RefreshParams) (err error, errMsg string)
- GetSourceName() string
- }
- // AddCalculateBatchParams 添加的请求参
- type AddCalculateBatchParams struct {
- Req *EdbInfoCalculateBatchSaveReq
- FromEdbInfo *EdbInfo
- EdbCode string
- UniqueCode string
- SysUserId int
- SysUserRealName string
- }
- // EditCalculateBatchParams 编辑的请求参
- type EditCalculateBatchParams struct {
- Req *EdbInfoCalculateBatchEditReq
- EdbInfo *EdbInfo
- FromEdbInfo *EdbInfo
- }
- // RefreshParams 编辑的请求参
- type RefreshParams struct {
- EdbInfo *EdbInfo
- FromEdbInfo *EdbInfo
- StartDate string
- EndDate string
- }
- // GetBaseEdbInfoModel 获取普通指标的model
- func GetBaseEdbInfoModel(source int) (baseEdbInfoModel BaseEdbInfoInterface) {
- switch source {
- case utils.DATA_SOURCE_CALCULATE_LJZZJ:
- baseEdbInfoModel = Ljzzj{}
- case utils.DATA_SOURCE_CALCULATE_LJZ:
- baseEdbInfoModel = Ljz{}
- case utils.DATA_SOURCE_CALCULATE_LJZNCZJ:
- baseEdbInfoModel = LjzNczj{}
- default:
- }
- return
- }
- // BatchSaveCalculateBatchParams 编辑的请求参
- type BatchSaveCalculateBatchParams struct {
- Req EdbInfoCalculateBatchSaveReq
- EdbInfo *EdbInfo
- FromEdbInfo *EdbInfo
- EdbCode string
- UniqueCode string
- SysUserId int
- SysUserRealName string
- }
- // BasePredictEdbInfoInterface 基础指标接口
- type BasePredictEdbInfoInterface interface {
- Add(params BatchSaveCalculateBatchParams) (edbInfo *EdbInfo, latestDateStr string, latestValue float64, err error, errMsg string)
- Edit(params BatchSaveCalculateBatchParams) (latestDateStr string, latestValue float64, err error, errMsg string)
- Refresh(params RefreshParams) (latestDateStr string, latestValue float64, err error, errMsg string)
- GetSourceName() string
- }
- // GetBasePredictEdbInfoModel 获取预测指标的model
- func GetBasePredictEdbInfoModel(source int) (baseEdbInfoModel BasePredictEdbInfoInterface) {
- switch source {
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZJ:
- baseEdbInfoModel = PredictLjzzj{}
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZ:
- baseEdbInfoModel = PredictLjz{}
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ:
- baseEdbInfoModel = PredictLjzNczj{}
- default:
- }
- return
- }
|