|
|
@@ -1,6 +1,8 @@
|
|
|
package com.kingdee.eas.custom.integration.beisen.controller;
|
|
|
|
|
|
import com.kingdee.eas.custom.integration.base.annotation.ApiDoc;
|
|
|
+import com.kingdee.eas.custom.integration.base.annotation.SkipAuth;
|
|
|
+import com.kingdee.eas.custom.integration.base.annotation.SkipCallLog;
|
|
|
import com.kingdee.eas.custom.integration.base.controller.AbstractIntegrationController;
|
|
|
import com.kingdee.eas.custom.integration.base.dto.ApiResult;
|
|
|
import com.kingdee.eas.custom.integration.beisen.dto.AttendanceResponse;
|
|
|
@@ -16,9 +18,9 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
- * 北森考勤数据同步接口
|
|
|
+ * 北森考勤数据同步接口。
|
|
|
* 访问路径: /beisen/attendance/*
|
|
|
- * 无需登录认证(供北森系统回调)
|
|
|
+ * 无需登录认证(供北森系统回调)。
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/beisen/attendance")
|
|
|
@@ -28,11 +30,12 @@ public class BeisenAttendanceController extends AbstractIntegrationController {
|
|
|
private AttendanceService attendanceService;
|
|
|
|
|
|
/**
|
|
|
- * 健康检查接口
|
|
|
- * GET /beisen/attendance/health
|
|
|
+ * 健康检查接口。
|
|
|
*/
|
|
|
+ @SkipAuth
|
|
|
+ @SkipCallLog
|
|
|
@RequestMapping("/health")
|
|
|
- @ApiDoc(name = "健康检查接口", desc = "测试接口")
|
|
|
+ @ApiDoc(name = "健康检查接口", desc = "服务探活接口")
|
|
|
public Map<String, Object> health() {
|
|
|
Map<String, Object> result = new LinkedHashMap<>();
|
|
|
result.put("status", "UP");
|
|
|
@@ -42,13 +45,15 @@ public class BeisenAttendanceController extends AbstractIntegrationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 考勤日报批量写入接口
|
|
|
- * POST /beisen/attendance/daily
|
|
|
+ * 考勤日报批量写入接口。
|
|
|
+ * 单次上限 200 条,超出抛 IntegrationException。
|
|
|
*/
|
|
|
@PostMapping("/daily")
|
|
|
- @ApiDoc(name = "考勤日报批量写入接口", desc = "批量写入考勤日报数据")
|
|
|
+ @ApiDoc(name = "考勤日报批量写入", desc = "接收北森系统推送的考勤日报数据,支持批量写入")
|
|
|
public ApiResult<AttendanceResponse> writeDaily(@RequestBody BatchAttendanceRequest request) {
|
|
|
requireNotEmpty(request.getRecords(), "records");
|
|
|
+ requireTrue(request.getRecords().size() <= 200,
|
|
|
+ "单次写入记录数不能超过200条,当前: " + request.getRecords().size());
|
|
|
|
|
|
log.info("收到考勤日报批量写入请求 - 记录数: {}", request.getRecords().size());
|
|
|
|
|
|
@@ -57,12 +62,16 @@ public class BeisenAttendanceController extends AbstractIntegrationController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 考勤月报批量写入接口
|
|
|
- * POST /beisen/attendance/monthly
|
|
|
+ * 考勤月报批量写入接口。
|
|
|
+ * 单次上限 200 条,超出抛 IntegrationException。
|
|
|
*/
|
|
|
@PostMapping("/monthly")
|
|
|
- @ApiDoc(name = "考勤月报批量写入接口", desc = "批量写入考勤月报数据")
|
|
|
+ @ApiDoc(name = "考勤月报批量写入", desc = "接收北森系统推送的考勤月报数据,支持批量写入")
|
|
|
public ApiResult<AttendanceResponse> writeMonthly(@RequestBody BatchAttendanceRequest request) {
|
|
|
+ requireNotEmpty(request.getRecords(), "records");
|
|
|
+ requireTrue(request.getRecords().size() <= 200,
|
|
|
+ "单次写入记录数不能超过200条,当前: " + request.getRecords().size());
|
|
|
+
|
|
|
log.info("收到考勤月报批量写入请求 - 记录数: {}",
|
|
|
request.getRecords() != null ? request.getRecords().size() : 0);
|
|
|
|