edb_info_calculate.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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 *EdbInfo
  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. Data interface{} `description:"数据列"`
  184. }
  185. // EdbInfoCalculateBatchEditReq 编辑计算指标的请求参数
  186. type EdbInfoCalculateBatchEditReqByEdbLib struct {
  187. EdbName string `description:"指标名称"`
  188. Frequency string `description:"频度"`
  189. Unit string `description:"单位"`
  190. ClassifyId int `description:"分类id"`
  191. Formula string `description:"N值"`
  192. EdbInfoId int `description:"编辑指标id"`
  193. FromEdbInfoId int `description:"计算来源指标id"`
  194. Source int `description:"来源:1:同花顺,2:wind,3:彭博,4:指标运算,5:累计值转月,6:同比值,7:同差值,8:N数值移动平均计算,12:环比值,13:环差值,14:变频"`
  195. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  196. MoveFrequency string `description:"移动频度:天/周/月/季/年"`
  197. Calendar string `description:"公历/农历"`
  198. EdbInfoIdArr []EdbInfoFromTag
  199. }
  200. func GetEdbInfoCalculateMap(edbInfoId, source int) (list []*EdbInfo, err error) {
  201. o := orm.NewOrmUsingDB("data")
  202. //calculateTableName := GetEdbInfoCalculateTableName(source)
  203. //sql := ` SELECT b.* FROM %s AS a
  204. // INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  205. // WHERE a.edb_info_id=? ORDER BY sort ASC `
  206. //sql = fmt.Sprintf(sql, calculateTableName)
  207. sql := ` SELECT b.* FROM edb_info_calculate_mapping AS a
  208. INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  209. WHERE a.edb_info_id=? ORDER BY sort ASC `
  210. _, err = o.Raw(sql, edbInfoId).QueryRows(&list)
  211. return
  212. }
  213. type CalculateItems struct {
  214. EdbInfoId int
  215. DataMap map[string]float64
  216. }
  217. func CheckFormula(formula string) map[string]string {
  218. mathFormula := []string{"MAX", "MIN", "ABS", "ACOS", "ASIN", "CEIL", "MOD", "POW", "ROUND", "SIGN", "SIN", "TAN", "LOG10", "LOG2", "LOG", "LN"}
  219. str := strings.ToUpper(formula)
  220. for _, v := range mathFormula {
  221. str = strings.Replace(str, v, "", -1)
  222. }
  223. str = strings.Replace(str, "(", "", -1)
  224. str = strings.Replace(str, ")", "", -1)
  225. byteMap := make(map[string]string)
  226. for i := 0; i < len(str); i++ {
  227. byteInt := str[i]
  228. if byteInt >= 65 && byteInt <= 90 {
  229. byteStr := string(byteInt)
  230. if _, ok := byteMap[byteStr]; !ok {
  231. byteMap[byteStr] = byteStr
  232. }
  233. }
  234. }
  235. return byteMap
  236. }
  237. func ReplaceFormula(edbInfoIdArr []*EdbInfo, valArr map[int]float64, formulaMap map[string]string, formulaStr string, edbInfoIdBytes []string) string {
  238. funMap := GetFormulaMap()
  239. for k, v := range funMap {
  240. formulaStr = strings.Replace(formulaStr, k, v, -1)
  241. }
  242. replaceCount := 0
  243. for dk, dv := range edbInfoIdArr {
  244. if dk == 0 {
  245. dKey := edbInfoIdBytes[dk]
  246. if _, ok := formulaMap[dKey]; ok { //公式中存在
  247. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  248. dvStr := fmt.Sprintf("%v", val)
  249. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  250. replaceCount++
  251. }
  252. }
  253. }
  254. if dk == 1 {
  255. dKey := edbInfoIdBytes[dk]
  256. if _, ok := formulaMap[dKey]; ok { //公式中存在
  257. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  258. dvStr := fmt.Sprintf("%v", val)
  259. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  260. replaceCount++
  261. }
  262. }
  263. }
  264. if dk == 2 {
  265. dKey := edbInfoIdBytes[dk]
  266. if _, ok := formulaMap[dKey]; ok { //公式中存在
  267. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  268. dvStr := fmt.Sprintf("%v", val)
  269. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  270. replaceCount++
  271. }
  272. }
  273. }
  274. if dk == 3 {
  275. dKey := edbInfoIdBytes[dk]
  276. if _, ok := formulaMap[dKey]; ok { //公式中存在
  277. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  278. dvStr := fmt.Sprintf("%v", val)
  279. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  280. replaceCount++
  281. }
  282. }
  283. }
  284. if dk == 4 {
  285. dKey := edbInfoIdBytes[dk]
  286. if _, ok := formulaMap[dKey]; ok { //公式中存在
  287. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  288. dvStr := fmt.Sprintf("%v", val)
  289. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  290. replaceCount++
  291. }
  292. }
  293. }
  294. if dk == 5 {
  295. dKey := edbInfoIdBytes[dk]
  296. if _, ok := formulaMap[dKey]; ok { //公式中存在
  297. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  298. dvStr := fmt.Sprintf("%v", val)
  299. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  300. replaceCount++
  301. }
  302. }
  303. }
  304. if dk == 6 {
  305. dKey := edbInfoIdBytes[dk]
  306. if _, ok := formulaMap[dKey]; ok { //公式中存在
  307. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  308. dvStr := fmt.Sprintf("%v", val)
  309. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  310. replaceCount++
  311. }
  312. }
  313. }
  314. if dk == 7 {
  315. dKey := edbInfoIdBytes[dk]
  316. if _, ok := formulaMap[dKey]; ok { //公式中存在
  317. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  318. dvStr := fmt.Sprintf("%v", val)
  319. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  320. replaceCount++
  321. }
  322. }
  323. }
  324. if dk == 8 {
  325. dKey := edbInfoIdBytes[dk]
  326. if _, ok := formulaMap[dKey]; ok { //公式中存在
  327. if val, valOk := valArr[dv.EdbInfoId]; valOk { //值存在
  328. dvStr := fmt.Sprintf("%v", val)
  329. formulaStr = strings.Replace(formulaStr, dKey, dvStr, -1)
  330. replaceCount++
  331. }
  332. }
  333. }
  334. }
  335. for k, v := range funMap {
  336. formulaStr = strings.Replace(formulaStr, v, k, -1)
  337. }
  338. if replaceCount == len(formulaMap) {
  339. return formulaStr
  340. } else {
  341. return ""
  342. }
  343. }
  344. func GetFormulaMap() map[string]string {
  345. funMap := make(map[string]string)
  346. funMap["MAX"] = "[@@]"
  347. funMap["MIN"] = "[@!]"
  348. funMap["ABS"] = "[@#]"
  349. funMap["CEIL"] = "[@$]"
  350. funMap["COS"] = "[@%]"
  351. funMap["FLOOR"] = "[@^]"
  352. funMap["MOD"] = "[@&]"
  353. funMap["POW"] = "[@*]"
  354. funMap["ROUND"] = "[@(]"
  355. return funMap
  356. }
  357. func Calculate(edbInfoIdArr []*EdbInfo, edbInfoId int, edbCode, formulaStr string, edbInfoIdBytes []string) (err error) {
  358. defer func() {
  359. if err != nil {
  360. utils.FileLog.Info("Calculate Err:%s" + err.Error())
  361. }
  362. }()
  363. saveDataMap := make(map[string]map[int]float64)
  364. for _, v := range edbInfoIdArr {
  365. var condition string
  366. var pars []interface{}
  367. condition += " AND edb_info_id=? "
  368. pars = append(pars, v.EdbInfoId)
  369. dataList, err := GetEdbDataListAll(condition, pars, v.Source, 1)
  370. if err != nil {
  371. return err
  372. }
  373. dataMap := make(map[string]float64)
  374. for _, dv := range dataList {
  375. if val, ok := saveDataMap[dv.DataTime]; ok {
  376. if _, ok := val[v.EdbInfoId]; !ok {
  377. val[v.EdbInfoId] = dv.Value
  378. }
  379. } else {
  380. temp := make(map[int]float64)
  381. temp[v.EdbInfoId] = dv.Value
  382. saveDataMap[dv.DataTime] = temp
  383. }
  384. }
  385. item := new(CalculateItems)
  386. item.EdbInfoId = v.EdbInfoId
  387. item.DataMap = dataMap
  388. }
  389. formulaMap := CheckFormula(formulaStr)
  390. addSql := ` INSERT INTO edb_data_calculate(edb_info_id,edb_code,data_time,value,create_time,modify_time,status,data_timestamp) values `
  391. nowStr := time.Now().Format(utils.FormatDateTime)
  392. var isAdd bool
  393. for sk, sv := range saveDataMap {
  394. formulaStr = strings.ToUpper(formulaStr)
  395. formulaFormStr := ReplaceFormula(edbInfoIdArr, sv, formulaMap, formulaStr, edbInfoIdBytes)
  396. if formulaStr == "" {
  397. return
  398. }
  399. if formulaFormStr != "" {
  400. utils.FileLog.Info("formulaFormStr:%s", formulaFormStr)
  401. expression := formula.NewExpression(formulaFormStr)
  402. calResult, err := expression.Evaluate()
  403. if err != nil {
  404. err = errors.New("计算失败:Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
  405. fmt.Println(err)
  406. return err
  407. }
  408. calVal, err := calResult.Float64()
  409. if err != nil {
  410. err = errors.New("计算失败:获取计算值失败 Err:" + err.Error() + ";formulaStr:" + formulaFormStr)
  411. fmt.Println(err)
  412. return err
  413. }
  414. //需要存入的数据
  415. {
  416. dataTime, _ := time.Parse(utils.FormatDate, sk)
  417. timestamp := dataTime.UnixNano() / 1e6
  418. timeStr := fmt.Sprintf("%d", timestamp)
  419. addSql += "("
  420. addSql += strconv.Itoa(edbInfoId) + "," + "'" + edbCode + "'" + "," + "'" + sk + "'" + "," + utils.SubFloatToString(calVal, 4) + "," + "'" + nowStr + "'" +
  421. "," + "'" + nowStr + "'" + "," + "1"
  422. addSql += "," + "'" + timeStr + "'"
  423. addSql += "),"
  424. isAdd = true
  425. }
  426. } else {
  427. fmt.Println("formulaFormStr is empty")
  428. }
  429. }
  430. if isAdd {
  431. addSql = strings.TrimRight(addSql, ",")
  432. AddEdbDataCalculateBySql(addSql)
  433. if err != nil {
  434. fmt.Println("AddEdbDataCalculate Err:" + err.Error())
  435. return err
  436. }
  437. }
  438. return
  439. }
  440. // SaveAdjustEdbInfoReq 保存数据调整请求参数(请求指标服务)
  441. type SaveAdjustEdbInfoReq struct {
  442. AdminId int `description:"添加人id"`
  443. AdminName string `description:"添加人名称"`
  444. EdbInfoId int `description:"指标id"`
  445. FromEdbInfoId int `description:"来源指标id"`
  446. EdbName string `description:"指标名称"`
  447. Frequency string `description:"频度"`
  448. Unit string `description:"单位"`
  449. ClassifyId int `description:"分类id"`
  450. DataList []SaveAdjustEdbDataReq `description:"指标对应的数据值"`
  451. }
  452. // SaveAdjustEdbDataReq 保存数据调整请求的数据的参数
  453. type SaveAdjustEdbDataReq struct {
  454. Date string `description:"数据日期"`
  455. Value float64 `description:"数据值"`
  456. }
  457. // BatchEdbInfoCalculateBatchSaveReq 批量添加 计算指标
  458. type BatchEdbInfoCalculateBatchSaveReq struct {
  459. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  460. CalculateInfo EdbInfoCalculateBatchSaveReq
  461. }
  462. // BatchEdbInfoCalculateBatchSaveResp 批量添加 计算指标 返回数据
  463. type BatchEdbInfoCalculateBatchSaveResp struct {
  464. Fail []BatchEdbInfoCalculateBatchSaveFailResp `description:"添加失败的指标"`
  465. Success []BatchEdbInfoCalculateBatchSaveSuccessResp `description:"添加成功的指标"`
  466. }
  467. // BatchEdbInfoCalculateBatchSaveFailResp 添加失败的指标信息
  468. type BatchEdbInfoCalculateBatchSaveFailResp struct {
  469. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  470. Msg string `description:"用户提示信息"`
  471. ErrMsg string `description:"错误信息,内部查看"`
  472. }
  473. // BatchEdbInfoCalculateBatchSaveSuccessResp 添加成功的指标信息
  474. type BatchEdbInfoCalculateBatchSaveSuccessResp struct {
  475. ClassifyId int `description:"分类id"`
  476. CalculateId string `description:"当前请求时,单个计算的唯一标识"`
  477. EdbInfoId int `description:"指标ID"`
  478. UniqueCode string `description:"指标唯一编码"`
  479. }