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 java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -73,7 +74,6 @@ public class StaticDataController {
case "miniConfig":
return Result.OK(commonConfig());
case "sportsScore":
// 体育成绩计算器
Integer year = params.getInt("year");
@ -104,17 +104,27 @@ public class StaticDataController {
/**
* 通用配置当前年份历年...
*
* @return
*/
public JSONObject commonConfig() {
String memberDeadline = "2026年08月31日";
JSONObject jsonObject = new JSONObject();
jsonObject.set("nowYear", 2025); // 当前年份
jsonObject.set("nowYear", 2026); // 当前年份
jsonObject.set("showZeSuan", false); // 是否显示折算按钮
jsonObject.set("tiQianPiZhiYuanNum", 1);
jsonObject.set("benZhiYuanNum", 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();
contact.set("personNumber", "15785689971");

View File

@ -13,6 +13,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.AssertUtils;
import org.jeecg.modules.web.vo.SaveVolunteerRecordVO;
import org.jeecg.modules.web.vo.SaveVolunteerVO;
import org.jeecg.modules.system.entity.SysUser;
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.util.PdfUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.thymeleaf.TemplateEngine;
@ -138,6 +140,43 @@ public class ArtVolunteerController {
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 = "删除志愿明细")
@DeleteMapping("/volunteerRecordDelete")
@Transactional(rollbackFor = Exception.class) // 加事务
public Result<?> volunteerRecordDelete(SaveVolunteerVO saveVolunteerVO) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
AssertUtils.notNull(sysUser, "请先登录!");
/*String volunteerId = saveVolunteerVO.getVolunteerId();
Integer indexs = saveVolunteerVO.getIndexs();
String batch = saveVolunteerVO.getBatch();
AssertUtils.notNull(volunteerId,"请求参数有误");*/
String id = saveVolunteerVO.getId();
AssertUtils.notNull(id, "请求参数有误");
try {
// 先查再删
YxVolunteerRecord yxVolunteerRecord = yxVolunteerRecordService.getById(id);
AssertUtils.notNull(yxVolunteerRecord, "志愿明细不存在");
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) {
throw new JeecgBootException(e);
throw new JeecgBootException("删除失败", e);
}
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 = "志愿单名称")
private String volunteerName;
@ApiModelProperty(value = "专业IdList")
private List<String> calculationMajorIdList;
@ApiModelProperty(value = "志愿单明细信息")
private List<SaveVolunteerRecordVO> volunteerRecordList;

View File

@ -3,7 +3,9 @@ package org.jeecg.modules.yx.constant;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @Description
@ -65,7 +67,9 @@ public class YxConstant {
public static List<String> defaultRulesEnrollProbabilityList = Arrays.asList("文过专排", "专过文排");
public static String zhuanke= "高职高专";
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;

View File

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

View File

@ -28,4 +28,6 @@ public interface YxCalculationMajorMapper extends BaseMapper<YxCalculationMajor>
YxCalculationMajor getCalculationById(@Param("calculationTableName") String calculationTableName, @Param("calculationMajorId") String calculationMajorId);
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'
</when>
<when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流'
AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when>
<otherwise>
</otherwise>
@ -343,7 +346,10 @@
AND s.is211 = '1'
</when>
<when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流'
AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when>
<otherwise>
</otherwise>
@ -499,7 +505,10 @@
AND s.is211 = '1'
</when>
<when test="queryvo.tagsList.contains('双一流')">
AND s.sfsyl !='双一流'
AND s.sfsyl ='双一流'
</when>
<when test="queryvo.tagsList.contains('新增院校')">
AND cm.state ='2'
</when>
<otherwise>
</otherwise>
@ -565,5 +574,11 @@
<select id="getCalculationById" resultType="org.jeecg.modules.yx.entity.YxCalculationMajor">
SELECT * FROM ${calculationTableName} WHERE id = #{calculationMajorId}
</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>

View File

@ -66,4 +66,6 @@ public interface IYxCalculationMajorService extends IService<YxCalculationMajor>
YxCalculationMajor getCalculationById(String calculationTableName, String calculationMajorId);
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
*/
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);
boolean artVolunteerSave(SaveVolunteerVO saveVolunteerVO);
List<YxVolunteerRecord> getListByCreateBy(YxVolunteerRecord yxVolunteerRecord);
/**
* 根据volunteerId删除
*/

View File

@ -17,6 +17,7 @@ import java.util.List;
*/
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);
VolunteerDTO findById(String id);
/**
* 填报 志愿单
*/
@ -42,11 +41,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/
boolean deleteById(String id);
/**
* 根据志愿id 获取志愿详情
*/
VolunteerDTO artVolunteerDTO(String volunteerId);
YxVolunteer addNew(YxVolunteer yxVolunteer);
/**
@ -65,8 +59,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
*/
void removeOldScore(String userId);
/**
* 批量添加志愿信息
*/
@ -76,4 +68,6 @@ public interface IYxVolunteerService extends IService<YxVolunteer> {
* 根据 志愿明细id删除志愿
*/
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;
}
@Override
public List<YxCalculationMajor> listByIdsOfYear(List<String> calculationMajorIdList, String newCalculationMajorName) {
return baseMapper.selectBatchIdsOfYear(calculationMajorIdList, newCalculationMajorName);
}
private void setSchoolTagsList(List<RecommendMajorDTO> recommendMajorList) {
if (CollectionUtils.isNotEmpty(recommendMajorList)) {
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 {
@Resource
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
public List<VolunteerRecordDTO> listDTOByVolunteerId(String scoreId,String calculationTableName, String volunteerId) {
return baseMapper.listDTOByVolunteerId2(scoreId,calculationTableName,volunteerId);
@ -144,11 +130,6 @@ public class YxVolunteerRecordServiceImpl extends ServiceImpl<YxVolunteerRecordM
return this.save(yxVolunteerRecord);
}
@Override
public List<YxVolunteerRecord> getListByCreateBy(YxVolunteerRecord yxVolunteerRecord) {
return baseMapper.getListByCreateBy(yxVolunteerRecord);
}
@Override
public boolean deleteByVolunteerId(String 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);
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.setVolunteerRecordJuniorCollegeList(volunteerRecordJuniorCollegeList);
return volunteerDTO;
@ -252,11 +259,6 @@ public class YxVolunteerServiceImpl extends ServiceImpl<YxVolunteerMapper, YxVol
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());
}
}
@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);
}
}
}