package cn.com.victorysoft.business.calc.service;

import cn.com.victorysoft.business.calc.dao.DataSyncDao;
import cn.com.victorysoft.business.calc.dao.FlushDataSyncDao;
import cn.com.victorysoft.business.calc.entity.SysInjectTechnology;
import cn.com.victorysoft.business.indicator.dao.WellSectionMonthDao;
import cn.com.victorysoft.business.indicator.entity.WellSectionMonth;
import cn.com.victorysoft.business.sys.dao.WellSectionDailyDao;
import cn.com.victorysoft.business.sys.entity.DateRange;
import cn.com.victorysoft.business.sys.entity.WellSectionDaily;
import cn.com.victorysoft.business.util.DateUtils;
import cn.com.victorysoft.business.util.StringUtils;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;

import static cn.com.victorysoft.business.indicator.constant.Constants.*;

/**
 * 洗井数据同步服务
 */
@Slf4j
@Service
public class FlushDataSyncService {

    @Resource
    private FlushDataSyncDao flushDataSyncDao;

    /**
     * 同步洗井运行情况
     */
    @Transactional
    public void syncFlushRecord(Date startDate, Date endDate) {
        flushDataSyncDao.syncFlushRecord(startDate, endDate);
        flushDataSyncDao.insertFlushDaily();
        flushDataSyncDao.updateFlushDaily();
    }

}
