yujian
2019-07-31 f4548a3ee46afe45da4ee2a42dc169c575deee9f
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java
@@ -6,8 +6,6 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
@@ -32,7 +30,8 @@
   @Resource
   private HongBaoOrderService hongBaoOrderService;
   @Transactional(propagation = Propagation.NESTED, rollbackFor = Exception.class)
   // @Transactional(propagation = Propagation.NESTED, rollbackFor =
   // Exception.class)
   public boolean addOrder(Order order) throws Exception {
      order.setVersion(2);
      WriteLock writeLock = orderLock.writeLock();
@@ -79,31 +78,10 @@
      return true;
   }
   @Transactional
   public List<Order> setOrderState(final String orderid, final int orderType) {
      List<Order> orderList = orderMapper.selectOrderByOrderIdAndOrderType(orderid, orderType);
      if (orderList != null)
         for (Order order : orderList) {
            if (order.getDrawbackTime() == null || order.getDrawbackTime() <= 0) {
               Order updateOrder = new Order();
               updateOrder.setId(order.getId());
               updateOrder.setDrawbackTime(java.lang.System.currentTimeMillis());
               updateOrder.setState(Order.STATE_SHIXIAO);
               orderMapper.updateByPrimaryKeySelective(updateOrder);
               order.setDrawbackTime(updateOrder.getDrawbackTime());
               order.setState(updateOrder.getState());
            }
         }
      return orderList;
   }
   @Override
   public Order findOrderByOrderIdAndType(String orderId, int type) {
      List<Order> list = orderMapper.selectOrderByOrderIdAndOrderType(orderId, type);
      if (list.size() > 0) {
         return list.get(0);
      }
      return null;
      Order order = orderMapper.selectOrderByOrderIdAndOrderType(orderId, type);
      return order;
   }
   @Override