Browse Source

创建白板兼容ios

zouxuan 4 years ago
parent
commit
4938bb211a

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -257,7 +257,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         Integer studentId = studentGoodsSell.getUserId();
         studentDao.lockUser(studentId);
         SysUser student = sysUserFeignService.queryUserById(studentId);
-        List<GoodsSellDto> goodsSellDtos = studentGoodsSell.getGoodsSellDtos();
+        List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(studentGoodsSell.getGoodsJson(),GoodsSellDto.class);
         List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
 
         Map<Integer, BigDecimal> map = getMap("goods", "id_", "market_price_", goodsIds, Integer.class, BigDecimal.class);

+ 4 - 0
mec-im/src/main/java/com/ym/service/Impl/HereWhiteServiceImpl.java

@@ -6,6 +6,7 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.util.http.HttpUtil;
 import com.ym.pojo.HereWhite;
 import com.ym.service.HereWhiteService;
+import com.ym.service.RoomService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -25,10 +26,13 @@ public class HereWhiteServiceImpl implements HereWhiteService {
 
     @Autowired
     private HereWhiteDao hereWhiteDao;
+    @Autowired
+    private RoomService roomService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HereWhite create(String name, Integer userNum,Integer courseScheduleId) throws Exception {
+        courseScheduleId = roomService.getCurrentCourseId(courseScheduleId.toString());
         JSONObject json = new JSONObject();
         json.put("name",name);
         json.put("limit",userNum);

+ 23 - 0
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -39,6 +39,7 @@ import com.ym.utils.CodeUtil;
 import com.ym.utils.DateTimeUtils;
 import com.ym.utils.IdentifierUtils;
 import com.ym.whiteboard.WhiteBoardHelper;
+import io.swagger.models.auth.In;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -94,6 +95,28 @@ public class RoomServiceImpl implements RoomService {
     @Autowired
     private RedisTemplate<String,String> redisTemplate;
 
+    @Override
+    public Integer getCurrentCourseId(String roomId){
+        String continueCourseTime = sysConfigDao.findConfigValue(SysConfigService.ONLINE_CONTINUE_COURSE_TIME);
+        if(StringUtils.isEmpty(continueCourseTime)){
+            continueCourseTime = "5";
+        }
+        CourseSchedule courseSchedule = courseScheduleDao.get(Long.parseLong(roomId));
+        CourseSchedule schedule = courseSchedule;
+        //如果当前课程是连堂课,那么获取第一节课的课程编号
+        while (true){
+            String classDate = DateUtil.format(schedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
+            String startClassTime = DateUtil.format(schedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
+            schedule = courseScheduleDao.getLastCourse(schedule.getClassGroupId(),classDate + " " + startClassTime,schedule.getActualTeacherId(),continueCourseTime);
+            if(schedule != null){
+                roomId = schedule.getId().toString();
+            }else {
+                break;
+            }
+        }
+        return Integer.parseInt(roomId);
+    }
+
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
     @Override
     public RoomResult joinRoom(String roomId) throws Exception {

+ 2 - 0
mec-im/src/main/java/com/ym/service/RoomService.java

@@ -12,6 +12,8 @@ public interface RoomService {
     //everyone
     RoomResult joinRoom(String roomId) throws Exception;
 
+    Integer getCurrentCourseId(String roomId);
+
     //only host
     Boolean downgrade(String roomId, List<ReqChangeUserRoleData.ChangedUser> users) throws Exception;
 

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

@@ -41,7 +41,8 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                 "/repair/getStudentGoodsOrder",
                 "/subjectChange/getChangeInfo",
                 "/subjectChange/payChange",
-                "/contracts/queryProduceContract").permitAll().anyRequest().authenticated().and().httpBasic();
+                "/contracts/queryProduceContract",
+                "/repair/studentPaymentGoodsOrder").permitAll().anyRequest().authenticated().and().httpBasic();
     }
 
     @Override