Blame view

src/main/java/com/huaheng/api/general/controller/ReceiptApiController.java 3.96 KB
pengcheng authored
1
2
3
4
5
package com.huaheng.api.general.controller;


import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.service.ReceiptApiService;
6
import com.huaheng.api.general.service.ReceiptContainerApiService;
周峰 authored
7
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
pengcheng authored
8
9
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
10
import com.huaheng.framework.web.controller.BaseController;
pengcheng authored
11
12
13
14
15
16
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
lector authored
17
import java.util.List;
pengcheng authored
18
19
20

@RestController
@RequestMapping("/api/receiptApi")
xqs authored
21
@Api(tags = {"入库单接口"}, value = "入库单接口receipt")
22
public class ReceiptApiController extends BaseController{
pengcheng authored
23
24
25

    @Resource
    private ReceiptApiService receiptApiService;
26
    @Resource
27
    private ReceiptContainerApiService receiptContainerApiService;
pengcheng authored
28
29
30
31
32
33
34
35

    /**
     * 同步入库单
     */
    @Log(title = "入库单添加", action = BusinessType.INSERT)
    @PostMapping("/receipt")
    @ApiOperation("入库单添加公共接口")
    @ResponseBody
周峰 authored
36
    @ApiLogger(apiName = "添加入库单", from="ERP")
游杰 authored
37
    public AjaxResult receipt(@RequestBody ReceiptDomain receiptDomain)
pengcheng authored
38
    {
39
40
41
42
43
44
45
        AjaxResult ajaxResult = handleMultiProcess(new BaseController.MultiProcessListener() {
            @Override
            public AjaxResult doProcess() {
                AjaxResult ajaxResult = receiptApiService.receipt(receiptDomain);
                return ajaxResult;
            }
        });
pengcheng authored
46
47
48
        return ajaxResult;
    }
49
50
51
52
53
54
55
56
57
58
    /**
     * 入库组盘
     */
    @Log(title = "入库单组盘", action = BusinessType.INSERT)
    @PostMapping("/receiptContainer")
    @ApiOperation("添加入库组盘公共接口")
    @ResponseBody
    @ApiLogger(apiName = "添加入库组盘", from="ERP")
    public AjaxResult receiptContainer(@RequestBody ReceiptDomain receiptDomain)
    {
59
60
61
62
63
64
65
66
        AjaxResult ajaxResult = handleMultiProcess(new BaseController.MultiProcessListener() {
            @Override
            public AjaxResult doProcess() {
                AjaxResult ajaxResult = receiptContainerApiService.saveReceiptContainer(receiptDomain);
                return ajaxResult;
            }
        });
        return ajaxResult;
67
68
    }
69
游杰 authored
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//    /**
//     * 入库单下发
//     */
//    @Log(title = "入库单下发", action = BusinessType.INSERT)
//    @PostMapping("/insertReceipt")
//    @ApiOperation("入库单下发接口")
//    @ResponseBody
//    @ApiLogger(apiName = "下发入库单", from="ERP")
//    public AjaxResult MaterialApi(@RequestBody Receipt receipt) {
//        System.out.println("————————开始接收入库单——————————");
//        System.out.println(receipt);
//        AjaxResult ajaxResult = receiptService.insertReceipt(receipt);
//        return ajaxResult;
//    }
84
85

    /**
86
87
88
89
90
     * 取消入库单
     */
    @Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
    @PostMapping("/remove")
    @ResponseBody
周峰 authored
91
    @ApiLogger(apiName = "取消入库单", from="ERP")
lector authored
92
    public AjaxResult remove(@RequestBody List<String> receiptCodeList){
游杰 authored
93
        if (receiptCodeList==null && receiptCodeList.size()<1){
lector authored
94
            return AjaxResult.error("单号列表为空");
95
        }
lector authored
96
        return receiptApiService.remove(receiptCodeList);
97
98
    }
lector authored
99
100
101
102
103
104
    /**
     * 入库单查询
     */
    @Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
    @GetMapping("/search")
    @ResponseBody
游杰 authored
105
    @ApiLogger(apiName = "查询入库单", from="ERP")
lector authored
106
107
108
109
110
    public AjaxResult search(@RequestParam String receiptCode,
                             @RequestParam String companyCode,
                             @RequestParam String warehouseCode){
        return receiptApiService.search(receiptCode,companyCode,warehouseCode);
    }
111
pengcheng authored
112
}