projectStatisticsLogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/encrypt"
  4. "context"
  5. "jyBXCore/rpc/type/bxcore"
  6. "jyBXCore/api/internal/svc"
  7. "jyBXCore/api/internal/types"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type ProjectStatisticsLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewProjectStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ProjectStatisticsLogic {
  16. return &ProjectStatisticsLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *ProjectStatisticsLogic) ProjectStatistics(req *types.PtatisticsListReq) (resp *types.CommonResp, err error) {
  23. // todo: add your logic here and delete this line
  24. for k, v := range req.EntUserIdArr {
  25. req.EntUserIdArr[k] = encrypt.SE.Decode4Hex(v)
  26. }
  27. res, err := l.svcCtx.BxCore.ProjectStatistics(l.ctx, &bxcore.StatisticsListReq{
  28. EntId: req.EntId,
  29. EntUserId: req.EntUserId,
  30. PositionId: req.PositionId,
  31. EntUserIdArr: req.EntUserIdArr,
  32. DeptId: req.DeptId,
  33. StartTime: req.StartTime,
  34. EndTime: req.EndTime,
  35. BidWay: req.BidWay,
  36. })
  37. if err != nil {
  38. return nil, err
  39. }
  40. return &types.CommonResp{
  41. Data: res.Data,
  42. }, nil
  43. }