| | |
| | | type AttendanceController struct { |
| | | } |
| | | |
| | | // GetTemplate |
| | | // @Tags 考勤管理 |
| | | // @Summary 获取模版列表 |
| | | // @Produce application/json |
| | | // @Param object body request.TemplateCategoryRequest true "参数" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-jl/v1/attendance/getTemplate [post] |
| | | func (slf AttendanceController) GetTemplate(c *gin.Context) { |
| | | var params request.TemplateCategoryRequest |
| | | if err := c.ShouldBind(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | |
| | | list, err := models.NewFileTemplateAttachmentSearch().SetCategory(params.Category).Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查找失败") |
| | | return |
| | | } |
| | | |
| | | util.ResponseFormat(c, code.Success, list) |
| | | } |
| | | |
| | | // AttendanceInput |
| | | // |
| | | // @Tags 考勤管理 |
| | |
| | | as.ActualAttendanceDays = as.ActualAttendanceDays + 1 |
| | | time2, _ := timex.StringToTime2(manage.Date) |
| | | day := time2.Day() |
| | | as.Details[day-1].Status = manage.Status |
| | | detail := as.Details[day-1] |
| | | detail.Status = manage.Status |
| | | detail.StartWorkTime = manage.StartWorkTime |
| | | detail.EndWorkTime = manage.EndWorkTime |
| | | detail.ClassesStartTime = manage.ClassesStartTime |
| | | detail.ClassesEndTime = manage.ClassesEndTime |
| | | detail.Classes = manage.Classes |
| | | as.Details[day-1] = detail |
| | | |
| | | m[manage.WorkerId] = as |
| | | } |