Commit 15ff56ea 15ff56ea870ce5ddb9fcdf0b39f29a46a8acd480 by xianghan

1.修复添加观影记录时循环添加的bug

1 parent 7b819cbb
...@@ -887,9 +887,8 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -887,9 +887,8 @@ public class UserOperationServiceImpl implements UserOperationService {
887 887
888 } else { 888 } else {
889 889
890 for (UserCollectionDetail collectionDetail : userCollectionDetailOptional) {
891 //观影记录同一天只存一条记录 890 //观影记录同一天只存一条记录
892 boolean sameDay = DateUtil.isSameDay(new Date(collectionDetail.getCreateTime().getTime()), new Date()); 891 boolean sameDay = DateUtil.isSameDay(new Date(userCollectionDetail.getCreateTime().getTime()), new Date());
893 if (sameDay) { 892 if (sameDay) {
894 continue; 893 continue;
895 } else { 894 } else {
...@@ -902,26 +901,6 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -902,26 +901,6 @@ public class UserOperationServiceImpl implements UserOperationService {
902 } 901 }
903 902
904 } 903 }
905 /*if (userCollectionDetailOptional.isPresent()) {
906 //观影记录同一天只存一条记录
907 boolean sameDay = DateUtil.isSameDay(new Date(userCollectionDetailOptional.get().getCreateTime().getTime()), new Date());
908 if (sameDay) {
909 userCollectionDetail.setId(userCollectionDetailOptional.get().getId());
910 userCollectionDetailRepository.save(userCollectionDetail);
911 } else {
912
913 continue;
914 }
915
916 } else {
917
918 userCollectionDetail.setId(null)
919 .setUserCollectionId(userCollection.getId());
920 userCollectionDetailRepository.save(userCollectionDetail);
921 }*/
922
923
924 }
925 } 904 }
926 905
927 } catch (Exception e) { 906 } catch (Exception e) {
......