|
@@ -114,12 +114,15 @@ 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();
|
|
|
CqYcqxx cqYcqxx=new CqYcqxx();//添加抽取记录的对象
|
|
|
//判断是否是市直属学校
|
|
|
if (cqXxxq.getDistrictname().equals("市直属")) {
|
|
|
cqXxList=cqXxxqMapper.cqxxxqszs(cqXxxq);
|
|
|
if(cqXxList.isEmpty()){
|
|
|
- throw new JeecgBootException("没有可抽签的学校!");
|
|
|
+ return cqXxList;
|
|
|
+// throw new JeecgBootException("没有可抽签的学校!");
|
|
|
}else {
|
|
|
//保存被抽签的学校
|
|
|
for (CqXxxq xxxq : cqXxList) {
|
|
@@ -130,11 +133,7 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
cqYcqxx.setClasscode(xxxq.getClasscode());
|
|
|
cqYcqxx.setNianji(xxxq.getNianji());
|
|
|
cqYcqxx.setEstate(xxxq.getEstate());
|
|
|
- //获取抽签学校的考生数
|
|
|
- LambdaQueryWrapper<CqKsxx> query1 = new LambdaQueryWrapper<>();
|
|
|
- query1.eq(CqKsxx::getDistrictname, xxxq.getDistrictname())
|
|
|
- .eq(CqKsxx::getSchoolname, xxxq.getSchoolname());
|
|
|
- cqYcqxx.setSchoolpopulation(Math.toIntExact(cqKsxxMapper.selectCount(query1)));
|
|
|
+ cqYcqxx.setSchoolpopulation(xxxq.getSchoolpopulation());
|
|
|
cqYcqxxMapper.insert(cqYcqxx);
|
|
|
}
|
|
|
return cqXxList;
|
|
@@ -143,9 +142,13 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
//根据县区名称、年级、层次获取符合的学校
|
|
|
cqXxxqList=cqXxxqMapper.cqxxxq(cqXxxq);
|
|
|
if(cqXxxqList.isEmpty()){
|
|
|
- throw new JeecgBootException("没有可抽签的学校!");
|
|
|
+ return cqXxList;
|
|
|
+// throw new JeecgBootException("没有可抽签的学校!");
|
|
|
}else if(cqXxxqList.size()<Integer.parseInt(cqXxxq.getSchooamount())) {
|
|
|
- throw new JeecgBootException("可抽签的学数量不能大于以抽签学校数量!");
|
|
|
+ cqXxxqs.setId("1");
|
|
|
+ cqXxxqLists.add(cqXxxqs);
|
|
|
+ return cqXxxqLists;
|
|
|
+// throw new JeecgBootException("可抽签的学数量不能大于以抽签学校数量!");
|
|
|
}else {
|
|
|
//检查当前区是否已经抽签
|
|
|
LambdaQueryWrapper<CqYcqxx> query = new LambdaQueryWrapper<>();
|
|
@@ -153,7 +156,10 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
.eq(CqYcqxx::getEstate, cqXxxq.getEstate());
|
|
|
Long count = cqYcqxxMapper.selectCount(query);
|
|
|
if (Integer.parseInt(count+"") >0) {
|
|
|
- throw new JeecgBootException("该区当前等级已经有抽签记录无法重复抽签!");
|
|
|
+ cqXxxqs.setId("2");
|
|
|
+ cqXxxqLists.add(cqXxxqs);
|
|
|
+ return cqXxxqLists;
|
|
|
+// throw new JeecgBootException("该区当前等级已经有抽签记录无法重复抽签!");
|
|
|
}else if(Integer.parseInt(count+"") ==0){
|
|
|
cqXxList=chouschool(cqXxxqList, Integer.parseInt(cqXxxq.getSchooamount()));
|
|
|
//保存被抽签的学校
|
|
@@ -166,10 +172,7 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
cqYcqxx.setNianji(xxxq.getNianji());
|
|
|
cqYcqxx.setEstate(xxxq.getEstate());
|
|
|
//获取抽签学校的考生数
|
|
|
- LambdaQueryWrapper<CqKsxx> query1 = new LambdaQueryWrapper<>();
|
|
|
- query1.eq(CqKsxx::getDistrictname, xxxq.getDistrictname())
|
|
|
- .eq(CqKsxx::getSchoolname, xxxq.getSchoolname());
|
|
|
- cqYcqxx.setSchoolpopulation(Math.toIntExact(cqKsxxMapper.selectCount(query1)));
|
|
|
+ cqYcqxx.setSchoolpopulation(xxxq.getSchoolpopulation());
|
|
|
cqYcqxxMapper.insert(cqYcqxx);
|
|
|
}
|
|
|
}else {
|
|
@@ -186,8 +189,7 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
query.eq(CqXxxq::getDistrictname, cqXxxq.getDistrictname())
|
|
|
.eq(CqXxxq::getEstate, cqXxxq.getEstate())
|
|
|
.eq(CqXxxq::getNianji, cqXxxq.getNianji());
|
|
|
- List<CqXxxq> cqXxxqList=cqXxxqMapper.selectList(query);
|
|
|
- return cqXxxqList;
|
|
|
+ return cqXxxqMapper.selectList(query);
|
|
|
}
|
|
|
|
|
|
// //抽签不允许抽已经抽取的区
|
|
@@ -248,8 +250,8 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
query.eq(CqCqbjxx::getDistrictname, districtname);
|
|
|
Long count = cqCqbjxxMapper.selectCount(query);
|
|
|
if (Integer.parseInt(count+"") >0) {
|
|
|
-// throw new JeecgBootException("该区已经有抽签班级记录无法重复抽签!");
|
|
|
- System.out.println("该区已经有抽签班级记录无法重复抽签");
|
|
|
+ return "该区已经有抽签班级记录无法重复抽签!";
|
|
|
+// System.out.println("该区已经有抽签班级记录无法重复抽签");
|
|
|
}else if(Integer.parseInt(count+"") ==0){
|
|
|
//获取当前区内班级数量最大的学校的班级数量
|
|
|
String zuidashuliang =cqYcqxxMapper.chabanjishu(districtname);
|