add:内外部会议导出功能
This commit is contained in:
+58
-1
@@ -1,19 +1,33 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
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.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
import com.adc.da.utils.util.InsideOutsideMeetingExportUtil;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
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.List;
|
||||
|
||||
/**
|
||||
@@ -25,6 +39,8 @@ import java.util.List;
|
||||
@RequestMapping("/${restPath}/lawss/insideOutsideMeeting")
|
||||
public class InsideOutSideMeetingController extends BaseController<InsideOutsideMeetingVO> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InsideOutSideMeetingController.class);
|
||||
|
||||
@Resource
|
||||
private InsideOutsideMeetingService meetingService;
|
||||
|
||||
@@ -71,4 +87,45 @@ public class InsideOutSideMeetingController extends BaseController<InsideOutside
|
||||
Boolean updateResult = meetingService.updateMeetingInfo(insideOutSideMeeting);
|
||||
return updateResult ? Result.success() : Result.error("更新失败");
|
||||
}
|
||||
|
||||
@ApiOperation("导出内外部会议信息")
|
||||
@GetMapping("/exportMeetingInfo")
|
||||
public ResponseMessage<?> exportMeetingInfo(InsideOutsideMeetingVO insideOutsideMeetingVO, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
List<InsideOutsideMeetingVO> datas;
|
||||
try {
|
||||
if(StringUtils.isEmpty(insideOutsideMeetingVO.getExportName())||insideOutsideMeetingVO.getExportName().equals("null")){
|
||||
insideOutsideMeetingVO.setExportName("内外部会议信息");
|
||||
}
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + ReadExcel.encodeFileName(insideOutsideMeetingVO.getExportName()+".xlsx",
|
||||
request));
|
||||
// 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出
|
||||
if (StrUtil.isNotBlank(insideOutsideMeetingVO.getExportIds())) {
|
||||
List<String> idList = Arrays.asList(insideOutsideMeetingVO.getExportIds().split(","));
|
||||
datas = meetingService.queryMeetingById(idList);
|
||||
} else {
|
||||
// 导出所有数据
|
||||
datas = meetingService.queryAllMeeting(insideOutsideMeetingVO);
|
||||
}
|
||||
workbook = InsideOutsideMeetingExportUtil.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);
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation("Excel文件导入内外部会议信息")
|
||||
@PostMapping("/importMeetingInfo")
|
||||
public ResponseMessage<?> importMeetingInfo(@RequestParam(value = "file",required = false) MultipartFile file) {
|
||||
return meetingService.importMeetingInfo(file);
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -4,6 +4,7 @@ import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,4 +20,7 @@ public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutsideMeeting
|
||||
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryMeetingById(@Param("exportIdList") List<String> exportIdList);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO);
|
||||
}
|
||||
|
||||
+13
-1
@@ -1,7 +1,9 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -58,7 +60,7 @@ public class InsideOutsideMeetingVO extends BasePage {
|
||||
private Integer validFlag;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date creationTime;
|
||||
private Date createTime;
|
||||
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
@@ -68,4 +70,14 @@ public class InsideOutsideMeetingVO extends BasePage {
|
||||
private String sortMode = "asc";
|
||||
|
||||
private String meetingTimeOperator = "=";
|
||||
|
||||
// 导出使用字段
|
||||
// 被前端选中的记录的ids
|
||||
private String exportIds;
|
||||
|
||||
// 从ids转换过来的id集合
|
||||
private List<String> exportIdList;
|
||||
|
||||
// 导出的文件名
|
||||
private String exportName;
|
||||
}
|
||||
|
||||
+8
@@ -1,8 +1,10 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -22,4 +24,10 @@ public interface InsideOutsideMeetingService extends IService<InsideOutsideMeeti
|
||||
Boolean deleteMeetingById(String meetingId);
|
||||
|
||||
Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO);
|
||||
|
||||
List<InsideOutsideMeetingVO> queryMeetingById(List<String> exportIdList);
|
||||
|
||||
ResponseMessage<?> importMeetingInfo(MultipartFile file);
|
||||
}
|
||||
|
||||
+133
-4
@@ -1,23 +1,34 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
||||
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||
import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.WorkbookFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
@@ -30,6 +41,9 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
@Resource
|
||||
private MeetingTopicService meetingTopicService;
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Override
|
||||
public InsideOutsideMeeting getMeetingInfo(String meetingId){
|
||||
InsideOutsideMeeting insideOutSideMeeting = this.baseMapper.selectById(meetingId);
|
||||
@@ -83,6 +97,16 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) {
|
||||
return this.baseMapper.queryAllMeeting(insideOutsideMeetingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsideOutsideMeetingVO> queryMeetingById(List<String> exportIdList) {
|
||||
return this.baseMapper.queryMeetingById(exportIdList);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) {
|
||||
@@ -120,4 +144,109 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
page.getPager().setRowCount(rowCount);
|
||||
return this.baseMapper.queryByPage(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseMessage<?> importMeetingInfo(MultipartFile file) {
|
||||
//给出头部信息
|
||||
String[] headerExcel = (FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic).split(",");
|
||||
//获取文件全称
|
||||
String fileNameStr = file.getOriginalFilename();
|
||||
//获取最后.的位置
|
||||
int pos = fileNameStr.lastIndexOf(".");
|
||||
//获取压缩文件名称并以小写显示
|
||||
String fileStr = fileNameStr.substring(pos + 1).toLowerCase();
|
||||
//校验是否是zip文件
|
||||
if (!fileStr.equals("zip")) {
|
||||
return Result.error("请上传zip格式的文件");
|
||||
}
|
||||
//进行拼接获取文件名称
|
||||
String fileName = fileNameStr.substring(0, pos);
|
||||
//获取路径和文件名称
|
||||
String path = filePath + "/" + fileName;
|
||||
|
||||
File saveDirectory = new File(path);
|
||||
//判断saveDirectory中是否是文件夹
|
||||
if (!saveDirectory.isDirectory()) {
|
||||
saveDirectory.mkdir();
|
||||
}
|
||||
//将文件写入到指定路径中
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr));
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件存储失败!");
|
||||
}
|
||||
int countSuccess = 0;
|
||||
//解压缩
|
||||
String zipEntryName = null;
|
||||
try {
|
||||
zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path);
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件解压失败");
|
||||
}
|
||||
//获取文件信息
|
||||
List<File> fileList = readImpExcelFile(zipEntryName);
|
||||
//判断获取到的文件数量
|
||||
if (fileList.size() != 1) {
|
||||
return Result.error("上传的文件只能有一个");
|
||||
}
|
||||
File importFile = fileList.get(0);
|
||||
if (!importFile.getName().contains(".xls") || !importFile.getName().contains(".xlsx")) {
|
||||
return Result.error("文件必须是EXCEL文件");
|
||||
}
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
workbook = WorkbookFactory.create(importFile);
|
||||
} catch (IOException e) {
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
if (sheet == null) {
|
||||
return Result.error("工作表为空");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 获取excel表头
|
||||
Row headerRow = sheet.getRow(1);
|
||||
for (int i = 0; i <= 25; i++) {
|
||||
sb.append(headerRow.getCell(i).getStringCellValue()).append(",");
|
||||
}
|
||||
//获取总条数
|
||||
int rowNum = sheet.getPhysicalNumberOfRows();
|
||||
// 开始遍历表格行
|
||||
for (int rowIndex = 1; rowIndex < rowNum; rowIndex++) {
|
||||
Row row = sheet.getRow(rowIndex);
|
||||
String fields = StringUtils.join(headerExcel);
|
||||
if (!fields.equals(FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic)) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
return Result.error("文件关闭出错");
|
||||
}
|
||||
//删除原上传文件
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
||||
}
|
||||
Map<String, String> rowList = new LinkedHashMap<>();
|
||||
// TODO 内外部会议导入
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,读取所有文件
|
||||
String name = fi.getName();
|
||||
//文件不为空 添加
|
||||
if (name != null){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,11 @@ public class FieldConvertUtil {
|
||||
// 企标计划 表头
|
||||
public static String exportFieldNamesEsRevisePlan = "企标类别,企标编号,企标名称,计划状态,制修订类型,起草人,内部评审责任人,技术委员会评审负责人,计划标准初稿完成时间,计划标准发布时间,起草责任单位,实际标准发布时间,质量评分";
|
||||
|
||||
// 内外部会议 表头
|
||||
public static String exportFieldNamesInsideOutsideMeeting = "会议名称,课题名称,会议主办单位,会议时间,会议地点,参会人员,会议主要内容,一级会议类别,二级会议类别";
|
||||
// 内外部会议关联表 表头
|
||||
public static String exportFieldNamesMeetingTopic = "议题名称,汇报人,汇报单位,议题主要内容";
|
||||
|
||||
public static String exportBaseFieldNamesBussCode = "起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称";
|
||||
|
||||
public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," +
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||
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 tjzdw
|
||||
* @description
|
||||
* @date 2023/10/20
|
||||
*/
|
||||
public class InsideOutsideMeetingExportUtil {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InsideOutsideMeetingExportUtil.class);
|
||||
|
||||
|
||||
public static Workbook exportDatas(List<InsideOutsideMeetingVO> datas) {
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
try {
|
||||
//定义表头
|
||||
String header = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic;
|
||||
//创建工作表对象
|
||||
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<InsideOutsideMeetingVO> datas,
|
||||
String header) throws Exception {
|
||||
String[] insideOutsideMeetingHeaderList = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting.split(",");
|
||||
String[] meetingTopicHeaderList = FieldConvertUtil.exportFieldNamesMeetingTopic.split(",");
|
||||
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
if (datas != null && !datas.isEmpty()) {
|
||||
int rowIndex = 1;
|
||||
for (InsideOutsideMeetingVO data : datas) {
|
||||
String[] headerArr = header.split(",");
|
||||
Row row = sheet.createRow(rowIndex);
|
||||
int cellIndex = 0;
|
||||
if (data.getMeetingTopicList().isEmpty()) {
|
||||
for (String headerName : headerArr) {
|
||||
String value = getValueByName(headerName, data);
|
||||
if (StringUtils.isBlank(value) || "null".equals(value)) {
|
||||
value = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(value);
|
||||
cellIndex++;
|
||||
}
|
||||
} else {
|
||||
for (String headerName : insideOutsideMeetingHeaderList) {
|
||||
String value = getValueByName(headerName, data);
|
||||
if (StringUtils.isBlank(value) || "null".equals(value)) {
|
||||
value = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(value);
|
||||
cellIndex++;
|
||||
}
|
||||
int newCellIndex = cellIndex;
|
||||
for (String field : meetingTopicHeaderList) {
|
||||
String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(0));
|
||||
if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) {
|
||||
topicValue = "";
|
||||
}
|
||||
row.createCell(cellIndex).setCellValue(topicValue);
|
||||
cellIndex++;
|
||||
}
|
||||
rowIndex++;
|
||||
for (int index = 1; index < data.getMeetingTopicList().size(); index++) {
|
||||
Row newRow = sheet.createRow(rowIndex);
|
||||
for (String field : meetingTopicHeaderList) {
|
||||
String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(index));
|
||||
if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) {
|
||||
topicValue = "";
|
||||
}
|
||||
newRow.createCell(newCellIndex).setCellValue(topicValue);
|
||||
newCellIndex++;
|
||||
}
|
||||
rowIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据表头返回相应值
|
||||
public static String getValueByName(String name, InsideOutsideMeetingVO insideOutsideMeeting) throws Exception{
|
||||
String value = "";
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch (name) {
|
||||
case "会议名称":
|
||||
value = insideOutsideMeeting.getMeetingName();
|
||||
break;
|
||||
case "课题名称":
|
||||
value = insideOutsideMeeting.getTopicName();
|
||||
break;
|
||||
case "会议主办单位":
|
||||
value = insideOutsideMeeting.getMeetingOrganizer();
|
||||
break;
|
||||
case "会议时间":
|
||||
String meetingTime = null;
|
||||
if (insideOutsideMeeting.getMeetingTime() != null){
|
||||
meetingTime = sdf.format(insideOutsideMeeting.getMeetingTime());
|
||||
}
|
||||
value = meetingTime;
|
||||
break;
|
||||
case "会议地点":
|
||||
value = insideOutsideMeeting.getMeetingAddress();
|
||||
break;
|
||||
case "参会人员":
|
||||
value = insideOutsideMeeting.getParticipants();
|
||||
break;
|
||||
case "会议主要内容":
|
||||
value = insideOutsideMeeting.getMeetingContent();
|
||||
break;
|
||||
case "一级会议类别":
|
||||
value = insideOutsideMeeting.getFirstMeetingType();
|
||||
break;
|
||||
case "二级会议类别":
|
||||
value = insideOutsideMeeting.getSecondMeetingType();
|
||||
break;
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
public static String getMeetingTopicValueByName (String name, MeetingTopic meetingTopic) {
|
||||
String value = "";
|
||||
switch (name) {
|
||||
case "议题名称":
|
||||
value = meetingTopic.getAgendaName();
|
||||
break;
|
||||
case "汇报人":
|
||||
value = meetingTopic.getReporter();
|
||||
break;
|
||||
case "汇报单位":
|
||||
value = meetingTopic.getReportingUnit();
|
||||
break;
|
||||
case "议题主要内容":
|
||||
value = meetingTopic.getAgendaContent();
|
||||
break;
|
||||
default:
|
||||
value = null;
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
+27
-10
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao">
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting" >
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO" >
|
||||
<id column="id" property="id" />
|
||||
<result column="MEETING_NAME" property="meetingName" />
|
||||
<result column="TOPIC_NAME" property="topicName" />
|
||||
@@ -19,7 +19,7 @@
|
||||
<result column="CREATE_TIME" property="createTime" />
|
||||
<result column="MODIFY_TIME" property="modifyTime" />
|
||||
<collection property="meetingTopicList" ofType="com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic">
|
||||
<id column="ID" property="id" />
|
||||
<id column="mtId" property="id" />
|
||||
<result column="MEETING_ID" property="meetingId" />
|
||||
<result column="AGENDA_NAME" property="agendaName" />
|
||||
<result column="AGENDA_MATERIALS" property="agendaMaterials" />
|
||||
@@ -38,7 +38,7 @@
|
||||
<sql id="Base_Column_Join_MeetingTopic_List">
|
||||
iom.ID,iom.MEETING_NAME,iom.TOPIC_NAME,iom.MEETING_ORGANIZER,iom.MEETING_TIME,iom.MEETING_ADDRESS,
|
||||
iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE,
|
||||
mt.ID,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
|
||||
mt.ID as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
|
||||
mt.AGENDA_CONTENT,mt.VALID_FLAG,mt.CREATE_TIME,mt.MODIFY_TIME,
|
||||
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME
|
||||
</sql>
|
||||
@@ -104,13 +104,30 @@
|
||||
<include refid="MeetingTopic_where" />
|
||||
order by
|
||||
<choose>
|
||||
<when test="sortField == 'AGENDA_NAME'">
|
||||
mt.${sortField} ${sortMode}
|
||||
</when>
|
||||
<otherwise>
|
||||
iom.${sortField} ${sortMode}
|
||||
</otherwise>
|
||||
</choose>
|
||||
<when test="sortField == 'AGENDA_NAME'">
|
||||
mt.${sortField} ${sortMode}
|
||||
</when>
|
||||
<otherwise>
|
||||
iom.${sortField} ${sortMode}
|
||||
</otherwise>
|
||||
</choose>
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
<select id="queryMeetingById" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0 and iom.ID in
|
||||
<foreach collection="exportIdList" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
order by iom.MEETING_NAME
|
||||
</select>
|
||||
<select id="queryAllMeeting" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
<include refid="MeetingTopic_where" />
|
||||
order by iom.MEETING_NAME
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user