智慧保安后台管理-外网项目备份
tangzy
2022-02-24 d4b00c05321d9373a33bfb26618735e2a5868a81
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -31,6 +31,7 @@
import org.springblade.modules.exam.service.ExamScoreService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.system.service.MyAsyncService;
import org.springblade.modules.training.vo.TrainingRegistrationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -67,9 +68,11 @@
//   @Autowired
   private final ExamScoreService examScoreService;
   private final MyAsyncService myAsyncService;
   /**
    * 自定义分页
    *
    * @param query page,size
    * @param apply 考试报名信息对象
    */
@@ -90,6 +93,7 @@
   /**
    * 新增报名
    *
    * @param apply 考试报名信息对象
    */
   @PostMapping("/save")
@@ -151,12 +155,14 @@
         "values(" + "'" + id + "'" + "," + "'" + apply.getUserId() + "'" + "," + "'" + formatStr +
         "'" + "," + "'" + apply.getApplyStatus() + "'" + "," +"'" + apply.getIsExam() + "'" + ");" +
         "update blade_user set is_apply = " + user1.getIsApply() + " " +"where id = " + "'" + user1.getId() + "'";
      FtpUtil.sqlFileUpload(s);
      //FtpUtil.sqlFileUpload(s);
      myAsyncService.FTP(s);
   }
   /**
    * 修改
    *
    * @param apply 考试报名信息对象
    */
   @PostMapping("/update")
@@ -166,6 +172,7 @@
   /**
    * 新增或修改
    *
    * @param apply 考试报名信息对象
    */
   @PostMapping("/submit")
@@ -209,6 +216,7 @@
   /**
    * 导出报名数数据
    *
    * @param response
    * @param apply 报名对象
    */
@@ -221,6 +229,7 @@
   /**
    * 生成准考证号码
    *
    * @param apply 考试报名信息对象
    */
   private String getCandidateNo(Apply apply) {
@@ -293,6 +302,7 @@
   /**
    * 生成报名编号
    *
    * @param apply 考试报名信息对象
    */
   private String getApplyCode(Apply apply) {
@@ -344,6 +354,7 @@
   /**
    * 获取字符串拼音的第一个字母
    *
    * @param chinese
    * @return
    */
@@ -370,6 +381,7 @@
   /**
    * 删除
    *
    * @param ids 考试报名信息ids 数组
    */
   @PostMapping("/remove")
@@ -378,13 +390,15 @@
      list.forEach(id -> {
         //内网同步
         String s1 = "delete from sys_apply where id = " + "'" + id + "'";
         FtpUtil.sqlFileUpload(s1);
         //FtpUtil.sqlFileUpload(s1);
         myAsyncService.FTP(s1);
      });
      return R.status(applyService.removeByIds(Func.toLongList(ids)));
   }
   /**
    * 查询用户详情
    *
    * @param user
    */
   @GetMapping("/userDetail")
@@ -398,6 +412,7 @@
   /**
    * 详情
    *
    * @param apply 考试报名信息对象
    */
   @GetMapping("/detail")
@@ -411,6 +426,7 @@
   /**
    * 获取准考证信息
    *
    * @param apply
    * @return
    */
@@ -427,6 +443,7 @@
   /**
    * 取消报名
    *
    * @param apply 考试报名信息对象
    */
   @PostMapping("/cancelApply")
@@ -475,12 +492,14 @@
      String s =
         "update sys_apply set apply_status = " + apply.getApplyStatus() + " " +"where id = " + "'" + apply.getId() + "';" +
            "update blade_user set is_apply = " + user.getIsApply() + " " +"where id = " + "'" + user.getId() + "'";
      FtpUtil.sqlFileUpload(s);
      //FtpUtil.sqlFileUpload(s);
      myAsyncService.FTP(s);
   }
   /**
    * 公司报名列表取消报名,无applyId
    *
    * @param apply 考试报名信息对象
    */
   @PostMapping("/cancelApplyNotApplyId")
@@ -527,6 +546,7 @@
   /**
    * 批量报名
    *
    * @param ids userIds 人员
    */
   @PostMapping("/batchApply")
@@ -612,9 +632,9 @@
   }
   /**
    * 生成考试,报名
    *
    * @param applyVO 报名info
    */
   @PostMapping("/batchExam")
@@ -646,7 +666,8 @@
            "," + "'" + examPaper.getExamType() +"'" +
            "," + "'" + format +"'" +
            ","  +"'" + endTimeFormat + "'" + ")";
         FtpUtil.sqlFileUpload(s);
         //FtpUtil.sqlFileUpload(s);
         myAsyncService.FTP(s);
         //修改报名信息
         applyIds.forEach(apply ->{
@@ -659,7 +680,8 @@
               String s1 =
                  "update sys_apply set exam_id = " + apply.getExamId() + ",candidate_no = " + "'" + apply.getCandidateNo() + "'" +
                     " " +"where id = " + "'" + apply.getId() + "'";
               FtpUtil.sqlFileUpload(s1);
               //FtpUtil.sqlFileUpload(s1);
               myAsyncService.FTP(s1);
            }
         });
      }
@@ -669,6 +691,7 @@
   /**
    * 查询报名清册信息
    *
    * @param apply 报名信息
    * @return
    */
@@ -680,6 +703,7 @@
   /**
    * 查询保安员个人报名信息
    *
    * @param apply 报名信息,包含userId
    * @return
    */
@@ -691,6 +715,7 @@
   /**
    * 修改考试状态
    *
    * @param apply 报名信息,包含userId,applyid
    * @return
    */
@@ -705,7 +730,8 @@
      examScore.setCandidateNo(apply.getCandidateNo());
      examScore.setExamTime(new Date());
      //新增考试成绩
      examScoreService.save(examScore);
      boolean save = examScoreService.save(examScore);
      if (save) {
      //内网同步
      Long sid = examScore.getId();
      String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
@@ -716,14 +742,16 @@
         "," + "'" + examScore.getUserId() +"'" +
         ","  +"'" + examScore.getExamId() +"'" +
         ","  +"'" + examScore.getApplyId() + "'" + ")";
      FtpUtil.sqlFileUpload(s);
         //FtpUtil.sqlFileUpload(s);
         myAsyncService.FTP(s);
      }
      return examScore;
   }
   /**
    * test
    *
    * @return
    */
   @GetMapping("/test")