Jelajahi Sumber

Merge remote-tracking branch 'origin/master'

Joburgess 5 tahun lalu
induk
melakukan
bafe361d50

+ 1 - 1
edu-common/src/main/resources/config/mybatis/SysMessageMapper.xml

@@ -175,7 +175,7 @@
 	</select>
 
 	<select id="queryCountOfUnread" resultMap="Mapper" parameterType="map">
-		SELECT group_ key_,COUNT(*) value_ FROM sys_message WHERE user_id_ = #{userId} AND read_status_ = 0 and status_ = 2
+		SELECT group_ key_,COUNT(*) value_ FROM sys_message WHERE user_id_ = #{userId} AND read_status_ = 0
 		<if test="type != null">
 		and type_ = #{type,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
 		</if>

+ 2 - 2
edu-im/edu-im-server/src/main/java/com/keao/edu/im/controller/RoomController.java

@@ -75,7 +75,7 @@ public class RoomController{
     @RequestMapping(value = "/leave", method = RequestMethod.POST)
     public Object leaveRoom(@RequestBody ReqUserData data)
             throws ApiException, Exception {
-        boolean result = roomService.leaveRoom(data.getRegistrationId(),data.getRoomId());
+        boolean result = roomService.leaveRoom(data.getRegistrationId(),data.getRoomId(),null);
         return new BaseResponse<>(result);
     }
 
@@ -100,7 +100,7 @@ public class RoomController{
             //成员加入
         }else if(notify.getEvent() == 12){
             //成员退出
-            roomService.leaveRoom(null,notify.getChannelId());
+            roomService.leaveRoom(null,notify.getChannelId(),notify.getUserId());
         }else if(notify.getEvent() == 20){
             //资源发生变动
         }

+ 4 - 2
edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java

@@ -247,9 +247,11 @@ public class IMHelper {
         jsonObject.put("videoFormat","mp4");
         jsonObject.put("audioFormat","mp3");
         jsonObject.put("videoResolution","640x480");
-        jsonObject.put("mixLayout",3);
-        jsonObject.put("sliceMin",60);
+        jsonObject.put("mixLayout",2);
+        jsonObject.put("sliceMin",30);
+//        jsonObject.put("renderMode",1);
         jsonObject.put("hostUserId",hostUserId);
+//        jsonObject.put("hostStreamId",hostUserId);
         JSONObject json = new JSONObject();
         json.put("sessionId",roomQuery(roomId));
         json.put("config",jsonObject);

+ 18 - 15
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -36,7 +36,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -407,7 +406,7 @@ public class RoomServiceImpl implements RoomService {
 
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     @Override
-    public Boolean leaveRoom(Long registrationId,String roomId) throws Exception {
+    public Boolean leaveRoom(Long registrationId,String roomId,String userId) throws Exception {
         if(registrationId != null){
             StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
             /*Integer recordFlag = examResult.getRecordFlag();
@@ -416,9 +415,13 @@ public class RoomServiceImpl implements RoomService {
             }*/
             roomId = examResult.getRoomId();
         }
-
-        SysUser user = sysUserFeignService.queryUserInfo();
-        String userId = user.getId().toString();
+        SysUser user;
+        if(StringUtils.isEmpty(userId)){
+            user = sysUserFeignService.queryUserInfo();
+            userId = user.getId().toString();
+        }else {
+            user = sysUserFeignService.queryUserById(Integer.parseInt(userId));
+        }
         /*if(StringUtils.isEmpty(userId)){
             user = sysUserFeignService.queryUserInfo();
             userId = user.getId().toString();
@@ -480,7 +483,7 @@ public class RoomServiceImpl implements RoomService {
         } else {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
             MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
-            msg.setUserName(user.getUsername());
+            msg.setUserName(user.getRealName());
             imHelper.publishMessage(userId, roomId, msg);
             log.info("quit group: roomId={},userId: {}", roomId,userId);
         }
@@ -954,7 +957,7 @@ public class RoomServiceImpl implements RoomService {
             msg.setTicket(ticket);
             msg.setType(taskInfo.getTypeEnum().ordinal());
             msg.setOpUserId(authUser.getId().toString());
-            msg.setOpUserName(authUser.getUsername());
+            msg.setOpUserName(authUser.getRealName());
             imHelper.publishMessage(authUser.getId().toString(), userId, roomId, msg);
         } else {
             if (typeEnum.equals(DeviceTypeEnum.Camera)) {
@@ -1025,7 +1028,7 @@ public class RoomServiceImpl implements RoomService {
         ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Approve.ordinal());
         msg.setType(taskInfo.getTypeEnum().ordinal());
         msg.setOpUserId(userId);
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
 
         DeviceStateChangedMessage deviceResourceMessage = new DeviceStateChangedMessage(taskInfo.getTypeEnum().ordinal(), taskInfo.isOnOff());
@@ -1045,7 +1048,7 @@ public class RoomServiceImpl implements RoomService {
         ControlDeviceNotifyMessage msg = new ControlDeviceNotifyMessage(ActionEnum.Reject.ordinal());
         msg.setType(taskInfo.getTypeEnum().ordinal());
         msg.setOpUserId(userId);
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
         return true;
     }
@@ -1143,7 +1146,7 @@ public class RoomServiceImpl implements RoomService {
         SpeechResultMessage msg = new SpeechResultMessage(SpeechResultMessage.Action_Approve);
         List<UserInfo> userInfoList = userDao.findByUid(taskInfo.getApplyUserId());
         msg.setOpUserId(userId);
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         msg.setReqUserId(taskInfo.getApplyUserId());
         if (!userInfoList.isEmpty()) {
             msg.setReqUserName(userInfoList.get(0).getName());
@@ -1178,7 +1181,7 @@ public class RoomServiceImpl implements RoomService {
         log.info("rejectSpeech: task = {}", taskInfo);
         SpeechResultMessage msg = new SpeechResultMessage(SpeechResultMessage.Action_Reject);
         msg.setOpUserId(userId);
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         msg.setRole(Student.getValue());
         IMApiResultInfo resultInfo = imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
         if (resultInfo.isSuccess()) {
@@ -1268,7 +1271,7 @@ public class RoomServiceImpl implements RoomService {
         UpgradeRoleMessage msg = new UpgradeRoleMessage(ActionEnum.Invite.ordinal());
         msg.setTicket(ticket);
         msg.setOpUserId(userId);
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         msg.setRole(targetRole);
         IMApiResultInfo resultInfo = imHelper.publishMessage(userId, targetUserId, roomId, msg);
         if (resultInfo.isSuccess()) {
@@ -1301,7 +1304,7 @@ public class RoomServiceImpl implements RoomService {
 
         UpgradeRoleMessage msg = new UpgradeRoleMessage(ActionEnum.Approve.ordinal());
 
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         msg.setOpUserId(userId);
         msg.setRole(taskInfo.getRole().getValue());
         IMApiResultInfo resultInfo = imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);
@@ -1312,7 +1315,7 @@ public class RoomServiceImpl implements RoomService {
         RoleChangedMessage rcMsg = new RoleChangedMessage(userId);
         List<RoleChangedMessage.ChangedUser> changedUserList = new ArrayList<>();
         RoleChangedMessage.ChangedUser user = new RoleChangedMessage.ChangedUser(userId, taskInfo.getRole().getValue());
-        user.setUserName(authUser.getUsername());
+        user.setUserName(authUser.getRealName());
         changedUserList.add(user);
         rcMsg.setUsers(changedUserList);
         imHelper.publishMessage(userId, roomId, rcMsg, 1);
@@ -1329,7 +1332,7 @@ public class RoomServiceImpl implements RoomService {
         String userId = authUser.getId().toString();
         UpgradeRoleTaskInfo taskInfo = (UpgradeRoleTaskInfo) scheduleManager.executeTask(ticket);
         UpgradeRoleMessage msg = new UpgradeRoleMessage(ActionEnum.Reject.ordinal());
-        msg.setOpUserName(authUser.getUsername());
+        msg.setOpUserName(authUser.getRealName());
         msg.setOpUserId(userId);
         msg.setRole(taskInfo.getRole().getValue());
         IMApiResultInfo resultInfo = imHelper.publishMessage(userId, taskInfo.getApplyUserId(), roomId, msg);

+ 1 - 1
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/RoomService.java

@@ -25,7 +25,7 @@ public interface RoomService {
 
     void stopRecord(String userId,String roomId) throws Exception;
 
-    public Boolean leaveRoom(Long registrationId,String roomId) throws ApiException, Exception;
+    public Boolean leaveRoom(Long registrationId,String roomId,String userId) throws ApiException, Exception;
 
     //only host
     public Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws ApiException, Exception;

+ 2 - 2
edu-thirdparty/src/main/java/com/keao/edu/thirdparty/adapay/Payment.java

@@ -182,8 +182,8 @@ public class Payment extends ConfigInit {
         paymentParams.put("appId", appId);
         paymentParams.put("amount", amount.setScale(2,BigDecimal.ROUND_HALF_UP));
         paymentParams.put("orderNo", orderNo);
-        paymentParams.put("notifyUrl", notifyUrl);
-        paymentParams.put("returnUrl", returnUrl);
+//        paymentParams.put("notifyUrl", notifyUrl);
+//        paymentParams.put("returnUrl", returnUrl);
         paymentParams.put("orderSubject", orderSubject);
         paymentParams.put("orderBody", orderBody);
         paymentParams.put("wxAppId", wxAppId);

+ 1 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -596,7 +596,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		examRoomStudentRelationDao.update(examRoomStudentRelation);
 		HashMap<Integer, String> map = new HashMap<>(1);
 		map.put(examRoomStudentRelation.getStudentId(),examRoomStudentRelation.getStudentId().toString());
-		String url = "3?examRegistrationId" + nextExamRoomStudentRelationId;
+		String url = "3?examRegistrationId=" + nextExamRoomStudentRelationId;
 		sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_STARTED_PUSH,map,null,null,url,JiguangPushPlugin.PLUGIN_NAME);
 
 		//状态变更为呼叫中

+ 6 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrderController.java

@@ -84,17 +84,17 @@ public class ExamOrderController extends BaseController {
     public Object executePayment(BigDecimal amount, String orderNo, String payChannel, String returnUrl,String notifyUrl, String orderSubject, String orderBody, String sign, String code, String platform) throws Exception {
         Map<String, Object> signParams = new LinkedHashMap<>();
         signParams.put("appId", ConfigInit.appId);
-        signParams.put("amount", amount);
+        signParams.put("amount", amount.setScale(2,BigDecimal.ROUND_HALF_UP));
         signParams.put("orderNo", orderNo);
-        signParams.put("notifyUrl", notifyUrl);
-        signParams.put("returnUrl", returnUrl);
+//        signParams.put("notifyUrl", notifyUrl);
+//        signParams.put("returnUrl", returnUrl);
         signParams.put("orderSubject", orderSubject);
         signParams.put("orderBody", orderBody);
         signParams.put("wxAppId", ConfigInit.wxAppId);
 
         String originalStr = JSONObject.toJSONString(signParams);
         String newSign = DigestUtils.md5DigestAsHex(originalStr.getBytes());
-        if(sign != newSign){
+        if(!sign.equals(newSign)){
             return failed("请勿非法请求");
         }
 
@@ -133,7 +133,7 @@ public class ExamOrderController extends BaseController {
         paymentParams.put("app_id", ConfigInit.appId);
         paymentParams.put("order_no", orderNo);
         paymentParams.put("pay_channel", payChannel);
-        paymentParams.put("pay_amt", amount);
+        paymentParams.put("pay_amt", amount.setScale(2,BigDecimal.ROUND_HALF_UP));
         paymentParams.put("goods_title", orderSubject);
         paymentParams.put("goods_desc", orderBody);
         paymentParams.put("time_expire", timeExpire);
@@ -142,7 +142,7 @@ public class ExamOrderController extends BaseController {
             List<Map<String, Object>> divMembers = new ArrayList<>();
             Map<String, Object> divMember = new HashMap<>();
             divMember.put("member_id", merNos);//分佣账户
-            divMember.put("amount", amount);//分佣金额
+            divMember.put("amount", amount.setScale(2,BigDecimal.ROUND_HALF_UP));//分佣金额
             divMember.put("fee_flag", "Y"); //承担手续费
             divMembers.add(divMember);
             paymentParams.put("div_members", JSON.toJSONString(divMembers));