zouxuan 5 년 전
부모
커밋
0e5d444185

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupPaymentEntitiesDao.java

@@ -20,7 +20,7 @@ public interface MusicGroupPaymentEntitiesDao extends BaseDAO<Integer, MusicGrou
     void delByGroupId(String musicGroupId);
 
     /**
-     * 根据乐团编号查询
+     * 根据乐团编号查询乐团
      * @param musicGroupId
      * @return
      */

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java

@@ -216,4 +216,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     Map<String,Integer> queryStudentNum(Integer organId);
+
+    /**
+     * 根据乐团编号获取当前乐团所有已报名学员
+     * @param musicGroupId
+     * @return
+     */
+    List<Map<Integer, String>> findMapByMusicGroupId(String musicGroupId);
 }

+ 17 - 9
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -374,14 +374,13 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
         //获取当前乐团所有已报名学员
         List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
-        Map<Integer,String> map = new HashMap<>(registrations.size());
-        registrations.forEach(e->{
-            map.put(e.getUserId(),e.getUserId() + "");
-        });
-        if(map.size() > 0){
-            String content = sysMessageConfigDao.findContent(MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE.getCode());
-            content = MessageFormatter.arrayFormat(content,sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
-            sysMessageService.batchSendMessage(MessageSender.JIGUANG,"",content,map,new Date(),0,"");
+        if(registrations != null && registrations.size() > 0){
+            Map<Integer,String> map = new HashMap<>(registrations.size());
+            registrations.forEach(e->{
+                map.put(e.getUserId(),e.getParentsPhone());
+            });
+            sysMessageService.batchSendMessage(MessageSender.YIMEI,MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
+                    map,null,0,"",sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
         }
         //记录建团日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId,"取消乐团",sysUser.getId(),""));
@@ -702,7 +701,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             return true;
         }
         if(studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAilED){
-            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL + musicGroupId);
+            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
             sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, receivers, null, 0, "",
                     studentApplyUrl);
             sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, receivers, null, 0, "",
@@ -900,6 +899,15 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setApplyExpireDate(DateUtil.toDate(expireDate));
         musicGroup.setStatus(MusicGroupStatusEnum.PAY);
         musicGroupDao.update(musicGroup);
+        //乐团成立后(开始缴费)
+        //获取所有已报名学员列表
+        HashMap<Integer,String> map = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findMapByMusicGroupId(musicGroupId))), HashMap.class);
+        if(map != null && map.size() > 0){
+            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
+            String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
+            sysMessageService.batchSendMessage(MessageSender.YIMEI,MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
+                    map,null,0,"",musicGroup.getName(),studentApplyUrl,serverPhone);
+        }
         return musicGroup;
     }
 

+ 9 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherAttendanceServiceImpl.java

@@ -212,12 +212,14 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				//教师签退后,给未签到学员添加旷课记录
 				//封装未签到学员签到列表
 				List<StudentAttendance> studentAttendances = teacherAttendanceDao.queryNoSignStudentRecord(courseScheduleId);
-				studentAttendances.forEach(e->{
-					e.setTeacherId(userId);
-					e.setStatus(StudentAttendanceStatusEnum.TRUANT);
-					e.setRemark("学员未到,自动补旷课");
-				});
-				studentAttendanceDao.addStudentAttendances(studentAttendances);
+				if(studentAttendances != null && studentAttendances.size() > 0){
+					studentAttendances.forEach(e->{
+						e.setTeacherId(userId);
+						e.setStatus(StudentAttendanceStatusEnum.TRUANT);
+						e.setRemark("学员未到,自动补旷课");
+					});
+					studentAttendanceDao.addStudentAttendances(studentAttendances);
+				}
 			}
 		}else{
 			teacherAttendanceDao.insert(teacherAttendance);
@@ -226,7 +228,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 				//获取所有当前课程的学生列表
 				Map<Integer,String> userMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(courseScheduleDao.findStudentMap(courseScheduleId))),HashMap.class);
 				if(userMap != null && userMap.size() > 0){
-					sysMessageService.batchSendMessage(MessageSender.JIGUANG,MessageTypeEnum.STUDENT_PUSH_ONLINE_COURSE_ACTION,userMap,
+					sysMessageService.batchSendMessage(MessageSender.YIMEI,MessageTypeEnum.STUDENT_PUSH_ONLINE_COURSE_ACTION,userMap,
 							null,0,"",courseSchedule.getName());
 				}
 			}

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -295,6 +295,6 @@
             WHERE class_group_id_=#{classGroupId}
     </select>
     <select id="findByStatusAndCourseScheduleId" resultMap="StudentAttendance">
