ReceiptApi.java 1.6 KB
package com.huaheng.api.general.controller;


import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.service.ReceiptApiService;
import com.huaheng.common.utils.StringUtils;
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;
import io.swagger.annotations.ApiParam;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/receiptApi")
@Api(tags = {"入库单接口"}, value = "入库单接口receipt")
public class ReceiptApi {

    @Resource
    private ReceiptApiService receiptApiService;


    /**
     * 同步入库单
     */
    @Log(title = "入库单添加", action = BusinessType.INSERT)
    @PostMapping("/receipt")
    @ApiOperation("入库单添加公共接口")
    @ResponseBody
    public AjaxResult Receipt(@RequestBody ReceiptDomain receiptDomain)
    {
        AjaxResult ajaxResult = receiptApiService.receipt(receiptDomain);
        return ajaxResult;
    }


    /**
     * 取消入库单
     */
    @Log(title = "入库-入库单 ",operating = "入库单删除", action = BusinessType.UPDATE)
    @PostMapping("/remove")
    @ResponseBody
    public AjaxResult remove(@RequestBody Integer[] ids){
        if (StringUtils.isNull(ids)){
            return AjaxResult.error("id为空");
        }
        return receiptApiService.remove(ids);
    }

}