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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package com.qianwen.smartman.modules.andon.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.validation.Valid;
import com.qianwen.smartman.common.cache.RegionCache;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.mp.support.Query;
import com.qianwen.core.oss.model.BladeFile;
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.utils.Func;
import com.qianwen.smartman.modules.andon.service.IAndonCallRecordService;
import com.qianwen.smartman.modules.andon.service.IAndonRecordService;
import com.qianwen.smartman.modules.andon.vo.AndonCallRecordResVO;
import com.qianwen.smartman.modules.andon.vo.AndonCallRecordSearchVO;
import com.qianwen.smartman.modules.andon.vo.AndonFinishRecordVO;
import com.qianwen.smartman.modules.andon.vo.AndonReceiveEditRecordVO;
import com.qianwen.smartman.modules.andon.vo.AndonReceiveRecordVO;
import com.qianwen.smartman.modules.andon.vo.AndonRecordSearchVO;
import com.qianwen.smartman.modules.andon.vo.AndonRecordVO;
import com.qianwen.smartman.modules.andon.vo.HmiAndonVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Api(value = "安灯记录表管理", tags = {"安灯记录表管理"})
@ApiResource({"blade-andon/andon-record"})
@RestController
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/andon/controller/AndonRecordController.class */
public class AndonRecordController extends BladeController {
    private final IAndonRecordService andonRecordService;
    private final IAndonCallRecordService callRecordService;
 
    public AndonRecordController(final IAndonRecordService andonRecordService, final IAndonCallRecordService callRecordService) {
        this.andonRecordService = andonRecordService;
        this.callRecordService = callRecordService;
    }
 
    @ApiOperationSupport(order = 1)
    @PostResource({"/andon-page"})
    @ApiOperation(value = "安灯接收列表", notes = "PC安灯接收列表/手机端呼叫列表")
    public R<IPage<AndonRecordVO>> pageReceiveList(@Valid @RequestBody AndonRecordSearchVO andonRecordSearchVO, Query query) {
        return R.data(this.andonRecordService.pageReceiveList(andonRecordSearchVO, query));
    }
 
    @ApiOperationSupport(order = 2)
    @GetResource({"/andon-detail"})
    @ApiOperation(value = "安灯记录详情", notes = "PC安灯记录详情/HMI安灯记录详情")
    public R<AndonReceiveRecordVO> andonDetail(@RequestParam("id") String id) {
        return R.data(this.andonRecordService.receiveRecordDetail(id));
    }
 
    @ApiOperationSupport(order = 3)
    @PostResource({"/andon-batch-receive"})
    @ApiOperation(value = "安灯批量接收", notes = "PC安灯接收单个/多个")
    public R<Boolean> batchReceive(@RequestBody List<String> ids) {
        return R.data(this.andonRecordService.batchReceiveAndonRecord(Func.toLongList(ids)));
    }
 
    @ApiOperationSupport(order = 4)
    @GetResource({"/andon-del-record"})
    @ApiOperation(value = "删除安灯记录", notes = "hmi删除安灯待呼叫记录")
    public R<Boolean> delAndonRecord(@RequestParam("id") String id) {
        return R.data(this.andonRecordService.delReceiveAndonRecord(id));
    }
 
    @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL)
    @PostResource({"/andon-edit-record"})
    @ApiOperation(value = "编辑安灯记录", notes = "HMI编辑安灯待接收记录")
    public R<AndonReceiveRecordVO> editReceiveRecord(@RequestBody AndonReceiveEditRecordVO andonReceiveRecordVO) {
        return R.data(this.andonRecordService.editReceiveRecord(andonReceiveRecordVO));
    }
 
    @ApiOperationSupport(order = 6)
    @PostResource({"/andon-finish-record"})
    @ApiOperation(value = "完成安灯记录", notes = "hmi完成安灯呼叫")
    public R<Boolean> finishAndon(@RequestBody AndonFinishRecordVO andonFinishRecordVO) {
        return R.data(this.andonRecordService.toBeOrReceivedAndonRecord(andonFinishRecordVO));
    }
 
    @ApiOperationSupport(order = 7)
    @PostResource({"/andon-initiate-call"})
    @ApiOperation(value = "发起安灯呼叫", notes = "手机端/hmi发起安灯呼叫")
    public R<Boolean> initiateAndonCall(@RequestBody AndonReceiveRecordVO andonReceiveRecordVO) {
        return R.data(this.andonRecordService.initiateAndonCall(andonReceiveRecordVO));
    }
 
    @ApiOperationSupport(order = 8)
    @GetResource({"/hmi-device-andon-records"})
    @ApiOperation(value = "hmi工位对应的安灯记录", notes = "hmi设备对应安灯记录")
    public R<List<HmiAndonVO>> hmiWorkstationLoginAndon(@RequestParam("workstationId") String workstationId) {
        return R.data(this.andonRecordService.hmiWorkstationLoginAndon(workstationId));
    }
 
    @ApiOperationSupport(order = 9)
    @PostResource({"/page-query"})
    @ApiOperation("安灯呼叫确认记录")
    public R<IPage<AndonCallRecordResVO>> pageQueryRecord(@RequestBody AndonCallRecordSearchVO vo, Query query) {
        return R.data(this.callRecordService.pageQueryRecord(query, vo));
    }
 
    @ApiOperationSupport(order = 10)
    @PostResource({"/export-record"})
    @ApiOperation("导出安灯呼叫确认记录")
    @PreAuth
    public R<BladeFile> exportRecord(@RequestBody AndonCallRecordSearchVO vo) {
        return R.data(this.callRecordService.exportRecord(vo));
    }
}