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

This commit is contained in:
wxyclub
2023-11-30 10:12:32 +08:00
parent b859379639
commit 1fd9413da0
2 changed files with 13 additions and 3 deletions
@@ -117,7 +117,7 @@ public class SarLawsTopic implements Serializable {
/** /**
* 课题组研究方案 * 课题组研究方案
*/ */
@CompareField(fieldName = "researchPlan") @CompareField(fieldName = "课题研究方案")
@ApiModelProperty(value = "课题研究方案") @ApiModelProperty(value = "课题研究方案")
@TableField(value = "RESEARCH_PLAN") @TableField(value = "RESEARCH_PLAN")
private String researchPlan; private String researchPlan;
@@ -557,7 +557,17 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
} }
// 获取字段名称 // 获取字段名称
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0]; CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];
changes.add(annotationsByType.fieldName() + "\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\""); if (StringUtils.isBlank(String.join(",",oldFileNameList))) {
oldValue = "";
}else {
oldValue = String.join(",",oldFileNameList);
}
if (StringUtils.isBlank(String.join(",",fileNameList))) {
newValue = "";
}else {
newValue = String.join(",",fileNameList);
}
changes.add(annotationsByType.fieldName() + "\"" + oldValue + "\"改为\"" + newValue + "\"");
// 对比列表字段 // 对比列表字段
} else if ("meetingList".equals(field.getName())|| "topicContactInformationList".equals(field.getName()) || "insideContactInformationList".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); String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1);
@@ -573,7 +583,7 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
} else { } else {
// 对比其他字段 // 对比其他字段
CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0]; CompareField annotationsByType = field.getAnnotationsByType(CompareField.class)[0];
changes.add(annotationsByType.fieldName() + "\"" + oldValue + "\"改为\"" + newValue + "\""); changes.add(annotationsByType.fieldName() + "\"" + Optional.ofNullable(oldValue).orElse("") + "\"改为\"" + Optional.ofNullable(newValue).orElse("") + "\"");
} }
} }
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {