| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.feignClient.account.*; |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | |
| | | List<MoneyBack> refund = refundCoursePackageClient.getRefund(); |
| | | |
| | | for (MoneyBack moneyBack : refund) { |
| | | List<TCoursePackagePayment> coursePackagePayments = courseStuddentClient.queryByIds(moneyBack.getIds()); |
| | | List<CoursePackageOrderStudent> coursePackagePayments = courseStuddentClient.queryByIds(moneyBack.getIds()); |
| | | BigDecimal totalAmount = BigDecimal.ZERO; |
| | | for (TCoursePackagePayment payment : coursePackagePayments){ |
| | | //课包名称 |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(payment.getCoursePackageId()); |
| | | payment.setName(tCoursePackage.getName()); |
| | | payment.setId(Long.valueOf(tCoursePackage.getId())); |
| | | BigDecimal cashPayment = payment.getCashPayment(); |
| | | if (cashPayment==null){ |
| | | cashPayment = BigDecimal.ZERO; |
| | | } |
| | | Integer totalClassHours = payment.getTotalClassHours(); |
| | | BigDecimal result = new BigDecimal(0); |
| | | if (totalClassHours!=0) { |
| | | result = cashPayment.divide(BigDecimal.valueOf(totalClassHours), 2, RoundingMode.HALF_UP); |
| | | } |
| | | //单价 |
| | | payment.setOnePrice(result); |
| | | int has = payment.getTotalClassHours() - payment.getLaveClassHours(); |
| | | //剩余课时 |
| | | payment.setHasHours(has); |
| | | BigDecimal onePrice = payment.getOnePrice(); |
| | | Integer laveClassHours = payment.getLaveClassHours(); |
| | | BigDecimal result1 = onePrice.multiply(BigDecimal.valueOf(laveClassHours)); |
| | | //总价 |
| | | payment.setRestPrice(result1); |
| | | System.out.println("======="+result1); |
| | | totalAmount = totalAmount.add(result1); |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setInsertTime(payment.getInsertTime()); |
| | | temp.setAmount(result1); |
| | | incomeVOS.add(temp); |
| | | } |
| | | // for (TCoursePackagePayment payment : coursePackagePayments){ |
| | | // //课包名称 |
| | | // TCoursePackage tCoursePackage = coursePackageClient.queryById(payment.getCoursePackageId()); |
| | | // payment.setName(tCoursePackage.getName()); |
| | | // payment.setId(Long.valueOf(tCoursePackage.getId())); |
| | | // BigDecimal cashPayment = payment.getCashPayment(); |
| | | // if (cashPayment==null){ |
| | | // cashPayment = BigDecimal.ZERO; |
| | | // } |
| | | // Integer totalClassHours = payment.getTotalClassHours(); |
| | | // BigDecimal result = new BigDecimal(0); |
| | | // if (totalClassHours!=0) { |
| | | // result = cashPayment.divide(BigDecimal.valueOf(totalClassHours), 2, RoundingMode.HALF_UP); |
| | | // } |
| | | // //单价 |
| | | // payment.setOnePrice(result); |
| | | // int has = payment.getTotalClassHours() - payment.getLaveClassHours(); |
| | | // //剩余课时 |
| | | // payment.setHasHours(has); |
| | | // BigDecimal onePrice = payment.getOnePrice(); |
| | | // Integer laveClassHours = payment.getLaveClassHours(); |
| | | // BigDecimal result1 = onePrice.multiply(BigDecimal.valueOf(laveClassHours)); |
| | | // //总价 |
| | | // payment.setRestPrice(result1); |
| | | // System.out.println("======="+result1); |
| | | // totalAmount = totalAmount.add(result1); |
| | | // IncomeVO temp = new IncomeVO(); |
| | | // temp.setInsertTime(payment.getInsertTime()); |
| | | // temp.setAmount(result1); |
| | | // incomeVOS.add(temp); |
| | | // } |
| | | } |
| | | // 获取赛事退费记录 |
| | | List<PaymentCompetition> competitions = competitionClient.listAllPayment(competitionQuery); |
| | |
| | | public String store(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | List<TStore> tStores = new ArrayList<>(); |
| | | |
| | | if(objectType == 1){ |
| | | tStores = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getState, 1)); |
| | | } |
| | | if (objectType == 2){ |
| | | tStores = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getState, 1).eq(TStore::getOperatorId,UserExt.getUser().getObjectId())); |
| | | } |