| | |
| | | //内网同步 |
| | | 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,exam_time,user_id,exam_id,apply_id) " + |
| | | // "values(" + "'" + sid + "'" + "," + "'" + |
| | | // format + "'" + "," + "'" + |
| | | // examScore.getUserId() +"'" + "," +"'" + |
| | | // examScore.getExamId() +"'" + "," +"'" + |
| | | // examScore.getApplyId() + "'" + ")"; |
| | | // FtpUtil.sqlFileUpload(s); |
| | | return examScore; |
| | | } |
| | | |
| | |
| | | apply1.setIsExam(3); |
| | | baseMapper.updateById(apply1); |
| | | |
| | | String s1 = |
| | | "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | // String s1 = |
| | | // "update sys_apply set is_exam = " + apply1.getIsExam() + " " +"where id = " + "'" + apply1.getId() + "'"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | //模拟考 |
| | | if (apply.getExamType()==2){ |
| | |
| | | trainingRegistration.setIsExam(3); |
| | | trainingRegistrationService.updateById(trainingRegistration); |
| | | |
| | | String s1 = |
| | | "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | // String s1 = |
| | | // "update sys_training_registration set is_exam = " + trainingRegistration.getIsExam() + " " +"where id = " + "'" + trainingRegistration.getId() + "'"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | } |
| | | |
| | |
| | | //去生成保安证编号 |
| | | 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++; |
| | | System.out.println("max = " + max); |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | | //发证日期 |
| | |
| | | } else { |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | result = pre + (decimalFormat.format(count++)); |
| | | count++; |
| | | System.out.println("count = " + count); |
| | | result = pre + (decimalFormat.format(count)); |
| | | } |
| | | user.setSecuritynumber(result); |
| | | //发证日期 |
| | |
| | | ResponseEntity<byte[]> aEntity = null; |
| | | try { |
| | | URLEncoder.encode(content,"utf-8"); |
| | | System.out.println("content = " + content); |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | | // Set headers |
| | | final HttpHeaders headers = new HttpHeaders(); |
| | |
| | | */ |
| | | @GetMapping("/getQrCodeBase64") |
| | | public String getQrCodeBase64(String securityNumber) throws Exception{ |
| | | String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | // String url = "http://s16s652780.51mypc.cn/securityInfo/securityInfo.html"; |
| | | String url = "http://223.82.109.183:2080/securityInfo.html"; |
| | | if (null!=securityNumber) { |
| | | String content = url + "?securityNumber=" + securityNumber; |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--查询当前年份已有的保安证编号--> |
| | | <!--查询当前年份已有的保安证编号,取倒数5位的最大值--> |
| | | <select id="getSecurityPaperCount" resultType="java.lang.Integer"> |
| | | select count(*) from blade_user |
| | | select ifnull(max(0+RIGHT(securitynumber,5)),0) from blade_user |
| | | where securitynumber like concat('%', #{pre},'%') |
| | | </select> |
| | | |
| | |
| | | if (null != userExcel.getHold() && userExcel.getHold() != "") { |
| | | if (userExcel.getHold().equals("是")) { |
| | | user.setHold("1"); |
| | | //分配保安角色 |
| | | Role role = new Role(); |
| | | role.setRoleAlias("保安"); |
| | | Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | } |
| | | if(userExcel.getHold().equals("否")) { |
| | | user.setHold("2"); |
| | | 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()); |
| | | //性别 |
| | | if (null!=userExcel.getSex()) { |
| | | if (userExcel.getSex().equals("男")) { |
| | | user.setSex(1); |
| | |
| | | if (null != userExcel.getHold() && userExcel.getHold() != "") { |
| | | if (userExcel.getHold().equals("是")) { |
| | | user.setHold("1"); |
| | | //分配保安角色 |
| | | Role role = new Role(); |
| | | role.setRoleAlias("保安"); |
| | | Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | user.setRoleId(oneRole.getId().toString()); |
| | | } |
| | | if(userExcel.getHold().equals("否")) { |
| | | user.setHold("2"); |
| | | 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()); |
| | | |
| | | if (null!=userExcel.getSex()) { |
| | | if (userExcel.getSex().equals("男")) { |
| | | user.setSex(1); |