fix: 政策课题修改记录代码修改

This commit is contained in:
wxyclub
2023-11-26 16:55:49 +08:00
parent a700d9c05d
commit f0277ac730
@@ -531,8 +531,10 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
field.setAccessible(true);
Object oldValue = field.get(oldLawsTopic);
Object newValue = field.get(newLawsTopic);
if (oldValue instanceof Date && newValue instanceof Date) {
if (oldValue instanceof Date){
oldValue = sdf.format((Date)oldValue);
}
if( newValue instanceof Date) {
newValue = sdf.format((Date)newValue);
}
if (!Objects.equals(oldValue, newValue)) {
@@ -564,20 +566,17 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];
changes.add(annotationsByType.fieldName() + "\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\"");
// 对比列表字段
} else if ("meetingList".equals(field.getName())) {
} else if ("meetingList".equals(field.getName())|| "topicContactInformationList".equals(field.getName()) || "insideContactInformationList".equals(field.getName())) {
String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
Method method = SarLawsTopic.class.getMethod("get" + fieldName + "List");
Method method = SarLawsTopic.class.getMethod("get" + fieldName);
Object oldInvoke = method.invoke(oldLawsTopic);
Object newInvoke = method.invoke(newLawsTopic);
if (oldInvoke == null && newInvoke == null) {
continue;
List<?> oldList = (List<?>) oldInvoke;
List<?> newList = (List<?>) newInvoke;
if (!isListEqual(oldList, newList)) {
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];
changes.add(annotationsByType.fieldName() + "被变更");
}
List<SarLawsTopicMeeting> oldLawsTopicList = (List<SarLawsTopicMeeting>) oldInvoke;
List<SarLawsTopicMeeting> newLawsTopicList = (List<SarLawsTopicMeeting>) newInvoke;
isListEqual(oldLawsTopicList, newLawsTopicList);
} else if ("topicContactInformationList".equals(field.getName()) || "insideContactInformationList".equals(field.getName())) {
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];
changes.add(annotationsByType.fieldName() + "被变更");
} else {
// 对比其他字段
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];