yangys
2024-04-04 ed4a5236bab800094be4a8378f5098eebe3de6ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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);
    }
}