bug: 78317政策课题修改记录修改

This commit is contained in:
wxyclub
2023-11-13 15:04:10 +08:00
parent b9ff91d5d6
commit ec0c40f7ca
2 changed files with 22 additions and 6 deletions
@@ -58,7 +58,7 @@ public class SarLawsTopic implements Serializable {
/**
* 开始时间
*/
@ApiModelProperty(value = "开始时间")
@ApiModelProperty(value = "启动时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@TableField(value = "START_TIME")
private Date startTime;
@@ -414,14 +414,16 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
if (!ignoreFieldList.contains(field.getName())) {
try {
field.setAccessible(true);
String oldValue = String.valueOf(field.get(oldLawsTopic));
String newValue = String.valueOf(field.get(newLawsTopic));
Object oldValue = field.get(oldLawsTopic);
Object newValue = field.get(newLawsTopic);
if (!Objects.equals(oldValue, newValue)) {
// 对比文件字段
if (fileAttIdFieldList.contains(field.getName())) {
String oldValueStr = String.valueOf(oldValue);
String newValueStr = String.valueOf(newValue);
List<String> fileNameList = new ArrayList<>();
if (StringUtils.isNotBlank(newValue)) {
String[] split = newValue.split(",");
if (StringUtils.isNotBlank(newValueStr)) {
String[] split = newValueStr.split(",");
for (String attId : split) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
fileNameList.add(fileInfo.getOldFileName());
@@ -447,7 +449,21 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
|| "insideContactInformationList".equals(field.getName())) {
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "被变更");
} else {
} else if ("startTime".equals(field.getName()) || "closeTime".equals(field.getName())) {
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String oldDateStr = null;
String newDateStr = null;
if (newValue != null) {
Date oldDate = (Date) newValue;
oldDateStr = sdf.format(oldDate);
}
if (oldValue!= null) {
Date newDate = (Date) oldValue;
newDateStr = sdf.format(newDate);
}
changes.add(annotationsByType.value() + "\"" + oldDateStr + "\"改为\"" + newDateStr + "\"");
}else {
// 对比其他字段
ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0];
changes.add(annotationsByType.value() + "\"" + oldValue + "\"改为\"" + newValue + "\"");