package com.sifang.modules.order.service;

import com.jfinal.plugin.activerecord.Record;
import com.sifang.modules.sys.common.service.BaseService;
import com.sifang.modules.sys.common.utils.MathUtils;
import com.sifang.modules.sys.util.LayuiPage;
import com.sifang.modules.sys.util.TrimStrMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

@Service
public class SettlementDetailsService extends BaseService {


    /**
     * 结算，计算工单结算总金额。
     */
    public BigDecimal calcOrderTotalCosts(Record settlement) {
        return MathUtils.sumBigDecimal(settlement.getBigDecimal("service_costs"), settlement.getBigDecimal("other_cost"), settlement.getBigDecimal("mileage_cost"), settlement.getBigDecimal("exigency_costs"));
    }
}
