| | |
| | | import com.project.common.core.domain.AjaxResult; |
| | | import com.project.common.core.page.TableDataInfo; |
| | | import com.project.common.enums.BusinessType; |
| | | import com.project.common.utils.SensitiveUtil; |
| | | import com.project.common.utils.StringUtils; |
| | | import com.project.common.utils.file.ImageUtils; |
| | | import com.project.common.utils.poi.ExcelUtil; |
| | | import com.project.common.utils.zip.ZipUtils; |
| | | import com.project.system.domain.SysCompany; |
| | | import com.project.system.domain.bo.editBo.SysCompanyBo; |
| | | import com.project.system.domain.bo.queryBo.SysCompanyQueryBo; |
| | | import com.project.system.domain.vo.SysCompanyResultVo; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 企业信息Controller |
| | |
| | | private final ISysCompanyService iSysCompanyService; |
| | | |
| | | |
| | | |
| | | @ApiOperation("查询企业信息列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysCompanyQueryBo bo) |
| | | { |
| | | startPage(); |
| | | List<SysCompanyVo> list = iSysCompanyService.queryList(bo); |
| | | list.forEach(SensitiveUtil::desensitize); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("下载二维码") |
| | | @GetMapping("/downloadQrcode") |
| | | public void downloadQrcode(String companyIds, HttpServletResponse response) |
| | | { |
| | | if (StringUtils.isNotEmpty(companyIds)){ |
| | | String[] split = companyIds.split(","); |
| | | List<Long> longs = new ArrayList<>(); |
| | | for (String s : split) { |
| | | long l = Long.parseLong(s); |
| | | longs.add(l); |
| | | } |
| | | List<SysCompany> list = iSysCompanyService.list(iSysCompanyService.lq() |
| | | .in(StringUtils.isNotEmpty(longs), SysCompany::getCompanyId, longs) |
| | | ); |
| | | list.forEach(e->{ |
| | | if (StringUtils.isEmpty(e.getQrcodeImg())){ |
| | | String qrcode = ImageUtils.createQrcode(e.getCompanyCode(), e.getCompanyName(), "2"); |
| | | e.setQrcodeImg(qrcode); |
| | | iSysCompanyService.updateById(e); |
| | | } |
| | | }); |
| | | List<String> collect = list.stream().map(SysCompany::getQrcodeImg).collect(Collectors.toList()); |
| | | List<String> names = list.stream().map(SysCompany::getCompanyName).collect(Collectors.toList()); |
| | | ZipUtils.downloadToZip(collect,names, response); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("导出企业信息列表") |
| | |
| | | |
| | | @ApiOperation(value = "保存导入信息") |
| | | @Log(title = "导入企业信息保存" , businessType = BusinessType.IMPORT) |
| | | @RepeatSubmit |
| | | @PostMapping("/saveImport") |
| | | public AjaxResult saveImport(@RequestBody SysCompanyResultVo resultVo) |
| | | { |