jiangping
2024-10-10 29d76f8a034cb2bbeccee258e97f66f2e2d87451
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWaterGasServiceImpl.java
@@ -49,11 +49,12 @@
    public Integer create(PlatformWaterGas platformWaterGas) {
        if(platformWaterGas.getTimeInfo() ==null || platformWaterGas.getNum()==null
        ||(Constants.equalsInteger(platformWaterGas.getType(),Constants.TWO) && StringUtils.isBlank(platformWaterGas.getCarCode()))){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该年月数据已存在,请勿重新录入,可以尝试搜索后进行数据修改!");
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,参数错误!");
        }
        if( platformWaterGasMapper.selectCount(new QueryWrapper<PlatformWaterGas>().lambda()
                .eq(PlatformWaterGas::getIsdeleted, Constants.ZERO)
                .apply("to_days(time_info) = to_days('"+ DateUtil.getPlusTime2(platformWaterGas.getTimeInfo()) +"')")
                .eq(PlatformWaterGas::getType,platformWaterGas.getType())
                .eq(Constants.equalsInteger(platformWaterGas.getType(),Constants.TWO),PlatformWaterGas::getCarCode,platformWaterGas.getCarCode()))>0){
            throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该年月数据已存在,请勿重新录入,可以尝试搜索后进行数据修改!");
        }