bug: 导入功能修改

This commit is contained in:
wxyclub
2023-11-23 22:22:47 +08:00
parent 5c2e723722
commit 60d8fd311c
13 changed files with 263 additions and 73 deletions
@@ -11,8 +11,7 @@ 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.entity.*;
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.FieldConvertUtil;
@@ -27,6 +26,7 @@ import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -122,11 +123,26 @@ public class InsideOutSideMeetingController extends BaseController<InsideOutside
// 导出所有数据
datas = meetingService.queryAllMeeting(insideOutsideMeetingVO);
}
List<InsideOutsideMeetingExport> dataExportList = new ArrayList<>();
for (InsideOutsideMeetingVO data : datas) {
InsideOutsideMeetingExport dataExport = new InsideOutsideMeetingExport();
BeanUtils.copyProperties(data, dataExport);
if (data.getMeetingTopicList()!= null) {
List<MeetingTopicExport> topicExportList = new ArrayList<>();
for (MeetingTopic meetingTopic : data.getMeetingTopicList()) {
MeetingTopicExport topicExport = new MeetingTopicExport();
BeanUtils.copyProperties(meetingTopic, topicExport);
topicExportList.add(topicExport);
}
dataExport.setMeetingTopicList(topicExportList);
}
dataExportList.add(dataExport);
}
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
exportParams.setSheetName(insideOutsideMeetingVO.getExportName());
// workbook = InsideOutsideMeetingExportUtil.exportDatas(datas);
workbook = ExcelExportUtil.exportExcel(exportParams, InsideOutsideMeetingVO.class, datas);
workbook = ExcelExportUtil.exportExcel(exportParams, InsideOutsideMeetingExport.class, dataExportList);
os = response.getOutputStream();
workbook.write(os);
os.flush();
@@ -75,19 +75,19 @@ public class InsideOutsideMeeting extends BaseEntity {
@TableField("MEETING_CONTENT")
private String meetingContent;
@ApiModelProperty(value = "1级会议类")
@ApiModelProperty(value = "1级会议")
@TableField("FIRST_MEETING_TYPE")
private String firstMeetingType;
@ApiModelProperty(value = "1级会议类名称")
@ApiModelProperty(value = "1级会议类名称")
@TableField(exist = false)
private String firstMeetingTypeName;
@ApiModelProperty(value = "2级会议类")
@ApiModelProperty(value = "2级会议")
@TableField("SECOND_MEETING_TYPE")
private String secondMeetingType;
@ApiModelProperty(value = "2级会议类名称")
@ApiModelProperty(value = "2级会议类名称")
@TableField(exist = false)
private String secondMeetingTypeName;
@@ -0,0 +1,51 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.adc.da.att.entity.AttFileEO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author tjzdw
* @description
* @date 2023/11/23
*/
@Data
public class InsideOutsideMeetingExport {
private String id;
@Excel(name = "会议名称", needMerge = true)
private String meetingName;
@Excel(name = "课题名称", needMerge = true)
private String topicName;
@Excel(name = "会议主办单位", needMerge = true)
private String meetingOrganizer;
@Excel(name = "会议时间", exportFormat = "yyyy-MM-dd", needMerge = true)
private Date meetingTime;
@Excel(name = "会议地点", needMerge = true)
private String meetingAddress;
@Excel(name = "参会人员", needMerge = true)
private String participants;
@Excel(name = "会议主要内容", needMerge = true)
private String meetingContent;
@Excel(name = "1级会议分类", needMerge = true)
private String firstMeetingTypeName;
@Excel(name = "2级会议分类", needMerge = true)
private String secondMeetingTypeName;
@ExcelCollection(name = "会议议题")
private List<MeetingTopicExport> meetingTopicList;
}
@@ -24,42 +24,42 @@ public class InsideOutsideMeetingVO extends BasePage {
private String id;
@Excel(name = "会议名称", needMerge = true)
@Excel(name = "*会议名称", needMerge = true)
private String meetingName;
@Excel(name = "课题名称", needMerge = true)
private String topicName;
@Excel(name = "会议主办单位", needMerge = true)
@Excel(name = "*会议主办单位", needMerge = true)
private String meetingOrganizer;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@Excel(name = "会议时间", exportFormat = "yyyy-MM-dd", needMerge = true)
@Excel(name = "*会议时间", exportFormat = "yyyy-MM-dd", needMerge = true)
private Date meetingTime;
@Excel(name = "会议地点", needMerge = true)
@Excel(name = "*会议地点", needMerge = true)
private String meetingAddress;
private String agendaNameStr;
@Excel(name = "参会人员", needMerge = true)
@Excel(name = "*参会人员", needMerge = true)
private String participants;
private String meetingMinutes;
private List<AttFileEO> meetingMinutesList;
@Excel(name = "会议主要内容", needMerge = true)
@Excel(name = "*会议主要内容", needMerge = true)
private String meetingContent;
private String firstMeetingType;
@Excel(name = "1级会议类", needMerge = true)
@Excel(name = "*1级会议", needMerge = true)
private String firstMeetingTypeName;
private String secondMeetingType;
@Excel(name = "2级会议类", needMerge = true)
@Excel(name = "*2级会议", needMerge = true)
private String secondMeetingTypeName;
@ExcelCollection(name = "会议议题")
@@ -38,27 +38,28 @@ public class MeetingTopic extends BaseEntity {
@ApiModelProperty(value = "议题名称")
@TableField("AGENDA_NAME")
@Excel(name = "议题名称")
@Excel(name = "*议题名称")
private String agendaName;
@ApiModelProperty(value = "议题材料")
@TableField("AGENDA_MATERIALS")
private String agendaMaterials;
@TableField(exist = false)
private List<AttFileEO> agendaMaterialsList;
@ApiModelProperty(value = "汇报人")
@TableField("REPORTER")
@Excel(name = "汇报人")
@Excel(name = "*汇报人")
private String reporter;
@ApiModelProperty(value = "汇报单位")
@TableField("REPORTING_UNIT")
@Excel(name = "汇报单位")
@Excel(name = "*汇报单位")
private String reportingUnit;
@ApiModelProperty(value = "议题主要内容")
@TableField("AGENDA_CONTENT")
@Excel(name = "议题主要内容")
@Excel(name = "*议题主要内容")
private String agendaContent;
@ApiModelProperty(value = "创建时间")
@@ -0,0 +1,34 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.adc.da.att.entity.AttFileEO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author tjzdw
* @description
* @date 2023/11/23
*/
@Data
public class MeetingTopicExport {
private String id;
@Excel(name = "议题名称")
private String agendaName;
@Excel(name = "汇报人")
private String reporter;
@Excel(name = "汇报单位")
private String reportingUnit;
@Excel(name = "议题主要内容")
private String agendaContent;
}
@@ -356,7 +356,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
InsideOutsideMeeting insideOutsideMeeting = new InsideOutsideMeeting();
List<MeetingTopic> meetingTopicList = new ArrayList<>();
for (Map<String, String> dataMap : importDataList) {
String meetingName = dataMap.get("会议名称");
String meetingName = dataMap.get("*会议名称");
// 如果会议名称为空,则表示该行为会议课题行,是之前会议的会议课题,不提交之前的会议信息。不为空则进入
if (StringUtils.isNotBlank(meetingName)) {
// 如果计数器大于0,表示进入了新的会议信息中,提交之前的会议信息
@@ -371,64 +371,108 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
count = 0;
}
insideOutsideMeeting.setMeetingName(meetingName);
insideOutsideMeeting.setTopicName(dataMap.get("课题名称"));
insideOutsideMeeting.setMeetingOrganizer(dataMap.get("会议主办单位"));
Date meetingTime = null;
try {
meetingTime = sdf.parse(dataMap.get("会议时间"));
} catch (ParseException e) {
return Result.error(""+ (count+1) +"会议时间格式必须为年-月-日");
if (StringUtils.isNotBlank(dataMap.get("课题名称"))) {
insideOutsideMeeting.setTopicName(dataMap.get("课题名称"));
} else {
return Result.error(""+ (count+1) +"行课题名称不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*会议主办单位"))) {
insideOutsideMeeting.setMeetingOrganizer(dataMap.get("*会议主办单位"));
} else {
return Result.error(""+ (count+1) +"行会议主办单位不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*会议时间"))) {
Date meetingTime = null;
try {
meetingTime = sdf.parse(dataMap.get("*会议时间"));
insideOutsideMeeting.setMeetingTime(meetingTime);
} catch (ParseException e) {
return Result.error(""+ (count+1) +"行会议时间格式必须为年-月-日");
}
} else {
return Result.error(""+ (count+1) +"行会议时间不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*会议地点"))) {
insideOutsideMeeting.setMeetingAddress(dataMap.get("*会议地点"));
} else {
return Result.error(""+ (count+1) +"行会议地点不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*参会人员"))) {
insideOutsideMeeting.setParticipants(dataMap.get("*参会人员"));
} else {
return Result.error(""+ (count+1) +"行参会人员不能为空");
}
insideOutsideMeeting.setMeetingTime(sdf.parse(dataMap.get("会议时间")));
insideOutsideMeeting.setMeetingAddress(dataMap.get("会议地点"));
insideOutsideMeeting.setParticipants(dataMap.get("参会人员"));
String meetingMinutesFileNameStr = dataMap.get("会议纪要");
String meetingMinutesFileAtt = null;
try {
meetingMinutesFileAtt = getFileAtt(meetingMinutesFileNameStr, fileMap, count);
meetingMinutesFileAtt = getFileAtt("会议纪要",meetingMinutesFileNameStr, fileMap, count);
} catch (Exception e) {
return Result.error(e.getMessage());
}
if (StringUtils.isNotBlank(meetingMinutesFileAtt)) {
insideOutsideMeeting.setMeetingMinutes(meetingMinutesFileAtt);
}
insideOutsideMeeting.setMeetingContent(dataMap.get("会议主要内容"));
if (StringUtils.isNotBlank(dataMap.get("一级会议类别"))) {
if (!firstMeetingTypeNameSet.contains(dataMap.get("一级会议类别"))){
return Result.error("一级会议类别不符合输入要求");
if (StringUtils.isNotBlank(dataMap.get("*会议主要内容"))) {
insideOutsideMeeting.setMeetingContent(dataMap.get("*会议主要内容"));
}else {
return Result.error(""+ (count+1) +"行会议主要内容不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*一级会议分类"))) {
if (!firstMeetingTypeNameSet.contains(dataMap.get("*一级会议分类"))){
return Result.error("一级会议分类不符合输入要求");
}
for (TsDicType tsDicType : firstMeetingTypeList) {
if (dataMap.get("一级会议类").equals(tsDicType.getDicTypeName())) {
if (dataMap.get("*一级会议").equals(tsDicType.getDicTypeName())) {
insideOutsideMeeting.setFirstMeetingType(tsDicType.getDicTypeCode());
}
}
}else {
return Result.error(""+ (count+1) +"行一级会议分类不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("二级会议类"))) {
if (!secondMeetingTypeNameSet.contains(dataMap.get("二级会议类"))){
return Result.error("二级会议类不符合输入要求");
if (StringUtils.isNotBlank(dataMap.get("*二级会议"))) {
if (!secondMeetingTypeNameSet.contains(dataMap.get("*二级会议"))){
return Result.error("二级会议类不符合输入要求");
}
for (TsDicType tsDicType : secondMeetingTypeList) {
if (dataMap.get("二级会议类").equals(tsDicType.getDicTypeName())) {
if (dataMap.get("*二级会议").equals(tsDicType.getDicTypeName())) {
insideOutsideMeeting.setSecondMeetingType(tsDicType.getDicTypeCode());
}
}
}else {
return Result.error(""+ (count+1) +"行二级会议分类不能为空");
}
// 会议课题信息
MeetingTopic meetingTopic = new MeetingTopic();
meetingTopic.setAgendaName(dataMap.get("议题名称"));
if (StringUtils.isNotBlank(dataMap.get("*议题名称"))) {
meetingTopic.setAgendaName(dataMap.get("*议题名称"));
} else {
return Result.error(""+ (count+1) +"行议题名称不能为空");
}
String agendaMaterialsFileNameStr = dataMap.get("议题材料");
String agendaMaterialsFileNameAtt = null;
try {
agendaMaterialsFileNameAtt = getFileAtt(agendaMaterialsFileNameStr, fileMap, count);
agendaMaterialsFileNameAtt = getFileAtt("议题材料",agendaMaterialsFileNameStr, fileMap, count);
} catch (Exception e) {
return Result.error(e.getMessage());
}
if (StringUtils.isNotBlank(agendaMaterialsFileNameAtt)) {
meetingTopic.setAgendaMaterials(agendaMaterialsFileNameAtt);
}
meetingTopic.setReporter(dataMap.get("汇报人"));
meetingTopic.setReportingUnit(dataMap.get("汇报单位"));
meetingTopic.setAgendaContent(dataMap.get("议题主要内容"));
if (StringUtils.isNotBlank(dataMap.get("*汇报人"))) {
meetingTopic.setReporter(dataMap.get("*汇报"));
} else {
return Result.error(""+ (count+1) +"行汇报人不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*汇报单位"))) {
meetingTopic.setReportingUnit(dataMap.get("*汇报单位"));
} else {
return Result.error(""+ (count+1) +"行汇报单位不能为空");
}
if (StringUtils.isNotBlank(dataMap.get("*议题主要内容"))) {
meetingTopic.setAgendaContent(dataMap.get("*议题主要内容"));
} else {
return Result.error(""+ (count+1) +"行议题主要内容不能为空");
}
meetingTopicList.add(meetingTopic);
count++;
} else {
@@ -438,16 +482,16 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
String agendaMaterialsFileNameStr = dataMap.get("议题材料");
String agendaMaterialsFileNameAtt = null;
try {
agendaMaterialsFileNameAtt = getFileAtt(agendaMaterialsFileNameStr, fileMap, count);
agendaMaterialsFileNameAtt = getFileAtt("议题材料",agendaMaterialsFileNameStr, fileMap, count);
} catch (Exception e) {
return Result.error(e.getMessage());
}
if (StringUtils.isNotBlank(agendaMaterialsFileNameAtt)) {
meetingTopic.setAgendaMaterials(agendaMaterialsFileNameAtt);
}
meetingTopic.setReporter(dataMap.get("汇报人"));
meetingTopic.setReportingUnit(dataMap.get("汇报单位"));
meetingTopic.setAgendaContent(dataMap.get("议题主要内容"));
meetingTopic.setReporter(dataMap.get("*汇报人"));
meetingTopic.setReportingUnit(dataMap.get("*汇报单位"));
meetingTopic.setAgendaContent(dataMap.get("*议题主要内容"));
meetingTopicList.add(meetingTopic);
count++;
}
@@ -569,7 +613,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
}
public String getFileAtt(String fileNameStr, Map<String, File> fileMap, int count) throws Exception {
public String getFileAtt(String fieldName, String fileNameStr, Map<String, File> fileMap, int count) throws Exception {
if (fileNameStr != null) {
List<String> fileAttList = new ArrayList<>();
for (String meetingMinutesFileName : fileNameStr.split(",")) {
@@ -579,17 +623,17 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
if (lastName.equals("pdf") || lastName.equals("ppt") || lastName.equals("pptx") || lastName.equals("doc") || lastName.equals("docx")) {
File file1 = fileMap.get(meetingMinutesFileName);
if (file1 == null) {
throw new Exception("会议纪要中第" + (count+1) +"" + meetingMinutesFileName + "文件不存在,请上传pdf/ppt/pptx/doc/docx格式的附件");
throw new Exception(fieldName + "中第" + (count+1) +"" + meetingMinutesFileName + "文件不存在,请上传pdf/ppt/pptx/doc/docx格式的附件");
}
AttFileVo attFileVo = attFileEOService.saveFileInfo(file1);
if (StringUtils.isNotBlank(attFileVo.getId())) {
fileAttList.add(attFileVo.getAttId());
}
} else {
throw new Exception("会议纪要中第" + (count+1) +"" + meetingMinutesFileName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
throw new Exception(fieldName + "中第" + (count+1) +"" + meetingMinutesFileName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
}
} else {
throw new Exception("会议纪要中第" + (count+1) +"" + meetingMinutesFileName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
throw new Exception(fieldName + "中第" + (count+1) +"" + meetingMinutesFileName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
}
}
return String.join(",", fileAttList);
@@ -46,7 +46,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "一级资料类别名称")
// @TableField(exist = false)
@Excel(name = "1级资料分类", orderNum = "0")
@Excel(name = "*1级资料分类", orderNum = "0")
private String firstTypeName;
/**
@@ -61,7 +61,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "二级资料类别名称")
// @TableField(exist = false)
@Excel(name = "2级资料分类", orderNum = "1")
@Excel(name = "*2级资料分类", orderNum = "1")
private String secondTypeName;
/**
@@ -76,7 +76,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "三级资料类别名称")
// @TableField(exist = false)
@Excel(name = "3级资料分类", orderNum = "2")
@Excel(name = "*3级资料分类", orderNum = "2")
private String thirdTypeName;
/**
@@ -91,7 +91,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "四级资料类别名称")
// @TableField(exist = false)
@Excel(name = "4级资料分类", orderNum = "3")
@Excel(name = "*4级资料分类", orderNum = "3")
private String fourthTypeName;
/**
@@ -99,7 +99,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "资料名称")
@TableField(value = "NAME")
@Excel(name = "资料名称", orderNum = "4")
@Excel(name = "*资料名称", orderNum = "4")
private String name;
/**
@@ -107,7 +107,7 @@ public class SarLawsInformation extends BasePage implements Serializable {
*/
@ApiModelProperty(value = "资料归属部门")
@TableField(value = "DEPARTMENT")
@Excel(name = "资料归属部门", orderNum = "5")
@Excel(name = "*资料归属部门", orderNum = "5")
private String department;
/**
@@ -499,11 +499,14 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
// 去除空数据
List<SarLawsInformation> sarLawsInformationListNew = new ArrayList<>();
for (SarLawsInformation sarLawsInformation : sarLawsInformationList) {
if (StringUtils.isNotBlank(sarLawsInformation.getName())) {
if (StringUtils.isBlank(sarLawsInformation.getName())) {
sarLawsInformationListNew.add(sarLawsInformation);
}
}
for (SarLawsInformation sarLawsInformation : sarLawsInformationListNew){
if (StringUtils.isBlank(sarLawsInformation.getDepartment())) {
return Result.error("" + index + "条记录的资料归属部门不能为空");
}
// 把excel表中的类别名转换为类别编号,并对类别名做检测
if (StringUtils.isNotBlank(sarLawsInformation.getFirstTypeName())) {
List<String> firstTypeCodeList = new ArrayList<>();
@@ -518,6 +521,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
}
}
sarLawsInformation.setFirstType(String.join(",", firstTypeCodeList));
}else {
return Result.error("" + index + "条记录的1级资料分类不能为空");
}
if (StringUtils.isNotBlank(sarLawsInformation.getSecondTypeName())) {
List<String> secondTypeCodeList = new ArrayList<>();
@@ -532,6 +537,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
}
}
sarLawsInformation.setSecondType(String.join(",", secondTypeCodeList));
}else {
return Result.error("" + index + "条记录的2级资料分类不能为空");
}
if (StringUtils.isNotBlank(sarLawsInformation.getThirdTypeName())) {
List<String> thirdTypeCodeList = new ArrayList<>();
@@ -546,6 +553,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
}
}
sarLawsInformation.setThirdType(String.join(",", thirdTypeCodeList));
}else {
return Result.error("" + index + "条记录的3级资料分类不能为空");
}
if (StringUtils.isNotBlank(sarLawsInformation.getFourthTypeName())) {
List<String> fourthTypeCodeList = new ArrayList<>();
@@ -560,6 +569,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl<SarLawsInformatio
}
}
sarLawsInformation.setFourthType(String.join(",", fourthTypeCodeList));
} else {
return Result.error("" + index + "条记录的4级资料分类不能为空");
}
String informationFileAtt = null;
try {
@@ -30,13 +30,13 @@ public class SarLawsTopicVO extends BasePage {
/**
* 课题名称
*/
@Excel(name = "课题名称", orderNum = "0", type = 1, needMerge = true)
@Excel(name = "*课题名称", orderNum = "0", type = 1, needMerge = true)
private String topicName;
/**
* 课题承办单位
*/
@Excel(name = "课题承办单位", orderNum = "1",type = 1, needMerge = true)
@Excel(name = "*课题承办单位", orderNum = "1",type = 1, needMerge = true)
private String organizer;
/**
@@ -56,7 +56,7 @@ public class SarLawsTopicVO extends BasePage {
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "启动时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true)
@Excel(name = "*启动时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true)
private Date startTime;
/**
@@ -150,10 +150,19 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
@Transactional
@Override
public Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (StringUtils.isBlank(lawsTopic.getId())) {
return false;
}
SarLawsTopic lawsTopicInfoDB = getLawsTopicInfo(lawsTopic.getId());
log.error("====================新的================" + sdf.format(lawsTopic.getStartTime()));
log.error("====================旧的================" + sdf.format(lawsTopicInfoDB.getStartTime()));
if (lawsTopic.getCloseTime()!= null) {
log.error("====================新的================" + sdf.format(lawsTopic.getCloseTime()));
}
if (lawsTopicInfoDB.getCloseTime() != null) {
log.error("====================旧的================" + sdf.format(lawsTopicInfoDB.getCloseTime()));
}
List<String> compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic);
if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) {
return true;
@@ -359,6 +368,12 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
// 存入数据库
SarLawsTopic sarLawsTopic = new SarLawsTopic();
BeanUtils.copyProperties(lawsTopicVO,sarLawsTopic);
if (StringUtils.isBlank(sarLawsTopic.getOrganizer())) {
return Result.error("" + index + "条记录的课题承办单位不能为空");
}
if (sarLawsTopic.getStartTime() == null) {
return Result.error("" + index + "条记录的启动时间不能为空");
}
if (sarLawsTopic.getStartTime() != null && sarLawsTopic.getCloseTime() != null) {
sarLawsTopic.setTopicStatus("已结题");
} else {
@@ -65,15 +65,15 @@ public class FieldConvertUtil {
public static String exportFieldNamesEsRevisePlan = "企标类别,企标编号,企标名称,计划状态,制修订类型,起草人,内部评审责任人,技术委员会评审负责人,计划标准初稿完成时间,计划标准发布时间,起草责任单位,实际标准发布时间,质量评分";
// 内外部会议 表头
public static String exportFieldNamesInsideOutsideMeeting = "会议名称,课题名称,会议主办单位,会议时间,会议地点,参会人员,会议纪要,会议主要内容,一级会议类别,二级会议类";
public static String exportFieldNamesInsideOutsideMeeting = "*会议名称,课题名称,*会议主办单位,*会议时间,*会议地点,*参会人员,会议纪要,*会议主要内容,*一级会议分类,*二级会议";
// 内外部会议关联表 表头
public static String exportFieldNamesMeetingTopic = "议题名称,议题材料,汇报人,汇报单位,议题主要内容";
public static String exportFieldNamesMeetingTopic = "*议题名称,议题材料,*汇报人,*汇报单位,*议题主要内容";
// 政策法规资料 表头
public static String exportFieldLawsInformation = "1级资料分类,2级资料分类,3级资料分类,4级资料分类,资料名称,资料归属部门,作者,资料说明,资料文件";
public static String exportFieldLawsInformation = "*1级资料分类,*2级资料分类,*3级资料分类,*4级资料分类,*资料名称,*资料归属部门,作者,资料说明,资料文件";
// 政策课题 表头
public static String exportFieldLawsTopic = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元),协议,课题组会议列表,课题组研究方案,课题组研究成果,课题组其他,课题组会议资料,课题组联系方式,内部立项报告,内部研究方案,内部会议资料,内部研究成果,内部其他,内部联系方式";
public static String exportFieldLawsTopic = "*课题名称,*课题承办单位,课题指导单位,课题参与单位,*启动时间,结题时间,课题费用(万元),协议,课题组会议列表,课题组研究方案,课题组研究成果,课题组其他,课题组会议资料,课题组联系方式,内部立项报告,内部研究方案,内部会议资料,内部研究成果,内部其他,内部联系方式";
// 政策课题关联表 表头
public static String exportFieldLawsTopicRelation = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容,姓名,单位,电话,邮箱,身份,姓名,单位,电话,邮箱,身份";
@@ -101,16 +101,24 @@ public class FieldConvertUtil {
public static String exportInsideOutsideMeetingDesc ="填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.会议分类按照系统下拉菜单中的分类填写\n" +
"3.会议议题如果存在多条,则在下面以此填写,新的内外部会议另起一行填写";
"2.所有带*号的字段必须填写\n" +
"3.会议分类按照系统中的分类填写\n" +
"4.发布日期,企标实施日期字段为年-月-日格式,必须精确到日,例如(2023-04-01)\n" +
"5.会议议题如果存在多条,则在下面以此填写,新的内外部会议另起一行填写 \n" +
"6.会议纪要,议题材料为附件文件,需要放在Excel文档同级目录中";
public static String exportLawsInformationDesc = "填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.资料分类按照系统下拉菜单中的分类填写\n";
"2.所有带*号的字段必须填写\n" +
"3.资料分类按照系统中的分类填写\n" +
"4.资料文件为附件文件,需要放在Excel文档同级目录中";
public static String exportLawsTopicDesc = "填写说明\n" +
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
"2.课题组会议、课题组联系方式、内部联系方式如果存在多条,则在下面一次填写,新的课题组会议、课题组联系方式、内部联系方式在下面依次填写";
"2.所有带*号的字段必须填写 \n" +
"3.启动时间,结题时间字段为年-月-日格式,必须精确到日,例如(2023-12-01)\n" +
"4.课题组会议、课题组联系方式、内部联系方式如果存在多条,则在下面一行填写,新的课题组会议、课题组联系方式、内部联系方式在下面依次填写 \n" +
"5.协议,研究方案,研究成果,其他,会议资料等为附件文件,需要放在Excel文档同级目录中";
public static String exportFieldName = "*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,";
@@ -126,7 +126,12 @@
</choose>
</select>
<select id="queryMeetingById" resultMap="BaseResultMap">
select <include refid="Base_Column_Join_MeetingTopic_List" />
select
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 as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
mt.AGENDA_CONTENT,
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME
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=",">
@@ -135,7 +140,12 @@
order by iom.MEETING_NAME
</select>
<select id="queryAllMeeting" resultMap="BaseResultMap">
select <include refid="Base_Column_Join_MeetingTopic_List" />
select
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 as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT,
mt.AGENDA_CONTENT,
iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME
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" />