|
|
@@ -63,7 +63,6 @@ import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
|
-import java.util.stream.IntStream;
|
|
|
|
|
|
@Service
|
|
|
@Slf4j
|
|
|
@@ -889,6 +888,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
if (tbOrder.getStatus().equals(4)) {
|
|
|
return Result.success();
|
|
|
}
|
|
|
+ log.info("操作完成订单4:"+order.getOrderId());
|
|
|
Result result = this.accomplishOrder(order.getOrderId());
|
|
|
if("500".equals(String.valueOf(result.get("code")))){
|
|
|
return result;
|
|
|
@@ -1013,8 +1013,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
return Result.error("系统繁忙,请稍后再试!");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @Transactional
|
|
|
@Override
|
|
|
public Result accomplishOrder(Long orderId) {
|
|
|
reentrantReadWriteLock.writeLock().lock();
|
|
|
@@ -1038,7 +1036,9 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public Result accomplishOrders(Long orderId, Integer type) {
|
|
|
+ log.info("订单id:"+orderId+",类型:"+type);
|
|
|
TbOrder tbOrder = appOrderDao.selectById(orderId);
|
|
|
+ log.info("订单状态 :"+tbOrder.getStatus());
|
|
|
if (tbOrder.getStatus().equals(4)) {
|
|
|
return Result.success();
|
|
|
}
|
|
|
@@ -1067,7 +1067,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
appOrderDao.updateById(tbOrder);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
GoodsShop goodsShop = shopMessageService.selectShopId(tbOrder.getShopId());
|
|
|
//计算商户应得金额
|
|
|
|
|
|
@@ -1117,7 +1116,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
}*/
|
|
|
}
|
|
|
|
|
|
-
|
|
|
tbOrder.setShopIncomeMoney(shopMoney);
|
|
|
appOrderDao.updateById(tbOrder);
|
|
|
//添加商户用户钱包收入记录
|
|
|
@@ -1206,6 +1204,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
//计算当前订单什么时候超时完成
|
|
|
LocalDateTime overDateTime = updateTime.plusHours(Integer.parseInt(one.getValue()));
|
|
|
if (LocalDateTime.now().isAfter(overDateTime)) {
|
|
|
+ log.info("操作完成订单6:"+tbOrder.getOrderId());
|
|
|
accomplishOrders(tbOrder.getOrderId(),2);
|
|
|
//管理端完成订单,则消息通知用户
|
|
|
//添加消息记录
|
|
|
@@ -1324,7 +1323,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
|
|
|
if (tbOrder.getStatus() == 7) {
|
|
|
UserEntity userEntity = userDao.selectById(tbOrder.getUserId());
|
|
|
//已支付判断支付方式
|
|
|
-
|
|
|
if (tbOrder.getPayType() == 2) {
|
|
|
//余额支付,直接退还钱包
|
|
|
userMoneyDao.updateMayMoney(1, tbOrder.getUserId(), tbOrder.getPayMoney().doubleValue());
|