| | |
| | | import org.springblade.modules.apply.vo.ApplyVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @time 2021-07-17 |
| | |
| | | public R submit(@RequestBody Apply apply) { |
| | | if (null!=apply.getId()){ |
| | | //去生成准考证 |
| | | apply.setCandidateNo(getCandidateNo(apply)); |
| | | } |
| | | return R.status(applyService.saveOrUpdate(apply)); |
| | | } |
| | | |
| | | /** |
| | | * 生成准考证 |
| | | * @param apply 报名对象信息 |
| | | */ |
| | | private String getCandidateNo(Apply apply) { |
| | | String candidateNo = null; |
| | | if (null!=apply.getExamTime()){ |
| | | String year = ((Integer) apply.getExamTime().getYear()).toString().substring(2,3); |
| | | String quarter = null; |
| | | int month = apply.getExamTime().getMonth(); |
| | | if (month>0 && month<=3){ |
| | | quarter = "C"; |
| | | } |
| | | if (month>3 && month<=6){ |
| | | quarter = "X"; |
| | | } |
| | | if (month>6 && month<=9){ |
| | | quarter = "Q"; |
| | | } |
| | | if (month>9 && month<=12){ |
| | | quarter = "D"; |
| | | } |
| | | } |
| | | return "2107XN0001"; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param ids 考试报名信息ids 数组 |
| | | */ |
| | |
| | | <!--考试报名分页信息--> |
| | | <select id="selectApplyPage" resultType="org.springblade.modules.apply.vo.ApplyVO"> |
| | | SELECT |
| | | sa.*,ke.total_score paperScore |
| | | sa.*,ke.total_score paperScore,ke.exam_type examType,ke.start_time startTime |
| | | FROM |
| | | sys_apply sa |
| | | left join |
| | | ksxt_exam ke |
| | | on |
| | | sa.exam_id = ke.id |
| | | left join |
| | | blade_user bu |
| | | on |
| | | sa.user_id = bu.id |
| | | WHERE |
| | | 1=1 |
| | | <if test="apply.name!=null and apply.name!=''"> |
| | |
| | | */ |
| | | private Integer paperScore; |
| | | |
| | | /** |
| | | * 考试类型 |
| | | */ |
| | | private Integer examType; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.SqlParser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.vo.DeptVO; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @SqlParser(filter=true) |
| | | List<DeptVO> lazyTreeUser(String tenantId, Long parentId); |
| | | List<DeptVO> lazyTreeUser(String tenantId, @Param("parentId") Long parentId); |
| | | } |
| | |
| | | blade_dept dept |
| | | WHERE |
| | | dept.is_deleted = 0 |
| | | <if test="parentId!=null and parentId!=''"> |
| | | and dept_category=1 |
| | | </if> |
| | | ) |
| | | |
| | | union |
| | | |
| | | (select |
| | | id, |
| | | dept_id parent_id, |
| | | real_name AS title, |
| | | id AS "value", |
| | | id AS "key", |
| | | bu.id, |
| | | bu.dept_id parent_id, |
| | | bu.real_name AS title, |
| | | bu.id AS "value", |
| | | bu.id AS "key", |
| | | 0 as "has_children" |
| | | from blade_user |
| | | from blade_user bu |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = bu.dept_id |
| | | where 1=1 |
| | | <if test="parentId!=null and parentId!=''"> |
| | | and dept_category=1 |
| | | </if> |
| | | ) |
| | | )c |
| | | </select> |