| | |
| | | import com.ruoyi.system.model.TCommissionTransactionFlow; |
| | | import com.ruoyi.system.model.TCompany; |
| | | import com.ruoyi.system.query.BigGiftPackageOrderQuery; |
| | | import com.ruoyi.system.query.GoldChangeRecordQuery; |
| | | import com.ruoyi.system.query.ProfitPageListQuery; |
| | | import com.ruoyi.system.service.TBigGiftPackageOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<TBigGiftPackageOrder> pageOrderList(Page<TBigGiftPackageOrder> tBigGiftPackageOrderPage, GoldChangeRecordQuery query) { |
| | | List<TBigGiftPackageOrder> tBigGiftPackageOrders = this.baseMapper.pageOrderList(tBigGiftPackageOrderPage, query); |
| | | if(!tBigGiftPackageOrders.isEmpty()){ |
| | | List<Integer> companyId = tBigGiftPackageOrders.stream().map(TBigGiftPackageOrder::getCompanyId).collect(Collectors.toList()); |
| | | List<TCompany> tCompanies = companyMapper.selectBatchIds(companyId); |
| | | tBigGiftPackageOrders.forEach(tBigGiftPackageOrder -> { |
| | | TCompany tCompany1 = tCompanies.stream().filter(tCompany -> tCompany.getId().equals(tBigGiftPackageOrder.getCompanyId())).findFirst().orElse(null); |
| | | if(tCompany1!=null){ |
| | | tBigGiftPackageOrder.setCompanyName(tCompany1.getName()); |
| | | } |
| | | }); |
| | | List<Integer> goodsIds = tBigGiftPackageOrders.stream().map(TBigGiftPackageOrder::getBigGiftPackageId).collect(Collectors.toList()); |
| | | List<TBigGiftPackage> bigGiftPackages = bigGiftPackageMapper.selectBatchIds(goodsIds); |
| | | tBigGiftPackageOrders.forEach(tBigGiftPackageOrder -> { |
| | | TBigGiftPackage bigGiftPackage = bigGiftPackages.stream().filter(tBigGiftPackage -> tBigGiftPackage.getId().equals(tBigGiftPackageOrder.getBigGiftPackageId())).findFirst().orElse(null); |
| | | if(bigGiftPackage!=null){ |
| | | tBigGiftPackageOrder.setBigGiftPackageName(bigGiftPackage.getName()); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | return tBigGiftPackageOrders; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public PlaceOrderVO placeOrder(BigGiftPlaceOrderDTO dto, Integer appUserId, String openid) { |
| | | // 1. 校验商品是否存在 |