Explorar o código

自考考生端

haogh hai 3 meses
pai
achega
aab76c8d68
Modificáronse 38 ficheiros con 724 adicións e 370 borrados
  1. 1 1
      ses-enrol/src/main/java/cn/hmsoft/ses/control/by/ByApplyControl.java
  2. 14 1
      ses-enrol/src/main/java/cn/hmsoft/ses/control/ifaceservice/AtgBizIfaceService.java
  3. 5 0
      ses-enrol/src/main/java/cn/hmsoft/ses/control/pl/PlExamAreaCourseControl.java
  4. 0 55
      ses-enrol/src/main/java/cn/hmsoft/ses/control/pl/PlMajorControl.java
  5. 99 50
      ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdBreakDisciplineControl.java
  6. 50 1
      ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdEnrolControl.java
  7. 18 0
      ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdQueryControl.java
  8. 185 8
      ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdRegInfoControl.java
  9. 14 6
      ses-enrol/src/main/java/cn/hmsoft/ses/control/sys/SysAppNewsControl.java
  10. 13 2
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/by/ByApplyDao.java
  11. 6 0
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlCourseDao.java
  12. 11 65
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlCourseTextbookDao.java
  13. 5 0
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlExamAreaCourseDao.java
  14. 5 7
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMajorCourseDao.java
  15. 0 26
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMajorDao.java
  16. 71 27
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMergePublishPlanDao.java
  17. 22 0
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdBreakDisciplineFileDao.java
  18. 4 2
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdEnrolDao.java
  19. 7 2
      ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdRegInfoDao.java
  20. 26 0
      ses-enrol/src/main/java/cn/hmsoft/ses/helper/YearCodeHelper.java
  21. 2 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlCourseService.java
  22. 1 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlExamAreaCourseService.java
  23. 1 3
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMajorCourseService.java
  24. 0 3
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMajorService.java
  25. 4 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMergePublishPlanService.java
  26. 3 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/std/IStdBreakDisciplineService.java
  27. 2 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/std/IStdRegInfoService.java
  28. 36 7
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/by/ByApplyServiceImpl.java
  29. 5 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlCourseServiceImpl.java
  30. 4 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlExamAreaCourseServiceImpl.java
  31. 6 11
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMajorCourseServiceImpl.java
  32. 0 88
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMajorServiceImpl.java
  33. 51 4
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMergePublishPlanServiceImpl.java
  34. 15 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdBreakDisciplineServiceImpl.java
  35. 16 0
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdEnrolServiceImpl.java
  36. 16 1
      ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdRegInfoServiceImpl.java
  37. 6 0
      ses-enrol/src/main/java/cn/hmsoft/web/filter/LoginFilter.java
  38. BIN=BIN
      ses-enrol/src/main/webapp/WEB-INF/lib/hmsoft-web-1.0.jar

+ 1 - 1
ses-enrol/src/main/java/cn/hmsoft/ses/control/by/ByApplyControl.java

@@ -460,7 +460,7 @@ public class ByApplyControl extends AjaxControl {
 		}
 		
 					
