| | |
| | | return R.status(examScoreService.updateById(examScore)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 缺考标记修改 |
| | | * |
| | | * @param examScore 考试成绩信息对象 |
| | | */ |
| | | @PostMapping("/updateAbsent") |
| | | public R updateAbsent(@RequestBody ExamScore examScore) { |
| | | examScore.setQualified(3); |
| | | boolean status = examScoreService.updateByIdAndQualifiee(examScore); |
| | | |
| | | //内网数据推送 |
| | | String s1 = |
| | | "update exam_score set qualified = " + "'" + examScore.getQualified() + "'" + |
| | | " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(status); |
| | | } |
| | | |
| | | /** |
| | | * 修改总成绩 |
| | | * |
| | |
| | | //去生成保安证编号 |
| | | String pre = SecurityPaperUtil.getSecurityPaper(); |
| | | //查询当前年份已有的保安证编号 |
| | | int count = userService.getSecurityPaperCount(pre); |
| | | int max = userService.getSecurityPaperCount(pre); |
| | | String result = null; |
| | | if (count == 0) { |
| | | if (max == 0) { |
| | | result = pre + "00000"; |
| | | } else { |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | result = pre + (decimalFormat.format(count++)); |
| | | max++; |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | | //发证日期 |
| | |
| | | //修改为持证保安 |
| | | user.setHold("1"); |
| | | //分配保安角色 |
| | | Role role = new Role(); |
| | | role.setRoleAlias("保安"); |
| | | Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | // Role role = new Role(); |
| | | // role.setRoleAlias("保安"); |
| | | // Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | // user.setRoleId(oneRole.getId().toString()); |
| | | //更新保安数据 |
| | | userService.updateById(user); |
| | | |
| | | String s1 = |
| | | "update blade_user set role_id = " + "'" + user.getRoleId() + "'" + |
| | | ",hold = " + "'" + user.getHold() + "'" + |
| | | "update blade_user set hold = " + "'" + user.getHold() + "'" + |
| | | ",securitynumber = " + "'" + user.getSecuritynumber() + "'" + |
| | | ",paper_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(user.getPaperTime()) + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | |
| | | cjhz.put("sccj",sccj); |
| | | return R.data(cjhz); |
| | | } |
| | | |
| | | /** |
| | | * 考试合格人数对比统计 |
| | | */ |
| | | @GetMapping("score-stat") |
| | | @ApiOperation(value = "分数统计") |
| | | public R scoreStat(HttpServletResponse response, String deptid, String jurisdiction) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | List<Object> mapList = examScoreService.scoreStat(deptid, jurisdiction); |
| | | return R.data(mapList); |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param query page,size |
| | | */ |
| | | @GetMapping("/score-page") |
| | | public R<IPage<ExamScoreVO>> scorePage(Query query, String deptid, String jurisdiction,String realName) { |
| | | IPage<ExamScoreVO> pages = examScoreService.scorePage(Condition.getPage(query),deptid,jurisdiction,realName); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | } |