| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入exam") |
| | | public R save(@RequestBody ExamPaper exam) { |
| | | return R.status(examPaperService.save(exam)); |
| | | public R save(@RequestBody ExamPaper examPaper) { |
| | | boolean save = examPaperService.save(examPaper); |
| | | String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getStartTime()); |
| | | String s = "insert into ksxt_exam(id,exam_name,exam_type,start_time) " + |
| | | "values(" + "'" + examPaper.getId() + "'" + "," + "'" + examPaper.getExamName() + |
| | | "'" + "," + "'" + examPaper.getExamType() + |
| | | "'" + "," +"'" + format + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return R.status(save); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入exam") |
| | | public R update(@RequestBody ExamPaper exam) { |
| | | String s1 = |
| | | "update ksxt_exam set exam_name = " + "'" + exam.getExamName() + "'" + |
| | | ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getStartTime()) + "'" + |
| | | " " +"where id = " + "'" + exam.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(examPaperService.updateById(exam)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入exam") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | //内网删除 |
| | | List<Long> list = Func.toLongList(ids); |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from ksxt_exam where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }); |
| | | boolean temp = examPaperService.removeByIds(Func.toLongList(ids)); |
| | | return R.status(temp); |
| | | } |
| | |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "考试题目绑定", notes = "传入exam") |
| | | public R setPagerSubject(@ApiParam(value = "主键集合") ExamPaper exam) { |
| | | |
| | | return R.status(true); |
| | | } |
| | | |