| | |
| | | import com.dsh.account.feignclient.course.model.*; |
| | | import com.dsh.account.feignclient.other.ImgConfigClient; |
| | | import com.dsh.account.feignclient.other.RechargeConfigClient; |
| | | import com.dsh.account.feignclient.other.SiteClient; |
| | | import com.dsh.account.feignclient.other.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.SiteBooking; |
| | | import com.dsh.account.feignclient.other.model.Store; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.feignclient.other.model.TImgConfig; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Resource |
| | | private CoursePackageConfigClient cpconClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Resource |
| | | private SiteClient stClient; |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id,String latitude,String longitude) { |
| | |
| | | } |
| | | } |
| | | // 4.场地预约 |
| | | // TODO: 2023/7/14 账单的场地预约查询 |
| | | List<SiteBooking> allSiteBookingList = stClient.getAllSiteBookingList(appUserId); |
| | | if (allSiteBookingList.size() > 0){ |
| | | for (SiteBooking booking : allSiteBookingList) { |
| | | BillingDetailsVo.ConsumeDetail consumeDetail = new BillingDetailsVo.ConsumeDetail(); |
| | | if (booking.getStatus() != 5){ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("-" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getPayTime())); |
| | | }else { |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("+" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getCancelTime())); |
| | | } |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | |
| | | // 5.智慧球场 |
| | | // 6.年度会员 |
| | |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | |
| | | if (details.size() > 0 ){ |
| | | Collections.sort(details, new Comparator<BillingDetailsVo.ConsumeDetail>() { |
| | | @Override |
| | | public int compare(BillingDetailsVo.ConsumeDetail record1, BillingDetailsVo.ConsumeDetail record2) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = dateFormat.parse(record1.getConsumeTime()); |
| | | date2 = dateFormat.parse(record2.getConsumeTime()); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 倒序排序 |
| | | return date2.compareTo(date1); |
| | | } |
| | | }); |
| | | } |
| | | vo.setDetails(details); |
| | | return vo; |
| | | } |