Merge commit 'da957a46706061aaffe06b2ebb35205b78f84d5a'
This commit is contained in:
+22
-4
@@ -350,6 +350,7 @@ public class ActSarItemsBussEOService {
|
||||
String standType = String.valueOf(standMap.get("standType"));
|
||||
String DTQBBHBUSS = String.valueOf(standMap.get("DTQBBHBUSS"));
|
||||
String standNum = String.valueOf(standMap.get("standNum"));//制修订时顺序号
|
||||
String madelSub = String.valueOf(standMap.get("madelSub")); // 培训文件
|
||||
// String isJudge = String.valueOf(standMap.get("ifIn")); //是否经过技术评估
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
// if(standMap.containsKey("standId")) {
|
||||
@@ -463,15 +464,29 @@ public class ActSarItemsBussEOService {
|
||||
String relatePro = sarBussStandAttrInfoService.selectFieldValByStandId("XGLC",standId);
|
||||
if (StringUtils.isNotBlank(relatePro)) {
|
||||
String[] processSplit = relatePro.split(",");
|
||||
Set<String> processSet = new HashSet<>();
|
||||
for(String sData:processSplit){
|
||||
processSet.add(sData);
|
||||
}
|
||||
Set<String> processSet = new HashSet<>(Arrays.asList(processSplit));
|
||||
processSet.add(prcNum);
|
||||
relatePro = StringUtils.join(processSet.toArray(), ",");
|
||||
} else {
|
||||
relatePro = prcNum;
|
||||
}
|
||||
if (StringUtils.isNotBlank(madelSub)) {
|
||||
// 查询原宣贯记录
|
||||
String xgjlBuss = sarBussStandAttrInfoService.selectFieldValByStandId("XGJLBUSS", standId);
|
||||
if (StringUtils.isNotBlank(xgjlBuss)) {
|
||||
String[] xgjlBussSplit = xgjlBuss.split(",");
|
||||
Set<String> xgjlBussSet = new HashSet<>();
|
||||
for (String xgjlBussData : xgjlBussSplit) {
|
||||
xgjlBussSet.add(xgjlBussData);
|
||||
}
|
||||
xgjlBussSet.add(madelSub);
|
||||
xgjlBuss = StringUtils.join(xgjlBussSet.toArray(), ',');
|
||||
} else {
|
||||
xgjlBuss = madelSub;
|
||||
}
|
||||
// 编辑宣贯记录
|
||||
sarBussStandAttrInfoService.updateStandInfo(standId,"XGJLBUSS",xgjlBuss);
|
||||
}
|
||||
// 编辑标准
|
||||
sarBussionessStand.setId(standId);
|
||||
iSarBussionessStandService.updateSarBussionessStand(sarBussionessStand);
|
||||
@@ -487,6 +502,7 @@ public class ActSarItemsBussEOService {
|
||||
JSONObject atteObj = JSON.parseObject(sarBussionessStand.getSarStandAttrEOStr());
|
||||
atteObj.remove("LSBBBUSS");
|
||||
atteObj.put("LSBBBUSS","");
|
||||
atteObj.put("XGJLBUSS",madelSub);
|
||||
String resData1 = JSON.toJSONString(atteObj);
|
||||
sarBussionessStand.setSarStandAttrEOStr(resData1);
|
||||
ResponseMessage<SarBussionessStand> responseMessage = iSarBussionessStandService.createSarBussionessStand(sarBussionessStand);
|
||||
@@ -497,6 +513,8 @@ public class ActSarItemsBussEOService {
|
||||
|
||||
// 编辑相关流程
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGLC",prcNum);
|
||||
// 编辑宣贯记录
|
||||
sarBussStandAttrInfoService.updateStandInfo(sarBussionessStand.getId(),"XGJLBUSS",madelSub);
|
||||
}
|
||||
List<SarStandItems> allItems = new ArrayList<>();
|
||||
//开始处理条款数据,从去重后的结果中直接处理即可
|
||||
|
||||
@@ -185,6 +185,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
//在线编辑 日志 (包含把17的文件下载到16)
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/selectOnlineFile");
|
||||
|
||||
// 标准法规库-企标计划导出接口
|
||||
addInterceptor.excludePathPatterns("/api/esRevisePlan/es-revise-plan/exportEsRevisePlanInfoExcel");
|
||||
|
||||
|
||||
// // 添加自定义拦截器,并拦截对应 url
|
||||
addInterceptor.addPathPatterns("/**");
|
||||
|
||||
+28
@@ -6,9 +6,12 @@ import com.adc.da.search.util.DateUtil;
|
||||
import com.adc.da.search.util.InitStandAttrSearchUtil;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
||||
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -40,6 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -53,6 +57,9 @@ import java.util.stream.Stream;
|
||||
public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
private final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SearchCenterServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private ISarMenuStandardService sarMenuStandardService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TransportClient transportClient;
|
||||
@@ -232,6 +239,18 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
sortField2 = "standYear";
|
||||
sortField3 = "standSort.keyword";
|
||||
}
|
||||
|
||||
List<String> menuNameList = new ArrayList<>();
|
||||
// 国内海外查询标准体系字段由id变为文字
|
||||
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||
ArrayList<String> menuIdList = new ArrayList<>();
|
||||
Collections.addAll(menuIdList,searchInfoEO.getStandSystem().split(","));
|
||||
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(SarMenuStandard::getId,menuIdList);
|
||||
wrapper.select(SarMenuStandard::getMenuName);
|
||||
List<SarMenuStandard> sarMenuStandardList = sarMenuStandardService.list(wrapper);
|
||||
menuNameList = sarMenuStandardList.stream().map(SarMenuStandard::getMenuName).collect(Collectors.toList());
|
||||
}
|
||||
searchRequestBuilder = client.prepareSearch(searchInfoEO.getSelectIndex())
|
||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||
.setFrom((searchInfoEO.getPage()-1)*searchInfoEO.getPageSize())
|
||||
@@ -347,6 +366,15 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
||||
}
|
||||
boolQueryBuilder.must(boolQueryShould);
|
||||
}else {
|
||||
if (!menuNameList.isEmpty()) {
|
||||
menuNameList.forEach(each -> {
|
||||
if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||
boolQueryBuilder.must(QueryBuilders.matchQuery("standSystem","*"+each+"*"));
|
||||
}else if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||
boolQueryBuilder.must(QueryBuilders.matchQuery("TXLBBUSS",each));
|
||||
}
|
||||
});
|
||||
}
|
||||
if ("stand".equals(searchInfoEO.getSelectIndex()) && StringUtils.isNotBlank(searchInfoEO.getStandType())) {
|
||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
||||
}
|
||||
|
||||
+91
@@ -1,23 +1,36 @@
|
||||
package com.adc.da.slrs.esRevisePlan.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.utils.util.EsRevisePlanExportUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,6 +47,8 @@ import java.util.List;
|
||||
@RequestMapping("api/esRevisePlan/es-revise-plan")
|
||||
public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(EsRevisePlanController.class);
|
||||
|
||||
@Autowired
|
||||
IEsRevisePlanService iEsRevisePlanService;
|
||||
@Autowired
|
||||
@@ -61,6 +76,82 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
return esRevisePlans;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "企标计划导出excel")
|
||||
@GetMapping(value = "/exportEsRevisePlanInfoExcel")
|
||||
public void exportStandardsInfoExcel(EsRevisePlan esRevisePlan, HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
esRevisePlan.setExportFlag(true);
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
if (StrUtil.isNotBlank(esRevisePlan.getExportIds())) {
|
||||
esRevisePlan.setExportIdList(Arrays.asList(esRevisePlan.getExportIds().split(",")));
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isEmpty(esRevisePlan.getExportName())||esRevisePlan.getExportName().equals("null")){
|
||||
esRevisePlan.setExportName("标准法规信息");
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(esRevisePlan.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出所有数据
|
||||
List<EsRevisePlan> datas = iEsRevisePlanService.queryAllPlans(esRevisePlan);
|
||||
for (EsRevisePlan revisePlan : datas){
|
||||
String area = revisePlan.getArea();
|
||||
if (StringUtils.isNotBlank(area)){
|
||||
if (area.startsWith("[") && area.endsWith("]")){
|
||||
area = area.substring(1,area.length() - 1);
|
||||
area = area.replace("\"","");
|
||||
}
|
||||
}
|
||||
revisePlan.setArea(area);
|
||||
//查评分
|
||||
if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) {
|
||||
List<Double> last = new ArrayList<>();
|
||||
List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
|
||||
for (QualityEvaluation evaluation : evaluations) {
|
||||
Double score;
|
||||
String value;
|
||||
if (evaluation.getProcessNode()==null){
|
||||
value="";
|
||||
}else {
|
||||
value=evaluation.getProcessNode();
|
||||
}
|
||||
String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore();
|
||||
switch (value){
|
||||
case "征求意见":
|
||||
score=Double.valueOf(evaluationScore) * 0.3;
|
||||
break;
|
||||
case "技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluationScore) * 0.4;
|
||||
break;
|
||||
case "重新技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluationScore) * 0.4;
|
||||
break;
|
||||
case "标准化复审":
|
||||
score=Double.valueOf(evaluationScore) * 0.15;
|
||||
break;
|
||||
case "标准法规部高级经理审核":
|
||||
score=Double.valueOf(evaluationScore) * 0.15;
|
||||
break;
|
||||
default: score=Double.valueOf(evaluationScore);
|
||||
}
|
||||
last.add(score);
|
||||
}
|
||||
revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
|
||||
}
|
||||
}
|
||||
workbook = EsRevisePlanExportUtil.exportDatas(datas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
throw new AdcDaBaseException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "多条件查询企标计划")
|
||||
@PostMapping("queryAllPlans")
|
||||
public ResponseMessage<Object> queryAllPlans(EsRevisePlan esRevisePlan){
|
||||
|
||||
@@ -169,4 +169,20 @@ public class EsRevisePlan extends BasePage {
|
||||
@ApiModelProperty(value = "OA是否已经发送")
|
||||
@TableField("OA_IS_SEND")
|
||||
private String oaIsSend;
|
||||
|
||||
@ApiModelProperty(value = "导出的文件名")
|
||||
@TableField(exist = false)
|
||||
private String exportName;
|
||||
|
||||
@ApiModelProperty(value = "是否为导出标识")
|
||||
@TableField(exist = false)
|
||||
private boolean exportFlag;
|
||||
|
||||
@ApiModelProperty(value = "被前端选中的记录的ids")
|
||||
@TableField(exist = false)
|
||||
private String exportIds;
|
||||
|
||||
@ApiModelProperty(value = "从ids转换过来的id集合")
|
||||
@TableField(exist = false)
|
||||
private List<String> exportIdList;
|
||||
}
|
||||
|
||||
-6
@@ -6,7 +6,6 @@ import com.adc.da.Log.BusinessType;
|
||||
import com.adc.da.Log.EpcLog;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.impl.AttFileEOServiceImpl;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanInfo;
|
||||
@@ -37,10 +36,8 @@ import com.adc.da.utils.util.SarAdvanceSearchUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
@@ -54,13 +51,10 @@ import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import springfox.documentation.spring.web.json.Json;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
+5
@@ -125,6 +125,10 @@ public class SarBussionessStand extends BaseEntity {
|
||||
@TableField("STAND_SN")
|
||||
private String standSn;
|
||||
|
||||
@ApiModelProperty(value = "保密等级")
|
||||
@TableField("SECRET_LEVEL")
|
||||
private String secretLevel;
|
||||
|
||||
@ApiModelProperty(value = "发布稿名称")
|
||||
@TableField(exist = false)
|
||||
private String LSBBBUSS;
|
||||
@@ -370,6 +374,7 @@ public class SarBussionessStand extends BaseEntity {
|
||||
return validFlag;
|
||||
}
|
||||
|
||||
|
||||
public void setValidFlag(Integer validFlag) {
|
||||
this.validFlag = validFlag;
|
||||
}
|
||||
|
||||
+9
@@ -1915,6 +1915,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
getAttrMap.put("FBGBUSS", obj);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank((String) getAttrMap.get("XGJLBUSS"))) {
|
||||
String[] xgjlBussList = getAttrMap.get("XGJLBUSS").toString().split(",");
|
||||
StringBuilder xgjlBussName = new StringBuilder();
|
||||
for (String xgjlBuss : xgjlBussList) {
|
||||
AttFileEO fileInfo = attFileEOService.getFileInfo(xgjlBuss);
|
||||
xgjlBussName.append(fileInfo.getOldFileName());
|
||||
}
|
||||
getAttrMap.put("xgjlBussName",xgjlBussName.toString());
|
||||
}
|
||||
}
|
||||
if (InitStandAttrUtil.clobFieldListBuss != null && !InitStandAttrUtil.clobFieldListBuss.isEmpty()) {
|
||||
// 遍历修改所有clob类型的值
|
||||
|
||||
+8
-4
@@ -59,7 +59,7 @@ public class ZlTreeServiceImpl extends ServiceImpl<ZlTreeDao, ZlTree> implements
|
||||
// 查询当前登录人的权限菜单
|
||||
List<String> recourceIdList = tsUserService.getResourceUserId(loginUserId);
|
||||
|
||||
TreeData res=new TreeData();
|
||||
List<TreeData> resList = new ArrayList<>();
|
||||
QueryWrapper<ZlTree> wrapper=new QueryWrapper<>();
|
||||
wrapper.lambda().in(ZlTree::getId, recourceIdList);
|
||||
wrapper.orderByAsc("length(sort),sort");
|
||||
@@ -72,13 +72,17 @@ public class ZlTreeServiceImpl extends ServiceImpl<ZlTreeDao, ZlTree> implements
|
||||
BeanUtils.copyProperties(zlTree,zlTreeData);
|
||||
treeData.add(zlTreeData);
|
||||
}else {
|
||||
TreeData res=new TreeData();
|
||||
BeanUtils.copyProperties(zlTree,res);
|
||||
resList.add(res);
|
||||
}
|
||||
}
|
||||
//递归生成树
|
||||
digui(res,treeData);
|
||||
List<TreeData> treeData1=new ArrayList<>();
|
||||
treeData1.add(res);
|
||||
//递归生成树
|
||||
for (TreeData data : resList) {
|
||||
digui(data,treeData);
|
||||
treeData1.add(data);
|
||||
}
|
||||
return treeData1;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/8/29 17:27
|
||||
*/
|
||||
public class EsRevisePlanExportUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BussStandExportUtil.class);
|
||||
|
||||
|
||||
public static Workbook exportDatas(List<EsRevisePlan> datas) {
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
try {
|
||||
StringBuilder attrBud = new StringBuilder();
|
||||
//定义表头
|
||||
String header = FieldConvertUtil.exportFieldNamesEsRevisePlan + "," + attrBud.toString();
|
||||
//创建工作表对象
|
||||
Sheet sheet = workbook.createSheet();
|
||||
// 创建头部
|
||||
createHeader(workbook, sheet, header);
|
||||
// 创建数据
|
||||
createDatas(workbook, sheet, datas, header);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
public static void createHeader(Workbook workbook, Sheet sheet, String header) {
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
Row rowHeader = sheet.createRow(0);//开始创建标题行
|
||||
if (StringUtils.isNotBlank(header)) {
|
||||
String[] headerArr = header.split(",");
|
||||
for (int i = 0; i < headerArr.length; i++) {
|
||||
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void createDatas(Workbook workbook, Sheet sheet, List<EsRevisePlan> datas,
|
||||
String header) throws Exception {
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
for (int i = 0; i < datas.size(); i++) {
|
||||
EsRevisePlan esRevisePlan = datas.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
String[] headerArr = header.split(",");
|
||||
int sheetNum = 0;
|
||||
for (String headerName : headerArr) {
|
||||
String value = getValueByName(headerName, esRevisePlan);
|
||||
if (StringUtils.isBlank(value) || "null".equals(value)) {
|
||||
value = "";
|
||||
}
|
||||
row.createCell(sheetNum).setCellValue(value);
|
||||
sheetNum++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据表头返回相应值
|
||||
public static String getValueByName(String name, EsRevisePlan esRevisePlan) throws Exception{
|
||||
String value = "";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch (name) {
|
||||
case "企标类别":
|
||||
value = esRevisePlan.getBussSort();
|
||||
break;
|
||||
case "企标编号":
|
||||
value = esRevisePlan.getStandNumber();
|
||||
break;
|
||||
case "企标名称":
|
||||
value = esRevisePlan.getEsName();
|
||||
break;
|
||||
case "计划状态":
|
||||
value = esRevisePlan.getPlanStatus();
|
||||
break;
|
||||
case "制修订类型":
|
||||
value = esRevisePlan.getReviseStatus();
|
||||
break;
|
||||
case "起草人":
|
||||
value = esRevisePlan.getDrafterName();
|
||||
break;
|
||||
case "内部评审责任人":
|
||||
value = esRevisePlan.getResPersonName();
|
||||
break;
|
||||
case "技术委员会评审负责人":
|
||||
value = esRevisePlan.getWgLeaderName();
|
||||
break;
|
||||
case "计划标准初稿完成时间":
|
||||
String draftTime = null;
|
||||
if (esRevisePlan.getDraftTime() != null){
|
||||
draftTime = sdf.format(esRevisePlan.getDraftTime());
|
||||
}
|
||||
value = draftTime;
|
||||
break;
|
||||
case "计划标准发布时间":
|
||||
String releaseTime = null;
|
||||
if (esRevisePlan.getReleaseTime() != null){
|
||||
releaseTime = sdf.format(esRevisePlan.getReleaseTime());
|
||||
}
|
||||
value = releaseTime;
|
||||
break;
|
||||
case "起草责任单位":
|
||||
value = esRevisePlan.getUnitName();
|
||||
break;
|
||||
case "实际标准发布时间":
|
||||
String actualTime = null;
|
||||
if (esRevisePlan.getActualTime() != null){
|
||||
actualTime = sdf.format(esRevisePlan.getActualTime());
|
||||
}
|
||||
value = actualTime;
|
||||
break;
|
||||
case "质量评分":
|
||||
value = String.valueOf(esRevisePlan.getScore());
|
||||
break;
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.adc.da.utils.util;
|
||||
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -56,6 +55,9 @@ public class FieldConvertUtil {
|
||||
|
||||
public static String exportBaseFieldNamesBuss = "企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态";
|
||||
|
||||
// 企标计划 表头
|
||||
public static String exportFieldNamesEsRevisePlan = "企标类别,企标编号,企标名称,计划状态,制修订类型,起草人,内部评审责任人,技术委员会评审负责人,计划标准初稿完成时间,计划标准发布时间,起草责任单位,实际标准发布时间,质量评分";
|
||||
|
||||
public static String exportBaseFieldNamesBussCode = "起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称";
|
||||
|
||||
public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," +
|
||||
|
||||
@@ -265,9 +265,18 @@
|
||||
<if test="unit != null and unit != ''">
|
||||
and (select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) like concat('%',#{unit},'%')
|
||||
</if>
|
||||
<if test="exportFlag and exportIdList != null and exportIdList.size() > 0">
|
||||
AND es_revise_plan.id in
|
||||
<foreach item="item" index="index" collection="exportIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
<include refid="pages">
|
||||
</include>
|
||||
<if test="!exportFlag">
|
||||
<include refid="pages">
|
||||
</include>
|
||||
</if>
|
||||
</select>
|
||||
<!-- 查询详情-->
|
||||
<select id="selectOne" parameterType="java.lang.String" resultMap="BaseInfoMap">
|
||||
|
||||
+1
@@ -23,6 +23,7 @@
|
||||
<result column="text_status_buss" property="textStatusBuss" />
|
||||
<result column="text_status_buss_show" property="textStatusBussShow"/>
|
||||
<result column="DTQBBHBUSS" property="DTQBBHBUSS"/>
|
||||
<result column="secret_level" property="secretLevel" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStandExport" >
|
||||
|
||||
+2
@@ -1004,6 +1004,7 @@
|
||||
<!-- 标准名称 -->
|
||||
<if test="page.standName != null and page.standName != ''">
|
||||
and stand_name like concat(concat('%',#{page.standName}),'%')
|
||||
or stand_en_name like concat(concat('%',#{page.standName},'%'))
|
||||
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
|
||||
@@ -1196,6 +1197,7 @@
|
||||
<!-- 标准名称 -->
|
||||
<if test="page.standName != null and page.standName != ''">
|
||||
and stand_name like concat(concat('%',#{page.standName}),'%')
|
||||
or stand_en_name like concat(concat('%',#{page.standName}),'%')
|
||||
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
|
||||
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
|
||||
|
||||
Reference in New Issue
Block a user