Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
c4486b69dd

+ 2 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java

@@ -23,7 +23,8 @@ import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
 import com.ym.mec.im.ImFeignService;
-import com.ym.mec.user.UserFeignService;
+import com.ym.mec.im.UserFeignService;
+import org.springframework.transaction.annotation.Transactional;
 
 
 @Service
 @Service
 public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implements SysUserService {
 public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implements SysUserService {

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -337,9 +337,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
 
 
             String courseScheduleName = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
             String courseScheduleName = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
 
 
-            while (true) {
+            System.out.println("***************开始循环***************");
+            while (highClassGroup.getCourseTimes() >= times) {
                 int dayOfWeek = now.getDayOfWeek().getValue();
                 int dayOfWeek = now.getDayOfWeek().getValue();
-                if (highClassGroup.getDayOfWeek().equals(dayOfWeek)) {
+                if (highClassGroup.getDayOfWeek() == dayOfWeek) {
                     CourseSchedule courseSchedule = new CourseSchedule();
                     CourseSchedule courseSchedule = new CourseSchedule();
                     Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
                     Instant instant = now.atZone(ZoneId.systemDefault()).toInstant();
                     Date classDate = Date.from(instant);
                     Date classDate = Date.from(instant);
@@ -365,19 +366,21 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     times++;
                     times++;
                 }
                 }
                 now = now.plusDays(1);
                 now = now.plusDays(1);
-                if (highClassGroup.getCourseTimes().equals(times)) {
-                    break;
-                }
             }
             }
+            System.out.println("***************结束循环***************");
             //检测新排课冲突
             //检测新排课冲突
             courseScheduleService.checkNewCourseSchedules(courseScheduleList, false);
             courseScheduleService.checkNewCourseSchedules(courseScheduleList, false);
+            System.out.println("***************检查排课***************");
             courseScheduleDao.batchAddCourseSchedules(courseScheduleList);
             courseScheduleDao.batchAddCourseSchedules(courseScheduleList);
+            System.out.println("***************批量排课***************");
 
 
             List<Integer> userIdList = new ArrayList<>();
             List<Integer> userIdList = new ArrayList<>();
             userIdList.add(classGroupTeacherMapper.getUserId());
             userIdList.add(classGroupTeacherMapper.getUserId());
 
 
             //加入Im群组
             //加入Im群组
             addImGroup(highClassGroup, userIdList);
             addImGroup(highClassGroup, userIdList);
+
+            System.out.println("***************融云加群***************");
         }
         }
         redisCache.releaseLocked(key, value);
         redisCache.releaseLocked(key, value);
         return highClassGroupList;
         return highClassGroupList;

+ 2 - 2
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -777,12 +777,12 @@
     </select>
     </select>
 
 
     <!-- 根据主键批量删除班级-->
     <!-- 根据主键批量删除班级-->
-    <delete id="batchSoftDelete">
+    <update id="batchSoftDelete">
         UPDATE class_group SET del_flag_ = 1 WHERE id_ IN
         UPDATE class_group SET del_flag_ = 1 WHERE id_ IN
         <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
         <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
             #{classGroupId}
             #{classGroupId}
         </foreach>
         </foreach>
-    </delete>
+    </update>
 
 
     <select id="findClassGroupByType" resultMap="ClassGroupTeachers">
     <select id="findClassGroupByType" resultMap="ClassGroupTeachers">
         SELECT * FROM class_group WHERE music_group_id_=#{musicGroupId}
         SELECT * FROM class_group WHERE music_group_id_=#{musicGroupId}

+ 7 - 7
mec-client-api/src/main/java/com/ym/mec/user/UserFeignService.java → mec-client-api/src/main/java/com/ym/mec/im/UserFeignService.java

@@ -1,15 +1,15 @@
-package com.ym.mec.user;
+package com.ym.mec.im;
 
 
+import com.ym.mec.common.config.FeignConfiguration;
+import com.ym.mec.task.fallback.UserFeignServiceFallback;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-
-import com.ym.mec.common.config.FeignConfiguration;
-import com.ym.mec.user.fallback.UserFeignServiceFallback;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 
 @FeignClient(name = "web-server", contextId = "UserFeignService", configuration = FeignConfiguration.class, fallback = UserFeignServiceFallback.class)
 @FeignClient(name = "web-server", contextId = "UserFeignService", configuration = FeignConfiguration.class, fallback = UserFeignServiceFallback.class)
 public interface UserFeignService {
 public interface UserFeignService {
 
 
-	@GetMapping(value = "api/createCashAccount/{userId}")
-	public Boolean createCashAccount(@PathVariable("userId") Integer userId);
+	@RequestMapping(value = "api/createCashAccount")
+	Boolean createCashAccount(@RequestParam("userId") Integer userId);
 }
 }

+ 2 - 2
mec-client-api/src/main/java/com/ym/mec/user/fallback/UserFeignServiceFallback.java → mec-client-api/src/main/java/com/ym/mec/task/fallback/UserFeignServiceFallback.java

@@ -1,8 +1,8 @@
-package com.ym.mec.user.fallback;
+package com.ym.mec.task.fallback;
 
 
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Component;
 
 
-import com.ym.mec.user.UserFeignService;
+import com.ym.mec.im.UserFeignService;
 
 
 @Component
 @Component
 public class UserFeignServiceFallback implements UserFeignService {
 public class UserFeignServiceFallback implements UserFeignService {

+ 3 - 0
mec-im/src/main/java/com/ym/controller/GroupController.java

@@ -2,6 +2,7 @@ package com.ym.controller;
 
 
 import com.ym.service.GroupService;
 import com.ym.service.GroupService;
 import com.ym.service.MessageService;
 import com.ym.service.MessageService;
+import io.rong.models.group.GroupMember;
 import io.rong.models.group.GroupModel;
 import io.rong.models.group.GroupModel;
 import io.rong.models.group.UserGroup;
 import io.rong.models.group.UserGroup;
 import io.rong.models.message.GroupMessage;
 import io.rong.models.message.GroupMessage;
@@ -84,6 +85,8 @@ public class GroupController{
 
 
     @RequestMapping(value = "/dismiss", method = RequestMethod.POST)
     @RequestMapping(value = "/dismiss", method = RequestMethod.POST)
     public Object dismiss(@RequestBody GroupModel groupModel) throws Exception {
     public Object dismiss(@RequestBody GroupModel groupModel) throws Exception {
+        GroupMember[] groupMember = {new GroupMember("1",null,null)};
+        groupModel.setMembers(groupMember);
         return groupService.groupDismiss(groupModel);
         return groupService.groupDismiss(groupModel);
     }
     }
 }
 }

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0").antMatchers("/v2/api-docs","/classGroup/highClassGroups","/code/*").permitAll().anyRequest().authenticated()
+				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0").antMatchers("/v2/api-docs","/classGroup/highClassGroups","/code/*","/api/*").permitAll().anyRequest().authenticated()
 				.and().httpBasic();
 				.and().httpBasic();
 	}
 	}
 
 

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/APIController.java

@@ -20,8 +20,8 @@ public class APIController extends BaseController {
 	@Autowired
 	@Autowired
 	private SysUserCashAccountDao sysUserCashAccountDao;
 	private SysUserCashAccountDao sysUserCashAccountDao;
 
 
-	@GetMapping("/createCashAccount/{userId}")
-	public Boolean createCashAccount(@PathVariable("userId") Integer userId) {
+	@GetMapping("/createCashAccount")
+	public Boolean createCashAccount(Integer userId) {
 		// 添加用户现金账户
 		// 添加用户现金账户
 		sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
 		sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));