From cc057177b2fb17aee9a173a6adbabdc578fd74c7 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 06 Dec 2021 10:30:44 +0800
Subject: [PATCH] 1.许可
---
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java | 62 ++++++++++++++++++++++++++----
1 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java b/src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
index 14f26a7..a3b6246 100644
--- a/src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
+++ b/src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -115,6 +115,25 @@
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);
+ }
+
/**
* 修改总成绩
*
@@ -135,14 +154,15 @@
//去生成保安证编号
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);
//发证日期
@@ -150,16 +170,15 @@
//修改为持证保安
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() + "'";
@@ -315,4 +334,29 @@
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);
+ }
+
}
--
Gitblit v1.9.3