|
@@ -16,20 +16,15 @@ import com.yohobuy.ufo.model.order.vo.GoodsVo; |
|
@@ -16,20 +16,15 @@ import com.yohobuy.ufo.model.order.vo.GoodsVo; |
16
|
import com.yohobuy.ufo.model.order.vo.ProductVo;
|
16
|
import com.yohobuy.ufo.model.order.vo.ProductVo;
|
17
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
17
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
18
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
18
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
19
|
-import com.yohoufo.dal.order.AppraiseOrderGoodsMapper;
|
|
|
20
|
-import com.yohoufo.dal.order.AppraiseOrderMapper;
|
|
|
21
|
-import com.yohoufo.dal.order.AppraiseOrderMetaMapper;
|
|
|
22
|
-import com.yohoufo.dal.order.AppraiseOrderStorageMapper;
|
|
|
23
|
-import com.yohoufo.dal.order.model.AppraiseOrder;
|
|
|
24
|
-import com.yohoufo.dal.order.model.AppraiseOrderGoods;
|
|
|
25
|
-import com.yohoufo.dal.order.model.AppraiseOrderMeta;
|
|
|
26
|
-import com.yohoufo.dal.order.model.AppraiseOrderStorage;
|
19
|
+import com.yohoufo.dal.order.*;
|
|
|
20
|
+import com.yohoufo.dal.order.model.*;
|
27
|
import com.yohoufo.order.constants.MetaKey;
|
21
|
import com.yohoufo.order.constants.MetaKey;
|
28
|
import com.yohoufo.order.convert.ProductConvertor;
|
22
|
import com.yohoufo.order.convert.ProductConvertor;
|
29
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
23
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
30
|
import com.yohoufo.order.service.impl.AbsOrderViewService;
|
24
|
import com.yohoufo.order.service.impl.AbsOrderViewService;
|
31
|
import com.yohoufo.order.utils.LoggerUtils;
|
25
|
import com.yohoufo.order.utils.LoggerUtils;
|
32
|
import lombok.Builder;
|
26
|
import lombok.Builder;
|
|
|
27
|
+import org.apache.commons.collections.CollectionUtils;
|
33
|
import org.slf4j.Logger;
|
28
|
import org.slf4j.Logger;
|
34
|
import org.springframework.beans.factory.annotation.Autowired;
|
29
|
import org.springframework.beans.factory.annotation.Autowired;
|
35
|
import org.springframework.stereotype.Service;
|
30
|
import org.springframework.stereotype.Service;
|
|
@@ -56,6 +51,9 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -56,6 +51,9 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
56
|
@Autowired
|
51
|
@Autowired
|
57
|
private AppraiseOrderMetaMapper appraiseOrderMetaMapper;
|
52
|
private AppraiseOrderMetaMapper appraiseOrderMetaMapper;
|
58
|
|
53
|
|
|
|
54
|
+ @Autowired
|
|
|
55
|
+ private OrdersPayRefundMapper ordersPayRefundMapper;
|
|
|
56
|
+
|
59
|
public PageResp<SellerDepositOrderListResp> getOrderList(SellerDepositOrderListReq req ){
|
57
|
public PageResp<SellerDepositOrderListResp> getOrderList(SellerDepositOrderListReq req ){
|
60
|
PageResp.PageRespBuilder<SellerDepositOrderListResp> respBuilder = PageResp.builder();
|
58
|
PageResp.PageRespBuilder<SellerDepositOrderListResp> respBuilder = PageResp.builder();
|
61
|
SellerDepositOrderListType sellerDepositOrderListType = SellerDepositOrderListType.getByCode(req.getListType());
|
59
|
SellerDepositOrderListType sellerDepositOrderListType = SellerDepositOrderListType.getByCode(req.getListType());
|
|
@@ -136,6 +134,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -136,6 +134,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
136
|
.build();
|
134
|
.build();
|
137
|
}
|
135
|
}
|
138
|
|
136
|
|
|
|
137
|
+ /**
|
|
|
138
|
+ * 由子订单维度组成的列表
|
|
|
139
|
+ * 携带鉴定信息
|
|
|
140
|
+ * @param req
|
|
|
141
|
+ * @return
|
|
|
142
|
+ */
|
139
|
public PageResp<DepositOrderInStorePrdListResp> getDepositOrderListInStore(SellerDepositOrderPrdListReq req){
|
143
|
public PageResp<DepositOrderInStorePrdListResp> getDepositOrderListInStore(SellerDepositOrderPrdListReq req){
|
140
|
Long orderCode = req.getOrderCode();
|
144
|
Long orderCode = req.getOrderCode();
|
141
|
int total = appraiseOrderMapper.selectSubOrderCnt(orderCode);
|
145
|
int total = appraiseOrderMapper.selectSubOrderCnt(orderCode);
|
|
@@ -148,6 +152,7 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -148,6 +152,7 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
148
|
int offset = (req.getPage() - 1) * limit;
|
152
|
int offset = (req.getPage() - 1) * limit;
|
149
|
List<AppraiseOrder> paoList = appraiseOrderMapper.selectSubOrderList(orderCode, offset, limit);
|
153
|
List<AppraiseOrder> paoList = appraiseOrderMapper.selectSubOrderList(orderCode, offset, limit);
|
150
|
List<Long> orderCodes = paoList.parallelStream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
|
154
|
List<Long> orderCodes = paoList.parallelStream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList());
|
|
|
155
|
+ List<String> orderCodeStrs = paoList.parallelStream().map(ao-> String.valueOf(ao.getOrderCode())).collect(Collectors.toList());
|
151
|
//
|
156
|
//
|
152
|
List<AppraiseOrderGoods> paogList = appraiseOrderGoodsMapper.selectByOrderCodes(orderCodes);
|
157
|
List<AppraiseOrderGoods> paogList = appraiseOrderGoodsMapper.selectByOrderCodes(orderCodes);
|
153
|
Map<Long, AppraiseOrderGoods> orderCodeAppraiseOrderGoodsMap = paogList.parallelStream()
|
158
|
Map<Long, AppraiseOrderGoods> orderCodeAppraiseOrderGoodsMap = paogList.parallelStream()
|
|
@@ -156,9 +161,17 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -156,9 +161,17 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
156
|
List<AppraiseOrderStorage> paosList = appraiseOrderStorageMapper.selectByOrderCodes(orderCodes);
|
161
|
List<AppraiseOrderStorage> paosList = appraiseOrderStorageMapper.selectByOrderCodes(orderCodes);
|
157
|
Map<Long,AppraiseOrderStorage> orderCodeAppraiseOrderStorageMap = paosList.parallelStream()
|
162
|
Map<Long,AppraiseOrderStorage> orderCodeAppraiseOrderStorageMap = paosList.parallelStream()
|
158
|
.collect(Collectors.toMap(AppraiseOrderStorage::getOrderCode, Function.identity()));
|
163
|
.collect(Collectors.toMap(AppraiseOrderStorage::getOrderCode, Function.identity()));
|
|
|
164
|
+ //
|
|
|
165
|
+ List<OrdersPayRefund> ordersPayRefundList = ordersPayRefundMapper.selectByRefundCodes(orderCodeStrs);
|
|
|
166
|
+ Map<String, OrdersPayRefund> orderCodeStrOPRMap = CollectionUtils.isEmpty(ordersPayRefundList) ?
|
|
|
167
|
+ new HashMap<>(1) : ordersPayRefundList
|
|
|
168
|
+ .parallelStream().collect(Collectors.toMap(OrdersPayRefund::getRefundCode, Function.identity()));
|
|
|
169
|
+
|
159
|
List<DepositOrderInStorePrdListResp> dataList = paoList.parallelStream()
|
170
|
List<DepositOrderInStorePrdListResp> dataList = paoList.parallelStream()
|
160
|
- .map(pao->buildDepositOrderInStorePrdListResp(pao, orderCodeAppraiseOrderGoodsMap.get(pao.getOrderCode()),
|
|
|
161
|
- orderCodeAppraiseOrderStorageMap.get(pao.getOrderCode())))
|
171
|
+ .map(pao->buildDepositOrderInStorePrdListResp(pao,
|
|
|
172
|
+ orderCodeAppraiseOrderGoodsMap.get(pao.getOrderCode()),
|
|
|
173
|
+ orderCodeAppraiseOrderStorageMap.get(pao.getOrderCode()),
|
|
|
174
|
+ orderCodeStrOPRMap.get(String.valueOf(pao.getOrderCode()))))
|
162
|
.collect(Collectors.toList());
|
175
|
.collect(Collectors.toList());
|
163
|
|
176
|
|
164
|
respBuilder.data(dataList);
|
177
|
respBuilder.data(dataList);
|
|
@@ -168,11 +181,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -168,11 +181,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
168
|
|
181
|
|
169
|
DepositOrderInStorePrdListResp buildDepositOrderInStorePrdListResp(AppraiseOrder pao,
|
182
|
DepositOrderInStorePrdListResp buildDepositOrderInStorePrdListResp(AppraiseOrder pao,
|
170
|
AppraiseOrderGoods paog,
|
183
|
AppraiseOrderGoods paog,
|
171
|
- AppraiseOrderStorage paos){
|
184
|
+ AppraiseOrderStorage paos,
|
|
|
185
|
+ OrdersPayRefund ordersPayRefund){
|
172
|
|
186
|
|
173
|
AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
|
187
|
AppraiseOrderStatus appraiseOrderStatus = AppraiseOrderStatus.getByCode(pao.getStatus());
|
174
|
OrderAttributes oa = OrderAttributes.getOrderAttributes(pao.getAttributes());
|
188
|
OrderAttributes oa = OrderAttributes.getOrderAttributes(pao.getAttributes());
|
175
|
- String refundEarnestMoney = null;
|
189
|
+ String refundEarnestMoney = ordersPayRefund == null? null : ordersPayRefund.getAmount().toPlainString();
|
176
|
GoodsVo goods = GoodsVo.builder()
|
190
|
GoodsVo goods = GoodsVo.builder()
|
177
|
.productName(paog.getProductName())
|
191
|
.productName(paog.getProductName())
|
178
|
.imgUrl(ImageUrlAssist.getAllProductPicUrl(paog.getImageUrl(), "goodsimg", "center", "d2hpdGU="))
|
192
|
.imgUrl(ImageUrlAssist.getAllProductPicUrl(paog.getImageUrl(), "goodsimg", "center", "d2hpdGU="))
|
|
@@ -194,7 +208,11 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -194,7 +208,11 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
194
|
return OrderAttributes.DEPOSITE;
|
208
|
return OrderAttributes.DEPOSITE;
|
195
|
}
|
209
|
}
|
196
|
|
210
|
|
197
|
-
|
211
|
+ /**
|
|
|
212
|
+ * skn 维度商品列表
|
|
|
213
|
+ * @param req
|
|
|
214
|
+ * @return
|
|
|
215
|
+ */
|
198
|
public PageResp<ProductVo> getSknList(SellerDepositOrderPrdListReq req){
|
216
|
public PageResp<ProductVo> getSknList(SellerDepositOrderPrdListReq req){
|
199
|
Long orderCode = req.getOrderCode();
|
217
|
Long orderCode = req.getOrderCode();
|
200
|
int total = appraiseOrderGoodsMapper.selectCntByOrderCode(orderCode);
|
218
|
int total = appraiseOrderGoodsMapper.selectCntByOrderCode(orderCode);
|
|
@@ -219,7 +237,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
|
@@ -219,7 +237,12 @@ public class SellerDepositOrderListService extends AbsOrderViewService { |
219
|
.collect(Collectors.toCollection(()->new ArrayList<>(paogs.size())));
|
237
|
.collect(Collectors.toCollection(()->new ArrayList<>(paogs.size())));
|
220
|
}
|
238
|
}
|
221
|
|
239
|
|
222
|
-
|
240
|
+ /**
|
|
|
241
|
+ * skn维度的商品列表
|
|
|
242
|
+ * 每一个skn聚合sku列表
|
|
|
243
|
+ * @param req
|
|
|
244
|
+ * @return
|
|
|
245
|
+ */
|
223
|
public PageResp<ProductVo> getSkuList(SellerDepositOrderPrdListReq req){
|
246
|
public PageResp<ProductVo> getSkuList(SellerDepositOrderPrdListReq req){
|
224
|
final Long orderCode = req.getOrderCode();
|
247
|
final Long orderCode = req.getOrderCode();
|
225
|
int total = appraiseOrderGoodsMapper.selectCntByOrderCode(orderCode);
|
248
|
int total = appraiseOrderGoodsMapper.selectCntByOrderCode(orderCode);
|