package com.prolog.cs.biz.outbound.controller;

import com.prolog.cs.biz.inbound.vo.UploadCircubParamVO;
import com.prolog.cs.biz.outbound.model.print.PrintDataWithMark;
import com.prolog.cs.biz.outbound.service.InvoicePdfService;
import com.prolog.cs.biz.outbound.service.PrintService;
import com.prolog.framework.bz.common.print.PrintData;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author zzz
 * @desc
 * @date 2021/4/27
 */
@Api(tags = "打印")
@Slf4j
@RestController
@RequestMapping("/invoicePdf")
public class InvoicePdfController {

    @Autowired
    private InvoicePdfService invoicePdfService;

    @ApiOperation("发票同步-获取发票地址")
    @PostMapping("/getInvoicePdfUrl")
    public RestMessage<String> getInvoicePdfUrl(@RequestBody List<String> orderNos) {
        try {
            boolean flag = invoicePdfService.getInvoicePdfUrl(orderNos);
            if(flag){
                return RestMessage.newInstance(true, "发票同步成功", null);
            }else {
                return RestMessage.newInstance(false, "发票同步失败", null);
            }
        } catch (Exception e) {
            return RestMessage.newInstance(false, e.getMessage(), null);
        }
    }


}
