|
@@ -43,6 +43,7 @@ import com.chuanghai.ihotel.service.RoomService;
|
|
|
import com.chuanghai.ihotel.service.RoomTypeService;
|
|
import com.chuanghai.ihotel.service.RoomTypeService;
|
|
|
import com.chuanghai.ihotel.service.SystemSettingService;
|
|
import com.chuanghai.ihotel.service.SystemSettingService;
|
|
|
import com.chuanghai.ihotel.util.CommonUtil;
|
|
import com.chuanghai.ihotel.util.CommonUtil;
|
|
|
|
|
+import com.chuanghai.ihotel.vo.AdminOrderIndexVO;
|
|
|
import com.chuanghai.ihotel.vo.ConfirmOrderVO;
|
|
import com.chuanghai.ihotel.vo.ConfirmOrderVO;
|
|
|
import com.chuanghai.ihotel.dto.LoginUserDTO;
|
|
import com.chuanghai.ihotel.dto.LoginUserDTO;
|
|
|
import com.chuanghai.ihotel.vo.OrderBillHandleVO;
|
|
import com.chuanghai.ihotel.vo.OrderBillHandleVO;
|
|
@@ -153,6 +154,34 @@ public class HotelOrderServiceImpl extends ServiceImpl<HotelOrderDao, HotelOrder
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public PageUtils pageForAdmin(PageParam pageParam, OrderQueryRequest request) {
|
|
|
|
|
+ pageParam.setOrderField("create_time");
|
|
|
|
|
+ pageParam.setOrder("desc");
|
|
|
|
|
+ request.setDeleteFlag("1"); // 1未删除
|
|
|
|
|
+
|
|
|
|
|
+ PageUtils pageUtils = this.queryPage(pageParam, request);
|
|
|
|
|
+ List<HotelOrderEntity> orderList = pageUtils.getList();
|
|
|
|
|
+ Set<Long> ids = orderList.stream().map(order -> order.getId()).collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ if (ids.size() > 0) {
|
|
|
|
|
+ List<HotelOrderBillEntity> orderBillList = orderBillService.findByOrderIds(ids);
|
|
|
|
|
+ Map<Long, HotelOrderBillEntity> orderBillMap = orderBillList.stream().collect(Collectors.toMap(HotelOrderBillEntity::getHotelOrderId, e -> e));
|
|
|
|
|
+
|
|
|
|
|
+ List<AdminOrderIndexVO> voList = orderList.stream().map(order -> {
|
|
|
|
|
+ AdminOrderIndexVO vo = new AdminOrderIndexVO();
|
|
|
|
|
+ vo.setOrder(order);
|
|
|
|
|
+ vo.setOrderBill(orderBillMap.get(order.getId()));
|
|
|
|
|
+
|
|
|
|
|
+ return vo;
|
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ pageUtils.setList(voList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return pageUtils;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public HotelOrderEntity findByOrderNo(String orderNo) {
|
|
public HotelOrderEntity findByOrderNo(String orderNo) {
|
|
|
QueryWrapper<HotelOrderEntity> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<HotelOrderEntity> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("order_no", orderNo);
|
|
queryWrapper.eq("order_no", orderNo);
|