|
@@ -117,6 +117,7 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
List<CqXxxq> cqXxxqLists=new ArrayList<>();//接口抛错使用
|
|
|
CqXxxq cqXxxqs=new CqXxxq();//接口抛错使用
|
|
|
CqYcqxx cqYcqxx=new CqYcqxx();//添加抽取记录的对象
|
|
|
+ CqYcqxx cqYcqxxbu=new CqYcqxx();//bu
|
|
|
//判断是否是市直属学校
|
|
|
if (cqXxxq.getDistrictname().equals("市直属")) {
|
|
|
cqXxList=cqXxxqMapper.cqxxxqszs(cqXxxq);
|
|
@@ -145,6 +146,13 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
cqXxxq.setEstate(estate);
|
|
|
//根据县区名称、年级、层次获取符合的学校
|
|
|
cqXxxqList = cqXxxqMapper.cqxxxq(cqXxxq);
|
|
|
+ //判断抽几个学校
|
|
|
+ if (cqXxxqList.size()<10){
|
|
|
+ cqXxxq.setSchooamount("1");
|
|
|
+ }else {
|
|
|
+ cqXxxq.setSchooamount(String.valueOf((int) Math.round((double) (cqXxxqList.size() * 10) / 100)));
|
|
|
+ }
|
|
|
+
|
|
|
if (cqXxxqList.isEmpty()) {
|
|
|
CqXxxqlistmap.put(estate,cqXxList);
|
|
|
// throw new JeecgBootException("没有可抽签的学校!");
|
|
@@ -173,7 +181,51 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
cqYcqxx.setEstate(xxxq.getEstate());
|
|
|
//获取抽签学校的考生数
|
|
|
cqYcqxx.setSchoolpopulation(xxxq.getSchoolpopulation());
|
|
|
- cqYcqxxMapper.insert(cqYcqxx);
|
|
|
+ if(xxxq.getSchoolpopulation()<45){
|
|
|
+ cqYcqxx.setState("1");
|
|
|
+ cqYcqxxMapper.insert(cqYcqxx);
|
|
|
+ int xh=1;
|
|
|
+ if(Integer.parseInt(xxxq.getSchoolcode())!=cqXxxqList.size()){
|
|
|
+ xh= Integer.parseInt(xxxq.getSchoolcode())+1;
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ int ss=0;
|
|
|
+ while (ss!=2){
|
|
|
+ System.out.println("开始");
|
|
|
+ for (CqXxxq xxxq1 : cqXxList) {
|
|
|
+ if(xxxq1.getSchoolcode().equals(""+xh)){
|
|
|
+ ss=1;
|
|
|
+ xh=xh+1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ss==0){
|
|
|
+ ss=2;
|
|
|
+ }else {
|
|
|
+ ss=0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("补的学校:"+xh);
|
|
|
+ CqXxxq cqXxxq1=new CqXxxq();
|
|
|
+ for(CqXxxq cqXxxq2:cqXxxqList){
|
|
|
+ if (cqXxxq2.getSchoolcode().equals(xh+"")){
|
|
|
+ cqXxxq1=cqXxxq2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //添加补的学校
|
|
|
+ cqYcqxxbu.setId(null);
|
|
|
+ cqYcqxxbu.setDistrictname(cqXxxq1.getDistrictname());
|
|
|
+ cqYcqxxbu.setSchoolname(cqXxxq1.getSchoolname());
|
|
|
+ cqYcqxxbu.setSchoolcode(cqXxxq1.getSchoolcode());
|
|
|
+ cqYcqxxbu.setClasscode(cqXxxq1.getClasscode());
|
|
|
+ cqYcqxxbu.setNianji(cqXxxq1.getNianji());
|
|
|
+ cqYcqxxbu.setEstate(cqXxxq1.getEstate());
|
|
|
+ cqYcqxxbu.setSchoolpopulation(cqXxxq1.getSchoolpopulation());
|
|
|
+ cqYcqxxbu.setState("2");
|
|
|
+ cqYcqxxbu.setBuid(cqYcqxx.getId());
|
|
|
+ cqYcqxxMapper.insert(cqYcqxxbu);
|
|
|
+ }else {
|
|
|
+ cqYcqxxMapper.insert(cqYcqxx);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
System.out.println("异常");
|
|
@@ -301,8 +353,10 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
//获取需要抽签的学校
|
|
|
LambdaQueryWrapper<CqYcqxx> query = new LambdaQueryWrapper<>();
|
|
|
query.eq(CqYcqxx::getDistrictname, cqXxxq.getDistrictname())
|
|
|
- .eq(CqYcqxx::getEstate, cqXxxq.getEstate());
|
|
|
+ .eq(CqYcqxx::getEstate, cqXxxq.getEstate())
|
|
|
+ .ne(CqYcqxx::getState, "2");
|
|
|
List<CqYcqxx> cqYcqxxList=cqYcqxxMapper.selectList(query);
|
|
|
+ System.out.println("xianshi chouzhogndeebanji"+cqYcqxxList);
|
|
|
if (cqYcqxxList.isEmpty()){
|
|
|
System.out.println("空的不处理!");
|
|
|
}else {
|
|
@@ -317,7 +371,8 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
System.out.println("获取学校人数不足抽签人数的学校,都抽签完毕后,去别的学校里补");
|
|
|
//获取人员不够的学校进行补充
|
|
|
for (String estate : dengji) {
|
|
|
- bcxxbanjiry(cqXxxq.getDistrictname(),estate,studentamount);
|
|
|
+// bcxxbanjiry(cqXxxq.getDistrictname(),estate,studentamount);
|
|
|
+ buxs(cqXxxq.getDistrictname(),estate,studentamount);
|
|
|
|
|
|
}
|
|
|
return null;
|
|
@@ -684,4 +739,27 @@ public class CqXxxqServiceImpl extends ServiceImpl<CqXxxqMapper, CqXxxq> impleme
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+ public boolean buxs(String districtname,String estate,int studentamount) {
|
|
|
+ //获取需要补的学校
|
|
|
+ //获取地市抽取的随机数
|
|
|
+ LambdaQueryWrapper<CqCqbjxx> query1 = new LambdaQueryWrapper<>();
|
|
|
+ query1.eq(CqCqbjxx::getDistrictname, districtname);
|
|
|
+ CqCqbjxx cqCqbjxx=cqCqbjxxMapper.selectOne(query1);
|
|
|
+ int chouqurenshu=0;
|
|
|
+ int schoolcodewz=0;
|
|
|
+ CqYcqxx cqYcqxxb=new CqYcqxx();
|
|
|
+ //获取需要补足的学校
|
|
|
+ List<CqYcqxx> cqYcqxxList= cqYcqxxMapper.chabzrsxx(districtname,estate,studentamount);
|
|
|
+ System.out.println("显示不够抽签人数的学校");
|
|
|
+ System.out.println(cqYcqxxList);
|
|
|
+ System.out.println(cqYcqxxList.size());
|
|
|
+ for (CqYcqxx cqYcqxx : cqYcqxxList) {
|
|
|
+ chouqurenshu=studentamount-cqYcqxx.getSchoolpopulation();
|
|
|
+ //获取补的学校
|
|
|
+ cqYcqxxb=cqYcqxxMapper.chabu(cqYcqxx.getId());
|
|
|
+ System.out.println("显示补足的学校"+cqYcqxxb);
|
|
|
+ rycqsjsbj(cqYcqxxb,cqCqbjxx,chouqurenshu);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|