add: 内外部会议详情

This commit is contained in:
wxyclub
2023-10-27 16:13:43 +08:00
parent 1c082fc9b6
commit c342f88f2c
5 changed files with 197 additions and 5 deletions
@@ -1,5 +1,6 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
@@ -38,7 +39,10 @@ public class InsideOutsideMeeting extends BaseEntity {
@TableField("MEETING_NAME")
private String meetingName;
@ApiModelProperty(value = "课题名称,可通过调取功能从政策课题模块中获取")
/**
* 课题名称,可通过调取功能从政策课题模块中获取
*/
@ApiModelProperty(value = "课题名称")
@TableField("TOPIC_NAME")
private String topicName;
@@ -63,6 +67,10 @@ public class InsideOutsideMeeting extends BaseEntity {
@TableField("MEETING_MINUTES")
private String meetingMinutes;
@ApiModelProperty(value = "会议纪要文件列表")
@TableField(exist = false)
private List<AttFileEO> meetingMinutesList;
@ApiModelProperty(value = "会议主要内容")
@TableField("MEETING_CONTENT")
private String meetingContent;
@@ -71,6 +79,9 @@ public class InsideOutsideMeeting extends BaseEntity {
@TableField("FIRST_MEETING_TYPE")
private String firstMeetingType;
@ApiModelProperty(value = "1级会议类别名称")
private String firstMeetingTypeName;
@ApiModelProperty(value = "2级会议类别")
@TableField("SECOND_MEETING_TYPE")
private String secondMeetingType;
@@ -79,7 +90,10 @@ public class InsideOutsideMeeting extends BaseEntity {
@TableField(exist = false)
private List<MeetingTopic> meetingTopicList;
@ApiModelProperty(value = "逻辑删除,0可用,1不可用")
/**
* 逻辑删除,0可用,1不可用
*/
@ApiModelProperty(value = "逻辑删除")
@TableField("VALID_FLAG")
private Integer validFlag;
@@ -1,9 +1,8 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import com.adc.da.att.entity.AttFileEO;
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;
@@ -39,6 +38,8 @@ public class InsideOutsideMeetingVO extends BasePage {
private String meetingMinutes;
private List<AttFileEO> meetingMinutesList;
private String meetingContent;
private String firstMeetingType;
@@ -1,12 +1,17 @@
package com.adc.da.slrs.InsideOntSideMeeting.service;
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author tjzdw
* @description
* @date 2023/10/13
*/
public interface MeetingTopicService extends IService<MeetingTopic> {
public List<String> compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic);
}
@@ -1,5 +1,7 @@
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.common.FileUnZip;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
@@ -9,10 +11,13 @@ 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.slrs.sarLawsInformation.entity.SarLawsInformation;
import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService;
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 io.swagger.annotations.ApiModelProperty;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
@@ -25,6 +30,9 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -40,6 +48,12 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
@Resource
private MeetingTopicService meetingTopicService;
@Resource
private IAttFileEOService attFileEOService;
@Resource
private ITsDicTypeService dicTypeService;
@Value("${file.path}")
private String filePath;//文件存储路径
@@ -47,6 +61,14 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
public InsideOutsideMeeting getMeetingInfo(String meetingId){
InsideOutsideMeeting insideOutSideMeeting = this.baseMapper.selectById(meetingId);
if (insideOutSideMeeting != null) {
if (StringUtils.isNotBlank(insideOutSideMeeting.getMeetingMinutes())) {
List<AttFileEO> meetingMinutesList = new ArrayList<>();
for (String attId : insideOutSideMeeting.getMeetingMinutes().split(",")) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
meetingMinutesList.add(fileInfo);
}
insideOutSideMeeting.setMeetingMinutesList(meetingMinutesList);
}
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
List<MeetingTopic> meetingTopicList = meetingTopicService.list(wrapper);
@@ -98,7 +120,18 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
@Override
public List<InsideOutsideMeetingVO> queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) {
return this.baseMapper.queryAllMeeting(insideOutsideMeetingVO);
List<InsideOutsideMeetingVO> insideOutsideMeetingVOList = this.baseMapper.queryAllMeeting(insideOutsideMeetingVO);
for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) {
if (StringUtils.isNotBlank(meetingVO.getMeetingMinutes())) {
List<AttFileEO> meetingMinutesList = new ArrayList<>();
for (String attId : meetingVO.getMeetingMinutes().split(",")) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
meetingMinutesList.add(fileInfo);
}
meetingVO.setMeetingMinutesList(meetingMinutesList);
}
}
return insideOutsideMeetingVOList;
}
@Override
@@ -320,4 +353,80 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
}
return resultlist;
}
/**
* 比较两个InsideOutSideMeeting 对象
* @param oldMeeting 数据库中存储的对象
* @param newMeeting 更新后的对象
* @return 差异
*/
public List<String> compareInsideOutsideMeeting(InsideOutsideMeeting oldMeeting, InsideOutsideMeeting newMeeting) {
List<String> changes = new ArrayList<>();
// 不需要比较的字段
String[] ignoreFields = {"id","validFlag","createTime","modifyTime","meetingTopicList"};
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
// 获取SarLawsInformation类的所有字段
Field[] fields = SarLawsInformation.class.getDeclaredFields();
for (Field field : fields) {
if (!ignoreFieldList.contains(field.getName())) {
try {
field.setAccessible(true);
String oldValue = String.valueOf(field.get(oldMeeting));
String newValue = String.valueOf(field.get(newMeeting));
if (!Objects.equals(oldValue, newValue)) {
if ("firstMeetingType".equals(field.getName()) || "secondMeetingType".equals(field.getName())) {
String typeName = "";
if (StringUtils.isNotBlank(newValue)) {
typeName = dicTypeService.getDicTypeNameByDicCode(newValue);
}
// 获取资料类型名称
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
Object oldTypeName = method.invoke(oldMeeting);
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldTypeName + "\"改为\"" + typeName + "\"");
} else if ("meetingMinutes".equals(field.getName())) {
List<String> fileNameList = new ArrayList<>();
if (StringUtils.isNotBlank(newValue)) {
String[] split = newValue.split(",");
for (String attId : split) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
fileNameList.add(fileInfo.getOldFileName());
}
}
// 获取资料类型名称
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
Object oldTypeName = method.invoke(oldMeeting);
// 获取字段名称
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\"");
}
else if ("meetingTopicList".equals(field.getName())) {
// // 获取会议列表内容
// String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
// Method method = SarLawsInformation.class.getMethod("get" + fieldName);
// List<?> oldMeetingTopicList = (List<?>)method.invoke(oldMeeting);
// List<?> newMeetingTopicList = (List<?>)method.invoke(newMeeting);
// for (Object meetingTopic : oldMeetingTopicList) {
// meetingTopicService.compareMeetingTopic(meetingTopic, oldMeeting);
// }
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldValue + "\"改为\"" + newValue + "\"");
}
else {
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldValue + "\"改为\"" + newValue + "\"");
}
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
// 处理异常
e.printStackTrace();
}
}
}
return changes;
}
}
@@ -1,11 +1,26 @@
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.slrs.InsideOntSideMeeting.dao.MeetingTopicDao;
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
/**
* @author tjzdw
* @description
@@ -13,4 +28,52 @@ import org.springframework.stereotype.Service;
*/
@Service
public class MeetingTopicServiceImpl extends ServiceImpl<MeetingTopicDao, MeetingTopic> implements MeetingTopicService {
@Resource
private IAttFileEOService attFileEOService;
@Override
public List<String> compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic) {
List<String> changes = new ArrayList<>();
// 不需要比较的字段
String[] ignoreFields = {"id","meetingId","validFlag","createTime","modifyTime"};
List<String> ignoreFieldList = Arrays.asList(ignoreFields);
// 获取SarLawsInformation类的所有字段
Field[] fields = SarLawsInformation.class.getDeclaredFields();
for (Field field : fields) {
if (!ignoreFieldList.contains(field.getName())) {
try {
field.setAccessible(true);
String oldValue = String.valueOf(field.get(oldTopic));
String newValue = String.valueOf(field.get(newTopic));
if (!Objects.equals(oldValue, newValue)) {
if ("agendaMaterials".equals(field.getName())) {
List<String> fileNameList = new ArrayList<>();
if (StringUtils.isNotBlank(newValue)) {
String[] split = newValue.split(",");
for (String attId : split) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
fileNameList.add(fileInfo.getOldFileName());
}
}
// 获取文件名称
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name");
Object oldTypeName = method.invoke(oldTopic);
// 获取字段名称
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\"");
} else {
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldValue + "\"改为\"" + newValue + "\"");
}
}
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
// 处理异常
e.printStackTrace();
}
}
}
return changes;
}
}