|
@@ -716,3 +716,47 @@ func (this *MySteelChemicalController) GetIndexLimitByFrequency() {
|
|
|
br.Success = true
|
|
|
br.Msg = "处理成功"
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取钢联指标分页数据
|
|
|
+// @Description 获取钢联指标分页数据
|
|
|
+// @Success 200 {object} models.HandleMysteelIndexResp
|
|
|
+// @router /getIndexPageByFrequency [post]
|
|
|
+func (this *MySteelChemicalController) GetIndexPageByFrequency() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ var req models.GetIndexPageByFrequencyPageReq
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ if req.Frequency != "" {
|
|
|
+ condition += ` AND frequency = ? `
|
|
|
+ pars = append(pars, req.Frequency)
|
|
|
+ }
|
|
|
+
|
|
|
+ if req.EndDate != "" {
|
|
|
+ condition += ` AND end_date < ? `
|
|
|
+ pars = append(pars, req.EndDate)
|
|
|
+ }
|
|
|
+
|
|
|
+ indexObj := new(models.BaseFromMysteelChemicalIndex)
|
|
|
+ // 获取未合并的指标总数量
|
|
|
+ indexTotal, err := indexObj.GetIndexPageByFrequency(condition, pars, req.StartSize, req.PageSize)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Data = indexTotal
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "处理成功"
|
|
|
+}
|