feat: scc流程不分发导出
This commit is contained in:
+10
@@ -185,6 +185,16 @@ public class ProcessStandardComplianceCheckController extends JeroController<Pro
|
||||
sccService.exportXls(taskId, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 不分发节点导出
|
||||
*/
|
||||
@AutoLog(value = "法规符合性排查流程-不分发节点导出")
|
||||
@ApiOperation(value="法规符合性排查流程-不分发节点导出", notes="法规符合性排查流程-不分发节点导出")
|
||||
@GetMapping(value = "/exportXlsWithoutDistribute")
|
||||
public void exportXlsWithoutDistribute(@RequestParam("taskId") String taskId, HttpServletResponse response) {
|
||||
sccService.exportXlsWithoutDistribute(taskId, response);
|
||||
}
|
||||
|
||||
@AutoLog(value = "法规符合性排查流程-导入")
|
||||
@ApiOperation(value="法规符合性排查流程-导入", notes="法规符合性排查流程-导入")
|
||||
@PostMapping("/importExcelWithData")
|
||||
|
||||
+2
-2
@@ -103,7 +103,7 @@ public class ProcessStandardComplianceCheckDetail implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "车型状态")
|
||||
@Dict(dicCode = "model_status")
|
||||
@Excel(name = "车型", width = 15, dicCode = "model_status", orderNum = "4")
|
||||
@Excel(name = "车型状态", width = 15, dicCode = "model_status", orderNum = "4")
|
||||
private String modelStatus;
|
||||
|
||||
/**
|
||||
@@ -226,7 +226,7 @@ public class ProcessStandardComplianceCheckDetail implements Serializable {
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ApiModelProperty(value = "附件")
|
||||
@ApiModelProperty(value = "佐证材料")
|
||||
@ExcelCollection(name = "", orderNum = "16")
|
||||
@TableField(exist = false)
|
||||
private List<ExcelExportUtilPro.FileDetails> fileList = Collections.emptyList();
|
||||
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
package com.jero.modules.activiti.process.standardComplianceCheck.entity.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.modules.laws.utils.ExcelExportUtilPro;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WithoutDistributeExcelTemplate {
|
||||
|
||||
/**
|
||||
* 条款号
|
||||
*/
|
||||
@ApiModelProperty(value = "条款号")
|
||||
@Excel(name = "条款号", width = 15, orderNum = "1")
|
||||
private String termNumber;
|
||||
|
||||
/**
|
||||
* 条款标题
|
||||
*/
|
||||
@ApiModelProperty(value = "条款标题")
|
||||
@Excel(name = "条款标题", width = 15, orderNum = "2")
|
||||
private String termTitle;
|
||||
|
||||
/**
|
||||
* 条款内容
|
||||
*/
|
||||
@ApiModelProperty(value = "条款内容")
|
||||
@Excel(name = "条款内容", width = 15, orderNum = "3")
|
||||
private String termContent;
|
||||
|
||||
/**
|
||||
* 车型
|
||||
*/
|
||||
@ApiModelProperty(value = "车型")
|
||||
@Excel(name = "车型", width = 15, orderNum = "4")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 车型状态
|
||||
*/
|
||||
@ApiModelProperty(value = "车型状态")
|
||||
@Dict(dicCode = "model_status")
|
||||
@Excel(name = "车型状态", width = 15, dicCode = "model_status", orderNum = "5")
|
||||
private String modelStatus;
|
||||
|
||||
/**
|
||||
* 合规评估结果
|
||||
*/
|
||||
@ApiModelProperty(value = "合规评估结果")
|
||||
@Dict(dicCode = "evaluation_result")
|
||||
@Excel(name = "评估结果", width = 15, orderNum = "6", dicCode = "evaluation_result")
|
||||
private String result;
|
||||
|
||||
/**
|
||||
* 不满足要求的现状
|
||||
*/
|
||||
@ApiModelProperty(value = "不满足要求的现状")
|
||||
@Excel(name = "不满足要求的现状", width = 15, orderNum = "7")
|
||||
private String unsatisfiedRequire;
|
||||
|
||||
/**
|
||||
* 整改方案
|
||||
*/
|
||||
@ApiModelProperty(value = "整改方案")
|
||||
@Excel(name = "整改方案", width = 15, orderNum = "8")
|
||||
private String correctionSolution;
|
||||
|
||||
/**
|
||||
* 整改周期
|
||||
*/
|
||||
@ApiModelProperty(value = "整改周期")
|
||||
@Dict(dicCode = "correction_period")
|
||||
@Excel(name = "整改方案", width = 15, orderNum = "9", dicCode = "correction_period")
|
||||
private String correctionPeriod;
|
||||
|
||||
/**
|
||||
* 整改费用
|
||||
*/
|
||||
@ApiModelProperty(value = "整改费用")
|
||||
@Excel(name = "整改费用", width = 15, orderNum = "10")
|
||||
private String correctionCost;
|
||||
|
||||
/**
|
||||
* 与其他项目共用性
|
||||
*/
|
||||
@ApiModelProperty(value = "与其他项目共用性")
|
||||
@Excel(name = "与其他项目共用性", width = 15, orderNum = "11")
|
||||
private String commonality;
|
||||
|
||||
/**
|
||||
* 共用后本项目所需费用
|
||||
*/
|
||||
@ApiModelProperty(value = "共用后本项目所需费用")
|
||||
@Excel(name = "共用后本项目所需费用", width = 15, orderNum = "12")
|
||||
private String commonalityCost;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Excel(name = "备注", width = 15, orderNum = "13")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@ApiModelProperty(value = "佐证材料")
|
||||
@ExcelCollection(name = "", orderNum = "14")
|
||||
@TableField(exist = false)
|
||||
private List<ExcelExportUtilPro.FileDetails> fileList = Collections.emptyList();
|
||||
|
||||
/**
|
||||
* 佐证材料
|
||||
*/
|
||||
@ApiModelProperty(value = "佐证材料")
|
||||
@Dict(dictTable = "oss_file", dicCode = "id", dicText = "file_name")
|
||||
private String material;
|
||||
|
||||
public List<String> obtainFileIds() {
|
||||
return material != null ? Arrays.asList(material.split(",")) : Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -32,6 +32,7 @@ public interface IProcessStandardComplianceCheckService extends IService<Process
|
||||
List<ProcessStandardComplianceCheckDetail> generate(ProcessStandardComplianceCheck scc) throws Exception;
|
||||
|
||||
void exportXls(String taskId, HttpServletResponse response);
|
||||
void exportXlsWithoutDistribute(String taskId, HttpServletResponse response);
|
||||
|
||||
Map<String, Object> importExcelWithData(MultipartFile file);
|
||||
}
|
||||
|
||||
+49
@@ -27,6 +27,7 @@ import com.jero.modules.activiti.process.standardComplianceCheck.entity.ProcessS
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.entity.vo.ModelExcelVO;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.entity.vo.ProcessSccVO;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.entity.vo.SplitExcelVO;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.entity.vo.WithoutDistributeExcelTemplate;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.mapper.ProcessStandardComplianceCheckMapper;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.service.IProcessStandardComplianceCheckDetailService;
|
||||
import com.jero.modules.activiti.process.standardComplianceCheck.service.IProcessStandardComplianceCheckService;
|
||||
@@ -473,9 +474,57 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
public void exportXlsWithoutDistribute(String taskId, HttpServletResponse response) {
|
||||
ProcessInfoVO<ProcessSccVO> handleData = this.getHandleData(taskId);
|
||||
ProcessSccVO businessInfoDTO = handleData.getBusinessInfoDTO();
|
||||
ProcessStandardComplianceCheck standardInfo = businessInfoDTO.getStandardInfo();
|
||||
List<ProcessStandardComplianceCheckDetail> detailInfoList = businessInfoDTO.getDetailInfoList();
|
||||
String fileName = standardInfo.getStandardNumber() + "-" + standardInfo.getStandardName() + "-符合性排查";
|
||||
String url = exportExcelTempPath.replace(EXPORT_EXCEL_TEMP, fileName);
|
||||
File file = new File(url);
|
||||
if (!file.exists()) {
|
||||
boolean mkdirs = file.mkdirs();
|
||||
log.info("创建临时目录:{}", mkdirs);
|
||||
}
|
||||
try (FileOutputStream fos = new FileOutputStream(url + File.separator + fileName + ".xls")){
|
||||
// 获取数据
|
||||
excelExportUtilPro.settleDocuments(url, detailInfoList,
|
||||
ProcessStandardComplianceCheckDetail::obtainFileIds,
|
||||
ProcessStandardComplianceCheckDetail::setFileList);
|
||||
// 生成excel
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.HSSF);
|
||||
// 复制一份数据
|
||||
List<WithoutDistributeExcelTemplate> data = BeanCopyUtils
|
||||
.copyBeanList(detailInfoList, WithoutDistributeExcelTemplate.class);
|
||||
List<WithoutDistributeExcelTemplate> newRecordsExport = new ArrayList<>(data);
|
||||
Workbook workbook = ExcelExportUtil
|
||||
.exportExcel(exportParams, WithoutDistributeExcelTemplate.class, detailInfoList);
|
||||
// 生成超链接
|
||||
excelExportUtilPro.generateHyperlink(newRecordsExport, workbook,
|
||||
WithoutDistributeExcelTemplate::getFileList, 13);
|
||||
// 导出excel
|
||||
workbook.write(fos);
|
||||
// 生成并导出zip
|
||||
ZipUtil.toZip(url, response.getOutputStream(), response, true);
|
||||
} catch (Exception e) {
|
||||
log.error("导出excel异常", e);
|
||||
throw new JeroBootException("导出excel异常", e);
|
||||
} finally {
|
||||
// 删除文件
|
||||
if (new File(url).exists()) {
|
||||
FileUtils.deleteFolders(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> importExcelWithData(MultipartFile file) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ public class ExcelExportUtilPro {
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
@Excel(name = "附件/佐证材料", width = 15)
|
||||
@ApiModelProperty(value = "附件/佐证材料")
|
||||
private String fileName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user