package com.xiaopeng.maintenance.controller;
|
|
|
import com.xiaopeng.api.model.maintenance.XpErrorType;
|
import com.xiaopeng.common.core.domain.R;
|
import com.xiaopeng.common.security.service.TokenService;
|
import com.xiaopeng.maintenance.dto.ClockDTO;
|
import com.xiaopeng.maintenance.dto.ShiftAttendanceDTO;
|
import com.xiaopeng.maintenance.dto.VerifyRangeDTO;
|
import com.xiaopeng.maintenance.service.IXpClockInService;
|
import com.xiaopeng.maintenance.vo.ShiftAttendanceVO;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* <p>
|
* 打卡明细 前端控制器
|
* </p>
|
*
|
* @author xiaochen
|
* @since 2026-02-06
|
*/
|
@Api(tags = "打卡明细")
|
@RestController
|
@RequestMapping("")
|
public class XpClockInController {
|
|
@Autowired
|
private IXpClockInService xpClockInService;
|
@Autowired
|
private TokenService tokenService;
|
@ApiOperation(value = "校验是否在打卡范围内", tags = "运维APP-排班与考勤")
|
@PostMapping("/api/v1/clock/verifyRange")
|
public R<Boolean> verifyRange(@RequestBody VerifyRangeDTO dto) {
|
return R.ok(xpClockInService.verifyRange(dto));
|
}
|
|
@ApiOperation(value = "上班打卡", tags = "运维APP-排班与考勤")
|
@PostMapping("/api/v1/clock/clockIn")
|
public R<String> clockIn(@RequestBody ClockDTO dto) {
|
Long id = tokenService.getLoginOperationUser().getId();
|
dto.setOperationsUserId(id);
|
return xpClockInService.clockIn(dto);
|
}
|
|
@ApiOperation(value = "下班打卡", tags = "运维APP-排班与考勤")
|
@PostMapping("/api/v1/clock/clockOut")
|
public R<String> clockOut(@RequestBody ClockDTO dto) {
|
Long id = tokenService.getLoginOperationUser().getId();
|
dto.setOperationsUserId(id);
|
return xpClockInService.clockOut(dto);
|
}
|
|
}
|