package com.sw.mes.agv.service;

import com.sw.mes.agv.entity.MobileRecharge;
import com.sw.mes.core.base.BaseService;
import com.sw.mes.core.utils.RequestPage;
import org.springframework.data.jpa.domain.Specification;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface MobileRechargeService extends BaseService<MobileRecharge> {

    List<MobileRecharge> findAll(RequestPage page);

    List<MobileRecharge> findAll(Specification<MobileRecharge> specification);

    List<MobileRecharge> findByExample(Specification<MobileRecharge> specification, RequestPage page);

    List<MobileRecharge> findBySlingCode(String slingCode);

    /**
     * 根据载具编号获取最近灌料信息
     *
     * @param code
     * @return
     */
    MobileRecharge findLastBySlingCode(String code);

    List<Map<String, Object>> rechargeDetail(String startTime, String endTime,Long start, Integer rows);

    List<Map<String, Object>> rechargeDetailCount(String startTime, String endTime);

    void create(MobileRecharge recharge) throws RuntimeException;

    void backoff(Long id, BigDecimal backoffWeight, String backoffReason);

}
