1.考试查询接口修改,计算每场考试报名人数
2.个人头像批量上传接口修改,删除生成在本地的压缩包和文件
| | |
| | | File file = null; |
| | | InputStream ins = srcFile.getInputStream(); |
| | | String savaPaths = savePath+srcFile.getOriginalFilename(); |
| | | System.out.println("savaPaths = " + savaPaths); |
| | | file=new File(savaPaths); |
| | | inputStreamToFile(ins, file); |
| | | |
| | |
| | | String str = EntityUtils.toString(entity); |
| | | httpPost.clone(); |
| | | httpClient.close(); |
| | | System.out.println(str); |
| | | return str; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入exam") |
| | | public R<IPage<ExamPaperVO>> list(@ApiIgnore @RequestParam Map<String, Object> exam, Query query) { |
| | |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/pages") |
| | | public R<IPage<ExamPaperVO>> page(ExamPaperVO exam, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPage(Condition.getPage(query), exam); |
| | | public R<IPage<ExamPaperVO>> pages(ExamPaperVO exam, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPages(Condition.getPage(query), exam); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * @param query 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | public R<IPage<ExamPaperVO>> page(ExamPaperVO examPaperVO, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPage(Condition.getPage(query), examPaperVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | Date date = new Date(); |
| | | String strDateFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat); |
| | | System.out.println(sdf.format(date)); |
| | | return R.data(sdf.format(date)); |
| | | } |
| | | |
| | |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | max++; |
| | | System.out.println("max = " + max); |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | |
| | | */ |
| | | public interface ExamPaperMapper extends BaseMapper<ExamPaper> { |
| | | |
| | | IPage<ExamPaperVO> selectExamPaperPage(IPage page, ExamPaperVO exam); |
| | | IPage<ExamPaperVO> selectExamPaperPages(IPage page, ExamPaperVO exam); |
| | | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * @param page 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | | */ |
| | | IPage<ExamPaperVO> selectExamPaperPage(IPage page, @Param("paper")ExamPaperVO examPaperVO); |
| | | |
| | | ExamPaperSubjectVO queryPagerSubject(@Param("paper") ExamPaper paper); |
| | | |
| | |
| | | * @return |
| | | */ |
| | | ExamPaper getExamInfoByExamName(@Param("examName") String examName); |
| | | |
| | | /** |
| | | * 查询每个考试的报名人员数量 |
| | | * @param examPaperVO1 |
| | | * @return |
| | | */ |
| | | Integer getApplyNumber(@Param("examPaper")ExamPaperVO examPaperVO1); |
| | | |
| | | /** |
| | | * 查询每个考试的报名人员数量 模拟考试 |
| | | * @param examPaperVO1 |
| | | * @return |
| | | */ |
| | | Integer getTrainNumber(@Param("examPaper")ExamPaperVO examPaperVO1); |
| | | } |
| | |
| | | SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 3 ORDER BY RAND( ) LIMIT 5 ) d |
| | | </select> |
| | | |
| | | <select id="selectExamPaperPage" resultType="org.springblade.modules.exam.vo.ExamPaperVO"> |
| | | <select id="selectExamPaperPages" resultType="org.springblade.modules.exam.vo.ExamPaperVO"> |
| | | SELECT |
| | | * |
| | | FROM |
| | |
| | | ksxt_exam sj ) as s |
| | | WHERE |
| | | show = 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectExamPaperPage" resultType="org.springblade.modules.exam.vo.ExamPaperVO"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ksxt_exam |
| | | where |
| | | 1=1 |
| | | <if test="paper.examType!=null and paper.examType!=''"> |
| | | and exam_type = #{paper.examType} |
| | | </if> |
| | | <if test="paper.examName!=null and paper.examName!=''"> |
| | | and exam_name = #{paper.examName} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="PagerSubject" resultMap="PagerSubjectAnswer"> |
| | |
| | | where exam_name like concat('%', #{examName},'%') |
| | | </select> |
| | | |
| | | <!--查询当前考试的报名人员数量--> |
| | | <select id="getApplyNumber" resultType="java.lang.Integer"> |
| | | select count(*) from sys_apply |
| | | where |
| | | exam_id = #{examPaper.id} |
| | | and apply_status = 2 |
| | | </select> |
| | | |
| | | <!--查询当前考试的报名人员数量,模拟考试--> |
| | | <select id="getTrainNumber" resultType="java.lang.Integer"> |
| | | select count(*) from sys_training_registration |
| | | where |
| | | train_exam_id = #{examPaper.id} |
| | | and cancel = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | public interface ExamPaperService extends IService<ExamPaper> { |
| | | |
| | | IPage<ExamPaperVO> selectExamPaperPage(IPage<ExamScoreVO> page, ExamPaperVO exam); |
| | | IPage<ExamPaperVO> selectExamPaperPages(IPage<ExamScoreVO> page, ExamPaperVO exam); |
| | | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * @param page 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | | */ |
| | | IPage<ExamPaperVO> selectExamPaperPage(IPage<ExamScoreVO> page, ExamPaperVO examPaperVO); |
| | | |
| | | ExamPaperSubjectVO queryPagerSubject(ExamPaper paper); |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public IPage<ExamPaperVO> selectExamPaperPage(IPage<ExamScoreVO> page, ExamPaperVO exam) { |
| | | return baseMapper.selectExamPaperPage(page,exam); |
| | | public IPage<ExamPaperVO> selectExamPaperPages(IPage<ExamScoreVO> page, ExamPaperVO exam) { |
| | | return baseMapper.selectExamPaperPages(page,exam); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * @param page 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<ExamPaperVO> selectExamPaperPage(IPage<ExamScoreVO> page, ExamPaperVO examPaperVO) { |
| | | IPage<ExamPaperVO> examPaperVOIPage = baseMapper.selectExamPaperPage(page, examPaperVO); |
| | | List<ExamPaperVO> records = examPaperVOIPage.getRecords(); |
| | | records.forEach(examPaperVO1 -> { |
| | | //查询每个考试的报名人员数量 |
| | | if (examPaperVO1.getExamType()==1) { |
| | | examPaperVO1.setNum(baseMapper.getApplyNumber(examPaperVO1)); |
| | | } |
| | | //模拟考试 |
| | | if (examPaperVO1.getExamType()==2) { |
| | | examPaperVO1.setNum(baseMapper.getTrainNumber(examPaperVO1)); |
| | | } |
| | | }); |
| | | return examPaperVOIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | count++; |
| | | System.out.println("count = " + count); |
| | | result = pre + (decimalFormat.format(count)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | |
| | | * 考试 id |
| | | */ |
| | | private Long applyId; |
| | | |
| | | /** |
| | | * 报名人数 |
| | | */ |
| | | private Integer num; |
| | | } |
| | |
| | | ResponseEntity<byte[]> aEntity = null; |
| | | try { |
| | | URLEncoder.encode(content,"utf-8"); |
| | | System.out.println("content = " + content); |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | | // Set headers |
| | | final HttpHeaders headers = new HttpHeaders(); |
| | |
| | | .build()); |
| | | |
| | | String urls = "http://223.82.109.183:2081/zhba/" + newName; |
| | | //内网 |
| | | String inUrl = ip + newName; |
| | | //取出身份证号,查询用户信息,更新用户信息 |
| | | String pictrueName = multipartFile.getName().substring(0, multipartFile.getName().lastIndexOf(".")); |
| | | // String regex ="([1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx])|([1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3})"; |
| | |
| | | |
| | | //内网数据推送 |
| | | //数据推送 |
| | | String s = "update blade_user set avatar = " + "'" + urls + "'" + "where id = " + "'" + user.getId() + "'"; |
| | | String s = "update blade_user set avatar = " + "'" + inUrl + "'" + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | |
| | | //文件推送 |
| | |
| | | } |
| | | } |
| | | //最后要删除文件 |
| | | FileUtil.clearFiles(FileConfig.localtion + File.separator + file.getOriginalFilename()); |
| | | FileUtil.clearFiles(desPath); |
| | | //数据封装 |
| | | map.put("data", "上传成功!"); |
| | |
| | | #username: sa |
| | | #password: zhbaw@2021 |
| | | |
| | | |
| | | #图片批量上传zip |
| | | upload: |
| | | # localtion: ${UPLOAD_DIR:/home/zhongsong/anbao} |
| | | localtion: ${UPLOAD_DIR:D:/test} |
| | | maxFileSize: 10240KB |
| | | maxRequestSize: 102400KB |
| | | |
| | | #第三方登陆 |
| | | social: |
| | | enabled: true |
| | |
| | | upload-domain: http://localhost:8999 |
| | | remote-path: /usr/share/nginx/html |
| | | |
| | | upload: |
| | | # localtion: ${UPLOAD_DIR:/home/zhongsong/anbao} |
| | | localtion: ${UPLOAD_DIR:D:/test} |
| | | maxFileSize: 10240KB |
| | | maxRequestSize: 102400KB |
| | | |
| | | |