|
@@ -2049,6 +2049,10 @@ public class OrderServiceImpl implements OrderService {
|
|
|
userDao.update(userEntity);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// TODO 查询使用的优惠券,并减扣金额
|
|
|
String couponSn = (String) userInfo.get("couponSn");
|
|
|
// 获取当前时间
|
|
@@ -2223,34 +2227,35 @@ public class OrderServiceImpl implements OrderService {
|
|
|
resultObj.put("time", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
resultObj.put("orderNo", order.getOrder_sn()); //
|
|
|
|
|
|
+ resultObj.put("phone",(String) userInfo.get("customPhone"));
|
|
|
// 通知WebSocket
|
|
|
WebSocketServer.sendMessage(sessionId, order.getOrder_sn(), order.getStore_id()
|
|
|
+ "");
|
|
|
|
|
|
// TODO 下单流程完成了,现在将下单的库存明细存入表中,准备发送到中控
|
|
|
- List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
|
|
|
-// orderGoodsVoList
|
|
|
- for (OrderGoodsVo orderGoodsVo : orderGoodsVoList) {
|
|
|
- KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
|
|
|
- ktoEccsEntity.setRequestData(JSON.toJSONString(orderGoodsVo));
|
|
|
- ktoEccsEntity.setRequestType("03");
|
|
|
- ktoEccsEntity.setSendStatus("00");
|
|
|
- ktoEccsEntity.setCreaterSn(user.getUserId()+"");
|
|
|
- ktoEccsEntity.setCreateTime(new Date());
|
|
|
- ktoEccsEntities.add(ktoEccsEntity);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if(ktoEccsEntities.size() > 0){
|
|
|
- if(ktoEccsEntities.size() > 50){
|
|
|
- List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
|
|
|
- for (List<KtoEccsEntity> ktoEccs : partition) {
|
|
|
- ktoEccsService.saveBatch(ktoEccs);
|
|
|
- }
|
|
|
- }else{
|
|
|
- ktoEccsService.saveBatch(ktoEccsEntities);
|
|
|
- }
|
|
|
- }
|
|
|
+// List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
|
|
|
+//// orderGoodsVoList
|
|
|
+// for (OrderGoodsVo orderGoodsVo : orderGoodsVoList) {
|
|
|
+// KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
|
|
|
+// ktoEccsEntity.setRequestData(JSON.toJSONString(orderGoodsVo));
|
|
|
+// ktoEccsEntity.setRequestType("03");
|
|
|
+// ktoEccsEntity.setSendStatus("00");
|
|
|
+// ktoEccsEntity.setCreaterSn(user.getUserId()+"");
|
|
|
+// ktoEccsEntity.setCreateTime(new Date());
|
|
|
+// ktoEccsEntities.add(ktoEccsEntity);
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// if(ktoEccsEntities.size() > 0){
|
|
|
+// if(ktoEccsEntities.size() > 50){
|
|
|
+// List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
|
|
|
+// for (List<KtoEccsEntity> ktoEccs : partition) {
|
|
|
+// ktoEccsService.saveBatch(ktoEccs);
|
|
|
+// }
|
|
|
+// }else{
|
|
|
+// ktoEccsService.saveBatch(ktoEccsEntities);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
return resultObj;
|
|
@@ -2520,8 +2525,8 @@ public class OrderServiceImpl implements OrderService {
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- if (times >= 120) {
|
|
|
- throw new RuntimeException("超过20s未支付,订单下单失败");
|
|
|
+ if (times >= 60) {
|
|
|
+ throw new RuntimeException("超过60s未支付,订单下单失败");
|
|
|
}
|
|
|
times++;
|
|
|
}
|
|
@@ -2601,6 +2606,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
orderDao.updateOrderInfo(orderRaram);
|
|
|
LOGGER.info(">>>>>>>>>>>>>>>>>>>>wxOrderByTransactionIdQueryUpdFail 根据支付单查询微信接口返回信息:state 【" + result.getTrade_state() +
|
|
|
"】,des【" + result.getTrade_state_desc() + "】");
|
|
|
+ return false;
|
|
|
} else if (result.getTrade_state().equalsIgnoreCase(Dict.tradeState.item_PAYERROR.getItem())) {
|
|
|
Map orderRaram = Maps.newHashMap();
|
|
|
orderRaram.put("payStatus", Dict.payStatus.item_8.getItem());
|
|
@@ -2609,6 +2615,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
orderDao.updateOrderInfo(orderRaram);
|
|
|
LOGGER.info(">>>>>>>>>>>>>>>>>>>>wxOrderByTransactionIdQueryUpdFail 根据支付单查询微信接口返回信息:state 【" + result.getTrade_state() +
|
|
|
"】,des【" + result.getTrade_state_desc() + "】");
|
|
|
+ return false;
|
|
|
} else if (result.getTrade_state().equalsIgnoreCase(Dict.tradeState.item_USERPAYING.getItem())) {
|
|
|
Map orderRaram = Maps.newHashMap();
|
|
|
orderRaram.put("payStatus", Dict.payStatus.item_1.getItem());
|
|
@@ -2620,6 +2627,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
} else if (result.getTrade_state().equalsIgnoreCase(Dict.tradeState.item_REVOKED.getItem())) {
|
|
|
LOGGER.info(">>>>>>>>>>>>>>>>>>>>wxOrderByTransactionIdQueryUpdFail 根据支付单查询微信接口返回信息:state 【" + result.getTrade_state() +
|
|
|
"】,des【" + result.getTrade_state_desc() + "】");
|
|
|
+ return false;
|
|
|
}
|
|
|
} else {
|
|
|
LOGGER.info(">>>>>>>>>>>>>>>>>>>>wxOrderQuery 微信查询接口返回失败信息:code 【" + result.getErr_code() +
|