|
@@ -2,8 +2,10 @@ package cn.hmsoft.art.service.ly;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.hmsoft.log.LogHelper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -280,4 +282,33 @@ public class LyGroupWrittenService extends ArtService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void updateStdSubjectRoomSeq(int ly_group_id) {
|
|
|
+ LyGroup group = daoGroup.find(ly_group_id);
|
|
|
+ FrameAssertUtil.isNotNull(group, "分组不存在");
|
|
|
+ FrameAssertUtil.isEqual(group.getVideo_score_mode(), FrameStatus.Active.toString(), "该分组不允许重新生成座位号");
|
|
|
+
|
|
|
+ //分组下的笔试考场
|
|
|
+ List<LyRoomWritten> roomWrittenList = this.daoRoom.list("ly_group_id", ly_group_id);
|
|
|
+ LogHelper.info("考场的数量:" + roomWrittenList.size());
|
|
|
+ List<LyStdSubject> stdSubjectList;
|
|
|
+ for(LyRoomWritten room : roomWrittenList) {
|
|
|
+ stdSubjectList = daoStdSubject.list("ly_room_id", room.getLy_room_id());
|
|
|
+ FrameAssertUtil.hasValue(stdSubjectList, "未发布编排");
|
|
|
+
|
|
|
+ //随机排序
|
|
|
+ Collections.shuffle(stdSubjectList);
|
|
|
+
|
|
|
+ int index = 1;
|
|
|
+ for(LyStdSubject sb : stdSubjectList) {
|
|
|
+ //更新座位号
|
|
|
+ sb.setLy_room_seq(index);
|
|
|
+ daoStdSubject.update(sb);
|
|
|
+ //同步更新考生其他科目的座位号
|
|
|
+ daoStdSubject.updateStdWrittenSeat(sb.getStd_id(),group.getOptr_dept(), index);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ LogHelper.info("座位号重新生成完成");
|
|
|
+ }
|
|
|
}
|