From e35bf36eca5d2bdf59ddfe489f69ad44ef0eb67b Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 17 九月 2019 09:45:34 +0800
Subject: [PATCH] 品牌
---
fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java | 37 +++++++++----------------------------
1 files changed, 9 insertions(+), 28 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java
index 9eb6697..e907fe4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderServiceImpl.java
+++ b/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();
@@ -44,9 +43,12 @@
if (find != null) {
return false;
}
-
+ Integer orderType = order.getOrderType();
+ if (orderType == null) {
+ orderType = Order.ORDER_TYPE_TAOBAO;
+ }
// 鏌ユ壘鏄惁瀛樺湪鍒嗕韩璧氳鍗�
- if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS) > 0)
+ if (hongBaoOrderService.countByOrderNoAndHongBaoType(order.getOrderId(), HongBaoV2.TYPE_SHARE_GOODS, orderType) > 0)
return false;
orderMapper.insertSelective(order);
} finally {
@@ -79,31 +81,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
--
Gitblit v1.8.0