|
|
@@ -1040,6 +1040,8 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
TbOrder tbOrder = appOrderDao.selectById(orderId);
|
|
|
log.info("订单状态 :"+tbOrder.getStatus());
|
|
|
if (tbOrder.getStatus().equals(4)) {
|
|
|
+ log.info("订单id【{}】,订单状态为【4】,属于已完成状态,直接返回", orderId);
|
|
|
+ log.info("订单id【{}】,accomplishOrders逻辑执行完成", orderId);
|
|
|
return Result.success();
|
|
|
}
|
|
|
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
|
|
@@ -1047,6 +1049,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
TbIndent indent = tbIndentService.getOne(new QueryWrapper<TbIndent>().eq("order_id", orderId));
|
|
|
if (type==1){
|
|
|
if (indent == null || !"4".equals(indent.getIndentState())) {
|
|
|
+ log.info("订单id【{}】,请等待骑手送达!", orderId);
|
|
|
return Result.error("请等待骑手送达!");
|
|
|
}
|
|
|
}
|
|
|
@@ -1067,9 +1070,10 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
appOrderDao.updateById(tbOrder);
|
|
|
}
|
|
|
|
|
|
+ log.info("订单id【{}】,开始计算商户应得金额", orderId);
|
|
|
+
|
|
|
GoodsShop goodsShop = shopMessageService.selectShopId(tbOrder.getShopId());
|
|
|
//计算商户应得金额
|
|
|
-
|
|
|
BigDecimal shopRate = goodsShop.getShopRate();
|
|
|
BigDecimal sumMoney = tbOrder.getPayMoney();
|
|
|
BigDecimal couponMoney = BigDecimal.ZERO;
|
|
|
@@ -1118,6 +1122,8 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
|
|
|
tbOrder.setShopIncomeMoney(shopMoney);
|
|
|
appOrderDao.updateById(tbOrder);
|
|
|
+ log.info("订单id【{}】,商户应得金额计算完毕", orderId);
|
|
|
+ log.info("订单id【{}】,开始添加商户用户钱包收入记录", orderId);
|
|
|
//添加商户用户钱包收入记录
|
|
|
UserMoneyDetails userMoneyDetails1 = new UserMoneyDetails();
|
|
|
userMoneyDetails1.setShopId(goodsShop.getShopId());
|
|
|
@@ -1159,8 +1165,12 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
userMoneyDetails1.setCreateTime(format);
|
|
|
userMoneyDetails1.setState(2);
|
|
|
userMoneyDetailsDao.insert(userMoneyDetails1);
|
|
|
+ log.info("订单id【{}】,商户用户钱包收入记录新增成功", orderId);
|
|
|
+
|
|
|
//将用户支付的金额转入商户用户钱包
|
|
|
userMoneyService.updateMoney(1, goodsShop.getUserId(), shopMoney.doubleValue());
|
|
|
+ log.info("订单id【{}】,商户用户钱包收入更新成功", orderId);
|
|
|
+
|
|
|
//管理端完成订单,则消息通知用户
|
|
|
//添加消息记录
|
|
|
MessageInfo messageInfo = new MessageInfo();
|
|
|
@@ -1191,6 +1201,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
UserEntity shopUser = userService.selectUserById(goodsShop.getUserId());
|
|
|
SenInfoCheckUtil.sendShopMsg(shopUser.getShopOpenId(), shopTemplate, msgListShop, 9);
|
|
|
|
|
|
+ log.info("订单id【{}】,accomplishOrders逻辑执行完成", orderId);
|
|
|
return Result.success();
|
|
|
}
|
|
|
|