Fancy
2024-06-24 d8a629a6f847acd2accbf150b5a341a9a1aed2ae
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
package com.dy.pmsStation.workOrder;
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltProductionLine;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 生产任务认领控制器
 */
@Slf4j
@RestController
@RequestMapping(path = "workOrder")
public class WorkOrderCtrl {
    private WorkOrderSv sv;
    @Autowired
    public void setWorkOrderSv(WorkOrderSv workOrderSv) {
        this.sv = workOrderSv;
    }
    /**
     * 查询用户信息
     * @param
     * @return
     */
    @GetMapping(path="getUserInfo")
    public BaseResponse<BaUser> getUserInfo(String userId) throws Exception {
        BaUser userInfo  = sv.getUserInfo(userId);
        return BaseResponseUtils.buildSuccess(userInfo);
    }
    /**
     * 查询工站是否已经被占用
     * @param
     * @return
     */
    @GetMapping(path="getStationInfo")
    public BaseResponse<PltStation> getStationInfo(String stationId){
        PltStation stationInfo  = sv.getStationInfo(stationId);
        return BaseResponseUtils.buildSuccess(stationInfo);
    }
    /**
     * 查询工站是否已经被占用
     * @param
     * @return
     */
    @GetMapping(path="checkStationUsed")
    public BaseResponse<StaAssemblyWorkLast> checkStationUsed(QueryVo last){
        StaAssemblyWorkLast stationInfo  = sv.checkStationUsed(last);
        return BaseResponseUtils.buildSuccess(stationInfo);
    }
    /**
     * 查询全部执行中的组装任务清单
     * @param
     * @return
     */
    @GetMapping(path="planList")
    public BaseResponse<List<PrAssemblyPlan>> selectAssyPlanList(){
        PrAssemblyPlan params = new PrAssemblyPlan();
        params.setStatus(1);
        List<PrAssemblyPlan> list = sv.selectAssyPlanList(params);
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
     * 根据组装任务查询节点信息
     * @param
     * @return
     */
   /* @GetMapping(path="nodeList")
    public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(String processId){
        PrAssemblyPlan params = new PrAssemblyPlan();
        params.setStatus(1);
        List<PrAssemblyPlan> list = sv.selectList(params);
        return BaseResponseUtils.buildSuccess(list);
    }*/
    /**
     * 保存登录信息
     * @param
     * @return
     */
    @PostMapping(path="save")
    public BaseResponse<StaAssemblyWorkLast> save(@RequestBody @Valid QueryVo last){
        StaAssemblyWorkLast result = sv.save(last);
        return BaseResponseUtils.buildSuccess(result);
    }
 
    /**
     * 保存登出信息
     * @param
     * @return
     */
    @PostMapping(path="logout")
    public BaseResponse<Boolean> logout(String id){
        int count = sv.logout(id);
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
 
    @GetMapping(path = "test")
    public BaseResponse test() {
        log.info("test");
        return BaseResponseUtils.buildSuccess("test");
    }
}