package com.qianwen.smartman.modules.perf.controller;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import java.util.List;
|
import com.qianwen.smartman.common.cache.RegionCache;
|
import com.qianwen.core.boot.ctrl.BladeController;
|
import com.qianwen.core.scanner.modular.annotation.GetResource;
|
import com.qianwen.core.scanner.modular.annotation.PostResource;
|
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
|
import com.qianwen.core.secure.annotation.PreAuth;
|
import com.qianwen.core.tool.api.R;
|
import com.qianwen.core.tool.api.ResultCode;
|
import com.qianwen.smartman.modules.cps.vo.EmployeeVO;
|
import com.qianwen.smartman.modules.cps.vo.GroupTreeVO;
|
import com.qianwen.smartman.modules.perf.service.IEmployeeOnOffWorkService;
|
import com.qianwen.smartman.modules.perf.vo.BatchOnWorkVO;
|
import com.qianwen.smartman.modules.perf.vo.EmployeeWorkStatusVO;
|
import com.qianwen.smartman.modules.perf.vo.OffEmployeeTreeVO;
|
import com.qianwen.smartman.modules.perf.vo.QueryWorkStatusVO;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
@Api(value = "员工上下线", tags = {"员工上下线controller"})
|
@ApiResource({"blade-perf/on-off-work"})
|
@RestController
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/perf/controller/EmployeeOnOffWorkController.class */
|
public class EmployeeOnOffWorkController extends BladeController {
|
private final IEmployeeOnOffWorkService onOffWorkService;
|
|
public EmployeeOnOffWorkController(final IEmployeeOnOffWorkService onOffWorkService) {
|
this.onOffWorkService = onOffWorkService;
|
}
|
|
@ApiOperationSupport(order = 1)
|
@PostResource({"/work-status"})
|
@ApiOperation("查看工位当前上下线状态")
|
@PreAuth
|
public R<List<EmployeeWorkStatusVO>> allWorkstationStatus(@RequestBody QueryWorkStatusVO vo) {
|
return R.data(this.onOffWorkService.allWorkstationStatus(vo));
|
}
|
|
@ApiOperationSupport(order = 2)
|
@ApiOperation("要上线的工位树")
|
@GetResource({"/will-on-work"})
|
@PreAuth
|
public R<List<GroupTreeVO>> willOnWork() {
|
return R.data(this.onOffWorkService.willOnWork());
|
}
|
|
@ApiOperationSupport(order = 3)
|
@ApiOperation("要下线的工位树")
|
@GetResource({"/will-off-work"})
|
@PreAuth
|
public R<List<OffEmployeeTreeVO>> willOffWork() {
|
return R.data(this.onOffWorkService.willOffWork());
|
}
|
|
@ApiOperationSupport(order = 4)
|
@ApiOperation("当前账号绑定的员工")
|
@GetResource({"/current-employee"})
|
@PreAuth
|
public R<EmployeeVO> currentEmployee() {
|
return R.data(this.onOffWorkService.currentEmployee());
|
}
|
|
@ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL)
|
@PostResource({"/batch-on-off-work"})
|
@ApiOperation("批量工位上下线")
|
public R<Boolean> batchOnOffWorkstation(@RequestBody BatchOnWorkVO vo) {
|
return R.data(this.onOffWorkService.batchOnOffWorkstation(vo));
|
}
|
|
@ApiOperationSupport(order = 6)
|
@PostResource({"/current-login"})
|
@ApiOperation("当前员工/其他员工已上线当前工位")
|
public R<Void> currentEmployeeWork(@RequestParam("employeeId") String employeeId, @RequestParam("workstationId") String workstationId) {
|
this.onOffWorkService.currentEmployeeWork(employeeId, workstationId);
|
return R.success(ResultCode.SUCCESS);
|
}
|
}
|