...
|
...
|
@@ -83,53 +83,56 @@ public class UserOrdersServiceImpl implements IUserOrdersService,IBusinessExport |
|
|
if(count>0){
|
|
|
userOrdersList = userOrdersDAO.selectUserOrderList(beginTime,endTime,String.valueOf(orderCode),unionId,idList,reqBO.getStart(),reqBO.getSize());
|
|
|
}
|
|
|
for(UserOrders userOrders:userOrdersList){
|
|
|
List<Orders> ordersList = new ArrayList<>();
|
|
|
for (UserOrders userOrders : userOrdersList) {
|
|
|
//根据查询出来的uid,ordercode,查询ERP_ORDERS.Orders
|
|
|
// Orders orders = ordersMapper.selectByUidAndOrderCode(userOrders.getuId(),Long.valueOf(userOrders.getOrderCode()));
|
|
|
Orders orders = ordersMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
|
|
List<Orders> order = ordersMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
|
|
ordersList.addAll(order);
|
|
|
}
|
|
|
for (Orders orders : ordersList) {
|
|
|
UnionOrderRspBO orderRspBO = new UnionOrderRspBO();
|
|
|
//优惠券金额
|
|
|
OrdersCoupons ordersCoupons = ordersCouponsMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
|
|
|
if(null!=ordersCoupons){
|
|
|
OrdersCoupons ordersCoupons = ordersCouponsMapper.selectByOrderCode(Long.valueOf(orders.getOrderCode()));
|
|
|
if (null != ordersCoupons) {
|
|
|
orderRspBO.setCouponAmount(ordersCoupons.getCouponAmount());
|
|
|
}else{
|
|
|
} else {
|
|
|
orderRspBO.setCouponAmount(new BigDecimal(0));
|
|
|
}
|
|
|
//防止订单数据没有在ERP中
|
|
|
if(null!=orders){
|
|
|
//订单金额
|
|
|
orderRspBO.setOrderAmount(orders.getOrderAmount());
|
|
|
orderRspBO.setYohoCoinNum(orders.getYohoCoinNum());
|
|
|
//运费
|
|
|
orderRspBO.setShipmentAmount(orders.getShippingCost());
|
|
|
//实际支付金额
|
|
|
orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
|
|
|
//订单状态
|
|
|
orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
|
|
|
//附加信息
|
|
|
orderRspBO.setExetInfmoation(orders.getRemark());
|
|
|
//支付方式
|
|
|
orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
|
|
|
//是否新客---从新的表中获取
|
|
|
OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(userOrders.getOrderCode()));
|
|
|
if(null !=ordersAccessOry){
|
|
|
orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew()==null?"N":ordersAccessOry.getIsNew()));
|
|
|
}else {
|
|
|
orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
|
|
|
}
|
|
|
|
|
|
orderRspBO.setUid(orders.getUid());
|
|
|
//订单金额
|
|
|
orderRspBO.setOrderAmount(orders.getOrderAmount());
|
|
|
orderRspBO.setYohoCoinNum(orders.getYohoCoinNum());
|
|
|
//运费
|
|
|
orderRspBO.setShipmentAmount(orders.getShippingCost());
|
|
|
//实际支付金额
|
|
|
orderRspBO.setRealPayAmount(orders.getLastOrderAmount().subtract(orders.getShippingCost()));
|
|
|
//订单状态
|
|
|
orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
|
|
|
//附加信息
|
|
|
orderRspBO.setExetInfmoation(orders.getRemark());
|
|
|
//支付方式
|
|
|
orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
|
|
|
//是否新客---从新的表中获取
|
|
|
OrdersAccessOry ordersAccessOry = ordersAccessOryMapper.selectByPrimaryKey(Long.valueOf(orders.getOrderCode()));
|
|
|
if (null != ordersAccessOry) {
|
|
|
orderRspBO.setIsNew(NewUserEnum.getNameByCode(ordersAccessOry.getIsNew() == null ? "N" : ordersAccessOry.getIsNew()));
|
|
|
} else {
|
|
|
orderRspBO.setIsNew(NewUserEnum.getNameByCode("N"));
|
|
|
}
|
|
|
|
|
|
orderRspBO.setOrderCode(Integer.valueOf(userOrders.getOrderCode()));
|
|
|
orderRspBO.setId(userOrders.getId());
|
|
|
orderRspBO.setOrderTime(DateUtil.long2DateStr(Long.valueOf(userOrders.getCreateTime()) * Long.valueOf(1000), "yyyy-MM-dd"));
|
|
|
orderRspBO.setUnionId(userOrders.getUid());
|
|
|
MktMarketingUrl mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(userOrders.getUid()));
|
|
|
if(mktMarketingUrl!=null){
|
|
|
orderRspBO.setUnionType(mktMarketingUrl.getName());
|
|
|
orderRspBO.setUid(orders.getUid());
|
|
|
orderRspBO.setOrderCode(orders.getOrderCode().intValue());
|
|
|
orderRspBO.setId(orders.getId());
|
|
|
orderRspBO.setOrderTime(DateUtil.long2DateStr(Long.valueOf(orders.getCreateTime()) * Long.valueOf(1000), "yyyy-MM-dd"));
|
|
|
UserOrders userOrders = userOrdersDAO.selectByOrderCode(orders.getParentOrderCode());
|
|
|
if(userOrders!=null){
|
|
|
orderRspBO.setUnionId(userOrders.getUid());
|
|
|
MktMarketingUrl mktMarketingUrl = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(userOrders.getUid()));
|
|
|
if (mktMarketingUrl != null) {
|
|
|
orderRspBO.setUnionType(mktMarketingUrl.getName());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
unionOrderRspBOList.add(orderRspBO);
|
|
|
}
|
|
|
PageUnionOrderRspBO pageUnionOrderRspBO = new PageUnionOrderRspBO();
|
...
|
...
|
|