| | |
| | | "github.com/xuri/excelize/v2" |
| | | "silkserver/constvar" |
| | | "silkserver/controllers/request" |
| | | "silkserver/controllers/response" |
| | | "silkserver/extend/code" |
| | | "silkserver/extend/util" |
| | | "silkserver/middleware" |
| | | "silkserver/models" |
| | | "silkserver/pkg/logx" |
| | | "silkserver/pkg/timex" |
| | | "strings" |
| | | "time" |
| | | ) |
| | | |
| | |
| | | util.ResponseFormatList(c, code.Success, manages, total) |
| | | } |
| | | |
| | | // GetAttendanceStatistic |
| | | // |
| | | // @Tags 考勤管理 |
| | | // @Summary 获取考勤统计 |
| | | // @Produce application/json |
| | | // @Param object body request.GetAttendanceStatistic true "参数" |
| | | // @Param Authorization header string true "token" |
| | | // @Success 200 {object} util.Response{data=response.AttendanceList} "成功" |
| | | // @Router /api-jl/v1/attendance/getAttendanceStatistic [post] |
| | | func (slf AttendanceController) GetAttendanceStatistic(c *gin.Context) { |
| | | var params request.GetAttendanceStatistic |
| | | err := c.BindJSON(¶ms) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | if params.Month == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数不能为空") |
| | | return |
| | | } |
| | | manages, err := models.NewAttendanceManageSearch().SetMonth(params.Month).SetPreload(true).FindNotTotal() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err) |
| | | return |
| | | } |
| | | m := make(map[string]response.AttendanceStatistic) |
| | | for _, manage := range manages { |
| | | var as response.AttendanceStatistic |
| | | if _, ok := m[manage.WorkerId]; ok { |
| | | as = m[manage.WorkerId] |
| | | } else { |
| | | as.WorkerId = manage.WorkerId |
| | | as.WorkerName = manage.WorkerName |
| | | as.WorkType = manage.WorkType.WorkName |
| | | as.Month = params.Month |
| | | } |
| | | as.WeekdayOverTime = as.WeekdayOverTime.Add(manage.OverTimeDuration) |
| | | as.ActualAttendanceDays = as.ActualAttendanceDays + 1 |
| | | var ad response.AttendanceDetail |
| | | ad.Date = strings.ReplaceAll(manage.Date, params.Month+"-", "") |
| | | ad.Status = manage.Status |
| | | as.Details = append(as.Details, ad) |
| | | |
| | | m[manage.WorkerId] = as |
| | | } |
| | | var list response.AttendanceList |
| | | for _, statistic := range m { |
| | | list.List = append(list.List, statistic) |
| | | } |
| | | |
| | | util.ResponseFormat(c, code.Success, list) |
| | | } |
| | | |
| | | // DeleteAttendanceInfo |
| | | // |
| | | // @Tags 考勤管理 |
| | |
| | | type DeleteAttendanceInfo struct { |
| | | Ids []uint `json:"ids"` //记录id |
| | | } |
| | | |
| | | type GetAttendanceStatistic struct { |
| | | Month string `json:"month"` //月份 |
| | | } |
New file |
| | |
| | | package response |
| | | |
| | | import ( |
| | | "github.com/shopspring/decimal" |
| | | "silkserver/constvar" |
| | | ) |
| | | |
| | | type AttendanceList struct { |
| | | List []AttendanceStatistic `json:"list"` |
| | | } |
| | | |
| | | type AttendanceStatistic struct { |
| | | WorkerId string `json:"workerId"` //人员id |
| | | WorkerName string `json:"workerName"` //人员姓名 |
| | | WorkType string `json:"workType"` //工种 |
| | | Month string `json:"month"` //月份 |
| | | WeekdayOverTime decimal.Decimal `json:"weekdayOverTime"` //工作日加班时长 |
| | | RestDayOverTime decimal.Decimal `json:"restDayOverTime"` //休息日加班时长 |
| | | RequiredAttendanceDays int `json:"requiredAttendanceDays"` //应出勤天数 |
| | | ActualAttendanceDays int `json:"actualAttendanceDays"` //实际出勤天数 |
| | | Details []AttendanceDetail `json:"details"` //详情 |
| | | } |
| | | |
| | | type AttendanceDetail struct { |
| | | Date string `json:"date"` //日期 |
| | | Status constvar.AttendanceStatus `json:"status"` //状态 |
| | | } |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "名称为空") |
| | | return |
| | | } |
| | | err = models.NewWorkerSearch().Create(¶ms) |
| | | err = models.NewWorkerSearch().Save(¶ms) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "更新失败") |
| | | return |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/getAttendanceRule": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "获取加班规则", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/getAttendanceStatistic": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "获取考勤统计", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetAttendanceStatistic" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.AttendanceList" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/saveAttendanceRule": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "保存加班规则", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/models.AttendanceRule" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/changeYieldRegister": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | }, |
| | | "definitions": { |
| | | "constvar.AttendanceStatus": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3, |
| | | 4 |
| | | ], |
| | | "x-enum-comments": { |
| | | "Abnormal": "异常", |
| | | "Normal": "正常", |
| | | "Overtime": "加班", |
| | | "Vacation": "休假" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "Normal", |
| | | "Overtime", |
| | | "Vacation", |
| | | "Abnormal" |
| | | ] |
| | | }, |
| | | "constvar.CarFlag": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "overTimeDuration": { |
| | | "type": "number" |
| | | }, |
| | | "startWorkTime": { |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "$ref": "#/definitions/constvar.AttendanceStatus" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "workType": { |
| | | "$ref": "#/definitions/models.WorkTypeManage" |
| | | }, |
| | | "workTypeId": { |
| | | "type": "integer" |
| | | }, |
| | | "workerId": { |
| | | "type": "string" |
| | | }, |
| | | "workerName": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.AttendanceRule": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "overTimeStart": { |
| | | "type": "number" |
| | | }, |
| | | "restDayRule": { |
| | | "type": "integer" |
| | | }, |
| | | "restDayStart": { |
| | | "type": "number" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "weekdayRule": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "ids": { |
| | | "description": "记录id", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetAttendanceStatistic": { |
| | | "type": "object", |
| | | "properties": { |
| | | "month": { |
| | | "description": "月份", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceDetail": { |
| | | "type": "object", |
| | | "properties": { |
| | | "date": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.AttendanceStatus" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "list": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.AttendanceStatistic" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceStatistic": { |
| | | "type": "object", |
| | | "properties": { |
| | | "actualAttendanceDays": { |
| | | "description": "实际出勤天数", |
| | | "type": "integer" |
| | | }, |
| | | "details": { |
| | | "description": "详情", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.AttendanceDetail" |
| | | } |
| | | }, |
| | | "month": { |
| | | "description": "月份", |
| | | "type": "string" |
| | | }, |
| | | "requiredAttendanceDays": { |
| | | "description": "应出勤天数", |
| | | "type": "integer" |
| | | }, |
| | | "restDayOverTime": { |
| | | "description": "休息日加班时长", |
| | | "type": "number" |
| | | }, |
| | | "weekdayOverTime": { |
| | | "description": "工作日加班时长", |
| | | "type": "number" |
| | | }, |
| | | "workType": { |
| | | "description": "工种", |
| | | "type": "string" |
| | | }, |
| | | "workerId": { |
| | | "description": "人员id", |
| | | "type": "string" |
| | | }, |
| | | "workerName": { |
| | | "description": "人员姓名", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.CarAndLevel": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/getAttendanceRule": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "获取加班规则", |
| | | "parameters": [ |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/getAttendanceStatistic": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "获取考勤统计", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.GetAttendanceStatistic" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/response.AttendanceList" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/attendance/saveAttendanceRule": { |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "考勤管理" |
| | | ], |
| | | "summary": "保存加班规则", |
| | | "parameters": [ |
| | | { |
| | | "description": "参数", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/models.AttendanceRule" |
| | | } |
| | | }, |
| | | { |
| | | "type": "string", |
| | | "description": "token", |
| | | "name": "Authorization", |
| | | "in": "header", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-jl/v1/fineness/changeYieldRegister": { |
| | | "post": { |
| | | "produces": [ |
| | |
| | | } |
| | | }, |
| | | "definitions": { |
| | | "constvar.AttendanceStatus": { |
| | | "type": "integer", |
| | | "enum": [ |
| | | 1, |
| | | 2, |
| | | 3, |
| | | 4 |
| | | ], |
| | | "x-enum-comments": { |
| | | "Abnormal": "异常", |
| | | "Normal": "正常", |
| | | "Overtime": "加班", |
| | | "Vacation": "休假" |
| | | }, |
| | | "x-enum-varnames": [ |
| | | "Normal", |
| | | "Overtime", |
| | | "Vacation", |
| | | "Abnormal" |
| | | ] |
| | | }, |
| | | "constvar.CarFlag": { |
| | | "type": "integer", |
| | | "enum": [ |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "overTimeDuration": { |
| | | "type": "number" |
| | | }, |
| | | "startWorkTime": { |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "$ref": "#/definitions/constvar.AttendanceStatus" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "workType": { |
| | | "$ref": "#/definitions/models.WorkTypeManage" |
| | | }, |
| | | "workTypeId": { |
| | | "type": "integer" |
| | | }, |
| | | "workerId": { |
| | | "type": "string" |
| | | }, |
| | | "workerName": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.AttendanceRule": { |
| | | "type": "object", |
| | | "properties": { |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "overTimeStart": { |
| | | "type": "number" |
| | | }, |
| | | "restDayRule": { |
| | | "type": "integer" |
| | | }, |
| | | "restDayStart": { |
| | | "type": "number" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "weekdayRule": { |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "ids": { |
| | | "description": "记录id", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "integer" |
| | |
| | | "pageSize": { |
| | | "description": "每页大小", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | | "request.GetAttendanceStatistic": { |
| | | "type": "object", |
| | | "properties": { |
| | | "month": { |
| | | "description": "月份", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceDetail": { |
| | | "type": "object", |
| | | "properties": { |
| | | "date": { |
| | | "description": "日期", |
| | | "type": "string" |
| | | }, |
| | | "status": { |
| | | "description": "状态", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.AttendanceStatus" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "list": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.AttendanceStatistic" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "response.AttendanceStatistic": { |
| | | "type": "object", |
| | | "properties": { |
| | | "actualAttendanceDays": { |
| | | "description": "实际出勤天数", |
| | | "type": "integer" |
| | | }, |
| | | "details": { |
| | | "description": "详情", |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/response.AttendanceDetail" |
| | | } |
| | | }, |
| | | "month": { |
| | | "description": "月份", |
| | | "type": "string" |
| | | }, |
| | | "requiredAttendanceDays": { |
| | | "description": "应出勤天数", |
| | | "type": "integer" |
| | | }, |
| | | "restDayOverTime": { |
| | | "description": "休息日加班时长", |
| | | "type": "number" |
| | | }, |
| | | "weekdayOverTime": { |
| | | "description": "工作日加班时长", |
| | | "type": "number" |
| | | }, |
| | | "workType": { |
| | | "description": "工种", |
| | | "type": "string" |
| | | }, |
| | | "workerId": { |
| | | "description": "人员id", |
| | | "type": "string" |
| | | }, |
| | | "workerName": { |
| | | "description": "人员姓名", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "response.CarAndLevel": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | definitions: |
| | | constvar.AttendanceStatus: |
| | | enum: |
| | | - 1 |
| | | - 2 |
| | | - 3 |
| | | - 4 |
| | | type: integer |
| | | x-enum-comments: |
| | | Abnormal: 异常 |
| | | Normal: 正常 |
| | | Overtime: 加班 |
| | | Vacation: 休假 |
| | | x-enum-varnames: |
| | | - Normal |
| | | - Overtime |
| | | - Vacation |
| | | - Abnormal |
| | | constvar.CarFlag: |
| | | enum: |
| | | - 1 |
| | |
| | | type: string |
| | | id: |
| | | type: integer |
| | | overTimeDuration: |
| | | type: number |
| | | startWorkTime: |
| | | type: string |
| | | status: |
| | | $ref: '#/definitions/constvar.AttendanceStatus' |
| | | updatedAt: |
| | | type: string |
| | | workType: |
| | | $ref: '#/definitions/models.WorkTypeManage' |
| | | workTypeId: |
| | | type: integer |
| | | workerId: |
| | | type: string |
| | | workerName: |
| | | type: string |
| | | type: object |
| | | models.AttendanceRule: |
| | | properties: |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | $ref: '#/definitions/gorm.DeletedAt' |
| | | id: |
| | | type: integer |
| | | overTimeStart: |
| | | type: number |
| | | restDayRule: |
| | | type: integer |
| | | restDayStart: |
| | | type: number |
| | | updatedAt: |
| | | type: string |
| | | weekdayRule: |
| | | type: integer |
| | | type: object |
| | | models.Dict: |
| | | properties: |
| | |
| | | request.DeleteAttendanceInfo: |
| | | properties: |
| | | ids: |
| | | description: 记录id |
| | | items: |
| | | type: integer |
| | | type: array |
| | |
| | | pageSize: |
| | | description: 每页大小 |
| | | type: integer |
| | | type: object |
| | | request.GetAttendanceStatistic: |
| | | properties: |
| | | month: |
| | | description: 月份 |
| | | type: string |
| | | type: object |
| | | request.GetMentorList: |
| | | properties: |
| | |
| | | description: 产量登记表id |
| | | type: integer |
| | | type: object |
| | | response.AttendanceDetail: |
| | | properties: |
| | | date: |
| | | description: 日期 |
| | | type: string |
| | | status: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.AttendanceStatus' |
| | | description: 状态 |
| | | type: object |
| | | response.AttendanceList: |
| | | properties: |
| | | list: |
| | | items: |
| | | $ref: '#/definitions/response.AttendanceStatistic' |
| | | type: array |
| | | type: object |
| | | response.AttendanceStatistic: |
| | | properties: |
| | | actualAttendanceDays: |
| | | description: 实际出勤天数 |
| | | type: integer |
| | | details: |
| | | description: 详情 |
| | | items: |
| | | $ref: '#/definitions/response.AttendanceDetail' |
| | | type: array |
| | | month: |
| | | description: 月份 |
| | | type: string |
| | | requiredAttendanceDays: |
| | | description: 应出勤天数 |
| | | type: integer |
| | | restDayOverTime: |
| | | description: 休息日加班时长 |
| | | type: number |
| | | weekdayOverTime: |
| | | description: 工作日加班时长 |
| | | type: number |
| | | workType: |
| | | description: 工种 |
| | | type: string |
| | | workerId: |
| | | description: 人员id |
| | | type: string |
| | | workerName: |
| | | description: 人员姓名 |
| | | type: string |
| | | type: object |
| | | response.CarAndLevel: |
| | | properties: |
| | | car: |
| | |
| | | summary: 获取考勤列表 |
| | | tags: |
| | | - 考勤管理 |
| | | /api-jl/v1/attendance/getAttendanceRule: |
| | | get: |
| | | parameters: |
| | | - description: token |
| | | in: header |
| | | name: Authorization |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 获取加班规则 |
| | | tags: |
| | | - 考勤管理 |
| | | /api-jl/v1/attendance/getAttendanceStatistic: |
| | | post: |
| | | parameters: |
| | | - description: 参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.GetAttendanceStatistic' |
| | | - description: token |
| | | in: header |
| | | name: Authorization |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/response.AttendanceList' |
| | | type: object |
| | | summary: 获取考勤统计 |
| | | tags: |
| | | - 考勤管理 |
| | | /api-jl/v1/attendance/saveAttendanceRule: |
| | | post: |
| | | parameters: |
| | | - description: 参数 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/models.AttendanceRule' |
| | | - description: token |
| | | in: header |
| | | name: Authorization |
| | | required: true |
| | | type: string |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 保存加班规则 |
| | | tags: |
| | | - 考勤管理 |
| | | /api-jl/v1/fineness/changeYieldRegister: |
| | | post: |
| | | parameters: |
| | |
| | | PageSize int |
| | | Preload bool |
| | | Ids []uint |
| | | Month string |
| | | Orm *gorm.DB |
| | | } |
| | | ) |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *AttendanceManageSearch) SetMonth(month string) *AttendanceManageSearch { |
| | | slf.Month = month |
| | | return slf |
| | | } |
| | | |
| | | func (slf *AttendanceManageSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Table(slf.TableName()) |
| | | |
| | |
| | | db = db.Model(&AttendanceManage{}).Preload("WorkType") |
| | | } |
| | | |
| | | if slf.Month != "" { |
| | | db = db.Where("date like ?", slf.Month+"%") |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |
| | |
| | | attendanceApi := r.Group(urlPrefix + "/attendance") |
| | | attendanceController := new(controllers.AttendanceController) |
| | | { |
| | | attendanceApi.POST("attendanceInput", attendanceController.AttendanceInput) //考勤导入 |
| | | attendanceApi.POST("getAttendanceList", attendanceController.GetAttendanceList) //获取考勤列表 |
| | | attendanceApi.DELETE("deleteAttendanceInfo", attendanceController.DeleteAttendanceInfo) //删除考勤信息 |
| | | attendanceApi.GET("getAttendanceRule", attendanceController.GetAttendanceRule) //获取加班规则 |
| | | attendanceApi.POST("saveAttendanceRule", attendanceController.SaveAttendanceRule) //保存加班规则 |
| | | attendanceApi.POST("attendanceInput", attendanceController.AttendanceInput) //考勤导入 |
| | | attendanceApi.POST("getAttendanceList", attendanceController.GetAttendanceList) //获取考勤列表 |
| | | attendanceApi.POST("getAttendanceStatistic", attendanceController.GetAttendanceStatistic) //获取考勤统计 |
| | | attendanceApi.DELETE("deleteAttendanceInfo", attendanceController.DeleteAttendanceInfo) //删除考勤信息 |
| | | attendanceApi.GET("getAttendanceRule", attendanceController.GetAttendanceRule) //获取加班规则 |
| | | attendanceApi.POST("saveAttendanceRule", attendanceController.SaveAttendanceRule) //保存加班规则 |
| | | } |
| | | |
| | | mentorApi := r.Group(urlPrefix + "/mentor") |