|
|
@@ -10,6 +10,9 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.math.BigDecimal;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -30,8 +33,23 @@ public class WeighbridgeController {
|
|
|
*/
|
|
|
@Operation(summary = "地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
|
|
|
@PostMapping("/weighBridgePush")
|
|
|
- public LicensePlateValidateResponse weighBridgePush(@RequestBody WeighbridgePushRequest request) {
|
|
|
+ public LicensePlateValidateResponse weighBridgePush(
|
|
|
+ @Parameter(description = "车牌号") @RequestParam("licensePlate") String licensePlate,
|
|
|
+ @Parameter(description = "地磅编号") @RequestParam("weighbridgeCode") String weighbridgeCode,
|
|
|
+ @Parameter(description = "称重重量(吨)") @RequestParam("grossWeight") BigDecimal grossWeight,
|
|
|
+ @Parameter(description = "时间戳(秒或毫秒)") @RequestParam("timestamp") Long timestamp,
|
|
|
+ @Parameter(description = "处理标签") @RequestParam(value = "tag", required = false) String tag,
|
|
|
+ @Parameter(description = "车辆照片") @RequestParam(value = "images[]", required = false) MultipartFile[] images
|
|
|
+ ) {
|
|
|
// 构建请求对象
|
|
|
+ WeighbridgePushRequest request = new WeighbridgePushRequest();
|
|
|
+ request.setLicensePlate(licensePlate);
|
|
|
+ request.setWeighbridgeCode(weighbridgeCode);
|
|
|
+ request.setGrossWeight(grossWeight);
|
|
|
+ request.setTimestamp(timestamp);
|
|
|
+ request.setTag(tag);
|
|
|
+ request.setImages(images);
|
|
|
+
|
|
|
// 调用业务层处理
|
|
|
return weighbridgeRecordManage.handleWeighbridgePush(request);
|
|
|
}
|