rzd_controller.go 939 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package controllers
  2. import (
  3. "eta/eta_data_analysis/models"
  4. "eta/eta_data_analysis/services/ruizide"
  5. "eta/eta_data_analysis/utils"
  6. "github.com/beego/beego/v2/server/web"
  7. )
  8. type RzdController struct {
  9. web.Controller
  10. }
  11. // DealData
  12. // @Title 解析睿咨得数据
  13. // @Description 合同套餐列表
  14. // @Param DayFlag query int false
  15. // @Param WeekFlag query int false
  16. // @Success 200 {object} company.GetUnusualRenewListGroupMonthResp
  17. // @router /rz_deal_data [get]
  18. func (this *RzdController) DealData() {
  19. br := new(models.BaseResponse).Init()
  20. defer func() {
  21. this.Data["json"] = br
  22. this.ServeJSON()
  23. }()
  24. var err error
  25. // 解析文件移动到目标目录
  26. err = ruizide.FileResolver()
  27. if err != nil {
  28. utils.FileLog.Error("睿咨得数据处理失败 err:%v", err)
  29. br.Msg = "操作异常"
  30. br.ErrMsg = "操作异常,Err:" + err.Error()
  31. return
  32. }
  33. br.Ret = 200
  34. br.Success = true
  35. br.Msg = "操作成功"
  36. }