| | |
| | | if (1==user.getIsApply()){ |
| | | return R.data(201,"已报名,不能重复报名"); |
| | | } |
| | | if (2==user.getIsApply() || -1==user.getIsApply()){ |
| | | if (2==user.getIsApply() || -1==user.getIsApply() || 3==user.getIsApply()){ |
| | | //默认通过 |
| | | apply.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | if (user.getIsApply()==2) { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | if(user.getIsApply()==1){ |
| | | apply.setApplyStatus(4); |
| | | boolean status = applyService.updateById(apply); |
| | |
| | | if (status){ |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | } |
| | | return R.data(202,"取消报名失败"); |
| | |
| | | user.setIsApply(1); |
| | | userService.updateById(user); |
| | | } else { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply()) { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply() || 3==user.getIsApply()) { |
| | | Apply apply1 = new Apply(); |
| | | apply1.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | user.setIsApply(1); |
| | | userService.updateById(user); |
| | | } else { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply()) { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply() || 3==user.getIsApply()) { |
| | | Apply apply1 = new Apply(); |
| | | apply1.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | user1.setIsApply(1); |
| | | userService.updateById(user1); |
| | | }else { |
| | | if (user1.getIsApply()==2 || -1==user.getIsApply()) { |
| | | if (user1.getIsApply()==2 || -1==user.getIsApply() || 3==user.getIsApply()) { |
| | | Apply apply1 = new Apply(); |
| | | apply1.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | <!--考试成绩分页信息-正式考试--> |
| | | <select id="selectExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO"> |
| | | SELECT |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | | es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | ke.exam_name examName, |
| | | bu.real_name securityName,company,bu.account, |
| | | sa.is_exam isExam, |
| | | bd.dept_name companyName |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | | es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | ke.exam_name examName, |
| | | bu.real_name securityName,company,bu.account, |
| | | sa.is_exam isExam, |
| | | bd.dept_name companyName |
| | | FROM |
| | | exam_score es |
| | | sys_apply sa |
| | | left join |
| | | blade_user bu |
| | | blade_user bu |
| | | on |
| | | es.user_id = bu.id |
| | | sa.user_id = bu.id |
| | | left join |
| | | blade_dept bd |
| | | blade_dept bd |
| | | on |
| | | bd.id = es.company |
| | | bd.id = bu.dept_id |
| | | left join |
| | | ksxt_exam ke |
| | | ksxt_exam ke |
| | | on |
| | | ke.id = es.exam_id |
| | | ke.id = sa.exam_id |
| | | left join |
| | | sys_apply sa |
| | | exam_score es |
| | | on |
| | | sa.user_id = bu.id |
| | | WHERE |
| | | 1=1 |
| | | es.exam_id = sa.exam_id |
| | | where |
| | | 1=1 |
| | | and (sa.is_exam = 2 or sa.is_exam = 3) |
| | | and ke.exam_type = 1 |
| | | <if test="examScore.examName!=null and examScore.examName!=''"> |
| | | and ke.exam_name like concat('%', #{examScore.examName},'%') |
| | | </if> |
| | |
| | | <!--考试成绩分页信息-模拟考试--> |
| | | <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO"> |
| | | SELECT |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | | es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | ke.exam_name examName, |
| | | bu.real_name securityName,company,bu.account, |
| | | str.is_exam isExam, |
| | | bd.dept_name companyName |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | | es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | ke.exam_name examName, |
| | | bu.real_name securityName,company,bu.account, |
| | | str.is_exam isExam, |
| | | bd.dept_name companyName |
| | | FROM |
| | | exam_score es |
| | | sys_training_registration str |
| | | left join |
| | | blade_user bu |
| | | blade_user bu |
| | | on |
| | | es.user_id = bu.id |
| | | str.user_id = bu.id |
| | | left join |
| | | blade_dept bd |
| | | blade_dept bd |
| | | on |
| | | bd.id = es.company |
| | | bd.id = bu.dept_id |
| | | left join |
| | | ksxt_exam ke |
| | | ksxt_exam ke |
| | | on |
| | | ke.id = es.exam_id |
| | | ke.id = str.train_exam_id |
| | | left join |
| | | sys_training_registration str |
| | | exam_score es |
| | | on |
| | | str.user_id = bu.id |
| | | es.exam_id = str.train_exam_id |
| | | WHERE |
| | | 1=1 |
| | | 1=1 |
| | | and (str.is_exam = 2 or str.is_exam = 3) |
| | | <if test="examScore.examName!=null and examScore.examName!=''"> |
| | | and ke.exam_name like concat('%', #{examScore.examName},'%') |
| | | </if> |
| | |
| | | //获取考试信息 |
| | | ExamPaper paper = examPaperService.getById(examScore.getPapersId()); |
| | | int age = 0; |
| | | UserVO user = new UserVO(); |
| | | //使用准考证号查询报名信息,修改考试状态为已考试 |
| | | if(paper.getExamType()==1){ |
| | | Apply apply = new Apply(); |
| | | apply.setCandidateNo(examScore.getCandidateNo()); |
| | | Apply apply1 = applyService.getOne(Condition.getQueryWrapper(apply)); |
| | | //查询用户年龄,根据年龄计算总分 |
| | | age = userService.getUserAgeById(apply1.getUserId()).getAge(); |
| | | user = userService.getUserAgeById(apply1.getUserId()); |
| | | //修改用户的考试状态,理论考试结束 |
| | | user.setIsApply(3); |
| | | userService.updateById(user); |
| | | age = user.getAge(); |
| | | //修改为已考试 |
| | | apply1.setIsExam(2); |
| | | applyService.updateById(apply1); |
| | |
| | | trainingRegistration.setCandidateNo(examScore.getCandidateNo()); |
| | | TrainingRegistration trainingRegistration1 = trainingRegistrationService.getOne(Condition.getQueryWrapper(trainingRegistration)); |
| | | //查询用户年龄,根据年龄计算总分 |
| | | age = userService.getUserAgeById(Long.parseLong(trainingRegistration1.getUserId())).getAge(); |
| | | user = userService.getUserAgeById(Long.parseLong(trainingRegistration1.getUserId())); |
| | | //修改用户的培训状态,理论考试结束 |
| | | user.setIsTrain(3); |
| | | age = user.getAge(); |
| | | userService.updateById(user); |
| | | //修改为已考试 |
| | | trainingRegistration1.setIsExam(2); |
| | | trainingRegistrationService.updateById(trainingRegistration1); |
| | | } |
| | | |
| | | |
| | | //设置考试ID |
| | | examScore.setExamId(examScore.getPapersId().toString()); |
| | |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | @GetMapping("/page-security") |
| | | public R<IPage<UserVO>> pageSecurity(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | user.setAccount("admin"); |
| | | bladeUser.setTenantId("000000"); |
| | | IPage<User> pages = userService.selectUserPageSecurity(Condition.getPage(query), user, deptId, "000000"); |
| | | public R<IPage<UserVO>> pageSecurity(@ApiIgnore User user, Query query) { |
| | | IPage<User> pages = userService.selectUserPageSecurity(Condition.getPage(query), user); |
| | | return R.data(UserWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | @GetMapping("/page-security-unit") |
| | | public List<User> pageSecurityUnit(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | user.setAccount("admin"); |
| | | bladeUser.setTenantId("000000"); |
| | | List<User> pages = userService.selectUserPageSecurityUnit(Condition.getPage(query), user, deptId, "000000"); |
| | | public List<User> pageSecurityUnit(@ApiIgnore User user, Query query) { |
| | | List<User> pages = userService.selectUserPageSecurityUnit(Condition.getPage(query), user); |
| | | return pages; |
| | | } |
| | | |
| | |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | @GetMapping("/page-security-units") |
| | | public R pageSecurityUnits(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) { |
| | | bladeUser.setTenantId("000000"); |
| | | List<User> pages = userService.selectUserPageSecurityUnit(Condition.getPage(query), user, deptId, "000000"); |
| | | public R pageSecurityUnits(@ApiIgnore User user, Query query) { |
| | | List<User> pages = userService.selectUserPageSecurityUnit(Condition.getPage(query),user); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | * 保安员列表,帅选无保安证 |
| | | */ |
| | | @GetMapping("/page-security-apply") |
| | | public R<IPage<UserVO>> pageSecurityApply(@ApiIgnore UserVO user, Query query, Long deptId, BladeUser bladeUser) { |
| | | bladeUser.setTenantId("000000"); |
| | | IPage<UserVO> pages = userService.selectUserPageSecurityApply(Condition.getPage(query), user, deptId, "000000"); |
| | | public R<IPage<UserVO>> pageSecurityApply(@ApiIgnore UserVO user, Query query) { |
| | | IPage<UserVO> pages = userService.selectUserPageSecurityApply(Condition.getPage(query), user); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | List<User> selectUserPageSecurity(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | List<User> selectUserPageSecurity(IPage<User> page, @Param("user") User user); |
| | | |
| | | /** |
| | | * 保安员列表,帅选无保安证 |
| | | * @param page |
| | | * @param user |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page,@Param("user") UserVO user, @Param("deptIdList")List<Long> deptIdList, @Param("tenantId") String tenantId); |
| | | IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page,@Param("user") UserVO user); |
| | | |
| | | /** |
| | | * 保安员列表树 安员列表树,帅选无保安证,下拉tree |
| | |
| | | @MapKey(value = "id") |
| | | @SqlParser(filter=true) |
| | | Map<Long, TreeNode> getSecurityApplyTree(@Param("user") UserVO user); |
| | | |
| | | |
| | | List<Map<Object,Object>> selectInr(String deptid); |
| | | |
| | | /** |
| | |
| | | bu.is_deleted = 0 |
| | | and |
| | | bd.dept_category = 1 |
| | | <if test="user.tenantId!=null and user.tenantId != ''"> |
| | | and bu.tenant_id = #{user.tenantId} |
| | | </if> |
| | | <if test="user.account!=null and user.account != ''"> |
| | | and bu.account != #{user.account} |
| | | </if> |
| | | <if test="user.realName!=null and user.realName != ''"> |
| | | and bu.real_name like concat(concat('%', #{user.realName}),'%') |
| | | </if> |
| | |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber = #{user.securitynumber} |
| | | </if> |
| | | <if test="deptIdList!=null and deptIdList.size>0"> |
| | | and bu.id in ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | blade_user_dept |
| | | WHERE |
| | | dept_id IN |
| | | <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ORDER BY bu.id |
| | | </select> |
| | | |
| | |
| | | bd.dept_category = 1 |
| | | and |
| | | (hold = 2 or hold = 3) |
| | | <if test="tenantId!=null and tenantId != ''"> |
| | | and bu.tenant_id = #{tenantId} |
| | | </if> |
| | | <if test="user.account!=null and user.account != ''"> |
| | | and bu.account = #{user.account} |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and bu.dept_id = #{user.deptId} |
| | | </if> |
| | |
| | | </if> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber = #{user.securitynumber} |
| | | </if> |
| | | <if test="deptIdList!=null and deptIdList.size>0"> |
| | | and bu.id in ( |
| | | SELECT |
| | | user_id |
| | | FROM |
| | | blade_user_dept |
| | | WHERE |
| | | dept_id IN |
| | | <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | ) |
| | | </if> |
| | | ORDER BY bu.id |
| | | </select> |
| | |
| | | /** |
| | | * 自定义用户列表(只有保安员) |
| | | */ |
| | | IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String s); |
| | | IPage<User> selectUserPageSecurity(IPage<User> page, User user); |
| | | |
| | | /** |
| | | * 自定义用户列表(只有保安员),根据保安员查 |
| | | */ |
| | | List<User> selectUserPageSecurityUnit(IPage<User> page, User user, Long deptId, String s); |
| | | List<User> selectUserPageSecurityUnit(IPage<User> page, User user); |
| | | |
| | | /** |
| | | * 保安员列表,帅选无保安证 |
| | |
| | | * @param s |
| | | * @return |
| | | */ |
| | | IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page, UserVO user, Long deptId, String s); |
| | | IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page, UserVO user); |
| | | |
| | | /** |
| | | * 保安员列表树 安员列表树,帅选无保安证,下拉tree |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return page.setRecords(baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId)); |
| | | public IPage<User> selectUserPageSecurity(IPage<User> page, User user) { |
| | | return page.setRecords(baseMapper.selectUserPageSecurity(page, user)); |
| | | } |
| | | |
| | | /** |
| | | * 自定义用户列表(只有保安员),根据保安员查 |
| | | */ |
| | | @Override |
| | | public List<User> selectUserPageSecurityUnit(IPage<User> page, User user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId); |
| | | public List<User> selectUserPageSecurityUnit(IPage<User> page, User user) { |
| | | return baseMapper.selectUserPageSecurity(page, user); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * @param page |
| | | * @param user |
| | | * @param deptId |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page, UserVO user, Long deptId, String tenantId) { |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return baseMapper.selectUserPageSecurityApply(page, user, null, tenantId); |
| | | public IPage<UserVO> selectUserPageSecurityApply(IPage<UserVO> page, UserVO user) { |
| | | return baseMapper.selectUserPageSecurityApply(page, user); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (1==user.getIsTrain()){ |
| | | return R.data(201,"已报名,不能重复报名"); |
| | | } |
| | | if (2==user.getIsTrain() || -1==user.getIsTrain()){ |
| | | if (2==user.getIsTrain() || -1==user.getIsTrain() || 3==user.getIsTrain()){ |
| | | //已报名 |
| | | trainingRegistration.setCancel(1); |
| | | //默认为未考试状态 |
| | |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | if (user.getIsTrain()==2) { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | if(user.getIsTrain()==1){ |
| | | trainingRegistration.setCancel(2); |
| | | boolean status = trainingRegistrationService.updateById(trainingRegistration); |
| | |
| | | if (status){ |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | |
| | | } |
| | |
| | | user.setIsTrain(1); |
| | | userService.updateById(user); |
| | | }else { |
| | | if (user.getIsTrain()==2 || -1==user.getIsTrain()) { |
| | | if (user.getIsTrain()==2 || -1==user.getIsTrain() || 3==user.getIsTrain()) { |
| | | TrainingRegistration trainingRegistration1 = new TrainingRegistration(); |
| | | trainingRegistration1.setCancel(1); |
| | | //默认为未考试状态 |
| | |
| | | user.setIsTrain(1); |
| | | userService.updateById(user); |
| | | }else { |
| | | if (2 == user.getIsTrain() || -1==user.getIsTrain()) { |
| | | if (2 == user.getIsTrain() || -1==user.getIsTrain() || 3==user.getIsTrain()) { |
| | | trainingRegistration.setIsExam(1); |
| | | trainingRegistration.setCancel(1); |
| | | trainingRegistration.setTrainingTime(new Date()); |