| | |
| | | bu.real_name, |
| | | bu.cardId, |
| | | str.train_exam_id as examId, |
| | | bu.sex, |
| | | CASE WHEN ssir.id IS NULL THEN |
| | | '未签到' ELSE '已签到' |
| | | END AS state |
| | |
| | | //考试id |
| | | private String examId; |
| | | |
| | | private String sex; |
| | | |
| | | } |
| | |
| | | return R.success("操作成功"); |
| | | } |
| | | |
| | | // /** |
| | | // * 导出用户 |
| | | // */ |
| | | // @GetMapping("export-user") |
| | | // @ApiOperationSupport(order = 13) |
| | | // @ApiOperation(value = "导出用户", notes = "传入user") |
| | | // public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | /** |
| | | * 导出用户 |
| | | */ |
| | | @GetMapping("export-user") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出用户", notes = "传入user") |
| | | public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | // QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class); |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()); |
| | | // } |
| | | // queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | // List<UserExcel> list = userService.exportUser(queryWrapper); |
| | | // ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class); |
| | | // } |
| | | List<UserExcel> list = userService.exportUser(user); |
| | | ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | * 是否冻结 0:否 1:是 |
| | | */ |
| | | private Integer isFreeze; |
| | | // |
| | | // /** |
| | | // * 审核状态:1、审核通过;2、审核不通过 10、待审核 |
| | | // */ |
| | | // private Integer auditStatus; |
| | | } |
| | |
| | | @ExcelProperty("企业名称*") |
| | | private String deptId; |
| | | |
| | | @ColumnWidth(15) |
| | | @ExcelProperty("警号*") |
| | | private String code; |
| | | // @ColumnWidth(15) |
| | | // @ExcelProperty("警号*") |
| | | // private String code; |
| | | |
| | | @ColumnWidth(10) |
| | | @ExcelProperty("姓名*") |
| | |
| | | /** |
| | | * 获取导出用户数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper); |
| | | List<UserExcel> exportUser(@Param("obj") Map<String, Object> param); |
| | | |
| | | /** |
| | | * 通过 身份证号查询用户信息 |
| | |
| | | </select> |
| | | |
| | | <select id="exportUser" resultType="org.springblade.modules.system.excel.UserExcel"> |
| | | SELECT id, |
| | | tenant_id, |
| | | user_type, |
| | | account, |
| | | name, |
| | | real_name, |
| | | email, |
| | | phone, |
| | | birthday, |
| | | role_id, |
| | | dept_id, |
| | | post_id |
| | | FROM blade_user ${ew.customSqlSegment} |
| | | SELECT |
| | | bu.id, |
| | | bd.dept_name AS deptId, |
| | | bu.real_name, |
| | | bu.phone, |
| | | bu.sex, |
| | | bu.cardid |
| | | FROM |
| | | blade_user bu |
| | | LEFT JOIN blade_dept bd ON bu.dept_id = bd.id |
| | | where bu.is_deleted = 0 |
| | | <if test="obj.account != null and obj.account != ''"> |
| | | AND bu.account LIKE CONCAT('%',#{obj.account},'%') |
| | | </if> |
| | | <if test="obj.realName != null and obj.realName != ''"> |
| | | AND bu.real_name LIKE CONCAT('%',#{obj.realName},'%') |
| | | </if> |
| | | <if test="obj.deptId != null and obj.deptId != ''"> |
| | | AND bu.dept_id = #{obj.deptId} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--通过 身份证号查询用户信息--> |
| | |
| | | package org.springblade.modules.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.base.BaseService; |
| | |
| | | /** |
| | | * 导出用户数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | //List<UserExcel> exportUser(Wrapper<User> queryWrapper); |
| | | List<UserExcel> exportUser(Map<String, Object> user); |
| | | |
| | | /** |
| | | * 注册用户 |
| | |
| | | package org.springblade.modules.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.config.QrcodeConfig; |
| | | import org.springblade.common.constant.AgeUtil; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.TenantConstant; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.common.utils.IdCardNoUtil; |
| | | import org.springblade.common.utils.ImageUtils; |
| | | import org.springblade.common.utils.QRCodeUtil; |
| | |
| | | } |
| | | } |
| | | |
| | | // @Override |
| | | // public List<UserExcel> exportUser(Wrapper<User> queryWrapper) { |
| | | // List<UserExcel> userList = baseMapper.exportUser(queryWrapper); |
| | | // userList.forEach(user -> { |
| | | @Override |
| | | public List<UserExcel> exportUser(Map<String, Object> param) { |
| | | List<UserExcel> userList = baseMapper.exportUser(param); |
| | | userList.forEach(user -> { |
| | | // user.setUserTypeName(DictCache.getValue(DictEnum.USER_TYPE, user.getUserType())); |
| | | // user.setRoleName(StringUtil.join(SysCache.getRoleNames(user.getRoleId()))); |
| | | // user.setDeptName(StringUtil.join(SysCache.getDeptNames(user.getDeptId()))); |
| | | // user.setPostName(StringUtil.join(SysCache.getPostNames(user.getPostId()))); |
| | | // }); |
| | | // return userList; |
| | | // } |
| | | |
| | | if (user.getSex() != null && StringUtil.isNotBlank(user.getSex())){ |
| | | if (user.getSex().equals("1")){ |
| | | user.setSex("男"); |
| | | }else if (user.getSex().equals("2")){ |
| | | user.setSex("女"); |
| | | } |
| | | } |
| | | }); |
| | | return userList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |