pjb
2025-03-13 19e6e3559842d23fc5bd4f28a688dd8c2c747d4b
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package com.zy.asrs.wms.apis.wcs.controller;
 
import com.mysql.cj.util.StringUtils;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.apis.wcs.entity.request.RfidSingalRequest;
import com.zy.asrs.wms.apis.wcs.entity.response.CommonReponse;
import com.zy.asrs.wms.apis.wcs.services.WaveManagentService;
import com.zy.asrs.wms.asrs.entity.param.WaveSeedReviewParam;
import com.zy.asrs.wms.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Map;
import java.util.Objects;
 
/**
 * 大屏操作基本功能
 */
@RestController
@RequestMapping("/wave")
public class WaveManagentController extends BaseController {
 
    @Autowired
    private WaveManagentService waveManagentService;
 
    /***
     * 获取处于播种状态的任务单据
     * @return
     */
    @GetMapping("/sow/seeds")
    public R sowSeeds() {
      return  waveManagentService.getSowSeeds();
    }
 
 
    /**
     * 通过任务号拉取任务明细
     * @param taskNo
     * @return
     */
    @GetMapping("/sow/task/detl/{taskNo}")
    public R getTaskDetl(@PathVariable String taskNo) {
        if (StringUtils.isNullOrEmpty(taskNo)) {
            throw new CoolException("任务编码不能为空!!");
        }
        return waveManagentService.getTaskDetl(taskNo);
    }
 
 
    /**
     * 大屏获取任务明细
     * 获取当前播种中具体任务明细
     * @param param
     * @return
     */
    @PostMapping("/task/detl/qutify")
    public R getTaskDetlQutify(@RequestBody Map<String, Object> param) {
        if (Objects.isNull(param)) {
            throw new CoolException("参数不能为空!!");
        }
        if (Objects.isNull(param.get("taskNo"))) {
            throw new CoolException("请求参数:任务编码不能为空!!");
        }
        String taskNoStr = (String) param.get("taskNo");
//        Long matnr = Long.valueOf(taskNo.get("matnr").toString());
 
        return waveManagentService.getTaskDetlQutify(taskNoStr);
    }
 
    /**
     * 获取当前播种墙库位信息
     * @return
     */
    @GetMapping("/seed/locs")
    public R getSeedLoc() {
        return waveManagentService.AllSeedLocs();
    }
 
    /***
     * 大屏获取出库列表
     * 获取当前播种中执行数据
     * @return
     */
    @GetMapping("/sow/tasks")
    public R getTasks() {
        return waveManagentService.getTask();
    }
 
    /**
     * 波次播种
     * 播种明细数量修改
     * @param reviewParam
     * @return
     */
    @PostMapping("/sow/review")
    public R reviewSeeds(@RequestBody WaveSeedReviewParam reviewParam) {
        if (Objects.isNull(reviewParam)) {
            return R.error("播种参数不能为空!!");
        }
        if (Objects.isNull(reviewParam.getReviewNum())) {
            return R.error("播种数量不能为空!!");
        }
        if (Objects.isNull(reviewParam.getWaveSeedId())) {
            return R.error("播种明细标识不能为空!!");
        }
        return waveManagentService.reviewSeeds(reviewParam);
    }
 
    /**
     * 删除播种
     * @param id
     * @return
     */
    @GetMapping("/sow/remove/{id}")
    public R delSowSeeds(@PathVariable Long id) {
         if (waveManagentService.removeSowSeed(id) > 0) {
             return R.ok("删除成功!!");
         } else {
             return R.error("删除失败!!");
         }
    }
 
    /**
     * 大屏获取波次所有订单信息
     * @param waveNo
     * @return
     */
    @GetMapping("/orders/{waveNo}")
    public R getWaveOrders(@PathVariable String waveNo) {
        if (StringUtils.isNullOrEmpty(waveNo)) {
            return R.error("波次编码不能为空!!!");
        }
        return waveManagentService.getAllOrders(waveNo);
    }
 
 
 
 
}