Browse Source

Merge branch 'feature/1022_vip' of http://git.dayaedu.com/yonge/mec into test

zouxuan 4 days ago
parent
commit
66b214f5ad

+ 9 - 6
mec-application/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -433,12 +433,15 @@ public class StudentOrderController extends BaseController {
             }
             orderDetail.put("detail", vipGroupActivities);
         } else if (orderByOrderNo.getGroupType().equals(GroupType.MEMBER)) {
-            CloudTeacherOrderDto orderDto = cloudTeacherOrderService.queryOrderInfoByOrderId(orderByOrderNo.getId()).get(0);
-            orderDetail.put("detail", orderDto);
-            if (orderDto != null) {
-                Map<String, Object> map = new HashMap<>(1);
-                map.put("paymentOrderId", orderDto.getCloudTeacherOrder().getOrderId());
-                orderDetail.put("couponList", sysCouponCodeDao.querySysCouponUseList(map));
+            List<CloudTeacherOrderDto> cloudTeacherOrderDtos = cloudTeacherOrderService.queryOrderInfoByOrderId(orderByOrderNo.getId());
+            if(CollectionUtils.isNotEmpty(cloudTeacherOrderDtos)){
+                CloudTeacherOrderDto orderDto = cloudTeacherOrderDtos.get(0);
+                orderDetail.put("detail", orderDto);
+                if (orderDto != null) {
+                    Map<String, Object> map = new HashMap<>(1);
+                    map.put("paymentOrderId", orderDto.getCloudTeacherOrder().getOrderId());
+                    orderDetail.put("couponList", sysCouponCodeDao.querySysCouponUseList(map));
+                }
             }
         } else if (orderByOrderNo.getGroupType().equals(GroupType.LIVE_BUY)) {
             orderDetail.put("detail", vipGroupActivityService.getDao().queryByIds(orderByOrderNo.getActivityId()));

+ 3 - 3
mec-util/src/main/java/com/ym/mec/util/date/DateUtil.java

@@ -1325,12 +1325,12 @@ public class DateUtil {
     public static int daysBetweenUp(Date date, Date maxTime) {
         long epochSecond = date.toInstant().getEpochSecond();
         long epochSecond1 = maxTime.toInstant().getEpochSecond();
-        int i = (int) (epochSecond1 - epochSecond)/(24*60*60)  ;
-        int j = (int) (epochSecond1 - epochSecond)%(24*60*60)  ;
+		long i = (epochSecond1 - epochSecond)/(24*60*60)  ;
+		long j = (epochSecond1 - epochSecond)%(24*60*60)  ;
         if (j >0) {
             i++;
         }
-        return i;
+        return (int)i;
     }
 
     /**