1.二维码代码同步
2.派遣,成绩查询,缴费查询,培训报名查询,心理资讯查询修改
20 files modified
2 files added
| | |
| | | <groupId>org.testng</groupId> |
| | | <artifactId>testng</artifactId> |
| | | </dependency> |
| | | <!-- 二维码生成 --> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>javase</artifactId> |
| | | <version>3.3.3</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| New file |
| | |
| | | package org.springblade.common.utils; |
| | | |
| | | import com.github.xiaoymin.knife4j.core.util.StrUtil; |
| | | import com.google.zxing.BarcodeFormat; |
| | | import com.google.zxing.EncodeHintType; |
| | | import com.google.zxing.WriterException; |
| | | import com.google.zxing.client.j2se.MatrixToImageWriter; |
| | | import com.google.zxing.common.BitMatrix; |
| | | import com.google.zxing.qrcode.QRCodeWriter; |
| | | import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; |
| | | import com.itextpdf.xmp.impl.Base64; |
| | | import lombok.experimental.UtilityClass; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.ServletOutputStream; |
| | | import java.awt.*; |
| | | import java.awt.geom.RoundRectangle2D; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.net.URL; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * <p>QRCodeUtil</p> |
| | | * |
| | | * @author lvhaosir6 |
| | | * @version 1.0.0 |
| | | * @date 2020/7/8 |
| | | * @import_date 2021-8-24 |
| | | */ |
| | | @Slf4j |
| | | @UtilityClass |
| | | public class QRCodeUtil { |
| | | /** |
| | | * 默认宽度 |
| | | */ |
| | | private static final Integer WIDTH = 140; |
| | | /** |
| | | * 默认高度 |
| | | */ |
| | | private static final Integer HEIGHT = 140; |
| | | |
| | | /** |
| | | * LOGO 默认宽度 |
| | | */ |
| | | private static final Integer LOGO_WIDTH = 22; |
| | | /** |
| | | * LOGO 默认高度 |
| | | */ |
| | | private static final Integer LOGO_HEIGHT = 22; |
| | | |
| | | /** |
| | | * 图片格式 |
| | | */ |
| | | private static final String IMAGE_FORMAT = "png"; |
| | | private static final String CHARSET = "utf-8"; |
| | | /** |
| | | * 原生转码前面没有 data:image/png;base64 这些字段,返回给前端是无法被解析 |
| | | */ |
| | | private static final String BASE64_IMAGE = "data:image/png;base64,%s"; |
| | | |
| | | /** |
| | | * 生成二维码,使用默认尺寸 |
| | | * |
| | | * @param content 内容 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content) { |
| | | return getBase64Image(content, WIDTH, HEIGHT, null, null, null); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码,使用默认尺寸二维码,插入默认尺寸logo |
| | | * |
| | | * @param content 内容 |
| | | * @param logoUrl logo地址 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content, String logoUrl) { |
| | | return getBase64Image(content, WIDTH, HEIGHT, logoUrl, LOGO_WIDTH, LOGO_HEIGHT); |
| | | } |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @return |
| | | */ |
| | | public String getBase64QRCode(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | return getBase64Image(content, width, height, logoUrl, logoWidth, logoHeight); |
| | | } |
| | | |
| | | private String getBase64Image(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | ByteArrayOutputStream os = new ByteArrayOutputStream(); |
| | | BufferedImage bufferedImage = crateQRCode(content, width, height, logoUrl, logoWidth, logoHeight); |
| | | try { |
| | | ImageIO.write(bufferedImage, IMAGE_FORMAT, os); |
| | | } catch (IOException e) { |
| | | log.error("[生成二维码,错误{}]", e); |
| | | } |
| | | // 转出即可直接使用 |
| | | return String.format(BASE64_IMAGE, Base64.encode(os.toByteArray())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @return |
| | | */ |
| | | private BufferedImage crateQRCode(String content, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) { |
| | | if (StrUtil.isNotBlank(content)) { |
| | | ServletOutputStream stream = null; |
| | | HashMap<EncodeHintType, Comparable> hints = new HashMap<>(4); |
| | | // 指定字符编码为utf-8 |
| | | hints.put(EncodeHintType.CHARACTER_SET, CHARSET); |
| | | // 指定二维码的纠错等级为中级 |
| | | hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); |
| | | // 设置图片的边距 |
| | | hints.put(EncodeHintType.MARGIN, 2); |
| | | try { |
| | | QRCodeWriter writer = new QRCodeWriter(); |
| | | BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints); |
| | | BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | bufferedImage.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); |
| | | } |
| | | } |
| | | if (StrUtil.isNotBlank(logoUrl)) { |
| | | insertLogo(bufferedImage, width, height, logoUrl, logoWidth, logoHeight); |
| | | } |
| | | return bufferedImage; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | if (stream != null) { |
| | | try { |
| | | stream.flush(); |
| | | stream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 二维码插入logo |
| | | * |
| | | * @param source 二维码 |
| | | * @param width 二维码宽度 |
| | | * @param height 二维码高度 |
| | | * @param logoUrl logo 在线地址 |
| | | * @param logoWidth logo 宽度 |
| | | * @param logoHeight logo 高度 |
| | | * @throws Exception |
| | | */ |
| | | private void insertLogo(BufferedImage source, Integer width, Integer height, String logoUrl, Integer logoWidth, Integer logoHeight) throws Exception { |
| | | // logo 源可为 File/InputStream/URL |
| | | Image src = ImageIO.read(new URL(logoUrl)); |
| | | // 插入LOGO |
| | | Graphics2D graph = source.createGraphics(); |
| | | int x = (width - logoWidth) / 2; |
| | | int y = (height - logoHeight) / 2; |
| | | graph.drawImage(src, x, y, logoWidth, logoHeight, null); |
| | | Shape shape = new RoundRectangle2D.Float(x, y, logoWidth, logoHeight, 6, 6); |
| | | graph.setStroke(new BasicStroke(3f)); |
| | | graph.draw(shape); |
| | | graph.dispose(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param output 输出流 |
| | | * @throws IOException |
| | | */ |
| | | public void getQRCode(String content, OutputStream output) throws IOException { |
| | | BufferedImage image = crateQRCode(content, WIDTH, HEIGHT, null, null, null); |
| | | ImageIO.write(image, IMAGE_FORMAT, output); |
| | | } |
| | | |
| | | /** |
| | | * 获取二维码 |
| | | * |
| | | * @param content 内容 |
| | | * @param logoUrl logo资源 |
| | | * @param output 输出流 |
| | | * @throws Exception |
| | | */ |
| | | public void getQRCode(String content, String logoUrl, OutputStream output) throws Exception { |
| | | BufferedImage image = crateQRCode(content, WIDTH, HEIGHT, logoUrl, LOGO_WIDTH, LOGO_HEIGHT); |
| | | ImageIO.write(image, IMAGE_FORMAT, output); |
| | | } |
| | | |
| | | /** |
| | | *高度——height, |
| | | * 宽度——width, |
| | | * 二维码内容——text(url需要自动跳转前面加上https://) |
| | | */ |
| | | public static byte[] getQRCodeImage(String text, int width, int height) throws WriterException, IOException { |
| | | QRCodeWriter qrCodeWriter = new QRCodeWriter(); |
| | | |
| | | HashMap<EncodeHintType, Object> hints = new HashMap<>(); |
| | | hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); |
| | | |
| | | BitMatrix bitMatrix =qrCodeWriter.encode(text,BarcodeFormat.QR_CODE, width, height,hints); |
| | | //BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height); |
| | | |
| | | ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream(); |
| | | MatrixToImageWriter.writeToStream(bitMatrix, "JPG", pngOutputStream); |
| | | //返回 |
| | | return pngOutputStream.toByteArray(); |
| | | } |
| | | |
| | | } |
| | |
| | | <if test="examPayment.deptName!=null and examPayment.deptName!=''"> |
| | | and bd.dept_name like concat('%', #{examPayment.deptName},'%') |
| | | </if> |
| | | <if test="examPayment.type!=null"> |
| | | and se.type = #{examPayment.type} |
| | | </if> |
| | | <if test="examPayment.paymentStatus!=null"> |
| | | and se.payment_status = #{examPayment.paymentStatus} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--考试报名详情信息--> |
| | |
| | | import org.springblade.modules.apply.vo.ExamPaymentVO; |
| | | import org.springblade.modules.exam.entity.ExamPaper; |
| | | import org.springblade.modules.exam.service.ExamPaperService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | private final ApplyService applyService; |
| | | |
| | | private final IDeptService deptService; |
| | | |
| | | private final IUserService userService; |
| | | |
| | | |
| | | /** |
| | | * 自定义分页数据 |
| | |
| | | for (ExamPaymentVO examPaymentVO : examPaymentVOS) { |
| | | //查询人数 |
| | | examPaymentVO.setNum(applyService.getApplyNum(examPaymentVO.getApplyCode())); |
| | | //如果为公司缴费 |
| | | if (examPaymentVO.getType()==1){ |
| | | //查询公司名称 |
| | | Dept dept = deptService.getById(examPaymentVO.getWorkerId()); |
| | | if (null!=dept){ |
| | | examPaymentVO.setDeptName(dept.getDeptName()); |
| | | } |
| | | } |
| | | //如果为个人缴费 |
| | | if (examPaymentVO.getType()==2){ |
| | | //查询公司名称 |
| | | User user = userService.getById(examPaymentVO.getWorkerId()); |
| | | if (null!=user){ |
| | | examPaymentVO.setDeptName(user.getRealName()); |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(examPaymentVOS); |
| | | } |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 保安单位名称 |
| | | * 保安单位名称(人员名称) |
| | | */ |
| | | private String deptName; |
| | | |
| | |
| | | <!--派遣记录分页数据--> |
| | | <select id="selectDispatcherPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO"> |
| | | select |
| | | sd.*,sdu.name dispatcherCompany |
| | | sd.*,bu.real_name securityName,sdu.name dispatcherCompany,bu.cardid idCardNo |
| | | from |
| | | sys_dispatcher sd |
| | | sys_dispatcher sd |
| | | left join |
| | | sys_dispatcher_unit sdu |
| | | sys_dispatcher_unit sdu |
| | | on |
| | | sdu.id = sd.dispatcher_unit_id |
| | | sdu.id = sd.dispatcher_unit_id |
| | | left join |
| | | blade_user bu |
| | | on |
| | | bu.id = sd.user_ids |
| | | where 1=1 |
| | | <if test="dispatcher.dispatcherUnitId!=null"> |
| | | and sd.dispatcher_unit_id = #{dispatcher.dispatcherUnitId} |
| | |
| | | <if test="dispatcher.deptId!=null"> |
| | | and sd.dept_id = #{dispatcher.deptId} |
| | | </if> |
| | | <if test="dispatcher.dispatch!=null and dispatcher.dispatch!=''"> |
| | | and bu.dispatch = #{dispatcher.dispatch} |
| | | and sd.status = #{dispatcher.dispatch} |
| | | </if> |
| | | <if test="dispatcher.userIds!=null and dispatcher.userIds!=''"> |
| | | and sd.user_ids like concat('%', #{dispatcher.userIds},'%') |
| | | </if> |
| | | <if test="dispatcher.name!=null and dispatcher.name!=''"> |
| | | and sd.name like concat('%', #{dispatcher.name},'%') |
| | | </if> |
| | | <if test="dispatcher.cardid!=null and dispatcher.cardid!=''"> |
| | | and sd.cardid like concat('%', #{dispatcher.cardid},'%') |
| | | </if> |
| | | <if test="dispatcher.userIds!=null and dispatcher.userIds!=''"> |
| | | and sd.user_ids like concat('%', #{dispatcher.userIds},'%') |
| | | </if> |
| | | <if test="dispatcher.dispatcherCompany!=null and dispatcher.dispatcherCompany!=''"> |
| | | and sdu.name like concat('%', #{dispatcher.dispatcherCompany},'%') |
| | | </if> |
| | | <if test="dispatcher.beginTime!=null or dispatcher.overTime!=null"> |
| | | <if test="dispatcher.beginTime!='' or dispatcher.overTime!=''"> |
| | | and sd.end_time <= #{dispatcher.overTime} and sd.end_time >= #{dispatcher.beginTime} |
| | | or ( sd.dispatcherTime <= #{dispatcher.overTime} and sd.dispatcherTime >= #{dispatcher.beginTime}) |
| | | </if> |
| | | </if> |
| | | </select> |
| | | |
| | | <!--派遣记录详情--> |
| | |
| | | */ |
| | | private String deptName; |
| | | |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private String beginTime; |
| | | |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private String overTime; |
| | | |
| | | /** |
| | | * 保安人员名称 |
| | | */ |
| | | private String securityName; |
| | | |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | private String idCardNo; |
| | | |
| | | /** |
| | | * 派遣状态 0:已派遣, 1:未派遣或派遣结束 |
| | | */ |
| | | private String dispatch; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.qrcode; |
| | | |
| | | import com.google.zxing.WriterException; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.QRCodeUtil; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | |
| | | /** |
| | | * @author zhongrj |
| | | * @date 2021-08-24 |
| | | * 二维码生成 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/qrCode") |
| | | @AllArgsConstructor |
| | | public class QrCodeController { |
| | | |
| | | private final IUserService userService; |
| | | |
| | | /** |
| | | * 二维码生成-字节流 |
| | | * @param securityNumber 保安证编号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQrCode") |
| | | public ResponseEntity<byte[]> getQrCode(String securityNumber){ |
| | | // 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; |
| | | // "&realName=" + one.getRealName() + |
| | | // "&age=" + one.getAge() + |
| | | // "&sex=" + one.getSex() + |
| | | // "&avatar=" + one.getAvatar() + |
| | | // "&deptName=" + one.getDeptName(); |
| | | |
| | | |
| | | ResponseEntity<byte[]> aEntity = null; |
| | | try { |
| | | URLEncoder.encode(content,"utf-8"); |
| | | byte[] qrCodeImage = QRCodeUtil.getQRCodeImage(content, 350, 350); |
| | | // Set headers |
| | | final HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.IMAGE_PNG); |
| | | aEntity = new ResponseEntity<byte[]>(qrCodeImage, headers, HttpStatus.CREATED); |
| | | } catch (WriterException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return aEntity; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 二维码生成base64 |
| | | * @param securityNumber 保安证编号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getQrCodeBase64") |
| | | public String getQrCodeBase64(String securityNumber) throws Exception{ |
| | | // 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); |
| | | String encode = new BASE64Encoder().encode(qrCodeImage); |
| | | return "data:image/png;base64,"+encode; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 根据保安员编码查询保安员信息 |
| | | * @param securityNumber |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserInfo") |
| | | public UserVO getUserInfo(String securityNumber){ |
| | | //根据保安员编码查询保安员信息 |
| | | return userService.getUserInfoBySecurityNumber(securityNumber); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/security_lazy-tree") |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> securityLazyTree(String tenantId, Long parentId, BladeUser bladeUser) { |
| | | List<DeptVO> tree = deptService.securityLazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId); |
| | | public R<List<DeptVO>> securityLazyTree(String jurisdiction, Long parentId) { |
| | | List<DeptVO> tree = deptService.securityLazyTree(jurisdiction,parentId); |
| | | return R.data(tree); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | List<DeptVO> securityLazyTree(String tenantId, Long parentId); |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | </select> |
| | | <select id="securityLazyTree" resultMap="treeNodeResultMap"> |
| | | SELECT |
| | | DISTINCT |
| | | dept.id, |
| | | dept.parent_id, |
| | | dept.dept_name AS title, |
| | |
| | | ) AS "has_children" |
| | | FROM |
| | | blade_dept dept |
| | | left join |
| | | sys_information si |
| | | on |
| | | si.departmentid = dept.id |
| | | WHERE |
| | | dept.parent_id = #{param2} AND dept.is_deleted = 0 |
| | | 1=1 |
| | | and dept_category = 1 |
| | | <if test="param1!=null and param1!=''"> |
| | | and dept.tenant_id = #{param1} |
| | | AND dept.is_deleted = 0 |
| | | and dept.id !=1420222961377357825 |
| | | and dept.parent_id!=1420222961377357825 |
| | | <if test="param1!=null and param1!='' and param1!='1123598813738675201'"> |
| | | and si.jurisdiction = #{param1} |
| | | </if> |
| | | ORDER BY dept.sort |
| | | </select> |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<User> selectUserPages(IPage<User> page,@Param("user") User user); |
| | | |
| | | /** |
| | | * 根据保安员编码查询保安员信息 |
| | | * @param securityNumber |
| | | * @return |
| | | */ |
| | | UserVO getUserInfoBySecurityNumber(@Param("securityNumber") String securityNumber); |
| | | } |
| | |
| | | and tenant_id = #{user.tenantId} |
| | | </if> |
| | | <if test="user.account!=null and user.account != ''"> |
| | | and account != #{user.account} |
| | | and account like concat('%', #{user.account},'%') |
| | | </if> |
| | | <if test="user.realName!=null and user.realName != ''"> |
| | | and real_name like concat(concat('%', #{user.realName}),'%') |
| | | and real_name like concat('%', #{user.realName},'%') |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId != ''"> |
| | | and dept_id like concat(concat('%', #{user.deptId}),'%') |
| | |
| | | <select id="selectUserPages" resultMap="userResultMaps"> |
| | | select |
| | | bu.*, |
| | | TIMESTAMPDIFF(YEAR, bu.birthday, CURDATE()) age |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( cardid,7,4),0) age |
| | | from |
| | | blade_user bu |
| | | left join |
| | |
| | | <if test="user.hold!=null and user.hold != ''"> |
| | | and bu.hold = #{user.hold} |
| | | </if> |
| | | <if test="user.jurisdiction!=null and user.jurisdiction != '' and user.jurisdiction != '1123598813738675201'"> |
| | | <if test="user.jurisdiction!=null and user.jurisdiction != '' and user.jurisdiction != '1372091709474910209'"> |
| | | and si.jurisdiction = #{user.jurisdiction} |
| | | </if> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | |
| | | <!--保安员列表--> |
| | | <select id="selectUserPageSecurity" resultMap="userResultMaps"> |
| | | select |
| | | bu.*,bd.dept_name as deptName |
| | | bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age, |
| | | bd.dept_name as deptName |
| | | from |
| | | blade_user bu |
| | | left join |
| | |
| | | and bu.jurisdiction = #{user.jurisdiction} |
| | | </if> |
| | | <if test="user.securitynumber!=null and user.securitynumber != ''"> |
| | | and bu.securitynumber = #{user.securitynumber} |
| | | and bu.securitynumber like concat('%', #{user.securitynumber},'%') |
| | | </if> |
| | | <if test="user.deptId!=null and user.deptId!=''"> |
| | | and bu.dept_id =#{user.deptId} |
| | |
| | | where examination_type is null |
| | | </select> |
| | | |
| | | <!--根据保安员编码查询保安信息--> |
| | | <select id="getUserInfoBySecurityNumber" resultType="org.springblade.modules.system.vo.UserVO"> |
| | | select |
| | | bu.*, |
| | | ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( cardid,7,4),0) age, |
| | | bd.dept_name deptName |
| | | from |
| | | blade_user bu |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bu.dept_id = bd.id |
| | | where securitynumber = #{securityNumber} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | List<Map<Object,String>> selectId(String id); |
| | | Map<Object,Object> selectHold(String deptid); |
| | | List<String> selectIn(); |
| | | List<DeptVO> securityLazyTree(String tenantId, Long parentId); |
| | | List<DeptVO> securityLazyTree(String jurisdiction, Long parentId); |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构(包含用户数据) |
| | |
| | | * @return |
| | | */ |
| | | List<TreeNodes> lazyTreeUsers(Integer type, Long deptId); |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | IPage<User> selectUserPages(IPage<User> page, User user); |
| | | |
| | | /** |
| | | * 根据保安员编码查询保安员信息 |
| | | * @param securityNumber |
| | | * @return |
| | | */ |
| | | UserVO getUserInfoBySecurityNumber(String securityNumber); |
| | | } |
| | |
| | | * 懒加载获取部门树形结构,不包含顶级管理员公安局 |
| | | */ |
| | | @Override |
| | | public List<DeptVO> securityLazyTree(String tenantId, Long parentId) { |
| | | if (AuthUtil.isAdministrator()) { |
| | | tenantId = StringPool.EMPTY; |
| | | } |
| | | return ForestNodeMerger.merge(baseMapper.securityLazyTree(tenantId, parentId)); |
| | | public List<DeptVO> securityLazyTree(String jurisdiction, Long parentId) { |
| | | return ForestNodeMerger.merge(baseMapper.securityLazyTree(jurisdiction, parentId)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public IPage<User> selectUserPages(IPage<User> page, User user) { |
| | | return page.setRecords(baseMapper.selectUserPages(page, user)); |
| | | } |
| | | |
| | | /** |
| | | * 根据保安员编码查询保安员信息 |
| | | * @param securityNumber |
| | | * @return |
| | | */ |
| | | @Override |
| | | public UserVO getUserInfoBySecurityNumber(String securityNumber) { |
| | | return baseMapper.getUserInfoBySecurityNumber(securityNumber); |
| | | } |
| | | } |
| | |
| | | private String sort; |
| | | |
| | | /** |
| | | * 排序 |
| | | * 年龄 |
| | | */ |
| | | private Integer age; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.talk.entity.Talk; |
| | | import org.springblade.modules.talk.vo.TalkVO; |
| | | |
| | |
| | | * @param talk |
| | | * @return |
| | | */ |
| | | List<TalkVO> selectTalkPage(IPage page, TalkVO talk); |
| | | List<TalkVO> selectTalkPage(IPage page, @Param("talk") TalkVO talk); |
| | | |
| | | } |
| | |
| | | |
| | | <select id="selectTalkPage" resultMap="talkResultMap"> |
| | | select * from sys_talk where 1=1 |
| | | <if test="talk.deptid!=null and alk.deptid!='' and alk.deptid!='1123598813738675201'"> |
| | | deptid=#{talk.deptid} |
| | | <if test="talk.deptid!=null and talk.deptid!='' and talk.deptid!='1123598813738675201'"> |
| | | and deptid = #{talk.deptid} |
| | | </if> |
| | | <if test="talk.realName!=null and talk.realName!=''"> |
| | | and real_name like concat('%',#{talk.realName},'%') |
| | | </if> |
| | | <if test="talk.title!=null and talk.title!=''"> |
| | | and title like concat('%',#{talk.title},'%') |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | @TableField("candidate_no") |
| | | private String candidateNo; |
| | | |
| | | /** |
| | | * 审核状态 1:审核通过 2:未通过审核 3:已提交审核 4:未提交审核 |
| | | */ |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | } |
| | |
| | | <if test="trainingRegistration.userId!=null and trainingRegistration.userId!=''"> |
| | | and sr.user_id = #{trainingRegistration.userId} |
| | | </if> |
| | | <if test="trainingRegistration.trainUnitName!=null and trainingRegistration.trainUnitName!=''"> |
| | | and bt0.dept_name like concat('%', #{trainingRegistration.trainUnitName},'%') |
| | | </if> |
| | | <if test="trainingRegistration.deptName!=null and trainingRegistration.deptName!=''"> |
| | | and bt.dept_name like concat('%', #{trainingRegistration.deptName},'%') |
| | | </if> |