Commit 2262adf3 authored by 法拉51246's avatar 法拉51246

1

parent 3645f391
...@@ -75,7 +75,7 @@ public class AlipayService { ...@@ -75,7 +75,7 @@ public class AlipayService {
request.setBizModel(model); request.setBizModel(model);
request.setNotifyUrl(aliPayConfig.getNotifyUrl()+"/api/pay/aliPayBoilerNotify"); request.setNotifyUrl(aliPayConfig.getNotifyUrl()+"/api/pay/aliPayBoilerNotify");
request.setReturnUrl("https://www.chsie.com.cn/payTheFees?examId="+examId+"&memberUserId="+memberUserId); request.setReturnUrl("https://www.chsie.com.cn/examDetail?examId="+examId);//支付成功后跳转回哪个页面
AlipayTradePagePayResponse response = alipayClient.pageExecute(request, "POST"); AlipayTradePagePayResponse response = alipayClient.pageExecute(request, "POST");
// 如果需要返回GET请求,请使用 // 如果需要返回GET请求,请使用
......
...@@ -104,6 +104,12 @@ public interface TbExamBatchMapper ...@@ -104,6 +104,12 @@ public interface TbExamBatchMapper
* @return 结果 * @return 结果
*/ */
public int insertTbExamBatchBatch(@Param("tbExamBatchList") List<TbExamBatch> tbExamBatchList); public int insertTbExamBatchBatch(@Param("tbExamBatchList") List<TbExamBatch> tbExamBatchList);
/**
* 批量修改考试批次
* @param tbExamBatchList 列表
* @return 结果
*/
public int updateTbExamBatchBatch(@Param("tbExamBatchList") List<TbExamBatch> tbExamBatchList);
/** /**
* 查询考试批次 * 查询考试批次
......
...@@ -46,6 +46,10 @@ import java.io.FileInputStream; ...@@ -46,6 +46,10 @@ import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -1264,11 +1268,29 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService ...@@ -1264,11 +1268,29 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService
int successRow = 0; int successRow = 0;
for (TbExamRegistrationVO item : collect) { for (TbExamRegistrationVO item : collect) {
//首先校验数据 //首先校验数据
//生日必须有两个-链接 String birthday = item.getBirthday();
if (item.getBirthday().split("-").length != 3){ String normalized = birthday.replace("/", "-");
erreList.put(item.getContactInformation(), "生日格式有误,正确格式:1999-09-09"); String formatted = null;
LocalDate date;
try {
// 先用宽松格式解析(允许不补0)
date = LocalDate.parse(normalized, DateTimeFormatter.ofPattern("yyyy-M-d"));
// 再用严格格式格式化(自动补0)
formatted = date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
} catch (Exception e1) {
try {
// 尝试解析 Java Date.toString() 格式
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH);
Date parsedDate = sdf.parse(normalized);
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd");
formatted = targetFormat.format(parsedDate);
} catch (Exception e2) {
erreList.put(item.getContactInformation(), "生日格式有误,应为:1999-09-09 或 Fri Jul 07 00:00:00 CST 2000");
continue; continue;
} }
}
item.setBirthday(formatted); // 回写为标准格式
//校验手机号必须11位纯数字 //校验手机号必须11位纯数字
if(item.getContactInformation().length() != 11||!item.getContactInformation().matches("^[0-9]*$")){ if(item.getContactInformation().length() != 11||!item.getContactInformation().matches("^[0-9]*$")){
erreList.put(item.getContactInformation(), "手机号格式有误,应为11位纯数字"); erreList.put(item.getContactInformation(), "手机号格式有误,应为11位纯数字");
......
...@@ -25,6 +25,8 @@ import javax.annotation.Resource; ...@@ -25,6 +25,8 @@ import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* 考试Service业务层处理 * 考试Service业务层处理
...@@ -195,6 +197,53 @@ public class TbExamServiceImpl implements ITbExamService ...@@ -195,6 +197,53 @@ public class TbExamServiceImpl implements ITbExamService
tbExamCourseMapper.insertTbExamCourse(tbExamCourse); tbExamCourseMapper.insertTbExamCourse(tbExamCourse);
} }
} }
//todo 删除逻辑
//
// List<TbExamBatch> existingBatches = tbExamBatchMapper.getByExamId(tbExam.getExamId());
// //存在的批次
// Map<Long, TbExamBatch> existingBatchMap = existingBatches.stream()
// .collect(Collectors.toMap(TbExamBatch::getBatchIndex, Function.identity()));
//
// // 2. 获取当前提交的批次(必须包含原来的 batchIndex)
// List<TbExamBatch> newBatches = tbExam.getExamBatchList();
// Set<Long> newBatchIndexes = newBatches.stream()
// .map(TbExamBatch::getBatchIndex)
// .collect(Collectors.toSet());
//
// // 3. 获取被移除的批次的主键 ID,转换为 Long[]
// Long[] toDeleteIds = existingBatches.stream()
// .filter(old -> !newBatchIndexes.contains(old.getBatchIndex()))
// .map(TbExamBatch::getExamBatchId)
// .toArray(Long[]::new);
//
// // 4. 删除操作
// if (toDeleteIds.length > 0) {
// tbExamBatchMapper.deleteTbExamBatchByExamBatchIds(toDeleteIds);
// }
//
// List<TbExamBatch> toInsert = new ArrayList<>();
// List<TbExamBatch> toUpdate = new ArrayList<>();
//
// for (TbExamBatch newBatch : newBatches) {
// newBatch.setExamId(tbExam.getExamId()); // 保证 examId 正确
// if (existingBatchMap.containsKey(newBatch.getBatchIndex())) {
// // 是更新:保留已有的主键 ID
// TbExamBatch existing = existingBatchMap.get(newBatch.getBatchIndex());
// newBatch.setExamBatchId(existing.getExamBatchId());
// toUpdate.add(newBatch);
// } else {
// // 是新增
// toInsert.add(newBatch);
// }
// }
// if (!toInsert.isEmpty()) {
// tbExamBatchMapper.insertTbExamBatchBatch(toInsert);
// }
//
// if (!toUpdate.isEmpty()) {
// tbExamBatchMapper.updateTbExamBatchBatch(toUpdate); // 你需要写批量 update 逻辑
// }
// 考试批次 // 考试批次
List<TbExamBatch> tbExamBatchList = tbExam.getExamBatchList(); List<TbExamBatch> tbExamBatchList = tbExam.getExamBatchList();
if (!tbExamBatchList.isEmpty()){ if (!tbExamBatchList.isEmpty()){
......
...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="publisher != null and publisher != ''"> and publisher = #{publisher}</if> <if test="publisher != null and publisher != ''"> and publisher = #{publisher}</if>
<if test="createTime != null "> and create_time = #{createTime}</if> <if test="createTime != null "> and create_time = #{createTime}</if>
</where> </where>
order by sort asc,create_time desc
</select> </select>
<select id="selectTbConferenceNoticeByConferenceNoticeId" parameterType="Long" resultMap="TbConferenceNoticeResult"> <select id="selectTbConferenceNoticeByConferenceNoticeId" parameterType="Long" resultMap="TbConferenceNoticeResult">
......
...@@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if> <if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if>
<if test="delFlag != null "> and del_flag = #{delFlag}</if> <if test="delFlag != null "> and del_flag = #{delFlag}</if>
</where> </where>
ororder by create_time desc
</select> </select>
<select id="selectTbCooperatePartnerByCooperatePartnerId" parameterType="Long" resultMap="TbCooperatePartnerResult"> <select id="selectTbCooperatePartnerByCooperatePartnerId" parameterType="Long" resultMap="TbCooperatePartnerResult">
......
...@@ -99,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -99,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleteTime != null "> and delete_time = #{deleteTime}</if> <if test="deleteTime != null "> and delete_time = #{deleteTime}</if>
<if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if> <if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if>
</where> </where>
order by sort asc,create_time desc
</select> </select>
<select id="selectTbEvaluateAgencyByEvaluateAgencyId" parameterType="Long" resultMap="TbEvaluateAgencyResult"> <select id="selectTbEvaluateAgencyByEvaluateAgencyId" parameterType="Long" resultMap="TbEvaluateAgencyResult">
......
...@@ -140,6 +140,23 @@ ...@@ -140,6 +140,23 @@
</foreach> </foreach>
</insert> </insert>
<update id="updateTbExamBatchBatch" parameterType="java.util.List">
<foreach collection="tbExamBatchList" item="item" separator=";">
UPDATE tb_exam_batch
SET
exam_id = #{item.examId},
batch_index = #{item.batchIndex},
exam_batch = #{item.examBatch},
exam_start_time = #{item.examStartTime},
exam_end_time = #{item.examEndTime},
sign_start_time = #{item.signStartTime},
sign_end_time = #{item.signEndTime}
WHERE exam_batch_id = #{item.examBatchId}
</foreach>
</update>
<select id="getByExamIdBatchIndex" resultMap="TbExamBatchResult"> <select id="getByExamIdBatchIndex" resultMap="TbExamBatchResult">
<include refid="selectTbExamBatchVo" /> <include refid="selectTbExamBatchVo" />
where where
......
...@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deleteTime != null "> and delete_time = #{deleteTime}</if> <if test="deleteTime != null "> and delete_time = #{deleteTime}</if>
<if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if> <if test="deleteBy != null and deleteBy != ''"> and delete_by = #{deleteBy}</if>
</where> </where>
order by create_time desc
</select> </select>
<select id="selectTbLiveBroadcastByLiveBroadcastId" parameterType="Long" resultMap="TbLiveBroadcastResult"> <select id="selectTbLiveBroadcastByLiveBroadcastId" parameterType="Long" resultMap="TbLiveBroadcastResult">
......
...@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null "> and status = #{status}</if> <if test="status != null "> and status = #{status}</if>
and del_flag = '0' and del_flag = '0'
</where> </where>
order by sort asc,create_time desc
</select> </select>
<select id="getAllMajorClassList" parameterType="TbMajorClass" resultMap="TbMajorClassResult"> <select id="getAllMajorClassList" parameterType="TbMajorClass" resultMap="TbMajorClassResult">
......
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