package com.nmgs.service.impl; import com.nmgs.entity.IntegralCheck; import com.nmgs.mapper.bak.IntegralCheckBakMapper; import com.nmgs.mapper.petrol.IntegralCheckMapper; import com.nmgs.util.PropertiesUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service @Slf4j public class SolveCheckServiceImpl { public IntegralCheckMapper integralCheckMapper; @Autowired public void setIntegralCheckMapper(IntegralCheckMapper integralCheckMapper) { this.integralCheckMapper = integralCheckMapper; } public IntegralCheckBakMapper integralCheckBakMapper; @Autowired public void setIntegralCheckBakMapper(IntegralCheckBakMapper integralCheckBakMapper) { this.integralCheckBakMapper = integralCheckBakMapper; } @Transactional(timeout = 1800) public void solveCheck(List list){ int i=1; for(IntegralCheck integralCheck:list){ i++; integralCheckMapper.insert(integralCheck); if(PropertiesUtil.getValue("IsBak").equals("1")){ integralCheckBakMapper.insert(integralCheck); } log.info("次数===" + i); } } }