-        SELECT * FROM student_attendance sa WHERE course_schedule_id_ = #{courseScheduleId} AND user_id_ = #{userId}
+        SELECT * FROM student_attendance sa WHERE course_schedule_id_ = #{courseScheduleId} AND user_id_ = #{userId} LIMIT 1
     </select>
 </mapper>

+ 5 - 0
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -459,4 +459,9 @@
     		</if>
     	</where> 
     </select>
+    <select id="findMapByMusicGroupId" resultType="java.util.Map">
+        SELECT sr.user_id_ 'key',MIN(sr.parents_phone_) 'value' FROM student_registration sr
+        WHERE sr.music_group_id_ = #{musicGroupId} AND sr.payment_status_ != 2
+        GROUP BY sr.user_id_
+    </select>
 </mapper>

+ 1 - 1
mec-im/src/main/java/com/ym/SealClassApplication.java

@@ -19,7 +19,7 @@ import org.springframework.web.client.RestTemplate;
 @EnableAspectJAutoProxy
 @Slf4j
 @SpringBootApplication
-@EnableFeignClients("com.ym")
+@EnableFeignClients("com.ym.mec")
 @MapperScan("com.ym.mec.biz.dal.dao")
 @EnableScheduling
 @EnableDiscoveryClient

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

@@ -93,9 +93,9 @@ public class RoomServiceImpl implements RoomService {
         String userId = sysUserFeignService.queryUserInfo().getId().toString();
         Teacher teacher = teacherDao.get(Integer.parseInt(userId));
         if(teacher == null){
-            studentAttendanceService.addStudentAttendanceRecord(Integer.parseInt(roomId),Integer.parseInt(userId), StudentAttendanceStatusEnum.NORMAL);
+            studentAttendanceService.addStudentAttendanceRecord(Integer.parseInt(roomId.substring(4)),Integer.parseInt(userId), StudentAttendanceStatusEnum.NORMAL);
         }else {
-            teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId),Integer.parseInt(userId), SignStatusEnum.SIGN_IN,true);
+            teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(4)),Integer.parseInt(userId), SignStatusEnum.SIGN_IN,true);
         }
 
         String display = "";
@@ -124,7 +124,7 @@ public class RoomServiceImpl implements RoomService {
                 log.info("join error: roomId = {}, userName = {}, isAudience = {}", roomId, userName, isAudience);
                 throw new ApiException(ErrorEnum.ERR_OVER_MAX_COUNT);
             }
