package com.tofly.watermeter.handler;

/**
 * @author wujianjun
 * @date 2024/2/21 13:50
 */
import com.tofly.watermeter.custom.service.meterBusiness.ConfigManageService;
import com.tofly.watermeter.custom.service.websb.impl.WebSBserviceImpl;
import com.tofly.watermeter.service.QfcbplandetailsService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author FlashWJL
 * @date 2021/4/8 14:40
 */
@Component
@AllArgsConstructor
public class GeneratePlanHandlerMeiCun {

  private final ConfigManageService configManageService;

  private final WebSBserviceImpl webSBservice;

  private final QfcbplandetailsService qfcbplandetailsService;

  /**
   * 同步水表厂家
   *
   * @param param param
   * @return ReturnT
   */
  @XxlJob("synVendor")
  public ReturnT<String> synVendor(String param) {
    configManageService.synVendor();
    return ReturnT.SUCCESS;
  }

  @XxlJob("getUpdateAndInsertMeiCun")
  public ReturnT<String> getUpdateAndInsertMeiCun(String param) {
    webSBservice.getUpdateAndInsertMeiCun(1, 1000);
    return ReturnT.SUCCESS;
  }

  /**
   * 初始化每下个月抄表数据月计划 三星 ***** 1 1 4 27 * ? （27号凌晨四点初始化抄表月计划） 2021-11-27 04:01:01 2021-12-27 04:01:01
   *
   * @return
   */
  @XxlJob("initCbbzAndDown")
  public ReturnT<String> initCbbzAndDown(String param) {
    qfcbplandetailsService.initCbData();
    return ReturnT.SUCCESS;
  }
}
