Commit e22c4a4e authored by 刘帅's avatar 刘帅

1.bug修复

parent 3af75154
...@@ -25,6 +25,7 @@ import java.math.RoundingMode; ...@@ -25,6 +25,7 @@ import java.math.RoundingMode;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @Author: LCL * @Author: LCL
...@@ -156,13 +157,16 @@ public class ApiExamController { ...@@ -156,13 +157,16 @@ public class ApiExamController {
// 做过的题目 // 做过的题目
String doneNum = "0"; String doneNum = "0";
// 查询所有题目 // 查询所有题目根据课程
List<Map<String, Object>> list = examSubjectService.queryByParam(params); List<Map<String, Object>> list = examSubjectService.queryByParam(params);
// 题目总数 // 题目总数
int allNum = list.size(); int allNum = list.size();
statisticsUn = String.valueOf(allNum); statisticsUn = String.valueOf(allNum);
if (params.containsKey("memberUserId") && StringUtils.isNotBlank(params.get("memberUserId").toString()) && allNum > 0) { if (params.containsKey("memberUserId") && StringUtils.isNotBlank(params.get("memberUserId").toString()) && allNum > 0) {
if (!list.isEmpty()) {
params.put("examSubjectIds", list.stream().map(item -> item.get("examSubjectId")).collect(Collectors.toList()));
}
// 正确题数, 当前题目编号 // 正确题数, 当前题目编号
params.put("status", 1); params.put("status", 1);
int countTrue = memberSubjectAllService.memberSubjectAllCount(params); int countTrue = memberSubjectAllService.memberSubjectAllCount(params);
...@@ -245,6 +249,9 @@ public class ApiExamController { ...@@ -245,6 +249,9 @@ public class ApiExamController {
try { try {
// 查询所有题目 // 查询所有题目
List<Map<String, Object>> list = examSubjectService.queryByParam(params); List<Map<String, Object>> list = examSubjectService.queryByParam(params);
if (!list.isEmpty()) {
params.put("examSubjectIds", list.stream().map(item -> item.get("examSubjectId")).collect(Collectors.toList()));
}
// 题目总数 // 题目总数
int allNum = list.size(); int allNum = list.size();
// 错误题数,正确题数, 当前题目编号 // 错误题数,正确题数, 当前题目编号
...@@ -264,11 +271,13 @@ public class ApiExamController { ...@@ -264,11 +271,13 @@ public class ApiExamController {
} else { } else {
// int location = memberSubjectAll.getLocation(); // int location = memberSubjectAll.getLocation();
//初始化数组 //初始化数组
List<Integer> nums = new ArrayList<Integer>(); List<Integer> nums = new ArrayList<>();
TbMemberSubjectAll subjectAll = new TbMemberSubjectAll(); TbMemberSubjectAll subjectAll = new TbMemberSubjectAll();
subjectAll.setPracticeType(Integer.parseInt(params.get("practiceType").toString())); subjectAll.setPracticeType(Integer.parseInt(params.get("practiceType").toString()));
subjectAll.setMemberUserId(Long.parseLong(params.get("memberUserId").toString())); subjectAll.setMemberUserId(Long.parseLong(params.get("memberUserId").toString()));
if (StringUtils.isNotEmpty(params.get("subjectWarehouseClassId").toString())) {
subjectAll.setSubjectWarehouseClassId(Long.parseLong(params.get("subjectWarehouseClassId").toString())); subjectAll.setSubjectWarehouseClassId(Long.parseLong(params.get("subjectWarehouseClassId").toString()));
}
List<TbMemberSubjectAll> allList = memberSubjectAllService.selectMemberSubjectAllList(subjectAll); List<TbMemberSubjectAll> allList = memberSubjectAllService.selectMemberSubjectAllList(subjectAll);
completeNum = allList.size(); completeNum = allList.size();
......
...@@ -167,9 +167,9 @@ public class ApiPCController { ...@@ -167,9 +167,9 @@ public class ApiPCController {
if (StringUtils.isNull(params.get("examNoticeId"))&&StringUtils.isNull(params.get("examId"))){ if (StringUtils.isNull(params.get("examNoticeId"))&&StringUtils.isNull(params.get("examId"))){
return AjaxResult.error("缺少 examNoticeId 考试通知ID 或者 examId 考试id"); return AjaxResult.error("缺少 examNoticeId 考试通知ID 或者 examId 考试id");
} }
/* if (!params.containsKey("examNoticeId") || StringUtils.isBlank(params.get("examNoticeId").toString())) { if (!params.containsKey("examRegistrationId") || StringUtils.isBlank(params.get("examRegistrationId").toString())) {
return AjaxResult.error("缺少 examNoticeId 考试通知ID"); return AjaxResult.error("缺少 examRegistrationId 考试报名ID");
}*/ }
try { try {
return AjaxResult.success().put("data", examNoticeService.getExamNoticeInfo(params)); return AjaxResult.success().put("data", examNoticeService.getExamNoticeInfo(params));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -239,6 +239,25 @@ wx: ...@@ -239,6 +239,25 @@ wx:
description: 学信考试 description: 学信考试
# 证书密钥 # 证书密钥
apiClientKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCYx8UTdItOSLGNZF/wBP2DWe6iF33l+80X+MQZtTYyAhfWu2HblnOm+LN9yc/S/Jyft5LbWj58/4jk1idPzXoDoYWf5UcyyCXXVTIZhuS7zuwsaVL6jdrdHxTeeu+LkSiJGKDrw10M8M0Utf2LQxdCIel/yZY59iOSPcF5sMfhpMgmMFB7LbDfStNHFku4IW/iIV+FzOI/NVaTwN2MXpgdSVnJnhV+HuHchqW+yA2fONaLgglQyNn748onSH/zzEQFYezkHgi1z8J7gxfK8HG83Bjj62ybL3LPhpe9cnB7J+suc1a+8EjFcMDiM9HH1NFbF947OoaVUU6NwZOfVB/tAgMBAAECggEBAJJuHcAY2o+scqhexOjKD6S+JE6tD1jHLvpDzsgI+6mQggKoVBFfsPcetQHh1FOXFBKsoo+kffHWBQG3E7ST7tbeD7GB0eylEkfBeyQmOsKaf5fNVt+X6GY4rQrTbxYoiV5lAY8WDvAhN54bE6hPJFKZKC/3KQnilJNMp0wYGGt1xdMtFmLn0nzhA4TYX6UWUaAV8T1e4gRjkUVCdTRTF4RqJQISzXsXCMh/UkbYNno/hxHHvur5Nd9QzXVzEoieRmrkVHWtbL1+hUnvi2JthRefRfdXESax2rWeqRumOQzxpkjymMBFngc8ze9lQlHtgw2nFaa4U4DlJVCKk8YQXAECgYEAyB+pphD7geNIV98TEFH5Rbh9WSgQrw2K6crUjbY6HFFmbgRRoHKMaHqCMeb7cOmDTlQzDQPr2w8Wa+rNIcCfS/y5ZprGdOOAn8JEIXpRFJrEyYHyGwKd2zNkXUVx9mXlQp1bQLbTTlOI5GSuB54zUeLGK8i/MLHu2q4NTvfjGQECgYEAw3Af+poh2/QiNG8/Sr/6nO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zZgoOOI7Fe5lOjXguFUVlUj+l8NujlzF7SvMWOg/y+DZfOX25OoRG0vmtxsEHNPSzlvBXuF3DCkEDv51lcxWB0LH6RG/0lAguFR3HBAO0xybYdExzh/Ng6f1jpxJ/G1+1sdOLHg=
h5: # 小程序id
appId: wx8de56186c26a6a76
# 小程序商户号
mchId: 1720827154
# api证书序列号
mchSerialNum: 270586DDA5BC8321EC6759EB98346BEB1CBE2A34
# apiV3密钥
apiV3Key: yFRJqhZQJ45wrwg2zJwokb40P7Yn2123
# 微信支付回调通知域名
notifyUrl: https://server.chsie.com.cn/api/pay/createNativePayParamNotify
# 微信支付回调通知域名
h5NotifyUrl: https://server.chsie.com.cn/api/pay/createH5PayParamNotify
# 支付宝支付回调通知域名
notifyZfbUrl: https://server.chsie.com.cn/api/pay/aliPayBoilerNotify
# 商品描述
description: 学信考试
# 证书密钥
apiClientKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDOSZP9VJ8kmG2FOGFORlJP3uR4RnXXThNnqtogvv+5OrlRlErsyce37ukPhwwrtRr0nXpXkfL7p8GXzDgTNQ+KDyFvuv14nPtlQdaoqyyjSmMh0fnsFNY2RSqNX/hdep5blxUkoCjoQG4Y+n9QXlZMHJ+TFfQG9/YNDz+hVjXHTCeeRRyvHlxTt/+f9BEfjCz32pwYYzLBEjeTf95m8q7g5Vw4vDqNiDEBRtk3clUoLkSw+fKNSLXfeTcji35v8Ozx1Sw2aTg+WOz14IF4aHekJMiA1nYC5tbWYccaprjZXVuQhGK0KIvy/7A6uHWH9ACwGnPT+VXUKLBxSnqwkFu9AgMBAAECggEBAM0kRIQ34+8LmlZSJAooSnDdMo0dXNDY9tkwAa1w43O7n1EuTHg/jVovvxtO7F6GwqCh/mkZXe6++/lOADGxoZtkwpaO+MQ6MJKYr7SaTVCxh/W5D3WjnwbnL5LZ7m5fox1oGIGMuEGG2TYD3hn5Ro54JISr3zoS2mBQWrHBvsdJ/kSPYotOTsTeCc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 @@ public interface TbExamMapper ...@@ -31,6 +31,14 @@ public interface TbExamMapper
*/ */
public List<TbExam> selectTbExamList(TbExam tbExam); public List<TbExam> selectTbExamList(TbExam tbExam);
/**
* 查询考试列表
*
* @param courseId 课程ID
* @return 考试集合
*/
public List<TbExam> selectTbExamListByCourseId(Long courseId);
/** /**
* 查询考试列表 * 查询考试列表
* *
......
...@@ -347,44 +347,51 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService ...@@ -347,44 +347,51 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService
if (examRegistration.getCertificateStatus()!=1){ if (examRegistration.getCertificateStatus()!=1){
throw new ServiceException("不是待发货状态,发货失败"); throw new ServiceException("不是待发货状态,发货失败");
} }
try { examRegistration.setCertificate(tbExamRegistration.getCertificate());
JSONObject sendResult = kd100Util.testBorderOfficial( examRegistration.setSendManName(sendManName);
CompanyConstant.EMS, examRegistration.setSendManMobile(sendManMobile);
sendManName, examRegistration.setSendManPrintAddr(sendManPrintAddr);
sendManMobile, return tbExamRegistrationMapper.updateTbExamRegistration(examRegistration);
sendManPrintAddr, // todo 后续需要对接快递,将以下代码取消注释,进行调试
tbExamRegistration.getName(), // try {
tbExamRegistration.getContactPhone(), // JSONObject sendResult = kd100Util.testBorderOfficial(
tbExamRegistration.getProvinceName() + tbExamRegistration.getCityName() + tbExamRegistration.getAreaName() + tbExamRegistration.getAddress()); // CompanyConstant.EMS,
// sendManName,
Boolean result = sendResult.getBoolean("result"); // sendManMobile,
if (result){ // sendManPrintAddr,
JSONObject data = sendResult.getJSONObject("data"); // tbExamRegistration.getName(),
String taskId = data.getString("taskId"); // tbExamRegistration.getContactPhone(),
String orderId = data.getString("orderId"); // tbExamRegistration.getProvinceName() + tbExamRegistration.getCityName() + tbExamRegistration.getAreaName() + tbExamRegistration.getAddress());
String kuaidinum = data.getString("kuaidinum"); //
String pollToken = data.getString("pollToken"); // Boolean result = sendResult.getBoolean("result");
//
tbExamRegistration.setShippingMark("ems"); // if (result){
tbExamRegistration.setShippingName("ems"); // JSONObject data = sendResult.getJSONObject("data");
tbExamRegistration.setShippingCode(kuaidinum); // String taskId = data.getString("taskId");
tbExamRegistration.setShippingTaskId(taskId); // String orderId = data.getString("orderId");
tbExamRegistration.setShippingOrderId(orderId); // String kuaidinum = data.getString("kuaidinum");
tbExamRegistration.setShippingPollToken(pollToken); // String pollToken = data.getString("pollToken");
tbExamRegistration.setSendManName(sendManName); //
tbExamRegistration.setSendManMobile(sendManMobile); // tbExamRegistration.setShippingMark("ems");
tbExamRegistration.setSendManPrintAddr(sendManPrintAddr); // tbExamRegistration.setShippingName("ems");
tbExamRegistrationMapper.updateTbExamRegistration(examRegistration); // tbExamRegistration.setShippingCode(kuaidinum);
// tbExamRegistration.setShippingTaskId(taskId);
return 1; // tbExamRegistration.setShippingOrderId(orderId);
}else { // tbExamRegistration.setShippingPollToken(pollToken);
String message = sendResult.getString("message"); // tbExamRegistration.setSendManName(sendManName);
throw new ServiceException(message); // tbExamRegistration.setSendManMobile(sendManMobile);
} // tbExamRegistration.setSendManPrintAddr(sendManPrintAddr);
} catch (Exception e) { // tbExamRegistrationMapper.updateTbExamRegistration(examRegistration);
e.printStackTrace(); //
throw new ServiceException("发货提交异常"); // return 1;
} // }else {
// String message = sendResult.getString("message");
// throw new ServiceException(message);
// }
// } catch (Exception e) {
// e.printStackTrace();
// throw new ServiceException("发货提交异常");
// }
} }
/** /**
...@@ -810,7 +817,7 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService ...@@ -810,7 +817,7 @@ public class TbExamRegistrationServiceImpl implements ITbExamRegistrationService
fileUrl = this.downloadAdmissionTicket(tbExamRegistration); fileUrl = this.downloadAdmissionTicket(tbExamRegistration);
} }
if (4 == type){// 证书 if (4 == type){// 证书
fileUrl = tbExamRegistration.getGraduationCertificate(); fileUrl = tbExamRegistration.getCertificate();
} }
if (10 == type){// 报名表 if (10 == type){// 报名表
fileUrl = this.downloadReportForm(tbExamRegistration); fileUrl = this.downloadReportForm(tbExamRegistration);
......
...@@ -398,6 +398,8 @@ public class TbExamServiceImpl implements ITbExamService ...@@ -398,6 +398,8 @@ public class TbExamServiceImpl implements ITbExamService
return "中级"; return "中级";
case 3: case 3:
return "高级"; return "高级";
case 4:
return "技师";
default: default:
return null; return null;
} }
......
...@@ -180,12 +180,16 @@ public class TbExamSubjectServiceImpl implements ITbExamSubjectService { ...@@ -180,12 +180,16 @@ public class TbExamSubjectServiceImpl implements ITbExamSubjectService {
*/ */
@Override @Override
public List<Map<String, Object>> queryByParam(Map<String, Object> params) { public List<Map<String, Object>> queryByParam(Map<String, Object> params) {
// Long courseId = MapUtils.getLong(params, "courseId"); Long courseId = MapUtils.getLong(params, "courseId");
// TbExamCourse examCourseDetail = tbExamCourseMapper.getSubjectWarehouseClassIdByCourseId(courseId); if (null == courseId) {
// if (ObjectUtils.isEmpty(examCourseDetail)) { throw new ServiceException("课程不能为空");
// throw new ServiceException("此课程未添加题库"); }
// } List<TbExam> tbExamList = tbExamMapper.selectTbExamListByCourseId(courseId);
// params.put("subjectWarehouseClassId", examCourseDetail.getSubjectWarehouseClassId()); List<Long> examIds = tbExamList.stream().map(TbExam::getExamId).collect(Collectors.toList());
if (examIds.isEmpty()) {
throw new ServiceException("课程不存在考试");
}
params.put("examIds", examIds);
return tbExamSubjectMapper.queryByParam(params); return tbExamSubjectMapper.queryByParam(params);
} }
...@@ -233,11 +237,15 @@ public class TbExamSubjectServiceImpl implements ITbExamSubjectService { ...@@ -233,11 +237,15 @@ public class TbExamSubjectServiceImpl implements ITbExamSubjectService {
@Override @Override
public List<Map<String, Object>> getSpecialPracticeList(Map<String, Object> params) { public List<Map<String, Object>> getSpecialPracticeList(Map<String, Object> params) {
Long courseId = MapUtils.getLong(params, "courseId"); Long courseId = MapUtils.getLong(params, "courseId");
TbExamCourse examCourseDetail = tbExamCourseMapper.getSubjectWarehouseClassIdByCourseId(courseId); if (null == courseId) {
if (ObjectUtils.isEmpty(examCourseDetail)) { throw new ServiceException("课程不能为空");
throw new ServiceException("管理员未上传该题库信息");
} }
params.put("subjectWarehouseClassId", examCourseDetail.getSubjectWarehouseClassId()); List<TbExam> tbExamList = tbExamMapper.selectTbExamListByCourseId(courseId);
List<Long> examIds = tbExamList.stream().map(TbExam::getExamId).collect(Collectors.toList());
if (examIds.isEmpty()) {
throw new ServiceException("课程不存在考试");
}
params.put("examIds", examIds);
return tbExamSubjectMapper.getSpecialPracticeList(params); return tbExamSubjectMapper.getSpecialPracticeList(params);
} }
......
...@@ -201,6 +201,7 @@ public class TbMajorClassServiceImpl implements ITbMajorClassService ...@@ -201,6 +201,7 @@ public class TbMajorClassServiceImpl implements ITbMajorClassService
list.forEach(item -> { list.forEach(item -> {
if (Objects.equals(MapUtils.getLong(course, "courseId"), item.getCourseId())){ if (Objects.equals(MapUtils.getLong(course, "courseId"), item.getCourseId())){
course.put("isEnroll", item.getIsEnroll()); course.put("isEnroll", item.getIsEnroll());
course.put("examRegistrationId", item.getExamRegistrationId());
} }
}); });
} }
......
...@@ -540,4 +540,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -540,4 +540,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTbExamListAll" resultMap="TbExamResult"> <select id="selectTbExamListAll" resultMap="TbExamResult">
<include refid="selectTbExamVo"/> <include refid="selectTbExamVo"/>
</select> </select>
<select id="selectTbExamListByCourseId" resultMap="TbExamResult">
<include refid="selectTbExamVo"/>
where career_id = #{courseId}
</select>
</mapper> </mapper>
...@@ -176,40 +176,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -176,40 +176,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getExamNoticeList" resultType="map"> <select id="getExamNoticeList" resultType="map">
SELECT SELECT
exam_id AS examId, ten.exam_id AS examId,
exam_notice_id AS examNoticeId, ten.exam_notice_id AS examNoticeId,
CONVERT(IFNULL(exam_notice_logo, ''), CHAR) AS examNoticeLogo, CONVERT(IFNULL(ten.exam_notice_logo, ''), CHAR) AS examNoticeLogo,
CONVERT(IFNULL(exam_notice_name, ''), CHAR) AS examNoticeName, CONVERT(IFNULL(ten.exam_notice_name, ''), CHAR) AS examNoticeName,
CONVERT(IFNULL(DATE_FORMAT(exam_start_time, '%Y-%m-%d %H:%i'), ''), CHAR) AS examStartTime, CONVERT(IFNULL(DATE_FORMAT(ten.exam_start_time, '%Y-%m-%d %H:%i'), ''), CHAR) AS examStartTime,
CONVERT(IFNULL(DATE_FORMAT(exam_end_time, '%Y-%m-%d %H:%i'), ''), CHAR) AS examEndTime, CONVERT(IFNULL(DATE_FORMAT(ten.exam_end_time, '%Y-%m-%d %H:%i'), ''), CHAR) AS examEndTime,
-- 动态排序字段:未过期标记为0(排前面),已过期标记为1(排后面) -- 动态排序字段:未过期标记为0(排前面),已过期标记为1(排后面)
CASE CASE
WHEN exam_start_time >= CURDATE() THEN 0 WHEN ten.exam_start_time >= CURDATE() THEN 0
ELSE 1 ELSE 1 END AS isExpired,
END AS isExpired ter.exam_registration_id as examRegistrationId
FROM tb_exam_notice FROM tb_exam_notice ten
WHERE LEFT JOIN tb_exam_registration ter on ten.exam_id = ter.exam_id and ten.batch_index = ter.exam_batch_index
status = 0 WHERE ten.status = 0 AND ten.del_flag = 0
AND del_flag = 0
<if test="searchValue != null and searchValue != ''"> <if test="searchValue != null and searchValue != ''">
AND ( AND (ten.exam_notice_name LIKE CONCAT('%', #{searchValue}, '%') OR ten.exam_notice_introduce LIKE CONCAT('%', #{searchValue}, '%'))
exam_notice_name LIKE CONCAT('%', #{searchValue}, '%')
OR exam_notice_introduce LIKE CONCAT('%', #{searchValue}, '%')
)
</if> </if>
ORDER BY ORDER BY isExpired ASC, -- 未过期在前
isExpired ASC, -- 未过期在前
CASE CASE
WHEN isExpired = 0 THEN exam_start_time -- 未过期按开始时间升序 WHEN isExpired = 0 THEN ten.exam_start_time -- 未过期按开始时间升序
END ASC, END ASC,
CASE CASE
WHEN isExpired = 1 THEN exam_start_time -- 已过期按开始时间降序 WHEN isExpired = 1 THEN ten.exam_start_time -- 已过期按开始时间降序
END DESC END DESC
</select> </select>
<select id="getExamNoticeInfo" resultType="map"> <select id="getExamNoticeInfo" resultType="map">
SELECT SELECT
ten.exam_notice_id AS examNoticeId, ten.exam_notice_id AS examNoticeId,
te.career_id AS courseId,
te.career_name AS courseName,
<choose> <choose>
<when test="examNoticeId != null and examNoticeId !=''"> <when test="examNoticeId != null and examNoticeId !=''">
ten.exam_id AS examId, ten.exam_id AS examId,
...@@ -313,22 +310,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -313,22 +310,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END `minute`, END `minute`,
ter.exam_registration_id AS examRegistrationId ter.exam_registration_id AS examRegistrationId
FROM FROM
tb_exam te tb_exam_registration ter
LEFT JOIN tb_exam te ON ter.exam_id = te.exam_id
LEFT JOIN tb_exam_notice ten ON ten.exam_id = te.exam_id LEFT JOIN tb_exam_notice ten ON ten.exam_id = te.exam_id
LEFT JOIN tb_exam_registration ter ON ter.exam_id = te.exam_id AND ter.is_pay = 1 AND ter.member_user_id = #{memberUserId} INNER JOIN tb_exam_batch teb ON te.exam_id = teb.exam_id AND ter.exam_batch_index = teb.batch_index
<if test="examBatchIndex != null and examBatchIndex !=''">
and ter.exam_batch_index = #{examBatchIndex}
</if>
<if test="examNoticeId != null and examNoticeId !=''">
and ter.exam_batch_index = ten.batch_index
</if>
INNER JOIN tb_exam_batch teb on te.exam_id = teb.exam_id
<where> <where>
<if test="examNoticeId != null and examNoticeId !=''"> <if test="examNoticeId != null and examNoticeId !=''">
and ten.exam_notice_id = #{examNoticeId} and ten.exam_notice_id = #{examNoticeId}
</if> </if>
<if test="examId != null and examId !=''"> <if test="examRegistrationId != null and examRegistrationId !=''">
and te.exam_id = #{examId} and ter.exam_registration_id = #{examRegistrationId}
</if> </if>
</where> </where>
......
...@@ -1272,13 +1272,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -1272,13 +1272,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1 limit 1
</select> </select>
<select id="selectCourseIsPay" resultType="com.ruoyi.hezhi.domain.TbExamRegistration"> <select id="selectCourseIsPay" resultType="com.ruoyi.hezhi.domain.TbExamRegistration">
select tec.course_id as courseId,tec.exam_id as examId,ter.is_pay as isPay, select ter.exam_registration_id as examRegistrationId, ter.course_id as courseId,ter.is_pay as isPay,
case when ter.is_pay = 1 then '已报名' case when ter.is_pay = 1 then '已报名'
when ter.is_pay !=1 then '未报名' when ter.is_pay !=1 then '未报名'
ELSE '未报名' END isEnroll ELSE '未报名' END isEnroll
from tb_exam_registration ter from tb_exam_registration ter
left join tb_exam_course tec on tec.exam_id = ter.exam_id where ter.member_user_id = #{memberUserId} and ter.course_id in
where ter.member_user_id = #{memberUserId} and tec.course_id in
<foreach item="item" collection="courseIdList" separator="," open="(" close=")" index=""> <foreach item="item" collection="courseIdList" separator="," open="(" close=")" index="">
#{item} #{item}
</foreach> </foreach>
......
...@@ -237,6 +237,12 @@ ...@@ -237,6 +237,12 @@
and find_in_set('1', tes.exam_type) and find_in_set('1', tes.exam_type)
</if> </if>
<if test="subjectType != null and subjectType != ''"> and tes.subject_type = #{subjectType}</if> <if test="subjectType != null and subjectType != ''"> and tes.subject_type = #{subjectType}</if>
<if test="examIds != null">
and tes.exam_id in
<foreach collection="examIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and tes.status = 0 and tes.status = 0
and tes.del_flag = 0 and tes.del_flag = 0
</where> </where>
...@@ -305,6 +311,12 @@ ...@@ -305,6 +311,12 @@
and subject_warehouse_class_id = #{subjectWarehouseClassId} and subject_warehouse_class_id = #{subjectWarehouseClassId}
and FIND_IN_SET('1', exam_type) and FIND_IN_SET('1', exam_type)
</if> </if>
<if test="examIds != null">
and exam_id in
<foreach collection="examIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and status = 0 and status = 0
and del_flag = 0 and del_flag = 0
</where> </where>
......
...@@ -170,6 +170,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -170,6 +170,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="subjectType != null and subjectType != ''"> and tes.subject_type = #{subjectType}</if> <if test="subjectType != null and subjectType != ''"> and tes.subject_type = #{subjectType}</if>
<if test="practiceType != null and practiceType != ''"> and tmsa.practice_type = #{practiceType}</if> <if test="practiceType != null and practiceType != ''"> and tmsa.practice_type = #{practiceType}</if>
<if test="status != null and status != '' "> and tmsa.status = #{status}</if> <if test="status != null and status != '' "> and tmsa.status = #{status}</if>
<if test="examSubjectIds != null and examSubjectIds != ''">
and tmsa.exam_subject_id in
<foreach collection="examSubjectIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and tes.status = 0 and tes.status = 0
and tes.del_flag = 0 and tes.del_flag = 0
</where> </where>
......
...@@ -1357,7 +1357,20 @@ export default { ...@@ -1357,7 +1357,20 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: {}, rules: {
certificate: [
{ required: true, message: "证书不能为空", trigger: "blur" },
],
sendManName: [
{ required: true, message: "寄件人姓名不能为空", trigger: "blur" },
],
sendManMobile: [
{ required: true, message: "寄件人手机号不能为空", trigger: "blur" },
],
sendManPrintAddr: [
{ required: true, message: "寄件人地址不能为空", trigger: "blur" },
],
},
memberUserId: null, memberUserId: null,
examId: null, examId: null,
// 证书发货 // 证书发货
...@@ -1673,7 +1686,7 @@ export default { ...@@ -1673,7 +1686,7 @@ export default {
} }
certificateSend(this.form).then((response) => { certificateSend(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.sendOpen = false;
this.getList(); this.getList();
}); });
}, },
......
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