Ver Fonte

设备管理费pc接口

李进 há 1 ano atrás
pai
commit
f080a53046

+ 1 - 1
device-api-service/src/main/java/com/xy/service/DeviceAlgorithmChargingServiceImpl.java

@@ -76,7 +76,7 @@ public class DeviceAlgorithmChargingServiceImpl extends ServiceImpl<DeviceAlgori
                 .in(DeviceAlgorithmCharging::getBeginTime, Arrays.asList(DataTime.getSring("yyyyMM"), -1))
         );
         if (!Emptys.check(deviceAlgorithmChargings)) {
-            throw new CommRuntimeException("算法费欠费");
+            throw new CommRuntimeException(R.Enum.ALGORITHM_CHARGING.getCode(), R.Enum.ALGORITHM_CHARGING.getMsg());
         }
         return R.ok();
     }

+ 4 - 2
device-api-service/src/main/java/com/xy/service/DeviceChargingServiceImpl.java

@@ -21,6 +21,7 @@ import com.xy.utils.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.validation.annotation.Validated;
@@ -44,6 +45,7 @@ import static com.xy.utils.PlusBeans.toPageBean;
  * @author lijin
  * @since 2023-04-14
  */
+@Slf4j
 @Service
 @Api(tags = "设备计费表")
 @AllArgsConstructor(onConstructor_ = @Lazy)
@@ -111,11 +113,11 @@ public class DeviceChargingServiceImpl extends ServiceImpl<DeviceChargingMapper,
                     .setTimeout(now)
                     .setCreateTime(now)
             );
-            throw new CommRuntimeException("管理费欠费");
+            throw new CommRuntimeException(R.Enum.CHARGING.getCode(), R.Enum.CHARGING.getMsg());
         }
         int contrast = DataTime.stringContrast(DataTime.toString(deviceCharging.getTimeout()), DataTime.toString(now));
         if (deviceCharging.getChargingX() == 0 && contrast <= 0) {
-            throw new CommRuntimeException("管理费欠费");
+            throw new CommRuntimeException(R.Enum.CHARGING.getCode(), R.Enum.CHARGING.getMsg());
         }
         return R.ok();
     }