fix: 优化bug
This commit is contained in:
parent
b8e8fc5eaf
commit
e3e3bd3c88
@ -36,4 +36,7 @@ public class MsOperationLog implements Serializable {
|
|||||||
@TableField("RECORD_ID")
|
@TableField("RECORD_ID")
|
||||||
private String recordId;
|
private String recordId;
|
||||||
|
|
||||||
|
@TableField("OPERATION_TYPE")
|
||||||
|
private String operationType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ public class EngVmsstbprptVo implements Serializable {
|
|||||||
private String rvcdFullPath;
|
private String rvcdFullPath;
|
||||||
private String stcd;
|
private String stcd;
|
||||||
private String stnm;
|
private String stnm;
|
||||||
|
private String rstcd;
|
||||||
private String ennm;
|
private String ennm;
|
||||||
private String baseId;
|
private String baseId;
|
||||||
private String baseName;
|
private String baseName;
|
||||||
|
|||||||
@ -287,7 +287,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
if (engInfo == null) {
|
if (engInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"新增电站", source);
|
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"新增", source,"01");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -323,7 +323,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsOperationLog mainLog = buildMainLog(before.getStcd(),"修改电站", source);
|
MsOperationLog mainLog = buildMainLog(before.getStcd(),"修改电站", source,"02");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -360,7 +360,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
if (engInfo == null) {
|
if (engInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"删除电站", source);
|
MsOperationLog mainLog = buildMainLog(engInfo.getStcd(),"删除电站", source,"03");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -390,11 +390,11 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
batchInsertDetails(details);
|
batchInsertDetails(details);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MsOperationLog buildMainLog(String recordId,String remark, String source) {
|
private MsOperationLog buildMainLog(String recordId,String remark, String source,String operationType) {
|
||||||
return buildMainLog(ENG_TABLE_NAME, recordId, remark, source);
|
return buildMainLog(ENG_TABLE_NAME, recordId, remark, source,operationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MsOperationLog buildMainLog(String tableName, String recordId, String remark, String source) {
|
private MsOperationLog buildMainLog(String tableName, String recordId, String remark, String source,String operationType) {
|
||||||
MsOperationLog log = new MsOperationLog();
|
MsOperationLog log = new MsOperationLog();
|
||||||
log.setOperator(resolveOperator());
|
log.setOperator(resolveOperator());
|
||||||
log.setOperateTime(new Date());
|
log.setOperateTime(new Date());
|
||||||
@ -402,12 +402,13 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
log.setRecordId(recordId);
|
log.setRecordId(recordId);
|
||||||
log.setSource(StrUtil.trimToNull(source));
|
log.setSource(StrUtil.trimToNull(source));
|
||||||
log.setRemark(remark);
|
log.setRemark(remark);
|
||||||
|
log.setOperationType(operationType);
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void recordOperationLog(String tableName, String recordId, String operation, String source) {
|
public void recordOperationLog(String tableName, String recordId, String operation, String source) {
|
||||||
MsOperationLog log = buildMainLog(tableName, recordId, operation, source);
|
MsOperationLog log = buildMainLog(tableName, recordId, operation, source,null);
|
||||||
msOperationLogMapper.insert(log);
|
msOperationLogMapper.insert(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,7 +418,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// String recordId = getStcd(before);
|
// String recordId = getStcd(before);
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source,"02");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -457,7 +458,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// String recordId = getStcd(entity);
|
// String recordId = getStcd(entity);
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source,"01");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -489,7 +490,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
}
|
}
|
||||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||||
|
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "新增", source,"01");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -507,7 +508,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
}
|
}
|
||||||
String fieldMeaning = resolveFieldChinese(field);
|
String fieldMeaning = resolveFieldChinese(field);
|
||||||
Object newValue = getFieldValue(field, entity);
|
Object newValue = getFieldValue(field, entity);
|
||||||
|
if(newValue == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||||
fieldMeaning, null, newValue, "新增字段值");
|
fieldMeaning, null, newValue, "新增字段值");
|
||||||
|
|
||||||
@ -525,7 +528,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// String recordId = getStcd(entity);
|
// String recordId = getStcd(entity);
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source,"03");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -560,7 +563,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
}
|
}
|
||||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||||
|
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "修改", source,"02");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -604,7 +607,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
}
|
}
|
||||||
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
Map<String, String> codeToNameFieldMap = buildCodeToNameFieldMap(codeToNameMetaList);
|
||||||
|
|
||||||
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source);
|
MsOperationLog mainLog = buildMainLog(tableName, recordId, "删除", source,"03");
|
||||||
msOperationLogMapper.insert(mainLog);
|
msOperationLogMapper.insert(mainLog);
|
||||||
|
|
||||||
List<MsOperationLogDetail> details = new ArrayList<>();
|
List<MsOperationLogDetail> details = new ArrayList<>();
|
||||||
@ -622,7 +625,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
}
|
}
|
||||||
String fieldMeaning = resolveFieldChinese(field);
|
String fieldMeaning = resolveFieldChinese(field);
|
||||||
Object oldValue = getFieldValue(field, entity);
|
Object oldValue = getFieldValue(field, entity);
|
||||||
|
if(oldValue == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
MsOperationLogDetail detail = buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||||
fieldMeaning, oldValue, null, "删除字段值");
|
fieldMeaning, oldValue, null, "删除字段值");
|
||||||
|
|
||||||
@ -940,7 +945,10 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<MsOperationLogDetail> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MsOperationLogDetail> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(MsOperationLogDetail::getMainId, mainId);
|
wrapper.eq(MsOperationLogDetail::getMainId, mainId)
|
||||||
|
.notIn(MsOperationLogDetail::getFieldCode,
|
||||||
|
"recordUser", "recordTime", "modifyUser", "modifyTime",
|
||||||
|
"isDeleted", "deleteUser", "deleteTime");
|
||||||
return msOperationLogDetailMapper.selectList(wrapper);
|
return msOperationLogDetailMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2219,13 +2219,13 @@ public class ZqMonitorServiceImpl implements ZqMonitorService {
|
|||||||
selectMap.put("rstcd", "t.RSTCD AS rstcd");
|
selectMap.put("rstcd", "t.RSTCD AS rstcd");
|
||||||
selectMap.put("ennm", "eng.ENNM AS ennm");
|
selectMap.put("ennm", "eng.ENNM AS ennm");
|
||||||
selectMap.put("baseId", "eng.BASE_ID AS baseId");
|
selectMap.put("baseId", "eng.BASE_ID AS baseId");
|
||||||
selectMap.put("baseName", "hb.BASENAME AS baseName");
|
// selectMap.put("baseName", "hb.BASENAME AS baseName");
|
||||||
selectMap.put("hbrvcd", "eng.HBRVCD AS hbrvcd");
|
selectMap.put("hbrvcd", "eng.HBRVCD AS hbrvcd");
|
||||||
selectMap.put("hbrvcdName", "hbrv.HBRVNM AS hbrvcdName");
|
// selectMap.put("hbrvcdName", "hbrv.HBRVNM AS hbrvcdName");
|
||||||
selectMap.put("rvcd", "eng.RVCD AS rvcd");
|
selectMap.put("rvcd", "eng.RVCD AS rvcd");
|
||||||
selectMap.put("rvcdName", "rv.RVNM AS rvcdName");
|
// selectMap.put("rvcdName", "rv.RVNM AS rvcdName");
|
||||||
selectMap.put("addvcd", "eng.ADDVCD AS addvcd");
|
selectMap.put("addvcd", "eng.ADDVCD AS addvcd");
|
||||||
selectMap.put("addvcdName", "addv.ADDVNM AS addvcdName");
|
// selectMap.put("addvcdName", "addv.ADDVNM AS addvcdName");
|
||||||
selectMap.put("fhstcd", "t.FHSTCD AS fhstcd");
|
selectMap.put("fhstcd", "t.FHSTCD AS fhstcd");
|
||||||
selectMap.put("ispro", "t.ISPRO AS ispro");
|
selectMap.put("ispro", "t.ISPRO AS ispro");
|
||||||
selectMap.put("project", "t.PROJECT AS project");
|
selectMap.put("project", "t.PROJECT AS project");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user