| | |
| | | return request.post('/business/company/updateStatus', data) |
| | | } |
| | | |
| | | export function exportComFiles (data) { |
| | | return request.post('/business/company/exportFiles', data, { |
| | | trim: true, |
| | | download: true |
| | | }) |
| | | } |
| | | |
| | | // 根据ID查询 |
| | | export function getById (id) { |
| | | return request.get(`/business/company/${id}`) |
| | |
| | | </div> |
| | | </div> |
| | | <template v-slot:footer> |
| | | <el-button type="primary">企业证件</el-button> |
| | | <el-button type="primary" :loading="isWorking.export" @click="exportComFiles">企业证件</el-button> |
| | | <el-button type="primary" :loading="isWorking.export" @click="exportDetail">导出详单</el-button> |
| | | <el-button>取消</el-button> |
| | | <el-button @click="visible=false">取消</el-button> |
| | | </template> |
| | | </GlobalWindow> |
| | | </template> |
| | |
| | | }) |
| | | }, |
| | | exportDetail(){ |
| | | |
| | | this.$dialog.exportConfirm('确认导出吗?') |
| | | this.$dialog.exportConfirm('确认导出详单吗?') |
| | | .then(() => { |
| | | this.isWorking = true |
| | | exportDetailExcel({ id: this.model.id }) |
| | |
| | | }) |
| | | |
| | | }, |
| | | exportComFiles(){ |
| | | this.$dialog.exportConfirm('确认导出企业证件吗?') |
| | | .then(() => { |
| | | this.isWorking = true |
| | | exportComFiles({ id: this.model.companyId }) |
| | | .then(response => { |
| | | this.download(response) |
| | | }) |
| | | .catch(e => { |
| | | console.log(e) |
| | | this.$message.error('数据下载失败!') |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking = false |
| | | }) |
| | | }) |
| | | .catch(() => { |
| | | }) |
| | | |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`每页 ${val} 条`); |
| | | }, |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { all as solutionAll} from '@/api/business/solutions' |
| | | import {exportComFiles as exportComFiles} from '@/api/business/company' |
| | | import { pageAll as companyAll} from '@/api/business/company' |
| | | import OperaInsuranceApplyWindow from '@/components/business/OperaInsuranceApplyWindow' |
| | | export default { |
| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | |
| | | |
| | | return ApiResponse.success(companyService.findById(id)); |
| | | } |
| | | |
| | | @ApiOperation("企业证件下载") |
| | | @PostMapping("/exportFiles") |
| | | @RequiresPermissions("business:locks:exportExcel") |
| | | public void exportFiles(@RequestBody Company company,HttpServletResponse response) { |
| | | if(company.getId() == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | companyService.exportFiles(company.getId(),response); |
| | | } |
| | | } |
| | |
| | | @ApiOperation("资料下载") |
| | | @PostMapping("/exportFiles") |
| | | @RequiresPermissions("business:locks:exportExcel") |
| | | public void exportExcel(@RequestParam Integer id,HttpServletResponse response) { |
| | | public void exportFiles(@RequestParam Integer id,HttpServletResponse response) { |
| | | if(id == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | style.setFont(font); |
| | | // 设置边框 |
| | | configCellBorder(style); |
| | | // configCellBorder(style); |
| | | cell.setCellStyle(style); |
| | | } |
| | | /** |
| | |
| | | sxssfWorkbook = new SXSSFWorkbook(); |
| | | Sheet sheet = sxssfWorkbook.createSheet(sheetName); |
| | | for (int i = 0; i < 6; i++) { |
| | | sheet.setColumnWidth(i, 20 * 2 * 256); |
| | | sheet.setColumnWidth(i, (i==5?20:15) * 2 * 256); |
| | | } |
| | | sheet.createFreezePane(0, 1); |
| | | sheet.addMergedRegion(new CellRangeAddress(0 ,0,0,5)); |
| | | Row title = sheet.createRow(0); |
| | | title.setHeight((short) 800); |
| | | Cell c = title.createCell(0); |
| | | c.setCellValue(sheetName); |
| | | configTitleCell(sxssfWorkbook,c); |
| | | for (int i = 0; i < 6; i++) { |
| | | title.createCell(i).setCellValue(i==0?sheetName:""); |
| | | configTitleCell(sxssfWorkbook,title.getCell(i)); |
| | | } |
| | | sheet.addMergedRegion(new CellRangeAddress(0 ,0,0,5)); |
| | | Row header1 = sheet.createRow(1); |
| | | header1.setHeight((short) 400); |
| | | header1.setHeight((short) 500); |
| | | header1.createCell(0).setCellValue("投保企业"); |
| | | header1.createCell(1).setCellValue("保险方案"); |
| | | header1.createCell(2).setCellValue("保险生效起期"); |
| | |
| | | header4.createCell(3).setCellValue("身份证号"); |
| | | header4.createCell(4).setCellValue("派遣单位"); |
| | | header4.createCell(5).setCellValue("所属工种"); |
| | | header4.setHeight((short) 400); |
| | | header4.setHeight((short) 500); |
| | | for (int i = 0; i < 6; i++) { |
| | | configFirstCell(sxssfWorkbook,header4.getCell(i)); |
| | | } |
| | |
| | | for (int rowIndex = 0; rowIndex < data.getApplyDetailList().size(); rowIndex++) { |
| | | ApplyDetail d = data.getApplyDetailList().get(rowIndex); |
| | | Row header5 = sheet.createRow(rowIndex + 4); |
| | | header5.setHeight((short) 300); |
| | | // header5.setHeight((short) 300); |
| | | header5.createCell(0).setCellValue(rowIndex+1); |
| | | header5.createCell(1).setCellValue(StringUtils.defaultString(d.getMemberName(),"")); |
| | | header5.createCell(2).setCellValue(Constants.equalsInteger(d.getSex(),0)?"男":(Constants.equalsInteger(d.getSex(),1)?"女":"-")); |
| | |
| | | import com.doumee.dao.business.model.Solutions; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import javax.servlet.ServletOutputStream; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.net.URL; |
| | | import java.net.URLDecoder; |
| | |
| | | private int key; |
| | | private int collectStatus; |
| | | |
| | | |
| | | // 构造方法 |
| | | InsuranceApplyStatus(int key, String name,String info,int collectStatus) { |
| | | this.name = name; |
| | |
| | | |
| | | return file; |
| | | } |
| | | public static void packFilesToZip(List<File> files, ServletOutputStream os) throws IOException { |
| | | try (ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os)) { |
| | | for (File file : files) { |
| | | ZipArchiveEntry entry = new ZipArchiveEntry(file.getName()); |
| | | zipOutputStream.putArchiveEntry(entry); |
| | | try (FileInputStream fileInputStream = new FileInputStream(file)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = fileInputStream.read(buffer)) > 0) { |
| | | zipOutputStream.write(buffer, 0, length); |
| | | } |
| | | } |
| | | zipOutputStream.closeArchiveEntry(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Company; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | void dealSignIdStatus(); |
| | | |
| | | void updateSolutions(Company company); |
| | | |
| | | void exportFiles(Integer id, HttpServletResponse response); |
| | | } |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Array; |
| | | import java.net.URI; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | //处理关联方案 |
| | | dealSolutionsData(company); |
| | | } |
| | | @Transactional |
| | | public void exportFiles(Integer id, HttpServletResponse response){ |
| | | try { |
| | | Company model = companyMapper.selectById(id); |
| | | if(model == null){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | List<File> fileList = new ArrayList<>(); |
| | | List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,id) |
| | | .isNotNull(Multifile::getFileurl) |
| | | .in(Multifile::getObjType, Arrays.asList(new Integer[]{ |
| | | Constants.MultiFile.COM_BUSINESS_LICENSE.getKey(), |
| | | Constants.MultiFile.COM_IDCARD_IMG.getKey(), |
| | | })) |
| | | ); |
| | | if(multifileList== null || multifileList.size() == 0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.COMPANY_FILE).getCode(); |
| | | for(Multifile l : multifileList){ |
| | | File f = Constants.getFileByNetFile(path + l.getFileurl(),StringUtils.defaultString(l.getName(),"未命名")); |
| | | if(f !=null && f.isFile()){ |
| | | fileList.add(f); |
| | | } |
| | | } |
| | | if(fileList == null || fileList.size() == 0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | String fileName = model.getName() +"理赔资料下_"+System.currentTimeMillis()+".zip" ; |
| | | String encodeFileName = URLEncoder.encode(fileName); |
| | | response.setHeader("Content-Disposition","attachment;filename=" + encodeFileName); |
| | | response.setContentType("application/octet-stream"); |
| | | response.setHeader("eva-opera-type", "download"); |
| | | response.setHeader("eva-download-filename", encodeFileName); |
| | | Constants. packFilesToZip(fileList,response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e); |
| | | } |
| | | } |
| | | |
| | | private void dealSystemUserData(Company company) { |
| | | if(systemUserMapper.selectCount(new QueryWrapper<SystemUser>().lambda() |
| | |
| | | .selectAs(DispatchUnit::getName,ApplyDetail::getDuName) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyDetail::getDuId) |
| | | .eq(InsuranceApply::getId,model.getId()); |
| | | .eq(ApplyDetail::getApplyId,model.getId()); |
| | | //查询明细 |
| | | List<ApplyDetail> detailList =applyDetailJoinMapper.selectJoinList(ApplyDetail.class,wrapper1); |
| | | if(detailList!=null){ |
| | |
| | | response.setContentType("application/octet-stream"); |
| | | response.setHeader("eva-opera-type", "download"); |
| | | response.setHeader("eva-download-filename", encodeFileName); |
| | | packFilesToZip(fileList,response.getOutputStream()); |
| | | Constants.packFilesToZip(fileList,response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void packFilesToZip(List<File> files, ServletOutputStream os) throws IOException { |
| | | try (ZipArchiveOutputStream zipOutputStream = new ZipArchiveOutputStream(os)) { |
| | | for (File file : files) { |
| | | ZipArchiveEntry entry = new ZipArchiveEntry(file.getName()); |
| | | zipOutputStream.putArchiveEntry(entry); |
| | | try (FileInputStream fileInputStream = new FileInputStream(file)) { |
| | | byte[] buffer = new byte[1024]; |
| | | int length; |
| | | while ((length = fileInputStream.read(buffer)) > 0) { |
| | | zipOutputStream.write(buffer, 0, length); |
| | | } |
| | | } |
| | | zipOutputStream.closeArchiveEntry(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public SettleClaims getSettleClaimsDetail(Integer id){ |