package com.zfire.jiasm.syncdata.download.basedata;

import lombok.extern.slf4j.Slf4j;

/**
 * 格力品牌安装销售类型基础资料下载
 */
@Slf4j
// @Component
public class GLPPXSLXDownload {
    /*@Value("${baseurl}")
    private String baseurl = "";
    @Value("${azxslxc}")
    private String azxslxc = "";

    @Resource
    TokenCenter tokenCenter;
    @Resource
    GLPPXSLXDownloadService glppxslxDownloadService;



    *//**
     * 格力品牌安装销售类型信息同步
     * @return
     *//*
    @Scheduled(fixedDelayString = "${azxslx}")
    public void processXSLXTask() throws Exception {
        if (azxslxc.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Map<String, String> paramMap = new HashMap<String, String>();

        log.info("开始下载格力品牌安装销售类型信息: \uF0B7{}",sdf.format(new Date()));

        Token token = tokenCenter.getCurrentToken();
        String url = baseurl + InterFaceTypeEnum.GLPP_XSLX.getCode() + "/querylist";
        String paramJson= JSON.toJSONString(paramMap);

        JSONResult jsonResult = HttpUtil.httpRequestWithToken(url, "POST", paramJson, token);
        if (jsonResult.getStatus() == null || !jsonResult.getStatus().toString().equals("200")) {
            log.info("下载格力品牌安装销售类型信息失败！: {}",jsonResult.getMessage());
            return;
        }
        JSONArray jsonArray = (JSONArray) jsonResult.getData();

        if (jsonArray != null) {

            log.info("下载了{}条数据",jsonArray.size());

            glppxslxDownloadService.extractedXSLX(jsonArray);

            jsonArray.clear();
            log.info("格力品牌安装销售类型信息处理完成: \uF0B7{}",sdf.format(new Date()));

        }else {
            log.info("["+url+"]无数据");
        }
    }*/

}
