|
|
|
@ -139,6 +139,9 @@ public class OrderController extends BaseController { |
|
|
|
/** |
|
|
|
* {"appkey":"0acdbb709ee95707","goods":[{"goods_isli":"010007-00000000349999999999-2","use_years":"1"}], |
|
|
|
* "timestamp":"1667283296","user_isli":"899998-000000001640-3"} |
|
|
|
* |
|
|
|
* goods_isli=010007-00000000352199999999-4&is_car=2 |
|
|
|
* &user_isli=899998-000000001640-3&use_years=1&random=0.12520860309501458 |
|
|
|
*/ |
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
log.info("createOrder:"+reqstr); |
|
|
|
@ -152,18 +155,21 @@ public class OrderController extends BaseController { |
|
|
|
String redisKey = "createOrder_"+userIsli; |
|
|
|
Object redisCon = RedisUtil.get(redisKey); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> retmap = orderService.createOrder(userIsli,jGoodsArray); |
|
|
|
if(redisCon!=null){ |
|
|
|
jsonObject.put("code","error"); |
|
|
|
jsonObject.put("msg","请勿重复提交"); |
|
|
|
return jsonObject; |
|
|
|
}else{ |
|
|
|
// 10s redis
|
|
|
|
RedisUtil.set(redisKey,"1",10); |
|
|
|
} |
|
|
|
//count process use cost time
|
|
|
|
long end =System.currentTimeMillis(); |
|
|
|
long howuse = (end-start)/1000l; |
|
|
|
jsonObject.put("data",retmap); |
|
|
|
jsonObject.put("msg","成功"); |
|
|
|
jsonObject.put("data",retmap.get("rdata")); |
|
|
|
jsonObject.put("msg",retmap.get("msg")); |
|
|
|
jsonObject.put("useTime",howuse); |
|
|
|
return jsonObject; |
|
|
|
} |
|
|
|
|