Merge branch 'dev_order' into test6.8.2
Showing
10 changed files
with
115 additions
and
72 deletions
@@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl; | @@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl; | ||
3 | import com.yoho.error.ServiceError; | 3 | import com.yoho.error.ServiceError; |
4 | import com.yoho.error.exception.ServiceException; | 4 | import com.yoho.error.exception.ServiceException; |
5 | import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; | 5 | import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; |
6 | +import com.yohobuy.ufo.model.order.common.SkupStatus; | ||
6 | import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; | 7 | import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; |
7 | import com.yohoufo.common.helper.ImageUrlAssist; | 8 | import com.yohoufo.common.helper.ImageUrlAssist; |
8 | import com.yohoufo.common.utils.DateUtil; | 9 | import com.yohoufo.common.utils.DateUtil; |
@@ -28,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -28,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
28 | /** | 29 | /** |
29 | * Created by chenchao on 2018/9/20. | 30 | * Created by chenchao on 2018/9/20. |
30 | */ | 31 | */ |
31 | -public abstract class AbsOrderDetailService implements IOrderDetailService{ | 32 | +public abstract class AbsOrderDetailService extends AbsOrderViewService implements IOrderDetailService{ |
32 | 33 | ||
33 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 34 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
34 | 35 | ||
@@ -53,13 +54,8 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | @@ -53,13 +54,8 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | ||
53 | 54 | ||
54 | abstract AddressInfo getHiddenAddressInfo(int uid, long orderCode, int skup); | 55 | abstract AddressInfo getHiddenAddressInfo(int uid, long orderCode, int skup); |
55 | 56 | ||
56 | - Long getDeliverLeftTime(int buyerUid, long orderCode, Integer orderStatus){ | ||
57 | - if (OrderStatus.HAS_PAYED.getCode() == orderStatus){ | ||
58 | - return ordersPayService.getDeliverLeftTime(buyerUid, orderCode); | ||
59 | - }else{ | ||
60 | - return null; | ||
61 | - } | ||
62 | - } | 57 | + |
58 | + | ||
63 | /** | 59 | /** |
64 | * 获取订单详情 | 60 | * 获取订单详情 |
65 | * @param orderRequest | 61 | * @param orderRequest |
@@ -181,7 +177,7 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | @@ -181,7 +177,7 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | ||
181 | //只有卖家在查看买家的订单时才有 | 177 | //只有卖家在查看买家的订单时才有 |
182 | assembleSoldPrdCompute(orderDetailInfo, buyerOrder.getSellerUid(), buyerOrderGoods.getSkup()); | 178 | assembleSoldPrdCompute(orderDetailInfo, buyerOrder.getSellerUid(), buyerOrderGoods.getSkup()); |
183 | 179 | ||
184 | - orderDetailInfo.setDeliverLeftTime(getDeliverLeftTime(buyerUid, orderCode, buyerOrder.getStatus())); | 180 | + //orderDetailInfo.setDeliverLeftTime(getDeliverLeftTime(buyerUid, orderCode, buyerOrder.getStatus())); |
185 | return orderDetailInfo; | 181 | return orderDetailInfo; |
186 | } | 182 | } |
187 | 183 | ||
@@ -208,9 +204,7 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | @@ -208,9 +204,7 @@ public abstract class AbsOrderDetailService implements IOrderDetailService{ | ||
208 | protected abstract OrderDetailInfo.StatusDetail getStatusDetail(BuyerOrder buyerOrder,OrderStatus orderStatus, TabType tabType) ; | 204 | protected abstract OrderDetailInfo.StatusDetail getStatusDetail(BuyerOrder buyerOrder,OrderStatus orderStatus, TabType tabType) ; |
209 | 205 | ||
210 | 206 | ||
211 | - protected int calLeftTime(int creatTime){ | ||
212 | - return OrderInfo.PAY_TIME_SECOND -(DateUtil.getCurrentTimeSecond() - creatTime); | ||
213 | - } | 207 | + |
214 | 208 | ||
215 | /** | 209 | /** |
216 | * 用于从cache中获取数据后,重置动态数据 | 210 | * 用于从cache中获取数据后,重置动态数据 |
@@ -26,13 +26,10 @@ import java.util.stream.Collectors; | @@ -26,13 +26,10 @@ import java.util.stream.Collectors; | ||
26 | /** | 26 | /** |
27 | * Created by chenchao on 2018/9/19. | 27 | * Created by chenchao on 2018/9/19. |
28 | */ | 28 | */ |
29 | -public abstract class AbsOrderListService implements IOrderListService{ | 29 | +public abstract class AbsOrderListService extends AbsOrderViewService implements IOrderListService{ |
30 | 30 | ||
31 | private final Logger logger = LoggerFactory.getLogger(getClass()); | 31 | private final Logger logger = LoggerFactory.getLogger(getClass()); |
32 | 32 | ||
33 | - @Autowired | ||
34 | - private OrdersPayService ordersPayService; | ||
35 | - | ||
36 | abstract List<Integer> initOrderListRequest(OrderListRequest request); | 33 | abstract List<Integer> initOrderListRequest(OrderListRequest request); |
37 | 34 | ||
38 | abstract int getTotal(int uid, List<Integer> statusQuery); | 35 | abstract int getTotal(int uid, List<Integer> statusQuery); |
@@ -43,13 +40,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -43,13 +40,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
43 | 40 | ||
44 | abstract List<SellerOrderGoods> getBaseOrderGoodsList(List<Integer> skups); | 41 | abstract List<SellerOrderGoods> getBaseOrderGoodsList(List<Integer> skups); |
45 | 42 | ||
46 | - Long getDeliverLeftTime(int buyerUid, long orderCode, Integer orderStatus){ | ||
47 | - if (OrderStatus.HAS_PAYED.getCode() == orderStatus){ | ||
48 | - return ordersPayService.getDeliverLeftTime(buyerUid, orderCode); | ||
49 | - }else{ | ||
50 | - return null; | ||
51 | - } | ||
52 | - } | 43 | + |
53 | /** | 44 | /** |
54 | * 订单列表 | 45 | * 订单列表 |
55 | * @param request | 46 | * @param request |
@@ -102,9 +93,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -102,9 +93,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
102 | 93 | ||
103 | } | 94 | } |
104 | 95 | ||
105 | - protected int calLeftTime(int creatTime){ | ||
106 | - return OrderInfo.PAY_TIME_SECOND - (DateUtil.getCurrentTimeSecond() - creatTime); | ||
107 | - } | 96 | + |
108 | /** | 97 | /** |
109 | * 获取返回结果 | 98 | * 获取返回结果 |
110 | * @param buyerOrderGoodsMap | 99 | * @param buyerOrderGoodsMap |
@@ -123,8 +112,10 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -123,8 +112,10 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
123 | * 3.查询 seller_order_goods | 112 | * 3.查询 seller_order_goods |
124 | */ | 113 | */ |
125 | OrderListInfo orderListInfo = new OrderListInfo(); | 114 | OrderListInfo orderListInfo = new OrderListInfo(); |
126 | - orderListInfo.setUid(buyerOrder.getUid()); | ||
127 | - orderListInfo.setOrderCode(buyerOrder.getOrderCode()); | 115 | + Integer buyerUid; |
116 | + Long orderCode; | ||
117 | + orderListInfo.setUid(buyerUid=buyerOrder.getUid()); | ||
118 | + orderListInfo.setOrderCode(orderCode=buyerOrder.getOrderCode()); | ||
128 | orderListInfo.setRealPrice(buyerOrder.getAmount() == null ? "" : buyerOrder.getAmount().toPlainString()); | 119 | orderListInfo.setRealPrice(buyerOrder.getAmount() == null ? "" : buyerOrder.getAmount().toPlainString()); |
129 | // 订单中状态显示 | 120 | // 订单中状态显示 |
130 | orderListInfo.setStatus(buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus()); | 121 | orderListInfo.setStatus(buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus()); |
@@ -132,7 +123,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -132,7 +123,7 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
132 | 123 | ||
133 | if (orderStatus == null){ | 124 | if (orderStatus == null){ |
134 | logger.warn("getOrderList orderStatus not exist, uid is {}, orderCode is {}, status is {}", | 125 | logger.warn("getOrderList orderStatus not exist, uid is {}, orderCode is {}, status is {}", |
135 | - buyerOrder.getUid(), orderListInfo.getOrderCode(), buyerOrder.getStatus()); | 126 | + buyerUid,orderCode, buyerOrder.getStatus()); |
136 | return null; | 127 | return null; |
137 | } | 128 | } |
138 | 129 | ||
@@ -142,10 +133,8 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -142,10 +133,8 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
142 | orderListInfo.setButtons(orderStatus.getListButtons(tabType)); | 133 | orderListInfo.setButtons(orderStatus.getListButtons(tabType)); |
143 | 134 | ||
144 | // 当订单状态是待付款, 显示leftTime | 135 | // 当订单状态是待付款, 显示leftTime |
145 | - if (orderListInfo.getStatus() == OrderStatus.WAITING_PAY.getCode()){ | ||
146 | - orderListInfo.setLeftTime(calLeftTime(buyerOrder.getCreateTime())); | ||
147 | - } | ||
148 | - | 136 | + Integer leftTime = getLeftTime(tabType, buyerUid, orderCode, buyerOrder.getStatus(), buyerOrder.getCreateTime()); |
137 | + orderListInfo.setLeftTime(leftTime); | ||
149 | BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMap.get(buyerOrder.getOrderCode()); | 138 | BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMap.get(buyerOrder.getOrderCode()); |
150 | if (buyerOrderGoods == null){ | 139 | if (buyerOrderGoods == null){ |
151 | logger.warn("getOrderList buyer goods not exist, uid is {}, orderCode is {}", | 140 | logger.warn("getOrderList buyer goods not exist, uid is {}, orderCode is {}", |
@@ -173,9 +162,6 @@ public abstract class AbsOrderListService implements IOrderListService{ | @@ -173,9 +162,6 @@ public abstract class AbsOrderListService implements IOrderListService{ | ||
173 | orderListInfo.setGoodsInfo(goodsInfo); | 162 | orderListInfo.setGoodsInfo(goodsInfo); |
174 | orderListInfo.setSecendLevelCreateTime(buyerOrder.getCreateTime()); | 163 | orderListInfo.setSecendLevelCreateTime(buyerOrder.getCreateTime()); |
175 | orderListInfo.setCreateTime(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); | 164 | orderListInfo.setCreateTime(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); |
176 | - // | ||
177 | - orderListInfo.setDeliverLeftTime(getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(), | ||
178 | - buyerOrder.getStatus())); | ||
179 | return orderListInfo; | 165 | return orderListInfo; |
180 | } | 166 | } |
181 | 167 |
1 | +package com.yohoufo.order.service.impl; | ||
2 | + | ||
3 | +import com.yohobuy.ufo.model.order.bo.OrderInfo; | ||
4 | +import com.yohobuy.ufo.model.order.common.OrderStatus; | ||
5 | +import com.yohobuy.ufo.model.order.common.SkupStatus; | ||
6 | +import com.yohobuy.ufo.model.order.common.TabType; | ||
7 | +import com.yohoufo.common.utils.DateUtil; | ||
8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
9 | + | ||
10 | +/** | ||
11 | + * Created by chao.chen on 2018/11/26. | ||
12 | + */ | ||
13 | +public abstract class AbsOrderViewService { | ||
14 | + | ||
15 | + @Autowired | ||
16 | + private OrdersPayService ordersPayService; | ||
17 | + | ||
18 | + Integer getLeftTime(TabType actor, Integer uid, Long orderCode, Integer orderStatus, Integer createTime){ | ||
19 | + Integer leftTime =null; | ||
20 | + Integer payLeftTime = getPayLeftTime(actor, orderStatus, | ||
21 | + createTime); | ||
22 | + Integer deliverLeftTime = null; | ||
23 | + | ||
24 | + if (uid != null && orderCode != null && orderStatus!= null){ | ||
25 | + deliverLeftTime = getDeliverLeftTime(uid, orderCode, | ||
26 | + orderStatus); | ||
27 | + } | ||
28 | + | ||
29 | + if (payLeftTime != null){ | ||
30 | + leftTime = payLeftTime; | ||
31 | + } | ||
32 | + if (deliverLeftTime !=null ){ | ||
33 | + leftTime = deliverLeftTime; | ||
34 | + } | ||
35 | + | ||
36 | + return leftTime; | ||
37 | + } | ||
38 | + | ||
39 | + Integer getPayLeftTime(TabType actor, Integer orderStatus, int createTime){ | ||
40 | + boolean isBuyer = actor.equals(TabType.BUY); | ||
41 | + boolean isSeller = actor.equals(TabType.SELL); | ||
42 | + Integer leftTime = null; | ||
43 | + boolean isFiredCal = (isBuyer && orderStatus == OrderStatus.WAITING_PAY.getCode()) | ||
44 | + || (isSeller && orderStatus == SkupStatus.CAN_NOT_SELL.getCode()); | ||
45 | + if(isFiredCal){ | ||
46 | + leftTime = calLeftTime(createTime); | ||
47 | + } | ||
48 | + return leftTime; | ||
49 | + } | ||
50 | + | ||
51 | + Integer getDeliverLeftTime(int buyerUid, long orderCode, Integer orderStatus){ | ||
52 | + Integer leftTime = null; | ||
53 | + if (OrderStatus.HAS_PAYED.getCode() == orderStatus){ | ||
54 | + leftTime = ordersPayService.getDeliverLeftTime(buyerUid, orderCode); | ||
55 | + } | ||
56 | + return leftTime; | ||
57 | + } | ||
58 | + | ||
59 | + protected int calLeftTime(int creatTime){ | ||
60 | + return OrderInfo.PAY_TIME_SECOND - (DateUtil.getCurrentTimeSecond() - creatTime); | ||
61 | + } | ||
62 | +} |
@@ -177,6 +177,8 @@ public class BuyerOrderCancelService { | @@ -177,6 +177,8 @@ public class BuyerOrderCancelService { | ||
177 | //(退费)退保证金给卖家 | 177 | //(退费)退保证金给卖家 |
178 | logger.info("in BuyerCancelAfterProcessTask call buyerUid {}, orderCode {}, skup {}, transferCase {}, compensate {}", | 178 | logger.info("in BuyerCancelAfterProcessTask call buyerUid {}, orderCode {}, skup {}, transferCase {}, compensate {}", |
179 | buyerUid, orderCode, skup, transferCase, compensate); | 179 | buyerUid, orderCode, skup, transferCase, compensate); |
180 | + PayRefundBo prb = null; | ||
181 | + try { | ||
180 | SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode); | 182 | SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode); |
181 | int sellerUid = sellerOrder.getUid(); | 183 | int sellerUid = sellerOrder.getUid(); |
182 | long sellerOrderCode = sellerOrder.getOrderCode(); | 184 | long sellerOrderCode = sellerOrder.getOrderCode(); |
@@ -188,7 +190,7 @@ public class BuyerOrderCancelService { | @@ -188,7 +190,7 @@ public class BuyerOrderCancelService { | ||
188 | .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(sellerOrder.getOrderCode()) | 190 | .buyerUid(buyerUid).sellerUid(sellerUid).orderCode(sellerOrder.getOrderCode()) |
189 | .payType(sellerOrder.getPayment()).refundCase(RefundCase.SELLER_EARNEST_MONEY) | 191 | .payType(sellerOrder.getPayment()).refundCase(RefundCase.SELLER_EARNEST_MONEY) |
190 | .skup(skup); | 192 | .skup(skup); |
191 | - PayRefundBo prb = payRefundService.refund(req, bleb); | 193 | + prb = payRefundService.refund(req, bleb); |
192 | 194 | ||
193 | //(转账)瓜分指定赔偿款给卖家和平台 | 195 | //(转账)瓜分指定赔偿款给卖家和平台 |
194 | 196 | ||
@@ -212,7 +214,12 @@ public class BuyerOrderCancelService { | @@ -212,7 +214,12 @@ public class BuyerOrderCancelService { | ||
212 | payRefundService.refund(rprOfBuyer, blebOfBuyer); | 214 | payRefundService.refund(rprOfBuyer, blebOfBuyer); |
213 | logger.info("out BuyerCancelAfterProcessTask call buyerUid {}, orderCode {}, skup {}, transferCase {}, compensate {}", | 215 | logger.info("out BuyerCancelAfterProcessTask call buyerUid {}, orderCode {}, skup {}, transferCase {}, compensate {}", |
214 | buyerUid, orderCode, skup, transferCase, compensate); | 216 | buyerUid, orderCode, skup, transferCase, compensate); |
217 | + }catch (Exception ex){ | ||
218 | + logger.info("occur error BuyerCancelAfterProcessTask call buyerUid {}, orderCode {}, skup {}, transferCase {}, compensate {}", | ||
219 | + buyerUid, orderCode, skup, transferCase, compensate, ex); | ||
220 | + } | ||
215 | return prb; | 221 | return prb; |
222 | + | ||
216 | } | 223 | } |
217 | } | 224 | } |
218 | 225 |
@@ -129,10 +129,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO | @@ -129,10 +129,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO | ||
129 | .build(); | 129 | .build(); |
130 | 130 | ||
131 | // 待付款时,剩余时间 | 131 | // 待付款时,剩余时间 |
132 | - if (orderStatus.getCode() == OrderStatus.WAITING_PAY.getCode()){ | ||
133 | - int leftTime = calLeftTime(buyerOrder.getCreateTime()); | 132 | + int leftTime = getLeftTime(tabType,buyerOrder.getUid(), buyerOrder.getOrderCode(), orderStatus.getCode(), buyerOrder.getCreateTime()); |
134 | statusDetail.setLeftTime(leftTime); | 133 | statusDetail.setLeftTime(leftTime); |
135 | - } | ||
136 | boolean isShowWaitingTime = OrderStatus.WAITING_RECEIVE.getCode() == orderStatus.getCode(); | 134 | boolean isShowWaitingTime = OrderStatus.WAITING_RECEIVE.getCode() == orderStatus.getCode(); |
137 | if(isShowWaitingTime){ | 135 | if(isShowWaitingTime){ |
138 | int leftSeconds = BuyerConfirmHandler.DELAY_MINUTES_7_DAYS*60 - (DateUtil.getCurrentTimeSecond()-buyerOrder.getUpdateTime()); | 136 | int leftSeconds = BuyerConfirmHandler.DELAY_MINUTES_7_DAYS*60 - (DateUtil.getCurrentTimeSecond()-buyerOrder.getUpdateTime()); |
@@ -147,12 +145,14 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO | @@ -147,12 +145,14 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO | ||
147 | 145 | ||
148 | @Override | 146 | @Override |
149 | protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) { | 147 | protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) { |
150 | - if (orderDetailInfo.getStatusDetail().getStatus() == OrderStatus.WAITING_PAY.getCode()){ | ||
151 | - int leftTime = calLeftTime(orderDetailInfo.getSecendLevelCreateTime()); | 148 | + |
149 | + Integer leftTime = getLeftTime(TabType.BUY, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(), | ||
150 | + orderDetailInfo.getStatusDetail().getStatus(), orderDetailInfo.getSecendLevelCreateTime()); | ||
151 | + | ||
152 | orderDetailInfo.getStatusDetail().setLeftTime(leftTime); | 152 | orderDetailInfo.getStatusDetail().setLeftTime(leftTime); |
153 | - orderDetailInfo.setDeliverLeftTime(getDeliverLeftTime(orderDetailInfo.getUid(), | ||
154 | - orderDetailInfo.getOrderCode(), orderDetailInfo.getStatusDetail().getStatus())); | ||
155 | - } | ||
156 | } | 153 | } |
157 | 154 | ||
155 | + | ||
156 | + | ||
157 | + | ||
158 | } | 158 | } |
@@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl; | @@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl; | ||
3 | import com.yoho.error.ServiceError; | 3 | import com.yoho.error.ServiceError; |
4 | import com.yoho.error.exception.ServiceException; | 4 | import com.yoho.error.exception.ServiceException; |
5 | import com.yohobuy.ufo.model.order.common.OrderStatus; | 5 | import com.yohobuy.ufo.model.order.common.OrderStatus; |
6 | +import com.yohobuy.ufo.model.order.common.TabType; | ||
6 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; | 7 | import com.yohobuy.ufo.model.order.resp.OrderListInfo; |
7 | import com.yohobuy.ufo.model.order.common.OrderListType; | 8 | import com.yohobuy.ufo.model.order.common.OrderListType; |
8 | import com.yohoufo.common.helper.ImageUrlAssist; | 9 | import com.yohoufo.common.helper.ImageUrlAssist; |
@@ -92,11 +93,9 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO | @@ -92,11 +93,9 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO | ||
92 | protected void resetDynamicProporties(List<OrderListInfo> list) { | 93 | protected void resetDynamicProporties(List<OrderListInfo> list) { |
93 | if(CollectionUtils.isNotEmpty(list)){ | 94 | if(CollectionUtils.isNotEmpty(list)){ |
94 | list.forEach(oli -> { | 95 | list.forEach(oli -> { |
95 | - | ||
96 | - if (oli.getStatus() == OrderStatus.WAITING_PAY.getCode()){ | ||
97 | - oli.setLeftTime(calLeftTime(oli.getSecendLevelCreateTime())); | ||
98 | - } | ||
99 | - oli.setDeliverLeftTime(getDeliverLeftTime(oli.getUid(), oli.getOrderCode(), oli.getStatus())); | 96 | + Integer leftTime = getLeftTime(TabType.BUY, oli.getUid(), oli.getOrderCode(), oli.getStatus(), |
97 | + oli.getSecendLevelCreateTime()); | ||
98 | + oli.setLeftTime(leftTime); | ||
100 | }); | 99 | }); |
101 | } | 100 | } |
102 | } | 101 | } |
@@ -16,11 +16,11 @@ public class OrdersPayService { | @@ -16,11 +16,11 @@ public class OrdersPayService { | ||
16 | @Autowired | 16 | @Autowired |
17 | private OrdersPayMapper ordersPayMapper; | 17 | private OrdersPayMapper ordersPayMapper; |
18 | 18 | ||
19 | - public Long getDeliverLeftTime(int buyerUid, long orderCode){ | 19 | + public Integer getDeliverLeftTime(int buyerUid, long orderCode){ |
20 | OrdersPay ordersPay = ordersPayMapper.selectOrdersPay(orderCode, buyerUid); | 20 | OrdersPay ordersPay = ordersPayMapper.selectOrdersPay(orderCode, buyerUid); |
21 | if (ordersPay == null){ | 21 | if (ordersPay == null){ |
22 | return null; | 22 | return null; |
23 | } | 23 | } |
24 | - return (long)DelayTime.MINUTES_36_HOURS * 60 - (DateUtil.getCurrentTimeSecond()-ordersPay.getCreateTime()); | 24 | + return DelayTime.MINUTES_36_HOURS * 60 - (DateUtil.getCurrentTimeSecond()-ordersPay.getCreateTime()); |
25 | } | 25 | } |
26 | } | 26 | } |
@@ -285,11 +285,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -285,11 +285,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
285 | .paymentTips(skupStatus.getPaymentTips()) | 285 | .paymentTips(skupStatus.getPaymentTips()) |
286 | .build(); | 286 | .build(); |
287 | 287 | ||
288 | - // 待付款时,剩余时间 | ||
289 | - if (skupStatus.getCode() == SkupStatus.CAN_NOT_SELL.getCode()){ | ||
290 | - int leftTime = calLeftTime(order.getCreateTime()); | 288 | + // 待付款时 或待发货,剩余时间 |
289 | + | ||
290 | + int leftTime = getPayLeftTime(TabType.SELL, skupStatus.getCode(), order.getCreateTime()); | ||
291 | statusDetail.setLeftTime(leftTime); | 291 | statusDetail.setLeftTime(leftTime); |
292 | - } | ||
293 | 292 | ||
294 | return statusDetail; | 293 | return statusDetail; |
295 | } | 294 | } |
@@ -375,7 +374,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -375,7 +374,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
375 | .statuStr(orderStatus.getStatusStr(tabType)) | 374 | .statuStr(orderStatus.getStatusStr(tabType)) |
376 | .detailDesc(orderStatus.getDetailDesc(tabType)) | 375 | .detailDesc(orderStatus.getDetailDesc(tabType)) |
377 | .build(); | 376 | .build(); |
378 | - | 377 | + Integer deliverLeftTime = getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(), buyerOrder.getStatus()); |
378 | + if (deliverLeftTime != null){ | ||
379 | + statusDetail.setLeftTime(deliverLeftTime); | ||
380 | + } | ||
379 | if(sellerViewExpressStatus.contains(orderStatus.getCode())){ | 381 | if(sellerViewExpressStatus.contains(orderStatus.getCode())){ |
380 | statusDetail.setExpressShow(true); | 382 | statusDetail.setExpressShow(true); |
381 | } | 383 | } |
@@ -384,16 +386,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | @@ -384,16 +386,10 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I | ||
384 | 386 | ||
385 | @Override | 387 | @Override |
386 | protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) { | 388 | protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) { |
387 | - if (orderDetailInfo.getStatusDetail().getStatus() == SkupStatus.CAN_NOT_SELL.getCode()){ | ||
388 | - int leftTime = calLeftTime(orderDetailInfo.getSecendLevelCreateTime()); | 389 | + |
390 | + Integer leftTime = getLeftTime(TabType.SELL, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(), | ||
391 | + orderDetailInfo.getStatusDetail().getStatus(), orderDetailInfo.getSecendLevelCreateTime()); | ||
392 | + | ||
389 | orderDetailInfo.getStatusDetail().setLeftTime(leftTime); | 393 | orderDetailInfo.getStatusDetail().setLeftTime(leftTime); |
390 | } | 394 | } |
391 | - List<BuyerOrderGoods> bogList = buyerOrderGoodsMapper.selectBySkups(Arrays.asList(orderDetailInfo.getGoodsInfo().getSkup())); | ||
392 | - if (CollectionUtils.isNotEmpty(bogList)){ | ||
393 | - //存在时说明已经有买家下单 当前状态来自于买家订单 | ||
394 | - BuyerOrderGoods bog = bogList.get(0); | ||
395 | - int status = orderDetailInfo.getStatusDetail().getStatus(); | ||
396 | - orderDetailInfo.setDeliverLeftTime(getDeliverLeftTime(bog.getUid(), bog.getOrderCode(), status)); | ||
397 | - } | ||
398 | - } | ||
399 | } | 395 | } |
@@ -142,7 +142,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | @@ -142,7 +142,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde | ||
142 | //存在时说明已经有买家下单 当前状态来自于买家订单 | 142 | //存在时说明已经有买家下单 当前状态来自于买家订单 |
143 | BuyerOrderGoods bog = bogList.get(0); | 143 | BuyerOrderGoods bog = bogList.get(0); |
144 | int status = oli.getStatus(); | 144 | int status = oli.getStatus(); |
145 | - oli.setDeliverLeftTime(getDeliverLeftTime(bog.getUid(), bog.getOrderCode(), status)); | 145 | + Integer leftTime = getDeliverLeftTime(bog.getUid(), bog.getOrderCode(), status); |
146 | + if (leftTime != null) { | ||
147 | + oli.setLeftTime(leftTime); | ||
148 | + } | ||
146 | } | 149 | } |
147 | 150 | ||
148 | }); | 151 | }); |
-
Please register or login to post a comment