Kaynağa Gözat

占位符处理

donglang 4 ay önce
ebeveyn
işleme
26f2d210f7

+ 2 - 1
iot-platform-manager/src/main/java/com/platform/api/controller/WeighbridgeController.java

@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -64,7 +65,7 @@ public class WeighbridgeController {
             @Parameter(description = "厂商来源标识") @RequestParam("uuid") String uuid
     ) {
         LicensePlateValidateRequest request = new LicensePlateValidateRequest();
-        request.setLicensePlate(licensePlate.replace("\\r\\n", ""));
+        request.setLicensePlate(StringUtils.isNotBlank(licensePlate) ? licensePlate.replace("\\r\\n", "") : "");
         request.setUuid(uuid);
         return weighbridgeRecordManage.handleValidateLicensePlate(request);
     }