| | |
| | | @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()); |
| | | public void exportUser(@ApiIgnore @RequestParam Map<String, String> user, BladeUser bladeUser, HttpServletResponse response) { |
| | | // QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class); |
| | | User users = new User(); |
| | | if (user.get("realName")!=null&&!user.get("realName").equals("")){ |
| | | users.setRealName(user.get("realName").trim()); |
| | | } |
| | | queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | List<UserExcel> list = userService.exportUser(queryWrapper); |
| | | if (user.get("jurisdiction")!=null&&!user.get("jurisdiction").equals("")){ |
| | | users.setJurisdiction(user.get("jurisdiction").trim()); |
| | | } |
| | | if (user.get("workjurisdiction")!=null&&!user.get("workjurisdiction").equals("")){ |
| | | users.setWorkjurisdiction(user.get("workjurisdiction").trim()); |
| | | } |
| | | |
| | | // if (!AuthUtil.isAdministrator()) { |
| | | // queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()); |
| | | // } |
| | | // queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED); |
| | | List<UserExcel> list = userService.exportUser(users); |
| | | ExcelUtil.export(response, "用户数据" + DateUtil.time(), "用户数据表", list, UserExcel.class); |
| | | } |
| | | |
| | |
| | | |
| | | @ExcelProperty("岗位名称") |
| | | private String postName; |
| | | @ExcelProperty("服务范围") |
| | | private String fwfw; |
| | | @ExcelProperty("工作单位") |
| | | private String gzd; |
| | | |
| | | @ColumnWidth(20) |
| | | @ExcelProperty("生日") |
| | |
| | | /** |
| | | * 获取导出用户数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<UserExcel> exportUser(@Param("ew") Wrapper<User> queryWrapper); |
| | | List<UserExcel> exportUser(@Param("user")User user); |
| | | |
| | | /** |
| | | * 根据用户编号查询用户信息 |
| | |
| | | </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 u.id, u.tenant_id, user_type, account, name, real_name, email, phone, birthday, role_id, dept_id, post_id, |
| | | j.dept_name as fwfw, |
| | | w.dept_name as gzd FROM blade_user u |
| | | LEFT JOIN sys_jurisdiction j on j.id = u.jurisdiction |
| | | LEFT JOIN sys_jurisdiction w on w.id = u.workjurisdiction |
| | | where 1 = 1 |
| | | <if test="user.jurisdiction!=null and user.jurisdiction != ''"> |
| | | and (jurisdiction = #{user.jurisdiction} or workjurisdiction = #{user.jurisdiction}) |
| | | </if> |
| | | <if test="user.workjurisdiction!=null and user.workjurisdiction != ''"> |
| | | and workjurisdiction = #{user.workjurisdiction} |
| | | </if> |
| | | <if test="user.realName!=null and user.realName != ''"> |
| | | and real_name like concat('%',#{user.realName},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据用户编号查询用户信息--> |
| | |
| | | /** |
| | | * 导出用户数据 |
| | | * |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<UserExcel> exportUser(Wrapper<User> queryWrapper); |
| | | List<UserExcel> exportUser(User user); |
| | | |
| | | /** |
| | | * 注册用户 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserExcel> exportUser(Wrapper<User> queryWrapper) { |
| | | public List<UserExcel> exportUser(User queryWrapper) { |
| | | List<UserExcel> userList = baseMapper.exportUser(queryWrapper); |
| | | userList.forEach(user -> { |
| | | user.setUserTypeName(DictCache.getValue(DictEnum.USER_TYPE, user.getUserType())); |
| | |
| | | # username: root |
| | | # password: ZHba@0112 |
| | | |
| | | url: jdbc:mysql://192.168.0.126:3306/hcyj?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true |
| | | url: jdbc:mysql://106.225.193.35:3306/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true |
| | | username: root |
| | | password: NCzhba@2022 |
| | | password: HCyj@2022 |
| | | |
| | | |
| | | # PostgreSQL |