This commit is contained in:
zhouwentao 2025-11-28 09:25:40 +08:00
parent ea89c6ed53
commit 8c4afa1fa1
13 changed files with 222 additions and 87 deletions

View File

@ -23,6 +23,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -41,39 +42,38 @@ public class StaticDataController {
@Resource @Resource
private IYxHistoryMajorEnrollService yxHistoryMajorEnrollService; private IYxHistoryMajorEnrollService yxHistoryMajorEnrollService;
@RequestMapping(value = "/getJson",method = RequestMethod.POST) @RequestMapping(value = "/getJson", method = RequestMethod.POST)
public Result<?> getJson(@RequestBody JSONObject params, HttpServletRequest request){ public Result<?> getJson(@RequestBody JSONObject params, HttpServletRequest request) {
String key = params.getStr("key"); String key = params.getStr("key");
String programType = params.getStr("programType"); String programType = params.getStr("programType");
if (StringUtils.isNotBlank(key)) { if (StringUtils.isNotBlank(key)) {
JSONObject responseData = new JSONObject(); JSONObject responseData = new JSONObject();
switch (key){ switch (key) {
case "reload_major_modal_message": case "reload_major_modal_message":
responseData.set("message1","刷新专业是用来获取最新的专业录取规则,刷新后已填报志愿单将移除,需要手动再次添加。"); responseData.set("message1", "刷新专业是用来获取最新的专业录取规则,刷新后已填报志愿单将移除,需要手动再次添加。");
responseData.set("message2","可刷新专业来获取最新的专业录取规则"); responseData.set("message2", "可刷新专业来获取最新的专业录取规则");
// 刷新专业提示 // 刷新专业提示
return Result.OK(responseData); return Result.OK(responseData);
case "volunteer_preview": case "volunteer_preview":
// 查看志愿单按钮 // 查看志愿单按钮
// 查看方式 1.跳转浏览器下载2.web-view预览 // 查看方式 1.跳转浏览器下载2.web-view预览
responseData.set("type","1"); responseData.set("type", "1");
//附件地址 //附件地址
responseData.set("filePrefixUrl","https://www.yitisheng.vip/volunteer/preview"); responseData.set("filePrefixUrl", "https://www.yitisheng.vip/volunteer/preview");
responseData.set("webViewUrl","/"); responseData.set("webViewUrl", "/");
responseData.set("message","目前不支持小程序打印。已自动复制网址,请在手机浏览器里粘贴该网址进行打印。"); responseData.set("message", "目前不支持小程序打印。已自动复制网址,请在手机浏览器里粘贴该网址进行打印。");
return Result.OK(responseData); return Result.OK(responseData);
case "professionalCategoryList": case "professionalCategoryList":
if (StringUtils.isBlank(programType) || "艺体志愿宝".equals(programType)) { if (StringUtils.isBlank(programType) || "艺体志愿宝".equals(programType)) {
String json = "[{\"value\":\"美术与设计类\",\"label\":\"美术与设计类\",\"scoreMax\":300},{\"value\":\"音乐类\",\"label\":\"音乐类\",\"scoreMax\":300,\"children\":[{\"label\":\"音乐表演声乐\",\"value\":\"音乐表演声乐\",\"exclude\":\"音乐表演器乐\"},{\"label\":\"音乐表演器乐\",\"value\":\"音乐表演器乐\",\"exclude\":\"音乐表演声乐\"},{\"label\":\"音乐教育\",\"value\":\"音乐教育\"}]},{\"value\":\"舞蹈类\",\"label\":\"舞蹈类\",\"scoreMax\":300},{\"value\":\"播音与主持类\",\"label\":\"播音与主持类\",\"scoreMax\":300},{\"value\":\"表演类\",\"label\":\"表演类\",\"scoreMax\":300,\"children\":[{\"label\":\"服装表演\",\"value\":\"服装表演\"},{\"label\":\"戏剧影视导演\",\"value\":\"戏剧影视导演\"},{\"label\":\"戏剧影视表演\",\"value\":\"戏剧影视表演\"}]},{\"value\":\"书法类\",\"label\":\"书法类\",\"scoreMax\":300},{\"value\":\"体育类\",\"label\":\"体育类\",\"scoreMax\":150}]"; String json = "[{\"value\":\"美术与设计类\",\"label\":\"美术与设计类\",\"scoreMax\":300},{\"value\":\"音乐类\",\"label\":\"音乐类\",\"scoreMax\":300,\"children\":[{\"label\":\"音乐表演声乐\",\"value\":\"音乐表演声乐\",\"exclude\":\"音乐表演器乐\"},{\"label\":\"音乐表演器乐\",\"value\":\"音乐表演器乐\",\"exclude\":\"音乐表演声乐\"},{\"label\":\"音乐教育\",\"value\":\"音乐教育\"}]},{\"value\":\"舞蹈类\",\"label\":\"舞蹈类\",\"scoreMax\":300},{\"value\":\"播音与主持类\",\"label\":\"播音与主持类\",\"scoreMax\":300},{\"value\":\"表演类\",\"label\":\"表演类\",\"scoreMax\":300,\"children\":[{\"label\":\"服装表演\",\"value\":\"服装表演\"},{\"label\":\"戏剧影视导演\",\"value\":\"戏剧影视导演\"},{\"label\":\"戏剧影视表演\",\"value\":\"戏剧影视表演\"}]},{\"value\":\"书法类\",\"label\":\"书法类\",\"scoreMax\":300},{\"value\":\"体育类\",\"label\":\"体育类\",\"scoreMax\":150}]";
return Result.OK(JSONArray.parseArray(json)); return Result.OK(JSONArray.parseArray(json));
}else{ } else {
String json = "[{\"value\":\"体育类\",\"label\":\"体育类\",\"scoreMax\":150}]"; String json = "[{\"value\":\"体育类\",\"label\":\"体育类\",\"scoreMax\":150}]";
return Result.OK(JSONArray.parseArray(json)); return Result.OK(JSONArray.parseArray(json));
} }
case "miniConfig": case "miniConfig":
return Result.OK(commonConfig()); return Result.OK(commonConfig());
case "sportsScore": case "sportsScore":
// 体育成绩计算器 // 体育成绩计算器
Integer year = params.getInt("year"); Integer year = params.getInt("year");
@ -83,17 +83,17 @@ public class StaticDataController {
BigDecimal shotPut = params.getBigDecimal("shotPut");// 推铅球 BigDecimal shotPut = params.getBigDecimal("shotPut");// 推铅球
year = 2024; year = 2024;
// AssertUtils.notNull(year,"请选择年份"); // AssertUtils.notNull(year,"请选择年份");
AssertUtils.notNull(sex,"请选择性别成绩"); AssertUtils.notNull(sex, "请选择性别成绩");
AssertUtils.notNull(sprint,"请输入100米跑成绩"); AssertUtils.notNull(sprint, "请输入100米跑成绩");
AssertUtils.notNull(jump,"请输入立定跳远成绩"); AssertUtils.notNull(jump, "请输入立定跳远成绩");
AssertUtils.notNull(shotPut,"请输入推铅球成绩"); AssertUtils.notNull(shotPut, "请输入推铅球成绩");
List<BigDecimal> pointsList = new ArrayList<>(); List<BigDecimal> pointsList = new ArrayList<>();
// 100米 // 100米
pointsList.add(yxSportsScoreService.getSprintPoints(year,sex,sprint)); pointsList.add(yxSportsScoreService.getSprintPoints(year, sex, sprint));
// 立定跳远 // 立定跳远
pointsList.add(yxSportsScoreService.getJumpPoints(year,sex,jump)); pointsList.add(yxSportsScoreService.getJumpPoints(year, sex, jump));
// 推铅球 // 推铅球
pointsList.add(yxSportsScoreService.getShotPutPoints(year,sex,shotPut)); pointsList.add(yxSportsScoreService.getShotPutPoints(year, sex, shotPut));
return Result.OK(pointsList); return Result.OK(pointsList);
} }
} }
@ -104,22 +104,32 @@ public class StaticDataController {
/** /**
* 通用配置当前年份历年... * 通用配置当前年份历年...
*
* @return * @return
*/ */
public JSONObject commonConfig(){ public JSONObject commonConfig() {
String memberDeadline = "2026年08月31日";
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.set("nowYear", 2025); // 当前年份 jsonObject.set("nowYear", 2026); // 当前年份
jsonObject.set("showZeSuan", false); // 是否显示折算按钮 jsonObject.set("showZeSuan", false); // 是否显示折算按钮
jsonObject.set("tiQianPiZhiYuanNum", 1); jsonObject.set("tiQianPiZhiYuanNum", 1);
jsonObject.set("benZhiYuanNum", 64); jsonObject.set("benZhiYuanNum", 64);
jsonObject.set("zhuanZhiYuanNum", 64); jsonObject.set("zhuanZhiYuanNum", 64);
// 会员截止时间 // 会员截止时间
jsonObject.set("memberDeadline", "2025年08月31日"); jsonObject.set("memberDeadline", memberDeadline);
// 志愿卡说明
jsonObject.set("volunteerCardDescList", Arrays.asList("(一)、适用范围:艺术类文理科考生(自主招生暂不适用)。",
"(二)、使用期限:自购买起,截止到" + memberDeadline + "有效。",
"(三)、分数修改次数:每届服务期内高考分数放榜前可修改10次放榜后只可修改1次。",
"(四)、系统数据来源于及第生涯部门,由合作网站提供。",
"(五)、部分年份数据如果为空可能是当年不在查询地招生。系统数据不包含高考加分,如果录取数据与院校公布数据不一致,请以高校正式公布的数据为准。",
"(六)、由于高考填报志愿是一个动态变化的过程,本系统查询的历年高校录取数据仅作为填报志愿参考,请综合各种信息进行报考,勿仅以此填报志愿。",
"(七)、本卡为电子卡,不记名,不挂失,一经出售,概不退换! 最终解释权归本平台所有。"));
// 联系人 // 联系人
JSONObject contact = new JSONObject(); JSONObject contact = new JSONObject();
contact.set("personNumber","15785689971"); contact.set("personNumber", "15785689971");
contact.set("personName","周老师"); contact.set("personName", "周老师");
contact.set("images","https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/web-bakground/20250619212936.jpg"); contact.set("images", "https://mp-7a4eecb1-2a04-4d36-b050-1c4a78cc31a4.cdn.bspapp.com/images/web-bakground/20250619212936.jpg");
jsonObject.set("contact", contact); jsonObject.set("contact", contact);
return jsonObject; return jsonObject;
} }
@ -134,7 +144,7 @@ public class StaticDataController {
for (YxSchoolMajor major : list) { for (YxSchoolMajor major : list) {
i1++; i1++;
// System.out.println(i1); // System.out.println(i1);
if(i1 == 61){ if (i1 == 61) {
// System.out.println("1"); // System.out.println("1");
} }
if (major != null && StringUtils.isNotBlank(major.getProbabilityOperator()) && !major.getProbabilityOperator().equals("") && major.getProbabilityOperator().contains("+")) { if (major != null && StringUtils.isNotBlank(major.getProbabilityOperator()) && !major.getProbabilityOperator().equals("") && major.getProbabilityOperator().contains("+")) {
@ -174,7 +184,7 @@ public class StaticDataController {
for (YxHistoryMajorEnroll major : list) { for (YxHistoryMajorEnroll major : list) {
i1++; i1++;
// System.out.println(i1); // System.out.println(i1);
if(i1 == 61){ if (i1 == 61) {
// System.out.println("1"); // System.out.println("1");
} }
if (major != null && StringUtils.isNotBlank(major.getProbabilityOperator()) && !major.getProbabilityOperator().equals("") && major.getProbabilityOperator().contains("+")) { if (major != null && StringUtils.isNotBlank(major.getProbabilityOperator()) && !major.getProbabilityOperator().equals("") && major.getProbabilityOperator().contains("+")) {
@ -220,11 +230,11 @@ public class StaticDataController {
List<YxSchoolMajor> newList = new ArrayList<>(); List<YxSchoolMajor> newList = new ArrayList<>();
for (YxSchoolMajor yxSchoolMajor : schoolMajorList) { for (YxSchoolMajor yxSchoolMajor : schoolMajorList) {
hmel.clear(); hmel.clear();
hmel.eq(YxHistoryMajorEnroll::getSchoolCode,yxSchoolMajor.getSchoolCode()); hmel.eq(YxHistoryMajorEnroll::getSchoolCode, yxSchoolMajor.getSchoolCode());
hmel.eq(YxHistoryMajorEnroll::getMajorName,yxSchoolMajor.getMajorName()); hmel.eq(YxHistoryMajorEnroll::getMajorName, yxSchoolMajor.getMajorName());
hmel.eq(YxHistoryMajorEnroll::getCategory,yxSchoolMajor.getCategory()); hmel.eq(YxHistoryMajorEnroll::getCategory, yxSchoolMajor.getCategory());
hmel.eq(YxHistoryMajorEnroll::getBatch,yxSchoolMajor.getBatch()); hmel.eq(YxHistoryMajorEnroll::getBatch, yxSchoolMajor.getBatch());
hmel.eq(YxHistoryMajorEnroll::getMajorType,yxSchoolMajor.getMajorType()); hmel.eq(YxHistoryMajorEnroll::getMajorType, yxSchoolMajor.getMajorType());
hmel.eq(YxHistoryMajorEnroll::getYear, "2024"); hmel.eq(YxHistoryMajorEnroll::getYear, "2024");
hmelList = yxHistoryMajorEnrollService.list(hmel); hmelList = yxHistoryMajorEnrollService.list(hmel);

View File

@ -13,6 +13,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.AssertUtils; import org.jeecg.common.util.AssertUtils;
import org.jeecg.modules.web.vo.SaveVolunteerRecordVO;
import org.jeecg.modules.web.vo.SaveVolunteerVO; import org.jeecg.modules.web.vo.SaveVolunteerVO;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
@ -26,6 +27,7 @@ import org.jeecg.modules.yx.service.IYxVolunteerRecordService;
import org.jeecg.modules.yx.service.IYxVolunteerService; import org.jeecg.modules.yx.service.IYxVolunteerService;
import org.jeecg.modules.yx.util.PdfUtil; import org.jeecg.modules.yx.util.PdfUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.thymeleaf.TemplateEngine; import org.thymeleaf.TemplateEngine;
@ -138,6 +140,43 @@ public class ArtVolunteerController {
return Result.OK(yxVolunteerService.artVolunteerSave(saveVolunteerVO)); return Result.OK(yxVolunteerService.artVolunteerSave(saveVolunteerVO));
} }
/**
* saveFilledVolunteer
*/
@ApiOperation(value = "saveFilledVolunteer", notes = "saveFilledVolunteer")
@PostMapping(value = "/saveFilledVolunteer")
public Result<String> saveFilledVolunteer(@RequestBody SaveVolunteerVO saveVolunteerVO) {
AssertUtils.notNull(saveVolunteerVO.getVolunteerId(), "请求参数有误");
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser, "请先登录!");
saveVolunteerVO.setCreateBy(sysUser.getId());
return Result.OK(yxVolunteerService.saveFilledVolunteer(saveVolunteerVO));
}
/**
* 重新保存志愿明细顺序
*/
@ApiOperation(value = "小程序端-重新保存志愿明细顺序")
@PostMapping(value = "/resortVolunteer")
public Result<?> resortVolunteer(@RequestBody SaveVolunteerVO saveVolunteerVO){
AssertUtils.notNull(saveVolunteerVO.getVolunteerId(), "请求参数有误");
if (CollectionUtil.isNotEmpty(saveVolunteerVO.getVolunteerRecordList())) {
List<YxVolunteerRecord> list = new ArrayList<>();
YxVolunteerRecord yxVolunteerRecord;
for (SaveVolunteerRecordVO saveVolunteerRecordVO : saveVolunteerVO.getVolunteerRecordList()) {
yxVolunteerRecord = new YxVolunteerRecord();
yxVolunteerRecord.setId(saveVolunteerRecordVO.getId());
yxVolunteerRecord.setIndexs(saveVolunteerRecordVO.getIndexs());
list.add(yxVolunteerRecord);
}
yxVolunteerRecordService.updateBatchById(list);
}
return Result.OK();
}
/** /**
* 新建志愿 * 新建志愿
*/ */
@ -203,23 +242,57 @@ public class ArtVolunteerController {
@ApiOperation(value = "删除志愿明细") @ApiOperation(value = "删除志愿明细")
@DeleteMapping("/volunteerRecordDelete") @DeleteMapping("/volunteerRecordDelete")
@Transactional(rollbackFor = Exception.class) // 加事务
public Result<?> volunteerRecordDelete(SaveVolunteerVO saveVolunteerVO) { public Result<?> volunteerRecordDelete(SaveVolunteerVO saveVolunteerVO) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser, "请先登录!"); AssertUtils.notNull(sysUser, "请先登录!");
/*String volunteerId = saveVolunteerVO.getVolunteerId();
Integer indexs = saveVolunteerVO.getIndexs();
String batch = saveVolunteerVO.getBatch();
AssertUtils.notNull(volunteerId,"请求参数有误");*/
String id = saveVolunteerVO.getId(); String id = saveVolunteerVO.getId();
AssertUtils.notNull(id, "请求参数有误"); AssertUtils.notNull(id, "请求参数有误");
try { try {
// 先查再删
YxVolunteerRecord yxVolunteerRecord = yxVolunteerRecordService.getById(id);
AssertUtils.notNull(yxVolunteerRecord, "志愿明细不存在");
yxVolunteerRecordService.removeById(id); yxVolunteerRecordService.removeById(id);
String volunteerId = yxVolunteerRecord.getVolunteerId();
if (StringUtils.isNotBlank(volunteerId)) {
VolunteerDTO volunteerDto = yxVolunteerService.findById(volunteerId);
if (volunteerDto != null) {
// 重新排序并更新
updateVolunteerRecordIndexes(volunteerDto.getVolunteerRecordUndergraduateList());
updateVolunteerRecordIndexes(volunteerDto.getVolunteerRecordJuniorCollegeList());
}
}
} catch (Exception e) { } catch (Exception e) {
throw new JeecgBootException(e); throw new JeecgBootException("删除失败", e);
} }
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
/**
* 更新志愿明细序号
*/
private void updateVolunteerRecordIndexes(List<VolunteerRecordDTO> recordList) {
if (CollectionUtils.isEmpty(recordList)) return;
List<YxVolunteerRecord> updateList = new ArrayList<>();
for (int i = 0; i < recordList.size(); i++) {
VolunteerRecordDTO dto = recordList.get(i);
YxVolunteerRecord record = new YxVolunteerRecord();
record.setId(dto.getId());
record.setIndexs(i + 1);
updateList.add(record);
}
if (!updateList.isEmpty()) {
yxVolunteerRecordService.updateBatchById(updateList);
}
}
/** /**
* 移动志愿序号 * 移动志愿序号
*/ */

View File

@ -24,6 +24,9 @@ public class SaveVolunteerVO implements Serializable {
@ApiModelProperty(value = "志愿单名称") @ApiModelProperty(value = "志愿单名称")
private String volunteerName; private String volunteerName;
@ApiModelProperty(value = "专业IdList")
private List<String> calculationMajorIdList;
@ApiModelProperty(value = "志愿单明细信息") @ApiModelProperty(value = "志愿单明细信息")
private List<SaveVolunteerRecordVO> volunteerRecordList; private List<SaveVolunteerRecordVO> volunteerRecordList;

View File

@ -3,7 +3,9 @@ package org.jeecg.modules.yx.constant;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
/** /**
* @Description * @Description
@ -65,7 +67,9 @@ public class YxConstant {
public static List<String> defaultRulesEnrollProbabilityList = Arrays.asList("文过专排", "专过文排"); public static List<String> defaultRulesEnrollProbabilityList = Arrays.asList("文过专排", "专过文排");
public static String zhuanke= "高职高专";
public static List<String> batchList1=Arrays.asList("提前批","本科","本科A段","本科B段"); public static List<String> batchList1=Arrays.asList("提前批","本科","本科A段","本科B段");
public static Set<String> batchSet1 = new HashSet<>(Arrays.asList("提前批","本科","本科A段","本科B段"));
//当天最多修改成绩次数 //当天最多修改成绩次数
public static final Integer todayMaxEditScoreCount = 10; public static final Integer todayMaxEditScoreCount = 10;

View File

@ -72,8 +72,10 @@ public class VolunteerDTO implements Serializable {
private List<VolunteerRecordDTO> volunteerRecordUndergraduateAList; private List<VolunteerRecordDTO> volunteerRecordUndergraduateAList;
@ApiModelProperty(value = "填报志愿明细信息-本科B段") @ApiModelProperty(value = "填报志愿明细信息-本科B段")
private List<VolunteerRecordDTO> volunteerRecordUndergraduateBList; private List<VolunteerRecordDTO> volunteerRecordUndergraduateBList;
/**填报志愿明细信息-本科*/
@ApiModelProperty(value = "填报志愿明细信息-本科") @ApiModelProperty(value = "填报志愿明细信息-本科")
private List<VolunteerRecordDTO> volunteerRecordUndergraduateList; private List<VolunteerRecordDTO> volunteerRecordUndergraduateList;
/**填报志愿明细信息-高职高专*/
@ApiModelProperty(value = "填报志愿明细信息-高职高专") @ApiModelProperty(value = "填报志愿明细信息-高职高专")
private List<VolunteerRecordDTO> volunteerRecordJuniorCollegeList; private List<VolunteerRecordDTO> volunteerRecordJuniorCollegeList;
} }

View File

@ -27,5 +27,7 @@ public interface YxCalculationMajorMapper extends BaseMapper<YxCalculationMajor>
YxCalculationMajor getCalculationById(@Param("calculationTableName") String calculationTableName, @Param("calculationMajorId") String calculationMajorId); YxCalculationMajor getCalculationById(@Param("calculationTableName") String calculationTableName, @Param("calculationMajorId") String calculationMajorId);
int updateScoreId(@Param("calculationTableName") String calculationTableName,@Param("scoreId") String scoreId,@Param("bakScoreId") String bakScoreId); int updateScoreId(@Param("calculationTableName") String calculationTableName,@Param("scoreId") String scoreId, @Param("bakScoreId") String bakScoreId);
List<YxCalculationMajor> selectBatchIdsOfYear(@Param("calculationMajorIdList") List<String> calculationMajorIdList, @Param("calculationTableName") String newCalculationMajorName);
} }

View File

@ -160,7 +160,10 @@
AND s.is211 = '1' AND s.is211 = '1'
</when> </when>
<when test="queryvo.tagsList.contains('双一流')"> <when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流' AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when> </when>
<otherwise> <otherwise>
</otherwise> </otherwise>
@ -343,7 +346,10 @@
AND s.is211 = '1' AND s.is211 = '1'
</when> </when>
<when test="queryvo.tagsList.contains('双一流')"> <when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流' AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when> </when>
<otherwise> <otherwise>
</otherwise> </otherwise>
@ -499,7 +505,10 @@
AND s.is211 = '1' AND s.is211 = '1'
</when> </when>
<when test="queryvo.tagsList.contains('双一流')"> <when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流' AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when> </when>
<otherwise> <otherwise>
</otherwise> </otherwise>
@ -565,5 +574,11 @@
<select id="getCalculationById" resultType="org.jeecg.modules.yx.entity.YxCalculationMajor"> <select id="getCalculationById" resultType="org.jeecg.modules.yx.entity.YxCalculationMajor">
SELECT * FROM ${calculationTableName} WHERE id = #{calculationMajorId} SELECT * FROM ${calculationTableName} WHERE id = #{calculationMajorId}
</select> </select>
<select id="selectBatchIdsOfYear" resultType="org.jeecg.modules.yx.entity.YxCalculationMajor">
SELECT * FROM ${calculationTableName} WHERE id in
<foreach collection="calculationMajorIdList" index="index" item="b" open="(" separator="," close=")">
#{b}
</foreach>
</select>
</mapper> </mapper>

View File

@ -66,4 +66,6 @@ public interface IYxCalculationMajorService extends IService<YxCalculationMajor>
YxCalculationMajor getCalculationById(String calculationTableName, String calculationMajorId); YxCalculationMajor getCalculationById(String calculationTableName, String calculationMajorId);
boolean updateScoreId(String calculationTableName, String scoreId, String bakScoreId); boolean updateScoreId(String calculationTableName, String scoreId, String bakScoreId);
List<YxCalculationMajor> listByIdsOfYear(List<String> calculationMajorIdList, String newCalculationMajorName);
} }

View File

@ -14,21 +14,9 @@ import java.util.List;
* @Version: V1.0 * @Version: V1.0
*/ */
public interface IYxVolunteerRecordService extends IService<YxVolunteerRecord> { public interface IYxVolunteerRecordService extends IService<YxVolunteerRecord> {
/**
* 根据 volunteerId 查询
* @param volunteerId 志愿单主键id
* @return 志愿单填报明细
*/
List<YxVolunteerRecord> listByVolunteerId(String volunteerId);
List<VolunteerRecordDTO> listDTOByVolunteerId(String volunteerId);
List<VolunteerRecordDTO> listDTOByVolunteerId(String scoreId,String calculationTableName, String volunteerId); List<VolunteerRecordDTO> listDTOByVolunteerId(String scoreId,String calculationTableName, String volunteerId);
boolean artVolunteerSave(SaveVolunteerVO saveVolunteerVO); boolean artVolunteerSave(SaveVolunteerVO saveVolunteerVO);
List<YxVolunteerRecord> getListByCreateBy(YxVolunteerRecord yxVolunteerRecord);
/** /**
* 根据volunteerId删除 * 根据volunteerId删除
*/ */

View File

@ -17,6 +17,7 @@ import java.util.List;
*/ */
public interface IYxVolunteerService extends IService<YxVolunteer> { public interface IYxVolunteerService extends IService<YxVolunteer> {
VolunteerDTO findById(String id);
/** /**
* 根据创建人获取 使用中 的志愿单 * 根据创建人获取 使用中 的志愿单
@ -25,8 +26,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/ */
public VolunteerDTO getActiveByCreate(String createBy); public VolunteerDTO getActiveByCreate(String createBy);
VolunteerDTO findById(String id);
/** /**
* 填报 志愿单 * 填报 志愿单
*/ */
@ -42,11 +41,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/ */
boolean deleteById(String id); boolean deleteById(String id);
/**
* 根据志愿id 获取志愿详情
*/
VolunteerDTO artVolunteerDTO(String volunteerId);
YxVolunteer addNew(YxVolunteer yxVolunteer); YxVolunteer addNew(YxVolunteer yxVolunteer);
/** /**
@ -65,8 +59,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/ */
void removeOldScore(String userId); void removeOldScore(String userId);
/** /**
* 批量添加志愿信息 * 批量添加志愿信息
*/ */
@ -76,4 +68,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
* 根据 志愿明细id删除志愿 * 根据 志愿明细id删除志愿
*/ */
Result<?> deleteVolunteerRecordBatch(List<String> volunteerRecordIdList); Result<?> deleteVolunteerRecordBatch(List<String> volunteerRecordIdList);
String saveFilledVolunteer(SaveVolunteerVO saveVolunteerVO);
} }

View File

@ -477,6 +477,11 @@ public class YxCalculationMajorServiceImpl extends ServiceImpl<YxCalculationMajo
return baseMapper.updateScoreId(calculationTableName, scoreId, bakScoreId) >= 1; return baseMapper.updateScoreId(calculationTableName, scoreId, bakScoreId) >= 1;
} }
@Override
public List<YxCalculationMajor> listByIdsOfYear(List<String> calculationMajorIdList, String newCalculationMajorName) {
return baseMapper.selectBatchIdsOfYear(calculationMajorIdList, newCalculationMajorName);
}
private void setSchoolTagsList(List<RecommendMajorDTO> recommendMajorList) { private void setSchoolTagsList(List<RecommendMajorDTO> recommendMajorList) {
if (CollectionUtils.isNotEmpty(recommendMajorList)) { if (CollectionUtils.isNotEmpty(recommendMajorList)) {
Set<String> schoolIdSet = recommendMajorList.stream().map(RecommendMajorDTO::getSchoolId).collect(Collectors.toSet()); Set<String> schoolIdSet = recommendMajorList.stream().map(RecommendMajorDTO::getSchoolId).collect(Collectors.toSet());

View File

@ -31,20 +31,6 @@ import java.util.List;
public class YxVolunteerRecordServiceImpl extends ServiceImpl<YxVolunteerRecordMapper, YxVolunteerRecord> implements IYxVolunteerRecordService { public class YxVolunteerRecordServiceImpl extends ServiceImpl<YxVolunteerRecordMapper, YxVolunteerRecord> implements IYxVolunteerRecordService {
@Resource @Resource
private IYxSchoolMajorService yxSchoolMajorService; private IYxSchoolMajorService yxSchoolMajorService;
@Override
public List<YxVolunteerRecord> listByVolunteerId(String volunteerId) {
LambdaQueryWrapper<YxVolunteerRecord> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(YxVolunteerRecord::getVolunteerId,volunteerId);
queryWrapper.orderByAsc(YxVolunteerRecord::getIndexs);
return this.list(queryWrapper);
}
@Override
public List<VolunteerRecordDTO> listDTOByVolunteerId(String volunteerId) {
return baseMapper.listDTOByVolunteerId(volunteerId);
}
@Override @Override
public List<VolunteerRecordDTO> listDTOByVolunteerId(String scoreId,String calculationTableName, String volunteerId) { public List<VolunteerRecordDTO> listDTOByVolunteerId(String scoreId,String calculationTableName, String volunteerId) {
return baseMapper.listDTOByVolunteerId2(scoreId,calculationTableName,volunteerId); return baseMapper.listDTOByVolunteerId2(scoreId,calculationTableName,volunteerId);
@ -144,11 +130,6 @@ public class YxVolunteerRecordServiceImpl extends ServiceImpl<YxVolunteerRecordM
return this.save(yxVolunteerRecord); return this.save(yxVolunteerRecord);
} }
@Override
public List<YxVolunteerRecord> getListByCreateBy(YxVolunteerRecord yxVolunteerRecord) {
return baseMapper.getListByCreateBy(yxVolunteerRecord);
}
@Override @Override
public boolean deleteByVolunteerId(String volunteerId) { public boolean deleteByVolunteerId(String volunteerId) {
return this.remove(new LambdaQueryWrapper<YxVolunteerRecord>().eq(YxVolunteerRecord::getVolunteerId,volunteerId)); return this.remove(new LambdaQueryWrapper<YxVolunteerRecord>().eq(YxVolunteerRecord::getVolunteerId,volunteerId));

View File

@ -145,9 +145,16 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
yxHistoryMajorEnrollService.volunteerRecordDTOListSetHistoryInfo(recordDTOList); yxHistoryMajorEnrollService.volunteerRecordDTOListSetHistoryInfo(recordDTOList);
volunteerDTO.setVolunteerRecordEarlyAdmissionList(new ArrayList<>()); volunteerDTO.setVolunteerRecordEarlyAdmissionList(new ArrayList<>());
//填报志愿明细信息-本科 //填报志愿明细信息-本科
List<VolunteerRecordDTO> volunteerRecordUndergraduateList = recordDTOList.stream().filter(r -> YxConstant.batchList1.contains(r.getBatch())).collect(Collectors.toList()); List<VolunteerRecordDTO> volunteerRecordUndergraduateList = new ArrayList<>();
//填报志愿明细信息-专科 //填报志愿明细信息-专科
List<VolunteerRecordDTO> volunteerRecordJuniorCollegeList = recordDTOList.stream().filter(r -> r.getBatch().equals("高职高专")).collect(Collectors.toList()); List<VolunteerRecordDTO> volunteerRecordJuniorCollegeList = new ArrayList<>();
for (VolunteerRecordDTO volunteerRecordDTO : recordDTOList) {
if (YxConstant.batchSet1.contains(volunteerRecordDTO.getBatch())) {
volunteerRecordUndergraduateList.add(volunteerRecordDTO);
}else if(YxConstant.zhuanke.equals(volunteerRecordDTO.getBatch())){
volunteerRecordJuniorCollegeList.add(volunteerRecordDTO);
}
}
volunteerDTO.setVolunteerRecordUndergraduateList(volunteerRecordUndergraduateList); volunteerDTO.setVolunteerRecordUndergraduateList(volunteerRecordUndergraduateList);
volunteerDTO.setVolunteerRecordJuniorCollegeList(volunteerRecordJuniorCollegeList); volunteerDTO.setVolunteerRecordJuniorCollegeList(volunteerRecordJuniorCollegeList);
return volunteerDTO; return volunteerDTO;
@ -252,11 +259,6 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
return true; return true;
} }
@Override
public VolunteerDTO artVolunteerDTO(String volunteerId) {
return null;
}
/** /**
* 创建新的志愿单 * 创建新的志愿单
*/ */
@ -498,4 +500,58 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
return Result.error(e.getMessage()); return Result.error(e.getMessage());
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public String saveFilledVolunteer(SaveVolunteerVO saveVolunteerVO) {
// ============== 开始查询数据
YxVolunteer yxVolunteer = super.getById(saveVolunteerVO.getVolunteerId());
AssertUtils.notNull(yxVolunteer, "未查询到志愿表信息");
// TODO 后期获取用户的 yx_calculation_major 分表
List<String> calculationMajorIdList = saveVolunteerVO.getCalculationMajorIdList();
// 先删除之前的明细
yxVolunteerRecordService.remove(new LambdaQueryWrapper<YxVolunteerRecord>().eq(YxVolunteerRecord::getVolunteerId, saveVolunteerVO.getVolunteerId()));
try {
if (CollectionUtils.isNotEmpty(calculationMajorIdList)) {
List<YxCalculationMajor> yxCalculationMajorList = yxCalculationMajorService.listByIdsOfYear(saveVolunteerVO.getCalculationMajorIdList(),YxConstant.newCalculationMajorName);
List<YxVolunteerRecord> yxVolunteerRecordList = new ArrayList<>();
Optional<YxCalculationMajor> findAny;
YxCalculationMajor yxCalculationMajor;
YxVolunteerRecord yxVolunteerRecord;
int index = 0; // 本科索引
int index2 = 0; // 专科索引
for (String calculationMajorId : calculationMajorIdList) {
findAny = yxCalculationMajorList.stream().filter((c) -> c.getId().equals(calculationMajorId)).findAny();
if (!findAny.isPresent()) {
continue;
// 没找到
}
yxCalculationMajor = findAny.get();
yxVolunteerRecord = new YxVolunteerRecord();
yxVolunteerRecord.setVolunteerId(yxVolunteer.getId());
yxVolunteerRecord.setBatch(yxCalculationMajor.getBatch());
yxVolunteerRecord.setSchoolCode(yxCalculationMajor.getSchoolCode());
yxVolunteerRecord.setMajorCode(yxCalculationMajor.getMajorCode());
yxVolunteerRecord.setEnrollmentCode(yxCalculationMajor.getEnrollmentCode());
yxVolunteerRecord.setEnrollProbability(yxCalculationMajor.getEnrollProbability()); //概率
yxVolunteerRecord.setStudentConvertedScore(yxCalculationMajor.getStudentConvertedScore());
yxVolunteerRecord.setCalculationMajorId(calculationMajorId);
if ("高职高专".equals(yxCalculationMajor.getBatch())) {
index2++;
yxVolunteerRecord.setIndexs(index2);
}else{
index++;
yxVolunteerRecord.setIndexs(index);
}
yxVolunteerRecordList.add(yxVolunteerRecord);
}
// 保存新的明细
yxVolunteerRecordService.saveBatch(yxVolunteerRecordList);
}
return yxVolunteer.getId();
}catch (Exception e){
log.debug(e.getMessage());
throw new RuntimeException("保存失败", e);
}
}
} }