MesApiAskController.java 1.61 KB
package com.huaheng.api.mes.controller;

import com.huaheng.api.general.domain.ReceiptDomain;
import com.huaheng.api.general.domain.ShipmentDomain;
import com.huaheng.api.general.service.ShipmentApiService;
import com.huaheng.common.constant.QuantityConstant;
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.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * mes逻辑处理控制器
 * @author xcq
 */

@RestController
@RequestMapping("/api/mes")
@Api(tags = {"mes请求处理接口"}, value = "mes请求处理接口")
public class MesApiAskController {
    @Resource
    private ShipmentApiService shipmentApiService;

    /**
     * mes生产出库
     */
    @Log(title = "入库单添加", action = BusinessType.INSERT)
    @PostMapping("/productionShipment")
    @ApiOperation("生产出库接口")
    @ResponseBody
    @ApiLogger(apiName = "mes生产出库", from="MES")
    public AjaxResult productionShipment(@RequestBody ShipmentDomain shipmentDomain){
        if (shipmentDomain != null && shipmentDomain.getShipmentDetails() != null && shipmentDomain.getShipmentHeader() != null){
            shipmentDomain.getShipmentHeader().setCreatedBy(QuantityConstant.PLATFORM_MES);
            return shipmentApiService.shipment(shipmentDomain);
        }

        return AjaxResult.error("请勿提交空数据!");
    }
}