Commit a27fa5cb authored by 刘帅's avatar 刘帅

1.学校专业导入优化

parent ed83fa66
...@@ -7,9 +7,9 @@ spring: ...@@ -7,9 +7,9 @@ spring:
# 主库数据源 # 主库数据源
master: master:
# 本地数据源 # 本地数据源
# url: jdbc:mysql://rm-hp3340490n5mw72tcto.mysql.huhehaote.rds.aliyuncs.com:3306/yikaozhiyuan_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true # url: jdbc:mysql://localhost:3306/yikaozhiyuan_20250605?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
# username: yikaozhiyuan # username: root
# password: KxappNYy7dQUzuterEncvBt@Pf # password: 123456
# 正式数据源 # 正式数据源
url: jdbc:mysql://bj-cynosdbmysql-grp-oppabofo.sql.tencentcdb.com:29687/yikaozhiyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true url: jdbc:mysql://bj-cynosdbmysql-grp-oppabofo.sql.tencentcdb.com:29687/yikaozhiyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root username: root
......
...@@ -48,7 +48,7 @@ public interface MallAcceptPlanMapper ...@@ -48,7 +48,7 @@ public interface MallAcceptPlanMapper
public String selectMaxYear(); public String selectMaxYear();
public MallAcceptPlan selectPlan(@Param("schoolId")Long schoolId, public List<MallAcceptPlan> selectPlan(@Param("schoolId")Long schoolId,
@Param("batchId")Long batchId, @Param("batchId")Long batchId,
@Param("planYear")String planYear, @Param("planYear")String planYear,
@Param("subjectType")Integer subjectType, @Param("subjectType")Integer subjectType,
......
...@@ -30,6 +30,13 @@ public interface MallAcceptRuleMapper ...@@ -30,6 +30,13 @@ public interface MallAcceptRuleMapper
*/ */
public MallAcceptRule selectMallAcceptRuleByAcceptRuleStr(@Param("ruleStr")String ruleStr); public MallAcceptRule selectMallAcceptRuleByAcceptRuleStr(@Param("ruleStr")String ruleStr);
/**
* 录取字符串查询
* @param ruleStr 字符串
* @return
*/
public List<MallAcceptRule> selectMallAcceptRuleByAcceptRuleStr2(@Param("ruleStr")String ruleStr);
/** /**
* 录取原则 * 录取原则
* @return * @return
......
...@@ -32,7 +32,7 @@ public interface MallSchoolAcceptMapper ...@@ -32,7 +32,7 @@ public interface MallSchoolAcceptMapper
* @return * @return
*/ */
public MallSchoolAccept selectBySchoolIdAndLinkId(@Param("schoolId")Long schoolId, public List<MallSchoolAccept> selectBySchoolIdAndLinkId(@Param("schoolId")Long schoolId,
@Param("batchId")Long batchId, @Param("batchId")Long batchId,
@Param("linkId")Long linkId, @Param("linkId")Long linkId,
@Param("acceptYear")String acceptYear, @Param("acceptYear")String acceptYear,
......
...@@ -840,55 +840,54 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -840,55 +840,54 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
String ruleStr = replaceOther(newAcceptBO.getRuleStr()); // 录取原则 String ruleStr = replaceOther(newAcceptBO.getRuleStr()); // 录取原则
BigDecimal reference = newAcceptBO.getReference(); // 参考分 BigDecimal reference = newAcceptBO.getReference(); // 参考分
String acceptYear = "2024"; // 年份 String acceptYear = newAcceptBO.getAcceptYear(); // 年份
String subjectType = newAcceptBO.getSubjectType().contains("文") ? "0" : "1"; // 学科 String subjectType = newAcceptBO.getSubjectType().contains("文") ? "0" : "1"; // 学科
if (StringUtils.isBlank(batchName)){ if (StringUtils.isBlank(batchName)){
//return "第" + index + "行缺少批次名称"; //return "第" + index + "行缺少批次名称";
sb.append("第" + index + "行缺少批次名称;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少批次名称;").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少批次名称"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少批次名称");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
if (StringUtils.isBlank(schoolName)){ if (StringUtils.isBlank(schoolName)){
//return "第" + index + "行缺少学校名称数据"; //return "第" + index + "行缺少学校名称数据";
sb.append("第" + index + "行缺少学校名称数据;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少学校名称数据;").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少学校名称数据"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少学校名称数据");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
if (StringUtils.isBlank(majorNameStr)){ if (StringUtils.isBlank(majorNameStr)){
//return "第" + index + "行缺少专业名称"; //return "第" + index + "行缺少专业名称";
sb.append("第" + index + "行缺少专业名称"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少专业名称").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少专业名称"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少专业名称");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
if (StringUtils.isBlank(ruleStr)){ if (StringUtils.isBlank(ruleStr)){
//return "第" + index + "行缺少录取原则"; //return "第" + index + "行缺少录取原则";
sb.append("第" + index + "行缺少录取原则;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少录取原则;").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少录取原则"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少录取原则");
errorList.add(errorDataBO);
continue;
}
if (ObjectUtils.isEmpty(reference)){
//return "第" + index + "行缺少参考分";
sb.append("第" + index + "行缺少参考分;");
errorDataBO.setMsg("第" + index + "行缺少参考分");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
// if (ObjectUtils.isEmpty(reference)){
// sb.append("第【" +index + "】行学校【"+schoolName+"】缺少参考分;").append(System.lineSeparator());
// errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少参考分");
// errorList.add(errorDataBO);
// continue;
// }
if (StringUtils.isBlank(acceptYear)){ if (StringUtils.isBlank(acceptYear)){
sb.append("第" + index + "行缺少年份;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少年份;").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少年份;"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少年份;");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
if (StringUtils.isBlank(subjectType)){ if (StringUtils.isBlank(subjectType)){
sb.append("第" + index + "行缺少学科分类;") ; sb.append("第【" +index + "】行学校【"+schoolName+"】缺少学科分类;").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "行缺少学科分类;"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】行缺少学科分类;");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
} }
...@@ -906,10 +905,10 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -906,10 +905,10 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
//return "第" + index + "行批次不存在,请先添加批次或批次名称不正确"; //return "第" + index + "行批次不存在,请先添加批次或批次名称不正确";
} }
// 查询学校 // 查询学校
List<MallSchool> collect = schoolList.stream().filter(item -> item.getSchoolName().equals(replaceOther(newAcceptBO.getSchoolName()))).collect(Collectors.toList()); List<MallSchool> collect = schoolList.stream().filter(item -> replaceOther(item.getSchoolName()).equals(schoolName)).collect(Collectors.toList());
if (ObjectUtils.isEmpty(collect)){ if (ObjectUtils.isEmpty(collect)){
sb.append("第" + index + "学校不存在或学校名称错误:"+ schoolName + ";"); sb.append("第【" +index + "】行学校【"+schoolName+"】不存在或学校名称错误").append(System.lineSeparator());
errorDataBO.setMsg("第" + index + "学校不存在或学校名称错误:"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】不存在或学校名称错误:");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
//return "第" + index + "学校不存在或学校名称错误:"+ schoolName; //return "第" + index + "学校不存在或学校名称错误:"+ schoolName;
...@@ -928,8 +927,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -928,8 +927,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
BigDecimal cultureLowest = BigDecimal.ZERO ; // 文化分数线 BigDecimal cultureLowest = BigDecimal.ZERO ; // 文化分数线
if (ObjectUtils.isEmpty(newAcceptBO.getCultureLowest())){ if (ObjectUtils.isEmpty(newAcceptBO.getCultureLowest())){
sb.append("第" +index + "行缺少文化分数线;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少文化分数线;").append(System.lineSeparator());
errorDataBO.setMsg("第" +index + "缺少文化分数线"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】缺少文化分数线");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
//return "缺少文化分数线" + index; //return "缺少文化分数线" + index;
...@@ -940,8 +939,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -940,8 +939,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
BigDecimal majorLowest = new BigDecimal("0") ; // 专业分数线 BigDecimal majorLowest = new BigDecimal("0") ; // 专业分数线
if (ObjectUtils.isEmpty(newAcceptBO.getMajorLowest())){ if (ObjectUtils.isEmpty(newAcceptBO.getMajorLowest())){
//majorLowest = new BigDecimal("216"); //majorLowest = new BigDecimal("216");
sb.append("第" +index + "行缺少联考分数线;"); sb.append("第【" +index + "】行学校【"+schoolName+"】缺少联考分数线;").append(System.lineSeparator());
errorDataBO.setMsg("第" +index + "缺少联考分数线"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】缺少联考分数线");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
//return "缺少文化分数线" + index; //return "缺少文化分数线" + index;
...@@ -981,8 +980,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -981,8 +980,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
// twoIds.append(collect2.get(0).getMajorId()).append(","); // twoIds.append(collect2.get(0).getMajorId()).append(",");
//} //}
if (ObjectUtils.isEmpty(linkMajorSchool)){ if (ObjectUtils.isEmpty(linkMajorSchool)){
sb.append("第" + index + "专业未录入;"); sb.append("第【" +index + "】行学校【"+schoolName+"】【"+majorNameStr+"】专业未录入;").append(System.lineSeparator());
errorDataBO.setMsg("第" +index + "专业未录入或名称错误"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】专业未录入或名称错误");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
//return "专业未录入" + index + "-" + schoolName + "-" + majorNameStr; //return "专业未录入" + index + "-" + schoolName + "-" + majorNameStr;
...@@ -1009,20 +1008,20 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -1009,20 +1008,20 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
} }
// 查询录取原则 // 查询录取原则
MallAcceptRule acceptRule = mallAcceptRuleMapper.selectMallAcceptRuleByAcceptRuleStr(ruleStr); List<MallAcceptRule> acceptRule = mallAcceptRuleMapper.selectMallAcceptRuleByAcceptRuleStr2(ruleStr);
Long acceptRuleId = 0L; Long acceptRuleId = 0L;
if (ObjectUtils.isEmpty(acceptRule)){ if (acceptRule.isEmpty()){
sb.append("第" + index + "录取原则不存在或录入错误;"); sb.append("第【" +index + "】行学校【"+schoolName+"】录取原则【"+ruleStr+"】不存在或录入错误;").append(System.lineSeparator());
errorDataBO.setMsg("第" +index + "录取原则不存在或录入错误"); errorDataBO.setMsg("第" +index + "行学校【"+schoolName+"】录取原则不存在或录入错误");
errorList.add(errorDataBO); errorList.add(errorDataBO);
continue; continue;
}else{ }else{
acceptRuleId = acceptRule.getAcceptRuleId(); acceptRuleId = acceptRule.get(0).getAcceptRuleId();
} }
// 查询是否已导入数据 // 查询是否已导入数据
MallSchoolAccept schoolAccept = mallSchoolAcceptMapper.selectBySchoolIdAndLinkId(school.getSchoolId(), mallBatch.getBatchId(), linkId, acceptYear, subjectType); List<MallSchoolAccept> schoolAcceptList = mallSchoolAcceptMapper.selectBySchoolIdAndLinkId(school.getSchoolId(), mallBatch.getBatchId(), linkId, acceptYear, subjectType);
if (ObjectUtils.isEmpty(schoolAccept)){ if (schoolAcceptList.isEmpty()){
// 生成新专业录取数据 // 生成新专业录取数据
MallSchoolAccept mallSchoolAccept = new MallSchoolAccept(); MallSchoolAccept mallSchoolAccept = new MallSchoolAccept();
mallSchoolAccept.setSchoolId(school.getSchoolId()); mallSchoolAccept.setSchoolId(school.getSchoolId());
...@@ -1076,6 +1075,7 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -1076,6 +1075,7 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
}else{ }else{
b++; b++;
// 修改数据 // 修改数据
MallSchoolAccept schoolAccept = schoolAcceptList.get(0);
// 生成新专业录取数据 // 生成新专业录取数据
schoolAccept.setAcceptNum(acceptNum); schoolAccept.setAcceptNum(acceptNum);
schoolAccept.setAcceptLowest(acceptLowest); schoolAccept.setAcceptLowest(acceptLowest);
...@@ -1086,9 +1086,9 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -1086,9 +1086,9 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
mallSchoolAcceptMapper.updateMallSchoolAccept(schoolAccept); mallSchoolAcceptMapper.updateMallSchoolAccept(schoolAccept);
// 修改招生计划 // 修改招生计划
MallAcceptPlan plan = mallAcceptPlanMapper.selectPlan(school.getSchoolId(), mallBatch.getBatchId(), acceptYear, Integer.valueOf(subjectType), linkId); List<MallAcceptPlan> mallAcceptPlanList = mallAcceptPlanMapper.selectPlan(school.getSchoolId(), mallBatch.getBatchId(), acceptYear, Integer.valueOf(subjectType), linkId);
if (ObjectUtils.isNotEmpty(plan)){ if (!mallAcceptPlanList.isEmpty()){
MallAcceptPlan plan = mallAcceptPlanList.get(0);
plan.setAcceptNum(acceptNum); plan.setAcceptNum(acceptNum);
plan.setSchoolPrice(schoolPrice); plan.setSchoolPrice(schoolPrice);
plan.setAcceptRuleId(acceptRuleId); plan.setAcceptRuleId(acceptRuleId);
...@@ -1279,8 +1279,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService { ...@@ -1279,8 +1279,8 @@ public class MallSchoolAcceptServiceImpl implements IMallSchoolAcceptService {
MallAcceptRule acceptRule = mallAcceptRuleMapper.selectRuleStr(ruleStr); MallAcceptRule acceptRule = mallAcceptRuleMapper.selectRuleStr(ruleStr);
// 查询是否已导入数据 // 查询是否已导入数据
MallSchoolAccept schoolAccept = mallSchoolAcceptMapper.selectBySchoolIdAndLinkId(schoolId, 4L, linkId, acceptYear, subjectType); List<MallSchoolAccept> schoolAcceptList = mallSchoolAcceptMapper.selectBySchoolIdAndLinkId(schoolId, 4L, linkId, acceptYear, subjectType);
if (ObjectUtils.isEmpty(schoolAccept)){ if (schoolAcceptList.isEmpty()){
// 生成新专业录取数据 // 生成新专业录取数据
MallSchoolAccept mallSchoolAccept = new MallSchoolAccept(); MallSchoolAccept mallSchoolAccept = new MallSchoolAccept();
mallSchoolAccept.setSchoolId(schoolId); mallSchoolAccept.setSchoolId(schoolId);
......
...@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectPlan" resultType="MallAcceptPlan"> <select id="selectPlan" resultType="com.ruoyi.mall.domain.MallAcceptPlan">
select accept_plan_id acceptPlanId, select accept_plan_id acceptPlanId,
school_id schoolId, school_id schoolId,
batch_id batchId, batch_id batchId,
...@@ -169,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -169,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and plan_year = #{planYear} and plan_year = #{planYear}
and subject_type = #{subjectType} and subject_type = #{subjectType}
and link_id = #{linkId} and del_flag = '0' and link_id = #{linkId} and del_flag = '0'
order by create_at desc
</select> </select>
<select id="selectSchoolPrice" parameterType="Long" resultType="MallAcceptPlan"> <select id="selectSchoolPrice" parameterType="Long" resultType="MallAcceptPlan">
......
...@@ -55,6 +55,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +55,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0' and del_flag = '0'
</select> </select>
<select id="selectMallAcceptRuleByAcceptRuleStr2" resultMap="MallAcceptRuleResult">
<include refid="selectMallAcceptRuleVo"/>
where rule_str = #{ruleStr}
and del_flag = '0'
order by create_at desc
</select>
<select id="selectNewAcceptRule" resultMap="MallAcceptRuleResult"> <select id="selectNewAcceptRule" resultMap="MallAcceptRuleResult">
<include refid="selectMallAcceptRuleVo"/> <include refid="selectMallAcceptRuleVo"/>
where is_new = 1 where is_new = 1
......
...@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -97,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where school_accept_id = #{schoolAcceptId} where school_accept_id = #{schoolAcceptId}
</select> </select>
<select id="selectBySchoolIdAndLinkId" resultType="MallSchoolAccept"> <select id="selectBySchoolIdAndLinkId" resultType="com.ruoyi.mall.domain.MallSchoolAccept">
select msa.school_accept_id schoolAcceptId, select msa.school_accept_id schoolAcceptId,
msa.school_id schoolId, msa.school_id schoolId,
msa.major_id majorId, msa.major_id majorId,
...@@ -120,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -120,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and link_id = #{linkId} and link_id = #{linkId}
and accept_year = #{acceptYear} and accept_year = #{acceptYear}
and subject_type = #{subjectType} and subject_type = #{subjectType}
order by create_at desc
</select> </select>
<insert id="insertMallSchoolAccept" parameterType="MallSchoolAccept" useGeneratedKeys="true" keyProperty="schoolAcceptId"> <insert id="insertMallSchoolAccept" parameterType="MallSchoolAccept" useGeneratedKeys="true" keyProperty="schoolAcceptId">
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
<el-input v-model="form.schoolName" placeholder="请输入学校名" /> <el-input v-model="form.schoolName" placeholder="请输入学校名" />
</el-form-item> </el-form-item>
<el-form-item label="批次" prop="batchId"> <el-form-item label="批次" prop="batchId">
<el-select v-model="form.batchId" placeholder="请选择批次"> <el-select v-model="form.batchId" filterable placeholder="请选择批次">
<el-option <el-option
v-for="item in batchList" v-for="item in batchList"
:key="item.batchId" :key="item.batchId"
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="专业" prop="majorId"> <el-form-item label="专业" prop="majorId">
<el-select v-model="form.majorId" placeholder="请选择专业"> <el-select v-model="form.majorId" filterable placeholder="请选择专业">
<el-option <el-option
v-for="item in majorList" v-for="item in majorList"
:key="item.majorId" :key="item.majorId"
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="录取原则" prop="acceptRuleId"> <el-form-item label="录取原则" prop="acceptRuleId">
<el-select v-model="form.acceptRuleId" > <el-select v-model="form.acceptRuleId" filterable >
<el-option v-for="item in ruleList" <el-option v-for="item in ruleList"
:value="item.acceptRuleId" :value="item.acceptRuleId"
:key="item.acceptRuleId" :key="item.acceptRuleId"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment