work_hour

package
v0.0.0-...-57ed434 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserIntoProParticipant

func AddUserIntoProParticipant(orgId int64, opUid, targetUid int64, projectId int64) errs.SystemErrorInfo

AddUserIntoProParticipant 将一个用户加为项目参与者

func ChangeWorkerIdWhenChangedIssueOwner

func ChangeWorkerIdWhenChangedIssueOwner(orgId, issueId, oldOwner, newOwner int64) errs.SystemErrorInfo

当任务的负责人变更之后,对应的工时的执行人也发生变更

func CheckAndFixGetStatisticDataParam

func CheckAndFixGetStatisticDataParam(param *vo.GetWorkHourStatisticReq) errs.SystemErrorInfo

func CheckHasWorkHoursUpdatePower

func CheckHasWorkHoursUpdatePower(orgId int64, paramBo bo.CheckWorkHoursUpdatePowerBo) (bool, errs.SystemErrorInfo)

CheckHasWorkHoursUpdatePower 检查是否有权限编辑工时记录 工时执行人、项目负责人,以及有工时字段权限角色的协作人能对工时进行编辑

func CheckIsEnableWorkHour

func CheckIsEnableWorkHour(orgId, currentUserId int64, param vo.CheckIsEnableWorkHourReq) (*vo.CheckIsEnableWorkHourResp, errs.SystemErrorInfo)

CheckIsEnableWorkHour 引入工时字段后,默认就是开启的。增加工时列后,就能添加工时记录。

func CheckIsIssueMember

func CheckIsIssueMember(orgId int64, param vo.CheckIsIssueMemberReq) (*vo.BoolResp, errs.SystemErrorInfo)

检查员工是否是项目成员

func CheckIsIssueRelatedPeople

func CheckIsIssueRelatedPeople(orgId int64, param vo.CheckIsIssueMemberReq) (*vo.BoolResp, errs.SystemErrorInfo)

检查是否是任务相关人员(创建人,关注人,负责人)

func CheckNeedTimeValid

func CheckNeedTimeValid(needTime string) errs.SystemErrorInfo

func CheckPowerForCreateIssueWorkHours

func CheckPowerForCreateIssueWorkHours(orgId, currentUserId int64, issue *bo.IssueBo) (bool, errs.SystemErrorInfo)

CheckPowerForCreateIssueWorkHours 创建工时记录时,检查是否有权限 1.先检查当前用户是否是项目负责人、任务负责人、关注人 2.检查当前人是否是任务的相关人

func CheckWorkerIdValid

func CheckWorkerIdValid(workerId int64) bool

校验工时执行者id是否合法

func CreateIssueWorkHours

func CreateIssueWorkHours(orgId, currentUserId int64, param vo.CreateIssueWorkHoursReq, needPush bool, tx ...sqlbuilder.Tx) (*vo.BoolResp, errs.SystemErrorInfo)

CreateIssueWorkHours 创建新的工时记录,2种情况 1.issue 负责人创建预估工时或者实际工时 2.issue 参与人,创建自己的实际工时

func CreateMultiIssueWorkHours

func CreateMultiIssueWorkHours(orgId, currentUserId int64, param vo.CreateMultiIssueWorkHoursReq) (*vo.BoolResp, errs.SystemErrorInfo)

CreateMultiIssueWorkHours 新增详细版预估工时(多个子预估工时)信息。新建多个子预估工时时,会生成一个总预估工时记录

func DeleteIssueWorkHours

func DeleteIssueWorkHours(orgId, currentUserId int64, param vo.DeleteIssueWorkHoursReq, needUpdateTotal, needCheckPermission bool) (*vo.BoolResp, errs.SystemErrorInfo)

DeleteIssueWorkHours 删除工时记录 只有自己和负责人类型的人可以删除工时 删除子预估工时,会削减总预估工时的时长

func DisOrEnableIssueWorkHours

