updates
This commit is contained in:
parent
80deb8892e
commit
2a9d09ae36
|
|
@ -7,23 +7,25 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.net.URLDecoder;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import antlr.collections.impl.LList;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.exception.JeecgBootException;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.yx.dto.LiNianShuJuDTO;
|
||||
import org.jeecg.modules.yx.dto.SchoolImport2;
|
||||
import org.jeecg.modules.yx.dto.SchoolMajorImport3;
|
||||
import org.jeecg.modules.yx.dto.SchoolUpdateCodeImport;
|
||||
import org.jeecg.modules.web.vo.QueryRecommendMajorVO;
|
||||
import org.jeecg.modules.yx.dto.*;
|
||||
import org.jeecg.modules.yx.entity.*;
|
||||
import org.jeecg.modules.yx.service.*;
|
||||
|
||||
|
|
@ -63,23 +65,27 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
public class YxSchoolController extends JeecgController<YxSchool, IYxSchoolService> {
|
||||
@Autowired
|
||||
private IYxSchoolService yxSchoolService;
|
||||
@Autowired
|
||||
private IYxSchoolChildService yxSchoolChildService;
|
||||
@Autowired
|
||||
private IYxMajorService yxMajorService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IYxSchoolMajorService yxSchoolMajorService;
|
||||
@Autowired
|
||||
private IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
|
||||
@Autowired
|
||||
private IYxFirstLevelDisciplinesService yxFirstLevelDisciplinesService;
|
||||
@Autowired
|
||||
private IYxHistoryScoreControlLineService yxHistoryScoreControlLineService;
|
||||
private IYxSchoolChildService yxSchoolChildService;
|
||||
|
||||
@GetMapping(value = "/queryNotHasSchool")
|
||||
public Result<?> queryNotHasSchool(){
|
||||
List<String> schoolCodeList = yxSchoolChildService.getSchoolCodeList(null);
|
||||
if (CollectionUtil.isNotEmpty(schoolCodeList)) {
|
||||
LambdaQueryWrapper<YxSchoolMajor> schoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
schoolMajorLambdaQueryWrapper.notIn(YxSchoolMajor::getSchoolCode,schoolCodeList);
|
||||
schoolMajorLambdaQueryWrapper.select(YxSchoolMajor::getSchoolCode);
|
||||
schoolMajorLambdaQueryWrapper.groupBy(YxSchoolMajor::getSchoolCode);
|
||||
List<YxSchoolMajor> list = yxSchoolMajorService.list(schoolMajorLambdaQueryWrapper);
|
||||
schoolCodeList = list.stream().map(YxSchoolMajor::getSchoolCode).collect(Collectors.toList());
|
||||
}
|
||||
return Result.OK(schoolCodeList);
|
||||
}
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param yxSchool
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
|
|
@ -88,14 +94,12 @@ public class YxSchoolController extends JeecgController<YxSchool, IYxSchoolServi
|
|||
//@AutoLog(value = "学校信息表-分页列表查询")
|
||||
@ApiOperation(value = "学校信息表-分页列表查询", notes = "学校信息表-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<YxSchool>> queryPageList(YxSchool yxSchool,
|
||||
public Result<IPage<YxSchool>> queryPageList(QueryRecommendMajorVO queryRecommendMajorVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<YxSchool> queryWrapper = QueryGenerator.initQueryWrapper(yxSchool, req.getParameterMap());
|
||||
Page<YxSchool> page = new Page<>(pageNo, pageSize);
|
||||
IPage<YxSchool> pageList = yxSchoolService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
return Result.OK(yxSchoolService.queryPageList(page,queryRecommendMajorVO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -180,7 +184,46 @@ public class YxSchoolController extends JeecgController<YxSchool, IYxSchoolServi
|
|||
/*@RequiresPermissions("yx:yx_school:exportXls")*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, YxSchool yxSchool) {
|
||||
return super.exportXls(request, yxSchool, YxSchool.class, "学校信息表");
|
||||
String title = "学校信息表";
|
||||
// Step.1 组装查询条件
|
||||
LambdaQueryWrapper<YxSchool> queryWrapper = new LambdaQueryWrapper<>();
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections");
|
||||
if (oConvertUtils.isNotEmpty(selections)) {
|
||||
List<String> selectionList = Arrays.asList(selections.split(","));
|
||||
queryWrapper.select(YxSchool::getId);
|
||||
queryWrapper.select(YxSchool::getSchoolName);
|
||||
queryWrapper.in(YxSchool::getId,selectionList);
|
||||
}
|
||||
List<YxSchool> exportList = service.list(queryWrapper);
|
||||
Map<String, String> schoolIdMap = exportList.stream().collect(Collectors.toMap(YxSchool::getId, YxSchool::getSchoolName));
|
||||
|
||||
List<SchoolExportDTO> schoolExportDTOList =new ArrayList<>();
|
||||
if (CollectionUtil.isNotEmpty(exportList)) {
|
||||
List<String> schoolIdList = exportList.stream().map(YxSchool::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<YxSchoolChild> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(YxSchoolChild::getSchoolId,schoolIdList);
|
||||
lambdaQueryWrapper.orderByDesc(YxSchoolChild::getSchoolCode);
|
||||
lambdaQueryWrapper.select(YxSchoolChild::getSchoolId,YxSchoolChild::getSchoolName,YxSchoolChild::getSchoolCode);
|
||||
List<YxSchoolChild> schoolChildList = yxSchoolChildService.list(lambdaQueryWrapper);
|
||||
SchoolExportDTO schoolExportDTO = null;
|
||||
for (YxSchoolChild yxSchoolChild : schoolChildList) {
|
||||
schoolExportDTO = new SchoolExportDTO();
|
||||
schoolExportDTO.setSchoolName(yxSchoolChild.getSchoolName());
|
||||
schoolExportDTO.setSchoolCode(yxSchoolChild.getSchoolCode());
|
||||
schoolExportDTO.setMasterSchoolName(schoolIdMap.get(yxSchoolChild.getSchoolId()));
|
||||
schoolExportDTOList.add(schoolExportDTO);
|
||||
}
|
||||
}
|
||||
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
||||
mv.addObject(NormalExcelConstants.CLASS, SchoolExportDTO.class);
|
||||
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
||||
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, schoolExportDTOList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -203,21 +246,17 @@ public class YxSchoolController extends JeecgController<YxSchool, IYxSchoolServi
|
|||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<YxSchool> list = ExcelImportUtil.importExcel(file.getInputStream(), YxSchool.class, params);
|
||||
|
||||
// if (CollectionUtils.isNotEmpty(list)) {
|
||||
// for (YxSchool yxSchool : list) {
|
||||
// long count = service.count(new LambdaQueryWrapper<YxSchool>().eq(YxSchool::getSchoolCode, yxSchool.getSchoolCode()));
|
||||
// if (count > 0) {
|
||||
// return Result.error(String.format("文件导入失败:学校代码-%s-已存在!", yxSchool.getSchoolCode()));
|
||||
// }
|
||||
// }
|
||||
// List<YxSchool> schoolList = yxSchoolService.list(new LambdaQueryWrapper<YxSchool>().select(YxSchool::getId, YxSchool::getSchoolName));
|
||||
// Map<String, String> schoolNameMap = schoolList.stream().collect(Collectors.toMap(YxSchool::getSchoolName, YxSchool::getId));
|
||||
// List<SchoolExportDTO> list = ExcelImportUtil.importExcel(file.getInputStream(), SchoolExportDTO.class, params);
|
||||
// long start = System.currentTimeMillis();
|
||||
// for (SchoolExportDTO schoolExportDTO : list) {
|
||||
// schoolNameMap.get(schoolExportDTO.getMasterSchoolName());
|
||||
// }
|
||||
//update-begin-author:taoyan date:20190528 for:批量插入数据
|
||||
long start = System.currentTimeMillis();
|
||||
service.saveBatch(list);
|
||||
log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
// service.saveBatch(list);
|
||||
// log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
// return Result.ok("文件导入成功!数据行数:" + list.size());
|
||||
return Result.ok("暂未开放");
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.error(msg, e);
|
||||
|
|
@ -237,104 +276,4 @@ public class YxSchoolController extends JeecgController<YxSchool, IYxSchoolServi
|
|||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/importSchoolMajor")
|
||||
public Result<?> importSchoolMajor() {
|
||||
//将本科专业 入库
|
||||
//获取 本科 专业 分类
|
||||
LambdaQueryWrapper<YxFirstLevelDisciplines> yxFirstLevelDisciplinesLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxFirstLevelDisciplinesLambdaQueryWrapper.eq(YxFirstLevelDisciplines::getEducationalLevel, 1);
|
||||
List<YxFirstLevelDisciplines> yxFirstLevelDisciplinesList = yxFirstLevelDisciplinesService.list(yxFirstLevelDisciplinesLambdaQueryWrapper);
|
||||
Map<String, String> types = new LinkedHashMap<>();
|
||||
//本科
|
||||
types.put("1693636614636453889", "艺术学");//设计类
|
||||
types.put("1693636948259782657", "13");//美术类
|
||||
types.put("1729330561128599553", "13");//戏剧与影视学类
|
||||
types.put("1729330693307895810", "13");//艺术学理论类
|
||||
types.put("1729330817086001154", "13");//音乐与舞蹈学类
|
||||
types.put("1722224567122784257", "4");//体育类
|
||||
//本科 职业教育
|
||||
types.put("1731184193902026753", "35");//艺术设计类
|
||||
types.put("1731184290459099137", "35");//表演艺术类
|
||||
types.put("1731184354581618689", "35");//文化服务类
|
||||
types.put("1731184415533244417", "37");//体育类(本科职业教育)
|
||||
//高职高专
|
||||
types.put("1729375855455334402", "57");//体育类
|
||||
types.put("1731488738330918913", "56");//广播影视类
|
||||
types.put("1729376034648584193", "55");//艺术设计类
|
||||
types.put("1729376091326214145", "55");//表演艺术类
|
||||
types.put("1729376162675519489", "55");//民族文化艺术类
|
||||
types.put("1729376220997316609", "55");//文化服务类
|
||||
//获取 省控线 数据
|
||||
List<YxHistoryScoreControlLine> yxHistoryScoreControlLineList = yxHistoryScoreControlLineService.list(new LambdaQueryWrapper<YxHistoryScoreControlLine>().eq(YxHistoryScoreControlLine::getYear, "2023"));
|
||||
Map<String, YxHistoryScoreControlLine> yxHistoryScoreControlLineMap = yxHistoryScoreControlLineList.stream().collect(Collectors.toMap(c -> c.getProfessionalCategory() + "_" + c.getCategory() + "_" + c.getBatch(), c -> c));
|
||||
|
||||
//获取本科专业
|
||||
LambdaQueryWrapper<YxMajor> yxMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxMajorLambdaQueryWrapper.eq(YxMajor::getEducationalLevel, 1);//本科
|
||||
List<YxMajor> majorBenlist = yxMajorService.list(yxMajorLambdaQueryWrapper);
|
||||
List<String> benMajorCodeList = majorBenlist.stream().map(YxMajor::getMajorCode).collect(Collectors.toList());
|
||||
//获取本科专业
|
||||
yxMajorLambdaQueryWrapper.clear();
|
||||
yxMajorLambdaQueryWrapper.eq(YxMajor::getEducationalLevel, 2);//高职高专
|
||||
List<YxMajor> majorZhuanlist = yxMajorService.list(yxMajorLambdaQueryWrapper);
|
||||
List<String> zhuanMajorCodeList = majorZhuanlist.stream().map(YxMajor::getMajorCode).collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<YxHistoryMajorEnroll> yxHistoryMajorEnrollLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
yxHistoryMajorEnrollLambdaQueryWrapper.groupBy(YxHistoryMajorEnroll::getSchoolCode, YxHistoryMajorEnroll::getMajorName, YxHistoryMajorEnroll::getBatch, YxHistoryMajorEnroll::getCategory);
|
||||
List<YxHistoryMajorEnroll> list = yxHistoryMajorEnrollService.list(yxHistoryMajorEnrollLambdaQueryWrapper);
|
||||
YxSchoolMajor yxSchoolMajor = new YxSchoolMajor();
|
||||
List<YxSchoolMajor> schoolMajorList = new ArrayList<>();
|
||||
YxHistoryScoreControlLine yxHistoryScoreControlLine = null;
|
||||
|
||||
LambdaQueryWrapper<YxSchoolMajor> yxSchoolMajorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
String batch2 = null;
|
||||
for (YxHistoryMajorEnroll yxHistoryMajorEnroll : list) {
|
||||
batch2 = yxHistoryMajorEnroll.getBatch();
|
||||
if (yxHistoryMajorEnroll.getBatch().contains("提前批")) {
|
||||
batch2 = "本科A段";
|
||||
} else if (yxHistoryMajorEnroll.getBatch().contains("专")) {
|
||||
batch2 = "高职高专";
|
||||
}
|
||||
// if(!zhuanMajorCodeList.contains(yxHistoryMajorEnroll.getMajorCode())){
|
||||
// continue;
|
||||
// }
|
||||
// if(!benMajorCodeList.contains(yxHistoryMajorEnroll.getMajorCode())){
|
||||
// continue;
|
||||
// }
|
||||
yxSchoolMajorLambdaQueryWrapper.clear();
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getMajorName, yxHistoryMajorEnroll.getMajorName());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getSchoolCode, yxHistoryMajorEnroll.getSchoolCode());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getBatch, yxHistoryMajorEnroll.getBatch());
|
||||
yxSchoolMajorLambdaQueryWrapper.eq(YxSchoolMajor::getCategory, yxHistoryMajorEnroll.getCategory());
|
||||
yxSchoolMajor = yxSchoolMajorService.getOne(yxSchoolMajorLambdaQueryWrapper);
|
||||
if (yxSchoolMajor == null) {
|
||||
yxSchoolMajor = new YxSchoolMajor();
|
||||
}
|
||||
yxSchoolMajor.setSchoolCode(yxHistoryMajorEnroll.getSchoolCode());
|
||||
yxSchoolMajor.setMajorCode(yxHistoryMajorEnroll.getMajorCode());
|
||||
yxSchoolMajor.setMajorName(yxHistoryMajorEnroll.getMajorName());
|
||||
yxSchoolMajor.setTuition(new BigDecimal(0));
|
||||
yxSchoolMajor.setDetail(null);
|
||||
yxSchoolMajor.setCategory(yxHistoryMajorEnroll.getCategory());
|
||||
yxSchoolMajor.setRulesEnrollProbability(yxHistoryMajorEnroll.getRulesEnrollProbability());
|
||||
yxSchoolMajor.setProbabilityOperator(yxHistoryMajorEnroll.getProbabilityOperator());
|
||||
yxSchoolMajor.setBatch(yxHistoryMajorEnroll.getBatch());
|
||||
yxSchoolMajor.setEnrollmentCode(yxHistoryMajorEnroll.getEnrollmentCode());
|
||||
yxSchoolMajor.setMajorType(yxHistoryMajorEnroll.getMajorType());
|
||||
yxHistoryScoreControlLine = yxHistoryScoreControlLineMap.get(yxHistoryMajorEnroll.getMajorType() + "_" + yxHistoryMajorEnroll.getCategory() + "_" + batch2);
|
||||
if (yxHistoryScoreControlLine == null) {
|
||||
System.out.println(yxHistoryMajorEnroll.getMajorType() + "_" + yxHistoryMajorEnroll.getCategory());
|
||||
throw new JeecgBootException("未获取到分数线");
|
||||
}
|
||||
yxSchoolMajor.setCulturalControlLine(yxHistoryScoreControlLine.getCulturalScore());
|
||||
yxSchoolMajor.setSpecialControlLine(yxHistoryScoreControlLine.getSpecialScore());
|
||||
|
||||
schoolMajorList.add(yxSchoolMajor);
|
||||
}
|
||||
//yxSchoolMajorService.saveOrUpdateBatch(schoolMajorList);
|
||||
System.out.println(list.size());
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
AssertUtils.notEmpty(schoolCode, "请选择[学校]!");
|
||||
AssertUtils.notEmpty(majorCode, "请选择[专业]!");
|
||||
AssertUtils.notEmpty(yxSchoolMajor.getMajorName(), "请输入[专业名称]!");
|
||||
//AssertUtils.notNull(yxSchoolMajor.getTuition(), "请输入[学费]!");
|
||||
AssertUtils.isTrue(yxSchoolChildService.checkHasSchoolCode(schoolCode),String.format("院校代码-[%s]-不存在",schoolCode));
|
||||
AssertUtils.notTrue(yxSchoolMajorService.exist(yxSchoolMajor), String.format("专业-[%s]-已经录入", majorCode));
|
||||
if (StringUtils.isNotBlank(yxSchoolMajor.getMajorName())) {
|
||||
yxSchoolMajor.setMajorName(yxSchoolMajor.getMajorName().replace("(","(").replace(")",")"));
|
||||
|
|
@ -154,6 +154,7 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
String majorName = yxSchoolMajor.getMajorName();
|
||||
String schoolCode = yxSchoolMajor.getSchoolCode();
|
||||
AssertUtils.notEmpty(schoolCode, "请输入[学校代码]!");
|
||||
AssertUtils.isTrue(yxSchoolChildService.checkHasSchoolCode(schoolCode),String.format("院校代码-[%s]-不存在",schoolCode));
|
||||
AssertUtils.notEmpty(majorCode, "请输入[专业代码]!");
|
||||
AssertUtils.notEmpty(majorName, "请输入[专业名称]!");
|
||||
AssertUtils.notEmpty(yxSchoolMajor.getEnrollmentCode(), "请输入[招生代码]!");
|
||||
|
|
@ -196,6 +197,7 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
schoolCode = yxSchoolMajor.getSchoolCode();
|
||||
enrollmentCode = yxSchoolMajor.getEnrollmentCode();
|
||||
AssertUtils.notEmpty(schoolCode, String.format("第%s行,请输入[学校代码]!",i));
|
||||
AssertUtils.isTrue(yxSchoolChildService.checkHasSchoolCode(schoolCode),String.format("第%s行-院校代码-[%s]-不存在",i,schoolCode));
|
||||
AssertUtils.notEmpty(majorCode, String.format("第%s行,请输入[专业代码]!",i));
|
||||
AssertUtils.notEmpty(majorName, String.format("第%s行,请输入[专业名称]!",i));
|
||||
AssertUtils.notEmpty(enrollmentCode, String.format("第%s行,请输入[招生代码]!",i));
|
||||
|
|
@ -375,6 +377,7 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
|
||||
} else if(majorType.contains("音乐类")){
|
||||
//主考科目
|
||||
AssertUtils.notEmpty(mainSubjects,String.format("行[%s],未识别到音乐类型-主考科目", index));
|
||||
if (mainSubjects.contains("器乐")&&mainSubjects.contains("声乐")) {
|
||||
item.setMainSubjects("器乐,声乐");
|
||||
} else if (mainSubjects.contains("器乐")) {
|
||||
|
|
@ -419,6 +422,9 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
AssertUtils.notTrue(!schoolMajorStateTextMap.values().contains(item.getState()),String.format("行[%s],状态有误", index));
|
||||
}
|
||||
|
||||
// 院校代码 set
|
||||
Set<String> schoolCodeSet = list.stream().map(YxSchoolMajor::getSchoolCode).collect(Collectors.toSet());
|
||||
List<String> schoolCodeList = yxSchoolChildService.getSchoolCodeList(Collections.singleton(schoolCodeSet));
|
||||
index=3;
|
||||
YxSchoolMajor yxSchoolMajor;
|
||||
String probabilityOperator ="";
|
||||
|
|
@ -427,6 +433,7 @@ public class YxSchoolMajorController extends JeecgController<YxSchoolMajor, IYxS
|
|||
if (org.apache.commons.lang.StringUtils.isBlank(item.getSchoolCode()) && org.apache.commons.lang.StringUtils.isBlank(item.getMajorName())) {
|
||||
continue;
|
||||
}
|
||||
AssertUtils.isTrue(schoolCodeList.contains(item.getSchoolCode()),String.format("行[%s],学校代码-[%s]-系统不存在", index,item.getSchoolCode()));
|
||||
key = item.getSchoolCode()+a+item.getBatch()+a+item.getMajorName()+a+item.getCategory();
|
||||
|
||||
yxSchoolMajor = schoolMajorMap.get(key);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package org.jeecg.modules.yx.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author ZhouWenTao
|
||||
* @create 2024-06-23-14:06
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SchoolExportDTO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 学校名称
|
||||
*/
|
||||
@Excel(name = "主学校名称", width = 15)
|
||||
@ApiModelProperty(value = "主学校名称")
|
||||
private java.lang.String masterSchoolName;
|
||||
|
||||
/**
|
||||
* 院校代码
|
||||
*/
|
||||
@Excel(name = "院校代码", width = 15)
|
||||
private String schoolCode;
|
||||
|
||||
/**
|
||||
* 院校名称
|
||||
*/
|
||||
@Excel(name = "院校名称", width = 15)
|
||||
private String schoolName;
|
||||
}
|
||||
|
|
@ -1,20 +1,14 @@
|
|||
package org.jeecg.modules.yx.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -40,6 +34,7 @@ public class YxSchool implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**
|
||||
* 学校名称
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -56,4 +56,6 @@ public interface YxSchoolMapper extends BaseMapper<YxSchool> {
|
|||
List<ArtHotSchoolDTO> artSchoolList2(@Param("province") String province,@Param("schoolType") String schoolType );
|
||||
|
||||
List<ArtHotSchoolDTO> artSchoolListBySchoolCodeList(@Param("schoolCodeList") List<String> schoolCodeList);
|
||||
|
||||
IPage<YxSchool> queryPageList(@Param("page") Page<YxSchool> page, @Param("qvo") QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -475,4 +475,17 @@
|
|||
<foreach collection="schoolCodeList" index="index" item="b" open="(" separator="," close=")">#{b}</foreach>
|
||||
ORDER BY FIELD(sc.school_code,<foreach collection="schoolCodeList" index="index" item="b" open="" separator="," close="">#{b}</foreach>)
|
||||
</select>
|
||||
<select id="queryPageList" resultType="org.jeecg.modules.yx.entity.YxSchool">
|
||||
SELECT s.* FROM yx_school s
|
||||
LEFT JOIN yx_school_child sc ON sc.school_id = s.id
|
||||
<where>
|
||||
<if test="qvo.schoolCode!=null and qvo.schoolCode!=''">
|
||||
AND sc.school_code like concat('%',#{qvo.schoolCode},'%')
|
||||
</if>
|
||||
<if test="qvo.schoolName!=null and qvo.schoolName!=''">
|
||||
AND (sc.school_name like concat('%',#{qvo.schoolName},'%') or s.school_name like concat('%',#{qvo.schoolName},'%'))
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY s.create_time,s.update_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package org.jeecg.modules.yx.service;
|
|||
import org.jeecg.modules.yx.entity.YxSchoolChild;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 子级院校表
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -10,5 +13,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
public interface IYxSchoolChildService extends IService<YxSchoolChild> {
|
||||
/**
|
||||
* 判断院校代码是否存在
|
||||
* @param schoolCode
|
||||
* @return
|
||||
*/
|
||||
public boolean checkHasSchoolCode(String schoolCode);
|
||||
|
||||
public List<String> getSchoolCodeList(Collection<Object> collection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package org.jeecg.modules.yx.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.jeecg.modules.web.dto.ArtHotSchoolDTO;
|
||||
import org.jeecg.modules.web.dto.ArtSchoolDTO;
|
||||
import org.jeecg.modules.web.vo.QueryRecommendMajorVO;
|
||||
|
|
@ -38,5 +39,7 @@ public interface IYxSchoolService extends IService<YxSchool> {
|
|||
*/
|
||||
IPage<MiniSchoolDTO> miniSchoolSearch(QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
|
||||
IPage<YxSchool> queryPageList(Page<YxSchool> page, QueryRecommendMajorVO queryRecommendMajorVO);
|
||||
|
||||
//小程序代码=================================================
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,7 +213,10 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
|
|||
yxHistoryScoreControlLine = historyScoreControlLineMap.get(recommendMajorDTO.getBatch());
|
||||
if (yxHistoryScoreControlLine!=null) {
|
||||
if (recommendMajorDTO.getStudentScore()!=null) {
|
||||
recommendMajorDTO.setScoreLineDifference(recommendMajorDTO.getStudentScore().subtract(ScoreUtil.covertIntoControlLine(recommendMajorDTO.getRulesEnrollProbability(), yxHistoryScoreControlLine.getCulturalScore(), yxHistoryScoreControlLine.getSpecialScore(), recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator())));
|
||||
recommendMajorDTO.setScoreLineDifference(recommendMajorDTO.getStudentScore().subtract(ScoreUtil.covertIntoControlLine(recommendMajorDTO.getRulesEnrollProbability(),
|
||||
yxHistoryScoreControlLine.getCulturalScore(),
|
||||
yxHistoryScoreControlLine.getSpecialScore(),
|
||||
recommendMajorDTO.getFirstLevelDiscipline(), recommendMajorDTO.getProbabilityOperator())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package org.jeecg.modules.yx.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jeecg.modules.yx.entity.YxSchoolChild;
|
||||
import org.jeecg.modules.yx.mapper.YxSchoolChildMapper;
|
||||
import org.jeecg.modules.yx.service.IYxSchoolChildService;
|
||||
|
|
@ -7,6 +9,11 @@ import org.springframework.stereotype.Service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 子级院校表
|
||||
* @Author: jeecg-boot
|
||||
|
|
@ -16,4 +23,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
@Service
|
||||
public class YxSchoolChildServiceImpl extends ServiceImpl<YxSchoolChildMapper, YxSchoolChild> implements IYxSchoolChildService {
|
||||
|
||||
@Override
|
||||
public boolean checkHasSchoolCode(String schoolCode) {
|
||||
LambdaQueryWrapper<YxSchoolChild> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(YxSchoolChild::getSchoolCode,schoolCode);
|
||||
return count(lambdaQueryWrapper)>0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSchoolCodeList(Collection<Object> collection) {
|
||||
LambdaQueryWrapper<YxSchoolChild> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (CollectionUtil.isNotEmpty(collection)) {
|
||||
lambdaQueryWrapper.in(YxSchoolChild::getSchoolCode,collection);
|
||||
}
|
||||
lambdaQueryWrapper.select(YxSchoolChild::getSchoolCode);
|
||||
List<YxSchoolChild> list = list(lambdaQueryWrapper);
|
||||
return list.stream().map(YxSchoolChild::getSchoolCode).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,11 @@ public class YxSchoolServiceImpl extends ServiceImpl<YxSchoolMapper, YxSchool> i
|
|||
return dtoPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<YxSchool> queryPageList(Page<YxSchool> page, QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
return baseMapper.queryPageList(page,queryRecommendMajorVO);
|
||||
}
|
||||
|
||||
///==========================PC端
|
||||
@Override
|
||||
public IPage<ArtSchoolDTO> search(QueryRecommendMajorVO queryRecommendMajorVO) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue