Blame view

src/main/java/com/huaheng/api/general/controller/ReceiptApiController.java 3.18 KB
pengcheng authored
1
2
3
package com.huaheng.api.general.controller;
lector authored
4
5
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
6
import com.huaheng.api.general.domain.Receipt;
pengcheng authored
7
8
import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.service.ReceiptApiService;
9
import com.huaheng.api.general.service.ReceiptService;
10
import com.huaheng.common.utils.StringUtils;
周峰 authored
11
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
pengcheng authored
12
13
14
15
16
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
17
18
import io.swagger.annotations.ApiParam;
import org.apache.shiro.authz.annotation.RequiresPermissions;
pengcheng authored
19
20
21
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
lector authored
22
import java.util.List;
pengcheng authored
23
24
25

@RestController
@RequestMapping("/api/receiptApi")
xqs authored
26
@Api(tags = {"入库单接口"}, value = "入库单接口receipt")
游杰 authored
27
public class ReceiptApiController {
pengcheng authored
28
29
30

    @Resource
    private ReceiptApiService receiptApiService;
31
32
    @Resource
    private ReceiptService receiptService;
pengcheng authored
33
34
35
36
37
38
39
40

    /**
     * 同步入库单
     */
    @Log(title = "入库单添加", action = BusinessType.INSERT)
    @PostMapping("/receipt")
    @ApiOperation("入库单添加公共接口")
    @ResponseBody
周峰 authored
41
    @ApiLogger(apiName = "添加入库单", from="ERP")
游杰 authored
42
    public AjaxResult receipt(@RequestBody ReceiptDomain receiptDomain)
pengcheng authored
43
44
45
46
47
    {
        AjaxResult ajaxResult = receiptApiService.receipt(receiptDomain);
        return ajaxResult;
    }
48
游杰 authored
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//    /**
//     * 入库单下发
//     */
//    @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;
//    }
63
64

    /**
65
66
67
68
69
     * 取消入库单
     */
    @Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
    @PostMapping("/remove")
    @ResponseBody
周峰 authored
70
    @ApiLogger(apiName = "取消入库单", from="ERP")
lector authored
71
    public AjaxResult remove(@RequestBody List<String> receiptCodeList){
游杰 authored
72
        if (receiptCodeList==null && receiptCodeList.size()<1){
lector authored
73
            return AjaxResult.error("单号列表为空");
74
        }
lector authored
75
        return receiptApiService.remove(receiptCodeList);
76
77
    }
lector authored
78
79
80
81
82
83
    /**
     * 入库单查询
     */
    @Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
    @GetMapping("/search")
    @ResponseBody
游杰 authored
84
    @ApiLogger(apiName = "查询入库单", from="ERP")
lector authored
85
86
87
88
89
    public AjaxResult search(@RequestParam String receiptCode,
                             @RequestParam String companyCode,
                             @RequestParam String warehouseCode){
        return receiptApiService.search(receiptCode,companyCode,warehouseCode);
    }
pengcheng authored
90
}