edb_info_calculate.go 19 KB

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