1.保安公司查询修改
2.报名列表修改
3.考试列表查询修改
4.保安员导入修改
| | |
| | | * @param list |
| | | */ |
| | | void insertBatch(@Param("list")List<ExamExaminationSubject> list); |
| | | |
| | | /** |
| | | * 查询报名人数 |
| | | * @param examPaperVO1 |
| | | * @return |
| | | */ |
| | | Integer getExamNumber(@Param("examPaper") ExamPaperVO examPaperVO1); |
| | | } |
| | |
| | | |
| | | <!--查询当前考试的报名人员数量,模拟考试--> |
| | | <select id="getTrainNumber" resultType="java.lang.Integer"> |
| | | select count(*) from sys_training_registration |
| | | select count(*) from sys_training_registration str |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = str.user_id |
| | | where |
| | | train_exam_id = #{examPaper.id} |
| | | and cancel = 1 |
| | | bu.is_deleted = 0 and bu.status = 1 |
| | | and train_exam_id = #{examPaper.id} |
| | | </select> |
| | | |
| | | <!--根据用户id查询报名信息--> |
| | |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!--查询当前考试的报名人员数量,模拟考试--> |
| | | <select id="getExamNumber" resultType="java.lang.Integer"> |
| | | select count(*) from sys_training_registration str |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = str.user_id |
| | | where |
| | | bu.is_deleted = 0 and bu.status = 1 |
| | | and train_exam_id = #{examPaper.id} |
| | | and (is_exam = 2 or is_exam = 3) |
| | | and cancel = 1 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | //模拟考试 |
| | | if (examPaperVO1.getExamType()==2) { |
| | | examPaperVO1.setNum(baseMapper.getTrainNumber(examPaperVO1)); |
| | | examPaperVO1.setExamNum(baseMapper.getExamNumber(examPaperVO1)); |
| | | } |
| | | }); |
| | | return examPaperVOIPage; |
| | |
| | | * 得分 |
| | | */ |
| | | private Long scoreId; |
| | | |
| | | /** |
| | | * 考试人数 |
| | | */ |
| | | private Integer examNum; |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.information.entity.Information; |
| | | import org.springblade.modules.information.vo.InformationVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | void deleteUserByDeptId(@Param("deptId") String deptId); |
| | | String selJurchilder(String id); |
| | | |
| | | /** |
| | | * 查询当前单位是否有子级单位 |
| | | * @param informationVO |
| | | * @return |
| | | */ |
| | | List<Dept> getDeptHashChildren(@Param("information") InformationVO informationVO); |
| | | |
| | | /** |
| | | * 查询单位的人数 |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | int selectInformationUserNumCount(@Param("dept")Dept dept); |
| | | |
| | | /** |
| | | * 查询单位的已派遣人数 |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | int selectInformationDispatcherNumCount(@Param("dept")Dept dept); |
| | | |
| | | /** |
| | | * 查询单位持证的人数 |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | int selectInformationHoldNumCount(@Param("dept")Dept dept); |
| | | } |
| | |
| | | sys_jurisdiction sj |
| | | on |
| | | sj.id = i.jurisdiction |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = i.departmentid |
| | | where 1=1 |
| | | <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'"> |
| | | and (sj.id=#{information.jurisdiction} or sj.parent_id=#{information.jurisdiction}) |
| | |
| | | and i.representative like concat(concat('%', #{information.representative}),'%') |
| | | </if> |
| | | <if test="information.stats!=null and information.stats!=''"> |
| | | and i.stats=#{information.stats} |
| | | and i.stats=#{information.stats} and bd.dept_category = 1 |
| | | </if> |
| | | <if test="information.departmentid!=null and information.departmentid!=''"> |
| | | and i.departmentid=#{information.departmentid} |
| | |
| | | WHERE parent_id = #{id} |
| | | </select> |
| | | |
| | | <!--查询当前单位是否有子级单位--> |
| | | <select id="getDeptHashChildren" resultType="org.springblade.modules.system.entity.Dept"> |
| | | select * from blade_dept where is_deleted = 0 and parent_id = #{information.departmentid} |
| | | </select> |
| | | |
| | | <!--查询单位的人数--> |
| | | <select id="selectInformationUserNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT( * ) FROM blade_user |
| | | WHERE 1=1 |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | and dept_id = #{dept.id} |
| | | </select> |
| | | |
| | | <!--查询单位的已派遣人数--> |
| | | <select id="selectInformationDispatcherNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT( * ) FROM blade_user |
| | | WHERE 1=1 |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND dispatch=0 |
| | | and dept_id = #{dept.id} |
| | | </select> |
| | | |
| | | <!--查询单位持证的人数--> |
| | | <select id="selectInformationHoldNumCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT( * ) FROM blade_user |
| | | WHERE 1=1 |
| | | and role_id = '1412226235153731586' |
| | | and is_deleted = 0 |
| | | AND status=1 |
| | | AND hold=1 |
| | | and dept_id = #{dept.id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | @Override |
| | | public IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information) { |
| | | return page.setRecords(baseMapper.selectInformationPage(page, information)); |
| | | List<InformationVO> informationVOS = baseMapper.selectInformationPage(page, information); |
| | | //遍历 |
| | | if (informationVOS.size()>0){ |
| | | //判断有无子级 |
| | | for (InformationVO informationVO : informationVOS) { |
| | | List<Dept> deptList = baseMapper.getDeptHashChildren(informationVO); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | for (Dept dept : deptList) { |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + Integer.parseInt(informationVO.getZnum()); |
| | | informationVO.setZnum(z.toString()); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + Integer.parseInt(informationVO.getPnum()); |
| | | informationVO.setPnum(p.toString()); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + Integer.parseInt(informationVO.getCnum()); |
| | | informationVO.setCnum(c.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(informationVOS); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | | /** |
| | | * 上传文件 |
| | | * |
| | | * @param file 文件 |
| | | * @return ObjectStat |
| | | */ |
| | | @SneakyThrows |
| | | @PostMapping("/put-file-user-avatar") |
| | | public R putFileUserAvatar(@RequestParam MultipartFile file) { |
| | | double size = file.getSize()/1024; |
| | | if (size<=30){ |
| | | throw new ServiceException("图片大小不能低于30KB"); |
| | | } |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://223.82.109.183:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | | .credentials(access, secret) |
| | | .build(); |
| | | // 检查存储桶是否已经存在 |
| | | boolean isExist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucket).build()); |
| | | if (!isExist) { |
| | | // 创建一个名为zip的存储桶,用于zip文件。 |
| | | minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucket).build()); |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | | Map<String, String> headers = new HashMap<>(1 << 2); |
| | | //添加自定义内容类型 |
| | | headers.put("Content-Type", "application/octet-stream"); |
| | | //上传 |
| | | minioClient.putObject( |
| | | PutObjectArgs.builder().bucket(bucket).object(newName).stream( |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://223.82.109.183:2081/zhba/" + newName; |
| | | //数据封装 |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("name", newName); |
| | | map.put("url", urls); |
| | | //返回 |
| | | return R.data(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * app 文件上传 |
| | |
| | | } |
| | | } |
| | | |
| | | //如果是异常标记 |
| | | if (null!=user.getExaminationType() && !user.getExaminationType().equals("")){ |
| | | if (user.getExaminationType().equals("1")) { |
| | | //吊销保安证 |
| | | user.setHold("3"); |
| | | } |
| | | } |
| | | |
| | | user.setPassword(user1.getPassword()); |
| | | userService.updateById(user); |
| | | String rtime; |
| | |
| | | + ",registered = " + "'" + user.getRegistered() + "'" |
| | | + ",securitynumber = " + "'" + user.getSecuritynumber() + "'" |
| | | + ",hold = " + "'" + user.getHold() + "'" |
| | | + ",cell = " + "'" + user.getCell() + "'" |
| | | + " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.success("修改成功"); |
| | |
| | | if (null!=user.getCell() && !user.getCell().equals("")) { |
| | | if (user.getCell().equals("2")){ |
| | | list.forEach(user2 -> { |
| | | user2.setStatus(2); |
| | | //先将原有人员离职 cell 1:手动录入 2:自动录入 |
| | | userService.updateById(user2); |
| | | //内网同步 |
| | | String s1 = "update blade_user set status = " + user2.getStatus() + |
| | | " where id = " + "'" + user2.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //判断是否在本单位,如果是本单位,则不能再次新增 |
| | | if(!user2.getDeptId().equals(user.getDeptId())) { |
| | | user2.setStatus(2); |
| | | //先将原有人员离职 cell 1:手动录入 2:自动录入 |
| | | userService.updateById(user2); |
| | | //内网同步 |
| | | String s1 = "update blade_user set status = " + user2.getStatus() + |
| | | " where id = " + "'" + user2.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }else { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | } |
| | | }); |
| | | }else { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | | } |
| | | }else { |
| | | throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount())); |
| | |
| | | * @param isCovered |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importSecurity(List<SecurityExcel> data, Boolean isCovered, String deptId) { |
| | | //将不能导入的保安员账号存起来 |
| | | List<String> errorList = new ArrayList<>(); |
| | |
| | | <if test="trainingRegistration.idCardNo!=null and trainingRegistration.idCardNo!=''"> |
| | | and bu.cardid like concat('%', #{trainingRegistration.idCardNo},'%') |
| | | </if> |
| | | <if test="trainingRegistration.cancel!=null"> |
| | | <if test="trainingRegistration.cancel!=null and trainingRegistration.cancel!=0"> |
| | | and sr.cancel = #{trainingRegistration.cancel} |
| | | </if> |
| | | <if test="trainingRegistration.isTrain!=null"> |
| | |
| | | if (null!=detail.getReplyDeptIds() && detail.getReplyDeptIds()!="" && !detail.getReplyDeptIds().isEmpty()) { |
| | | List<String> replyDeptIds = Arrays.asList(detail.getReplyDeptIds().split(",")); |
| | | StringBuilder replyDeptNameInfo = new StringBuilder(); |
| | | for (String deptId : replyDeptIds) { |
| | | //查询接收人单位信息 |
| | | Dept deptDetail = deptService.getById(Long.parseLong(deptId)); |
| | | replyDeptNameInfo = replyDeptNameInfo.append(deptDetail.getDeptName()).append(","); |
| | | if (replyDeptIds.size()>0) { |
| | | for (String deptId : replyDeptIds) { |
| | | //查询接收人单位信息 |
| | | Dept deptDetail = deptService.getById(Long.parseLong(deptId)); |
| | | if (null!= deptDetail) { |
| | | replyDeptNameInfo = replyDeptNameInfo.append(deptDetail.getDeptName()).append(","); |
| | | } |
| | | } |
| | | if (replyDeptNameInfo.length()>0) { |
| | | //截取 |
| | | return replyDeptNameInfo.substring(0, replyDeptNameInfo.length() - 1); |
| | | } |
| | | } |
| | | //截取 |
| | | return replyDeptNameInfo.substring(0, replyDeptNameInfo.length() - 1); |
| | | } |
| | | return null; |
| | | } |