Blame view

src/main/java/com/huaheng/api/general/controller/ShipmentApiController.java 2.8 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.ShipmentDomain;
import com.huaheng.api.general.service.ShipmentApiService;
lector authored
9
import com.huaheng.common.utils.StringUtils;
周峰 authored
10
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
pengcheng authored
11
12
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
13
import com.huaheng.framework.web.controller.BaseController;
pengcheng authored
14
15
16
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
17
import org.springframework.transaction.annotation.Transactional;
pengcheng authored
18
19
20
import org.springframework.web.bind.annotation.*;

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

@RestController
@RequestMapping("/api/shipmentApi")
xqs authored
25
@Api(tags = {"出库单接口"}, value = "出库单接口shipment")
26
public class ShipmentApiController extends BaseController {
pengcheng authored
27
28
29
30
31
32
33
34
35
36
37

    @Resource
    private ShipmentApiService shipmentApiService;

    /**
     * 同步出库单
     */
    @Log(title = "出库单添加", action = BusinessType.INSERT)
    @PostMapping("/shipment")
    @ApiOperation("出库单添加公共接口")
    @ResponseBody
周鸿 authored
38
//    @ApiLogger(apiName = "添加出库单", from="ERP")
pengcheng authored
39
40
    public AjaxResult Shipment(@RequestBody ShipmentDomain shipmentDomain)
    {
肖超群 authored
41
        AjaxResult ajaxResult = handleMultiProcess("Shipment", new BaseController.MultiProcessListener() {
42
43
44
45
46
47
            @Override
            public AjaxResult doProcess() {
                AjaxResult ajaxResult = shipmentApiService.shipment(shipmentDomain);
                return ajaxResult;
            }
        });
pengcheng authored
48
49
        return ajaxResult;
    }
lector authored
50
51
52
53
54
55
56

    /**
     * 取消出库单
     */
    @Log(title = "出库-出库单 ",operating = "出库单删除", action = BusinessType.UPDATE)
    @PostMapping("/remove")
    @ResponseBody
周鸿 authored
57
//    @ApiLogger(apiName = "取消出库单", from="ERP")
lector authored
58
59
60
61
62
63
64
65
66
67
68
69
70
    public AjaxResult remove(@RequestBody List<String> shipmentCodeList){
        if (shipmentCodeList==null&&shipmentCodeList.size()<1){
            return AjaxResult.error("出库单号列表为空");
        }
        return shipmentApiService.remove(shipmentCodeList);
    }

    /**
     * 出库单查询
     */
    @Log(title = "出库-出库单 ",operating = "出库单删除", action = BusinessType.UPDATE)
    @GetMapping("/search")
    @ResponseBody
周鸿 authored
71
//    @ApiLogger(apiName = "取消入库单", from="ERP")
lector authored
72
73
74
75
76
    public AjaxResult search(@RequestParam String shipmentCode,
                             @RequestParam String companyCode,
                             @RequestParam String warehouseCode){
        return shipmentApiService.search(shipmentCode,companyCode,warehouseCode);
    }
77
pengcheng authored
78
}