| | |
| | | package com.dy.pmsBase.user; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.dy.common.aop.SsoAop; |
| | | import com.dy.common.aop.SsoPowerAop; |
| | | import com.dy.common.util.MD5; |
| | |
| | | import com.dy.pmsGlobal.pojoBa.BaRole; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.util.Constant; |
| | | import com.dy.pmsGlobal.util.QrCodeConstant; |
| | | import com.dy.pmsGlobal.util.QrCodeUtil; |
| | | import com.google.zxing.WriterException; |
| | | import com.mysql.cj.util.StringUtils; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping(path="export") |
| | | @SsoPowerAop(power = "10100001") |
| | | @Log("导出用户信息") |
| | | public void export(HttpServletResponse response) { |
| | | List<Converter> list = new ArrayList<>(); |
| | | List<BaUser> users = sv.selectAll(); |
| | | if (users != null) { |
| | | for (BaUser user : users) { |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.name = user.name; |
| | | try { |
| | | vo.qrCode = QrCodeUtil.genQrCode(QrCodeConstant.TypeStation + user.id); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (WriterException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | list.add(vo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |