diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index 7edbaff5..208b8f25 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -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 dataExportList = new ArrayList<>(); + for (InsideOutsideMeetingVO data : datas) { + InsideOutsideMeetingExport dataExport = new InsideOutsideMeetingExport(); + BeanUtils.copyProperties(data, dataExport); + if (data.getMeetingTopicList()!= null) { + List 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(); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java index a45c1f00..324b3b84 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java @@ -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; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingExport.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingExport.java new file mode 100644 index 00000000..5cd3a682 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingExport.java @@ -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 meetingTopicList; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index 211f2cc7..734d7dbe 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -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 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 = "会议议题") diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java index 3538e1a1..24e0f273 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java @@ -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 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 = "创建时间") diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopicExport.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopicExport.java new file mode 100644 index 00000000..7b1443bc --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopicExport.java @@ -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; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index cbffcfa3..b5664e4f 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -356,7 +356,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl meetingTopicList = new ArrayList<>(); for (Map dataMap : importDataList) { - String meetingName = dataMap.get("会议名称"); + String meetingName = dataMap.get("*会议名称"); // 如果会议名称为空,则表示该行为会议课题行,是之前会议的会议课题,不提交之前的会议信息。不为空则进入 if (StringUtils.isNotBlank(meetingName)) { // 如果计数器大于0,表示进入了新的会议信息中,提交之前的会议信息 @@ -371,64 +371,108 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl fileMap, int count) throws Exception { + public String getFileAtt(String fieldName, String fileNameStr, Map fileMap, int count) throws Exception { if (fileNameStr != null) { List fileAttList = new ArrayList<>(); for (String meetingMinutesFileName : fileNameStr.split(",")) { @@ -579,17 +623,17 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl 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 firstTypeCodeList = new ArrayList<>(); @@ -518,6 +521,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl secondTypeCodeList = new ArrayList<>(); @@ -532,6 +537,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl thirdTypeCodeList = new ArrayList<>(); @@ -546,6 +553,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fourthTypeCodeList = new ArrayList<>(); @@ -560,6 +569,8 @@ public class SarLawsInformationServiceImpl extends ServiceImpl compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic); if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) { return true; @@ -359,6 +368,12 @@ public class SarLawsTopicServiceImpl extends ServiceImpl