-            if (!isAudience) {
+            /*if (!isAudience) {
                 List<RoomMember> assistantList = roomMemberDao.findByRidAndRole(roomId, RoleEnum.RoleAssistant.getValue());
                 if (!assistantList.isEmpty()) {
                     if (count == 1) {
@@ -137,6 +137,11 @@ public class RoomServiceImpl implements RoomService {
                 }
             } else {
                 roleEnum = RoleEnum.RoleAudience;
+            }*/
+            if(teacher == null){
+                roleEnum = RoleEnum.RoleStudent;
+            }else {
+                roleEnum = RoleEnum.RoleTeacher;
             }
             saveRoomMember(userId, userName, roomId, roleEnum.getValue(), !isDisableCamera, curTime);
             IMApiResultInfo resultInfo = imHelper.joinGroup(new String[]{userId}, roomId, roomId);
@@ -191,7 +196,7 @@ public class RoomServiceImpl implements RoomService {
         roomResult.setUserInfo(userResult);
         roomResult.setDisplay(display);
 //        JwtToken jwtToken = tokenHelper.createJwtToken(jwtUser);
-        IMTokenInfo tokenInfo = imHelper.getToken(userId, userId, "");
+//        IMTokenInfo tokenInfo = imHelper.getToken(userId, userId, "");
 //        if (tokenInfo.isSuccess()) {
 //            roomResult.setImToken(tokenInfo.getAuthenticationValue());
 //        } else {
@@ -236,7 +241,7 @@ public class RoomServiceImpl implements RoomService {
         String userId = user.getId().toString();
         Teacher teacher = teacherDao.get(user.getId());
         if(teacher != null){
-            teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId),user.getId(), SignStatusEnum.SIGN_OUT,true);
+            teacherAttendanceService.addTeacherAttendanceRecord(Integer.parseInt(roomId.substring(4)),user.getId(), SignStatusEnum.SIGN_OUT,true);
         }
         
         CheckUtils.checkArgument(user != null, "user must't be null");
@@ -432,7 +437,6 @@ public class RoomServiceImpl implements RoomService {
 
     @Override
     public Boolean display(String roomId, int type, String uri) throws ApiException, Exception {
-        String token = SecurityUtils.getAuthenticationValue();
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         log.info("display in room: {}, type = {}, uri = {}", roomId, type, uri);
@@ -482,8 +486,8 @@ public class RoomServiceImpl implements RoomService {
             log.info("change display to screen: roomId={}, display={}", roomId, display);
         } else {
             display += "?userId=" + "?uri=" + uri;
-            CheckUtils.checkArgument(uri != null, "uri must't be null");
-            CheckUtils.checkArgument(whiteboardDao.findByRidAndWbid(roomId, uri).size() > 0, "whiteboard not exist");
+//            CheckUtils.checkArgument(uri != null, "uri must't be null");
+//            CheckUtils.checkArgument(whiteboardDao.findByRidAndWbid(roomId, uri).size() > 0, "whiteboard not exist");
 
             roomDao.updateDisplayByRid(roomId, display);
             DisplayMessage displayMessage = new DisplayMessage(display);

+ 12 - 3
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherController.java

@@ -8,13 +8,13 @@ import com.ym.mec.biz.dal.page.TeacherQueryInfo;
 import com.ym.mec.biz.dal.page.VipClassQueryInfo;
 import com.ym.mec.biz.dal.page.queryMusicGroupStudentQueryInfo;
 import com.ym.mec.biz.service.ClassGroupService;
+import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.biz.service.TeacherService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
+import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -29,6 +29,8 @@ public class TeacherController extends BaseController {
 
     @Autowired
     private TeacherService teacherService;
+    @Autowired
+    private SubjectService subjectService;
 
     @Autowired
     private ClassGroupService classGroupService;
@@ -118,4 +120,11 @@ public class TeacherController extends BaseController {
     public Object queryMusicGroupStudentApply(queryMusicGroupStudentQueryInfo queryInfo) {
         return succeed(teacherService.queryMusicGroupStudentApply(queryInfo));
     }
+
+    @ApiOperation(value = "通过乐团编号查询乐团科目规划")
+    @GetMapping("/querySubByMusicGroupId")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "musicGroupId", value = "乐团编号", required = true, dataType = "String")})
+    public Object findSubByMusicGroupId(String musicGroupId){
+        return succeed(subjectService.findSubByMusicGroupId(musicGroupId));
+    }
 }

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -1,6 +1,6 @@
 package com.ym.mec.web;
 
-import com.ym.mec.biz.dal.entity.SysMessageConfig;
+import com.spring4all.swagger.EnableSwagger2Doc;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -10,11 +10,11 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.web.client.RestTemplate;
 
-import com.spring4all.swagger.EnableSwagger2Doc;
-
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")