-		if (temp_cert_no.equals(request.getData().getZjhm())
+		if (temp_cert_no.toUpperCase().equals(request.getData().getZjhm().toUpperCase())
 				&& byXueXinLog.getXm().equals(request.getData().getXm())) {
 			byXueXinLog.setStatus("认证成功");
 		} else {

+ 14 - 1
ses-enrol/src/main/java/cn/hmsoft/ses/control/ifaceservice/AtgBizIfaceService.java

@@ -380,7 +380,13 @@ public class AtgBizIfaceService extends InterfaceControl {
 		} else {
 			now = LocalDateTime.now();
 		}
-
+		
+		if(null == dbTimeConfig){
+			receiveResponse.setResultCode("CHANNEL_IDEMPOTENT");
+			receiveResponse.setResultMsg("不在免考开放时间范围之内,不受理免考业务");
+			LogHelper.info("不在免考开放时间范围之内,不受理免考业务");
+			return;
+		}
 		
 		if (!DateHelper.isBetween(now, dbTimeConfig.getStart_time(), dbTimeConfig.getEnd_time())) {
 			receiveResponse.setResultCode("CHANNEL_IDEMPOTENT");
@@ -669,6 +675,13 @@ public class AtgBizIfaceService extends InterfaceControl {
 		} else {
 			now = LocalDateTime.now();
 		}
+		
+		if(null == dbTimeConfig){
+			receiveResponse.setResultCode("CHANNEL_IDEMPOTENT");
+			receiveResponse.setResultMsg("不在免考开放时间范围之内,不受理免考业务");
+			LogHelper.info("不在免考开放时间范围之内,不受理免考业务");
+			return;
+		}
 
 		if (!DateHelper.isBetween(now, dbTimeConfig.getStart_time(), dbTimeConfig.getEnd_time())) {
 			receiveResponse.setResultCode("CHANNEL_IDEMPOTENT");

+ 5 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/control/pl/PlExamAreaCourseControl.java

@@ -62,4 +62,9 @@ public class PlExamAreaCourseControl extends AjaxControl {
 	public Ajax get(Integer id) {
 		return new Ajax(this.plExamAreaCourseService.find(id));
 	}
+	
+	@RequestMapping("pl/plExamAreaCourse/queryCourseCalculator")
+	public Ajax queryCourseCalculator(Integer course_id) {
+		return new Ajax(this.plExamAreaCourseService.queryCourseCalculator(course_id));
+	}
 }

+ 0 - 55
ses-enrol/src/main/java/cn/hmsoft/ses/control/pl/PlMajorControl.java

@@ -1,9 +1,7 @@
 package cn.hmsoft.ses.control.pl;
 
-import java.time.LocalDateTime;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -11,11 +9,9 @@ import org.springframework.web.bind.annotation.RestController;
 
 import cn.hmsoft.helper.StringHelper;
 import cn.hmsoft.ses.constants.EnrolSessionName;
-import cn.hmsoft.ses.data.model.pl.PlCourse;
 import cn.hmsoft.ses.data.model.pl.PlMajor;
 import cn.hmsoft.ses.data.model.pl.PlMajorCourse;
 import cn.hmsoft.ses.data.model.std.StdRegInfo;
-import cn.hmsoft.ses.service.iface.pl.IPlCourseService;
 import cn.hmsoft.ses.service.iface.pl.IPlMajorCourseService;
 import cn.hmsoft.ses.service.iface.pl.IPlMajorService;
 import cn.hmsoft.web.control.AjaxControl;
@@ -36,8 +32,6 @@ public class PlMajorControl extends AjaxControl{
 	@Autowired
 	private IPlMajorService plMajorService;
 	
-	@Autowired
-	private IPlCourseService plCourseService;
 	
 	@Autowired
     private IPlMajorCourseService plMajorCourseService;
@@ -62,57 +56,8 @@ public class PlMajorControl extends AjaxControl{
 	}
 
 
-	/**
-	 * @param plMajor:专业ID为必传项
-	 *  修改专业,包括停办证时间
-	 */
-	//@RequestMapping("pl/plMajor/edit")
-	public Ajax editPlMajor(PlMajor plMajor) {
-		plMajor.setCreate_time(LocalDateTime.now());
-		this.plMajorService.edit(plMajor);
-		return new Ajax();
-	}
-
-	/**
-	 * @param ids
-	 * 	批量删除专业接口--预留接口,专业新增后,不允许在删除
-	 */
-	//@RequestMapping("pl/plMajor/delete")
-	public Ajax deletePlMajor(Integer[] ids) {
-		for (Integer id : ids) {
-			this.plMajorService.delete(id);
-		}
-		return new Ajax();
-	}
 	
 	
-	/**
-	 * @param id:专业ID
-	 * 根据专业查询专业关联的课程和教材
-	 */
-	@RequestMapping("pl/plMajor/find")
-	public Ajax findCouseByMajor(Integer id) {
-		Map<String,Object> map = new HashMap<String,Object>();
-		map.put("major", this.plMajorService.findMajor(id));
-		map.put("courseList", this.plMajorService.findCourseAndBook(id));
-		return new Ajax(map);
-	}
-	
-	/**
-	 * @param ids:专业ID数组
-	 * 根据专业ID下载专业相关的课程教材,提供打印
-	 * 可以根据ids来选择只打印某些某些专业下的课程教材
-	 */
-	@RequestMapping("pl/plMajor/download")
-	public void downloadMajorCouse(String[] ids) {
-		try {
-			String fileName = "专业课程.pdf";
-			this.downloadFile(this.plMajorService.makeCourseBook(ids), fileName,true);
-		}catch(Exception e){
-			this.writeAlert(e.getMessage());
-		}
-	}
-	
 	/**
 	 * @param ids:需要排除的专业ID集合,以逗号分隔
 	 * 返回专业列表

+ 99 - 50
ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdBreakDisciplineControl.java

@@ -1,13 +1,23 @@
 package cn.hmsoft.ses.control.std;
 
+import java.io.File;
+
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import cn.hmsoft.frame.exception.web.BusinessException;
+import cn.hmsoft.frame.util.FrameAssertUtil;
 import cn.hmsoft.helper.StringHelper;
 import cn.hmsoft.jdbc.entity.Pager;
+import cn.hmsoft.ses.constants.EnrolSessionName;
+import cn.hmsoft.ses.constants.SysConst;
 import cn.hmsoft.ses.data.model.std.StdBreakDiscipline;
+import cn.hmsoft.ses.data.model.std.StdBreakDisciplineFile;
+import cn.hmsoft.ses.data.model.std.StdRegInfo;
 import cn.hmsoft.ses.service.iface.std.IStdBreakDisciplineService;
+import cn.hmsoft.web.control.AjaxControl;
 import cn.hmsoft.web.entity.Ajax;
 
 /**
@@ -20,54 +30,93 @@ import cn.hmsoft.web.entity.Ajax;
  * @Company: www.hmsoft.cn
  */
 @RestController
-public class StdBreakDisciplineControl {
-
-    @Autowired
-    private IStdBreakDisciplineService stdBreakDisciplineService;
-	
-    @RequestMapping("std/stdBreakDiscipline/page")
-    public Ajax pageStdBreakDiscipline(String query, Integer limit, Integer start, String order, String type) {
-        if (StringHelper.isEmpty(order)) {
-        	//TODO 修改为排序字段
-//        	order = "1";
-        }
-        Pager pageStdBreakDiscipline = this.stdBreakDisciplineService.pageStdBreakDiscipline(query, start, limit, order, type);
-        return new Ajax(pageStdBreakDiscipline);
-    }
-    
-    //@RequestMapping("std/stdBreakDiscipline/add")
-    public Ajax addStdBreakDiscipline(final StdBreakDiscipline stdBreakDiscipline) {
-        this.stdBreakDisciplineService.insert(stdBreakDiscipline);
-        return new Ajax();
-    }
-    
-   // @RequestMapping("std/stdBreakDiscipline/edit")
-    public Ajax editStdBreakDiscipline(final StdBreakDiscipline stdBreakDiscipline) {
-        this.stdBreakDisciplineService.edit(stdBreakDiscipline);
-        return new Ajax();
-    }
-    
-    //@RequestMapping("std/stdBreakDiscipline/delete")
-    public Ajax deleteStdBreakDiscipline(final Integer id) {
-        this.stdBreakDisciplineService.delete(id);
-        return new Ajax();
-    }
-    
-    //@RequestMapping("std/stdBreakDiscipline/deleteBatch")
-    public Ajax deleteStdBreakDiscipline(final Integer[] ids) {
-    	for (Integer id : ids) {
-    		this.stdBreakDisciplineService.delete(id);
-    	}
-        return new Ajax();
-    }    
-    
-    @RequestMapping("std/stdBreakDiscipline/get")
-    public Ajax getStdBreakDisciplineById(final Integer id) {
-        return new Ajax(this.stdBreakDisciplineService.find(id));
-    }
-    
-    @RequestMapping("std/stdBreakDiscipline/find")
-    public Ajax findStdBreakDiscipline(String ticket_no) {
-        return new Ajax(this.stdBreakDisciplineService.listBystd(ticket_no));
-    }
+public class StdBreakDisciplineControl extends AjaxControl {
+
+	@Autowired
+	private IStdBreakDisciplineService stdBreakDisciplineService;
+
+	@RequestMapping("std/stdBreakDiscipline/page")
+	public Ajax pageStdBreakDiscipline(String query, Integer limit, Integer start, String order, String type) {
+		if (StringHelper.isEmpty(order)) {
+			// TODO 修改为排序字段
+			// order = "1";
+		}
+		Pager pageStdBreakDiscipline = this.stdBreakDisciplineService.pageStdBreakDiscipline(query, start, limit, order,
+				type);
+		return new Ajax(pageStdBreakDiscipline);
+	}
+
+	// @RequestMapping("std/stdBreakDiscipline/add")
+	public Ajax addStdBreakDiscipline(final StdBreakDiscipline stdBreakDiscipline) {
+		this.stdBreakDisciplineService.insert(stdBreakDiscipline);
+		return new Ajax();
+	}
+
+	// @RequestMapping("std/stdBreakDiscipline/edit")
+	public Ajax editStdBreakDiscipline(final StdBreakDiscipline stdBreakDiscipline) {
+		this.stdBreakDisciplineService.edit(stdBreakDiscipline);
+		return new Ajax();
+	}
+
+	// @RequestMapping("std/stdBreakDiscipline/delete")
+	public Ajax deleteStdBreakDiscipline(final Integer id) {
+		this.stdBreakDisciplineService.delete(id);
+		return new Ajax();
+	}
+
+	// @RequestMapping("std/stdBreakDiscipline/deleteBatch")
+	public Ajax deleteStdBreakDiscipline(final Integer[] ids) {
+		for (Integer id : ids) {
+			this.stdBreakDisciplineService.delete(id);
+		}
+		return new Ajax();
+	}
+
+	@RequestMapping("std/stdBreakDiscipline/get")
+	public Ajax getStdBreakDisciplineById(final Integer id) {
+		return new Ajax(this.stdBreakDisciplineService.find(id));
+	}
+
+	@RequestMapping("std/stdBreakDiscipline/find")
+	public Ajax findStdBreakDiscipline(String ticket_no) {
+		return new Ajax(this.stdBreakDisciplineService.listBystd(ticket_no));
+	}
+
+	@RequestMapping("std/stdBreakDiscipline/queryStdBreakDisciplineFile")
+	public Ajax queryStdBreakDisciplineFile() {
+		StdRegInfo std = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
+		FrameAssertUtil.isNotNull(std, "未登录,请登录系统");
+		return new Ajax(this.stdBreakDisciplineService.queryStdBreakDisciplineFile(std.getTicket_no()));
+	}
+
+	@RequestMapping("std/stdBreakDiscipline/downStdBreakDisciplineFile")
+	public void downStdBreakDisciplineFile(Integer std_id, Integer exam_time_id, String file_type) {
+		StdRegInfo std = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
+		FrameAssertUtil.isNotNull(std, "未登录,请登录系统");
+
+		if (null != std_id && std.getId().intValue() != std_id.intValue()) {
+			throw new BusinessException("待下载记录与当前考生不一致,请重新登陆!");
+		}
+
+		try {
+			StdBreakDisciplineFile stdBreakDisciplineFile = this.stdBreakDisciplineService
+					.queryStdBreakDisciplineFile(std.getTicket_no(), exam_time_id, file_type);
+			if (null != stdBreakDisciplineFile && !StringUtils.isEmpty(stdBreakDisciplineFile.getFile_url())) {
+				String path = SysConst.getAppConfig().getUploadBase();
+				String fileName = stdBreakDisciplineFile.getFile_url();
+				String extension = fileName.substring(fileName.indexOf(".") + 1, fileName.length());
+
+				File tempFile = new File(path + stdBreakDisciplineFile.getFile_url());
+
+				if ("告知书".equals(file_type)) {
+					this.downloadFile(tempFile, std.getTicket_no() + "违纪告知书." + extension, false);
+				} else {
+					this.downloadFile(tempFile, std.getTicket_no() + "违纪决定书." + extension, false);
+				}
+			}
+
+		} catch (Exception e) {
+			this.writeAlert(e.getMessage());
+		}
+	}
 }

+ 50 - 1
ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdEnrolControl.java

@@ -28,6 +28,7 @@ import cn.hmsoft.ses.data.model.std.StdMajor;
 import cn.hmsoft.ses.data.model.std.StdRegInfo;
 import cn.hmsoft.ses.data.model.sys.SysOperateFail;
 import cn.hmsoft.ses.data.model.sys.SysVerificationCode;
+import cn.hmsoft.ses.helper.DateHelper;
 import cn.hmsoft.ses.helper.YearCodeHelper;
 import cn.hmsoft.ses.msgque.Thread.SendEpayOrderThread;
 import cn.hmsoft.ses.msgque.model.dto.EpayCancelMsgDTO;
@@ -219,6 +220,8 @@ public class StdEnrolControl extends AjaxControl{
 		Map<String, Object> map = new HashMap<String, Object>();
 		map.put("majorCouse", this.publishPlanService.listPublishCouse(std.getMajor_id(), 1));
 		map.put("otherCouse", this.publishPlanService.listPublishCouse(std.getMajor_id(), 2));
+		map.put("selectedCouse", this.publishPlanService.listPublishCouseForSelectedExam(std.getMajor_id()));
+		
 		return new Ajax(map);
 	}
     
@@ -239,7 +242,17 @@ public class StdEnrolControl extends AjaxControl{
 		}
 		map.put("courseInfo", this.courseService.find(course_id)); //课程信息
 		PlMajorCourse mCourse = this.mcService.findMajorCourse(std.getMajor_id(), course_id);
-		map.put("majorFlag", (mCourse == null ? 0 : 1)); //本专业 和非本专业标志(0:非本专业 1:本专业)
+		if(null != mCourse){
+			map.put("majorFlag", 1); //本专业 和非本专业标志(0:非本专业 1:本专业 2选考课程)
+		}else{
+			mCourse = this.mcService.findCourseForSelectedExam(course_id);
+			if(null != mCourse){
+				map.put("majorFlag", 2); //本专业 和非本专业标志(0:非本专业 1:本专业 2选考课程)
+			}else{
+				map.put("majorFlag", 0); //本专业 和非本专业标志(0:非本专业 1:本专业 2选考课程)
+			}
+		}
+		
 		return new Ajax(map);
 	}
     
@@ -268,6 +281,17 @@ public class StdEnrolControl extends AjaxControl{
 		return new Ajax(this.publishPlanService.listPublishCouse(major_id, exam_time_id,1));
 	}
     
+    
+    /** 查询选考课程考试计划
+     * @param major_id
+     * @return
+     */
+    @RequestMapping("std/stdEnrol/listPublishCouseForSelected")
+	public Ajax listPublishCouseForSelected(Integer exam_time_id) {
+		return new Ajax(this.publishPlanService.listPublishCouseForSelected(exam_time_id));
+	}
+    
+    
     @RequestMapping("std/stdEnrol/existStdEnrolPayed")
 	public Ajax existStdEnrolPayed() {
     	Ajax ajax = new Ajax();
@@ -340,6 +364,18 @@ public class StdEnrolControl extends AjaxControl{
 			 throw new BusinessException("证件号不能为空,请完善证件信息再报考(自助完善或到各市考办办理)!");
 		}
 		
+		if (StringUtils.isEmpty(std.getTicket_no())) {
+			 throw new BusinessException("准考证号不能为空,请完善基本信息再报考!");
+		}
+		
+		if (null == std.getMajor_id()) {
+			throw new BusinessException("专业信息不能为空,请完善基本信息再报考!");
+		}
+		
+		if (StringUtils.isEmpty(std.getPhoto_path())) {
+			 throw new BusinessException("照片不能为空,请完善基本信息再报考!");
+		}
+		
 		// 20220106 身份证号15位不允许报考,必须现场升位以后才允许报考 by huangzibo 确认:蓝剑
 		if (null != std.getCert_no() && std.getCert_no().length() == 15) {
 			 throw new BusinessException("身份证号是15位,请到达各市考办进行身份证升位后再报考!");
@@ -368,6 +404,10 @@ public class StdEnrolControl extends AjaxControl{
 			throw new BusinessException("考生有违纪信息,本批次不允许报考!");
 		}
 		
+		// 获取考生注册时间
+		StdRegInfo temp_dbStd = this.stdRegInfoService.queryStdCreateTime(std.getId());
+		LocalDateTime date = DateHelper.parseDateTime("2024-07-01 00:00:00");
+				
 		// 查询授限制报考的课程
 		FrameParam param = this.plExamTimeDao.find(FrameParam.class, "param_name", "enrol_limit");
 		
@@ -392,6 +432,15 @@ public class StdEnrolControl extends AjaxControl{
 				}
 			}
 			
+			// 2024年7月1号停考的专业下面的课程(其他还在开考的专业没有这些课程,且这些课程不在选考课程之内https://www.gxeea.cn/view/content_1148_15806.htm),
+			// 如果是2024年7月1日以后新注册的考生不允许报考缴费这些课程
+			if(null != temp_dbStd && null != temp_dbStd.getCreate_time() && temp_dbStd.getCreate_time().isAfter(date)){
+				PlCourse plCourse = this.courseService.findCourseLimit(courseId);
+				if(null != plCourse){
+					throw new BusinessException("2024年7月1日以后新注册的考生不允许报考课程【"+plCourse.getCourse_code()+"-"+plCourse.getCourse_name()+"】。");
+				}
+			}
+			
 		}
 		
 		//不能同时同一时间段内的课程

+ 18 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdQueryControl.java

@@ -9,6 +9,7 @@ import cn.hmsoft.ses.constants.StdConst;
 import cn.hmsoft.ses.constants.SysConst;
 import cn.hmsoft.ses.data.dao.std.StdEnrolDao;
 import cn.hmsoft.ses.data.model.pl.PlExamTime;
+import cn.hmsoft.ses.data.model.std.StdDownTicket;
 import cn.hmsoft.ses.data.model.std.StdRegInfo;
 import cn.hmsoft.ses.data.model.std.StdTicket;
 import cn.hmsoft.ses.helper.YearCodeHelper;
@@ -16,6 +17,7 @@ import cn.hmsoft.ses.service.iface.cf.ICfOperateTimeService;
 import cn.hmsoft.ses.service.iface.pl.IPlExamTimeService;
 import cn.hmsoft.ses.service.iface.std.IStdEnrolService;
 import cn.hmsoft.ses.service.iface.std.IStdTicketService;
+import cn.hmsoft.ses.service.impl.std.StdDownTicketDao;
 import cn.hmsoft.web.control.AjaxControl;
 import cn.hmsoft.web.entity.Ajax;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +29,7 @@ import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.OutputStream;
+import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -56,6 +59,8 @@ public class StdQueryControl extends AjaxControl{
     
     @Autowired
     private StdEnrolDao stdEnrolDao;
+    @Autowired
+	private StdDownTicketDao stdDownTicketDao;
     
     
     private Integer getTimeControlType(Integer special_flag){
@@ -244,6 +249,19 @@ public class StdQueryControl extends AjaxControl{
 
 				File tempFile = new File(path + stdTicket.getTicket_file());
 				this.downloadFile(tempFile, "准考证.pdf", false);
+				
+				// 新增下载准考证操作日志
+				StdDownTicket ticket = new StdDownTicket();
+				ticket.setOpertype(1);
+				ticket.setStd_reg_id(std.getId());
+				ticket.setTicket_no(std.getTicket_no());
+
+				ticket.setUser_id(std.getId());
+				ticket.setYear_code(YearCodeHelper.getCurrentYearCode());
+				ticket.setCreatetime(LocalDateTime.now());
+
+				this.stdDownTicketDao.insert(ticket);
+				
 			}
 
 		}catch(Exception e){

+ 185 - 8
ses-enrol/src/main/java/cn/hmsoft/ses/control/std/StdRegInfoControl.java

@@ -78,7 +78,9 @@ import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
+import java.net.URLDecoder;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.ZoneOffset;
@@ -696,7 +698,7 @@ public class StdRegInfoControl extends AjaxControl {
 		return new Ajax();
 	}
 	
-	@RequestMapping("/std/stdRegInfo/reg")
+	/*@RequestMapping("/std/stdRegInfo/reg")
 	public Ajax reg(StdRegInfo stdRegInfo) {
 		if(null == stdRegInfo || StringUtils.isEmpty(stdRegInfo.getCert_no())){
 			throw new BusinessException("请填写证件号。");
@@ -792,11 +794,27 @@ public class StdRegInfoControl extends AjaxControl {
 		stdRegInfo.setPhoto_path(null);
 		stdRegInfo.setMajor_id(null);
 		
+		
+		StdRegInfo std = new StdRegInfo();
+		std.setCert_no(stdRegInfo.getCert_no());
+		std.setStd_name(stdRegInfo.getStd_name());
+		std.setStd_sex(stdRegInfo.getStd_sex());
+		std.setStd_city(stdRegInfo.getStd_city());
+		std.setStd_county(stdRegInfo.getStd_county());
+		std.setStd_birth(stdRegInfo.getStd_birth());
+		std.setCert_type(stdRegInfo.getCert_type());
+		std.setStd_pass(stdRegInfo.getStd_pass());
+		std.setStatus(StdConst.Status.NEW.ordinal());
+		std.setReg_time(DateHelper.format(now));
+		std.setIs_new_stu(1);
+		std.setStd_source(1);
+		std.setExam_time_id(exam_time_id);
+		
 		// 保存考生信息
-		this.stdRegInfoService.save(stdRegInfo);
+		this.stdRegInfoService.save(std);
 
 		return new Ajax();
-	}
+	}*/
 
 	
 	/**
@@ -3096,7 +3114,8 @@ public class StdRegInfoControl extends AjaxControl {
 			std = new StdRegInfo();
 			std.setId(dbStdRegInfo.getId());	
 			std.setTicket_no(dbStdRegInfo.getTicket_no());
-			std.setBindphone(dbStdRegInfo.getBindphone());
+			// 返回加密后的手机号码
+			std.setBindphone(dbStdRegInfo.getBindphone_en());
 			if(null != dbStdRegInfo.getQuestion()){
 				std.setQuestion("Question");
 			}
@@ -4579,6 +4598,14 @@ public class StdRegInfoControl extends AjaxControl {
 		if (null == stdRegInfo || StringUtils.isEmpty(stdRegInfo.getStd_name())) {
 			throw new BusinessException("请填写姓名。");
 		} else if (!StringUtils.isEmpty(stdRegInfo.getStd_name())) {
+			if(stdRegInfo.getStd_name().length()>15){
+				try {
+					stdRegInfo.setStd_name(URLDecoder.decode(stdRegInfo.getStd_name(),"utf-8"));
+				} catch (UnsupportedEncodingException e) {
+					LogHelper.error(e);
+				}
+			}
+			
 			if (!PatternUtil.checkStdName(stdRegInfo.getStd_name().trim())) {
 				throw new BusinessException("请输入正确中文姓名且长度在15个字范围内!");
 			}
@@ -4697,8 +4724,30 @@ public class StdRegInfoControl extends AjaxControl {
 		stdRegInfo.setPhoto_path(null);
 		stdRegInfo.setMajor_id(null);
 		
+		StdRegInfo std = new StdRegInfo();
+		std.setCert_no(stdRegInfo.getCert_no());
+		std.setStd_name(stdRegInfo.getStd_name());
+		std.setStd_sex(stdRegInfo.getStd_sex());
+		std.setStd_city(stdRegInfo.getStd_city());
+		std.setStd_county(stdRegInfo.getStd_county());
+		std.setStd_birth(stdRegInfo.getStd_birth());
+		std.setCert_type(stdRegInfo.getCert_type());
+		std.setStd_pass(stdRegInfo.getStd_pass());
+		
+		//APP登录同时绑定手要号码
+		std.setStd_mobile(stdRegInfo.getStd_mobile());
+		std.setBindphone(stdRegInfo.getStd_mobile());
+		
+		std.setStatus(StdConst.Status.NEW.ordinal());
+		std.setReg_time(DateHelper.format(now));
+		std.setIs_new_stu(1);
+		std.setStd_source(1);
+		std.setExam_time_id(exam_time_id);
+		std.setYear_code(currentTime.getYear_code());
+		
+		
 		// 保存考生信息
-		this.stdRegInfoService.save(stdRegInfo);
+		this.stdRegInfoService.save(std);
 
 		return new Ajax();
 		
@@ -4813,7 +4862,12 @@ public class StdRegInfoControl extends AjaxControl {
 	@RequestMapping("/std/getLoginToken")
 	public Ajax getLoginToken(String uuid) {
 		StdRegInfo std = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
-		String token=SecureHelper.des3Encrypt(std.getId().toString()+ "@"+uuid+ "@"+ LocalDateTime.now().plusDays(7).toInstant(ZoneOffset.of("+8")).toEpochMilli(), SecureHelper.getSecureKey(uuid));
+		String loginToken = std.getId().toString()+ "@"+uuid+ "@"+ LocalDateTime.now().plusDays(7).toInstant(ZoneOffset.of("+8")).toEpochMilli();
+		String pubKey = SysConst.getAppConfig().getPubKey();
+		// 4.1.7[高风险]敏感信息泄露
+		String token = RSAUtils.encrypt(loginToken, pubKey);
+		
+		//String token=SecureHelper.des3Encrypt();
 		
 		//[高风险]安全退出无效-服务端 将token保存数据库中
 		StdAppLogintoken temp = this.stdAppLogintokenDao.find("token", token);
@@ -4831,6 +4885,66 @@ public class StdRegInfoControl extends AjaxControl {
 		
 		return new Ajax(token);
 	}
+	
+	
+	@RequestMapping("/std/setAuthentication")
+	public Ajax setAuthentication(String uuid, String token) {
+		if (uuid == null || token == null) {
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+		
+//		String std_id = SecureHelper.des3Decrypt(token, SecureHelper.getSecureKey(uuid));
+//		if (StringUtils.isEmpty(std_id) ) {
+//			throw new BusinessException("请使用账号或手机重新登录!");
+//		}
+		String source = null;
+		
+		/*try {
+			source = SecureHelper.des3Decrypt(token, SecureHelper.getSecureKey(uuid));
+		} catch (Exception e) {
+		}*/
+		
+		// 4.1.7[高风险]敏感信息泄露
+		String privateKey = SysConst.getAppConfig().getPrivateKey();
+		source = RSAUtils.decrypt(token, privateKey);
+		
+		if (StringHelper.isEmpty(source))
+			throw new BusinessException("请使用账号或手机重新登录!");
+		if (source.split("@").length != 3)
+			throw new BusinessException("请使用账号或手机重新登录!");
+		if (!source.split("@")[1].equals(uuid))
+			throw new BusinessException("请使用账号或手机重新登录!");
+		if(System.currentTimeMillis()>Long.parseLong(source.split("@")[2]))
+			throw new BusinessException("请使用账号或手机重新登录!");
+		
+		// [高风险]安全退出无效-服务端 从数据库中获取token,判断token是否已经安全退出,如果已经安全退出,则需要重新登录
+		StdAppLogintoken temp = this.stdAppLogintokenDao.find("token", token);
+		if (null != temp && !"1".equals(temp.getStatus())) {
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+
+		StdRegInfo dbStdRegInfo = this.stdRegInfoDao.queryStdById(Integer.valueOf(source.split("@")[0]));
+		if (dbStdRegInfo == null ) {
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+		
+		
+		StdRegInfo seStd = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
+		if (seStd != null && !seStd.getId().equals(dbStdRegInfo.getId())) {
+			getRequest().getSession().setAttribute(EnrolSessionName.EnrolStdReg, null);
+			throw new BusinessException("请注销之前的登录用户或关闭浏览器重新登录!");
+		}
+	
+		StdRegInfo std = new StdRegInfo();
+		std.setId(dbStdRegInfo.getId());
+		
+		String pubKey = SysConst.getAppConfig().getPubKey();
+		String std_pass = dbStdRegInfo.getStd_pass();
+		String encrypt_std_pass = RSAUtils.encrypt(std_pass, pubKey);
+		std.setStd_pass(encrypt_std_pass);
+
+		return new Ajax(std);
+	}
 
 	@RequestMapping("/std/loginForAuthentication")
 	public Ajax loginForAuthentication(String uuid, String token) {
@@ -4843,10 +4957,16 @@ public class StdRegInfoControl extends AjaxControl {
 //			throw new BusinessException("请使用账号或手机重新登录!");
 //		}
 		String source = null;
-		try {
+		
+		/*try {
 			source = SecureHelper.des3Decrypt(token, SecureHelper.getSecureKey(uuid));
 		} catch (Exception e) {
-		}
+		}*/
+		
+		// 4.1.7[高风险]敏感信息泄露
+		String privateKey = SysConst.getAppConfig().getPrivateKey();
+		source = RSAUtils.decrypt(token, privateKey);
+		
 		if (StringHelper.isEmpty(source))
 			throw new BusinessException("请使用账号或手机重新登录!");
 		if (source.split("@").length != 3)
@@ -4870,6 +4990,7 @@ public class StdRegInfoControl extends AjaxControl {
 		
 		StdRegInfo seStd = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
 		if (seStd != null && !seStd.getId().equals(dbStdRegInfo.getId())) {
+			getRequest().getSession().setAttribute(EnrolSessionName.EnrolStdReg, null);
 			throw new BusinessException("请注销之前的登录用户或关闭浏览器重新登录!");
 		}
 		stdRegInfoService.DecryptStd(dbStdRegInfo);
@@ -4883,5 +5004,61 @@ public class StdRegInfoControl extends AjaxControl {
 		return new Ajax(std);
 	}
 	
+	@RequestMapping("/std/loginForAuthenticationMode")
+	public Ajax loginForAuthenticationMode(Integer id, String std_pass) {
+		if (id == null || std_pass == null) {
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+		
+//		String std_id = SecureHelper.des3Decrypt(token, SecureHelper.getSecureKey(uuid));
+//		if (StringUtils.isEmpty(std_id) ) {
+//			throw new BusinessException("请使用账号或手机重新登录!");
+//		}
+		String source = null;
+		
+		/*try {
+			source = SecureHelper.des3Decrypt(token, SecureHelper.getSecureKey(uuid));
+		} catch (Exception e) {
+		}*/
+		
+		// 4.1.7[高风险]敏感信息泄露
+		String privateKey = SysConst.getAppConfig().getPrivateKey();
+		source = RSAUtils.decrypt(std_pass, privateKey);
+		
+
+		StdRegInfo dbStdRegInfo = this.stdRegInfoDao.queryStdById(id);
+		if (dbStdRegInfo == null) {
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+		
+		String error = this.isSysOperateFail(dbStdRegInfo.getCert_no(), "canLoginTime", 5);
+		if (null != error) {
+			throw new BusinessException(error);
+		}
+		
+
+		if(!dbStdRegInfo.getStd_pass().equals(source)){
+			this.setSysOperateFail(dbStdRegInfo.getCert_no(), "canLoginTime", 5, 5, "登录失败累计超过5次,请5分钟之后再登录!");
+			throw new BusinessException("请使用账号或手机重新登录!");
+		}
+		
+		
+		StdRegInfo seStd = (StdRegInfo) getRequest().getSession().getAttribute(EnrolSessionName.EnrolStdReg);
+		if (seStd != null && !seStd.getId().equals(dbStdRegInfo.getId())) {
+			getRequest().getSession().setAttribute(EnrolSessionName.EnrolStdReg, null);
+			throw new BusinessException("请注销之前的登录用户或关闭浏览器重新登录!");
+		}
+		
+		
+		stdRegInfoService.DecryptStd(dbStdRegInfo);
+		getRequest().getSession().setAttribute(EnrolSessionName.EnrolStdReg, dbStdRegInfo);
+		StdRegInfo std = new StdRegInfo();
+		std.setId(dbStdRegInfo.getId());
+		std.setTicket_no(dbStdRegInfo.getTicket_no());
+		std.setBindphone(dbStdRegInfo.getBindphone());
+
+		return new Ajax(std);
+	}
+	
 
 }

+ 14 - 6
ses-enrol/src/main/java/cn/hmsoft/ses/control/sys/SysAppNewsControl.java

@@ -1,12 +1,16 @@
 package cn.hmsoft.ses.control.sys;
 
 import cn.hmsoft.helper.StringHelper;
+import cn.hmsoft.jdbc.entity.Pager;
+import cn.hmsoft.jdbc.entity.QueryOrder;
 import cn.hmsoft.jdbc.entity.QueryOrderType;
 import cn.hmsoft.ses.service.iface.cf.ICfOperateTimeService;
 import cn.hmsoft.ses.service.iface.sys.ISysAppNewsService;
 import cn.hmsoft.web.control.AjaxControl;
 import cn.hmsoft.web.entity.Ajax;
 
+import java.util.LinkedHashMap;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -31,12 +35,16 @@ public class SysAppNewsControl extends AjaxControl {
 	
     @RequestMapping("sys/sysAppNews/page")
     public Ajax page(String query, Integer limit, Integer start, String order, String type) {
-        if (StringHelper.isEmpty(order)) {
-        	//TODO 修改为排序字段
-        	order = "published_at";
-            type= QueryOrderType.DESC.toString();
-        }
-        return new Ajax(this.sysAppNewsService.page(query, start, limit, this.getQueryOrder(order, type)));
+    	Pager page = null;
+		if (StringHelper.isEmpty(order)) {
+			LinkedHashMap<String, QueryOrderType> fields = new LinkedHashMap<String, QueryOrderType>();
+			fields.put("topup", QueryOrderType.DESC);
+			fields.put("PUBLISHED_AT", QueryOrderType.DESC);
+			page = this.sysAppNewsService.page(query, start, limit, new QueryOrder(fields));
+		}else{
+			page = this.sysAppNewsService.page(query, start, limit, this.getQueryOrder(order, type));
+		}
+        return new Ajax(page);
     }
     
 	@RequestMapping("sys/sysAppNews/queryOperateTimeByTypeByExamTimeId")

+ 13 - 2
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/by/ByApplyDao.java

@@ -102,9 +102,11 @@ public class ByApplyDao extends PlatformDaoSupport<ByApply> {
 		sql.append("select                                                                                  		");
 		sql.append("       reg.photo_url,FUN_DECRYPTION(reg.cert_no_en, '").append(SysConst.getAppConfig().getcKey()).append("') cert_no,reg.ticket_no,reg.std_name,reg.std_occupation professional,     ");
 		sql.append("	   m.major_code || '-' || m.major_name||'-'||fd.dict_text as major_name,fd.dict_text as major_level,o.org_code || '-' ||o.org_name as school_name,decode(p.std_source,1,ot.org_name,3,o.org_name,nvl(ot.org_name,o.org_name)) org_name, ");
-		sql.append("	  tc.by_date,");
+		//sql.append("	  tc.by_date,");
 		sql.append("	   p.id,p.std_id,p.enrol_id,p.major_id,p.by_time_config_id,p.ticket_no,p.apply_date,p.std_source,p.commend,p.skill,p.apply_type,p.school_id,p.city_org_id,p.file_path,p.is_passed,p.status,p.is_auth_back,p.remark,p.std_sex,p.native_prov,p.native_city,p.nation,p.political,p.pre_edu,p.work_unit,p.address,p.post_code,p.diaplma_no,p.telephone,p.std_birth,p.final_auth_a,p.final_auth_b,p.org_id,p.exam_time_id,p.is_xuexin_pass,p.is_firstauth_pass,p.order_org_id,p.by_file, ");
-		sql.append("	   nvl(p.by_photo,reg.photo_url) by_photo,nvl(p.by_photo_path,reg.photo_path) by_photo_path,nvl(p.by_photo_id,reg.photo_id) by_photo_id ");
+		sql.append("	   nvl(p.by_photo,reg.photo_url) by_photo,nvl(p.by_photo_path,reg.photo_path) by_photo_path,nvl(p.by_photo_id,reg.photo_id) by_photo_id, ");
+		sql.append("	   (select t.exam_year||'-'||decode(t.exam_month,4,'06-30',10,'12-30',t.exam_month||'-30') from pl_exam_time t where t.id=p.exam_time_id) by_date ");
+
 		sql.append(" from by_apply p                                                                        		");
 		sql.append("    left join std_reg_info reg on reg.id=p.std_id                                       		");
 		sql.append("    left join pl_major m on m.id=p.major_id                                             		");
@@ -128,6 +130,15 @@ public class ByApplyDao extends PlatformDaoSupport<ByApply> {
 		
 		return this.listBySql(sql.toString(), diaplma_no);
 	}
+	
+	public List<ByApply> queryIsAlreadyBy(Integer std_id,Integer major_id) {
+		StringBuilder sql = new StringBuilder();
+		sql.append(" select * from by_apply a where a.status in (3,5) ");
+		sql.append(" and a.std_id in (select id from std_reg_info ss where ss.cert_no_en in(select s.cert_no_en from std_reg_info s where s.id=?)) ");
+		sql.append(" and (a.major_id=? or exists (select * from pl_major_old_new mo where mo.new_major_id=? and mo.old_major_id=a.major_id)) ");
+		
+		return this.listBySql(sql.toString(), std_id,major_id,major_id);
+	}
 
 
 

+ 6 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlCourseDao.java

@@ -3,6 +3,7 @@ package cn.hmsoft.ses.data.dao.pl;
 import cn.hmsoft.helper.StringHelper;
 import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.ses.data.model.pl.PlCourse;
+
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -39,4 +40,9 @@ public class PlCourseDao extends PlatformDaoSupport<PlCourse> {
 		query=generateLikeParamter(query);
 		return this.listBySql(sql,query,query);
 	}
+	
+	public PlCourse findCourseLimit(Integer course_id) {
+		String sql = "select * from PL_COURSE_limit a where a.id=? ";
+		return this.findBySql(sql, course_id);
+	}
 }

+ 11 - 65
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlCourseTextbookDao.java

@@ -3,14 +3,12 @@ package cn.hmsoft.ses.data.dao.pl;
 import cn.hmsoft.jdbc.entity.Pager;
 import cn.hmsoft.helper.StringHelper;
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.springframework.stereotype.Repository;
 import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.ses.data.model.pl.PlCourseTextbook;
-import cn.hmsoft.ses.data.model.pl.PlTextbook;
 
 /**
  * 课程教材关联表 课程对应的教材,一门课程可以对应多个教材 数据库处理.
@@ -69,72 +67,20 @@ public class PlCourseTextbookDao extends PlatformDaoSupport<PlCourseTextbook> {
 	 * @param year_code:批次码
 	 * @return 查找课程关联的教材信息
 	 */
-	public List<Map<String,Object>> listTextBookCourse(Integer course_id, String year_code) {
+	public List<Map<String,Object>> listTextBookCourse(Integer course_id) {
 		StringBuffer sb = new StringBuffer();
-		//sb.append("   select * from (                          ");
-		sb.append("  select t.*,ct.course_id,e.year_code,                          ");
-		sb.append("  decode(e.exam_year,null,e.year_code||'',e.exam_year || '年' || decode(e.exam_month,'4','上半年','10','下半年', e.exam_month || '月')) exam_year_month           ");
-
-		sb.append("    from pl_course_textbook_log ct, pl_textbook t, pl_exam_time e      ");
-		sb.append("   where ct.textbook_id = t.id                                     ");
-		sb.append("     and ct.exam_time_id = e.id                                    ");
-		sb.append("     and ct.course_id = ?                                          ");
-		sb.append("     and e.year_code > ?                                          ");
-		sb.append("     order by e.year_code desc                                     ");
-		//sb.append("     ) where rownum=1                                     ");
-		
-		
-//		return this.listBySql(sb.toString(), course_id, year_code);
-		return this.listMapBySql(sb.toString(), course_id, year_code);
-	}
-	
-	/**
-	 * @param course_id: 课程ID
-	 * @param year_code:批次码
-	 * @return 查找课程关联的教材信息
-	 */
-	public List<Map<String,Object>> listTextBookCourseByYearCode(Integer course_id, String year_code) {
-		StringBuffer sb = new StringBuffer();
-		sb.append("  select t.*,ct.course_id,e.year_code                          ");
-		sb.append("    from pl_course_textbook_log ct, pl_textbook t, pl_exam_time e      ");
-		sb.append("   where ct.textbook_id = t.id                                     ");
-		sb.append("     and ct.exam_time_id = e.id                                    ");
-		sb.append("     and ct.course_id = ?                                          ");
-		sb.append("     and e.year_code >= ?                                          ");
-		sb.append("     order by e.year_code desc                                     ");
+		sb.append("  select * from (   ");
+		sb.append("  select t.*,e.year_code,  ");
+		sb.append("  decode(e.exam_year,null,e.year_code||'',e.exam_year || '年' || decode(e.exam_month,'4','上半年','10','下半年', e.exam_month || '月')) exam_year_month ");
+		sb.append("  from pl_textbook t, pl_exam_time e ");
+		sb.append("  where t.exam_time_id = e.id ");
+		sb.append("  and t.status = 1 ");
+		sb.append("  and t.course_id = ? ");
+		sb.append("  order by e.year_code desc  ");
+		sb.append("  ) where rownum<=2 ");
 		
-		
-//		return this.listBySql(sb.toString(), course_id, year_code);
-		return this.listMapBySql(sb.toString(), course_id, year_code);
+		return this.listMapBySql(sb.toString(), course_id);
 	}
 	
 
-	/**
-	 * @param course_id:课程ID
-	 * @param textbook_id:教材ID
-	 * @return 根据条件查找教材课程关联信息
-	 */
-	public PlCourseTextbook findCourseTextbook(Integer course_id, Integer textbook_id) {
-		String sql = "select * from pl_course_textbook ct where ct.course_id = ? and ct.textbook_id = ? order by exam_time_id ";
-		return this.findBySql(sql, course_id, textbook_id);
-	}
-
-	/**
-	 * @param book:已经存在的课程教材关系
-	 * @param ctBook:要替换的课程教材关系
-	 * 用新的课程教材关系 更新 旧的课程教材关系
-	 */
-	public void updateCourseTextbook(PlCourseTextbook book, PlCourseTextbook ctBook) {
-		if (book != null && ctBook != null) {
-			String sql = "update pl_course_textbook ct set ct.exam_time_id = ? "
-					+ " where  ct.course_id = ? and ct.textbook_id = ? and ct.exam_time_id = ?";
-			this.updateBySql(sql, ctBook.getExam_time_id(), book.getCourse_id(), book.getTextbook_id(),
-					book.getExam_time_id());
-		}
-	}
-
-	public void updateTextbookBatch(Integer id, Integer exam_time_id) {
-		String sql = "update pl_course_textbook set exam_time_id = ? where id = ?  ";
-		this.updateBySql(sql, exam_time_id, id);
-	}
 }

+ 5 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlExamAreaCourseDao.java

@@ -65,4 +65,9 @@ public class PlExamAreaCourseDao extends PlatformDaoSupport<PlExamAreaCourse> {
 		return this.listBySql(sb.toString(),year_code,course_id);
 	}
 	
+	public PlExamAreaCourse queryCourseCalculator(Integer course_id){
+		String sql = "select '可携带不具有程序储存、记事、影音播放、无线通讯等功能的计算器。' calculator from pl_course_calculator c where c.course_id= ?";
+		return this.findBySql(sql, course_id);
+	}
+	
 }

+ 5 - 7
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMajorCourseDao.java

@@ -159,19 +159,17 @@ public class PlMajorCourseDao extends PlatformDaoSupport<PlMajorCourse> {
 		return this.listMapBySql(sb.toString(), major_id,String.valueOf(course_id));
 	}
 	
-	public List<Map<String, Object>> listCourseTextBook(Integer course_id) {
-		StringBuffer sb = new StringBuffer();
-		sb.append("select t.*,et.year_code,ct.course_id from pl_course_textbook ct, pl_textbook t ,pl_exam_time et");
-		sb.append(" where ct.textbook_id = t.id and ct.EXAM_TIME_ID  =et.id and ");
-		sb.append(" ct.course_id = ?");
-	    return this.listMapBySql(sb.toString(), course_id);
-	}
 
 	public PlMajorCourse findMajorByCourse(Integer major_id, Integer course_id) {
 		String sql = "select * from pl_major_course where major_id = ? and course_id = ? ";
 		return this.findBySql(sql, major_id, course_id);
 	}
 	
+	public PlMajorCourse findCourseForSelectedExam(Integer course_id) {
+		String sql = "select id course_id from pl_course_selected where id = ? ";
+		return this.findBySql(sql, course_id);
+	}
+	
 	public List<PlMajorCourse> listMajorCourse(Integer major_id, String[] courseCodes) {
 		StringBuffer sb = new StringBuffer();
 		sb.append("   select c.id, c.course_code, c.course_name,c.course_score                    ");

+ 0 - 26
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMajorDao.java

@@ -64,32 +64,6 @@ public class PlMajorDao extends PlatformDaoSupport<PlMajor> {
 		return this.listBySql(sql);
 	}
 
-	/**
-	 * @param id 专业ID
-	 * 根据专业ID查找相关的课程和教材
-	 */
-	public List<PlMajor> findCourseAndBook(Integer id) {
-		StringBuffer sb = new StringBuffer();
-		sb.append("  select ma.major_code,                              ");
-		sb.append("         ma.major_name,                              ");
-		sb.append("         c.course_code,                              ");
-		sb.append("         c.course_name,                              ");
-		sb.append("         c.course_score,                             ");
-		sb.append("         t.textbook_name,                            ");
-		sb.append("         t.textbook_publisher,                       ");
-		sb.append("         t.textbook_revision                         ");
-		sb.append("    from pl_major_course mc                          ");
-		sb.append("    left join pl_course c                            ");
-		sb.append("      on mc.course_id = c.id                         ");
-		sb.append("    left join pl_course_textbook b                   ");
-		sb.append("      on c.id = b.course_id                          ");
-		sb.append("    left join pl_textbook t                          ");
-		sb.append("      on b.textbook_id = t.id                        ");
-		sb.append("    left join pl_major ma                            ");
-		sb.append("      on mc.major_id = ma.id                         ");
-		sb.append("   where mc.major_id= ?                              ");
-		return this.listBySql(sb.toString(), id);
-	}
 	
 	/**
 	 * 查找专业所有的ID

+ 71 - 27
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/pl/PlMergePublishPlanDao.java

@@ -90,12 +90,42 @@ public class PlMergePublishPlanDao extends PlatformDaoSupport<PlMergePublishPlan
 			sb.append("             and p.exam_time = ?                                                              ");
 			sb.append("             and c.is_social_enrol = ?                                                        ");
 			sb.append("             and mc.major_id = ?)                                                             ");
+			sb.append("     and not exists (select 1 from pl_course_selected s where s.id=c.id)  ");
 			sb.append("             order by c.course_code                                                           ");
 			return this.listBySql(PlCourse.class, sb.toString(), year_code, exam_time, YesOrNo.YES.ordinal(),  year_code,
 					exam_time, YesOrNo.YES.ordinal(),major_id);
 		}
 	}
 	
+	public List<PlCourse> listPublishCouseForSelectedExam(String exam_time, Integer major_id, String year_code) {
+		//选考课程
+		StringBuffer sb = new StringBuffer();
+		sb.append("  select distinct c.id,                                                                       ");
+		sb.append("                  c.course_code,                                                              ");
+		sb.append("                  c.course_name,                                                              ");
+		sb.append("                  c.course_score,                                                             ");
+		sb.append("                  c.is_nation_exam,c.is_social_enrol                                           ");
+		sb.append("    from pl_merge_publish_plan p,pl_publish_plan_main pp, pl_course c                           ");
+		sb.append("   where p.course_id = c.id and pp.id=p.main_id and pp.status=1                                ");
+		sb.append("     and p.year_code = ?                                                                      ");
+		sb.append("     and p.exam_time = ?                                                                      ");
+		sb.append("     and c.is_social_enrol = ?                                                                ");
+		sb.append("     and p.id not in                                                                          ");
+		sb.append("         (select p.id                                                                         ");
+		sb.append("            from pl_merge_publish_plan p, pl_course c, pl_major_course mc                     ");
+		sb.append("           where p.course_id = c.id                                                           ");
+		sb.append("             and c.id = mc.course_id                                                          ");
+		sb.append("             and p.year_code = ?                                                              ");
+		sb.append("             and p.exam_time = ?                                                              ");
+		sb.append("             and c.is_social_enrol = ?                                                        ");
+		sb.append("             and mc.major_id = ?)                                                             ");
+		sb.append("     and exists (select 1 from pl_course_selected s where s.id=c.id)  ");
+		sb.append("             order by c.course_code                                                           ");
+		return this.listBySql(PlCourse.class, sb.toString(), year_code, exam_time, YesOrNo.YES.ordinal(),  year_code,
+				exam_time, YesOrNo.YES.ordinal(),major_id);
+
+	}
+	
 	/**
 	 * 查询专业计划开考课程,网报和现场报的都查询
 	 * @param exam_time
@@ -144,6 +174,35 @@ public class PlMergePublishPlanDao extends PlatformDaoSupport<PlMergePublishPlan
 					exam_time, major_id);
 		}
 	}
+	
+	/**
+	 * 查询选考开考课程,网报和现场报的都查询
+	 * @param exam_time
+	 * @param major_id
+	 * @param flag
+	 * @param year_code
+	 * @return
+	 */
+	public List<PlCourse> listPublishCouseForSelected(String exam_time, String year_code) {
+		
+			StringBuffer sb = new StringBuffer();
+			sb.append("  select distinct c.id,                                                                       ");
+			sb.append("                  c.course_code,                                                              ");
+			sb.append("                  c.course_name,                                                              ");
+			sb.append("                  c.course_score,                                                             ");
+			sb.append("                  c.is_nation_exam,c.is_social_enrol                                                            ");
+			sb.append("    from pl_merge_publish_plan p,pl_publish_plan_main pp, pl_course c                                                 ");
+			sb.append("   where p.course_id = c.id and pp.id=p.main_id and pp.status=1                                                                  ");
+			sb.append("     and p.year_code = ?                                                                      ");
+			sb.append("     and p.exam_time = ?                                                                      ");
+			//sb.append("     and c.is_social_enrol = ?                                                                ");
+			
+			sb.append("     and exists (select 1 from pl_course_selected s where s.id=c.id)  ");
+
+			sb.append("             order by c.course_code                                                           ");
+			return this.listBySql(PlCourse.class, sb.toString(), year_code, exam_time);
+		
+	}
 
 	public String getExamTime(Integer id, String currentYearCode) {
 		String sql = "select * from pl_merge_publish_plan where course_id = ? and year_code = ? ";
@@ -222,38 +281,23 @@ public class PlMergePublishPlanDao extends PlatformDaoSupport<PlMergePublishPlan
 				ExamTimeEnum.X.toString(), ExamTimeEnum.Y.toString(), year_code, courseId);
 	}
 	
-	public List<PlCourse> getCourseTextBook(List<PlCourse> listPublishCouse,String year_code) {
+	public List<PlCourse> getCourseTextBook(List<PlCourse> listPublishCouse,Integer exam_time_id) {
 		StringBuilder sqlb = new StringBuilder();
-		sqlb.append(" select rownum,f.* from (select b.year_code,c.course_code,c.course_name,d.textbook_name,d.textbook_writer,d.textbook_publisher,d.textbook_outline,d.textbook_revision from pl_course_textbook_log a ");
-		sqlb.append(" left join pl_exam_time b on a.exam_time_id=b.id ");
-		sqlb.append(" left join pl_course c on c.id=a.course_id ");
-		sqlb.append(" left join pl_textbook d on d.id=a.textbook_id ");
-		sqlb.append(" where c.course_code= ? and b.year_code=? order by year_code desc) f where rownum = 1");
-		
+		sqlb.append(" select b.year_code,c.course_code,c.course_name,d.textbook_name,d.textbook_writer,d.textbook_publisher,d.textbook_outline,d.textbook_revision from pl_textbook d ");
+		sqlb.append(" left join pl_exam_time b on d.exam_time_id=b.id ");
+		sqlb.append(" left join pl_course c on c.id=d.course_id ");
+		sqlb.append(" where d.status=1 and d.course_id= ? and d.exam_time_id=?");
 		
 		for (PlCourse plCourse : listPublishCouse) {
-			 PlCourse course = this.courseDao.findBySql(sqlb.toString(),plCourse.getCourse_code(),year_code);
-			 if(null == course){
-				StringBuilder sql = new StringBuilder();
-				sql.append(" select rownum,f.* from (select b.year_code,c.course_code,c.course_name,d.textbook_name,d.textbook_writer,d.textbook_publisher,d.textbook_outline,d.textbook_revision from pl_course_textbook_log a ");
-				sql.append(" left join pl_exam_time b on a.exam_time_id=b.id ");
-				sql.append(" left join pl_course c on c.id=a.course_id ");
-				sql.append(" left join pl_textbook d on d.id=a.textbook_id ");
-				if("202001".compareTo(year_code)<0){
-					sql.append(" where c.course_code= ? and b.year_code<? and b.year_code>202001 order by year_code desc) f where rownum = 1");
-					course = this.courseDao.findBySql(sql.toString(),plCourse.getCourse_code(),year_code);
-				}else{
-					sql.append(" where c.course_code= ? and b.year_code>202001 order by year_code desc) f where rownum = 1");
-					course = this.courseDao.findBySql(sql.toString(),plCourse.getCourse_code());
-				}
-				
+			 PlCourse course = this.courseDao.findBySql(sqlb.toString(),plCourse.getId(),exam_time_id);
+			 if(null != course){
+				 plCourse.setTextbook_name(course.getTextbook_name());
+				 plCourse.setTextbook_writer(course.getTextbook_writer());
+				 plCourse.setTextbook_publisher(course.getTextbook_publisher());
+				 plCourse.setTextbook_revision(course.getTextbook_revision());
+				 plCourse.setTextbook_outline(course.getTextbook_outline());
 			 }
 			 
-			 plCourse.setTextbook_name(course.getTextbook_name());
-			 plCourse.setTextbook_writer(course.getTextbook_writer());
-			 plCourse.setTextbook_publisher(course.getTextbook_publisher());
-			 plCourse.setTextbook_revision(course.getTextbook_revision());
-			 plCourse.setTextbook_outline(course.getTextbook_outline());
 		}
 		
 		return listPublishCouse;

+ 22 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdBreakDisciplineFileDao.java

@@ -0,0 +1,22 @@
+package cn.hmsoft.ses.data.dao.std;
+
+import java.util.List;
+
+import org.springframework.stereotype.Repository;
+
+import cn.hmsoft.jdbc.core.PlatformDaoSupport;
+import cn.hmsoft.ses.data.model.std.StdBreakDisciplineFile;
+
+@Repository
+public class StdBreakDisciplineFileDao extends PlatformDaoSupport<StdBreakDisciplineFile> {
+
+	public List<StdBreakDisciplineFile> queryStdBreakDisciplineFile(String ticket_no) {
+		String sql = "select a.*,t.exam_year || '年' || decode(t.exam_month,'4','上半年','10','下半年', t.exam_month || '月') exam_year_month from std_break_discipline_file a,pl_exam_time t where t.id=a.exam_time_id and a.ticket_no=? order by exam_time_id desc,a.file_type ";
+		return this.listBySql(sql, ticket_no);
+	}
+	
+	public StdBreakDisciplineFile queryStdBreakDisciplineFile(String ticket_no, Integer exam_time_id,String file_type) {
+		String sql = "select a.*,t.exam_year || '年' || decode(t.exam_month,'4','上半年','10','下半年', t.exam_month || '月') exam_year_month from std_break_discipline_file a,pl_exam_time t where t.id=a.exam_time_id and a.ticket_no=? and a.exam_time_id=? and a.file_type=? ";
+		return this.findBySql(sql, ticket_no, exam_time_id,file_type);
+	}
+}

+ 4 - 2
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdEnrolDao.java

@@ -75,7 +75,9 @@ public class StdEnrolDao extends PlatformDaoSupport<StdEnrol> {
 		sb.append("            to_char(et.exam_second_day, 'YYYY-MM-DD') || '下午'         ");
 		sb.append("           when mpp.exam_time = 'Y' then                                ");
 		sb.append("            to_char(et.exam_first_day, 'YYYY-MM-DD') || '下午'          ");
-		sb.append("         end exam_times                                                 ");
+		sb.append("         end exam_times,                                                 ");
+		sb.append("    (select '可携带不具有程序储存、记事、影音播放、无线通讯等功能的计算器。' from pl_course_calculator pc where pc.course_id=c.id) calculator        ");
+
 		sb.append("    from std_enrol en                                                   ");
 		sb.append("    left join pl_course c                                               ");
 		sb.append("      on en.course_id = c.id                                            ");
@@ -284,7 +286,7 @@ public class StdEnrolDao extends PlatformDaoSupport<StdEnrol> {
 		String sql = "select * from std_enrol e where e.std_reg_id = ? and e.course_id = ? and e.year_code = ? ";
 		return this.findBySql(sql, std_id, course_id, currentYearCode);
 	}
-
+	
 	public List<Map<String, Object>> listMajorCourseExamInfo(String exam_time, Integer major_id, String year_code , Integer std_reg_id) {
 		StringBuilder sql = new StringBuilder();
 		sql.append("    select distinct c.id, c.course_code, c.course_name, c.course_score, c.is_nation_exam,(select decode(count(1),0,'',c.course_code||'-'||c.course_name) from pl_course_calculator pc where pc.course_id=c.id) calculator        ");

+ 7 - 2
ses-enrol/src/main/java/cn/hmsoft/ses/data/dao/std/StdRegInfoDao.java

@@ -154,12 +154,12 @@ public class StdRegInfoDao extends PlatformDaoSupport<StdRegInfo> {
 	}
 	
 	public List<Map<String,Object>> queryCityCounty(String std_city) {
-		String sql = "select * from cf_county_bz a where a.city_code=? order by a.country_code";
+		String sql = "select a.*,a.country_code||' | '||a.country_name full_name from cf_county_bz a where a.city_code=? order by a.country_code";
 		return this.listMapBySql(sql, std_city);
 	}
 	
 	public List<Map<String,Object>> queryCity() {
-		String sql = "select * from cf_city_bz a order by a.city_code";
+		String sql = "select a.*,a.city_code||' | '||a.city_name full_name from cf_city_bz a order by a.city_code";
 		return this.listMapBySql(sql);
 	}
 	
@@ -193,4 +193,9 @@ public class StdRegInfoDao extends PlatformDaoSupport<StdRegInfo> {
 		return this.findBySql(sql.toString(), id);
 	}
 	
+	public StdRegInfo queryStdCreateTime(Integer id) {
+		String sql = " select create_date_time create_time from std_reg_info a where a.id=? ";
+		return this.findBySql(sql.toString(), id);
+	}
+	
 }

+ 26 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/helper/YearCodeHelper.java

@@ -88,6 +88,32 @@ public class YearCodeHelper {
 	 * 
 	 */
 	public static String getCurrentYearCode(Integer year) {
+		String yearCode = null;
+		LocalDateTime now = LocalDateTime.now();
+		year = (StringHelper.isEmpty(year) ? now.getYear() : year);
+		LocalDateTime april = LocalDateTime.of(year, 7, DAY + 1, HOUR, MINUTE);
+		LocalDateTime oct1 = LocalDateTime.of(year, 12, 15, HOUR, MINUTE);
+		LocalDateTime oct = LocalDateTime.of(year, 12, DAY + 1, HOUR, MINUTE);
+		LocalDateTime oct2 = LocalDateTime.of(year+1, 1, 24, HOUR, MINUTE);
+		if (now.isBefore(april)) {
+			yearCode = year + "0" + APRIL;
+		} else if (DateHelper.isBetween(now, april, oct1)) {
+			yearCode = "" + year + OCTOBER;
+		} else if (DateHelper.isBetween(now, oct1, oct)) {
+			yearCode = "" + (year + 1) + "01";
+		}else if (DateHelper.isBetween(now, oct, oct2)) {
+			yearCode = "" + year + "01";
+		} else {
+			yearCode = "" + (year + 1) + "0" + APRIL;
+		}
+		return yearCode;
+	}
+	
+	/**
+	 * 根据当前日期,小于7月31,取当年+04 大于7月31小于12月31,取当年+10
+	 * 
+	 */
+	public static String getCurrentYearCode1(Integer year) {
 		String yearCode = null;
 		LocalDateTime now = LocalDateTime.now();
 		year = (StringHelper.isEmpty(year) ? now.getYear() : year);

+ 2 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlCourseService.java

@@ -19,4 +19,6 @@ public interface IPlCourseService extends IBaseService<PlCourse> {
 
 
     List<PlCourse> listCourse(String query);
+    
+    PlCourse findCourseLimit(Integer course_id);
 }

+ 1 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlExamAreaCourseService.java

@@ -17,4 +17,5 @@ import cn.hmsoft.ses.data.model.pl.PlExamAreaCourse;
 public interface IPlExamAreaCourseService extends IBaseService<PlExamAreaCourse> {
 
 	List<PlExamAreaCourse> listExamArea(Integer course_id, Integer exam_time_id);
+	PlExamAreaCourse queryCourseCalculator(Integer course_id);
 }

+ 1 - 3
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMajorCourseService.java

@@ -3,9 +3,6 @@ package cn.hmsoft.ses.service.iface.pl;
 import java.util.List;
 import java.util.Map;
 
-import cn.hmsoft.ses.data.model.pl.PlCourse;
-import cn.hmsoft.ses.data.model.pl.PlCourseTextbook;
-import cn.hmsoft.ses.data.model.pl.PlCourseTextbookLog;
 import cn.hmsoft.ses.data.model.pl.PlMajorCourse;
 import cn.hmsoft.web.service.IBaseService;
 
@@ -30,6 +27,7 @@ public interface IPlMajorCourseService extends IBaseService<PlMajorCourse> {
 	List<Map<String, Object>> listMajorFullCourse(Integer major_id);
 	
 	PlMajorCourse findMajorCourse(Integer major_id, Integer course_id);
+	PlMajorCourse findCourseForSelectedExam(Integer course_id);
 
 	List<Map<String,Object>> listCourseTextbook(Integer course_id);
 	

+ 0 - 3
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMajorService.java

@@ -29,9 +29,6 @@ public interface IPlMajorService extends IBaseService<PlMajor> {
 
 	List<PlMajor> listMajor(String ids);
 
-	File makeCourseBook(String[] ids);
-
-	List<PlMajor> findCourseAndBook(Integer id);
 
 	PlMajor findMajor(Integer id);
 

+ 4 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/pl/IPlMergePublishPlanService.java

@@ -14,6 +14,10 @@ public interface IPlMergePublishPlanService extends IBaseService<PlMergePublishP
 
 	Map<String,List<PlCourse>> listPublishCouse(Integer major_id,Integer flag);
 	Map<String,List<PlCourse>> listPublishCouse(Integer major_id,Integer exam_time_id,Integer flag);
+	Map<String,List<PlCourse>> listPublishCouseForSelectedExam(Integer major_id);
+	Map<String,List<PlCourse>> listPublishCouseForSelected(Integer exam_time_id);
+
+
 
 	PlMergePublishPlan getExamDate(String exam_batch);
 

+ 3 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/std/IStdBreakDisciplineService.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import cn.hmsoft.jdbc.entity.Pager;
 import cn.hmsoft.ses.data.model.std.StdBreakDiscipline;
+import cn.hmsoft.ses.data.model.std.StdBreakDisciplineFile;
 import cn.hmsoft.web.service.IBaseService;
 
 /**
@@ -24,5 +25,7 @@ public interface IStdBreakDisciplineService extends IBaseService<StdBreakDiscipl
 	boolean isBreakStdForTurn(String ticket_no);
 
 	List<StdBreakDiscipline> listBystd(String ticket_no);
+	List<StdBreakDisciplineFile> queryStdBreakDisciplineFile(String ticket_no);
+	StdBreakDisciplineFile queryStdBreakDisciplineFile(String ticket_no, Integer exam_time_id,String file_type);
 	
 }

+ 2 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/iface/std/IStdRegInfoService.java

@@ -67,4 +67,6 @@ public interface IStdRegInfoService extends IBaseService<StdRegInfo> {
 	
 	List<Map<String,Object>> queryBzmbGbXzqhdm(String parent_id);
 	
+	StdRegInfo queryStdCreateTime(Integer id);
+	
 }

+ 36 - 7
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/by/ByApplyServiceImpl.java

@@ -34,7 +34,9 @@ import com.itextpdf.layout.property.AreaBreakType;
 import com.itextpdf.layout.property.TextAlignment;
 import com.itextpdf.layout.property.VerticalAlignment;
 
+import cn.hmsoft.frame.data.model.FrameParam;
 import cn.hmsoft.frame.exception.web.BusinessException;
+import cn.hmsoft.frame.service.IFrameParamService;
 import cn.hmsoft.frame.util.FrameAssertUtil;
 import cn.hmsoft.frame.util.FrameDictUtil;
 import cn.hmsoft.helper.JsonHelper;
@@ -131,6 +133,8 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 	private PlStdRecordDao  plStdRecordDao;
 	@Autowired
 	private PlExamTimeDao  plExamTimeDao;
+	@Autowired
+    private IFrameParamService frameParamService;
 	
 	
 	 @Autowired
@@ -460,6 +464,12 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 		
 		// 如果是修改重新提交,则更新毕业成绩;如果是确认有误重新提交不修改毕业成绩(审核机构已经更新过成绩,不能更新成绩)
 		if(StringUtils.isEmpty(byApply.getStd_confirm())){
+			// 校验考生当前专业是否已经毕业
+			List<ByApply> byList = this.byApplyDao.queryIsAlreadyBy(byApply.getStd_id(),byApply.getMajor_id());
+			if(null != byList && !byList.isEmpty()){
+				throw new BusinessException("当前账号(或账号对应的证件号),当前专业(或专业对应的旧专业)已经存在审核通过的毕业申请单,不允许再次申请毕业。");
+			}
+			
 			// 删除毕业成绩
 			this.byScoreService.deleteByScoreByApplyId(byApply);
 			// 新增毕业成绩表
@@ -467,6 +477,12 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 		} else {
 			// 考生确认时,如果专业有修改,则更新毕业成绩
 			if (null != dbApply && dbApply.getMajor_id().intValue() != byApply.getMajor_id().intValue()) {
+				// 校验考生当前专业是否已经毕业
+				List<ByApply> byList = this.byApplyDao.queryIsAlreadyBy(byApply.getStd_id(),byApply.getMajor_id());
+				if(null != byList && !byList.isEmpty()){
+					throw new BusinessException("当前账号(或账号对应的证件号),当前专业(或专业对应的旧专业)已经存在审核通过的毕业申请单,不允许再次申请毕业。");
+				}
+				
 				// 删除毕业成绩
 				this.byScoreService.deleteByScoreByApplyId(byApply);
 				// 新增毕业成绩表
@@ -477,6 +493,12 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 	}
 	
 	private void checkApplyInfo(ByApply byApply) {
+		// 校验考生当前专业是否已经毕业
+		List<ByApply> byList = this.byApplyDao.queryIsAlreadyBy(byApply.getStd_id(),byApply.getMajor_id());
+		if(null != byList && !byList.isEmpty()){
+			throw new BusinessException("当前账号(或账号对应的证件号),当前专业(或专业对应的旧专业)已经存在审核通过的毕业申请单,不允许再次申请毕业。");
+		}
+		
 		Map<String, Object> paramMap = new HashMap<String, Object>();
 		paramMap.put("std_id", byApply.getStd_id());
 		paramMap.put("exam_time_id", byApply.getExam_time_id());
@@ -498,20 +520,27 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 	public List<ByApply> ListAll(Integer std_id,Integer exam_time_id) {
 		List<ByApply> list = this.byApplyDao.listAll(std_id,exam_time_id);
 		
+		// 获取开关
+		FrameParam loginParam = this.frameParamService.find(FrameParam.class, "param_name", "not_show_by_status");
+
+					
 		// 20211215梁有日,考试院审核状态,不允许给考生看到
 		for (ByApply by : list) {
 			//20230705 不管之前的要求,待发放和不通过展示原状态而不再展示待终审
 			// 20231221 青玲待自治区招生考试院终审、待发放状态展示为待终审
 			// 待自治区招生考试院终审、待发放状态展示为待终审
-			if (2 == by.getStatus().intValue() || 3 == by.getStatus().intValue()) {
-				by.setStatus_text("待终审");
-			}
+			if (null != loginParam && "Active".equals(loginParam.getProtect_status())) {
+				if (2 == by.getStatus().intValue() || 3 == by.getStatus().intValue()) {
+					by.setStatus_text("待终审");
+				}
 
-			// 不通过状态,如果未过期,展示待终审,如果已过期展示不通过
-			if (6 == by.getStatus().intValue() && StringUtils.isEmpty(by.getTime_out())) {
-				by.setStatus_text("待终审");
+				// 不通过状态,如果未过期,展示待终审,如果已过期展示不通过
+				if (6 == by.getStatus().intValue() && StringUtils.isEmpty(by.getTime_out())) {
+					by.setStatus_text("待终审");
+				}
 			}
 			
+			
 			// 状态是新建且驳回时,状态显示驳回
 			if(null != by.getIs_auth_back() && by.getIs_auth_back().intValue()==1 && 0 == by.getStatus().intValue()){
 				by.setStatus_text("驳回");
@@ -1131,7 +1160,7 @@ public class ByApplyServiceImpl extends BaseServiceImpl<ByApply> implements IByA
 			// 地级市自考办 审核
 			final Table table2 = new Table(new float[] { 23, 470 }).setWidthPercent(100);
 			table2.setMarginLeft(35).setMarginRight(35);
-			table2.addCell(new Cell(2, 1).add("设区市自考办︵助学院校︶意见").setHeight(CELL_HEIGHT * 6)
+			table2.addCell(new Cell(2, 1).add("初审单位意见").setHeight(CELL_HEIGHT * 6)
 					.setTextAlignment(TextAlignment.CENTER).setVerticalAlignment(VerticalAlignment.MIDDLE)
 					.setBorderLeft(new SolidBorder(0.8f)).setFontSize(nomalSize));
 			table2.addCell(new Cell(1, 1)

+ 5 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlCourseServiceImpl.java

@@ -37,4 +37,9 @@ public class PlCourseServiceImpl extends BaseServiceImpl<PlCourse> implements IP
 	public List<PlCourse> listCourse(String query) {
 		return plCourseDao.listCourseByQuery(query);
 	}
+	
+	@Override
+	public PlCourse findCourseLimit(Integer course_id){
+		return this.plCourseDao.findCourseLimit(course_id);
+	}
 }

+ 4 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlExamAreaCourseServiceImpl.java

@@ -141,4 +141,8 @@ public class PlExamAreaCourseServiceImpl extends BaseServiceImpl<PlExamAreaCours
 		}
 		return org_ids;
 	}
+	@Override
+	public PlExamAreaCourse queryCourseCalculator(Integer course_id) {
+		return this.plExamAreaCourseDao.queryCourseCalculator(course_id);
+	}
 }

+ 6 - 11
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMajorCourseServiceImpl.java

@@ -9,16 +9,12 @@ import org.springframework.stereotype.Service;
 
 import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.ses.constants.CourseConst.CourseNatureEnum;
-import cn.hmsoft.ses.constants.CourseConst.CourseTypeEnum;
 import cn.hmsoft.ses.data.dao.pl.PlCourseTextbookDao;
 import cn.hmsoft.ses.data.dao.pl.PlMajorCourseDao;
 import cn.hmsoft.ses.data.dao.pl.PlMajorDao;
 import cn.hmsoft.ses.data.dao.std.StdEnrolDao;
-import cn.hmsoft.ses.data.model.pl.PlCourseTextbook;
-import cn.hmsoft.ses.data.model.pl.PlCourseTextbookLog;
 import cn.hmsoft.ses.data.model.pl.PlMajor;
 import cn.hmsoft.ses.data.model.pl.PlMajorCourse;
-import cn.hmsoft.ses.data.model.pl.PlTextbook;
 import cn.hmsoft.ses.data.model.std.StdEnrol;
 import cn.hmsoft.ses.helper.YearCodeHelper;
 import cn.hmsoft.ses.service.iface.pl.IPlMajorCourseService;
@@ -87,6 +83,10 @@ public class PlMajorCourseServiceImpl extends BaseServiceImpl<PlMajorCourse> imp
 		return this.plMajorCourseDao.findMajorByCourse(major_id, course_id);
 	}	
 	
+	@Override
+	public PlMajorCourse findCourseForSelectedExam(Integer course_id) {
+		return this.plMajorCourseDao.findCourseForSelectedExam(course_id);
+	}	
 	
 	@Override
 	public List<Map<String, Object>> listMajorFullCourse(Integer major_id) {
@@ -126,13 +126,8 @@ public class PlMajorCourseServiceImpl extends BaseServiceImpl<PlMajorCourse> imp
 
 	@Override
 	public List<Map<String,Object>> listCourseTextbook(Integer course_id) {
-		//先根据当前批次查询是否有大于等于当前批次的教材
-		//List<Map<String,Object>> tempList = this.CourseTextbookDao.listTextBookCourseByYearCode(course_id, YearCodeHelper.getCurrentYearCode());
-		
-		// 没有大于等于当前批次的教材,查询202001批次以后,取最新的教材,只取一条最新的记录
-		//if(null == tempList || tempList.isEmpty()){
-		List<Map<String,Object>> tempList = this.CourseTextbookDao.listTextBookCourse(course_id, "202001");
-		//}
+		List<Map<String,Object>> tempList = this.CourseTextbookDao.listTextBookCourse(course_id);
+	
 		return tempList;
 	}
 

+ 0 - 88
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMajorServiceImpl.java

@@ -1,30 +1,16 @@
 package cn.hmsoft.ses.service.impl.pl;
 
-import java.io.File;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.itextpdf.layout.Document;
-import com.itextpdf.layout.element.Cell;
-import com.itextpdf.layout.element.Paragraph;
-import com.itextpdf.layout.element.Table;
-import com.itextpdf.layout.property.TextAlignment;
-import com.itextpdf.layout.property.VerticalAlignment;
-
-import cn.hmsoft.frame.exception.web.BusinessException;
-import cn.hmsoft.helper.LogHelper;
 import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.jdbc.entity.Pager;
-import cn.hmsoft.office.pdf.ItextDocumentModel;
-import cn.hmsoft.office.pdf.ItextPdfHelper;
 import cn.hmsoft.ses.data.dao.pl.PlMajorDao;
 import cn.hmsoft.ses.data.model.pl.PlMajor;
 import cn.hmsoft.ses.service.iface.pl.IPlMajorService;
-import cn.hmsoft.ses.util.StudyFileHelper;
 import cn.hmsoft.web.service.impl.BaseServiceImpl;
 
 /**
@@ -74,80 +60,6 @@ public class PlMajorServiceImpl extends BaseServiceImpl<PlMajor> implements IPlM
 		return this.plMajorDao.listMajor(ids);
 	}
 	
-	@Override
-	public List<PlMajor> findCourseAndBook(Integer id) {
-		return this.plMajorDao.findCourseAndBook(id);
-	}
-
-	/**
-	 * 专业课程--导出PDF
-	 */
-	@Override
-	public File makeCourseBook(String[] ids) {
-		Document doc = null;
-		if (ids == null) {
-			ids = this.plMajorDao.listMajorIds();
-		}
-		try {
-			File tempFile = StudyFileHelper.createTempFile();
-			ItextDocumentModel model = new ItextDocumentModel();
-			model.rotate();
-			doc = model.prepareDocument(tempFile);
-			for (String id : ids) {
-				List<PlMajor> list = this.plMajorDao.findCourseAndBook(Integer.parseInt(id));
-				if (list != null && list.size() > 0) {
-					// 1、专业标题信息
-					Paragraph majorName = new Paragraph(list.get(0).getMajor_name()).setFontSize(20).setBold()
-							.setTextAlignment(TextAlignment.CENTER);
-					Paragraph majorCode = new Paragraph("专业代码:" + list.get(0).getMajor_code()).setFontSize(15)
-							.setTextAlignment(TextAlignment.CENTER);
-					doc.add(majorName);
-					doc.add(majorCode);
-
-					// 2、表头信息
-					Table table = new Table(new float[] { 0.8f, 1f, 0.6f, 1f, 0.8f, 0.6f }).setWidthPercent(100)
-							.setBorder(null);
-					table.addCell(new Cell().add("课程代码").setTextAlignment(TextAlignment.CENTER)
-							.setVerticalAlignment(VerticalAlignment.MIDDLE))
-							.addCell(new Cell().add("课程名称").setTextAlignment(TextAlignment.CENTER)
-									.setVerticalAlignment(VerticalAlignment.MIDDLE))
-							.addCell(new Cell().add("学分").setTextAlignment(TextAlignment.CENTER)
-									.setVerticalAlignment(VerticalAlignment.MIDDLE))
-							.addCell(new Cell().add("教材名称").setTextAlignment(TextAlignment.CENTER)
-									.setVerticalAlignment(VerticalAlignment.MIDDLE))
-							.addCell(new Cell().add("出版社").setTextAlignment(TextAlignment.CENTER)
-									.setVerticalAlignment(VerticalAlignment.MIDDLE))
-							.addCell(new Cell().add("版次").setTextAlignment(TextAlignment.CENTER)
-									.setVerticalAlignment(VerticalAlignment.MIDDLE));
-					for (PlMajor plMajor : list) {
-						// 3、表数据
-						table.addCell(new Cell(1, 1).add(plMajor.getCourse_code())
-								.setVerticalAlignment(VerticalAlignment.MIDDLE));
-						table.addCell(new Cell(1, 1).add(plMajor.getCourse_name())
-								.setVerticalAlignment(VerticalAlignment.MIDDLE));
-						table.addCell(
-								new Cell(1, 1).add(plMajor.getCourse_score() == null ? "" : plMajor.getCourse_code())
-										.setVerticalAlignment(VerticalAlignment.MIDDLE));
-						table.addCell(
-								new Cell(1, 1).add(plMajor.getTextbook_name() == null ? "" : plMajor.getTextbook_name())
-										.setVerticalAlignment(VerticalAlignment.MIDDLE));
-						table.addCell(new Cell(1, 1)
-								.add(plMajor.getTextbook_publisher() == null ? "" : plMajor.getTextbook_publisher())
-								.setVerticalAlignment(VerticalAlignment.MIDDLE));
-						table.addCell(new Cell(1, 1)
-								.add(plMajor.getTextbook_revision() == null ? "" : plMajor.getTextbook_revision())
-								.setVerticalAlignment(VerticalAlignment.MIDDLE));
-					}
-					doc.add(table);
-				}
-			}
-			ItextPdfHelper.closePdf(doc);
-			return tempFile;
-		} catch (Exception e) {
-			LogHelper.error(e);
-			throw new BusinessException("无法生成pdf文件,请联系系统管理员");
-		}
-	}
 
 	@Override
 	public PlMajor findMajor(Integer id) {

+ 51 - 4
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/pl/PlMergePublishPlanServiceImpl.java

@@ -45,10 +45,12 @@ public class PlMergePublishPlanServiceImpl extends BaseServiceImpl<PlMergePublis
 	@Override
 	public Map<String, List<PlCourse>> listPublishCouse(Integer major_id,Integer exam_time_id, Integer flag) {
 		LinkedHashMap<String, List<PlCourse>> map = new LinkedHashMap<>();
-		String currentYearCode = YearCodeHelper.getCurrentYearCode();
+		String currentYearCode = null;
 		if (!StringUtils.isEmpty(exam_time_id)) {
 			PlExamTime plExamTime = this.plExamTimeDao.find(exam_time_id);
 			currentYearCode = String.valueOf(plExamTime.getYear_code());
+		}else{
+			currentYearCode = YearCodeHelper.getCurrentYearCode();
 		}
 		
 		List<PlMergePublishPlan> list = this.mergePublishPlanDao.getExamDate(currentYearCode, null);
@@ -56,25 +58,70 @@ public class PlMergePublishPlanServiceImpl extends BaseServiceImpl<PlMergePublis
 			// 查找课程
 			String key = getDateTime(plan.getFull_exam_date());
 			List<PlCourse> listPublishCouse = this.mergePublishPlanDao.listPublishCouse2(plan.getExam_time(), major_id, flag, currentYearCode);
-			listPublishCouse = this.mergePublishPlanDao.getCourseTextBook(listPublishCouse,currentYearCode);
+			listPublishCouse = this.mergePublishPlanDao.getCourseTextBook(listPublishCouse, exam_time_id);
 			
 			map.put(key,listPublishCouse);
 		}
 		return map;
 	}
 	
+	
+	/**
+	 * 选考课程查询考试计划
+	 */
+	@Override
+	public Map<String, List<PlCourse>> listPublishCouseForSelected(Integer exam_time_id) {
+		LinkedHashMap<String, List<PlCourse>> map = new LinkedHashMap<>();
+		String currentYearCode = null;
+		if (!StringUtils.isEmpty(exam_time_id)) {
+			PlExamTime plExamTime = this.plExamTimeDao.find(exam_time_id);
+			currentYearCode = String.valueOf(plExamTime.getYear_code());
+		}else{
+			currentYearCode = YearCodeHelper.getCurrentYearCode();
+		}
+		
+		List<PlMergePublishPlan> list = this.mergePublishPlanDao.getExamDate(currentYearCode, null);
+		for (PlMergePublishPlan plan : list) {
+			// 查找课程
+			String key = getDateTime(plan.getFull_exam_date());
+			List<PlCourse> listPublishCouse = this.mergePublishPlanDao.listPublishCouseForSelected(plan.getExam_time(), currentYearCode);
+			listPublishCouse = this.mergePublishPlanDao.getCourseTextBook(listPublishCouse, exam_time_id);
+			
+			map.put(key,listPublishCouse);
+		}
+		return map;
+	}
+	
+	
+	
 	@Override
 	public Map<String, List<PlCourse>> listPublishCouse(Integer major_id, Integer flag) {
 		LinkedHashMap<String, List<PlCourse>> map = new LinkedHashMap<>();
-		List<PlMergePublishPlan> list = this.mergePublishPlanDao.getExamDate(YearCodeHelper.getCurrentYearCode(), null);
+		String year_code = YearCodeHelper.getCurrentYearCode();
+		List<PlMergePublishPlan> list = this.mergePublishPlanDao.getExamDate(year_code, null);
+		for (PlMergePublishPlan plan : list) {
+			// 查找课程
+			map.put(getDateTime(plan.getFull_exam_date()),
+			this.mergePublishPlanDao.listPublishCouse(plan.getExam_time(), major_id, flag, year_code));
+		}
+		return map;
+	}
+	
+	@Override
+	public Map<String, List<PlCourse>> listPublishCouseForSelectedExam(Integer major_id) {
+		LinkedHashMap<String, List<PlCourse>> map = new LinkedHashMap<>();
+		String year_code = YearCodeHelper.getCurrentYearCode();
+		List<PlMergePublishPlan> list = this.mergePublishPlanDao.getExamDate(year_code, null);
 		for (PlMergePublishPlan plan : list) {
 			// 查找课程
 			map.put(getDateTime(plan.getFull_exam_date()),
-			this.mergePublishPlanDao.listPublishCouse(plan.getExam_time(), major_id, flag, YearCodeHelper.getCurrentYearCode()));
+			this.mergePublishPlanDao.listPublishCouseForSelectedExam(plan.getExam_time(), major_id, year_code));
 		}
 		return map;
 	}
 	
+	
+	
 	private String getDateTime(String full_exam_date) {
 		String date = "";
 		if (full_exam_date.contains("A")) {

+ 15 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdBreakDisciplineServiceImpl.java

@@ -10,7 +10,9 @@ import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.jdbc.entity.Pager;
 import cn.hmsoft.ses.common.StdConst.StdDisciplineRuLe;
 import cn.hmsoft.ses.data.dao.std.StdBreakDisciplineDao;
+import cn.hmsoft.ses.data.dao.std.StdBreakDisciplineFileDao;
 import cn.hmsoft.ses.data.model.std.StdBreakDiscipline;
+import cn.hmsoft.ses.data.model.std.StdBreakDisciplineFile;
 import cn.hmsoft.ses.helper.YearCodeHelper;
 import cn.hmsoft.ses.service.iface.std.IStdBreakDisciplineService;
 import cn.hmsoft.web.service.impl.BaseServiceImpl;
@@ -29,6 +31,8 @@ public class StdBreakDisciplineServiceImpl extends BaseServiceImpl<StdBreakDisci
 
 	@Autowired
 	private StdBreakDisciplineDao stdBreakDisciplineDao;
+	@Autowired
+	private StdBreakDisciplineFileDao stdBreakDisciplineFileDao;
 	
 	@Override
 	public PlatformDaoSupport<StdBreakDiscipline> getDao() {
@@ -156,4 +160,15 @@ public class StdBreakDisciplineServiceImpl extends BaseServiceImpl<StdBreakDisci
 	public List<StdBreakDiscipline> listBystd(String ticket_no) {
 		return this.stdBreakDisciplineDao.listBystd(ticket_no);
 	}
+
+	@Override
+	public List<StdBreakDisciplineFile> queryStdBreakDisciplineFile(String ticket_no) {
+		return this.stdBreakDisciplineFileDao.queryStdBreakDisciplineFile(ticket_no);
+	}
+
+	@Override
+	public StdBreakDisciplineFile queryStdBreakDisciplineFile(String ticket_no, Integer exam_time_id,
+			String file_type) {
+		return this.stdBreakDisciplineFileDao.queryStdBreakDisciplineFile(ticket_no, exam_time_id, file_type);
+	}	
 }

+ 16 - 0
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdEnrolServiceImpl.java

@@ -25,6 +25,7 @@ import cn.hmsoft.ses.data.dao.pl.PlMajorDao;
 import cn.hmsoft.ses.data.dao.pl.PlMergePublishPlanDao;
 import cn.hmsoft.ses.data.dao.std.StdEnrolDao;
 import cn.hmsoft.ses.data.dao.std.StdEnrolLogDao;
+import cn.hmsoft.ses.data.dao.std.StdRegInfoDao;
 import cn.hmsoft.ses.data.model.cf.CfFeeScale;
 import cn.hmsoft.ses.data.model.cf.CfOrganization;
 import cn.hmsoft.ses.data.model.pl.PlCourse;
@@ -35,6 +36,7 @@ import cn.hmsoft.ses.data.model.std.StdDownTicket;
 import cn.hmsoft.ses.data.model.std.StdEnrol;
 import cn.hmsoft.ses.data.model.std.StdEnrolLog;
 import cn.hmsoft.ses.data.model.std.StdRegInfo;
+import cn.hmsoft.ses.helper.DateHelper;
 import cn.hmsoft.ses.helper.YearCodeHelper;
 import cn.hmsoft.ses.service.iface.cf.ICfOrganizationService;
 import cn.hmsoft.ses.service.iface.pl.IPlExamAreaCourseService;
@@ -110,6 +112,8 @@ public class StdEnrolServiceImpl extends BaseServiceImpl<StdEnrol> implements IS
 	private PlExamTimeDao plExamTimeDao;
 	@Autowired
    	private IPlExamAreaCourseService plExamAreaCourseService;
+	@Autowired
+	private StdRegInfoDao stdRegInfoDao;
 	  
 
 	@Override
@@ -177,6 +181,18 @@ public class StdEnrolServiceImpl extends BaseServiceImpl<StdEnrol> implements IS
 			}
 		}
 		
+		// 获取考生注册时间
+		StdRegInfo temp_dbStd = this.stdRegInfoDao.queryStdCreateTime(dbStd.getId());
+		LocalDateTime date = DateHelper.parseDateTime("2024-07-01 00:00:00");
+		// 2024年7月1号停考的专业下面的课程(其他还在开考的专业没有这些课程,且这些课程不在选考课程之内https://www.gxeea.cn/view/content_1148_15806.htm),
+		// 如果是2024年7月1日以后新注册的考生不允许报考缴费这些课程
+		if(null != temp_dbStd && null != temp_dbStd.getCreate_time() && temp_dbStd.getCreate_time().isAfter(date)){
+			PlCourse plCourse = this.courseDao.findCourseLimit(courseId);
+			if(null != plCourse){
+				throw new BusinessException("2024年7月1日以后新注册的考生不允许报考课程【"+plCourse.getCourse_code()+"-"+plCourse.getCourse_name()+"】。");
+			}
+		}
+		
 		
 		// 跨市修改考区,同一天的其他课程的考区也一起修改
 		if (null != otherCity && otherCity.intValue() == 1) {

+ 16 - 1
ses-enrol/src/main/java/cn/hmsoft/ses/service/impl/std/StdRegInfoServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hmsoft.helper.StringHelper;
 import cn.hmsoft.jdbc.core.PlatformDaoSupport;
 import cn.hmsoft.jdbc.entity.Pager;
 import cn.hmsoft.ses.constants.StdConst.OperType;
+import cn.hmsoft.ses.control.util.FrameIdCardUtil;
 import cn.hmsoft.ses.constants.SysConst;
 import cn.hmsoft.ses.data.dao.cf.CfOrganizationDao;
 import cn.hmsoft.ses.data.dao.std.StdRegInfoDao;
@@ -289,15 +290,24 @@ public class StdRegInfoServiceImpl extends BaseServiceImpl<StdRegInfo> implement
 
 	@Override
 	public void save(StdRegInfo stdRegInfo) {
+		// 20241015 注册时如果地市区县填写且存在,且是身份证注册的账号,则生成准考证号
+		if (StringUtils.isEmpty(stdRegInfo.getTicket_no()) && !StringUtils.isEmpty(stdRegInfo.getStd_city())
+				&& !StringUtils.isEmpty(stdRegInfo.getStd_county())) {
+			if (stdRegInfo.getCert_type() == 1 && FrameIdCardUtil.validateIdCard18(stdRegInfo.getCert_no())) {
+				stdRegInfo.setTicket_no(this.getTicketNoByCity(stdRegInfo));
+			}
+		}
+		
 		// 加密考生敏感信息
 		this.EncryptStd(stdRegInfo);
 		
-		
 	   Integer id = this.insert(stdRegInfo);
 	   
 	   // 处理生僻字
 	   this.stdRegInfoDao.updateStdNameById(stdRegInfo.getStd_name(), id);
 	   
+				
+	   
        //添加日志
        this.regLogService.insertStdRegLog(stdRegInfo, OperType.ADD.ordinal());
 	}
@@ -591,5 +601,10 @@ public class StdRegInfoServiceImpl extends BaseServiceImpl<StdRegInfo> implement
 			LogHelper.error(e);
 		}
 	}
+	
+	@Override
+	public StdRegInfo queryStdCreateTime(Integer id){
+		return this.stdRegInfoDao.queryStdCreateTime(id);
+	}
 
 }

+ 6 - 0
ses-enrol/src/main/java/cn/hmsoft/web/filter/LoginFilter.java

@@ -76,6 +76,12 @@ public class LoginFilter implements Filter {
 		allowedUrls.add("/std/sendSmsForReg.htm");
 		allowedUrls.add("/std/stdRegInfo/regForApp.htm");
 		allowedUrls.add("/std/loginForAuthentication.htm");
+		allowedUrls.add("/std/loginForAuthenticationMode.htm");
+		
+		allowedUrls.add("/std/stdRegInfo/queryCity.htm");
+		allowedUrls.add("/std/stdRegInfo/queryCityCounty.htm");
+
+
 		allowedUrls.add("/app/update.htm");
 		allowedUrls.add("/sys/sysAppNews/page.htm");
 		allowedUrls.add("/sys/sysAppServe/page.htm");

BIN=BIN
ses-enrol/src/main/webapp/WEB-INF/lib/hmsoft-web-1.0.jar