zouxuan il y a 5 ans
Parent
commit
73efb9c750

+ 23 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderDetailServiceImpl.java

@@ -65,13 +65,16 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			if(e.getPaymentStatus() == null || e.getPaymentStatus() != NON_PAYMENT){
 				throw new BizException("修改失败,缴费状态不匹配");
 			}
-			if(expectAmount.doubleValue() == 0){
-				e.setPaymentStatus(PAID_COMPLETED);
+			if(expectAmount.doubleValue() != 0){
+
 			}
+			/*if(expectAmount.doubleValue() == 0){
+				e.setPaymentStatus(PAID_COMPLETED);
+			}*/
 			e.setUpdateTime(date);
 			e.setExpectAmount(expectAmount);
 		});
-		if(expectAmount.doubleValue() == 0){
+		/*if(expectAmount.doubleValue() == 0){
 			//如果是设置为0元
 			MusicGroupPaymentCalender calender = musicGroupPaymentCalenderDao.get(calenderDetails.get(0).getMusicGroupPaymentCalenderId());
 			if(calender.getType() == ONLINE){
@@ -80,8 +83,24 @@ public class MusicGroupPaymentCalenderDetailServiceImpl extends BaseServiceImpl<
 			}
 			//缴费完成
 			musicGroupStudentFeeDao.setPaidCompleted(calenderDetails);
-		}
+		}*/
 		musicGroupPaymentCalenderDetailDao.batchUpdate(calenderDetails);
+		if(expectAmount.doubleValue() > 0){
+			String musicGroupId = calenderDetails.get(0).getMusicGroupId();
+			Set<Integer> studentIds = calenderDetails.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
+			//推送消息
+			if (studentIds.size() > 0) {
+				Map<Integer, String> push = new HashMap<>();
+				for (Integer userId : studentIds) {
+					push.put(userId, userId + "");
+				}
+				MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+				String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+				String memo = "4?" + baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+				// 发送续费通知
+				sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_WAIT_RENEW_MESSAGE, push, null, 0, memo,"STUDENT",musicGroup.getName());
+			}
+		}
 	}
 
 	@Override

+ 0 - 10
mec-im/src/main/java/com/ym/dao/RoomMemberDao.java

@@ -64,16 +64,6 @@ public interface RoomMemberDao extends JpaRepository<RoomMember, Long> {
 
     @Transactional
     @Modifying
-    @Query(value = "update rongyun_room_member set play_midi_json=?3 where rid=?1 and FIND_IN_SET(uid,?2)>0", nativeQuery = true)
-    public int updatePlayMidiJsonByRidAndUid(String rid, String uid, String playMidiJson);
-
-    @Transactional
-    @Modifying
-    @Query(value = "update rongyun_room_member set play_midi_json=?3 where rid=?1 and role=?2", nativeQuery = true)
-    public int updatePlayMidiJsonByRidAndRole(String rid, int role, String playMidiJson);
-
-    @Transactional
-    @Modifying
     @Query(value = "update rongyun_room_member set music_mode=?3 where rid=?1 and uid=?2", nativeQuery = true)
     public int updateMusicByRidAndUid(String rid, String uid, boolean musicMode);
 

+ 0 - 1
mec-im/src/main/java/com/ym/pojo/RoomMember.java

@@ -21,7 +21,6 @@ public class RoomMember {
     private @Getter @Setter int role;
     private @Getter @Setter Date joinDt;
     private @Getter @Setter String name;
-    private @Getter @Setter String playMidiJson;
     private @Getter @Setter boolean camera = true;
     private @Getter @Setter boolean musicMode = true;
     private @Getter @Setter boolean mic = true;