func DisOrEnableIssueWorkHours(orgId, currentUserId int64, param vo.DisOrEnableIssueWorkHoursReq) (*vo.BoolResp, errs.SystemErrorInfo)

启用/关闭工时记录功能 通过更新项目详情中的 is_enable_work_hours 判断是否开启工时功能 只有项目负责人可以开启/关闭工时功能

func ExportWorkHourStatistic

func ExportWorkHourStatistic(orgId int64, param vo.GetWorkHourStatisticReq) (*vo.ExportWorkHourStatisticResp, errs.SystemErrorInfo)

工时统计数据的导出。

func GenExcelFileForData

func GenExcelFileForData(fileWithPath string, workHourInfo *vo.GetWorkHourStatisticResp, dateStrArr []string) errs.SystemErrorInfo

生成 excel 文件

func GetDateListByDateRange

func GetDateListByDateRange(startTime, endTime int64) []string

通过起始时间生成这段日期内的所有日期穷举。

func GetExportFileInfo

func GetExportFileInfo(orgId int64) (relatePath, fileDir, fileName string, err errs.SystemErrorInfo)

获取导出的文件相关信息

func GetIssueIdsByStatisticInput

func GetIssueIdsByStatisticInput(orgId int64, param vo.GetWorkHourStatisticReq) ([]int64, errs.SystemErrorInfo)

GetIssueIdsByStatisticInput 通过统计的输入参数,获取符合条件的所有任务id

func GetIssueWorkHoursInfo

func GetIssueWorkHoursInfo(orgId, currentUserId int64, param vo.GetIssueWorkHoursInfoReq) (*vo.GetIssueWorkHoursInfoResp, errs.SystemErrorInfo)

GetIssueWorkHoursInfo 获取一个任务的工时信息 包含预估工时、实际工时记录列表等信息

func GetIssueWorkHoursList

func GetIssueWorkHoursList(orgId, currentUserId int64, param vo.GetIssueWorkHoursListReq) (*vo.GetIssueWorkHoursListResp, errs.SystemErrorInfo)

工时记录列表

func GetPermissionUserIdsForWorkHour

func GetPermissionUserIdsForWorkHour(orgId, userId, issueId int64) (owners, participant, followers []int64, err errs.SystemErrorInfo)

通过 issueId 获取项目负责人、任务负责人,参与人

func GetStatisticDataForActual

func GetStatisticDataForActual(startTime, endTime int64, workHours []*po.PpmPriIssueWorkHours) (total int64, list []vo.OneDateWorkHour, err errs.SystemErrorInfo)

实际工时计算:计算时间区域内,每个日期的工时

func GetStatisticDataForPredict

func GetStatisticDataForPredict(workHours []*po.PpmPriIssueWorkHours) (total int64, err errs.SystemErrorInfo)

预估工时计算

func GetStatisticDataForSummary

func GetStatisticDataForSummary(orgId int64, param vo.GetWorkHourStatisticReq, projectIds, issueIds, totalWorkerIds []int64) (vo.GetWorkHourStatisticSummary, errs.SystemErrorInfo)

筛选条件下的数据汇总

func GetUpdateData

func GetUpdateData(orgId, currentUserId int64, param vo.UpdateMultiIssueWorkHoursReq, issue *bo.IssueBo) (newData []*po.PpmPriIssueWorkHours, updateData []*vo.UpdateIssueWorkHoursReq, deleteIds []int64, err errs.SystemErrorInfo)

摘取出需要更新的一些信息。编辑预估工时时调用!

func GetWeekAndDate

func GetWeekAndDate(datetimeStr string) (weekStr, monthlyDate string, err errs.SystemErrorInfo)

通过标准的日期字符串,获取对应的星期和日期。如将 `2020-12-04 00:00:00` 抓换为 `周一`、`11/29`。

func GetWorkHourStatistic

func GetWorkHourStatistic(orgId int64, param vo.GetWorkHourStatisticReq) (*vo.GetWorkHourStatisticResp, errs.SystemErrorInfo)

