package com.trade.admin.system.controller;

import com.trade.admin.job.CustomsDeclarationSchedule;
import com.trade.admin.job.ExportTaxRebateSchedule;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private CustomsDeclarationSchedule customsDeclarationSchedule;
    @Resource
    private ExportTaxRebateSchedule exportTaxRebateSchedule;

    /**
     * 批量拉取报关单信息
     */
    @RequestMapping("/customsDeclarationTask1")
    public void customsDeclarationTask1() {
        customsDeclarationSchedule.batchProcessCustomsDeclaration4SalesOrder();
    }

    /**
     * 批量处理未结关报关单
     */
    @RequestMapping("/customsDeclarationTask2")
    public void customsDeclarationTask2() {
        customsDeclarationSchedule.batchProcessCustomsDeclarationUnFinish();
    }

    @RequestMapping("/exportTaxRebateTask")
    public void exportTaxRebateTask() {
        exportTaxRebateSchedule.pullTaxRebateRecordsJob();
    }

    @RequestMapping("/generateTaxRebatePaymentInfoForSelfExportUser")
    public void generateTaxRebatePaymentInfoForSelfExportUser() {
        exportTaxRebateSchedule.generateTaxRebatePaymentInfoForSelfExportUserJob();
    }

    /**
     * 下载海关申报文件
     */
    @RequestMapping("/downloadCustomsDeclarationFile")
    public void downloadCustomsDeclarationFile() {
        customsDeclarationSchedule.batchDownloadCustomsDeclarationFile();
    }

    /**
     * 备案单证文件写入
     */
    @RequestMapping("/writeFilingDocWithManual")
    public void writeFilingDocWithManual() {
        customsDeclarationSchedule.writeFilingDocWithCron();
    }
}
