自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-04-08 b34b41f262e179448e1b4c6f592936ae0cbd130f
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
package com.zy.asrs.controller;
 
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.Order;
import com.zy.asrs.entity.param.OpenOrderPakinParam;
import com.zy.asrs.service.OrderDetlService;
import com.zy.asrs.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * Created by vincent on 2022/4/8
 */
@RestController
@RequestMapping("open/asrs/")
public class OpenController {
 
    @Autowired
    private OrderService orderService;
    @Autowired
    private OrderDetlService orderDetlService;
 
    /**
     * 添加入库单
     */
    @PostMapping("order/pakin/default/v1")
    public synchronized R orderCreate(@RequestBody OpenOrderPakinParam param) {
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        if (Cools.isEmpty(param.getOrderNo())) {
            return R.error("单据编号[orderNo]不能为空");
        }
        if (Cools.isEmpty(param.getOrderType())) {
            return R.error("单据类型[orderType]错误");
        }
        if (Cools.isEmpty(param.getOrderDetails())) {
            return R.error("单据明细[orderDetails]不能为空");
        }
        Order order = orderService.selectByNo(param.getOrderNo());
        if (!Cools.isEmpty(order)) {
            return R.error(param.getOrderNo() + "单据已存在,请勿重复提交");
        }
 
        return R.ok();
    }
 
 
}