refactor(ruoyi):优化订单版本号输入和 Excel导入数据处理

- 将订单版本号输入类型从 text改为 number,限制在 0 到 100 之间
- 优化 Excel 导入时字符串处理逻辑,增加空值判断和去空格操作
master
chenhao 2025-05-28 09:55:31 +08:00
parent 171ebad572
commit 9567ebc89e
2 changed files with 5 additions and 2 deletions

View File

@ -37,7 +37,7 @@
<div class="form-group">
<label class="col-sm-4 control-label is-required">版本号:</label>
<div class="col-sm-8">
<input name="versionCode" th:field="*{versionCode}" class="form-control" type="text" max="100" min="0" required>
<input name="versionCode" th:field="*{versionCode}" class="form-control" type="number" max="100" min="0" required>
</div>
</div>
</div>

View File

@ -426,6 +426,9 @@ public class ExcelUtil<T>
if (String.class == fieldType)
{
String s = Convert.toStr(val);
if (StringUtils.isNotEmpty(s)) {
s = s.trim();
}
if (StringUtils.endsWith(s, ".0"))
{
val = StringUtils.substringBefore(s, ".0");
@ -439,7 +442,7 @@ public class ExcelUtil<T>
}
else
{
val = Convert.toStr(val);
val = s;
}
}
}