|
@@ -838,24 +838,62 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
|
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.andEqualTo("isDelete", 0);
|
|
|
+ statusCriteria.andIn("oid", list.stream().map(StoreOrder::getId).collect(Collectors.toList()));
|
|
|
+ statusList = storeOrderStatusService.findByCondition(statusCondition);
|
|
|
+
|
|
|
+ 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
|
|
|
+ public List<StoreOrder> appList(StoreOrderAppDTO dto) {
|
|
|
+ switch (dto.getType()) {
|
|
|
+ case 0:
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<StoreOrder> getUserCurrentCombinationOrders(Long uid, Long combinationId) {
|
|
|
Condition condition = new Condition(StoreOrder.class);
|
|
@@ -1123,7 +1161,7 @@ public class StoreOrderServiceImpl extends AbstractService<StoreOrder> implement
|
|
|
// storeCouponUserService.updateById(finalStoreCouponUser);
|
|
|
// }
|
|
|
// // 保存购物车商品详情
|
|
|
-// storeOrderInfoService.saveOrderInfos(storeOrderInfos);
|
|
|
+ storeOrderInfoService.saveOrderInfos(storeOrderInfos);
|
|
|
// // 生成订单日志
|
|
|
storeOrderStatusService.createLog(storeOrder.getId(), Constants.ORDER_STATUS_CREATE_ORDER, "订单生成");
|
|
|
//
|