|
@@ -0,0 +1,473 @@
|
|
|
+package cn.hmsoft.mr.control.review;
|
|
|
+
|
|
|
+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;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import cn.hmsoft.application.web.Ajax;
|
|
|
+import cn.hmsoft.frame.control.FrameControl;
|
|
|
+import cn.hmsoft.frame.data.model.FrameDept;
|
|
|
+import cn.hmsoft.frame.data.model.FrameOptr;
|
|
|
+import cn.hmsoft.frame.exception.BusinessException;
|
|
|
+import cn.hmsoft.helper.LocalDateHelper;
|
|
|
+import cn.hmsoft.helper.StringHelper;
|
|
|
+import cn.hmsoft.jdbc.entity.Pager;
|
|
|
+import cn.hmsoft.log.LogHelper;
|
|
|
+import cn.hmsoft.mr.constants.FrameResIdConst;
|
|
|
+import cn.hmsoft.mr.constants.GobalBusinessType;
|
|
|
+import cn.hmsoft.mr.constants.MRConst;
|
|
|
+import cn.hmsoft.mr.constants.MRConst.ApplyStatus;
|
|
|
+import cn.hmsoft.mr.data.dao.cf.CfBatchDao;
|
|
|
+import cn.hmsoft.mr.data.dao.std.StdApplyDetailDao;
|
|
|
+import cn.hmsoft.mr.data.model.cf.CfAspect;
|
|
|
+import cn.hmsoft.mr.data.model.cf.CfAspectOptr;
|
|
|
+import cn.hmsoft.mr.data.model.cf.CfBatch;
|
|
|
+import cn.hmsoft.mr.data.model.cf.CfSchool;
|
|
|
+import cn.hmsoft.mr.data.model.review.ReviewSign;
|
|
|
+import cn.hmsoft.mr.data.model.std.StdApplyMain;
|
|
|
+import cn.hmsoft.mr.enrol.helper.ArtWeixinHelper;
|
|
|
+import cn.hmsoft.mr.service.review.ProfesReviewService;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 专业评审控制器.
|
|
|
+ * @author zq
|
|
|
+ *
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+public class ProfesReviewControl extends FrameControl {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ProfesReviewService pService;
|
|
|
+ @Autowired
|
|
|
+ private StdApplyDetailDao dDao;
|
|
|
+ @Autowired
|
|
|
+ private CfBatchDao bDao;
|
|
|
+
|
|
|
+ @RequestMapping("final/review/rank/list.htm")
|
|
|
+ public Ajax rankList(Integer batch_id, Integer aspect_id) {
|
|
|
+ CfBatch batch = this.bDao.find(batch_id);
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ batch.getSchool_id(), batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号。");
|
|
|
+ }
|
|
|
+ if (aspect_id == null) {
|
|
|
+ aspect_id = aspOptr.getAspect_id();
|
|
|
+ }
|
|
|
+ return new Ajax(this.getRankListt(batch_id, aspect_id));
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<Map<String, Object>> getRankListt(Integer batch_id, Integer aspect_id) {
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select m.review_level,m.review_score,s.std_name,m.apply_id,s.std_id,s.std_edu,s.std_image,m.aspect_id,m.batch_id ");
|
|
|
+ sql.append("from std_apply_main m,std_reg s ");
|
|
|
+ sql.append("where m.batch_id=? and m.aspect_id=? and m.std_id=s.std_id and m.school_id=s.school_id and m.review_level is not null ");
|
|
|
+ sql.append("order by m.review_level ");
|
|
|
+ return this.dDao.listMapBySql(sql.toString(), batch_id, aspect_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下一个考生
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/std/next/total.htm")
|
|
|
+ public Ajax nextStd(String click_from, Integer main_id, Integer batch_id, String status, String query) {
|
|
|
+ if (StringHelper.isEmpty(status)) {
|
|
|
+ status = ApplyStatus.InitialAppr.toString();
|
|
|
+ }
|
|
|
+ StdApplyMain main = this.getNextStdMain(main_id, batch_id, status, query);
|
|
|
+ if (main == null) {
|
|
|
+ if (StringHelper.isNotEmpty(click_from) && click_from.equals("next")) {
|
|
|
+ main = this.getNextStdMain(null, batch_id, status, query);//从头开始取没评审的
|
|
|
+ } else {
|
|
|
+ //评审完成
|
|
|
+ new Ajax();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new Ajax(main);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 左边排名点击查询当前考生
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/std/curr/total.htm")
|
|
|
+ public Ajax currStd(Integer main_id, Integer batch_id) {
|
|
|
+ FrameDept org = this.dDao.find(FrameDept.class, this.getFrameOptr().getOptr_dept());
|
|
|
+ if (!org.getDept_type().equals(MRConst.OrgType.School.toString())) {
|
|
|
+ LogHelper.warn("当前登录[" + this.getFrameOptr().getLogin_name() + "]不是学校账号。");
|
|
|
+ }
|
|
|
+ StdApplyMain stdMain = null;
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select m.*,s.std_name,f.aspect_name,s.std_edu,s.std_image,e.exam_id from std_apply_main m ");
|
|
|
+ sql.append("left join std_reg s on m.std_id=s.std_id and m.school_id=s.school_id ");
|
|
|
+ sql.append("left join std_enrol e on m.std_id=e.std_id and m.aspect_id=e.aspect_id ");
|
|
|
+ sql.append("left join cf_aspect f on f.aspect_id=m.aspect_id and f.school_id=m.school_id and f.batch_id=m.batch_id ");
|
|
|
+ sql.append("where m.apply_id=? ");
|
|
|
+ sql.append("order by m.auth_time desc ");
|
|
|
+ stdMain = this.dDao.findBySql(StdApplyMain.class, sql.toString(), main_id);
|
|
|
+ return new Ajax(stdMain);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 初审通过的考生
|
|
|
+ * 下一个待审核考生上传分页
|
|
|
+ * @param query : 查询条件
|
|
|
+ * @param batch_id: 批次ID
|
|
|
+ * @param status: 状态
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/std/next/page.htm")
|
|
|
+ public Ajax pageFinalStd(String query, Integer start, Integer limit, String order, String type,
|
|
|
+ String click_from, Integer main_id, Integer batch_id, String status) {
|
|
|
+ FrameDept org = this.dDao.find(FrameDept.class, this.getFrameOptr().getOptr_dept());
|
|
|
+ if (!org.getDept_type().equals(MRConst.OrgType.School.toString())) {
|
|
|
+ LogHelper.warn("当前登录[" + this.getFrameOptr().getLogin_name() + "]不是学校账号。");
|
|
|
+ return new Ajax(new Pager());
|
|
|
+ }
|
|
|
+ CfSchool school = this.dDao.findBySql(CfSchool.class, "select * from cf_school where school_code=? and dept_id=?",
|
|
|
+ org.getDept_code(), org.getDept_id());
|
|
|
+ Integer school_id = school.getSchool_id();
|
|
|
+ //默认查询未评审的考生
|
|
|
+ if (StringHelper.isEmpty(click_from) && main_id == null) {
|
|
|
+ //前端没指定就取下一个待专业评审的考生
|
|
|
+ StdApplyMain main = this.getNextStdMain(main_id, batch_id, ApplyStatus.InitialAppr.toString(), query);
|
|
|
+ if (main == null) {//所有考生评审完后 返回 null
|
|
|
+ return new Ajax(new Pager());
|
|
|
+ } else {
|
|
|
+ main_id = main.getApply_id();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (click_from.equals("left")) {//排名点击查询
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select m.*,s.std_name,f.aspect_name,s.std_edu,e.exam_id from std_apply_main m ");
|
|
|
+ sql.append("left join std_reg s on m.std_id=s.std_id and m.school_id=s.school_id ");
|
|
|
+ sql.append("left join std_enrol e on m.std_id=e.std_id and m.aspect_id=e.aspect_id ");
|
|
|
+ sql.append("left join cf_aspect f on f.aspect_id=m.aspect_id and f.school_id=m.school_id and f.batch_id=m.batch_id ");
|
|
|
+ sql.append("where m.apply_id=? ");
|
|
|
+ sql.append("order by m.auth_time desc ");
|
|
|
+ StdApplyMain main = this.dDao.findBySql(StdApplyMain.class, sql.toString(), main_id);
|
|
|
+ main_id = main.getApply_id();
|
|
|
+ }/* else if (click_from.equals("next")) {//右边点击下一个
|
|
|
+ StdApplyMain main = this.getNextStdMain(main_id, batch_id, ApplyStatus.InitialAppr.toString(), query);
|
|
|
+ if (main == null) {//最后一个后 不存在,从第一个开始
|
|
|
+ main_id = null;
|
|
|
+ main = this.getNextStdMain(main_id, batch_id, ApplyStatus.InitialAppr.toString(), query);
|
|
|
+ } else {
|
|
|
+ main_id = main.getApply_id();
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ Pager p = this.dDao.pageFinalStdPage(start, limit, query, getQueryOrder(order, type),
|
|
|
+ main_id, school_id, batch_id, status);
|
|
|
+ return new Ajax(p);
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取下一个考生的主记录
|
|
|
+ private StdApplyMain getNextStdMain(Integer main_id, Integer batch_id, String status, String query) {
|
|
|
+ FrameDept org = this.dDao.find(FrameDept.class, this.getFrameOptr().getOptr_dept());
|
|
|
+ if (!org.getDept_type().equals(MRConst.OrgType.School.toString())) {
|
|
|
+ LogHelper.warn("当前登录[" + this.getFrameOptr().getLogin_name() + "]不是学校账号!");
|
|
|
+ }
|
|
|
+ StdApplyMain stdMain = null;
|
|
|
+ CfSchool school = this.dDao.findBySql(CfSchool.class, "select * from cf_school where school_code=? and dept_id=?",
|
|
|
+ org.getDept_code(), org.getDept_id());
|
|
|
+ Integer school_id = school.getSchool_id();
|
|
|
+ //前端没指定就取下一个没评审的考生
|
|
|
+ //TODO 如果评审老师可以评多专业 界面就要让老师选
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ school_id, batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号。");
|
|
|
+ }
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select m.*,s.std_name,f.aspect_name,s.std_edu,s.std_image,e.exam_id from std_apply_main m ");
|
|
|
+ sql.append("left join std_reg s on m.std_id=s.std_id and m.school_id=s.school_id ");
|
|
|
+ sql.append("left join std_enrol e on m.std_id=e.std_id and m.aspect_id=e.aspect_id ");
|
|
|
+ sql.append("left join cf_aspect f on f.aspect_id=m.aspect_id and f.school_id=m.school_id and f.batch_id=m.batch_id ");
|
|
|
+ sql.append("where m.school_id=? and m.batch_id=? and m.aspect_id=? and m.status=? and m.review_level is null ");
|
|
|
+
|
|
|
+ if (main_id != null) {//强制当前考生的下一个
|
|
|
+ StdApplyMain cur = this.dDao.find(StdApplyMain.class, main_id);
|
|
|
+ if (cur.getReview_level() == null) {
|
|
|
+ sql.append(" and m.apply_id != ? and m.auth_time <= ? ");
|
|
|
+ if (StringHelper.isNotEmpty(query)) {
|
|
|
+ String value = "'%" + query.trim() + "%'";
|
|
|
+ sql.append(" and (s.std_name like " + value + " or e.exam_id like " + value + " or s.cert_id like " + value + ") ");
|
|
|
+ }
|
|
|
+ sql.append("order by m.auth_time desc ");
|
|
|
+ stdMain = this.dDao.findBySql(StdApplyMain.class,
|
|
|
+ sql.toString(), school_id, batch_id, aspOptr.getAspect_id(), status, cur.getApply_id(), cur.getAuth_time());
|
|
|
+ return stdMain;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //未评审的 默认取第一个
|
|
|
+ if (StringHelper.isNotEmpty(query)) {
|
|
|
+ String value = "'%" + query.trim() + "%'";
|
|
|
+ sql.append(" and (s.std_name like " + value + " or e.exam_id like " + value + " or s.cert_id like " + value + ") ");
|
|
|
+ }
|
|
|
+ sql.append("order by m.auth_time desc ");
|
|
|
+ stdMain = this.dDao.findBySql(StdApplyMain.class,
|
|
|
+ sql.toString(), school_id, batch_id, aspOptr.getAspect_id(), status);
|
|
|
+ return stdMain;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("final/review/progress/info.htm")
|
|
|
+ public Ajax progressInfo(Integer batch_id, Integer aspect_id) {
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ batch.getSchool_id(), batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号!");
|
|
|
+ }
|
|
|
+ if (aspect_id == null) {
|
|
|
+ aspect_id = aspOptr.getAspect_id();
|
|
|
+ }
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select (select count(1) done_cnt from std_apply_main where school_id=? and batch_id=? and aspect_id=? and review_level is not null) done_cnt, ");
|
|
|
+ sql.append(" (select count(1) from std_apply_main where school_id=? and batch_id=? and aspect_id=? and review_level is null and status = 'InitialAppr') to_be_cnt ");
|
|
|
+ sql.append(" from dual ");
|
|
|
+ Map<String, Object> retMap = this.bDao.findMapBySql(sql.toString(), batch.getSchool_id(), batch_id, aspect_id,
|
|
|
+ batch.getSchool_id(), batch_id, aspect_id);
|
|
|
+ if (aspect_id != null) {
|
|
|
+ CfAspect aspect = this.dDao.find(CfAspect.class, aspect_id);
|
|
|
+ retMap.put("pass_percent", aspect.getPass_percent());//准考比率
|
|
|
+ retMap.put("initial_pass_cnt", aspect.getInitial_pass_cnt());//初审通过人数
|
|
|
+ retMap.put("pass_cnt", aspect.getPass_cnt());//准考人数 = pass_percent * initial_pass_cnt
|
|
|
+ }
|
|
|
+ //是否签名了
|
|
|
+ ReviewSign sign = this.bDao.findBySql(ReviewSign.class, "select * from review_sign where batch_id=? and review_optr=? and aspect_id=?",
|
|
|
+ batch_id, aspOptr.getOptr_id(), aspect_id);
|
|
|
+ retMap.put("sign_flag", sign != null ? 1 : 0);
|
|
|
+ return new Ajax(retMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 终审评分
|
|
|
+ * @param apply_id
|
|
|
+ * @param review_score
|
|
|
+ * @param review_remark
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/save.htm")
|
|
|
+ public Ajax finalSave(Integer apply_id, Integer review_score, String review_remark) {
|
|
|
+ this.authOptrRole(FrameResIdConst.RES_FINAL_REVIEW_SAVE);
|
|
|
+ this.pService.finalSave(apply_id, review_score, review_remark, this.getFrameOptr());
|
|
|
+ return new Ajax();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专业通过排名--专业评审老师签名查询用
|
|
|
+ * @param query
|
|
|
+ * @param start
|
|
|
+ * @param limit
|
|
|
+ * @param order
|
|
|
+ * @param type
|
|
|
+ * @param batch_id
|
|
|
+ * @param pass_type passed-通过主考的,no_passed-不准考证的
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/aspect/std/pass/page.htm")
|
|
|
+ public Ajax pageAspectPass(String query, Integer start, Integer limit, String order, String type,
|
|
|
+ Integer batch_id, String pass_type) {
|
|
|
+ Integer aspect_id = null;
|
|
|
+ if (batch_id == null) {
|
|
|
+ return new Ajax(new Pager());
|
|
|
+ }
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ batch.getSchool_id(), batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号!");
|
|
|
+ }
|
|
|
+ if (aspect_id == null) {
|
|
|
+ aspect_id = aspOptr.getAspect_id();
|
|
|
+ }
|
|
|
+ return new Ajax(this.dDao.pageStdPassPage(start, limit, query, getQueryOrder(order, type),
|
|
|
+ batch.getSchool_id(), batch_id, aspect_id, pass_type));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过未通过分页-考务人员查询分页
|
|
|
+ * @param query
|
|
|
+ * @param start
|
|
|
+ * @param limit
|
|
|
+ * @param order
|
|
|
+ * @param type
|
|
|
+ * @param batch_id
|
|
|
+ * @param pass_type passed-通过主考的,no_passed-不准考证的
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/std/pass/notice/page.htm")
|
|
|
+ public Ajax pagePassNotice(String query, Integer start, Integer limit, String order, String type,
|
|
|
+ Integer batch_id, String major_ids, String optr_ids, String pass_type) {
|
|
|
+ if (batch_id == null) {
|
|
|
+ return new Ajax(new Pager());
|
|
|
+ }
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ return new Ajax(this.dDao.pageStdNoticePage(start, limit, query, getQueryOrder(order, type),
|
|
|
+ batch.getSchool_id(), batch_id, major_ids, optr_ids, pass_type));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 签名确认
|
|
|
+ * @param batch_id
|
|
|
+ * @param sgin_base64
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/comfirm/sign.htm")
|
|
|
+ public Ajax sign(Integer batch_id, String sgin_base64) {
|
|
|
+ Integer aspect_id = null;
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ batch.getSchool_id(), batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号。");
|
|
|
+ }
|
|
|
+ if (aspect_id == null) {
|
|
|
+ aspect_id = aspOptr.getAspect_id();
|
|
|
+ }
|
|
|
+ this.pService.sign(batch, aspOptr.getOptr_id(), aspect_id, sgin_base64, this.getFrameOptr());
|
|
|
+ return new Ajax(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 评审进度分页.
|
|
|
+ * @param query
|
|
|
+ * @param start
|
|
|
+ * @param limit
|
|
|
+ * @param order
|
|
|
+ * @param type
|
|
|
+ * @param batch_id
|
|
|
+ * @param aspect_id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/progress/page.htm")
|
|
|
+ public Ajax pageReviewProgress(String query, Integer start, Integer limit, String order, String type,
|
|
|
+ Integer batch_id, Integer aspect_id) {
|
|
|
+ if (batch_id == null) {
|
|
|
+ return new Ajax(new Pager());
|
|
|
+ }
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ return new Ajax(this.dDao.pageFinalReviewProgress(start, limit, query, getQueryOrder(order, type),
|
|
|
+ batch.getSchool_id(), batch_id, aspect_id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 进度分页 done-专业评审完成、to_be-专业评审未完成
|
|
|
+ * @param query
|
|
|
+ * @param start
|
|
|
+ * @param limit
|
|
|
+ * @param order
|
|
|
+ * @param type
|
|
|
+ * @param batch_id
|
|
|
+ * @param aspect_id
|
|
|
+ * @param query_type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/progress/detail/page.htm")
|
|
|
+ public Ajax pageProgressDetailPage(String query, Integer start, Integer limit, String order, String type,
|
|
|
+ Integer batch_id, Integer aspect_id, String query_type) {
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ return new Ajax(this.dDao.pageProgressDetailPage(start, limit, query, getQueryOrder(order, type),
|
|
|
+ batch.getSchool_id(), batch_id, aspect_id, query_type));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专业评审发消息-通过、不通过
|
|
|
+ * @param batch_id
|
|
|
+ * @param query_type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/notice/send.htm")
|
|
|
+ public Ajax sendNotice(Integer batch_id, String pass_type, String major_ids, String optr_ids) {
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ Pager pager = this.dDao.pageStdNoticePage(0, Integer.MAX_VALUE, null, null,
|
|
|
+ batch.getSchool_id(), batch_id, major_ids, optr_ids, pass_type);
|
|
|
+ List<Map<String, Object>> list = (List<Map<String, Object>>)pager.getRecords();
|
|
|
+ for (Map<String, Object> data : list) {
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ map.put("std_name", data.get("std_name").toString());
|
|
|
+ map.put("aspect_name", data.get("aspect_name").toString());
|
|
|
+ map.put("title_msg", "【" + data.get("std_name") + "】,以下是您的学术审核结果");
|
|
|
+ map.put("review_type", "学术审核");
|
|
|
+ map.put("review_time", LocalDateHelper.format(LocalDateTime.now()));
|
|
|
+ if ("passed".equals(pass_type)) {
|
|
|
+ map.put("review_result", "予以准考");
|
|
|
+ map.put("remark", "准考证自助下载预计将于2023年3月底前开放,具体日期请关注我院后续通知。");
|
|
|
+ } else if ("no_passed".equals(pass_type)) {
|
|
|
+ map.put("review_result", "不予准考");
|
|
|
+ map.put("remark", "请继续加强学术积累,提升学术研究能力。欢迎明年继续报考我院博士研究生。");
|
|
|
+ }
|
|
|
+ ArtWeixinHelper.SendWeiXinTemplate(GobalBusinessType.ReviewRetNotice, batch.getSchool_id(),
|
|
|
+ data.get("std_id").toString(), map);
|
|
|
+ LogHelper.info("已发送评审结果通知,考生ID:" + data.get("std_id").toString());
|
|
|
+ }
|
|
|
+ return new Ajax();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专业评审提交提前检查.
|
|
|
+ * @param batch_id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("final/review/submit/check.htm")
|
|
|
+ public Ajax submitCheck(Integer batch_id) {
|
|
|
+ Integer aspect_id = null;
|
|
|
+ CfBatch batch = this.dDao.find(CfBatch.class, batch_id);
|
|
|
+ CfAspectOptr aspOptr = this.bDao.findBySql(CfAspectOptr.class, "select * from cf_aspect_optr where school_id=? and batch_id=? and optr_id=?",
|
|
|
+ batch.getSchool_id(), batch_id, this.getFrameOptr().getOptr_id());
|
|
|
+ if (aspOptr == null) {
|
|
|
+ throw new BusinessException("找不到当前登录老师的评审账号。");
|
|
|
+ }
|
|
|
+ if (aspect_id == null) {
|
|
|
+ aspect_id = aspOptr.getAspect_id();
|
|
|
+ }
|
|
|
+ //没评审的提示
|
|
|
+ List<StdApplyMain> list = this.dDao.listBySql(StdApplyMain.class,
|
|
|
+ "select s.std_name,s.cert_id,m.* from std_apply_main m,std_reg s where s.std_id=m.std_id and s.school_id=m.school_id and m.school_id=? and m.batch_id=? and m.aspect_id=? and m.review_remark is null and m.review_score is null",
|
|
|
+ batch.getSchool_id(), batch.getBatch_id(), aspect_id);
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
+ throw new BusinessException("考生没有评审,姓名[" + list.get(0).getStd_name() + "]");
|
|
|
+ }
|
|
|
+ //不予准考的 必须有备注
|
|
|
+ List<StdApplyMain> noRemarkList = this.dDao.listBySql(StdApplyMain.class,
|
|
|
+ "select s.std_name,s.cert_id,m.* from std_apply_main m,std_reg s,cf_aspect f where s.std_id=m.std_id and s.school_id=m.school_id and m.school_id=? and m.batch_id=? and m.aspect_id=? and length(trim(m.review_remark))=0 and f.aspect_id=m.aspect_id and m.review_level>f.pass_cnt and f.school_id=m.school_id and f.batch_id=m.batch_id ",
|
|
|
+ batch.getSchool_id(), batch.getBatch_id(), aspect_id);
|
|
|
+ if (noRemarkList != null && noRemarkList.size() > 0) {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ sb.append("考生");
|
|
|
+ for (StdApplyMain m : noRemarkList) {
|
|
|
+ sb.append("[").append(m.getStd_name()).append("]");
|
|
|
+ }
|
|
|
+ sb.append("不予准考,必须有审核意见。");
|
|
|
+ throw new BusinessException(sb.toString());
|
|
|
+ }
|
|
|
+ //检查准考最后一名是否 同成绩
|
|
|
+ List<Map<String, Object>> rankList = this.getRankListt(batch_id, aspect_id);
|
|
|
+ CfAspect aspect = this.bDao.find(CfAspect.class, aspect_id);
|
|
|
+ if (aspect.getPass_cnt() != null && rankList.size() > aspect.getPass_cnt()) {
|
|
|
+ Map<String, Object> zk = rankList.get(aspect.getPass_cnt() - 1);
|
|
|
+ for (int i=aspect.getPass_cnt(); i<rankList.size(); i++) {
|
|
|
+ Map<String, Object> zkNext = rankList.get(aspect.getPass_cnt());
|
|
|
+ if (zk.get("review_score").equals(zkNext.get("review_score"))) {
|
|
|
+ throw new BusinessException("考生[" + zk.get("std_name") + "]与[" + zkNext.get("std_name") + "]成绩相同,请确认后修改。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new Ajax(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询所有的专业评审老师
|
|
|
+ @RequestMapping("final/review/optr/list.htm")
|
|
|
+ public Ajax listMajor(Integer school_id, Integer batch_id) {
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.append("select o.optr_id,o.optr_name from frame_optr o,cf_aspect_optr ao ");
|
|
|
+ sql.append("where ao.school_id=? and ao.batch_id=? and o.optr_id=ao.optr_id ");
|
|
|
+ return new Ajax(this.bDao.listBySql(FrameOptr.class, sql.toString(), school_id, batch_id));
|
|
|
+ }
|
|
|
+}
|