package com.jeeplus.modules.sg.overheadline.service;

import com.jeeplus.common.utils.excel.ImportExcel;
import com.jeeplus.common.utils.sg.ExcelUtil;
import com.jeeplus.modules.sg.overheadline.entity.Settlement;
import com.jeeplus.modules.sg.overheadline.mapper.SettlementMapper;
import com.jeeplus.modules.sg.overheadline.util.BashInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.*;

@Service
public class SettlementService {
    @Autowired
    private SettlementMapper settlementMapper;

    /*
        添加结算工程表
     */
    @Transactional
    public void save(Map<String,Object[]> builtMap, double builtTotal, double[] divisiontotal, double wordtotal, double otherTotal, double feescount, String id){
        List<Settlement> settlementList = BashInfo.getTotality(builtMap,builtTotal,divisiontotal,wordtotal,otherTotal,feescount,id);
        for (Settlement settlement:settlementList){
            settlementMapper.sava(settlement);
        }
    }
    /*
        查找结算工程表
     */
    public List<Settlement> selectSettlementService(String id){
        return settlementMapper.selectSettlement(id);
    }
}
