|
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ynfy.buss.exam.chouqian.entity.*;
|
|
|
import com.ynfy.buss.exam.chouqian.mapper.*;
|
|
|
import com.ynfy.buss.exam.chouqian.service.ICqXxxqService;
|
|
|
-import org.jeecg.common.exception.JeecgBootException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -114,8 +113,8 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
public List<CqXxxq> cqxx(CqXxxq cqXxxq) {
|
|
|
List<CqXxxq> cqXxList=new ArrayList<>();//被抽签到到学校
|
|
|
List<CqXxxq> cqXxxqList=new ArrayList<>();
|
|
|
- List<CqXxxq> cqXxxqLists=new ArrayList<>();
|
|
|
- CqXxxq cqXxxqs=new CqXxxq();
|
|
|
+ List<CqXxxq> cqXxxqLists=new ArrayList<>();//接口抛错使用
|
|
|
+ CqXxxq cqXxxqs=new CqXxxq();//接口抛错使用
|
|
|
CqYcqxx cqYcqxx=new CqYcqxx();//添加抽取记录的对象
|
|
|
//判断是否是市直属学校
|
|
|
if (cqXxxq.getDistrictname().equals("市直属")) {
|
|
@@ -139,6 +138,11 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
return cqXxList;
|
|
|
}
|
|
|
}else {
|
|
|
+ //获取当前地市有多少个等级
|
|
|
+// List<String> dengji=cqXxxqMapper.huoqudsxxdj(cqXxxq.getDistrictname());
|
|
|
+// for (String estate : dengji) {
|
|
|
+// cqXxxq.setEstate(estate);
|
|
|
+// }
|
|
|
//根据县区名称、年级、层次获取符合的学校
|
|
|
cqXxxqList=cqXxxqMapper.cqxxxq(cqXxxq);
|
|
|
if(cqXxxqList.isEmpty()){
|
|
@@ -275,21 +279,44 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
query1.eq(CqCqbjxx::getDistrictname, cqXxxq.getDistrictname());
|
|
|
CqCqbjxx cqCqbjxx=cqCqbjxxMapper.selectOne(query1);
|
|
|
System.out.println("----------------------");
|
|
|
-// System.out.println(cqCqbjxx);
|
|
|
- //获取需要抽签的学校
|
|
|
- LambdaQueryWrapper<CqYcqxx> query = new LambdaQueryWrapper<>();
|
|
|
- query.eq(CqYcqxx::getDistrictname, cqXxxq.getDistrictname())
|
|
|
- .eq(CqYcqxx::getEstate, cqXxxq.getEstate());
|
|
|
- List<CqYcqxx> cqYcqxxList=cqYcqxxMapper.selectList(query);
|
|
|
int studentamount = 45;//抽取人数
|
|
|
- for (CqYcqxx cqYcqxx : cqYcqxxList) {
|
|
|
- //调用抽班级方法
|
|
|
- rycqsjsbj(cqYcqxx,cqCqbjxx,studentamount);
|
|
|
- System.out.println(cqYcqxx);
|
|
|
+ //判断是否是市直属学校
|
|
|
+ if (cqXxxq.getDistrictname().equals("市直属")) {
|
|
|
+ //获取需要抽签的学校
|
|
|
+ LambdaQueryWrapper<CqYcqxx> query = new LambdaQueryWrapper<>();
|
|
|
+ query.eq(CqYcqxx::getDistrictname, cqXxxq.getDistrictname());
|
|
|
+ List<CqYcqxx> cqYcqxxList=cqYcqxxMapper.selectList(query);
|
|
|
+
|
|
|
+ for (CqYcqxx cqYcqxx : cqYcqxxList) {
|
|
|
+ //调用抽班级方法
|
|
|
+ rycqsjsbj(cqYcqxx,cqCqbjxx,studentamount);
|
|
|
+ System.out.println(cqYcqxx);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //获取当前地市有多少个等级
|
|
|
+ List<String> dengji=cqXxxqMapper.huoqudsxxdj(cqXxxq.getDistrictname());
|
|
|
+ for (String estate : dengji) {
|
|
|
+ cqXxxq.setEstate(estate);
|
|
|
+ //获取需要抽签的学校
|
|
|
+ LambdaQueryWrapper<CqYcqxx> query = new LambdaQueryWrapper<>();
|
|
|
+ query.eq(CqYcqxx::getDistrictname, cqXxxq.getDistrictname())
|
|
|
+ .eq(CqYcqxx::getEstate, cqXxxq.getEstate());
|
|
|
+ List<CqYcqxx> cqYcqxxList=cqYcqxxMapper.selectList(query);
|
|
|
+ if (cqYcqxxList.isEmpty()){
|
|
|
+ System.out.println("空的不处理!");
|
|
|
+ }else {
|
|
|
+ for (CqYcqxx cqYcqxx : cqYcqxxList) {
|
|
|
+ //调用抽班级方法
|
|
|
+ rycqsjsbj(cqYcqxx,cqCqbjxx,studentamount);
|
|
|
+ System.out.println(cqYcqxx);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
- public String rycqsjsbj(CqYcqxx cqYcqxx,CqCqbjxx cqCqbjxx,int studentamount) {
|
|
|
+ public void rycqsjsbj(CqYcqxx cqYcqxx, CqCqbjxx cqCqbjxx, int studentamount) {
|
|
|
List<CqCqks> cqCqksList=new ArrayList<>();//学校抽取考生集合
|
|
|
int remainder = 0;//随机数取余的值
|
|
|
String banji="";//班级
|
|
@@ -323,7 +350,6 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
//获取人员不够的学校进行补充
|
|
|
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
//根据班级抽学生
|
|
|
public void cqbanxs(CqYcqxx cqYcqxx, String banji, int sjs, int studentamount) {
|