|
@@ -818,6 +818,9 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
criteria.andEqualTo("isDelete", 0);
|
|
criteria.andEqualTo("isDelete", 0);
|
|
condition.setOrderByClause("create_time DESC");
|
|
condition.setOrderByClause("create_time DESC");
|
|
|
|
+ if (dto.getId() != null) {
|
|
|
|
+ criteria.andEqualTo("id", dto.getId());
|
|
|
|
+ }
|
|
if (dto.getOrderId() != null) {
|
|
if (dto.getOrderId() != null) {
|
|
criteria.andEqualTo("orderId", dto.getOrderId());
|
|
criteria.andEqualTo("orderId", dto.getOrderId());
|
|
}
|
|
}
|
|
@@ -862,7 +865,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
Condition addressCondition = new Condition(UserAddress.class);
|
|
Condition addressCondition = new Condition(UserAddress.class);
|
|
Example.Criteria addressCriteria = addressCondition.createCriteria();
|
|
Example.Criteria addressCriteria = addressCondition.createCriteria();
|
|
addressCriteria.andEqualTo("isDelete", 0);
|
|
addressCriteria.andEqualTo("isDelete", 0);
|
|
- addressCriteria.andIn("id", list.stream().map(StoreOrder::getUid).collect(Collectors.toList()));
|
|
|
|
|
|
+ addressCriteria.andIn("id", list.stream().map(StoreOrder::getAddressId).filter(Objects::nonNull).collect(Collectors.toList()));
|
|
addressList = userAddressService.findByCondition(addressCondition);
|
|
addressList = userAddressService.findByCondition(addressCondition);
|
|
}
|
|
}
|
|
List<StoreOrderInfo> finalInfoArrayList = infoArrayList;
|
|
List<StoreOrderInfo> finalInfoArrayList = infoArrayList;
|
|
@@ -875,7 +878,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
vo.setOrderInfoVO(infoCollect);
|
|
vo.setOrderInfoVO(infoCollect);
|
|
vo.setOrderStatusVO(finalStatusList.stream().filter(status -> status.getOid().equals(item.getId())).collect(Collectors.toList()));
|
|
vo.setOrderStatusVO(finalStatusList.stream().filter(status -> status.getOid().equals(item.getId())).collect(Collectors.toList()));
|
|
vo.setBrokerage(BigDecimal.ONE);
|
|
vo.setBrokerage(BigDecimal.ONE);
|
|
- vo.setOrderAddressVO(finalAddressList.stream().filter(address -> address.getId().equals(item.getUid())).findFirst().orElse(null));
|
|
|
|
|
|
+ vo.setOrderAddressVO(finalAddressList.stream().filter(address -> address.getId().equals(item.getAddressId())).findFirst().orElse(null));
|
|
arrayList.add(vo);
|
|
arrayList.add(vo);
|
|
});
|
|
});
|
|
return arrayList;
|
|
return arrayList;
|
|
@@ -1284,6 +1287,32 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void refund(Long id) {
|
|
|
|
+ StoreOrder storeOrder = findById(id);
|
|
|
|
+ if (storeOrder.getPaid().equals(Constants.ORDER_STATUS_UNPAID)) {
|
|
|
|
+ throw new ServiceException("当前状态不支持退款");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void close(Long id) {
|
|
|
|
+ StoreOrder storeOrder = findById(id);
|
|
|
|
+// storeOrder.setStatus(Constants.ORDER_STATUS_CLOSE);
|
|
|
|
+// update(storeOrder);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void cancel(Long id) {
|
|
|
|
+ StoreOrder storeOrder = findById(id);
|
|
|
|
+ if (storeOrder.getPaid().equals(0)) {
|
|
|
|
+ storeOrder.setStatus(Constants.ORDER_STATUS_CANCEL);
|
|
|
|
+ update(storeOrder);
|
|
|
|
+ } else {
|
|
|
|
+ throw new ServiceException("当前状态不支持取消");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 校验商品库存(生成订单)
|
|
* 校验商品库存(生成订单)
|
|
*
|
|
*
|