|
@@ -83,53 +83,56 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport |
|
@@ -83,53 +83,56 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport |
83
|
if(count>0){
|
83
|
if(count>0){
|
84
|
userOrdersList = userOrdersDAO.selectUserOrderList(beginTime,endTime,String.valueOf(orderCode),unionId,idList,reqBO.getStart(),reqBO.getSize());
|
84
|
userOrdersList = userOrdersDAO.selectUserOrderList(beginTime,endTime,String.valueOf(orderCode),unionId,idList,reqBO.getStart(),reqBO.getSize());
|
85
|
}
|
85
|
}
|
86
|
- for(UserOrders userOrders:userOrdersList){
|
86
|
+ List<Orders> ordersList = new ArrayList<>();
|
|
|
87
|
+ for (UserOrders userOrders : userOrdersList) {
|
87
|
//根据查询出来的uid,ordercode,查询ERP_ORDERS.Orders
|
88
|
//根据查询出来的uid,ordercode,查询ERP_ORDERS.Orders
|
88
|
// Orders orders = ordersMapper.selectByUidAndOrderCode(userOrders.getuId(),Long.valueOf(userOrders.getOrderCode()));
|
89
|
// Orders orders = ordersMapper.selectByUidAndOrderCode(userOrders.getuId(),Long.valueOf(userOrders.getOrderCode()));
|
89
|
- Orders orders = ordersMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
90
|
+ List<Orders> order = ordersMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
|
|
91
|
+ ordersList.addAll(order);
|
|
|
92
|
+ }
|
|
|
93
|
+ for (Orders orders : ordersList) {
|
90
|
UnionOrderRspBO orderRspBO = new UnionOrderRspBO();
|
94
|
UnionOrderRspBO orderRspBO = new UnionOrderRspBO();
|
91
|
//优惠券金额
|
95
|
//优惠券金额
|
92
|
- OrdersCoupons ordersCoupons = ordersCouponsMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
|
|
93
|
- if(null!=ordersCoupons){
|
96
|
+ OrdersCoupons ordersCoupons = ordersCouponsMapper.selectByOrderCode(Long.valueOf(orders.getOrderCode()));
|
|
|
97
|
+ if (null != ordersCoupons) {
|
94
|
orderRspBO.setCouponAmount(ordersCoupons.getCouponAmount());
|
98
|
orderRspBO.setCouponAmount(ordersCoupons.getCouponAmount());
|
95
|
- }else{
|
99
|
+ } else {
|
96
|
orderRspBO.setCouponAmount(new BigDecimal(0));
|
100
|
orderRspBO.setCouponAmount(new BigDecimal(0));
|
97
|
}
|
101
|
}
|
98
|
//防止订单数据没有在ERP中
|
102
|
//防止订单数据没有在ERP中
|
99
|
- if(null!=orders){
|
|
|
100
|
- //订单金额
|
|
|
101
|
- orderRspBO.setOrderAmount(orders.getOrderAmount());
|
|
|
102
|
- orderRspBO.setYohoCoinNum(orders.getYohoCoinNum());
|
|
|
103
|
- //运费
|
|
|
104
|
- orderRspBO.setShipmentAmount(orders.getShippingCost());
|
|
|
105
|
- //实际支付金额
|
|
|
106
|
- orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
|
|
|
107
|
- //订单状态
|
|
|
108
|
- orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
|
|
|
109
|
- //附加信息
|
|
|
110
|
- orderRspBO.setExetInfmoation(orders.getRemark());
|
|
|
111
|
- //支付方式
|
|
|
112
|
- orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
|
|
|
113
|
- //是否新客---从新的表中获取
|
|
|
114
|
- OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(userOrders.getOrderCode()));
|
|
|
115
|
- if(null !=ordersAccessOry){
|
|
|
116
|
- orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew()==null?"N":ordersAccessOry.getIsNew()));
|
|
|
117
|
- }else {
|
|
|
118
|
- orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
|
|
|
119
|
- }
|
|
|
120
|
|
103
|
|
121
|
- orderRspBO.setUid(orders.getUid());
|
104
|
+ //订单金额
|
|
|
105
|
+ orderRspBO.setOrderAmount(orders.getOrderAmount());
|
|
|
106
|
+ orderRspBO.setYohoCoinNum(orders.getYohoCoinNum());
|
|
|
107
|
+ //运费
|
|
|
108
|
+ orderRspBO.setShipmentAmount(orders.getShippingCost());
|
|
|
109
|
+ //实际支付金额
|
|
|
110
|
+ orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
|
|
|
111
|
+ //订单状态
|
|
|
112
|
+ orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
|
|
|
113
|
+ //附加信息
|
|
|
114
|
+ orderRspBO.setExetInfmoation(orders.getRemark());
|
|
|
115
|
+ //支付方式
|
|
|
116
|
+ orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
|
|
|
117
|
+ //是否新客---从新的表中获取
|
|
|
118
|
+ OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(orders.getOrderCode()));
|
|
|
119
|
+ if (null != ordersAccessOry) {
|
|
|
120
|
+ orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew() == null ? "N" : ordersAccessOry.getIsNew()));
|
|
|
121
|
+ } else {
|
|
|
122
|
+ orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
|
122
|
}
|
123
|
}
|
123
|
-
|
|
|
124
|
- orderRspBO.setOrderCode(Integer.valueOf(userOrders.getOrderCode()));
|
|
|
125
|
- orderRspBO.setId(userOrders.getId());
|
|
|
126
|
- orderRspBO.setOrderTime(DateUtil.long2DateStr(Long.valueOf(userOrders.getCreateTime()) * Long.valueOf(1000), "yyyy-MM-dd"));
|
|
|
127
|
- orderRspBO.setUnionId(userOrders.getUid());
|
|
|
128
|
- MktMarketingUrl mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(userOrders.getUid()));
|
|
|
129
|
- if(mktMarketingUrl!=null){
|
|
|
130
|
- orderRspBO.setUnionType(mktMarketingUrl.getName());
|
124
|
+ orderRspBO.setUid(orders.getUid());
|
|
|
125
|
+ orderRspBO.setOrderCode(orders.getOrderCode().intValue());
|
|
|
126
|
+ orderRspBO.setId(orders.getId());
|
|
|
127
|
+ orderRspBO.setOrderTime(DateUtil.long2DateStr(Long.valueOf(orders.getCreateTime()) * Long.valueOf(1000), "yyyy-MM-dd"));
|
|
|
128
|
+ UserOrders userOrders = userOrdersDAO.selectByOrderCode(orders.getParentOrderCode());
|
|
|
129
|
+ if(userOrders!=null){
|
|
|
130
|
+ orderRspBO.setUnionId(userOrders.getUid());
|
|
|
131
|
+ MktMarketingUrl mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(userOrders.getUid()));
|
|
|
132
|
+ if (mktMarketingUrl != null) {
|
|
|
133
|
+ orderRspBO.setUnionType(mktMarketingUrl.getName());
|
|
|
134
|
+ }
|
131
|
}
|
135
|
}
|
132
|
-
|
|
|
133
|
unionOrderRspBOList.add(orderRspBO);
|
136
|
unionOrderRspBOList.add(orderRspBO);
|
134
|
}
|
137
|
}
|
135
|
PageUnionOrderRspBO pageUnionOrderRspBO = new PageUnionOrderRspBO();
|
138
|
PageUnionOrderRspBO pageUnionOrderRspBO = new PageUnionOrderRspBO();
|