|
@@ -6,11 +6,15 @@ import com.platform.exception.BaseResult;
|
|
|
import com.platform.manage.WeighbridgeRecordManage;
|
|
import com.platform.manage.WeighbridgeRecordManage;
|
|
|
import com.platform.response.LicensePlateValidateResponse;
|
|
import com.platform.response.LicensePlateValidateResponse;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
+
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 地磅数据上报接口
|
|
* 地磅数据上报接口
|
|
@@ -30,9 +34,26 @@ public class WeighbridgeController {
|
|
|
*/
|
|
*/
|
|
|
@Operation(summary = "地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
|
|
@Operation(summary = "地磅过磅数据上报", description = "接收地磅设备上报的过磅数据和图片")
|
|
|
@PostMapping("/weighBridgePush")
|
|
@PostMapping("/weighBridgePush")
|
|
|
- public BaseResult<Boolean> weighBridgePush(WeighbridgePushRequest request) {
|
|
|
|
|
- // 调用业务层处理;
|
|
|
|
|
- return BaseResult.success(weighbridgeRecordManage.handleWeighbridgePush(request));
|
|
|
|
|
|
|
+ public BaseResult<Boolean> weighBridgePush(
|
|
|
|
|
+ @Parameter(description = "车牌号", required = true) @RequestParam("licensePlate") String licensePlate,
|
|
|
|
|
+ @Parameter(description = "地磅编号", required = true) @RequestParam("weighbridgeCode") String weighbridgeCode,
|
|
|
|
|
+ @Parameter(description = "称重重量(吨)", required = true) @RequestParam("grossWeight") BigDecimal grossWeight,
|
|
|
|
|
+ @Parameter(description = "时间戳(秒或毫秒)", required = true) @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);
|
|
|
|
|
+
|
|
|
|
|
+ // 调用业务层处理
|
|
|
|
|
+ Boolean result = weighbridgeRecordManage.handleWeighbridgePush(request);
|
|
|
|
|
+ return BaseResult.success(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|