| | |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.training.vo.TrainingRegistrationVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import static org.springblade.common.constant.FtpConstant.*; |
| | | import static org.springblade.common.config.FtpConfig.*; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | |
| | | @RequestMapping("/apply") |
| | | public class ApplyController { |
| | | |
| | | // @Autowired |
| | | private final ApplyService applyService; |
| | | |
| | | // @Autowired |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | // @Autowired |
| | | private final IUserService userService; |
| | | |
| | | // @Autowired |
| | | private final ExamScoreService examScoreService; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | list.forEach(id -> { |
| | | //内网同步 |
| | | String s1 = "delete from sys_apply where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }); |
| | | return R.status(applyService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | |
| | | examScore.setExamId(apply.getExamId().toString()); |
| | | examScore.setUserId(apply.getUserId().toString()); |
| | | examScore.setApplyId(apply.getId()); |
| | | examScore.setCandidateNo(apply.getCandidateNo()); |
| | | examScore.setExamTime(new Date()); |
| | | //新增考试成绩 |
| | | examScoreService.save(examScore); |
| | | //内网同步 |
| | | Long sid = examScore.getId(); |
| | | String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime()); |
| | | // String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " + |
| | | // "values(" + "'" + sid + "'" + "," + "'" + |
| | | // format + "'" + "," + "'" + |
| | | // examScore.getUserId() +"'" + "," +"'" + |
| | | // examScore.getExamId() +"'" + "," +"'" + |
| | | // examScore.getApplyId() + "'" + ")"; |
| | | // FtpUtil.sqlFileUpload(s); |
| | | String s = "insert into exam_score(id,candidate_no,exam_time,user_id,exam_id,apply_id) " + |
| | | "values(" + "'" + sid + "'" + |
| | | "," + "'" + examScore.getCandidateNo() + "'" + |
| | | "," + "'" + format + "'" + |
| | | "," + "'" + examScore.getUserId() +"'" + |
| | | "," +"'" + examScore.getExamId() +"'" + |
| | | "," +"'" + examScore.getApplyId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | return examScore; |
| | | } |
| | | |
| | |
| | | } catch (FileNotFoundException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "f"+response1+".json", in1); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", "f"+response1+".json", in1); |
| | | return "成功"; |
| | | } |
| | | |