edb_info_calculate.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. package data_manage
  2. import (
  3. "errors"
  4. "eta/eta_api/utils"
  5. "fmt"
  6. "github.com/beego/beego/v2/client/orm"
  7. "github.com/yidane/formula"
  8. "strconv"
  9. "strings"
  10. "time"
  11. )
  12. type EdbInfoCalculateSaveReq struct {
  13. EdbName string `description:"指标名称"`
  14. Frequency string `description:"频率"`
  15. Unit string `description:"单位"`
  16. ClassifyId int `description:"分类id"`
  17. CalculateFormula string `description:"计算公式"`
  18. Calendar string `description:"公历/农历"`
  19. EdbInfoIdArr []EdbInfoFromTag `description:"指标信息"`
  20. }
  21. // EdbInfoFromTag 计算指标的关联指标
  22. type EdbInfoFromTag struct {
  23. EdbInfoId int `description:"指标id"`
  24. FromTag string `description:"指标对应标签"`
  25. MoveValue int `description:"移动的值"`
  26. }
  27. type EdbInfoCalculate struct {
  28. EdbInfoCalculateId int `orm:"column(edb_info_calculate_id);pk"`
  29. EdbInfoId int `description:"指标id"`
  30. EdbCode string `description:"指标编码"`
  31. FromEdbInfoId int `description:"计算指标id"`
  32. FromEdbCode string `description:"计算指标编码"`
  33. FromEdbName string `description:"计算指标名称"`
  34. FromSource int `description:"计算指标来源"`
  35. FromSourceName string `description:"计算指标来源名称"`
  36. FromTag string `description:"来源指标标签"`
  37. Sort int `description:"计算指标名称排序"`
  38. CreateTime time.Time `description:"创建时间"`
  39. ModifyTime time.Time `description:"修改时间"`
  40. }
  41. func AddEdbInfoCalculateMulti(items []*EdbInfoCalculate) (err error) {
  42. o := orm.NewOrmUsingDB("data")
  43. _, err = o.InsertMulti(1, items)
  44. return
  45. }
  46. type FromEdbInfoData struct {
  47. EdbInfoId int `description:"指标id"`
  48. EdbName string `description:"指标名称"`
  49. DataList []*EdbInfoSearchData
  50. }
  51. type EdbInfoCalculateDetail struct {
  52. EdbInfoCalculateId int `orm:"column(edb_info_calculate_id);pk"`
  53. EdbInfoId int `description:"指标id"`
  54. EdbCode string `description:"指标编码"`
  55. FromEdbInfoId int `description:"计算指标id"`
  56. FromEdbCode string `description:"计算指标编码"`
  57. FromEdbName string `description:"计算指标名称"`
  58. FromSource int `description:"计算指标来源"`
  59. FromSourceName string `description:"计算指标来源名称"`
  60. FromTag string `description:"来源指标标签"`
  61. MoveValue int `description:"移动的值,小于0是提前,0是不变,大于0是滞后"`
  62. Sort int `description:"计算指标名称排序"`
  63. CreateTime time.Time `description:"创建时间"`
  64. ModifyTime time.Time `description:"修改时间"`
  65. StartDate string `description:"开始日期"`
  66. EndDate string `description:"结束日期"`
  67. LatestDate string `description:"实际的结束日期"`
  68. LatestValue float64 `description:"最近实际数据的值"`
  69. EndValue float64 `description:"结束日期的值(可能是插入值)"`
  70. EdbType int `description:"指标类型:1:基础指标,2:计算指标"`
  71. }
  72. func GetEdbInfoCalculateDetail(edbInfoId, source int) (list []*EdbInfoCalculateDetail, err error) {
  73. o := orm.NewOrmUsingDB("data")
  74. //calculateTableName := GetEdbInfoCalculateTableName(source)
  75. //sql := ` SELECT a.*,b.start_date,b.end_date,b.edb_type FROM %s AS a
  76. // INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  77. // WHERE a.edb_info_id=? ORDER BY sort ASC `
  78. //
  79. //sql = fmt.Sprintf(sql, calculateTableName)
  80. sql := ` SELECT a.edb_info_calculate_mapping_id,a.edb_info_id,a.source,a.source_name,a.edb_code,a.from_edb_info_id,a.from_edb_code,a.from_source,a.from_source_name,a.sort,a.create_time,a.modify_time,a.from_tag,a.move_value,b.edb_name_source as from_edb_name,b.start_date,b.end_date,b.latest_date,b.latest_value,b.edb_type FROM edb_info_calculate_mapping AS a
  81. INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  82. WHERE a.edb_info_id=? ORDER BY sort ASC `
  83. _, err = o.Raw(sql, edbInfoId).QueryRows(&list)
  84. return
  85. }
  86. type CalculateDetailResp struct {
  87. EdbInfoDetail *EdbInfoFullClassify
  88. CalculateList []*EdbInfoCalculateDetail
  89. }
  90. type EdbInfoCalculateEditReq struct {
  91. EdbInfoId int `description:"指标id"`
  92. EdbName string `description:"指标名称"`
  93. Frequency string `description:"频率"`
  94. Unit string `description:"单位"`
  95. ClassifyId int `description:"分类id"`
  96. CalculateFormula string `description:"计算公式"`
  97. EdbInfoIdArr []EdbInfoFromTag `description:"指标信息"`
  98. }
  99. func GetCalculateEdbInfo(edbInfoId int) (from_edb_info_id string, err error) {
  100. o := orm.NewOrmUsingDB("data")
  101. sql := ` SELECT GROUP_CONCAT(from_edb_info_id ORDER BY sort ASC SEPARATOR ',') AS from_edb_info_id
  102. FROM edb_info_calculate_mapping
  103. WHERE edb_info_id=?
  104. GROUP BY edb_info_id
  105. `
  106. err = o.Raw(sql, edbInfoId).QueryRow(&from_edb_info_id)
  107. return
  108. }
  109. func DeleteCalculateEdbInfo(edbInfoId int) (err error) {
  110. o := orm.NewOrmUsingDB("data")
  111. to, err := o.Begin()
  112. if err != nil {
  113. return
  114. }
  115. defer func() {
  116. if err != nil {
  117. _ = to.Rollback()
  118. } else {
  119. _ = to.Commit()
  120. }
  121. }()
  122. sql := `DELETE FROM edb_data_calculate WHERE edb_info_id=?`
  123. _, err = to.Raw(sql, edbInfoId).Exec()
  124. if err != nil {
  125. return
  126. }
  127. sql = `DELETE FROM edb_info_calculate_mapping WHERE edb_info_id=?`
  128. _, err = to.Raw(sql, edbInfoId).Exec()
  129. return
  130. }
  131. func DeleteCalculateData(edbInfoId int) (err error) {
  132. o := orm.NewOrmUsingDB("data")
  133. sql := `DELETE FROM edb_data_calculate WHERE edb_info_id=?`
  134. _, err = o.Raw(sql, edbInfoId).Exec()
  135. return
  136. }
  137. type EdbInfoCalculateBatchSaveReq struct {
  138. EdbInfoId int `description:"指标id"`
  139. EdbName string `description:"指标名称"`
  140. Frequency string `description:"频度"`
  141. Unit string `description:"单位"`
  142. ClassifyId int `description:"分类id"`
  143. Formula string `description:"N值/移动天数"`
  144. FromEdbInfoId int `description:"计算来源指标id"`
  145. Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:变频"`
  146. CalculateFormula string `description:"计算公式"`
  147. EdbInfoIdArr []EdbInfoFromTag `description:"指标信息"`
  148. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  149. MoveFrequency string `description:"移动频度:天/周/月/季/年"`
  150. Calendar string `description:"公历/农历"`
  151. }
  152. type EdbInfoCalculateBatchEditReq struct {
  153. EdbName string `description:"指标名称"`
  154. Frequency string `description:"频度"`
  155. Unit string `description:"单位"`
  156. ClassifyId int `description:"分类id"`
  157. Formula string `description:"N值"`
  158. EdbInfoId int `description:"编辑指标id"`
  159. FromEdbInfoId int `description:"计算来源指标id"`
  160. Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:变频"`
  161. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  162. MoveFrequency string `description:"移动频度:天/周/月/季/年"`
  163. Calendar string `description:"公历/农历"`
  164. EdbInfoIdArr []EdbInfoFromTag
  165. }
  166. // EdbInfoCalculateBatchSaveReqByEdbLib edb指标库的请求逻辑
  167. type EdbInfoCalculateBatchSaveReqByEdbLib struct {
  168. AdminId int `description:"添加人id"`
  169. AdminName string `description:"添加人名称"`
  170. EdbInfoId int `description:"指标id"`
  171. EdbName string `description:"指标名称"`
  172. Frequency string `description:"频度"`
  173. Unit string `description:"单位"`
  174. ClassifyId int `description:"分类id"`
  175. Formula string `description:"N值/移动天数"`
  176. FromEdbInfoId int `description:"计算来源指标id"`
  177. Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:变频"`
  178. CalculateFormula string `description:"计算公式"`
  179. EdbInfoIdArr []EdbInfoFromTag `description:"指标信息"`
  180. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  181. MoveFrequency string `description:"移动频度:天/周/月/季/年"`
  182. Calendar string `description:"公历/农历"`
  183. }
  184. // EdbInfoCalculateBatchEditReq 编辑计算指标的请求参数
  185. type EdbInfoCalculateBatchEditReqByEdbLib struct {
  186. EdbName string `description:"指标名称"`
  187. Frequency string `description:"频度"`
  188. Unit string `description:"单位"`
  189. ClassifyId int `description:"分类id"`
  190. Formula string `description:"N值"`
  191. EdbInfoId int `description:"编辑指标id"`
  192. FromEdbInfoId int `description:"计算来源指标id"`
  193. Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:变频"`
  194. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  195. MoveFrequency string `description:"移动频度:天/周/月/季/年"`
  196. Calendar string `description:"公历/农历"`
  197. EdbInfoIdArr []EdbInfoFromTag
  198. }
  199. func GetEdbInfoCalculateMap(edbInfoId, source int) (list []*EdbInfo, err error) {
  200. o := orm.NewOrmUsingDB("data")
  201. //calculateTableName := GetEdbInfoCalculateTableName(source)
  202. //sql := ` SELECT b.* FROM %s AS a
  203. // INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  204. // WHERE a.edb_info_id=? ORDER BY sort ASC `
  205. //sql = fmt.Sprintf(sql, calculateTableName)
  206. sql := ` SELECT b.* FROM edb_info_calculate_mapping AS a
  207. INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  208. WHERE a.edb_info_id=? ORDER BY sort ASC `
  209. _, err = o.Raw(sql, edbInfoId).QueryRows(&list)
  210. return
  211. }
  212. type CalculateItems struct {
  213. EdbInfoId int
  214. DataMap map[string]float64
  215. }
  216. func CheckFormula(formula string) map[string]string {
  217. mathFormula := []string{"MAX", "MIN", "ABS", "ACOS", "ASIN", "CEIL", "MOD", "POW", "ROUND", "SIGN", "SIN", "TAN", "LOG10", "LOG2", "LOG", "LN"}
  218. str := strings.ToUpper(formula)
  219. for _, v := range mathFormula {
  220. str = strings.Replace(str, v, "", -1)
  221. }
  222. str = strings.Replace(str, "(", "", -1)
  223. str = strings.Replace(str, ")", "", -1)
  224. byteMap := make(map[string]string)
  225. for i := 0; i < len(str); i++ {
  226. byteInt := str[i]
  227. if byteInt >= 65 && byteInt <= 90 {
  228. byteStr := string(byteInt)
  229. if _, ok := byteMap[byteStr]; !ok {
  230. byteMap[byteStr] = byteStr
  231. }
  232. }
  233. }
  234. return byteMap
  235. }
  236. func ReplaceFormula(edbInfoIdArr []*EdbInfo, valArr map[int]float64, formulaMap map[string]string, formulaStr string, edbInfoIdBytes []string) string {
  237. funMap := GetFormulaMap()
  238. for k, v := range funMap {
  239. formulaStr = strings.Replace(formulaStr, k, v, -1)
  240. }
  241. replaceCount := 0
  242. for dk, dv := range edbInfoIdArr {
  243. if dk == 0 {
  244. dKey := edbInfoIdBytes[dk]
  245. if _, ok := formulaMap[dKey]; ok { //公式中存在
  246. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  247. dvStr := fmt.Sprintf("%v", val)
  248. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  249. replaceCount++
  250. }
  251. }
  252. }
  253. if dk == 1 {
  254. dKey := edbInfoIdBytes[dk]
  255. if _, ok := formulaMap[dKey]; ok { //公式中存在
  256. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  257. dvStr := fmt.Sprintf("%v", val)
  258. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  259. replaceCount++
  260. }
  261. }
  262. }
  263. if dk == 2 {
  264. dKey := edbInfoIdBytes[dk]
  265. if _, ok := formulaMap[dKey]; ok { //公式中存在
  266. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  267. dvStr := fmt.Sprintf("%v", val)
  268. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  269. replaceCount++
  270. }
  271. }
  272. }
  273. if dk == 3 {
  274. dKey := edbInfoIdBytes[dk]
  275. if _, ok := formulaMap[dKey]; ok { //公式中存在
  276. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  277. dvStr := fmt.Sprintf("%v", val)
  278. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  279. replaceCount++
  280. }
  281. }
  282. }
  283. if dk == 4 {
  284. dKey := edbInfoIdBytes[dk]
  285. if _, ok := formulaMap[dKey]; ok { //公式中存在
  286. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  287. dvStr := fmt.Sprintf("%v", val)
  288. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  289. replaceCount++
  290. }
  291. }
  292. }
  293. if dk == 5 {
  294. dKey := edbInfoIdBytes[dk]
  295. if _, ok := formulaMap[dKey]; ok { //公式中存在
  296. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  297. dvStr := fmt.Sprintf("%v", val)
  298. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  299. replaceCount++
  300. }
  301. }
  302. }
  303. if dk == 6 {
  304. dKey := edbInfoIdBytes[dk]
  305. if _, ok := formulaMap[dKey]; ok { //公式中存在
  306. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  307. dvStr := fmt.Sprintf("%v", val)
  308. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  309. replaceCount++
  310. }
  311. }
  312. }
  313. if dk == 7 {
  314. dKey := edbInfoIdBytes[dk]
  315. if _, ok := formulaMap[dKey]; ok { //公式中存在
  316. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  317. dvStr := fmt.Sprintf("%v", val)
  318. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  319. replaceCount++
  320. }
  321. }
  322. }
  323. if dk == 8 {
  324. dKey := edbInfoIdBytes[dk]
  325. if _, ok := formulaMap[dKey]; ok { //公式中存在
  326. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  327. dvStr := fmt.Sprintf("%v", val)
  328. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  329. replaceCount++
  330. }
  331. }
  332. }
  333. }
  334. for k, v := range funMap {
  335. formulaStr = strings.Replace(formulaStr, v, k, -1)
  336. }
  337. if replaceCount == len(formulaMap) {
  338. return formulaStr
  339. } else {
  340. return ""
  341. }
  342. }
  343. func GetFormulaMap() map[string]string {
  344. funMap := make(map[string]string)
  345. funMap["MAX"] = "[@@]"
  346. funMap["MIN"] = "[@!]"
  347. funMap["ABS"] = "[@#]"
  348. funMap["CEIL"] = "[@$]"
  349. funMap["COS"] = "[@%]"
  350. funMap["FLOOR"] = "[@^]"
  351. funMap["MOD"] = "[@&]"
  352. funMap["POW"] = "[@*]"
  353. funMap["ROUND"] = "[@(]"
  354. return funMap
  355. }
  356. func Calculate(edbInfoIdArr []*EdbInfo, edbInfoId int, edbCode, formulaStr string, edbInfoIdBytes []string) (err error) {
  357. defer func() {
  358. if err != nil {
  359. utils.FileLog.Info("Calculate Err:%s" + err.Error())
  360. }
  361. }()
  362. saveDataMap := make(map[string]map[int]float64)
  363. for _, v := range edbInfoIdArr {
  364. var condition string
  365. var pars []interface{}
  366. condition += " AND edb_info_id=? "
  367. pars = append(pars, v.EdbInfoId)
  368. dataList, err := GetEdbDataListAll(condition, pars, v.Source, 1)
  369. if err != nil {
  370. return err
  371. }
  372. dataMap := make(map[string]float64)
  373. for _, dv := range dataList {
  374. if val, ok := saveDataMap[dv.DataTime]; ok {
  375. if _, ok := val[v.EdbInfoId]; !ok {
  376. val[v.EdbInfoId] = dv.Value
  377. }
  378. } else {
  379. temp := make(map[int]float64)
  380. temp[v.EdbInfoId] = dv.Value
  381. saveDataMap[dv.DataTime] = temp
  382. }
  383. }
  384. item := new(CalculateItems)
  385. item.EdbInfoId = v.EdbInfoId
  386. item.DataMap = dataMap
  387. }
  388. formulaMap := CheckFormula(formulaStr)
  389. addSql := ` INSERT INTO edb_data_calculate(edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
  390. nowStr := time.Now().Format(utils.FormatDateTime)
  391. var isAdd bool
  392. for sk, sv := range saveDataMap {
  393. formulaStr = strings.ToUpper(formulaStr)
  394. formulaFormStr := ReplaceFormula(edbInfoIdArr, sv, formulaMap, formulaStr, edbInfoIdBytes)
  395. if formulaStr == "" {
  396. return
  397. }
  398. if formulaFormStr != "" {
  399. utils.FileLog.Info("formulaFormStr:%s", formulaFormStr)
  400. expression := formula.NewExpression(formulaFormStr)
  401. calResult, err := expression.Evaluate()
  402. if err != nil {
  403. err = errors.New("计算失败:Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
  404. fmt.Println(err)
  405. return err
  406. }
  407. calVal, err := calResult.Float64()
  408. if err != nil {
  409. err = errors.New("计算失败:获取计算值失败 Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
  410. fmt.Println(err)
  411. return err
  412. }
  413. //需要存入的数据
  414. {
  415. dataTime, _ := time.Parse(utils.FormatDate, sk)
  416. timestamp := dataTime.UnixNano() / 1e6
  417. timeStr := fmt.Sprintf("%d", timestamp)
  418. addSql += "("
  419. addSql += strconv.Itoa(edbInfoId) + "," + "'" + edbCode + "'" + "," + "'" + sk + "'" + "," + utils.SubFloatToString(calVal, 4) + "," + "'" + nowStr + "'" +
  420. "," + "'" + nowStr + "'" + "," + "1"
  421. addSql += "," + "'" + timeStr + "'"
  422. addSql += "),"
  423. isAdd = true
  424. }
  425. } else {
  426. fmt.Println("formulaFormStr is empty")
  427. }
  428. }
  429. if isAdd {
  430. addSql = strings.TrimRight(addSql, ",")
  431. AddEdbDataCalculateBySql(addSql)
  432. if err != nil {
  433. fmt.Println("AddEdbDataCalculate Err:" + err.Error())
  434. return err
  435. }
  436. }
  437. return
  438. }
  439. // SaveAdjustEdbInfoReq 保存数据调整请求参数(请求指标服务)
  440. type SaveAdjustEdbInfoReq struct {
  441. AdminId int `description:"添加人id"`
  442. AdminName string `description:"添加人名称"`
  443. EdbInfoId int `description:"指标id"`
  444. FromEdbInfoId int `description:"来源指标id"`
  445. EdbName string `description:"指标名称"`
  446. Frequency string `description:"频度"`
  447. Unit string `description:"单位"`
  448. ClassifyId int `description:"分类id"`
  449. DataList []SaveAdjustEdbDataReq `description:"指标对应的数据值"`
  450. }
  451. // SaveAdjustEdbDataReq 保存数据调整请求的数据的参数
  452. type SaveAdjustEdbDataReq struct {
  453. Date string `description:"数据日期"`
  454. Value float64 `description:"数据值"`
  455. }
  456. // BatchEdbInfoCalculateBatchSaveReq 批量添加 计算指标
  457. type BatchEdbInfoCalculateBatchSaveReq struct {
  458. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  459. CalculateInfo EdbInfoCalculateBatchSaveReq
  460. }
  461. // BatchEdbInfoCalculateBatchSaveResp 批量添加 计算指标 返回数据
  462. type BatchEdbInfoCalculateBatchSaveResp struct {
  463. Fail []BatchEdbInfoCalculateBatchSaveFailResp `description:"添加失败的指标"`
  464. Success []BatchEdbInfoCalculateBatchSaveSuccessResp `description:"添加成功的指标"`
  465. }
  466. // BatchEdbInfoCalculateBatchSaveFailResp 添加失败的指标信息
  467. type BatchEdbInfoCalculateBatchSaveFailResp struct {
  468. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  469. Msg string `description:"用户提示信息"`
  470. ErrMsg string `description:"错误信息,内部查看"`
  471. }
  472. // BatchEdbInfoCalculateBatchSaveSuccessResp 添加成功的指标信息
  473. type BatchEdbInfoCalculateBatchSaveSuccessResp struct {
  474. ClassifyId int `description:"分类id"`
  475. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  476. EdbInfoId int `description:"指标ID"`
  477. UniqueCode string `description:"指标唯一编码"`
  478. }