| | |
| | | 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 数组 |
| | | */ |