|  |  |  | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelImporter; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserModel; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.ScientificNotationTUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.Utils; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.MemberImport; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.PlatformGasImport; | 
|---|
|  |  |  | import com.doumee.dao.business.PlatformWaterGasMapper; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Company; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Member; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformReason; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformWaterGas; | 
|---|
|  |  |  | import com.doumee.dao.openapi.request.GasByMonthRequest; | 
|---|
|  |  |  | import com.doumee.dao.openapi.request.WaterByMonthRequest; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.github.yulichang.wrapper.MPJLambdaWrapper; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.checkerframework.checker.units.qual.C; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.data.redis.core.RedisTemplate; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.util.CollectionUtils; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.multipart.MultipartFile; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | 
|---|
|  |  |  | ExcelImporter ie = null; | 
|---|
|  |  |  | List<PlatformGasImport> dataList =null; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | ie = new ExcelImporter(file,0,0); | 
|---|
|  |  |  | ie = new ExcelImporter(file,1,0); | 
|---|
|  |  |  | dataList = ie.getDataList(PlatformGasImport.class,null); | 
|---|
|  |  |  | }  catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if( platformWaterGasMapper.selectCount(new QueryWrapper<PlatformWaterGas>().lambda() | 
|---|
|  |  |  | .eq(PlatformWaterGas::getIsdeleted, Constants.ZERO) | 
|---|
|  |  |  | .apply("to_days(time_info) = to_days('"+ DateUtil.getPlusTime2(model.getTimeInfo()) +"')") | 
|---|
|  |  |  | .apply("to_days(time_info) = to_days('"+ model.getTimeInfo()+"-01" +"')") | 
|---|
|  |  |  | .eq(PlatformWaterGas::getType,Constants.TWO) | 
|---|
|  |  |  | .eq(PlatformWaterGas::getCarCode,model.getCarCode()))>0){ | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该["+DateUtil.getPlusTime2(model.getTimeInfo())+"]数据已存在,请勿重新录入,可以尝试搜索后进行数据修改!"); | 
|---|
|  |  |  | throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该["+model.getTimeInfo()+"]数据已存在,请勿重新录入,可以尝试搜索后进行数据修改!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | platformWaterGas.setTimeInfo(model.getTimeInfo()); | 
|---|
|  |  |  | platformWaterGas.setTimeInfo(DateUtil.StringToDate(model.getTimeInfo()+"-01","yyyy-MM-dd")); | 
|---|
|  |  |  | platformWaterGas.setCarCode(model.getCarCode()); | 
|---|
|  |  |  | platformWaterGas.setContent(model.getContent()); | 
|---|
|  |  |  | platformWaterGas.setIsdeleted(Constants.ZERO); | 
|---|
|  |  |  | platformWaterGas.setType(Constants.TWO); | 
|---|
|  |  |  | platformWaterGas.setCreator(loginUserInfo.getId()); | 
|---|