Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

Joburgess 5 lat temu
rodzic
commit
67d2bc2869

+ 12 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/NotifyCallback.java

@@ -54,8 +54,10 @@ public class NotifyCallback implements MQTTCallbackHandler {
             notifyMap.put("totalMoney", dataObj.getString("pay_amt"));
             notifyMap.put("merOrderNo", dataObj.getString("order_no"));
             notifyCallback.studentPaymentOrderService.updateOrder(notifyMap);
-        } else {
-            TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+            return;
+        }
+        TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+        if (tenantPaymentOrder != null) {
             tenantPaymentOrder.setStatus(DealStatusEnum.SUCCESS);
             tenantPaymentOrder.setPaymentBusinessChannel(dataObj.getString("pay_channel"));
             tenantPaymentOrder.setActualAmount(new BigDecimal(dataObj.getString("pay_amt")));
@@ -89,8 +91,10 @@ public class NotifyCallback implements MQTTCallbackHandler {
             notifyMap.put("merOrderNo", dataObj.getString("order_no"));
             notifyMap.put("remarks", dataObj.getString("error_msg"));
             notifyCallback.studentPaymentOrderService.updateOrder(notifyMap);
-        } else {
-            TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+            return;
+        }
+        TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+        if (tenantPaymentOrder != null) {
             tenantPaymentOrder.setStatus(DealStatusEnum.FAILED);
             tenantPaymentOrder.setPaymentBusinessChannel(dataObj.getString("pay_channel"));
             notifyCallback.tenantPaymentOrderService.paymentForCallback(tenantPaymentOrder);
@@ -122,8 +126,10 @@ public class NotifyCallback implements MQTTCallbackHandler {
             notifyMap.put("merOrderNo", dataObj.getString("order_no"));
             notifyMap.put("remarks", dataObj.getString("error_msg"));
             notifyCallback.studentPaymentOrderService.updateOrder(notifyMap);
-        } else {
-            TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+            return;
+        }
+        TenantPaymentOrder tenantPaymentOrder = notifyCallback.tenantPaymentOrderService.queryByOrderNo(orderNo);
+        if (tenantPaymentOrder != null) {
             tenantPaymentOrder.setStatus(DealStatusEnum.FAILED);
             tenantPaymentOrder.setPaymentBusinessChannel(dataObj.getString("pay_channel"));
             tenantPaymentOrderService.paymentForCallback(tenantPaymentOrder);

+ 8 - 2
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -129,6 +129,9 @@ public class RoomServiceImpl implements RoomService {
         CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
         if(teacher != null && userId.equals(courseSchedule.getActualTeacherId())){
             courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId),null,null);
+            userName = sysUser.getRealName();
+        }else {
+            userName = sysUser.getUsername();
         }
         String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
         if(StringUtils.isEmpty(continueCourseTime)){
@@ -375,6 +378,7 @@ public class RoomServiceImpl implements RoomService {
     @Override
     public Boolean leaveRoom(String roomId) throws Exception {
         SysUser user = sysUserFeignService.queryUserInfo();
+        String userName = "";
         String userId = user.getId().toString();
         log.info("leaveRoom: roomId={}, userId={}", roomId,userId);
         studentDao.lockUser(user.getId());
@@ -384,8 +388,10 @@ public class RoomServiceImpl implements RoomService {
             if(teacher != null && teacher.getId().equals(courseSchedule.getActualTeacherId())){
                 courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId.substring(1)),null,null);
                 teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(1)),user.getId(), SignStatusEnum.SIGN_OUT,true);
+                userName = user.getRealName();
             }else {
                 studentAttendanceService.addStudentAttendanceRecord(Integer.parseInt(roomId.substring(1)),user.getId(), StudentAttendanceStatusEnum.NORMAL,SignStatusEnum.SIGN_OUT);
+                userName = user.getUsername();
             }
         }catch (Exception e){
             e.printStackTrace();
@@ -443,7 +449,7 @@ public class RoomServiceImpl implements RoomService {
                 if (apiResultInfo.isSuccess()) {
                     roomMemberDao.deleteUserByRidAndUid(roomId, userId);
                     MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
-                    msg.setUserName(user.getUsername());
+                    msg.setUserName(userName);
                     imHelper.publishMessage(userId, roomId, msg);
                     imHelper.quit(new String[]{userId}, roomId);
                     log.info("quit group: roomId={},userId: {}", roomId,userId);
@@ -1429,7 +1435,7 @@ public class RoomServiceImpl implements RoomService {
         //记录节拍器消息
 
 //        long courseId = Long.parseLong(roomId.substring(1));
-        courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId.substring(1)),userId,content);
+        courseScheduleStudentPaymentDao.adjustPlayMidi(Long.parseLong(roomId.substring(1)),playMidiMessageData.getUserId(),content);
         /*if(StringUtils.isEmpty(userId)){
             //批量操作节拍器状态
             courseScheduleStudentPaymentDao.openPlayMidi(courseId,userId,content);