package logic

import (
	"context"
	"jyBXCore/rpc/internal/svc"
	"jyBXCore/rpc/service"
	"jyBXCore/rpc/type/bxcore"

	"github.com/zeromicro/go-zero/core/logx"
)

type ProjectDetailsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewProjectDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ProjectDetailsLogic {
	return &ProjectDetailsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ProjectDetailsLogic) ProjectDetails(in *bxcore.ProjectDetailsReq) (*bxcore.DetailDataRes, error) {
	participateService := service.ParticipateStatistics{
		PositionId: in.PositionId,
		EntId:      in.EntId,
		DeptId:     in.EntId,
		EntUserId:  in.EntUserId,
	}

	data := participateService.ProjectDetails(in.EntUserIdArr, in)
	return &bxcore.DetailDataRes{
		ErrCode: 0,
		ErrMsg:  "",
		Data:    &data,
	}, nil
}
