Преглед на файлове

Merge branch 'feature/0722-kf' into test

yuanliang преди 1 година
родител
ревизия
d22abe69cd

+ 3 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/TeacherServiceImpl.java

@@ -771,6 +771,9 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
 
         List<TeacherWrapper.TeacherFriend> customerServiceFriendNums = this.getBaseMapper().getCustomerServiceFriendNums();
         customerServiceFriendNums.removeIf(n -> n.getTeacherId().equals(userId));
+        if (customerServiceFriendNums.isEmpty()) {
+            return result;
+        }
         List<Long> customerIdList = customerServiceFriendNums.stream().map(TeacherWrapper.TeacherFriend::getTeacherId).collect(Collectors.toList());
         List<ImUserFriend> userFriendList = friendList.stream()
                 .filter(n -> !ClientEnum.TEACHER.equals(n.getFriendType()) || !customerIdList.contains(n.getFriendId()))

+ 11 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/VipCardRecordServiceImpl.java

@@ -610,6 +610,7 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
         PeriodEnum period = addVipCardRecord.getType();
         // 扣减永久
         if (PeriodEnum.PERPETUAL.equals(period)) {
+            addVipCardRecord.setTimes(1);
             return deductedSVipPerpetual(addVipCardRecord, vipCardRecordList);
         }
 
@@ -676,7 +677,7 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
                 addRecord.setId(null);
                 addRecord.setDisplayFlag(false);
                 addRecord.setEfficientFlag(true);
-                addRecord.setEndTime(deductedStartDate);
+                addRecord.setEndTime(formatEnd(deductedStartDate));
                 addRecord.setStatus(EVipRecordStatus.UPDATE);
                 save(addRecord);
                 addId = addRecord.getId();
@@ -901,4 +902,13 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
             log.error("会员添加消息发送失败 : {}", e.getMessage());
         }
     }
+
+    private Date formatEnd(Date date) {
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(date);
+        c1.set(Calendar.HOUR_OF_DAY, 23);
+        c1.set(Calendar.MINUTE, 59);
+        c1.set(Calendar.SECOND, 59);
+        return c1.getTime();
+    }
 }