wait
This commit is contained in:
@ -75,12 +75,12 @@ public class SendDataController {
|
|||||||
return sendDataService.sendStoreInfoToBattery(Long.parseLong(id));
|
return sendDataService.sendStoreInfoToBattery(Long.parseLong(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "接收充电同步数据接口")
|
// @ApiOperation(value = "接收充电同步数据接口")
|
||||||
@GetMapping("/subOrder/{id}")
|
// @GetMapping("/subOrder/{id}")
|
||||||
public Map<String,String> sendSubOrderToBattery(@PathVariable String id){
|
// public Map<String,String> sendSubOrderToBattery(@PathVariable String id){
|
||||||
log.info("/subOrder 接收充电数据:{}",id);
|
// log.info("/subOrder 接收充电数据:{}",id);
|
||||||
return sendDataService.sendSubOrderToBattery(Long.parseLong(id));
|
// return sendDataService.sendSubOrderToBattery(Long.parseLong(id));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@ApiOperation(value = "接收充电同步数据接口")
|
@ApiOperation(value = "接收充电同步数据接口")
|
||||||
@GetMapping("/OrderMeal/{id}")
|
@GetMapping("/OrderMeal/{id}")
|
||||||
@ -90,34 +90,34 @@ public class SendDataController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @ApiOperation(value = "异步接收充电同步数据接口")
|
@ApiOperation(value = "异步接收充电同步数据接口")
|
||||||
// @GetMapping("/subOrder/{id}")
|
@GetMapping("/subOrder/{id}")
|
||||||
// public CompletableFuture<ResponseEntity<Map<String, String>>> sendSubOrderToBattery(@PathVariable String id){
|
public CompletableFuture<ResponseEntity<Map<String, String>>> sendSubOrderToBattery(@PathVariable String id){
|
||||||
// log.info("/subOrder 接收充电数据:{}",id);
|
log.info("/subOrder 接收充电数据:{}",id);
|
||||||
// return CompletableFuture
|
return CompletableFuture
|
||||||
// .supplyAsync(() -> {
|
.supplyAsync(() -> {
|
||||||
// try {
|
try {sleep(5000);
|
||||||
// return sendDataService.sendSubOrderToBattery(Long.parseLong(id));
|
return sendDataService.sendSubOrderToBattery(Long.parseLong(id));
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// log.error("处理用户数据时发生异常", e);
|
log.error("处理用户数据时发生异常", e);
|
||||||
// Map<String, String> errorResponse = new HashMap<>();
|
Map<String, String> errorResponse = new HashMap<>();
|
||||||
// errorResponse.put("code", "9999");
|
errorResponse.put("code", "9999");
|
||||||
// errorResponse.put("msg", "处理失败: " + e.getMessage());
|
errorResponse.put("msg", "处理失败: " + e.getMessage());
|
||||||
// return errorResponse;
|
return errorResponse;
|
||||||
// }
|
}
|
||||||
// }, taskExecutor)
|
}, taskExecutor)
|
||||||
// .thenApply(result -> {
|
.thenApply(result -> {
|
||||||
// log.info("用户数据处理完成,返回结果: {}", result);
|
log.info("用户数据处理完成,返回结果: {}", result);
|
||||||
// return ResponseEntity.ok(result);
|
return ResponseEntity.ok(result);
|
||||||
// })
|
})
|
||||||
// .exceptionally(throwable -> {
|
.exceptionally(throwable -> {
|
||||||
// log.error("异步处理用户数据时发生异常", throwable);
|
log.error("异步处理用户数据时发生异常", throwable);
|
||||||
// Map<String, String> errorResponse = new HashMap<>();
|
Map<String, String> errorResponse = new HashMap<>();
|
||||||
// errorResponse.put("code", "9999");
|
errorResponse.put("code", "9999");
|
||||||
// errorResponse.put("msg", "系统异常");
|
errorResponse.put("msg", "系统异常");
|
||||||
// return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorResponse);
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorResponse);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -356,8 +356,6 @@ public class SendDataServiceImpl implements SendDataService {
|
|||||||
map.put("msg",jsonObject.get("msg").toString());
|
map.put("msg",jsonObject.get("msg").toString());
|
||||||
return map;
|
return map;
|
||||||
}else if (status.equals("200")){
|
}else if (status.equals("200")){
|
||||||
String bOrdNo = jsonObject.get("order_no").toString();
|
|
||||||
companyStoreMapper.updateOdId(bOrdNo,id);
|
|
||||||
map.put("code",status);
|
map.put("code",status);
|
||||||
map.put("msg","发送成功");
|
map.put("msg","发送成功");
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
Reference in New Issue
Block a user