From 611dd8268e40caa4d97e8954b85b5adaaef99afa Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期一, 26 十月 2026 17:45:58 +0800
Subject: [PATCH] feat(hrm): 考勤规则支持地图定位打卡
---
src/api/hrm/attendance/record/index.ts | 70 ++++++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 1 deletions(-)
diff --git a/src/api/hrm/attendance/record/index.ts b/src/api/hrm/attendance/record/index.ts
index 7852fa8..4ca4bb5 100644
--- a/src/api/hrm/attendance/record/index.ts
+++ b/src/api/hrm/attendance/record/index.ts
@@ -10,6 +10,7 @@
userName?: string;
deptId?: number;
deptName?: string;
+ phone?: string;
date?: string;
clockInTime?: string;
clockOutTime?: string;
@@ -20,6 +21,26 @@
workHours?: number;
overtimeHours?: number;
location?: string;
+ /** 涓婄彮鎵撳崱缁忓害锛圵GS84锛� */
+ clockInLongitude?: number;
+ /** 涓婄彮鎵撳崱绾害锛圵GS84锛� */
+ clockInLatitude?: number;
+ /** 涓婄彮瀹氫綅绮惧害锛岀背 */
+ clockInAccuracy?: number;
+ /** 涓婄彮璺濇墦鍗″湴鐐硅窛绂伙紝绫� */
+ clockInDistance?: number;
+ /** 涓婄彮鎵撳崱鍦扮偣鍦板潃蹇収 */
+ clockInAddress?: string;
+ /** 涓嬬彮鎵撳崱缁忓害锛圵GS84锛� */
+ clockOutLongitude?: number;
+ /** 涓嬬彮鎵撳崱绾害锛圵GS84锛� */
+ clockOutLatitude?: number;
+ /** 涓嬬彮瀹氫綅绮惧害锛岀背 */
+ clockOutAccuracy?: number;
+ /** 涓嬬彮璺濇墦鍗″湴鐐硅窛绂伙紝绫� */
+ clockOutDistance?: number;
+ /** 涓嬬彮鎵撳崱鍦扮偣鍦板潃蹇収 */
+ clockOutAddress?: string;
dataSource?: number;
dataSourceName?: string;
remark?: string;
@@ -39,6 +60,23 @@
overtimeHours?: number;
totalWorkHours?: number;
}
+}
+
+/** 瀹氫綅鎵撳崱鍧愭爣锛屽悗绔粎鎺ュ彈 WGS84 */
+export interface AttendanceClockLocation {
+ longitude: number;
+ latitude: number;
+ accuracy: number;
+ coordinateSystem: 'WGS84';
+}
+
+/** 瀹氫綅鎵撳崱缁撴灉锛涙湭鍚敤瀹氫綅鑼冨洿鏍¢獙鏃讹紝璺濈涓庡崐寰勪负绌� */
+export interface AttendanceClockResponse {
+ record?: HrmAttendanceRecordApi.AttendanceRecord;
+ locationName?: string;
+ distanceMeters?: number;
+ radiusMeters?: number;
+ withinRange?: boolean;
}
/** 鏌ヨ鑰冨嫟璁板綍鍒嗛〉鍒楄〃 */
@@ -77,4 +115,34 @@
/** 瀵煎嚭鑰冨嫟璁板綍 */
export function exportAttendanceRecord(params: any) {
return requestClient.download('/hrm/attendance/record/export-excel', { params });
-}
\ No newline at end of file
+}
+
+/**
+ * 涓婄彮鎵撳崱
+ *
+ * 鍚屾椂鎻愪氦瀹氫綅锛圝SON body锛変笌鏃х増鍦扮偣鏂囨湰锛坬uery 鍙傛暟锛夛細
+ * - 鏂板悗绔寜瀹氫綅鏍¢獙鎵撳崱鑼冨洿锛屾湭鍚敤瀹氫綅鏃跺拷鐣ュ畾浣嶏紱
+ * - 鏃у悗绔彧璇诲彇 location 鍙傛暟锛屼繚璇佸崌绾у墠鍚庨兘鑳芥甯告墦鍗°��
+ */
+export function clockIn(
+ data?: AttendanceClockLocation | null,
+ location?: string,
+) {
+ return requestClient.post<AttendanceClockResponse>(
+ '/hrm/attendance/record/clock-in',
+ data ?? null,
+ location ? { params: { location } } : undefined,
+ );
+}
+
+/** 涓嬬彮鎵撳崱锛屽弬鏁拌鏄庡悓 clockIn */
+export function clockOut(
+ data?: AttendanceClockLocation | null,
+ location?: string,
+) {
+ return requestClient.post<AttendanceClockResponse>(
+ '/hrm/attendance/record/clock-out',
+ data ?? null,
+ location ? { params: { location } } : undefined,
+ );
+}
--
Gitblit v1.9.3