ShipmentApi.java 1.73 KB
package com.huaheng.api.general.Controller;


import com.huaheng.api.general.domain.ShipmentObject;
import com.huaheng.api.general.service.ShipmentAPIService;
import com.huaheng.framework.aspectj.lang.annotation.ApiLogger;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 *  出库下发和回传接口
 *    @author huaheng
 *    @date 2018-12-18
 *
 *
 *
 */
@RestController
@RequestMapping("/api")
@Api(tags = {"出库单接口"})
public class ShipmentApi extends BaseController {


    @Autowired
    private ShipmentAPIService shipmentAPIService;

    //出库单下发
    @Log(title = "出库单下发", action = BusinessType.INSERT)
    @PostMapping("/shipment/insertshipment")
    @ApiOperation("出库单下发公共接口")
    @ResponseBody
    @ApiLogger(apiName = "出库单下发", from = "ERP")
    public AjaxResult insertShipment(@RequestBody ShipmentObject shipmentObject){
        try {
            return shipmentAPIService.insertShipment(shipmentObject);
        }catch (Exception e){
            return AjaxResult.error(e.getMessage());
        }
    }

    //出库单回传
    @Log(title = "出库单回传", action = BusinessType.INSERT)
    @PostMapping("/voucher/rdvoucher")
    @ApiOperation("出库单回传公共接口")
    @ResponseBody
    public AjaxResult confirmShipment()
    {
        return shipmentAPIService.confirmShipment(false);
    }


}