工时统计 startTime、endTime 如果不传,则会默认最近 7 天内

func GetWorkerIdsForStatistic

func GetWorkerIdsForStatistic(orgId int64, param vo.GetWorkHourStatisticReq) (totalWorkerIds []int64, retErr errs.SystemErrorInfo)

通过查询条件获取要查询的工时执行人。

func GetWorkerInfos

func GetWorkerInfos(orgId int64, workerIds []int64) (map[int64]*vo.WorkHourWorker, errs.SystemErrorInfo)

通过工时中的 worker_id 获取对应工时执行者的信息

func PushMqttForWorkHour

func PushMqttForWorkHour(orgId, userId, issueId int64)

func RenderExcelBody

func RenderExcelBody(sheet *xlsx.Sheet, dataList []*vo.OnePersonWorkHourStatisticInfo)

func RenderExcelHeader

func RenderExcelHeader(row *xlsx.Row, dateStrList []string)

func RenderSummaryData

func RenderSummaryData(sheet *xlsx.Sheet, summaryData *vo.OnePersonWorkHourStatisticInfo)

渲染总计数据

func SetUserJoinIssue

func SetUserJoinIssue(orgId, currentUserId int64, param vo.SetUserJoinIssueReq) (*vo.BoolResp, errs.SystemErrorInfo)

将用户加入为任务的关注者

func TriggerCreateWorkHourTrend

func TriggerCreateWorkHourTrend(orgId, currentUserId, issueId int64, newWorkHourParam vo.OneWorkHourRecord) errs.SystemErrorInfo

TriggerCreateWorkHourTrend 新增工时,触发新增动态,触发工时变更卡片推送

func TriggerDeleteWorkHourTrend

func TriggerDeleteWorkHourTrend(orgId, currentUserId, issueId int64, workHour vo.OneWorkHourRecord) errs.SystemErrorInfo

TriggerDeleteWorkHourTrend 删除工时,触发新增动态、飞书卡片推送

func TriggerEnableOrDisableWorkHourTrend

func TriggerEnableOrDisableWorkHourTrend(orgId, currentUserId int64, project *bo.ProjectBo, disOrEnable string) errs.SystemErrorInfo

生成开启工时或者关闭工时功能的项目动态

func TriggerFsCardForWorkHourChange

func TriggerFsCardForWorkHourChange(issueTrendsBo *bo.IssueTrendsBo) errs.SystemErrorInfo

TriggerFsCardForWorkHourChange 工时的卡片推送

func TriggerUpdateWorkHourTrend

func TriggerUpdateWorkHourTrend(orgId, currentUserId, issueId int64, oldWorkHour vo.OneWorkHourRecord, newWorkHour vo.OneWorkHourRecord) error

TriggerUpdateWorkHourTrend 编辑工时,触发新增动态

func TriggerWorkHourWhenChangedPlanStartOrEndTime

func TriggerWorkHourWhenChangedPlanStartOrEndTime(orgId, issueId int64, updateField string, oldValue, newValue types2.Time) errs.SystemErrorInfo

更新任务时,触发更新总预估工时的某个字段。

func UpdateIssueWorkHours

func UpdateIssueWorkHours(orgId, currentUserId int64, param vo.UpdateIssueWorkHoursReq, needCheckPermission, needUpdateTotal, needTrend, needPush bool, tx ...sqlbuilder.Tx) (*vo.BoolResp, errs.SystemErrorInfo)

UpdateIssueWorkHours 编辑工时记录 needUpdateTotal 是否需要更新总预估工时。当一个请求中,只更新一个工时记录时,传 true。 needTrend 是否需要产生动态

func UpdateMultiIssueWorkHourWithDelete

func UpdateMultiIssueWorkHourWithDelete(orgId, currentUserId int64, param vo.UpdateMultiIssueWorkHoursReq) (*vo.BoolResp, errs.SystemErrorInfo)

UpdateMultiIssueWorkHourWithDelete 编辑多条预估工时,支持 diff 后的删除操作。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL