| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | vo.setCode(order.getCode()); |
| | | vo.setCreateTime(order.getCreateTime()); |
| | | vo.setOrderPrice(order.getOrderPrice()); |
| | | vo.setPaymentType(order.getPaymentType()); |
| | | |
| | | vo.setRefundAmount(order.getPaymentPrice()); |
| | | |
| | | // 用户信息 |
| | | TAppUser appUser = tAppUserService.getById(order.getAppUserId()); |
| | | vo.setUserName(appUser.getName()); |
| | | vo.setPhone(appUser.getPhone()); |
| | | if(appUser!=null){ |
| | | vo.setUserName(appUser.getName()); |
| | | vo.setPhone(appUser.getPhone()); |
| | | |
| | | } |
| | | |
| | | |
| | | // 商品信息 |
| | | TBigGiftPackage tBigGiftPackage = tBigGiftPackageService.getById(order.getBigGiftPackageId()); |
| | | vo.setBigGiftPackageName(tBigGiftPackage.getName()); |
| | | vo.setBigGiftPackageCover(tBigGiftPackage.getCoverImage()); |
| | | vo.setBigGiftPackagePrice(tBigGiftPackage.getTotalPrice()); |
| | | vo.setBigGiftPackageIntro(tBigGiftPackage.getIntroduction()); |
| | | String bigGiftPackage = order.getBigGiftPackage(); |
| | | if(bigGiftPackage!=null){ |
| | | JSONObject jsonObject = JSONObject.parseObject(bigGiftPackage); |
| | | vo.setBigGiftPackageName(jsonObject.getString("name")); |
| | | vo.setBigGiftPackageCover(jsonObject.getString("coverImage")); |
| | | vo.setBigGiftPackagePrice(new BigDecimal(jsonObject.getString("totalPrice"))); |
| | | vo.setBigGiftPackageIntro(jsonObject.getString("introduction")); |
| | | } |
| | | |
| | | // 销量 |
| | | long count = tBigGiftPackageOrderService.count(new LambdaQueryWrapper<TBigGiftPackageOrder>().eq(TBigGiftPackageOrder::getBigGiftPackageId, order.getBigGiftPackageId()).ne(TBigGiftPackageOrder::getStatus, 5)); |