projectstatisticslogic.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package logic
  2. import (
  3. "context"
  4. "jyBXCore/rpc/service"
  5. "jyBXCore/rpc/internal/svc"
  6. "jyBXCore/rpc/type/bxcore"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type ProjectStatisticsLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewProjectStatisticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ProjectStatisticsLogic {
  15. return &ProjectStatisticsLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 参标项目统计
  22. func (l *ProjectStatisticsLogic) ProjectStatistics(in *bxcore.StatisticsListReq) (*bxcore.ProjectStatisticsDataRes, error) {
  23. // todo: add your logic here and delete this line
  24. participateService := service.ParticipateStatistics{
  25. PositionId: in.PositionId,
  26. EntId: in.EntId,
  27. DeptId: in.EntId,
  28. EntUserId: in.EntUserId,
  29. }
  30. data := participateService.ProjectStatistics(in.EntUserIdArr, in.StartTime, in.EndTime)
  31. return &bxcore.ProjectStatisticsDataRes{
  32. ErrCode: 0,
  33. ErrMsg: "",
  34. Data: data,
  35. }, nil
  36. }