| | |
| | | import org.springblade.modules.exam.util.SecurityPaperUtil; |
| | | import org.springblade.modules.exam.vo.ExamScoreVO; |
| | | import org.springblade.modules.exam.vo.UpdateParamVo; |
| | | import org.springblade.modules.securitypaper.entity.SecurityPaper; |
| | | import org.springblade.modules.securitypaper.service.SecurityPaperService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | |
| | | |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | private final IRoleService roleService; |
| | | private final SecurityPaperService securityPaperService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | | user1.setSecuritynumber(result); |
| | | //发证日期 |
| | | // user1.setPaperTime(new Date()); |
| | | |
| | | //生成保安证的同时向保安证管理表中插入一条数据 |
| | | SecurityPaper securityPaper = new SecurityPaper(); |
| | | securityPaper.setUserId(user1.getId()); |
| | | securityPaper.setNumber(result); |
| | | securityPaper.setCreateTime(new Date()); |
| | | securityPaper.setIdCardNo(user.getCardid()); |
| | | securityPaper.setPeopleName(user1.getRealName()); |
| | | securityPaper.setExamId(Long.parseLong(examScore1.getExamId())); |
| | | securityPaper.setApplyId(examScore1.getApplyId()); |
| | | //新增保安员证信息 |
| | | securityPaperService.save(securityPaper); |
| | | //修改为持证保安 |
| | | user1.setHold("1"); |
| | | //分配保安角色 |
| | | // Role role = new Role(); |
| | | // role.setRoleAlias("保安"); |
| | | // Role oneRole = roleService.getOne(Condition.getQueryWrapper(role)); |
| | | // user.setRoleId(oneRole.getId().toString()); |
| | | //更新保安数据 |
| | | userService.updateById(user1); |
| | | |
| | | //数据同步 |
| | | String s1 = |
| | | "update blade_user set hold = " + "'" + user1.getHold() + "'" + |
| | | ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" + |
| | | ",user_type = " + "'" + user1.getUserType() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | |
| | | // String s1 = |
| | | // "insert into sys_security_paper(id,number,create_time,people_name,id_card_no,user_id,apply_id,exam_id) " + |
| | | // "values(" + "'" + securityPaper.getId() + "'" |
| | | // + "," + "'" + securityPaper.getNumber() +"'" |
| | | // + "," + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(securityPaper.getCreateTime()) +"'" |
| | | // + "," + "'" + securityPaper.getPeopleName() + "'" |
| | | // + "," + "'" + securityPaper.getIdCardNo() + "'" |
| | | // + "," + "'" + securityPaper.getUserId() + "'" |
| | | // + "," + "'" + securityPaper.getApplyId() + "'" |
| | | // + "," +"'" + securityPaper.getExamId() + "'" + ");" + |
| | | // "update blade_user set hold = " + "'" + user1.getHold() + "'" + |
| | | // ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" + |
| | | // ",user_type = " + "'" + user1.getUserType() + "'" + |
| | | // " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | } |
| | | } else { |