|
|
@@ -80,8 +80,15 @@ public class WeighbridgeRecordManage {
|
|
|
licensePlateValidateResponse.setCode(200);
|
|
|
licensePlateValidateResponse.setMessage("数据上报成功");
|
|
|
LicensePlateValidateResponse.Data data = new LicensePlateValidateResponse.Data();
|
|
|
- long l = request.getTimestamp() / 1000;
|
|
|
- data.setTimestamp(l);
|
|
|
+ String timestampStr = request.getTimestamp().toString();
|
|
|
+ if (timestampStr.length() == 10) {
|
|
|
+ // 秒级时间戳
|
|
|
+ data.setTimestamp(request.getTimestamp());
|
|
|
+ } else if (timestampStr.length() == 13) {
|
|
|
+ // 毫秒级时间戳
|
|
|
+ long l = request.getTimestamp() / 1000;
|
|
|
+ data.setTimestamp(l);
|
|
|
+ }
|
|
|
data.setScreen_message("数据上报成功");
|
|
|
data.setVoice_message("数据上报成功");
|
|
|
licensePlateValidateResponse.setData(data);
|
|
|
@@ -132,9 +139,16 @@ public class WeighbridgeRecordManage {
|
|
|
licensePlateValidateResponse.setCode(400);
|
|
|
licensePlateValidateResponse.setMessage("数据上报失败");
|
|
|
LicensePlateValidateResponse.Data data = new LicensePlateValidateResponse.Data();
|
|
|
+ String timestampStr = request.getTimestamp().toString();
|
|
|
+ if (timestampStr.length() == 10) {
|
|
|
+ // 秒级时间戳
|
|
|
+ data.setTimestamp(request.getTimestamp());
|
|
|
+ } else if (timestampStr.length() == 13) {
|
|
|
+ // 毫秒级时间戳
|
|
|
+ long l = request.getTimestamp() / 1000;
|
|
|
+ data.setTimestamp(l);
|
|
|
+ }
|
|
|
|
|
|
- long l = request.getTimestamp() / 1000;
|
|
|
- data.setTimestamp(l);
|
|
|
data.setVoice_message("数据上报失败");
|
|
|
licensePlateValidateResponse.setData(data);
|
|
|
return licensePlateValidateResponse;
|