package com.palmnest.webapp.quartz;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner;
import com.palmnest.application.bean.AppResultDto;
import com.palmnest.application.bean.Page;
import com.palmnest.application.dto.AppNoticeRecordVo;
import com.palmnest.dao.release.GoodsCompanyDao;
import com.palmnest.model.notice.AppNoticeModel;
import com.palmnest.service.estateserve.airconditioner.ConditionerAddTimeService;
import com.palmnest.service.estateserve.release.GoodsReleaseService;

import com.palmnest.service.notice.AppNoticeRecordManager;
import com.palmnest.service.notice.AppNoticeReminderRecordManager;
import com.palmnest.service.notice.WxMassmessageSendManager;
import com.palmnest.service.notice.service.NoticePublicnoService;
import com.palmnest.webapp.controller.backstage.GoodsReleaseController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@Component("airConditionerOrderTask")
public class AirConditionerOrderTask {

    @Autowired
    private ConditionerAddTimeService conditionerAddTimeService;
    @Autowired
    GoodsReleaseController controller;

    @Autowired
    private AppNoticeRecordManager appNoticeRecordManager;

    @Autowired
    NoticePublicnoService noticePublicnoService;

    @Autowired
    AppNoticeReminderRecordManager appNoticeReminderRecordManager;

    @Autowired
    private WxMassmessageSendManager wxMassmessageSendManager;
    public void run() throws Exception {
        log.info("quartz into AirConditionerOrderTask start ...");
        try {
            /**
             * 订单申请加开空调开启时间和结束时间前10分钟推送一条短信通知空调开关人员
             * 条件:未推送短信状态
             */
            conditionerAddTimeService.airConditioningOrder();
        } catch (Exception e) {
            e.printStackTrace();
            log.error(e.getMessage());
        }

        log.info("quartz into AirConditionerOrderTask end ...");

    }
}
