feat: There is no way the, bug #52285
This commit is contained in:
+2
-1
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarLawsStandInfo.controller;
|
|||||||
import com.adc.da.common.ReadExcel;
|
import com.adc.da.common.ReadExcel;
|
||||||
import com.adc.da.exception.AdcDaBaseException;
|
import com.adc.da.exception.AdcDaBaseException;
|
||||||
import com.adc.da.person.service.IPersonCollectEOService;
|
import com.adc.da.person.service.IPersonCollectEOService;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoExport;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||||
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
import com.adc.da.slrs.sarResource.service.ITsResourceService;
|
||||||
@@ -191,7 +192,7 @@ public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo>
|
|||||||
@GetMapping(value = "/exportStandardsInfoExcel")
|
@GetMapping(value = "/exportStandardsInfoExcel")
|
||||||
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
|
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
|
||||||
HttpServletRequest request) throws Exception {
|
HttpServletRequest request) throws Exception {
|
||||||
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
List<SarLawsStandInfoExport> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
|
||||||
|
|
||||||
OutputStream os = null;
|
OutputStream os = null;
|
||||||
Workbook workbook = null;
|
Workbook workbook = null;
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.sarLawsStandInfo.dao;
|
package com.adc.da.slrs.sarLawsStandInfo.dao;
|
||||||
|
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoExport;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -24,7 +25,7 @@ public interface SarLawsStandInfoDao extends BaseMapper<SarLawsStandInfo> {
|
|||||||
|
|
||||||
List<SarLawsStandInfo> selectStandardsInfoByKey(String id);
|
List<SarLawsStandInfo> selectStandardsInfoByKey(String id);
|
||||||
|
|
||||||
List<SarLawsStandInfo> getSarStandardsExportInfo(SarLawsStandInfoPage page);
|
List<SarLawsStandInfoExport> getSarStandardsExportInfo(SarLawsStandInfoPage page);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarLawsStandInfo.service;
|
|||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoExport;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
||||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||||
@@ -32,7 +33,7 @@ public interface ISarLawsStandInfoService extends IService<SarLawsStandInfo> {
|
|||||||
|
|
||||||
SarLawsStandInfoPage updateStandardsMenu(SarLawsStandInfoPage standardsInfoEO);
|
SarLawsStandInfoPage updateStandardsMenu(SarLawsStandInfoPage standardsInfoEO);
|
||||||
|
|
||||||
List<SarLawsStandInfo> getExportData(String exportType, String exportContent,String userId) throws Exception;
|
List<SarLawsStandInfoExport> getExportData(String exportType, String exportContent, String userId) throws Exception;
|
||||||
|
|
||||||
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page) throws Exception;
|
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page) throws Exception;
|
||||||
|
|
||||||
|
|||||||
+45
-14
@@ -36,6 +36,7 @@ import com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao;
|
|||||||
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
|
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.dao.SarLawsStandInfoDao;
|
import com.adc.da.slrs.sarLawsStandInfo.dao.SarLawsStandInfoDao;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoExport;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
|
||||||
import com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao;
|
import com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao;
|
||||||
@@ -60,6 +61,7 @@ import com.adc.da.utils.util.SarAdvanceSearchUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.json.JSONTokener;
|
import org.json.JSONTokener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -323,11 +325,13 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attrInfoDetailsExport (SarLawsStandInfo row) throws Exception {
|
public void attrInfoDetailsExport (SarLawsStandInfoExport row) throws Exception {
|
||||||
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||||
// 查询属性表数据
|
// 查询属性表数据
|
||||||
if (StringUtils.isNotBlank(fieldInfo)) {
|
if (StringUtils.isNotBlank(fieldInfo)) {
|
||||||
Map<String, Object> getAttrMap = sarLawsAttrInfoDao.selectLawsFieldAndData(fieldInfo,row.getId());
|
List<String> list = Arrays.asList(fieldInfo.split(",")).stream().map(s -> String.format(s.trim())).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<String, Object> getAttrMap = BeanUtils.describe(row);
|
||||||
if (InitStandAttrUtil.clobFieldListLaws != null && !InitStandAttrUtil.clobFieldListLaws.isEmpty()) {
|
if (InitStandAttrUtil.clobFieldListLaws != null && !InitStandAttrUtil.clobFieldListLaws.isEmpty()) {
|
||||||
// 遍历修改所有clob类型的值
|
// 遍历修改所有clob类型的值
|
||||||
for (String clobField : InitStandAttrUtil.clobFieldListLaws) {
|
for (String clobField : InitStandAttrUtil.clobFieldListLaws) {
|
||||||
@@ -341,7 +345,13 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
if(getAttrMap != null){
|
if(getAttrMap != null){
|
||||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||||
String name = entry.getKey();
|
String name = entry.getKey();
|
||||||
|
List<String> filterList = list.stream().filter(a -> name.equals(a)).collect(Collectors.toList());
|
||||||
|
if(filterList.isEmpty()){
|
||||||
|
newMap.remove(name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Object value1 = entry.getValue();
|
Object value1 = entry.getValue();
|
||||||
|
|
||||||
if (value1 != null && value1.toString().equals("\"null\"")){
|
if (value1 != null && value1.toString().equals("\"null\"")){
|
||||||
entry.setValue("");
|
entry.setValue("");
|
||||||
}
|
}
|
||||||
@@ -440,7 +450,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SarLawsStandInfo> getExportData(String exportType, String exportContent,String userId) throws Exception {
|
public List<SarLawsStandInfoExport> getExportData(String exportType, String exportContent,String userId) throws Exception {
|
||||||
SarLawsStandInfoPage page = new SarLawsStandInfoPage();
|
SarLawsStandInfoPage page = new SarLawsStandInfoPage();
|
||||||
if ("apart".equals(exportType)) {
|
if ("apart".equals(exportType)) {
|
||||||
page.setIdlist(exportContent.split(","));
|
page.setIdlist(exportContent.split(","));
|
||||||
@@ -489,9 +499,9 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
nowOrderFunc(page);
|
nowOrderFunc(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
|
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||||
|
|
||||||
List<String> list = Arrays.asList(fieldInfo.split(",")).stream().map(s -> String.format("SAR_BUSS_STAND_ATTR_INFO."+s.trim())).collect(Collectors.toList());
|
List<String> list = Arrays.asList(fieldInfo.split(",")).stream().map(s -> String.format("SAR_LAWS_ATTR_INFO."+s.trim())).collect(Collectors.toList());
|
||||||
List<String> listSelect = Arrays.asList(fieldInfo.split(",")).stream().map(s -> String.format("tmp_tb."+s.trim())).collect(Collectors.toList());
|
List<String> listSelect = Arrays.asList(fieldInfo.split(",")).stream().map(s -> String.format("tmp_tb."+s.trim())).collect(Collectors.toList());
|
||||||
String exportAllAttrInfo = list.stream().collect(Collectors.joining(","));
|
String exportAllAttrInfo = list.stream().collect(Collectors.joining(","));
|
||||||
String exportAllResult = listSelect.stream().collect(Collectors.joining(","));
|
String exportAllResult = listSelect.stream().collect(Collectors.joining(","));
|
||||||
@@ -503,7 +513,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
page.setExportAllResult(exportAllResult);
|
page.setExportAllResult(exportAllResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SarLawsStandInfo> rows = this.baseMapper.getSarStandardsExportInfo(page);
|
List<SarLawsStandInfoExport> rows = this.baseMapper.getSarStandardsExportInfo(page);
|
||||||
attrInfoShowExport(rows);
|
attrInfoShowExport(rows);
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
@@ -577,8 +587,15 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attrInfoShowExport (List<SarLawsStandInfo> sarlist) throws Exception {
|
public void attrInfoShowExport (List<SarLawsStandInfoExport> sarlist) throws Exception {
|
||||||
for(SarLawsStandInfo row : sarlist){
|
|
||||||
|
//查询字典表,形成Hash映射提升速度
|
||||||
|
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
|
||||||
|
Map<String, String> dicMap = dicInfo.stream()
|
||||||
|
.filter(item-> !item.getDicTypeCode().isEmpty())
|
||||||
|
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
|
||||||
|
|
||||||
|
for(SarLawsStandInfoExport row : sarlist){
|
||||||
attrInfoDetailsExport(row);
|
attrInfoDetailsExport(row);
|
||||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||||
Map<String, Object> getNewMap = new LinkedHashMap<>();
|
Map<String, Object> getNewMap = new LinkedHashMap<>();
|
||||||
@@ -588,11 +605,11 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
String name = entry.getKey();
|
String name = entry.getKey();
|
||||||
String value = "";
|
String value = "";
|
||||||
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && InitStandAttrUtil.fileFieldListLaws.size() > 0 && InitStandAttrUtil.fileFieldListLaws.contains(name)) {
|
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && InitStandAttrUtil.fileFieldListLaws.size() > 0 && InitStandAttrUtil.fileFieldListLaws.contains(name)) {
|
||||||
value = entry.getValue().toString();
|
// value = entry.getValue().toString();
|
||||||
if (StringUtils.isNotBlank(value)) {
|
// if (StringUtils.isNotBlank(value)) {
|
||||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
// List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
||||||
entry.setValue(fileObj);
|
// entry.setValue(fileObj);
|
||||||
}
|
// }
|
||||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
|
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
|
||||||
value = entry.getValue().toString();
|
value = entry.getValue().toString();
|
||||||
String selVal = InitStandAttrUtil.selectFieldMapLaws.get(name);
|
String selVal = InitStandAttrUtil.selectFieldMapLaws.get(name);
|
||||||
@@ -606,7 +623,21 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<String> valArr = Arrays.asList(value.split(","));
|
List<String> valArr = Arrays.asList(value.split(","));
|
||||||
value = dicTypeEODao.getDicNamesByCodes(valArr,"");
|
if(entry.getValue()!=null) {
|
||||||
|
StringBuilder builder = new StringBuilder("");
|
||||||
|
for (String s : valArr) {
|
||||||
|
if (dicMap.containsKey(s) && !"ZRBM".equals(name)){
|
||||||
|
builder.append(dicMap.get(s)+",");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (builder.toString().isEmpty()){
|
||||||
|
value = entry.getValue().toString();
|
||||||
|
}else {
|
||||||
|
value = builder.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
entry.setValue(value);
|
entry.setValue(value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ public class FieldConvertUtil {
|
|||||||
"EOP实施日期(文本),责任部门,相关部门,SVPPS,FO,项目评估角色,法规维护人,代替标准编号," +
|
"EOP实施日期(文本),责任部门,相关部门,SVPPS,FO,项目评估角色,法规维护人,代替标准编号," +
|
||||||
"对应其他标准,文字描述,等效标准,引用标准,被引用标准,覆盖关系";
|
"对应其他标准,文字描述,等效标准,引用标准,被引用标准,覆盖关系";
|
||||||
|
|
||||||
public static String exportBaseFieldNamesLaws = "政策分类,政策编号,中文名称,英文名称,政策文号,发文日期,发文单位,征集意见周期-起始时间,征集意见周期-结束时间,文本状态," +
|
public static String exportBaseFieldNamesLaws = "政策分类,政策编号,政策名称,英文名称,政策文号,发文日期,发文单位,征集意见周期-起始时间,征集意见周期-结束时间,文本状态," +
|
||||||
"适用区域,适用车型,是否纳入认证清单,年度,福田转发通知文号,信息简报,标签,备注";
|
"适用区域,适用车型,是否纳入认证清单,年度,福田转发通知文号,信息简报,标签,备注(最终政策发布)";
|
||||||
|
|
||||||
public static String exportAttrFieldNamesLaws = "适用车辆类型,要求类型," +
|
public static String exportAttrFieldNamesLaws = "适用车辆类型,要求类型," +
|
||||||
"个性化标签,政策文本,过程稿件,新车型实施日期(文本),在产车实施日期(文本),EOP实施日期(文本),SVPPS," +
|
"个性化标签,政策文本,过程稿件,新车型实施日期(文本),在产车实施日期(文本),EOP实施日期(文本),SVPPS," +
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.adc.da.utils.util;
|
|||||||
|
|
||||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||||
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
|
||||||
|
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoExport;
|
||||||
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
@@ -10,10 +11,8 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 标准导出工具
|
* @Description: 标准导出工具
|
||||||
@@ -24,11 +23,11 @@ public class LawsStandExportUtil {
|
|||||||
private static final Logger logger = LoggerFactory.getLogger(LawsStandExportUtil.class);
|
private static final Logger logger = LoggerFactory.getLogger(LawsStandExportUtil.class);
|
||||||
|
|
||||||
|
|
||||||
public static Workbook exportDatas (List<SarLawsStandInfo> datas) {
|
public static Workbook exportDatas (List<SarLawsStandInfoExport> datas) {
|
||||||
Workbook workbook = new XSSFWorkbook();
|
Workbook workbook = new XSSFWorkbook();
|
||||||
try {
|
try {
|
||||||
StringBuilder attrBud = new StringBuilder();
|
StringBuilder attrBud = new StringBuilder();
|
||||||
List<SarStandAttrDetails> detailsEOList = InitStandAttrUtil.lawsStandAttrFieldList;
|
List<SarStandAttrDetails> detailsEOList = InitStandAttrUtil.lawsForeignAttrFieldList;
|
||||||
Map<String,String> attrInfoMap = new HashMap<>();
|
Map<String,String> attrInfoMap = new HashMap<>();
|
||||||
for (SarStandAttrDetails detailsEO : detailsEOList) {
|
for (SarStandAttrDetails detailsEO : detailsEOList) {
|
||||||
if (!InitStandAttrUtil.fileFieldListLaws.contains(detailsEO.getAttrField())) {
|
if (!InitStandAttrUtil.fileFieldListLaws.contains(detailsEO.getAttrField())) {
|
||||||
@@ -62,13 +61,13 @@ public class LawsStandExportUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createDatas(Workbook workbook,Sheet sheet,List<SarLawsStandInfo> datas,
|
public static void createDatas(Workbook workbook,Sheet sheet,List<SarLawsStandInfoExport> datas,
|
||||||
String header,Map<String,String> attrInfoMap) throws Exception{
|
String header,Map<String,String> attrInfoMap) throws Exception{
|
||||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||||
if (datas != null && !datas.isEmpty()) {
|
if (datas != null && !datas.isEmpty()) {
|
||||||
for (int i=0;i < datas.size(); i++) {
|
for (int i=0;i < datas.size(); i++) {
|
||||||
SarLawsStandInfo sarStandardsInfoEO = datas.get(i);
|
SarLawsStandInfoExport sarStandardsInfoEO = datas.get(i);
|
||||||
Row row = sheet.createRow(i+1);
|
Row row = sheet.createRow(i+1);
|
||||||
String[] headerArr = header.split(",");
|
String[] headerArr = header.split(",");
|
||||||
int sheetNum = 0;
|
int sheetNum = 0;
|
||||||
@@ -85,7 +84,7 @@ public class LawsStandExportUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 根据表头返回相应值
|
// 根据表头返回相应值
|
||||||
public static String getValueByName (String name,SarLawsStandInfo sarStandardsInfoEO,Map<String,String> attrInfoMap) throws Exception{
|
public static String getValueByName (String name,SarLawsStandInfoExport sarStandardsInfoEO,Map<String,String> attrInfoMap) throws Exception{
|
||||||
String value = "";
|
String value = "";
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
Map<String,Object> attrValueMap = sarStandardsInfoEO.getAttrInfoMap();
|
Map<String,Object> attrValueMap = sarStandardsInfoEO.getAttrInfoMap();
|
||||||
@@ -96,7 +95,7 @@ public class LawsStandExportUtil {
|
|||||||
case "政策编号":
|
case "政策编号":
|
||||||
value = verifyBean(sarStandardsInfoEO.getLawsNumber());
|
value = verifyBean(sarStandardsInfoEO.getLawsNumber());
|
||||||
break;
|
break;
|
||||||
case "中文名称":
|
case "政策名称":
|
||||||
value = verifyBean(sarStandardsInfoEO.getLawsName());
|
value = verifyBean(sarStandardsInfoEO.getLawsName());
|
||||||
break;
|
break;
|
||||||
case "英文名称":
|
case "英文名称":
|
||||||
@@ -114,6 +113,11 @@ public class LawsStandExportUtil {
|
|||||||
issueTime=sarStandardsInfoEO.getIssueTime();
|
issueTime=sarStandardsInfoEO.getIssueTime();
|
||||||
}
|
}
|
||||||
value = issueTime;
|
value = issueTime;
|
||||||
|
if(StringUtils.isNotBlank(value)){
|
||||||
|
if (value.length()>10){
|
||||||
|
value = value.substring(0,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "发文单位":
|
case "发文单位":
|
||||||
value = verifyBean(sarStandardsInfoEO.getIssueCompany());
|
value = verifyBean(sarStandardsInfoEO.getIssueCompany());
|
||||||
@@ -126,6 +130,11 @@ public class LawsStandExportUtil {
|
|||||||
commentCycleStart=sarStandardsInfoEO.getCommentCycleStart();
|
commentCycleStart=sarStandardsInfoEO.getCommentCycleStart();
|
||||||
}
|
}
|
||||||
value = commentCycleStart;
|
value = commentCycleStart;
|
||||||
|
if(StringUtils.isNotBlank(value)){
|
||||||
|
if (value.length()>10){
|
||||||
|
value = value.substring(0,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "征集意见周期-结束时间":
|
case "征集意见周期-结束时间":
|
||||||
String commentCycleEnd="";
|
String commentCycleEnd="";
|
||||||
@@ -135,6 +144,11 @@ public class LawsStandExportUtil {
|
|||||||
commentCycleEnd=sarStandardsInfoEO.getCommentCycleEnd();
|
commentCycleEnd=sarStandardsInfoEO.getCommentCycleEnd();
|
||||||
}
|
}
|
||||||
value = commentCycleEnd;
|
value = commentCycleEnd;
|
||||||
|
if(StringUtils.isNotBlank(value)){
|
||||||
|
if (value.length()>10){
|
||||||
|
value = value.substring(0,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "文本状态":
|
case "文本状态":
|
||||||
value = verifyBean(sarStandardsInfoEO.getStandStatusShow());
|
value = verifyBean(sarStandardsInfoEO.getStandStatusShow());
|
||||||
@@ -160,14 +174,25 @@ public class LawsStandExportUtil {
|
|||||||
case "标签":
|
case "标签":
|
||||||
value = verifyBean(sarStandardsInfoEO.getLawsLabel());
|
value = verifyBean(sarStandardsInfoEO.getLawsLabel());
|
||||||
break;
|
break;
|
||||||
case "备注":
|
case "备注(最终政策发布)":
|
||||||
value = verifyBean(sarStandardsInfoEO.getLawsRemark());
|
value = verifyBean(sarStandardsInfoEO.getLawsRemark());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
List<String > dateList = InitStandAttrUtil.timeFieldListLaws;
|
||||||
|
List<String > dateList2 = InitStandAttrUtil.multiTimeFieldListLaws;
|
||||||
|
list.addAll(dateList);
|
||||||
|
list.addAll(dateList2);
|
||||||
String field = attrInfoMap.get(name);
|
String field = attrInfoMap.get(name);
|
||||||
if (attrValueMap != null) {
|
if (attrValueMap != null) {
|
||||||
|
List<String> finalData = list.stream().filter(field::contains).collect(Collectors.toList());
|
||||||
value = String.valueOf(attrValueMap.get(field));
|
value = String.valueOf(attrValueMap.get(field));
|
||||||
}
|
if (!finalData.isEmpty()) {
|
||||||
|
if (value.length()>10){
|
||||||
|
value = value.substring(0,10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
+58
-27
@@ -295,10 +295,10 @@
|
|||||||
laws_sycx_show.DIC_TYPE_NAME as LAWS_SYCX,
|
laws_sycx_show.DIC_TYPE_NAME as LAWS_SYCX,
|
||||||
laws_syqy_show.DIC_TYPE_NAME as LAWS_SYQY,
|
laws_syqy_show.DIC_TYPE_NAME as LAWS_SYQY,
|
||||||
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
|
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_YEAR,
|
laws_year_show.DIC_TYPE_NAME as LAWS_YEAR,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
|
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
|
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_LABEL,
|
laws_label_show.DIC_TYPE_NAME as LAWS_LABEL,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_REMARK,
|
SAR_LAWS_STAND_INFO.LAWS_REMARK,
|
||||||
SAR_LAWS_STAND_INFO.COUNTRY,
|
SAR_LAWS_STAND_INFO.COUNTRY,
|
||||||
SAR_LAWS_STAND_INFO.MODIFY_TIME,
|
SAR_LAWS_STAND_INFO.MODIFY_TIME,
|
||||||
@@ -306,28 +306,47 @@
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="Base_Column_List_show_ExportResult" >
|
<sql id="Base_Column_List_show_ExportResult" >
|
||||||
DISTINCT SAR_LAWS_STAND_INFO.ID,
|
DISTINCT tmp_tb.ID,
|
||||||
laws_type_show.DIC_TYPE_NAME as LAWS_TYPE,
|
tmp_tb.LAWS_TYPE,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
|
tmp_tb.LAWS_NUMBER,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_NAME,
|
tmp_tb.LAWS_NAME,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
|
tmp_tb.LAWS_EN_NAME,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_NO,
|
tmp_tb.LAWS_NO,
|
||||||
SAR_LAWS_STAND_INFO.ISSUE_TIME,
|
tmp_tb.ISSUE_TIME,
|
||||||
SAR_LAWS_STAND_INFO.ISSUE_COMPANY,
|
tmp_tb.ISSUE_COMPANY,
|
||||||
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START,
|
tmp_tb.COMMENT_CYCLE_START,
|
||||||
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END,
|
tmp_tb.COMMENT_CYCLE_END,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE,
|
tmp_tb.LAWS_TEXT_STATE,
|
||||||
laws_sycx_show.DIC_TYPE_NAME as LAWS_SYCX,
|
tmp_tb.LAWS_SYCX,
|
||||||
laws_syqy_show.DIC_TYPE_NAME as LAWS_SYQY,
|
tmp_tb.LAWS_SYQY,
|
||||||
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
|
tmp_tb.IS_RELATE_ACCESS,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_YEAR,
|
tmp_tb.LAWS_YEAR,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
|
tmp_tb.LAWS_NOTISYNC_NUM,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
|
tmp_tb.LAWS_BULLETIN,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_LABEL,
|
tmp_tb.LAWS_LABEL,
|
||||||
SAR_LAWS_STAND_INFO.LAWS_REMARK,
|
tmp_tb.LAWS_REMARK,
|
||||||
SAR_LAWS_STAND_INFO.COUNTRY,
|
tmp_tb.COUNTRY,
|
||||||
SAR_LAWS_STAND_INFO.MODIFY_TIME,
|
tmp_tb.MODIFY_TIME,
|
||||||
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
|
tmp_tb.standStatusShow,
|
||||||
|
tmp_tb.SSRQLAWS,
|
||||||
|
tmp_tb.XCXSSRQLAWS,
|
||||||
|
tmp_tb.ZCXSSRQLAWS,
|
||||||
|
tmp_tb.ZCWBLAWS,
|
||||||
|
tmp_tb.GCWBLAWS,
|
||||||
|
tmp_tb.JDWJLAWS,
|
||||||
|
tmp_tb.CYSDLAWS,
|
||||||
|
tmp_tb.TGRLAWS,
|
||||||
|
tmp_tb.TGDWLAWS,
|
||||||
|
tmp_tb.NYLXLAWS,
|
||||||
|
tmp_tb.YYRZLAWS,
|
||||||
|
tmp_tb.ZRBMLAWS,
|
||||||
|
tmp_tb.ZRGCSLAWS,
|
||||||
|
tmp_tb.DTWJHLAWS,
|
||||||
|
tmp_tb.BDTWJHLAWS,
|
||||||
|
tmp_tb.YYBZZCLAWS,
|
||||||
|
tmp_tb.XGLC,
|
||||||
|
tmp_tb.CHJLLAWS,
|
||||||
|
tmp_tb.GLWJLAWS
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
|
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
|
||||||
@@ -359,21 +378,33 @@
|
|||||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
AND dicstandTextStatus.valid_flag = 0
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
)
|
)
|
||||||
|
<!--年份-->
|
||||||
|
LEFT JOIN TS_DICTYPE laws_year_show ON (
|
||||||
|
laws_year_show.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_YEAR
|
||||||
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
|
)
|
||||||
|
<!--标签-->
|
||||||
|
LEFT JOIN TS_DICTYPE laws_label_show ON (
|
||||||
|
laws_label_show.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_LABEL
|
||||||
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
|
)
|
||||||
<!--适用车型-->
|
<!--适用车型-->
|
||||||
LEFT JOIN TS_DICTYPE laws_sycx_show ON (
|
LEFT JOIN TS_DICTYPE laws_sycx_show ON (
|
||||||
dicstandTextStatus.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_SYCX
|
laws_sycx_show.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_SYCX
|
||||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
AND dicstandTextStatus.valid_flag = 0
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
)
|
)
|
||||||
<!--适用区域-->
|
<!--适用区域-->
|
||||||
LEFT JOIN TS_DICTYPE laws_syqy_show ON (
|
LEFT JOIN TS_DICTYPE laws_syqy_show ON (
|
||||||
dicstandTextStatus.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_SYQY
|
laws_syqy_show.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_SYQY
|
||||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
AND dicstandTextStatus.valid_flag = 0
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
)
|
)
|
||||||
<!--政策分类-->
|
<!--政策分类-->
|
||||||
LEFT JOIN TS_DICTYPE laws_type_show ON (
|
LEFT JOIN TS_DICTYPE laws_type_show ON (
|
||||||
dicstandTextStatus.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_TYPE
|
laws_type_show.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_TYPE
|
||||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||||
AND dicstandTextStatus.valid_flag = 0
|
AND dicstandTextStatus.valid_flag = 0
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user