feat(企标宣贯):79573
This commit is contained in:
+38
-7
@@ -162,29 +162,60 @@ public class ProcessEsInspectPlanController extends JeroController<ProcessEsInsp
|
||||
* @param request
|
||||
* @param processEsInspectPlan
|
||||
*/
|
||||
@AutoLog(value = "企标稽查计划业务表-导出excel")
|
||||
@ApiOperation(value="企标稽查计划业务表-导出excel", notes="企标稽查计划业务表-导出excel")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProcessEsInspectPlan processEsInspectPlan) {
|
||||
return super.exportXls(request, processEsInspectPlan, ProcessEsInspectPlan.class, "企标稽查计划业务表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板(稽查联络人发起计划)
|
||||
*
|
||||
*/
|
||||
@AutoLog(value = "企标稽查计划业务表-下载导入模板(稽查联络人发起计划)")
|
||||
@ApiOperation(value="企标稽查计划业务表-下载导入模板(稽查联络人发起计划)", notes="企标稽查计划业务表-下载导入模板(稽查联络人发起计划)")
|
||||
@GetMapping(value = "/templateDownloadByStart")
|
||||
public void templateDownloadByStart(HttpServletResponse response) throws IOException {
|
||||
processEsInspectPlanService.templateDownloadByStart(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/templateDownload")
|
||||
public void templateDownload(HttpServletResponse response) throws IOException {
|
||||
processEsInspectPlanService.templateDownload(response);
|
||||
@AutoLog(value = "企标稽查计划业务表-下载导入模板(稽查征求意见对象填写意见)")
|
||||
@ApiOperation(value="企标稽查计划业务表-下载导入模板(稽查征求意见对象填写意见)", notes="企标稽查计划业务表-下载导入模板(稽查征求意见对象填写意见)")
|
||||
@GetMapping(value = "/templateDownloadByStartByOpinionFill")
|
||||
public void templateDownloadByStartByOpinionFill(HttpServletResponse response) throws IOException {
|
||||
processEsInspectPlanService.templateDownloadByStartByOpinionFill(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
* 通过excel导入数据(稽查联络人发起计划)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
return processEsInspectPlanService.importExcel(request, response);
|
||||
@AutoLog(value = "企标稽查计划业务表-通过excel导入数据(稽查联络人发起计划)")
|
||||
@ApiOperation(value="企标稽查计划业务表-通过excel导入数据(稽查联络人发起计划)", notes="企标稽查计划业务表-通过excel导入数据(稽查联络人发起计划)")
|
||||
@PostMapping(value = "/importExcelByStart")
|
||||
public Result<ProcessEsInspectPlan> importExcelByStart(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
return processEsInspectPlanService.importExcelByStart(request, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据(稽查征求意见对象填写意见)
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "企标稽查计划业务表-通过excel导入数据(稽查征求意见对象填写意见)")
|
||||
@ApiOperation(value="企标稽查计划业务表-通过excel导入数据(稽查征求意见对象填写意见)", notes="企标稽查计划业务表-通过excel导入数据(稽查征求意见对象填写意见)")
|
||||
@PostMapping(value = "/importExcelByOpinionFill")
|
||||
public Result<ProcessEsInspectPlan> importExcelByOpinionFill(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
return processEsInspectPlanService.importExcelByOpinionFill(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-3
@@ -89,16 +89,30 @@ public interface IProcessEsInspectPlanService extends IService<ProcessEsInspectP
|
||||
Map<String, Object> findActRuVariableByInstanceId(String instanceId, String key);
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
* 企标稽查计划业务表-通过excel导入数据(稽查联络人发起计划)
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception;
|
||||
Result<ProcessEsInspectPlan> importExcelByStart(HttpServletRequest request, HttpServletResponse response) throws Exception;
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
* @return
|
||||
*/
|
||||
void templateDownload(HttpServletResponse response) throws IOException;
|
||||
void templateDownloadByStart(HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 通过excel导入数据(稽查征求意见对象填写意见)
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
Result<ProcessEsInspectPlan> importExcelByOpinionFill(HttpServletRequest request, HttpServletResponse response) throws Exception;
|
||||
|
||||
/**
|
||||
* 企标稽查计划业务表-下载导入模板(稽查征求意见对象填写意见)
|
||||
* @param response
|
||||
*/
|
||||
void templateDownloadByStartByOpinionFill(HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
+109
-16
@@ -17,6 +17,7 @@ import com.jero.modules.activiti.process.esinspectplan.entity.ProcessEsInspectPl
|
||||
import com.jero.modules.activiti.process.esinspectplan.mapper.ProcessEsInspectPlanMapper;
|
||||
import com.jero.modules.activiti.process.esinspectplan.service.IProcessEsInspectPlanOpinionService;
|
||||
import com.jero.modules.activiti.process.esinspectplan.service.IProcessEsInspectPlanService;
|
||||
import com.jero.modules.activiti.process.esinspectplan.vo.ProcessEsInspectPlanExcel;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
@@ -37,7 +38,9 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -70,7 +73,7 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
this.sysUserService = sysUserService;
|
||||
this.sysDepartService = sysDepartService;
|
||||
}
|
||||
|
||||
private static final String ERROR_MESSAGE = "模板错误,按照系统模板导入!";
|
||||
private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
@@ -203,7 +206,7 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<ProcessEsInspectPlan> importExcel(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
public Result<ProcessEsInspectPlan> importExcelByStart(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String projectId = request.getParameter("projectId");
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
@@ -231,7 +234,7 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
List<String> secondVerify = secondVerify(list.get(i));
|
||||
List<String> thirdVerify = thirdVerify(list.get(i));
|
||||
List<String> fifthVerify = fifthVerify(list.get(i));
|
||||
List<String> sixthVerify = sixthVerify(list.get(i));
|
||||
List<String> sixthVerify = sixthVerify(list.get(i), true);
|
||||
firstVerify.addAll(secondVerify);
|
||||
firstVerify.addAll(thirdVerify);
|
||||
firstVerify.addAll(fifthVerify);
|
||||
@@ -254,8 +257,8 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
}
|
||||
|
||||
@Override
|
||||
public void templateDownload(HttpServletResponse response) throws IOException {
|
||||
File file = ResourceUtils.getFile("classpath:excelTemplate/企标稽查计划导入模板.xls");
|
||||
public void templateDownloadByStart(HttpServletResponse response) throws IOException {
|
||||
File file = ResourceUtils.getFile("classpath:excelTemplate/企标稽查计划导入模板(稽查联络人发起计划).xls");
|
||||
// 设置HTTP响应头,包括文件大小和内容类型
|
||||
response.setContentType("application/vnd.ms-excel"); // 根据实际文件类型设置内容类型
|
||||
response.setHeader("Content-Disposition", "attachment; filename=企标稽查计划导入模板.xls");
|
||||
@@ -272,7 +275,77 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> sixthVerify(ProcessEsInspectPlan processEsInspectPlan) {
|
||||
@Override
|
||||
public Result<ProcessEsInspectPlan> importExcelByOpinionFill(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String projectId = request.getParameter("projectId");
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
// 获取上传文件对象
|
||||
MultipartFile file = entity.getValue();
|
||||
ImportParams params = new ImportParams();
|
||||
params.setNeedSave(true);
|
||||
params.setHeadRows(1);
|
||||
// excel表格头部校验
|
||||
excelHeadVerify2(file, ProcessEsInspectPlanExcel.class, 0, 0);
|
||||
List<ProcessEsInspectPlanExcel> lists = ExcelImportUtil.importExcel(file.getInputStream(), ProcessEsInspectPlanExcel.class, params);
|
||||
if (CollectionUtils.isEmpty(lists) || lists.size() <= 2) {
|
||||
return Result.error("没有数据可导入!");
|
||||
}
|
||||
lists.remove(0);
|
||||
lists.remove(0);
|
||||
List<ProcessEsInspectPlan> list = BeanCopyUtils.copyBeanList(lists, ProcessEsInspectPlan.class);
|
||||
StringBuilder errorMSG = new StringBuilder();
|
||||
// 字段校验
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
list.get(i).setProjectId(projectId);
|
||||
String head = "第" + (i + 4) + "行:";
|
||||
List<String> firstVerify = firstVerify(list.get(i));
|
||||
List<String> secondVerify = secondVerify(list.get(i));
|
||||
List<String> thirdVerify = thirdVerify(list.get(i));
|
||||
List<String> fifthVerify = fifthVerify(list.get(i));
|
||||
List<String> sixthVerify = sixthVerify(list.get(i), false);
|
||||
firstVerify.addAll(secondVerify);
|
||||
firstVerify.addAll(thirdVerify);
|
||||
firstVerify.addAll(fifthVerify);
|
||||
firstVerify.addAll(sixthVerify);
|
||||
|
||||
if (!firstVerify.isEmpty()){
|
||||
errorMSG.append(head).append(String.join("", firstVerify));
|
||||
}
|
||||
}
|
||||
//update-begin-author:taoyan date:20190528 for:批量插入数据
|
||||
//update-end-author:taoyan date:20190528 for:批量插入数据
|
||||
if (errorMSG.length() > 0){
|
||||
throw new JeroBootException("文件导入失败:<br/>" + errorMSG);
|
||||
}else {
|
||||
saveBatch(list);
|
||||
return Result.OK("文件导入成功!数据行数:" + list.size());
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void templateDownloadByStartByOpinionFill(HttpServletResponse response) throws IOException {
|
||||
File file = ResourceUtils.getFile("classpath:excelTemplate/企标稽查计划导入模板(稽查征求意见对象填写意见).xls");
|
||||
// 设置HTTP响应头,包括文件大小和内容类型
|
||||
response.setContentType("application/vnd.ms-excel"); // 根据实际文件类型设置内容类型
|
||||
response.setHeader("Content-Disposition", "attachment; filename=企标稽查计划导入模板.xls");
|
||||
response.setContentLength((int) Files.size(file.toPath()));
|
||||
|
||||
// 将文件内容写入HTTP响应输出流中
|
||||
try (InputStream in = Files.newInputStream(file.toPath());
|
||||
ServletOutputStream out = response.getOutputStream()) {
|
||||
byte[] buffer = new byte[4096];
|
||||
int bytesRead;
|
||||
while ((bytesRead = in.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> sixthVerify(ProcessEsInspectPlan processEsInspectPlan, boolean flag) {
|
||||
List<String> errorList = new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(processEsInspectPlan.getStandardizationDockingUser())){
|
||||
SysUser sysUser = sysUserService.findUserByCalcNameWorkNo(processEsInspectPlan.getStandardizationDockingUser());
|
||||
@@ -284,15 +357,17 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
}else {
|
||||
errorList.add("标准化组对接人不能为空!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(processEsInspectPlan.getObjectOfConsultation())){
|
||||
SysUser sysUser = sysUserService.findUserByCalcNameWorkNo(processEsInspectPlan.getObjectOfConsultation());
|
||||
if (Objects.isNull(sysUser)){
|
||||
errorList.add("征求意见对象不存在!");
|
||||
if (flag){
|
||||
if (StringUtils.isNotBlank(processEsInspectPlan.getObjectOfConsultation())){
|
||||
SysUser sysUser = sysUserService.findUserByCalcNameWorkNo(processEsInspectPlan.getObjectOfConsultation());
|
||||
if (Objects.isNull(sysUser)){
|
||||
errorList.add("征求意见对象不存在!");
|
||||
}else {
|
||||
processEsInspectPlan.setObjectOfConsultation(sysUser.getId());
|
||||
}
|
||||
}else {
|
||||
processEsInspectPlan.setObjectOfConsultation(sysUser.getId());
|
||||
errorList.add("征求意见对象不能为空!");
|
||||
}
|
||||
}else {
|
||||
errorList.add("征求意见对象不能为空!");
|
||||
}
|
||||
return errorList;
|
||||
}
|
||||
@@ -409,11 +484,29 @@ public class ProcessEsInspectPlanServiceImpl extends ServiceImpl<ProcessEsInspec
|
||||
private void excelHeadVerify(MultipartFile file, Class<ProcessEsInspectPlan> carTypeClass, int titleRows, int i) {
|
||||
try {
|
||||
if (!(boolean) ImportExcelUtil.checkTemplateTitle(file, carTypeClass, titleRows, i)){
|
||||
throw new JeroBootException("模板错误,按照系统模板导入!");
|
||||
throw new JeroBootException(ERROR_MESSAGE);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("模板错误,按照系统模板导入!");
|
||||
throw new JeroBootException(ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* excel表头校验
|
||||
* @param file
|
||||
* @param carTypeClass
|
||||
* @param titleRows
|
||||
* @param i
|
||||
*/
|
||||
private void excelHeadVerify2(MultipartFile file, Class<ProcessEsInspectPlanExcel> carTypeClass, int titleRows, int i) {
|
||||
try {
|
||||
if (!(boolean) ImportExcelUtil.checkTemplateTitle(file, carTypeClass, titleRows, i)){
|
||||
throw new JeroBootException(ERROR_MESSAGE);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException(ERROR_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.jero.modules.activiti.process.esinspectplan.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.modules.activiti.process.esinspectplan.entity.ProcessEsInspectPlanOpinion;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: ProcessEsInspectPlanExcel
|
||||
* @Description:
|
||||
* @Author: yjz
|
||||
* @Date: 2023-12-29 17:27
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@Data
|
||||
public class ProcessEsInspectPlanExcel implements Serializable {
|
||||
/**项目id*/
|
||||
@ApiModelProperty(value = "项目id")
|
||||
private String projectId;
|
||||
/**稽查依据标准号*/
|
||||
@Excel(name = "*稽查依据标准号", width = 15)
|
||||
@ApiModelProperty(value = "稽查依据标准号")
|
||||
private String inspectNo;
|
||||
/**稽查依据标准名称*/
|
||||
@Excel(name = "*稽查依据标准名称", width = 16)
|
||||
@ApiModelProperty(value = "稽查依据标准名称")
|
||||
private String inspectName;
|
||||
/**计划稽查对象*/
|
||||
@Excel(name = "*计划稽查对象", width = 15)
|
||||
@ApiModelProperty(value = "计划稽查对象")
|
||||
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
private String inspectObject;
|
||||
/**主责标准化工作组*/
|
||||
@Excel(name = "*主责标准化工作组", width = 16)
|
||||
@ApiModelProperty(value = "主责标准化工作组")
|
||||
private String standardizationWorkGroup;
|
||||
/**所属部门*/
|
||||
@Excel(name = "*所属部门", width = 15)
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
@Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
|
||||
private String belongDept;
|
||||
/**计划稽查日期*/
|
||||
// @Excel(name = "计划稽查日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划稽查日期")
|
||||
private Date planInspectDate;
|
||||
/**计划稽查日期 导入用*/
|
||||
@Excel(name = "*计划稽查日期", width = 15, format = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "计划稽查日期 导入用")
|
||||
@TableField(exist = false)
|
||||
private String planInspectDates;
|
||||
/**稽查负责人*/
|
||||
@Excel(name = "*稽查负责人", width = 15)
|
||||
@ApiModelProperty(value = "稽查负责人")
|
||||
private String inspectUser;
|
||||
/**稽查负责人 翻译*/
|
||||
@ApiModelProperty(value = "稽查负责人 翻译")
|
||||
@TableField(exist = false)
|
||||
private String inspectUserDictText;
|
||||
/**标准化组对接人*/
|
||||
@Excel(name = "*标准化组对接人", width = 15)
|
||||
@ApiModelProperty(value = "标准化组对接人")
|
||||
private String standardizationDockingUser;
|
||||
/**标准化组对接人 翻译*/
|
||||
@ApiModelProperty(value = "标准化组对接人 翻译")
|
||||
@TableField(exist = false)
|
||||
private String standardizationDockingUserDictText;
|
||||
/**征求意见对象*/
|
||||
@ApiModelProperty(value = "征求意见对象")
|
||||
private String objectOfConsultation;
|
||||
/**征求意见对象 翻译*/
|
||||
@ApiModelProperty(value = "征求意见对象 翻译")
|
||||
@TableField(exist = false)
|
||||
private String objectOfConsultationDictText;
|
||||
/**备注*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**意见*/
|
||||
@ApiModelProperty(value = "意见")
|
||||
@TableField(exist = false)
|
||||
private List<ProcessEsInspectPlanOpinion> processEsInspectPlanOpinionList;
|
||||
/**节点id*/
|
||||
@ApiModelProperty(value = "节点id")
|
||||
@TableField(exist = false)
|
||||
private String nodeId;
|
||||
}
|
||||
+11
-6
@@ -25,10 +25,7 @@ import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
@@ -227,14 +224,22 @@ public class EnterpriseStandardDeclareServiceImpl extends ServiceImpl<Enterprise
|
||||
|
||||
private static void generateHyperlink(List<EnterpriseStandardDeclareExcel> newEnterpriseStandardDeclareExcels, Workbook workbook) {
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
// 设置字体颜色、下划线
|
||||
CellStyle cellStyle = workbook.createCellStyle();
|
||||
Font font = workbook.createFont();
|
||||
font.setColor(IndexedColors.BLUE.getIndex());
|
||||
font.setUnderline(Font.U_SINGLE);
|
||||
cellStyle.setFont(font);
|
||||
cellStyle.setWrapText(true);
|
||||
int i = 1;
|
||||
for (EnterpriseStandardDeclareExcel enterpriseStandardDeclareExcel : newEnterpriseStandardDeclareExcels) {
|
||||
if (!Objects.isNull(enterpriseStandardDeclareExcel.getDeclareFileList()) && !enterpriseStandardDeclareExcel.getDeclareFileList().isEmpty()){
|
||||
for (DeclareFileList declareFileList : enterpriseStandardDeclareExcel.getDeclareFileList()) {
|
||||
Row row = sheet.getRow(i);
|
||||
Cell cell = row.getCell(6);
|
||||
cell.setCellFormula("HYPERLINK(\"" + ".\\" + declareFileList.getFileName() + "\")");
|
||||
cell.setCellValue(declareFileList.getFileName());
|
||||
// 设置超链接 HYPERLINK("https://www.baidu.com", "百度")
|
||||
cell.setCellFormula("HYPERLINK(\"" + declareFileList.getFileName() + "\", \"" + declareFileList.getFileName() + "\")");
|
||||
cell.setCellStyle(cellStyle);
|
||||
i += 1;
|
||||
}
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user