2025年08月22日 1.1.15 优化参数下发表格前端日志输出

main
gaoshuguang 3 months ago
parent 67222e4e36
commit eba6070033

@ -167,14 +167,14 @@ public class DatabaseUtil {
//数据库连接(连接、账号、密码)
connection = DriverManager.getConnection(url, username, password);
if (!connection.isClosed()) {
log.info("[uuid:{}]{}数据库连接成功", uuid, url);
log.info("[uuid:{}]-{}-{}数据库连接成功",Constant.STR_FRONTEND, uuid, url);
//2.创建statement类对象用来执行SQL语句
statement = connection.createStatement();
//先删除表内数据
log.info("[uuid:{}]先删除{}表内数据", uuid, targetTableName);
log.info("[uuid:{}]-{}-先删除{}表内数据", uuid,Constant.STR_FRONTEND, targetTableName);
statement.executeUpdate(Constant.DELETE_FROM + targetTableName);
if (sqlList != null && sqlList.size() > 0) {
log.info("[uuid:{}]开始执行插入sql语句", uuid);
log.info("[uuid:{}]-{}-开始执行插入sql语句", uuid,Constant.STR_FRONTEND);
for (String sql : sqlList) {
//3.ResultSet类用来存放获取的结果集
//要执行的SQL语句
@ -183,13 +183,13 @@ public class DatabaseUtil {
}
}
log.info("[uuid:{}]执行插入sql语句完成插入数据条数为{}", uuid, count);
log.info("[uuid:{}]-{}-执行插入sql语句完成插入数据条数为{}", uuid,Constant.STR_FRONTEND, count);
}
} catch (ClassNotFoundException e) {
log.error("数据库连接异常{}", e.getMessage(), e);
log.error("{}数据库连接异常{}",Constant.STR_FRONTEND, e.getMessage(), e);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
} catch (SQLException e) {
log.error("sql语句执行失败{}", e.getMessage(), e);
log.error("{}sql语句执行失败{}",Constant.STR_FRONTEND, e.getMessage(), e);
throw new PPException(MessageEnum.sql.getCode(), MessageEnum.sql.getMessage());
} finally {
try {
@ -222,9 +222,9 @@ public class DatabaseUtil {
statement.executeUpdate(impSql);
}
} catch (ClassNotFoundException e) {
log.error("数据库连接异常{}", e.getMessage(), e);
log.error("{}-数据库连接异常{}",Constant.STR_FRONTEND, e.getMessage(), e);
} catch (SQLException e) {
log.error("sql语句执行失败{}", e.getMessage(), e);
log.error("{}-sql语句执行失败{}",Constant.STR_FRONTEND, e.getMessage(), e);
} finally {
try {
if (statement != null) {

@ -52,7 +52,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
@Override
public void manualSwitchDb(Map<String, Object> map) {
String uuid = UuidUtil.getUuid();
log.info("[uuid:{}]-开始手动同步数据库表中数据", uuid);
log.info("[uuid:{}]-{}-开始手动同步数据库表中数据", uuid,Constant.STR_FRONTEND);
List<Integer> ids = (List<Integer>) map.get("ids");
String checkedNodes = JSON.toJSONString(map.get("checkedNodes"));
List<NameTableDcomDec> list = JSON.parseObject(checkedNodes, new TypeReference<List<NameTableDcomDec>>() {
@ -118,7 +118,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
} else {
sqlParam = Constant.SELECT_FROM + source;
}
log.info("[uuid:{}]-开始查询{}--{}数据", uuid, cName, source);
log.info("[uuid:{}]-{}-开始查询{}--{}数据", uuid,Constant.STR_FRONTEND, cName, source);
ExportSqlUtil.initConnection(driverName,
url, username, password);
//List<String> stringList = ExportSqlUtil.executeSQLAndBuildSqlFile("dbo", source, sqlParam);
@ -130,7 +130,7 @@ public class DbSwitchServiceImpl implements DbSwitchService {
//判断当前表名是不是CMS_USERPRMIS_TABLE
if("CMS_USERPRMIS_TABLE".equalsIgnoreCase(source)){
log.info("[uuid:{}]-开始执行CMS_USERPRMIS_TABLE表SQL", uuid);
log.info("[uuid:{}]-{}-开始执行CMS_USERPRMIS_TABLE表SQL", uuid,Constant.STR_FRONTEND);
String impSql="";
if(Constant.STR_ONE.equals(targetDbType)){
impSql= "update CMS_USERPRMIS_TABLE set MENUTYPE=(select convert(varchar,(ISNULL(PRMISFLAG, 1)+1))+'-' from CMS_PRMIS_TABLE where PRMISID=CMS_USERPRMIS_TABLE.PRMISID),ORGTYPE=1 where MENUTYPE is null or MENUTYPE=''";
@ -140,9 +140,9 @@ public class DbSwitchServiceImpl implements DbSwitchService {
DatabaseUtil.updateSql(targetDriver,targetUrl, logName, logPw, impSql);
String publicSql = "UPDATE CMS_USERPRMIS_TABLE SET MENUTYPE = '2-' WHERE MENUTYPE IS NULL";
DatabaseUtil.updateSql(targetDriver,targetUrl, logName, logPw, publicSql);
log.info("[uuid:{}]-执行CMS_USERPRMIS_TABLE表SQL完成", uuid);
log.info("[uuid:{}]-{}-执行CMS_USERPRMIS_TABLE表SQL完成", uuid,Constant.STR_FRONTEND);
}
log.info("[uuid:{}]-同步更新--{}--{}--{}数据完成", uuid, staName, cName, source);
log.info("[uuid:{}]-{}-同步更新--{}--{}--{}数据完成", uuid,Constant.STR_FRONTEND, staName, cName, source);
}
}
}
@ -150,6 +150,6 @@ public class DbSwitchServiceImpl implements DbSwitchService {
}
}
log.info("[uuid:{}]-手动同步数据库表中数据完成", uuid);
log.info("[uuid:{}]-{}-手动同步数据库表中数据完成", uuid,Constant.STR_FRONTEND);
}
}

@ -5,7 +5,7 @@
<meta charset="UTF-8"/>
<title></title>
<script type="module" crossorigin src="./assets/index.46f1e074.js"></script>
<script type="module" crossorigin src="./assets/index.7322a5a7.js"></script>
<link rel="stylesheet" href="./assets/index.a3f8c100.css">
</head>
<body>

@ -28,3 +28,4 @@
23 2025年05月09日 1.1.12 适配达梦数据库
24 2025年06月16日 1.1.13 配置文件UserStaNO增加适配多个分公司编码多个编码用英文,隔开
25 2025年07月10日 1.1.14 优化参数下发页面日志精简打印标识为[FRONTEND],同时参数下发查询查询条件优化
26 2025年08月22日 1.1.15 优化参数下发表格前端日志输出

@ -5,7 +5,7 @@
<meta charset="UTF-8"/>
<title></title>
<script type="module" crossorigin src="./assets/index.46f1e074.js"></script>
<script type="module" crossorigin src="./assets/index.7322a5a7.js"></script>
<link rel="stylesheet" href="./assets/index.a3f8c100.css">
</head>
<body>

@ -191,15 +191,19 @@ export default {
},
//
websocketonmessage(e) {
// this.textarea = this.textarea + "\r\n" + e.data;
const line = e.data;
let line2 = e.data;
// [FRONTEND]
if (line.includes("[FRONTEND]")) {
// [FRONTEND]
line2 = line.replace("[FRONTEND]", "");
if (line.includes('ERROR')) {
line2 = `<p style="color: red;">${line}</p>`
line2 = `<p style="color: red;">${line2}</p>`;
} else {
line2 = `<p>${line}</p>`
line2 = `<p>${line2}</p>`;
}
this.textarea = this.textarea + line2;
}
},
//
websocketonerror(e) {

Loading…
Cancel
Save