|
@@ -168,8 +168,9 @@ func (this *MySteelChemicalController) HandleMysteelIndex() {
|
|
|
this.Data["json"] = br
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
+ body := this.Ctx.Input.RequestBody
|
|
|
var req models.HandleMysteelIndexResp
|
|
|
- err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ err := json.Unmarshal(body, &req)
|
|
|
if err != nil {
|
|
|
br.Msg = "参数解析异常!"
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
@@ -653,3 +654,126 @@ func (this *MySteelChemicalController) GetIndexDetailByCode() {
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (this *MySteelChemicalController) GetIndexCountByFrequency() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ var req models.GetMaxFileIndexReq
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+
|
|
|
+ condition += ` AND is_stop = 0 `
|
|
|
+
|
|
|
+ indexObj := new(models.BaseFromMysteelChemicalIndex)
|
|
|
+
|
|
|
+ indexTotal, err := indexObj.GetIndexCountByFrequency(condition, pars)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Data = indexTotal
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "处理成功"
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (this *MySteelChemicalController) GetIndexLimitByFrequency() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+ var req models.GetNoMergeIndexByFrequencyPageReq
|
|
|
+ err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ indexObj := new(models.BaseFromMysteelChemicalIndex)
|
|
|
+
|
|
|
+ indexTotal, err := indexObj.GetIndexLimitByFrequency(req.Frequency, req.Limit)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Data = indexTotal
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "处理成功"
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+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)
|
|
|
+ }
|
|
|
+
|
|
|
+ condition += ` AND is_stop = 0 `
|
|
|
+
|
|
|
+ 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 = "处理成功"
|
|
|
+}
|