package com.malk.suodisi.controller;

import com.alibaba.fastjson.JSON;
import com.malk.server.aliwork.YDConf;
import com.malk.server.aliwork.YDParam;
import com.malk.server.common.McException;
import com.malk.server.common.McR;
import com.malk.server.dingtalk.DDConf;
import com.malk.service.aliwork.YDClient;
import com.malk.suodisi.server.XYR;
import com.malk.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * 错误抛出与拦截详见 CatchException
 */
@Slf4j
@RestController
@RequestMapping("/hl")
public class HLController {

    @Autowired
    private YDClient ydClient;

    @Autowired
    private DDConf ddConf;

    /**
     * 动态审批人
     */
    @PostMapping("/invoice/hl")
    McR HL_invoice(@RequestBody Map data, HttpServletResponse response, HttpServletRequest request) {

        Map dataMain = new HashMap();
        List<Map> dataList = new ArrayList();
        String fileName = "HL invoice";

        UtilExcel.exportMapAndListByTemplate(response, dataMain, dataList, Map.class, fileName, "HL2025 invoice list.xls");
        return  McR.success();
    }
}


