|
@@ -5,12 +5,12 @@ import com.yoho.error.ServiceError; |
|
@@ -5,12 +5,12 @@ import com.yoho.error.ServiceError; |
5
|
import com.yoho.error.exception.ServiceException;
|
5
|
import com.yoho.error.exception.ServiceException;
|
6
|
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
|
6
|
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
|
7
|
import com.yohoufo.common.utils.DateUtil;
|
7
|
import com.yohoufo.common.utils.DateUtil;
|
8
|
-import com.yohoufo.common.utils.PriceFormater;
|
|
|
9
|
import com.yohoufo.dal.order.*;
|
8
|
import com.yohoufo.dal.order.*;
|
10
|
import com.yohoufo.dal.order.model.*;
|
9
|
import com.yohoufo.dal.order.model.*;
|
11
|
-import com.yohoufo.order.common.*;
|
10
|
+import com.yohoufo.order.common.OrderCodeType;
|
|
|
11
|
+import com.yohoufo.order.common.Payment;
|
|
|
12
|
+import com.yohoufo.order.common.SkupStatus;
|
12
|
import com.yohoufo.order.constants.MetaKey;
|
13
|
import com.yohoufo.order.constants.MetaKey;
|
13
|
-import com.yohoufo.order.constants.OrderConstant;
|
|
|
14
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
14
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
15
|
import com.yohoufo.order.model.AddressInfo;
|
15
|
import com.yohoufo.order.model.AddressInfo;
|
16
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
16
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
@@ -58,6 +58,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -58,6 +58,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
58
|
@Autowired
|
58
|
@Autowired
|
59
|
private SellerOrderMetaMapper somMapper;
|
59
|
private SellerOrderMetaMapper somMapper;
|
60
|
|
60
|
|
|
|
61
|
+ private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
62
|
+ SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
63
|
+ SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
61
|
|
64
|
|
62
|
|
65
|
|
63
|
@Override
|
66
|
@Override
|
|
@@ -88,19 +91,18 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -88,19 +91,18 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
88
|
Integer skupStatusCode = sellerOrderGoods.getStatus();
|
91
|
Integer skupStatusCode = sellerOrderGoods.getStatus();
|
89
|
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
|
92
|
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
|
90
|
|
93
|
|
91
|
- SoldPrdComputeBo computeBo = getSoldPrdCompute(uid, skup);
|
|
|
92
|
|
94
|
|
93
|
SellerOrderMeta addressMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.BACK_2_SELLER_DELIVERY_ADDRESS);
|
95
|
SellerOrderMeta addressMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.BACK_2_SELLER_DELIVERY_ADDRESS);
|
94
|
AddressInfo addressInfo = JSONObject.parseObject(addressMeta.getMetaValue(), AddressInfo.class);
|
96
|
AddressInfo addressInfo = JSONObject.parseObject(addressMeta.getMetaValue(), AddressInfo.class);
|
95
|
|
97
|
|
96
|
- return buildOrderDetail(sellerOrder, skupStatus, sellerOrderGoods, computeBo, addressInfo);
|
98
|
+ return buildOrderDetail(sellerOrder, skupStatus, sellerOrderGoods, addressInfo);
|
97
|
}
|
99
|
}
|
98
|
|
100
|
|
99
|
return super.getOrderDetail(orderRequest);
|
101
|
return super.getOrderDetail(orderRequest);
|
100
|
}
|
102
|
}
|
101
|
|
103
|
|
102
|
-
|
|
|
103
|
- SoldPrdComputeBo getSoldPrdCompute(int uid, int skup){
|
104
|
+ @Override
|
|
|
105
|
+ void assembleSoldPrdCompute(OrderDetailInfo orderDetailInfo, int uid, int skup){
|
104
|
SellerOrderMeta feeMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE);
|
106
|
SellerOrderMeta feeMeta = somMapper.selectByMetaKey(uid, skup, MetaKey.SELLER_FEE);
|
105
|
boolean metaIsPresent = Objects.nonNull(feeMeta);
|
107
|
boolean metaIsPresent = Objects.nonNull(feeMeta);
|
106
|
SoldPrdComputeBo computeBo = null;
|
108
|
SoldPrdComputeBo computeBo = null;
|
|
@@ -108,7 +110,13 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -108,7 +110,13 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
108
|
SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class);
|
110
|
SellerOrderComputeResult computeResult = JSONObject.parseObject(feeMeta.getMetaValue(), SellerOrderComputeResult.class);
|
109
|
computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult);
|
111
|
computeBo = SellerOrderConvertor.computeResult2SoldPrdComputeBo(computeResult);
|
110
|
}
|
112
|
}
|
111
|
- return computeBo;
|
113
|
+ if(Objects.nonNull(computeBo)){
|
|
|
114
|
+ orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
115
|
+ orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
116
|
+ orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
117
|
+ orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
118
|
+ orderDetailInfo.setIncome(computeBo.getIncome());
|
|
|
119
|
+ }
|
112
|
}
|
120
|
}
|
113
|
|
121
|
|
114
|
/**
|
122
|
/**
|
|
@@ -165,6 +173,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -165,6 +173,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
165
|
*/
|
173
|
*/
|
166
|
private GoodsInfo getGoodsInfo(SellerOrderGoods sellerOrderGoods) {
|
174
|
private GoodsInfo getGoodsInfo(SellerOrderGoods sellerOrderGoods) {
|
167
|
GoodsInfo goodsInfo = new GoodsInfo();
|
175
|
GoodsInfo goodsInfo = new GoodsInfo();
|
|
|
176
|
+ goodsInfo.setSkup(sellerOrderGoods.getId());
|
168
|
goodsInfo.setProductName(sellerOrderGoods.getProductName());
|
177
|
goodsInfo.setProductName(sellerOrderGoods.getProductName());
|
169
|
goodsInfo.setColorName(sellerOrderGoods.getColorName());
|
178
|
goodsInfo.setColorName(sellerOrderGoods.getColorName());
|
170
|
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
|
179
|
goodsInfo.setSizeName(sellerOrderGoods.getSizeName());
|
|
@@ -199,9 +208,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -199,9 +208,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
199
|
return statusDetail;
|
208
|
return statusDetail;
|
200
|
}
|
209
|
}
|
201
|
|
210
|
|
202
|
- private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
203
|
- SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
204
|
- SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
211
|
+
|
205
|
|
212
|
|
206
|
private Long getOrderCode(SkupStatus skupStatus, SellerOrder order){
|
213
|
private Long getOrderCode(SkupStatus skupStatus, SellerOrder order){
|
207
|
Long orderCode;
|
214
|
Long orderCode;
|
|
@@ -214,8 +221,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -214,8 +221,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
214
|
}
|
221
|
}
|
215
|
|
222
|
|
216
|
private OrderDetailInfo buildOrderDetail(SellerOrder order, SkupStatus skupStatus,
|
223
|
private OrderDetailInfo buildOrderDetail(SellerOrder order, SkupStatus skupStatus,
|
217
|
- SellerOrderGoods sellerOrderGoods, SoldPrdComputeBo computeBo
|
|
|
218
|
- , AddressInfo addressInfo
|
224
|
+ SellerOrderGoods sellerOrderGoods, AddressInfo addressInfo
|
219
|
) {
|
225
|
) {
|
220
|
OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
|
226
|
OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
|
221
|
orderDetailInfo.setUid(order.getUid());
|
227
|
orderDetailInfo.setUid(order.getUid());
|
|
@@ -224,13 +230,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
@@ -224,13 +230,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
224
|
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
230
|
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
225
|
orderDetailInfo.setUserAddress(addressInfo);
|
231
|
orderDetailInfo.setUserAddress(addressInfo);
|
226
|
//卖家
|
232
|
//卖家
|
227
|
- orderDetailInfo.setIncome(order.getIncome().toPlainString());
|
|
|
228
|
- if(Objects.nonNull(computeBo)){
|
|
|
229
|
- orderDetailInfo.setEarnestMoneyStr(computeBo.getEarnestMoneyStr());
|
|
|
230
|
- orderDetailInfo.setEarnestMoney(computeBo.getEarnestMoney());
|
|
|
231
|
- orderDetailInfo.setBankTransferFee(computeBo.getBankTransferFee());
|
|
|
232
|
- orderDetailInfo.setPlatformFee(computeBo.getPlatformFee());
|
|
|
233
|
- }
|
233
|
+ assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
|
234
|
|
234
|
|
235
|
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
|
235
|
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
|
236
|
orderDetailInfo.setStatusDetail(statusDetail);
|
236
|
orderDetailInfo.setStatusDetail(statusDetail);
|