SSPvOneApi.java 3.24 KB
package com.huaheng.api.SSP.controller;

import com.alibaba.fastjson.JSON;
import com.huaheng.api.SSP.domain.ConfirmModel;
import com.huaheng.api.SSP.domain.SSPOnlineModel;
import com.huaheng.api.SSP.service.*;
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 lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/SSP/v1")
@Slf4j
@Api(tags = {"SSPvOneApi"}, description = "SSP钱柜接口V1")
public class SSPvOneApi extends BaseController {

    @Autowired
    SSPOnlineApiService sspOnlineApiService;

    @Autowired
    LocationUploadApiService lus;

    @Autowired
    OrderConfirmApiService confirmService;

    @Autowired
    ItemDownloadApiService itemDownloadApiService;

    @Autowired
    OrderAssignApiService orderAssignApiService;


    @Log(title = "联机心跳接口", action = BusinessType.INSERT)
    @PostMapping("/SSPOnline")
//    @ApiOperation("SSP联机心跳接口")
    @ResponseBody
    public AjaxResult SSPOnline(@RequestBody SSPOnlineModel sspOnlineModel)
    {
        AjaxResult ajaxResult = sspOnlineApiService.SspOnline(sspOnlineModel);
        return ajaxResult;
    }

    @Log(title = "库位信息上传", action = BusinessType.INSERT)
    @PostMapping("/locationUpload")
    @ApiOperation("SSP库位信息上传")
    @ResponseBody
    @ApiLogger(apiName = "SSP库位信息上传", from = "SSP")
    public AjaxResult locationUpload(@RequestBody SSPOnlineModel sspOnlineModel){
        AjaxResult ajaxResult = lus.loupd(sspOnlineModel);
        return ajaxResult;
    }

    @Log(title = "订单回传", action = BusinessType.INSERT)
    @PostMapping("/OrderConfirm")
    @ApiOperation("SSP任务回传接口")
    @ResponseBody
    @ApiLogger(apiName = "SSP任务回传接口", from = "SSP")
    public AjaxResult OrderConfirm(@RequestBody ConfirmModel confirmModel) throws Exception {
        String JsonParam = JSON.toJSONString(confirmModel);
        log.info("回传任务信息:{}",JsonParam);
        AjaxResult ajaxResult = confirmService.ocfm(confirmModel);
        //AjaxResult ajaxResult=AjaxResult.success();
        return ajaxResult;
    }

    @Log(title = "物料信息同步", action = BusinessType.GRANT)
    @PostMapping("/ItemDownload")
    @ApiOperation("SSP物料信息同步接口")
    @ResponseBody
    @ApiLogger(apiName = "SSP物料信息同步接口", from = "SSP")
    public AjaxResult ItemDownload(String url){
        AjaxResult ajaxResult = itemDownloadApiService.Idls(url);
        return ajaxResult;
    }

//    @Log(title = "订单下发", action = BusinessType.GRANT)
//    @PostMapping("/OrderAssign")
//    @ApiOperation("SSP订单下发")
//    @ResponseBody
//    public AjaxResult OrderAssign(String url){
//        AjaxResult ajaxResult = orderAssignApiService.receiptAssign(url);
//        return ajaxResult;
//    }

}