|
@@ -66,10 +66,10 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
response.setAll(getCount(Constants.ORDER_STATUS_ALL, type));
|
|
response.setAll(getCount(Constants.ORDER_STATUS_ALL, type));
|
|
// 未支付订单
|
|
// 未支付订单
|
|
response.setUnPaid(getCount(Constants.ORDER_STATUS_UNPAID, type));
|
|
response.setUnPaid(getCount(Constants.ORDER_STATUS_UNPAID, type));
|
|
- // 未发货订单
|
|
|
|
- response.setNotShipped(getCount(Constants.ORDER_STATUS_NOT_SHIPPED, type));
|
|
|
|
|
|
+ // 待发货订单
|
|
|
|
+ response.setNotShipped(getCount(Constants.ORDER_STATUS_WAIT_DELIVER, type));
|
|
// 待收货订单
|
|
// 待收货订单
|
|
- response.setSpike(getCount(Constants.ORDER_STATUS_SPIKE, type));
|
|
|
|
|
|
+ response.setSpike(getCount(Constants.ORDER_STATUS_WAIT_RECEIVER, type));
|
|
// // 待评价订单
|
|
// // 待评价订单
|
|
// response.setBargain(getCount(Constants.ORDER_STATUS_BARGAIN, type));
|
|
// response.setBargain(getCount(Constants.ORDER_STATUS_BARGAIN, type));
|
|
// // 交易完成订单
|
|
// // 交易完成订单
|
|
@@ -78,9 +78,9 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
// response.setToBeWrittenOff(getCount(Constants.ORDER_STATUS_TOBE_WRITTEN_OFF, type));
|
|
// response.setToBeWrittenOff(getCount(Constants.ORDER_STATUS_TOBE_WRITTEN_OFF, type));
|
|
// // 退款中订单
|
|
// // 退款中订单
|
|
// response.setRefunding(getCount(Constants.ORDER_STATUS_REFUNDING, type));
|
|
// response.setRefunding(getCount(Constants.ORDER_STATUS_REFUNDING, type));
|
|
- // 已退款订单
|
|
|
|
- response.setRefunded(getCount(Constants.ORDER_STATUS_REFUNDED, type));
|
|
|
|
- // 已删除订单
|
|
|
|
|
|
+// // 已退款订单
|
|
|
|
+// response.setRefunded(getCount(Constants.ORDER_STATUS_REFUNDED, type));
|
|
|
|
+// // 已删除订单
|
|
// response.setDeleted(getCount(Constants.ORDER_STATUS_DELETED, type));
|
|
// response.setDeleted(getCount(Constants.ORDER_STATUS_DELETED, type));
|
|
return response;
|
|
return response;
|
|
}
|
|
}
|
|
@@ -877,7 +877,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<StoreOrder> appList(StoreOrderAppDTO dto) {
|
|
|
|
|
|
+ public List<StoreOrderVO> appList(StoreOrderAppDTO dto) {
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
criteria.andEqualTo("isDelete", 0);
|
|
criteria.andEqualTo("isDelete", 0);
|
|
@@ -916,10 +916,43 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- List<StoreOrder> orderList = findByCondition(condition);
|
|
|
|
|
|
+ List<StoreOrder> list = findByCondition(condition);
|
|
|
|
+ List<StoreOrderVO> arrayList = new ArrayList<>();
|
|
|
|
+ List<StoreOrderInfo> infoArrayList = new ArrayList<>();
|
|
|
|
+ List<StoreOrderStatus> statusList = new ArrayList<>();
|
|
|
|
+ List<UserAddress> addressList = new ArrayList<>();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
+ Condition infoCondition = new Condition(StoreOrderInfo.class);
|
|
|
|
+ Example.Criteria infoCriteria = infoCondition.createCriteria();
|
|
|
|
+ infoCriteria.andEqualTo("isDelete", 0);
|
|
|
|
+ infoCriteria.andIn("orderId", list.stream().map(StoreOrder::getId).collect(Collectors.toList()));
|
|
|
|
+ infoArrayList = storeOrderInfoService.findByCondition(infoCondition);
|
|
|
|
|
|
|
|
+ Condition statusCondition = new Condition(StoreOrderStatus.class);
|
|
|
|
+ Example.Criteria statusCriteria = statusCondition.createCriteria();
|
|
|
|
+ statusCriteria.andIn("oid", list.stream().map(StoreOrder::getId).collect(Collectors.toList()));
|
|
|
|
+ statusList = storeOrderStatusService.findByCondition(statusCondition);
|
|
|
|
|
|
- return orderList;
|
|
|
|
|
|
+ Condition addressCondition = new Condition(UserAddress.class);
|
|
|
|
+ Example.Criteria addressCriteria = addressCondition.createCriteria();
|
|
|
|
+ addressCriteria.andEqualTo("isDelete", 0);
|
|
|
|
+ addressCriteria.andIn("id", list.stream().map(StoreOrder::getUid).collect(Collectors.toList()));
|
|
|
|
+ addressList = userAddressService.findByCondition(addressCondition);
|
|
|
|
+ }
|
|
|
|
+ List<StoreOrderInfo> finalInfoArrayList = infoArrayList;
|
|
|
|
+ List<StoreOrderStatus> finalStatusList = statusList;
|
|
|
|
+ List<UserAddress> finalAddressList = addressList;
|
|
|
|
+ list.forEach(item -> {
|
|
|
|
+ StoreOrderVO vo = new StoreOrderVO();
|
|
|
|
+ BeanUtils.copyProperties(item, vo);
|
|
|
|
+ List<StoreOrderInfo> infoCollect = finalInfoArrayList.stream().filter(info -> info.getOrderId().equals(item.getId())).collect(Collectors.toList());
|
|
|
|
+ vo.setOrderInfoVO(infoCollect);
|
|
|
|
+ vo.setOrderStatusVO(finalStatusList.stream().filter(status -> status.getOid().equals(item.getId())).collect(Collectors.toList()));
|
|
|
|
+ vo.setBrokerage(BigDecimal.ONE);
|
|
|
|
+ vo.setOrderAddressVO(finalAddressList.stream().filter(address -> address.getId().equals(item.getUid())).findFirst().orElse(null));
|
|
|
|
+ arrayList.add(vo);
|
|
|
|
+ });
|
|
|
|
+ return arrayList;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -932,7 +965,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
return this.findByCondition(condition);
|
|
return this.findByCondition(condition);
|
|
}
|
|
}
|
|
|
|
|
|
- private Integer getCount(String status, Integer type) {
|
|
|
|
|
|
+ private Integer getCount(Integer status, Integer type) {
|
|
//总数只计算时间
|
|
//总数只计算时间
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
@@ -950,8 +983,8 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
*
|
|
*
|
|
* @param status String 类型
|
|
* @param status String 类型
|
|
*/
|
|
*/
|
|
- private void getStatusWhereNew(Example.Criteria criteria, String status) {
|
|
|
|
- if (StrUtil.isBlank(status)) {
|
|
|
|
|
|
+ private void getStatusWhereNew(Example.Criteria criteria, Integer status) {
|
|
|
|
+ if (status == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
switch (status) {
|
|
switch (status) {
|
|
@@ -962,51 +995,31 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
criteria.andEqualTo("status", 0);
|
|
criteria.andEqualTo("status", 0);
|
|
criteria.andEqualTo("isDelete", 0);
|
|
criteria.andEqualTo("isDelete", 0);
|
|
break;
|
|
break;
|
|
- case Constants.ORDER_STATUS_NOT_SHIPPED:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("status", 0);
|
|
|
|
- criteria.andEqualTo("refundStatus", 0);
|
|
|
|
- criteria.andEqualTo("shippingType", 1);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_SPIKE:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("status", 1);
|
|
|
|
- criteria.andEqualTo("refundStatus", 0);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_BARGAIN:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("status", 2);
|
|
|
|
- criteria.andEqualTo("refundStatus", 0);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_COMPLETE:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("status", 3);
|
|
|
|
- criteria.andEqualTo("refundStatus", 0);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_TOBE_WRITTEN_OFF:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("status", 0);
|
|
|
|
- criteria.andEqualTo("refundStatus", 0);
|
|
|
|
- criteria.andEqualTo("shippingType", 2);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_REFUNDING:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andIn("refundStatus", Arrays.asList(1, 3));
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_REFUNDED:
|
|
|
|
- criteria.andEqualTo("paid", 1);
|
|
|
|
- criteria.andEqualTo("refundStatus", 2);
|
|
|
|
- criteria.andEqualTo("isDelete", 0);
|
|
|
|
- break;
|
|
|
|
- case Constants.ORDER_STATUS_DELETED:
|
|
|
|
- criteria.andEqualTo("isDelete", 1);
|
|
|
|
- break;
|
|
|
|
|
|
+// case Constants.ORDER_STATUS_WAIT_DELIVER:
|
|
|
|
+// criteria.andEqualTo("paid", 1);
|
|
|
|
+// criteria.andEqualTo("status", 0);
|
|
|
|
+// criteria.andEqualTo("refundStatus", 0);
|
|
|
|
+// criteria.andEqualTo("shippingType", 1);
|
|
|
|
+// criteria.andEqualTo("isDelete", 0);
|
|
|
|
+// break;
|
|
|
|
+// case Constants.ORDER_STATUS_WAIT_RECEIVER:
|
|
|
|
+// criteria.andEqualTo("paid", 1);
|
|
|
|
+// criteria.andEqualTo("status", 1);
|
|
|
|
+// criteria.andEqualTo("refundStatus", 0);
|
|
|
|
+// criteria.andEqualTo("isDelete", 0);
|
|
|
|
+// break;
|
|
|
|
+// case Constants.ORDER_STATUS_BARGAIN:
|
|
|
|
+// criteria.andEqualTo("paid", 1);
|
|
|
|
+// criteria.andEqualTo("status", 2);
|
|
|
|
+// criteria.andEqualTo("refundStatus", 0);
|
|
|
|
+// criteria.andEqualTo("isDelete", 0);
|
|
|
|
+// break;
|
|
|
|
+// case Constants.ORDER_STATUS_COMPLETE:
|
|
|
|
+// criteria.andEqualTo("paid", 1);
|
|
|
|
+// criteria.andEqualTo("status", 3);
|
|
|
|
+// criteria.andEqualTo("refundStatus", 0);
|
|
|
|
+// criteria.andEqualTo("isDelete", 0);
|
|
|
|
+// break;
|
|
default:
|
|
default:
|
|
criteria.andEqualTo("paid", 1);
|
|
criteria.andEqualTo("paid", 1);
|
|
criteria.andNotEqualTo("refundStatus", 2);
|
|
criteria.andNotEqualTo("refundStatus", 2);
|