fix(优惠券中心):携程接口优化
This commit is contained in:
+7
-2
@@ -225,7 +225,7 @@ public class ApiDeviceController {
|
||||
log.info("开始下发设备指令: deviceId={}, qrcodeType={}", deviceId, qrcodeType);
|
||||
try {
|
||||
// 1. 生成随机订单号
|
||||
String orderNo = deviceId;
|
||||
String orderNo = generateRandomOrderNo();
|
||||
|
||||
// 2. 根据设备ID和二维码类型获取二维码信息
|
||||
Map<String, Object> qrcodeResult = orderCenterService.getQrcodeByDeviceId(deviceId, qrcodeType);
|
||||
@@ -256,7 +256,12 @@ public class ApiDeviceController {
|
||||
* 生成随机订单号
|
||||
*/
|
||||
private String generateRandomOrderNo() {
|
||||
return "CMD_" + System.currentTimeMillis() + "_" + (int)(Math.random() * 1000);
|
||||
// 生成13位随机数字
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < 13; i++) {
|
||||
sb.append((int)(Math.random() * 10));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user